@mseva/upyog-ui-module-ads 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e,t=require("@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"),a=require("react-query"),r=require("react-hook-form");const u=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},s=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},c=[],d=()=>{var e,n,a,r,u,s;const{path:d,...p}=o.useRouteMatch(),v=(i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("ADSCreate")),f=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSMyApplications"),m=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ADSApplicationDetails");return l.createElement("span",{className:"ads-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(h=c)&&(h=[]),h.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:d+"/bookad",component:v}),l.createElement(t.PrivateRoute,{path:d+"/myBookings",component:f}),l.createElement(t.PrivateRoute,{path:d+"/application/:acknowledgementIds/:tenantId",component:m}))));var h},p=[{head:"ES_TITILE_APPLICANT_DETAILS",body:[{route:"searchads",component:"ADSSearch",nextStep:"info",key:"adslist",type:"component"},{route:"info",component:"ADSRequiredDoc",nextStep:"applicant-details",key:"Documents",type:"component"},{route:"applicant-details",component:"ADSCitizenDetails",withoutLabel:!0,key:"applicant",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{header:"APPLICANT_PERSONAL_DETAILS",submitBarLabel:"ADS_COMMON_NEXT"}},{route:"address-details",component:"ADSAddress",withoutLabel:!0,key:"address",type:"component",nextStep:"document-details",hideInEmployee:!0,isMandatory:!0,texts:{header:"APPLICANT_ADDRESS_DETAILS",submitBarLabel:"ADS_COMMON_NEXT"}},{route:"document-details",component:"ADSDocumentDetails",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"ADS_COMMON_NEXT"}}]}];var v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e,t){return e(t={exports:{}},t.exports),t.exports}f(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:v,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)},a=n.push,r=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),v={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},h=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var l,i,o=(n=n||h).createElement("script");if(o.text=e,t)for(l in g)(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 S=function(e,t){return new S.fn.init(e,t)};function _(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!f(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,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=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.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(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.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:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,l,i,o,a=arguments[0]||{},r=1,u=arguments.length,s=!1;for("boolean"==typeof a&&(s=a,a=arguments[r]||{},r++),"object"==typeof a||f(a)||(a={}),r===u&&(a=this,r--);r<u;r++)if(null!=(e=arguments[r]))for(t in e)l=e[t],"__proto__"!==t&&a!==l&&(s&&l&&(S.isPlainObject(l)||(i=Array.isArray(l)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(s,o,l)):void 0!==l&&(a[t]=l));return a},S.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){E(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(_(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&&(_(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:r.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,a=!n;i<o;i++)!t(e[i],i)!==a&&l.push(e[i]);return l},map:function(e,t,n){var l,i,a=0,r=[];if(_(e))for(l=e.length;a<l;a++)null!=(i=t(e[a],a,n))&&r.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&r.push(i);return o(r)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.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,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S="sizzle"+1*new Date,_=e.document,b=0,A=0,D=ue(),C=ue(),T=ue(),x=ue(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],O=I.pop,L=I.push,P=I.push,R=I.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(B+"+","g"),W=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),z=new RegExp("^"+B+"*,"+B+"*"),$=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),K=new RegExp(B+"|>"),V=new RegExp(H),q=new RegExp("^"+F+"$"),G={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\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()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(I=R.call(_.childNodes),_.childNodes)}catch(e){P={apply:I.length?function(e,t){L.apply(e,R.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function re(e,t,l,i){var o,r,s,c,d,f,g,E=t&&t.ownerDocument,_=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return l;if(!i&&(p(t),t=t||v,m)){if(11!==_&&(d=Q.exec(e)))if(o=d[1]){if(9===_){if(!(s=t.getElementById(o)))return l;if(s.id===o)return l.push(s),l}else if(E&&(s=E.getElementById(o))&&y(t,s)&&s.id===o)return l.push(s),l}else{if(d[2])return P.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return P.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!x[e+" "]&&(!h||!h.test(e))&&(1!==_||"object"!==t.nodeName.toLowerCase())){if(g=e,E=t,1===_&&(K.test(e)||$.test(e))){for((E=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,ie):t.setAttribute("id",c=S)),r=(f=a(e)).length;r--;)f[r]=(c?"#"+c:":scope")+" "+ye(f[r]);g=f.join(",")}try{return P.apply(l,E.querySelectorAll(g)),l}catch(t){x(e,!0)}finally{c===S&&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[S]=!0,e}function ce(e){var t=v.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ve(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(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&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(l[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=re.support={},o=re.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!Y.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=re.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:_;return a!=v&&9===a.nodeType&&a.documentElement?(f=(v=a).documentElement,m=!o(v),_!=v&&(i=v.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return f.appendChild(e).appendChild(v.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(v.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(v.getElementsByClassName),n.getById=ce(function(e){return f.appendChild(e).id=S,!v.getElementsByName||!v.getElementsByName(S).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&&m){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&&m){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&&m)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(v.querySelectorAll))&&(ce(function(e){var t;f.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=v.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=v.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(E=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=E.call(e,"*"),E.call(e,"[s!='']:x"),g.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(f.compareDocumentPosition),y=t||J.test(f.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},N=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==v||e.ownerDocument==_&&y(_,e)?-1:t==v||t.ownerDocument==_&&y(_,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,a=[e],r=[t];if(!i||!o)return e==v?-1:t==v?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)r.unshift(n);for(;a[l]===r[l];)l++;return l?pe(a[l],r[l]):a[l]==_?-1:r[l]==_?1:0},v):v},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&m&&!x[t+" "]&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var l=E.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){x(t,!0)}return re(t,v,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!=v&&p(e),y(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=v&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&w.call(l.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},re.escape=function(e){return(e+"").replace(le,ie)},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,l=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),d){for(;t=e[o++];)t===e[o]&&(i=l.push(o));for(;i--;)e.splice(l[i],1)}return c=null,e},i=re.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=re.selectors={cacheLength:50,createPseudo:se,match:G,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]||re.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]&&re.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(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=D[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&D(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=re.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),a="last"!==e.slice(-4),r="of-type"===t;return 1===l&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,v,f,m=o!==a?"nextSibling":"previousSibling",h=t.parentNode,g=r&&t.nodeName.toLowerCase(),E=!u&&!r,y=!1;if(h){if(o){for(;m;){for(p=t;p=p[m];)if(r?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?h.firstChild:h.lastChild],a&&E){for(y=(v=(s=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=v&&h.childNodes[v];p=++v&&p&&p[m]||(y=v=0)||f.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[b,v,y];break}}else if(E&&(y=v=(s=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===y)for(;(p=++v&&p&&p[m]||(y=v=0)||f.pop())&&((r?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++y||(E&&((c=(d=p[S]||(p[S]={}))[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()]||re.error("unsupported pseudo: "+e);return i[S]?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),a=o.length;a--;)e[l=k(e,o[a])]=!(n[l]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],l=r(e.replace(W,"$1"));return l[S]?se(function(e,t,n,i){for(var o,a=l(e,null,i,[]),r=e.length;r--;)(o=a[r])&&(e[r]=!(t[r]=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 re(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 q.test(e||"")||re.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?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===f},focus:function(e){return e===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=ve(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=fe(t);function Ee(){}function ye(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function Se(e,t,n){var l=t.dir,i=t.next,o=i||l,a=n&&"parentNode"===o,r=A++;return t.first?function(t,n,i){for(;t=t[l];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var s,c,d,p=[b,r];if(u){for(;t=t[l];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||a)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[o])&&s[0]===b&&s[1]===r)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function _e(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,a=[],r=0,u=e.length,s=null!=t;r<u;r++)(o=e[r])&&(n&&!n(o,l,i)||(a.push(o),s&&t.push(r)));return a}function Ae(e,t,n,l,i,o){return l&&!l[S]&&(l=Ae(l)),i&&!i[S]&&(i=Ae(i,o)),se(function(o,a,r,u){var s,c,d,p=[],v=[],f=a.length,m=o||function(e,t,n){for(var l=0,i=t.length;l<i;l++)re(e,t[l],n);return n}(t||"*",r.nodeType?[r]:r,[]),h=!e||!o&&t?m:be(m,p,e,r,u),g=n?i||(o?e:f||l)?[]:a:h;if(n&&n(h,g,r,u),l)for(s=be(g,v),l(s,[],r,u),c=s.length;c--;)(d=s[c])&&(g[v[c]]=!(h[v[c]]=d));if(o){if(i||e){if(i){for(s=[],c=g.length;c--;)(d=g[c])&&s.push(h[c]=d);i(null,g=[],s,u)}for(c=g.length;c--;)(d=g[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(a[s]=d))}}else g=be(g===a?g.splice(f,g.length):g),i?i(null,a,g,u):P.apply(a,g)})}function De(e){for(var t,n,i,o=e.length,a=l.relative[e[0].type],r=a||l.relative[" "],u=a?1:0,c=Se(function(e){return e===t},r,!0),d=Se(function(e){return k(t,e)>-1},r,!0),p=[function(e,n,l){var i=!a&&(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=[Se(_e(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[S]){for(i=++u;i<o&&!l.relative[e[i].type];i++);return Ae(u>1&&_e(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<i&&De(e.slice(u,i)),i<o&&De(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return _e(p)}return Ee.prototype=l.filters=l.pseudos,l.setFilters=new Ee,a=re.tokenize=function(e,t){var n,i,o,a,r,u,s,c=C[e+" "];if(c)return t?0:c.slice(0);for(r=e,u=[],s=l.preFilter;r;){for(a in n&&!(i=z.exec(r))||(i&&(r=r.slice(i[0].length)||r),u.push(o=[])),n=!1,(i=$.exec(r))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),r=r.slice(n.length)),l.filter)!(i=G[a].exec(r))||s[a]&&!(i=s[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),r=r.slice(n.length));if(!n)break}return t?r.length:r?re.error(e):C(e,u).slice(0)},r=re.compile=function(e,t){var n,i=[],o=[],r=T[e+" "];if(!r){for(t||(t=a(e)),n=t.length;n--;)(r=De(t[n]))[S]?i.push(r):o.push(r);(r=T(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,r,u,c){var d,f,h,g=0,E="0",y=o&&[],S=[],_=s,A=o||i&&l.find.TAG("*",c),D=b+=null==_?1:Math.random()||.1,C=A.length;for(c&&(s=a==v||a||c);E!==C&&null!=(d=A[E]);E++){if(i&&d){for(f=0,a||d.ownerDocument==v||(p(d),r=!m);h=e[f++];)if(h(d,a||v,r)){u.push(d);break}c&&(b=D)}n&&((d=!h&&d)&&g--,o&&y.push(d))}if(g+=E,n&&E!==g){for(f=0;h=t[f++];)h(y,S,a,r);if(o){if(g>0)for(;E--;)y[E]||S[E]||(S[E]=O.call(u));S=be(S)}P.apply(u,S),c&&!o&&S.length>0&&g+t.length>1&&re.uniqueSort(u)}return c&&(b=D,s=_),y};return n?se(o):o}(o,i))).selector=e}return r},u=re.select=function(e,t,n,i){var o,u,s,c,d,p="function"==typeof e&&e,v=!i&&a(e=p.selector||e);if(n=n||[],1===v.length){if((u=v[0]=v[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&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=G.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)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return P.apply(n,i),n;break}}return(p||r(e,v))(i,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=S.split("").sort(N).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(v.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),re}(e);S.find=b,S.expr=b.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=b.uniqueSort,S.text=b.getText,S.isXMLDoc=b.isXML,S.contains=b.contains,S.escapeSelector=b.escape;var A=function(e,t,n){for(var l=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;l.push(e)}return l},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=S.expr.match.needsContext;function T(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var x=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return f(t)?S.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return r.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?S.find.matchesSelector(l,e)?[l]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,l=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<l;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)S.find(e,i[t],n);return l>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&C.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var l,i;if(!e)return this;if(n=n||w,"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(S.merge(this,S.parseHTML(l[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),x.test(l[1])&&S.isPlainObject(t))for(l in t)f(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):f(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var O=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!C.test(e))for(;l<i;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?r.call(S(e),this[0]):r.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(T(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,l){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(i=S.filter(l,i)),this.length>1&&(L[e]||S.uniqueSort(i),O.test(e)&&i.reverse()),this.pushStack(i)}});var R=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function B(e,t,n,l){var i;try{e&&f(i=e.promise)?i.call(e).done(t).fail(n):e&&f(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,l,i,o=[],a=[],r=-1,u=function(){for(i=i||e.once,l=t=!0;a.length;r=-1)for(n=a.shift();++r<o.length;)!1===o[r].apply(n[0],n[1])&&e.stopOnFalse&&(r=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},s={add:function(){return o&&(n&&!t&&(r=o.length-1,a.push(n)),function t(n){S.each(n,function(n,l){f(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 S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,o,n))>-1;)o.splice(n,1),n<=r&&r--}),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.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 S.Deferred(function(t){S.each(n,function(n,l){var i=f(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&f(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 a(t,n,l,i){return function(){var r=this,u=arguments,s=function(){var e,s;if(!(t<o)){if((e=l.apply(r,u))===n.promise())throw new TypeError("Thenable self-resolution");f(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,a(o,n,k,i),a(o,n,M,i)):(o++,s.call(e,a(o,n,k,i),a(o,n,M,i),a(o,n,k,n.notifyWith))):(l!==k&&(r=void 0,u=[e]),(i||n.resolveWith)(r,u))}},c=i?s:function(){try{s()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(l!==M&&(r=void 0,u=[e]),n.rejectWith(r,u))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(a(0,e,f(i)?i:k,e.notifyWith)),n[1][3].add(a(0,e,f(t)?t:k)),n[2][3].add(a(0,e,f(l)?l:M))}).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(n,function(e,t){var a=t[2],r=t[5];i[t[1]]=a.add,r&&a.add(function(){l=r},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.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),a=S.Deferred(),r=function(e){return function(n){l[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(l,o)}};if(t<=1&&(B(e,a.done(r(n)).resolve,a.reject,!t),"pending"===a.state()||f(o[n]&&o[n].then)))return a.then();for(;n--;)B(o[n],r(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var U=S.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return U.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||U.resolveWith(h,[S]))}}),S.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(S.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var j=function(e,t,n,l,i,o,a){var r=0,u=e.length,s=null==n;if("object"===y(n))for(r in i=!0,n)j(e,t,r,n[r],!0,o,a);else if(void 0!==l&&(i=!0,f(l)||(a=!0),s&&(a?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(S(e),n)})),t))for(;r<u;r++)t(e[r],n,a?l:l.call(e[r],r,t(e[r],n)));return i?e:s?t.call(e):u?t(e[0],n):o},W=/^-ms-/,z=/-([a-z])/g;function $(e,t){return t.toUpperCase()}function K(e){return e.replace(W,"ms-").replace(z,$)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function q(){this.expando=S.expando+q.uid++}q.uid=1,q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(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[K(t)]=n;else for(l in t)i[K(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][K(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(K):(t=K(t))in l?[t]:t.match(R)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||S.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&&!S.isEmptyObject(t)}};var G=new q,Y=new q,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var l;if(void 0===n&&1===e.nodeType)if(l="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(l))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Y.hasData(e)||G.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return G.access(e,t,n)},_removeData:function(e,t){G.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,l,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=Y.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(l=a[n].name).indexOf("data-")&&(l=K(l.slice(5)),J(o,l,i[l]));G.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Y.set(this,e)}):j(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Y.get(o,e))||void 0!==(n=J(o,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),S.extend({queue:function(e,t,n){var l;if(e)return l=G.get(e,t=(t||"fx")+"queue"),n&&(!l||Array.isArray(n)?l=G.access(e,t,S.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),l=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),l--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!l&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:S.Callbacks("once memory").add(function(){G.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,i=S.Deferred(),o=this,a=this.length,r=function(){--l||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=G.get(o[a],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(r));return r(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return S.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(le=function(e){return S.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"===S.css(e,"display")};function ae(e,t,n,l){var i,o,a=20,r=l?function(){return l.cur()}:function(){return S.css(e,t,"")},u=r(),s=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==s&&+u)&&ee.exec(S.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;a--;)S.style(e,t,c+s),(1-o)*(1-(o=r()/u||.5))<=0&&(a=0),c/=o;S.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 re={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,i=re[l];return i||(t=n.body.appendChild(n.createElement(l)),i=S.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),re[l]=i,i)}function se(e,t){for(var n,l,i=[],o=0,a=e.length;o<a;o++)(l=e[o]).style&&(n=l.style.display,t?("none"===n&&(i[o]=G.get(l,"display")||null,i[o]||(l.style.display="")),""===l.style.display&&oe(l)&&(i[o]=ue(l))):"none"!==n&&(i[o]="none",G.set(l,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}S.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)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&T(e,t)?S.merge([e],n):n}function ge(e,t){for(var n=0,l=e.length;n<l;n++)G.set(e[n],"globalEval",!t||G.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,v.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,a,r,u,s,c,d=t.createDocumentFragment(),p=[],v=0,f=e.length;v<f;v++)if((o=e[v])||0===o)if("object"===y(o))S.merge(p,o.nodeType?[o]:o);else if(Ee.test(o)){for(a=a||d.appendChild(t.createElement("div")),r=(ve.exec(o)||["",""])[1].toLowerCase(),a.innerHTML=(u=me[r]||me._default)[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(o));for(d.textContent="",v=0;o=p[v++];)if(l&&S.inArray(o,l)>-1)i&&i.push(o);else if(s=le(o),a=he(d.appendChild(o),"script"),s&&ge(a),n)for(c=0;o=a[c++];)fe.test(o.type||"")&&n.push(o);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function _e(){return!0}function be(){return!1}function Ae(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,n,l,i,o){var a,r;if("object"==typeof t){for(r in"string"!=typeof n&&(l=l||n,n=void 0),t)De(e,r,n,l,t[r],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&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,l,n)})}function Ce(e,t,n){n?(G.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var l,o,a=G.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),G.set(this,t,a),l=n(this,t),this[t](),a!==(o=G.get(this,t))||l?G.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(G.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&S.event.add(e,t,_e)}S.event={global:{},add:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,v,f,m,h=G.get(e);if(V(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(ne,i),n.guid||(n.guid=S.guid++),(u=h.events)||(u=h.events=Object.create(null)),(a=h.handle)||(a=h.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(R)||[""]).length;s--;)v=m=(r=Se.exec(t[s])||[])[1],f=(r[2]||"").split(".").sort(),v&&(d=S.event.special[v]||{},d=S.event.special[v=(i?d.delegateType:d.bindType)||v]||{},c=S.extend({type:v,origType:m,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=u[v])||((p=u[v]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,f,a)||e.addEventListener&&e.addEventListener(v,a)),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),S.event.global[v]=!0)},remove:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,v,f,m,h=G.hasData(e)&&G.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(R)||[""]).length;s--;)if(v=m=(r=Se.exec(t[s])||[])[1],f=(r[2]||"").split(".").sort(),v){for(d=S.event.special[v]||{},p=u[v=(l?d.delegateType:d.bindType)||v]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&m!==c.origType||n&&n.guid!==c.guid||r&&!r.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));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,f,h.handle)||S.removeEvent(e,v,h.handle),delete u[v])}else for(v in u)S.event.remove(e,v+t[s],n,l,!0);S.isEmptyObject(u)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,l,i,o,a,r=new Array(arguments.length),u=S.event.fix(e),s=(G.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(r[0]=u,t=1;t<arguments.length;t++)r[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,s),t=0;(i=a[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=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,r))&&!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,a,r=[],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=[],a={},n=0;n<u;n++)void 0===a[i=(l=t[n]).selector+" "]&&(a[i]=l.needsContext?S(i,this).index(s)>-1:S.find(i,this,null,[s]).length),a[i]&&o.push(l);o.length&&r.push({elem:s,handlers:o})}return s=this,u<t.length&&r.push({elem:s,handlers:t.slice(u)}),r},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:f(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[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click",_e),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&T(t,"input")&&G.get(t,"click")||T(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?_e: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&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=_e,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=_e,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=_e,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ce(this,e,Ae),!1},trigger:function(){return Ce(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===l||S.contains(l,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,l){return De(this,e,t,n,l)},one:function(e,t,n,l){return De(this,e,t,n,l,1)},off:function(e,t,n){var l,i;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,S(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(){S.event.remove(this,e,n,t)})}});var Te=/<script|<style|<link/i,xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return T(e,"table")&&T(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,l,i,o,a,r;if(1===t.nodeType){if(G.hasData(e)&&(r=G.get(e).events))for(i in G.remove(t,"handle events"),r)for(n=0,l=r[i].length;n<l;n++)S.event.add(t,i,r[i][n]);Y.hasData(e)&&(o=Y.access(e),a=S.extend({},o),Y.set(t,a))}}function Pe(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 Re(e,t,n,l){t=o(t);var i,a,r,u,s,c,d=0,p=e.length,m=p-1,h=t[0],g=f(h);if(g||p>1&&"string"==typeof h&&!v.checkClone&&xe.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),Re(o,t,n,l)});if(p&&(a=(i=ye(t,e[0].ownerDocument,!1,e,l)).firstChild,1===i.childNodes.length&&(i=a),a||l)){for(u=(r=S.map(he(i,"script"),Ie)).length;d<p;d++)s=i,d!==m&&(s=S.clone(s,!0,!0),u&&S.merge(r,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=r[r.length-1].ownerDocument,S.map(r,Oe),d=0;d<u;d++)fe.test((s=r[d]).type||"")&&!G.access(s,"globalEval")&&S.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?S._evalUrl&&!s.noModule&&S._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):E(s.textContent.replace(Ne,""),s,c))}return e}function ke(e,t,n){for(var l,i=t?S.filter(t,e):e,o=0;null!=(l=i[o]);o++)n||1!==l.nodeType||S.cleanData(he(l)),l.parentNode&&(n&&le(l)&&ge(he(l,"script")),l.parentNode.removeChild(l));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,i,o,a,r=e.cloneNode(!0),u=le(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=he(r),l=0,i=(o=he(e)).length;l<i;l++)Pe(o[l],a[l]);if(t)if(n)for(o=o||he(e),a=a||he(r),l=0,i=o.length;l<i;l++)Le(o[l],a[l]);else Le(e,r);return(a=he(r,"script")).length>0&&ge(a,!u&&he(e,"script")),r},cleanData:function(e){for(var t,n,l,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[G.expando]){if(t.events)for(l in t.events)i[l]?S.event.remove(n,l):S.removeEvent(n,l,t.handle);n[G.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),S.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?S.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 Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(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&&(S.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.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&&!Te.test(e)&&!me[(ve.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,l=[],i=S(e),o=i.length-1,r=0;r<=o;r++)n=r===o?this:this.clone(!0),S(i[r])[t](n),a.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=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,a,r=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||le(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Me.test(a)&&Ue.test(t)&&(l=r.width,i=r.minWidth,o=r.maxWidth,r.minWidth=r.maxWidth=r.width=a,a=n.width,r.width=l,r.minWidth=i,r.maxWidth=o)),void 0!==a?a+"":a}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%",a=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,a,r,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,l,i;return null==r&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),i=e.getComputedStyle(n),r=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),r}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,$e={};function Ke(e){return S.cssProps[e]||$e[e]||(e in ze?e:$e[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,qe=/^--/,Ge={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var l=ee.exec(t);return l?Math.max(0,l[2]-(n||0))+(l[3]||"px"):t}function Ze(e,t,n,l,i,o){var a="width"===t?1:0,r=0,u=0;if(n===(l?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+te[a],!0,i)),l?("content"===n&&(u-=S.css(e,"padding"+te[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+te[a]+"Width",!0,i))):(u+=S.css(e,"padding"+te[a],!0,i),"padding"!==n?u+=S.css(e,"border"+te[a]+"Width",!0,i):r+=S.css(e,"border"+te[a]+"Width",!0,i));return!l&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-r-.5))||0),u}function Je(e,t,n){var l=Be(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,l),o=i,a=He(e,t,l),r="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&T(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,l))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,l),(o=r in e)&&(a=e[r])),(a=parseFloat(a)||0)+Ze(e,t,n||(i?"border":"content"),o,l,a)+"px"}function Qe(e,t,n,l,i){return new Qe.prototype.init(e,t,n,l,i)}S.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,a,r=K(t),u=qe.test(t),s=e.style;if(u||(t=Ke(r)),a=S.cssHooks[t]||S.cssHooks[r],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,l))?i:s[t];"string"==(o=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=ae(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[r]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var i,o,a,r=K(t);return qe.test(t)||(t=Ke(r)),(a=S.cssHooks[t]||S.cssHooks[r])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=He(e,t,l)),"normal"===i&&t in Ye&&(i=Ye[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,l){if(n)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Fe(e,Ge,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Be(e),a=!v.scrollboxSize()&&"absolute"===o.position,r=(a||l)&&"border-box"===S.css(e,"boxSizing",!1,o),u=l?Ze(e,t,l,r,o):0;return r&&a&&(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=S.css(e,t)),Xe(0,n,u)}}}),S.cssHooks.marginLeft=je(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.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&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return j(this,function(e,t,n){var l,i,o={},a=0;if(Array.isArray(t)){for(l=Be(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,l);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=o||(S.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?S.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=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:S.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)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function it(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(it):e.setTimeout(it,S.fx.interval),S.fx.tick())}function ot(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function at(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 rt(e,t,n){for(var l,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,a=i.length;o<a;o++)if(l=i[o].call(n,t,e))return l}function ut(e,t,n){var l,i,o=0,a=ut.prefilters.length,r=S.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,a=s.tweens.length;o<a;o++)s.tweens[o].run(l);return r.notifyWith(e,[s,l,n]),l<1&&a?n:(a||r.notifyWith(e,[s,1,0]),r.resolveWith(e,[s]),!1)},s=r.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var l=S.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?(r.notifyWith(e,[s,1,0]),r.resolveWith(e,[s,t])):r.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,i,o,a;for(n in e)if(i=t[l=K(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==l&&(e[l]=o,delete e[n]),(a=S.cssHooks[l])&&"expand"in a)for(n in o=a.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<a;o++)if(l=ut.prefilters[o].call(s,e,c,s.opts))return f(l.stop)&&(S._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return S.map(c,rt,s),f(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),S.fx.timer(S.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}S.Animation=S.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ae(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){f(e)?(t=e,e=["*"]):e=e.match(R);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,a,r,u,s,c,d="width"in t||"height"in t,p=this,v={},f=e.style,m=e.nodeType&&oe(e),h=G.get(e,"fxshow");for(l in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,r=a.empty.fire,a.empty.fire=function(){a.unqueued||r()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(nt.test(i=t[l])){if(delete t[l],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;m=!0}v[l]=h&&h[l]||S.style(e,l)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(v))for(l in d&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(s=h&&h.display)&&(s=G.get(e,"display")),"none"===(c=S.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=S.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===S.css(e,"float")&&(u||(p.done(function(){f.display=s}),null==s&&(s="none"===(c=f.display)?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),u=!1,v)u||(h?"hidden"in h&&(m=h.hidden):h=G.access(e,"fxshow",{display:s}),o&&(h.hidden=!m),m&&se([e],!0),p.done(function(){for(l in m||se([e]),G.remove(e,"fxshow"),v)S.style(e,l,v[l])})),u=rt(m?h[l]:0,l,p),l in h||(h[l]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),S.speed=function(e,t,n){var l=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||f(e)&&e,duration:e,easing:n&&t||t&&!f(t)&&t};return S.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in S.fx.speeds?S.fx.speeds[l.duration]:S.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){f(l.old)&&l.old.call(this),l.queue&&S.dequeue(this,l.queue)},l},S.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=S.isEmptyObject(e),o=S.speed(t,n,l),a=function(){var t=ut(this,S.extend({},e),o);(i||G.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},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=S.timers,a=G.get(this);if(i)a[i]&&a[i].stop&&l(a[i]);else for(i in a)a[i]&&a[i].stop&&lt.test(i)&&l(a[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||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=G.get(this),l=n[e+"queue"],i=n[e+"queueHooks"],o=S.timers,a=l?l.length:0;for(n.finish=!0,S.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<a;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,l,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,l,i)}}),S.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,it())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var i=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(i)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",v.checkOn=""!==e.value,v.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",v.radioValue="t"===e.value}();var st,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return j(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void S.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=S.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&T(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(R);if(i&&1===e.nodeType)for(;n=i[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,l){var i,o,a=t.toLowerCase();return l||(o=ct[a],ct[a]=i,i=null!=n(e,t,l)?a:null,ct[a]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function vt(e){return(e.match(R)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return j(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(i=S.propHooks[t=S.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=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,l,i,o,a,r,u=0;if(f(e))return this.each(function(t){S(this).addClass(e.call(this,t,ft(this)))});if((t=mt(e)).length)for(;n=this[u++];)if(i=ft(n),l=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(r=vt(l))&&n.setAttribute("class",r)}return this},removeClass:function(e){var t,n,l,i,o,a,r,u=0;if(f(e))return this.each(function(t){S(this).removeClass(e.call(this,t,ft(this)))});if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;n=this[u++];)if(i=ft(n),l=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(r=vt(l))&&n.setAttribute("class",r)}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):f(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,ft(this),t),t)}):this.each(function(){var t,i,o,a;if(l)for(i=0,o=S(this),a=mt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=ft(this))&&G.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":G.get(this,"__className__")||""))})},hasClass:function(e){var t,n,l=0;for(t=" "+e+" ";n=this[l++];)if(1===n.nodeType&&(" "+vt(ft(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;S.fn.extend({val:function(e){var t,n,l,i=this[0];return arguments.length?(l=f(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=l?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ht,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,l,i=e.options,o=e.selectedIndex,a="select-one"===e.type,r=a?null:[],u=a?o+1:i.length;for(l=o<0?u:a?o:0;l<u;l++)if(((n=i[l]).selected||l===o)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;r.push(t)}return r},set:function(e,t){for(var n,l,i=e.options,o=S.makeArray(t),a=i.length;a--;)((l=i[a]).selected=S.inArray(S.valHooks.option.get(l),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,l,i){var o,a,r,u,s,d,p,v,g=[l||h],E=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(a=v=r=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!gt.test(E+S.event.triggered)&&(E.indexOf(".")>-1&&(y=E.split("."),E=y.shift(),y.sort()),s=E.indexOf(":")<0&&"on"+E,(t=t[S.expando]?t:new S.Event(E,"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]:S.makeArray(n,[t]),p=S.event.special[E]||{},i||!p.trigger||!1!==p.trigger.apply(l,n))){if(!i&&!p.noBubble&&!m(l)){for(gt.test((u=p.delegateType||E)+E)||(a=a.parentNode);a;a=a.parentNode)g.push(a),r=a;r===(l.ownerDocument||h)&&g.push(r.defaultView||r.parentWindow||e)}for(o=0;(a=g[o++])&&!t.isPropagationStopped();)v=a,t.type=o>1?u:p.bindType||E,(d=(G.get(a,"events")||Object.create(null))[t.type]&&G.get(a,"handle"))&&d.apply(a,n),(d=s&&a[s])&&d.apply&&V(a)&&(t.result=d.apply(a,n),!1===t.result&&t.preventDefault());return t.type=E,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),n)||!V(l)||s&&f(l[E])&&!m(l)&&((r=l[s])&&(l[s]=null),S.event.triggered=E,t.isPropagationStopped()&&v.addEventListener(E,Et),l[E](),t.isPropagationStopped()&&v.removeEventListener(E,Et),S.event.triggered=void 0,r&&(l[s]=r)),t.result}},simulate:function(e,t,n){var l=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(l,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var l=this.ownerDocument||this.document||this,i=G.access(l,t);i||l.addEventListener(e,n,!0),G.access(l,t,(i||0)+1)},teardown:function(){var l=this.ownerDocument||this.document||this,i=G.access(l,t)-1;i?G.access(l,t,i):(l.removeEventListener(e,n,!0),G.remove(l,t))}}});var yt=e.location,St={guid:Date.now()},_t=/\?/;S.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||S.error("Invalid XML: "+(l?S.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,l){var i;if(Array.isArray(t))S.each(t,function(t,i){n||bt.test(e)?l(e,i):Tt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,l)});else if(n||"object"!==y(t))l(e,t);else for(i in t)Tt(e+"["+i+"]",t[i],n,l)}S.param=function(e,t){var n,l=[],i=function(e,t){var n=f(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Tt(n,e[n],t,i);return l.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Ct.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var xt=/%20/g,Nt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Lt=/^\/\//,Pt={},Rt={},kt="*/".concat("*"),Mt=h.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(R)||[];if(f(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Ft(e,t,n,l){var i={},o=e===Rt;function a(r){var u;return i[r]=!0,S.each(e[r]||[],function(e,r){var s=r(t,n,l);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),a(s),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ut(e,t){var n,l,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:l||(l={}))[n]=t[n]);return l&&S.extend(!0,e,l),e}Mt.href=yt.href,S.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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,S.ajaxSettings),t):Ut(S.ajaxSettings,e)},ajaxPrefilter:Bt(Pt),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,a,r,u,s,c,d,p,v=S.ajaxSetup({},n=n||{}),f=v.context||v,m=v.context&&(f.nodeType||f.jquery)?S(f):S.event,g=S.Deferred(),E=S.Callbacks("once memory"),y=v.statusCode||{},_={},b={},A="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(s){if(!a)for(a={};t=It.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[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,_[e]=t),this},overrideMimeType:function(e){return null==s&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)D.always(e[D.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||A;return l&&l.abort(t),C(0,t),this}};if(g.promise(D),v.url=((t||v.url||yt.href)+"").replace(Lt,yt.protocol+"//"),v.type=n.method||n.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){u=h.createElement("a");try{u.href=v.url,u.href=u.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Ft(Pt,v,n,D),s)return D;for(d in(c=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),i=v.url.replace(Nt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(xt,"+")):(p=v.url.slice(i.length),v.data&&(v.processData||"string"==typeof v.data)&&(i+=(_t.test(i)?"&":"?")+v.data,delete v.data),!1===v.cache&&(i=i.replace(wt,"$1"),p=(_t.test(i)?"&":"?")+"_="+St.guid+++p),v.url=i+p),v.ifModified&&(S.lastModified[i]&&D.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&D.setRequestHeader("If-None-Match",S.etag[i])),(v.data&&v.hasContent&&!1!==v.contentType||n.contentType)&&D.setRequestHeader("Content-Type",v.contentType),D.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+kt+"; q=0.01":""):v.accepts["*"]),v.headers)D.setRequestHeader(d,v.headers[d]);if(v.beforeSend&&(!1===v.beforeSend.call(f,D,v)||s))return D.abort();if(A="abort",E.add(v.complete),D.done(v.success),D.fail(v.error),l=Ft(Rt,v,n,D)){if(D.readyState=1,c&&m.trigger("ajaxSend",[D,v]),s)return D;v.async&&v.timeout>0&&(r=e.setTimeout(function(){D.abort("timeout")},v.timeout));try{s=!1,l.send(_,C)}catch(e){if(s)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,a,u){var d,p,h,_,b,A=n;s||(s=!0,r&&e.clearTimeout(r),l=void 0,o=u||"",D.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(_=function(e,t,n){for(var l,i,o,a,r=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(i in r)if(r[i]&&r[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}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,D,a)),!d&&S.inArray("script",v.dataTypes)>-1&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),_=function(e,t,n,l){var i,o,a,r,u,s={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)s[a.toLowerCase()]=e.converters[a];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(!(a=s[u+" "+o]||s["* "+o]))for(i in s)if((r=i.split(" "))[1]===o&&(a=s[u+" "+r[0]]||s["* "+r[0]])){!0===a?a=s[i]:!0!==s[i]&&(o=r[0],c.unshift(r[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,_,D,d),d?(v.ifModified&&((b=D.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=b),(b=D.getResponseHeader("etag"))&&(S.etag[i]=b)),204===t||"HEAD"===v.type?A="nocontent":304===t?A="notmodified":(A=_.state,p=_.data,d=!(h=_.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(f,[p,A,D]):g.rejectWith(f,[D,A,h]),D.statusCode(y),y=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[D,v,d?p:h]),E.fireWith(f,[D,A]),c&&(m.trigger("ajaxComplete",[D,v]),--S.active||S.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,l,i){return f(n)&&(i=i||l,l=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:l},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(f(e)&&(e=e.call(this[0])),t=S(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 f(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=S.ajaxSettings.xhr();v.cors=!!jt&&"withCredentials"in jt,v.ajax=jt=!!jt,S.ajaxTransport(function(t){var n,l;if(v.cors||jt&&!t.crossDomain)return{send:function(i,o){var a,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)r[a]=t.xhrFields[a];for(a in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)r.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=l=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?o(0,"error"):o(r.status,r.statusText):o(Ht[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=n(),l=r.onerror=r.ontimeout=n("error"),void 0!==r.onabort?r.onabort=l:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{r.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.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 S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],$t=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,l){var i,o,a,r=!1!==t.jsonp&&($t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&$t.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=f(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace($t,"$1"+i):!1!==t.jsonp&&(t.url+=(_t.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||S.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},l.always(function(){void 0===o?S(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),a&&f(o)&&o(a[0]),a=o=void 0}),"script"}),v.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),o=!n&&[],(i=x.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var l,i,o},S.fn.load=function(e,t,n){var l,i,o,a=this,r=e.indexOf(" ");return r>-1&&(l=vt(e.slice(r)),e=e.slice(0,r)),f(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(l?S("<div>").append(S.parseHTML(e)).find(l):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var l,i,o,a,r,u,s=S.css(e,"position"),c=S(e),d={};"static"===s&&(e.style.position="relative"),r=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===s||"fixed"===s)&&(o+u).indexOf("auto")>-1?(a=(l=c.position()).top,i=l.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),f(t)&&(t=t.call(e,n,S.extend({},r))),null!=t.top&&(d.top=t.top-r.top+a),null!=t.left&&(d.left=t.left-r.left+i),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.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"===S.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"===S.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(l,"marginTop",!0),left:t.left-i.left-S.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(l){return j(this,function(e,l,i){var o;if(m(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)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=je(v.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){S.fn[l]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),r=n||(!0===i||!0===o?"margin":"border");return j(this,function(t,n,i){var o;return m(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?S.css(t,n,r):S.style(t,n,i,r)},t,a?i:void 0,a)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.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)}}),S.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){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Kt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,l,o;if("string"==typeof t&&(n=e[t],t=e,e=n),f(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||S.guid++,o},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=T,S.isFunction=f,S.isWindow=m,S.camelCase=K,S.type=y,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Kt,"")};var Vt=e.jQuery,qt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=qt),t&&e.jQuery===S&&(e.jQuery=Vt),S},void 0===t&&(e.jQuery=e.$=S),S})});const m=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:v,pageSizeLimit:f,sortParams:m,totalRecords:h}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:u,isPaginationRequired:v,onPageSizeChange:p,onSort:s,sortParams:m,totalRecords:h})},h=e=>{let{onSubmit:o,setExistingDataSet:a,Searchdata:r}=e;const{t:u}=i.useTranslation(),s=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[c,d]=n.useState(null),[p,v]=n.useState(!1),f=Digit.UserService.getUser().info,m=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:r.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:s,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{p&&(o(),v(!1))},[p,o]);let g,E=window.location.href.split("/").pop();isNaN(parseInt(E))||(g=E);let y=isNaN(parseInt(E))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:s,mobileNumber:null==f?void 0:f.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:g,tenantId:s};n.useEffect(()=>{d(y)},[E]);const{isLoading:S,data:_}=Digit.Hooks.ads.useADSSearch({filters:c});if(S)return l.createElement(t.Loader,null);const b=(null==_?void 0:_.bookingApplication)||[],A={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},D={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return l.createElement(l.Fragment,null,l.createElement("div",null,b.length>0&&b.map((e,n)=>{var i;return l.createElement("div",{key:n},l.createElement(t.Card,{style:{...A,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=D.backgroundColor,e.currentTarget.style.boxShadow=D.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(m.mutateAsync(h)).then(function(t){var n,l,i,o,r,u,s,c,d,p,f;const m=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,h={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(l=e.address)||void 0===l?void 0:l.pincode,houseNo:null==e||null===(i=e.address)||void 0===i?void 0:i.houseNo,streetName:null==e||null===(o=e.address)||void 0===o?void 0:o.streetName,landmark:null==e||null===(r=e.address)||void 0===r?void 0:r.landmark,addressline1:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine1,addressline2:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(f=e.applicantDetail)||void 0===f?void 0:f.applicantEmailId},timervalue:{timervalue:m||0},draftId:(null==t?void 0:t.draftId)||""};a(h),v(!0)})}catch(e){return Promise.reject(e)}}(e)}},l.createElement(t.KeyNote,{keyValue:u("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),l.createElement(t.KeyNote,{keyValue:u("ADS_APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u(""+(null==e?void 0:e.bookingStatus))})))}),0===b.length&&!S&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("ADS_NO_APPLICATION_FOUND_MSG"))))},g=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),E=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(g,null)),y=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r,Searchdata:u}=e;const[s,c]=n.useState(!1),[d,p]=n.useState(!1),v=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),f=e=>s&&l.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),m=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:u.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:v,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(a(),p(!1))},[d,a]),l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(f,{t:i}),headerBarEnd:l.createElement(E,{onClick:o}),actionCancelLabel:s&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},s&&l.createElement(h,{onSubmit:a,setExistingDataSet:r,Searchdata:u}),l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!s&&l.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!s&&l.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(m.mutateAsync(g)).then(function(e){r({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},S=()=>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"})),b=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(S,null)),A=e=>{let{onClose:n,cartDetails:a,setCartDetails:r}=e;const{t:u}=i.useTranslation(),s=(o.useLocation(),[{Header:()=>l.createElement("div",{style:{paddingLeft:"50px"}},u("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:u("ADD_TYPE"),accessor:"addType"},{Header:u("FACE_AREA"),accessor:"faceArea"},{Header:u("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,u(t?"Yes":"No"))}},{Header:u("BOOKING_DATE"),accessor:"bookingDate"},{Header:u("UNIT_PRICE"),accessor:"price"},{Header:u("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return l.createElement("div",{className:"sla-cell-success"},t)}},{Header:u("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>(e=>{const t=a.filter((t,n)=>n!==e);r(t)})(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(b,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},l.createElement(m,{t:u,data:a,columns:s,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:a.length}),l.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",a.reduce((e,t)=>e+Number(t.price),0)))},D=e=>{let{styles:t,className:n}=e;return l.createElement("svg",{width:"24",height:"24",className:n,style:{...t},viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M7 10H4V17H7V10Z"}),l.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),l.createElement("path",{d:"M22 19H2V22H22V19Z"}),l.createElement("path",{d:"M20 10H17V17H20V10Z"}),l.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))};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)}let T=[];const x=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":T=[];break;default:T=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(o),l.createElement("div",{className:"timeline-container",style:r?{}:{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"},a(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))},N=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),w=e=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(N,null))},I=()=>{var e,o,a,r,u,s,c,d,p,v,f,h,g,E,y;const[S,_]=n.useState(!1),[b,A]=n.useState(!1),{t:D}=i.useTranslation(),[C,T]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),x=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[N,I]=n.useState(!1),[O,L]=n.useState(!1),P=[{Header:()=>l.createElement("div",{style:{paddingLeft:"50px"}},D("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:D("ADD_TYPE"),accessor:"addType"},{Header:D("FACE_AREA"),accessor:"faceArea"},{Header:D("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,D(t?"Yes":"No"))}},{Header:D("BOOKING_DATE"),accessor:"bookingDate"},{Header:D("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>(e=>{var t;const n={...C};null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),T(n)})(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let R={tenantId:x,cartDetails:null==C||null===(e=C.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},k=Digit.Hooks.ads.useADSDemandEstimation();!1===N&&(k.mutate(R),I(!0));const M=()=>{A(e=>!e)},B=()=>{L(!O)},F=()=>{_(e=>!e)},U=(null===(o=k.data)||void 0===o?void 0:o.demands[0])&&(null===(a=k.data)||void 0===a||null===(r=a.demands[0])||void 0===r?void 0:r.additionalDetails);return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement("div",null,l.createElement("div",{onClick:M,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},l.createElement("div",{class:"container",style:{width:"1px"}}," ",l.createElement("div",{style:{width:"20px",position:"relative"}},l.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},l.createElement("div",null," ",null==C||null===(u=C.adslist)||void 0===u?void 0:u.cartDetails.length)))),"View Cart"),l.createElement("div",{onClick:F,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),l.createElement("div",{onClick:B,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",l.createElement("strong",null,U," INR"))),S&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:l.createElement(w,{onClick:F}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:S,onClose:F}),b&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(w,{onClick:M}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},l.createElement(m,{t:D,data:null==C||null===(s=C.adslist)||void 0===s?void 0:s.cartDetails,columns:P,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==C||null===(c=C.adslist)||void 0===c?void 0:c.cartDetails.length})),O&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:l.createElement(w,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:l.createElement("div",null,l.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),l.createElement("ul",null,(null===(d=k.data)||void 0===d||null===(p=d.demands[0])||void 0===p?void 0:p.demandDetails)&&(null===(v=k.data)||void 0===v||null===(f=v.demands[0])||void 0===f?void 0:f.demandDetails.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},l.createElement(t.CardText,null,D(""+e.taxHeadMasterCode)),l.createElement(t.CardText,null,"Rs ",e.taxAmount))))),l.createElement("hr",null),l.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},l.createElement(t.CardLabelDesc,null,"Total"),l.createElement(t.CardLabelDesc,null,"Rs ",(null===(h=k.data)||void 0===h||null===(g=h.demands[0])||void 0===g?void 0:g.demandDetails)&&(H=null===(E=k.data)||void 0===E||null===(y=E.demands[0])||void 0===y?void 0:y.demandDetails,H.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:O,onClose:B}));var H};function O(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function L(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const P=e=>{let{t:i,SlotSearchData:o,draftId:a=""}=e;const[r,u]=n.useState(0),[s,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,v]=n.useState(!1),f=Digit.Hooks.ads.useADSSlotSearch(),m={advertisementSlotSearchCriteria:o.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:a,isTimerRequired:!0}))};return n.useEffect(()=>{0!==r||p||(function(){try{const e=O(function(){return Promise.resolve(f.mutateAsync(m)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),l=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:i("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):u(l||0)})},function(){c({error:!0,label:i("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),v(!0))},[i,r,p]),n.useEffect(()=>{if(r>0){const e=setInterval(()=>{u(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[r]),n.useEffect(()=>{if(s){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[s]),l.createElement("div",null,l.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return`${Math.floor(e/60)}:${t<10?"0":""}${t}`})(r)),s&&l.createElement(t.Toast,{error:s.error,warning:s.warning,label:i(s.label),onClose:()=>{c(null)}}))};function R(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:c,formData:d,id:p}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],f=Digit.UserService.getUser().info,[m,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:"ADS_"+(null==v?void 0:v.documentType.replaceAll(".","_"))}:(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)>0?null==a?void 0:a.dropdownData[0]:{})),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[_,b]=n.useState(!1),{dropdownData:A}=a;var D=A;const[C,T]=n.useState(!1),x=()=>l.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=m&&m.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==y?void 0:y.length)||null===y?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==m?void 0:m.code,fileStoreId:y,documentUid:y}]})},[y,m]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.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?(h(l),S(null==n?void 0:n.fileStoreId)):T(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(g){const e=function(){if(g.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=L(function(){return O(function(){return S(null),b(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",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?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(){u(o("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(b(!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)}}()},[g]),n.useEffect(()=>{C&&S(null)},[C]),l.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o("ADS_"+(null==a?void 0:a.code.replaceAll(".","_")))," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:m,style:{width:"EMPLOYEE"===f.type?"50%":"100%"},placeholder:"Select "+o("ADS_"+(null==a?void 0:a.code.replaceAll(".","_"))),option:D.map(e=>{var t;return{...e,i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))}}),select:e=>h(e),optionKey:"i18nKey",t:o})):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{S(null)},id:p,message:_?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(x,null),l.createElement("span",null,"Uploading...")):y?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}))))}function k(e){let{value:n={},Code:o,index:a,showFileName:r=!1}=e;const{t:u}=i.useTranslation(),{isLoading:s,data:c}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},o,a),d=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"24",height:"24",rx:"4",fill:"#D32F2F"}),l.createElement("text",{x:"0",y:"16","font-family":"Arial, sans-serif","font-size":"12","font-weight":"bold",fill:"#FFFFFF"},"PDF")),p=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===o).map(e=>({...e,documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===o).map(e=>({...e,documentType:e.documentType.replace(/\./g,"_")}));return s?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(l.Fragment,null,l.createElement("div",null,p.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(c.pdfFiles,e.fileStoreId);return l.createElement("a",{target:"_",href:n,style:{minWidth:"160px",display:"flex",alignItems:"center"},key:t},l.createElement("p",{style:{marginRight:"8px",margin:"5px",color:"blue",fontWeight:"bold"}},u("ADS_"+(null==o?void 0:o.split(".").slice(0,4).join("_")))),l.createElement(d,null))}))))}const M=e=>{let{jumpTo:n}=e;const{t:a}=i.useTranslation(),r=o.useHistory();return l.createElement(t.LinkButton,{label:a("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){r.push(n)}})},B=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_SUCCESS"):t("ES_ADS_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_PENDING"):t("CS_ADS_BOOKING_PENDING"):e.isSuccess?void 0:window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_FAILED"):t("CS_ADS_BOOKING_FAILED")},F={padding:"4px 0px",justifyContent:"space-between"},U=e=>{var n;return l.createElement(t.Banner,{message:B(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.bookingApplication[0].bookingNo,info:e.isSuccess?e.t("ADS_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},H=()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const r=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],u=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,s={Icon:l.createElement(D,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:r.filter(e=>!(null!=e&&e.role)||u)};return l.createElement(t.EmployeeModuleCard,s)},j=e=>l.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),W=()=>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"})),z=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(W,null)),$=e=>{let{t:i,closeModal:o,actionCancelLabel:a,actionCancelOnSubmit:u,actionSaveLabel:s,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,v]=n.useState(!1),{handleSubmit:f}=r.useForm();return l.createElement(t.Modal,{headerBarMain:l.createElement(j,{t:i}),headerBarEnd:l.createElement(z,{onClick:o}),actionCancelLabel:i(a),actionCancelOnSubmit:u,actionSaveLabel:i(s),actionSaveOnSubmit:f(c),isDisabled:!p,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("form",{onSubmit:f(d)},l.createElement(t.CheckBox,{label:i("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{v(!p)},style:{height:"auto"}}))))},K=e=>{var i,a;let{tenantId:u,isLoading:s,t:c,onSubmit:d,data:p,count:v,setShowToast:f}=e;const m=window.Digit.Utils.browser.isMobile(),{register:h,control:g,handleSubmit:E,setValue:y,getValues:S,reset:_,formState:b}=r.useForm({defaultValues:{offset:0,limit:!m&&10,sortBy:"commencementDate",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:{i18nKey:"Booked",code:"BOOKED",value:c("CHB_BOOKED")}}});n.useEffect(()=>{h("offset",0),h("limit",10),h("sortBy","commencementDate"),h("sortOrder","DESC"),E(d)()},[h]);const[A,D]=n.useState(""),[C,T]=n.useState(!1),x=Digit.Hooks.ads.useADSCreateAPI(u,!1),{data:N}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}});let w=[];N&&N.map(e=>{w.push({i18nKey:""+e.code,code:""+e.code,value:""+e.name})});const I=e=>l.createElement("span",{className:"cell-text"},e),L=function(){try{T(!1);const e={...A,bookingStatus:"CANCELLED"};return Promise.resolve(x.mutateAsync({bookingApplication:e})).then(function(){E(d)()})}catch(e){return Promise.reject(e)}},P=n.useMemo(()=>[{Header:c("ADS_BOOKING_NO"),accessor:"bookingNo",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/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:c("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,l;return I(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(l=n.applicantDetail)||void 0===l?void 0:l.applicantName))},disableSortBy:!0},{Header:c("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const l=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,i=null==l?void 0:l.map(e=>null==e?void 0:e.location).join(", ");return I(i)},disableSortBy:!0},{Header:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return I(""+c(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0},{Header:c("ADS_ACTIONS"),Cell:e=>{let{row:i}=e;const[a,r]=n.useState(!1),s=n.useRef(),d=o.useHistory(),p=e=>{s.current&&!s.current.contains(e.target)&&r(!1)};l.useEffect(()=>(document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}),[]);let v=null==i?void 0:i.original;const m=Digit.Hooks.ads.useADSSlotSearch();let h={advertisementSlotSearchCriteria:null==v?void 0:v.cartDetails.map(e=>({bookingId:null==v?void 0:v.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return l.createElement("div",{ref:s},l.createElement(l.Fragment,null,l.createElement(t.SubmitBar,{label:c("WF_TAKE_ACTION"),onSubmit:()=>{r(!a)},disabled:"CANCELLED"===(null==v?void 0:v.bookingStatus)||"EXPIRED"===(null==v?void 0:v.bookingStatus)}),a&&l.createElement("div",{style:{position:"absolute",backgroundColor:"white",border:"1px solid #ccc",borderRadius:"4px",padding:"8px",zIndex:1e3}},"BOOKED"===(null==v?void 0:v.bookingStatus)&&l.createElement("div",{onClick:function(){try{return T(!0),D(null==i?void 0:i.original),Promise.resolve()}catch(e){return Promise.reject(e)}},style:{display:"block",padding:"8px",textDecoration:"none",color:"black",cursor:"pointer"}},c("ADS_CANCEL")),"BOOKED"!==(null==v?void 0:v.bookingStatus)&&l.createElement("div",{onClick:()=>function(){try{const e=O(function(){return Promise.resolve(m.mutateAsync(h)).then(function(e){var t;let n={bookingId:null==v?void 0:v.bookingId,tenantId:u,cartDetails:null==v?void 0:v.cartDetails};const l=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),i=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;l?f({error:!0,label:c("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):d.push({pathname:"/digit-ui/employee/payment/collect/adv-services/"+(null==v?void 0:v.bookingNo),state:{tenantId:null==v?void 0:v.tenantId,bookingNo:null==v?void 0:v.bookingNo,timerValue:i,SlotSearchData:n}})})},function(){f({error:!0,label:c("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),style:{display:"block",padding:"8px",textDecoration:"none",color:"black",cursor:"pointer"}},c("ADS_COLLECT_PAYMENT")))))}}],[]),R=[{i18nKey:"Booked",code:"BOOKED",value:c("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:c("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:c("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:c("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:c("ADS_CANCELLED")}],k=n.useCallback(e=>{0!==e.length&&(y("sortBy",e.id),y("sortOrder",e.desc?"DESC":"ASC"))},[]);function M(){y("offset",S("offset")-S("limit")),E(d)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,c("ADS_SEARCH_BOOKINGS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},c("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:d,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,c("ADS_BOOKING_NO")),l.createElement(t.TextInput,{name:"bookingNo",inputRef:h({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("ADS_APPLICANT_NAME")),l.createElement(t.TextInput,{name:"applicantName",inputRef:h({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("ADS_FACE_AREA")),l.createElement(r.Controller,{control:g,name:"faceArea",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:w,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(r.Controller,{control:g,name:"status",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("ADS_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:h({minLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:c("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==b||null===(i=b.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,c("FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:g})),l.createElement(t.SearchField,null,l.createElement("label",null,c("TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:g})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:c("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),f(null),M()}},c("ES_COMMON_CLEAR_ALL")))),!s&&null!=p&&p.display?l.createElement(t.Card,{style:{marginTop:20}},c(p.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):s||""===p?""!==p||s&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:c,data:p,totalRecords:v,columns:P,getCellProps:e=>({style:{minWidth:e.column.Header===c("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){y("limit",Number(e.target.value)),E(d)()},currentPage:S("offset")/S("limit"),onNextPage:function(){y("offset",S("offset")+S("limit")),E(d)()},onPrevPage:M,pageSizeLimit:S("limit"),onSort:k,disableSort:!1,sortParams:[{id:S("sortBy"),desc:"DESC"===S("sortOrder")}]})),C&&l.createElement($,{t:c,closeModal:()=>T(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>T(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:L,onSubmit:L}))},V=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,d]=n.useState(null);n.useEffect(()=>{if(c){const e=setTimeout(()=>{d(null)},1e3);return()=>clearTimeout(e)}},[c]);const p={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:v,isSuccess:f,data:{bookingApplication:m,Count:h}={}}=Digit.Hooks.ads.useADSSearch({tenantId:r,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(K,{t:a,isLoading:v,tenantId:r,setShowToast:d,onSubmit:function(e){var t=null==e?void 0:e.fromDate,n=null==e?void 0:e.toDate;const l={...e,...e.toDate?{toDate:n}:{},...e.fromDate?{fromDate:t}:{}};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.bookingNo||i.fromDate||i.status||i.applicantName||i.faceArea||i.toDate||i.mobileNumber?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_ONE_PARAMETERS"})},data:f&&!v?m.length>0?m:{display:"ES_COMMON_NO_DATA"}:"",count:h}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:a(c.label),onClose:()=>{d(null)}}))},q=e=>{var n,a,r,u;let{path:s}=e;i.useTranslation();const c=o.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const d=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ADSCreate"),p=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ApplicationDetails"),v=window.location.href.includes("ads/response"),f=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details");return l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},v?null:l.createElement("div",{style:f?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},l.createElement(t.BackButton,{location:c})),l.createElement(t.PrivateRoute,{path:s+"/bookad",component:d}),l.createElement(t.PrivateRoute,{path:s+"/my-applications",component:e=>l.createElement(V,C({},e,{parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/applicationsearch/application-details/:id",component:()=>l.createElement(p,{parentRoute:s})})))))},G=e=>{var a;let{application:r,tenantId:u,buttonLabel:s}=e;const{t:c}=i.useTranslation(),d=o.useHistory(),[p,v]=n.useState(null),f=Digit.Hooks.ads.useADSSlotSearch();let m={advertisementSlotSearchCriteria:null==r?void 0:r.cartDetails.map(e=>({bookingId:null==r?void 0:r.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{if(p){const e=setTimeout(()=>{v(null)},2e3);return()=>clearTimeout(e)}},[p]),l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_NO"),note:null==r?void 0:r.bookingNo}),l.createElement(t.KeyNote,{keyValue:c("ADS_APPLICANT_NAME"),note:null==r||null===(a=r.applicantDetail)||void 0===a?void 0:a.applicantName}),l.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_DATE"),note:(e=>{var t,n;if(!e||0===e.length)return c("CS_NA");const l=null===(t=e[0])||void 0===t?void 0:t.bookingDate,i=null===(n=e[e.length-1])||void 0===n?void 0:n.bookingDate;return l===i?l:l&&i?`${l} - ${i}`:c("CS_NA")})(null==r?void 0:r.cartDetails)}),l.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),l.createElement("div",null,l.createElement(o.Link,{to:`/digit-ui/citizen/ads/application/${null==r?void 0:r.bookingNo}/${null==r?void 0:r.tenantId}`},l.createElement(t.SubmitBar,{label:s})),("BOOKING_CREATED"===r.bookingStatus||"PAYMENT_FAILED"===r.bookingStatus||"PENDING_FOR_PAYMENT"===r.bookingStatus)&&l.createElement(t.SubmitBar,{label:c("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:function(){try{const e=O(function(){return Promise.resolve(f.mutateAsync(m)).then(function(e){var t;let n={bookingId:null==r?void 0:r.bookingId,tenantId:u,cartDetails:null==r?void 0:r.cartDetails};const l=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),i=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;l?v({error:!0,label:c("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):d.push({pathname:"/digit-ui/citizen/payment/my-bills/adv-services/"+(null==r?void 0:r.bookingNo),state:{tenantId:null==r?void 0:r.tenantId,bookingNo:null==r?void 0:r.bookingNo,timerValue:i,SlotSearchData:n}})})},function(){v({error:!0,label:c("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},style:{margin:"20px"}})),p&&l.createElement(t.Toast,{error:p.error,warning:p.warning,label:c(p.label),onClose:()=>{v(null)}}))};var Y,X=Array.isArray,Z="object"==typeof v&&v&&v.Object===Object&&v,J="object"==typeof self&&self&&self.Object===Object&&self,Q=Z||J||Function("return this")(),ee=Q.Symbol,te=Object.prototype,ne=te.hasOwnProperty,le=te.toString,ie=ee?ee.toStringTag:void 0,oe=Object.prototype.toString,ae=ee?ee.toStringTag:void 0,re=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ae&&ae in Object(e)?function(e){var t=ne.call(e,ie),n=e[ie];try{e[ie]=void 0;var l=!0}catch(e){}var i=le.call(e);return l&&(t?e[ie]=n:delete e[ie]),i}(e):function(e){return oe.call(e)}(e)},ue=function(e){return null!=e&&"object"==typeof e},se=function(e){return"symbol"==typeof e||ue(e)&&"[object Symbol]"==re(e)},ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,de=/^\w*$/,pe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ve=function(e){if(!pe(e))return!1;var t=re(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},fe=Q["__core-js_shared__"],me=(Y=/[^.]+$/.exec(fe&&fe.keys&&fe.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",he=Function.prototype.toString,ge=function(e){if(null!=e){try{return he.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ee=/^\[object .+?Constructor\]$/,ye=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!pe(e)||(t=e,me&&me in t))&&(ve(e)?ye:Ee).test(ge(e));var t}(n)?n:void 0},_e=Se(Object,"create"),be=Object.prototype.hasOwnProperty,Ae=Object.prototype.hasOwnProperty;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.__data__=_e?_e(null):{},this.size=0},De.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},De.prototype.get=function(e){var t=this.__data__;if(_e){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},De.prototype.has=function(e){var t=this.__data__;return _e?void 0!==t[e]:Ae.call(t,e)},De.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=_e&&void 0===t?"__lodash_hash_undefined__":t,this};var Ce=De,Te=function(e,t){return e===t||e!=e&&t!=t},xe=function(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1},Ne=Array.prototype.splice;function we(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])}}we.prototype.clear=function(){this.__data__=[],this.size=0},we.prototype.delete=function(e){var t=this.__data__,n=xe(t,e);return!(n<0||(n==t.length-1?t.pop():Ne.call(t,n,1),--this.size,0))},we.prototype.get=function(e){var t=this.__data__,n=xe(t,e);return n<0?void 0:t[n][1]},we.prototype.has=function(e){return xe(this.__data__,e)>-1},we.prototype.set=function(e,t){var n=this.__data__,l=xe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ie=we,Oe=Se(Q,"Map"),Le=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 Pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}Pe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ce,map:new(Oe||Ie),string:new Ce}},Pe.prototype.delete=function(e){var t=Le(this,e).delete(e);return this.size-=t?1:0,t},Pe.prototype.get=function(e){return Le(this,e).get(e)},Pe.prototype.has=function(e){return Le(this,e).has(e)},Pe.prototype.set=function(e,t){var n=Le(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Re=Pe;function ke(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ke.Cache||Re),n}ke.Cache=Re;var Me,Be,Fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ue=/\\(\\)?/g,He=(Me=ke(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Fe,function(e,n,l,i){t.push(l?i.replace(Ue,"$1"):n||e)}),t},function(e){return 500===Be.size&&Be.clear(),e}),Be=Me.cache,Me),je=ee?ee.prototype:void 0,We=je?je.toString:void 0,ze=function(e){if("string"==typeof e||se(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},$e=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return X(e)?e:function(e,t){if(X(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!se(e))||de.test(e)||!ce.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:He(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(X(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(se(t))return We?We.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[ze(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},Ke=f(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",f="[object Number]",m="[object Object]",h="[object RegExp]",g="[object Set]",E="[object String]",y="[object Symbol]",S="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",A="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",x="[object Int32Array]",N="[object Uint8Array]",w="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(R.source),B=RegExp(k.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,K=RegExp($.source),V=/^\s+/,q=/\s/,G=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+ce+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Ae="(?:"+_e+"|"+he+")",De="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,ye,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",ye,Se].join("|")+")"+Ce,xe="(?:"+[Ee+ve+"?",ve,ye,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Oe=RegExp([_e+"?"+me+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,_e,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,_e+be,"$"].join("|")+")",_e+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,Te].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ke=-1,Me={};Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[o]=Me[a]=Me[_]=Me[r]=Me[b]=Me[u]=Me[s]=Me[c]=Me[p]=Me[f]=Me[m]=Me[h]=Me[g]=Me[E]=Me[S]=!1;var Be={};Be[o]=Be[a]=Be[_]=Be[b]=Be[r]=Be[u]=Be[A]=Be[D]=Be[C]=Be[T]=Be[x]=Be[p]=Be[f]=Be[m]=Be[h]=Be[g]=Be[E]=Be[y]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[s]=Be[c]=Be[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof v&&v&&v.Object===Object&&v,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),$e=t&&!t.nodeType&&t,Ke=$e&&e&&!e.nodeType&&e,Ve=Ke&&Ke.exports===$e,qe=Ve&&je.process,Ge=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Ye=Ge&&Ge.isArrayBuffer,Xe=Ge&&Ge.isDate,Ze=Ge&&Ge.isMap,Je=Ge&&Ge.isRegExp,Qe=Ge&&Ge.isSet,et=Ge&&Ge.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var ft=_t("length");function mt(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):ht(e,yt,n)}function Et(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 St(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function _t(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 At(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Dt(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Tt(e){return e?e.slice(0,$t(e)+1).replace(V,""):e}function xt(e){return function(t){return e(t)}}function Nt(e,t){return st(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&gt(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length;n--&&gt(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=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"}),Rt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Fe[e]}function Mt(e){return Le.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Vt=function e(t){var v=(t=null==t?ze:Vt.defaults(ze.Object(),t,Vt.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,pe=t.Math,ve=t.Object,fe=t.RegExp,me=t.String,he=t.TypeError,ge=v.prototype,Ee=ve.prototype,ye=t["__core-js_shared__"],Se=de.prototype.toString,_e=Ee.hasOwnProperty,be=0,Ae=function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=Ee.toString,Ce=Se.call(ve),Te=ze._,xe=fe("^"+Se.call(_e).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ve?t.Buffer:void 0,Le=t.Symbol,Fe=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,We=Ft(ve.getPrototypeOf,ve),$e=ve.create,Ke=Ee.propertyIsEnumerable,qe=ge.splice,Ge=Le?Le.isConcatSpreadable:void 0,ft=Le?Le.iterator:void 0,bt=Le?Le.toStringTag:void 0,qt=function(){try{var e=Zi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Yt=q&&q.now!==ze.Date.now&&q.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=pe.ceil,Jt=pe.floor,Qt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ft(ve.keys,ve),on=pe.max,an=pe.min,rn=q.now,un=t.parseInt,sn=pe.random,cn=ge.reverse,dn=Zi(t,"DataView"),pn=Zi(t,"Map"),vn=Zi(t,"Promise"),fn=Zi(t,"Set"),mn=Zi(t,"WeakMap"),hn=Zi(ve,"create"),gn=mn&&new mn,En={},yn=Co(dn),Sn=Co(pn),_n=Co(vn),bn=Co(fn),An=Co(mn),Dn=Le?Le.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,Tn=Dn?Dn.toString:void 0;function xn(e){if(Wa(e)&&!Oa(e)&&!(e instanceof On)){if(e instanceof In)return e;if(_e.call(e,"__wrapped__"))return To(e)}return new In(e)}var Nn=function(){function e(){}return function(t){if(!ja(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function 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 Pn(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 Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Bn(e,t){var n=Oa(e),l=!n&&Ia(e),i=!n&&!l&&ka(e),o=!n&&!l&&!i&&Xa(e),a=n||l||i||o,r=a?Ct(e.length,me):[],u=r.length;for(var s in e)!t&&!_e.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function Fn(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function Un(e,t){return bo(mi(e),Gn(t,0,e.length))}function Hn(e){return bo(mi(e))}function jn(e,t,n){(void 0!==n&&!xa(e[t],n)||void 0===n&&!(t in e))&&Vn(e,t,n)}function Wn(e,t,n){var l=e[t];_e.call(e,t)&&xa(l,n)&&(void 0!==n||t in e)||Vn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(xa(e[n][0],t))return n;return-1}function $n(e,t,n,l){return Qn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Kn(e,t){return e&&hi(t,Er(t),e)}function Vn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=v(l),o=null==e;++n<l;)i[n]=o?void 0:vr(e,t[n]);return i}function Gn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Yn(e,t,n,l,i,a){var s,v=1&t,S=2&t,O=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!ja(e))return e;var L=Oa(e);if(L){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!v)return mi(e,s)}else{var P=eo(e),R=P==c||P==d;if(ka(e))return si(e,v);if(P==m||P==o||R&&!i){if(s=S||R?{}:no(e),!v)return S?function(e,t){return hi(e,Qi(e),t)}(e,function(e,t){return e&&hi(t,yr(t),e)}(s,e)):function(e,t){return hi(e,Ji(e),t)}(e,Kn(s,e))}else{if(!Be[P])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case _:return ci(e);case r:case u:return new l(+e);case b:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case A:case D:case C:case T:case x:case N:case"[object Uint8ClampedArray]":case w:case I:return di(e,n);case p:return new l;case f:case E:return new l(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new l;case y:return Cn?ve(Cn.call(e)):{}}}(e,P,v)}}a||(a=new Mn);var k=a.get(e);if(k)return k;a.set(e,s),qa(e)?e.forEach(function(l){s.add(Yn(l,t,n,l,e,a))}):za(e)&&e.forEach(function(l,i){s.set(i,Yn(l,t,n,i,e,a))});var M=L?void 0:(O?S?$i:zi:S?yr:Er)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),Wn(s,i,Yn(l,t,n,i,e,a))}),s}function Xn(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 Zn(e,t,l){if("function"!=typeof e)throw new he(n);return Eo(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,xt(n))),l?(o=ut,a=!1):t.length>=200&&(o=wt,a=!1,t=new kn(t));e:for(;++i<r;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&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}xn.templateSettings={escape:F,evaluate:U,interpolate:H,variable:"",imports:{_:xn}},(xn.prototype=wn.prototype).constructor=xn,(In.prototype=Nn(wn.prototype)).constructor=In,(On.prototype=Nn(wn.prototype)).constructor=On,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 _e.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:_e.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},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(pn||Pn),string:new Ln}},Rn.prototype.delete=function(e){var t=Yi(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return Yi(this,e).get(e)},Rn.prototype.has=function(e){return Yi(this,e).has(e)},Rn.prototype.set=function(e,t){var n=Yi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Pn,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 Pn){var l=n.__data__;if(!pn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Qn=yi(rl),el=yi(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ya(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):ct(i,r):l||(i[i.length]=r)}return i}var ol=Si(),al=Si(!0);function rl(e,t){return e&&ol(e,t,Er)}function ul(e,t){return e&&al(e,t,Er)}function sl(e,t){return at(t,function(t){return Fa(e[t])})}function cl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Do(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return Oa(e)?l:ct(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=_e.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=De.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return De.call(e)}(e)}function vl(e,t){return e>t}function fl(e,t){return null!=e&&_e.call(e,t)}function ml(e,t){return null!=e&&t in ve(e)}function hl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=v(o),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,xt(t))),u=an(c.length,u),r[a]=!n&&(t||i>=120&&c.length>=120)?new kn(a&&c):void 0}c=e[0];var d=-1,p=r[0];e:for(;++d<i&&s.length<u;){var f=c[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?wt(p,m):l(s,m,n))){for(a=o;--a;){var h=r[a];if(!(h?wt(h,m):l(e[a],m,n)))continue e}p&&p.push(m),s.push(f)}}return s}function gl(e,t,n){var l=null==(e=fo(e,t=oi(t,e)))?e:e[Do(Bo(t))];return null==l?void 0:tt(l,e,n)}function El(e){return Wa(e)&&pl(e)==o}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Wa(e)&&!Wa(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=Oa(e),v=Oa(t),S=d?a:eo(e),A=v?a:eo(t),D=(S=S==o?m:S)==m,C=(A=A==o?m:A)==m,T=S==A;if(T&&ka(e)){if(!ka(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Mn),d||Xa(e)?ji(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case f:return xa(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case E:return e==t+"";case p:var c=Bt;case g:if(c||(c=Ht),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var v=ji(c(e),c(t),l,i,o,a);return a.delete(e),v;case y:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,S,n,l,i,c);if(!(1&n)){var x=D&&_e.call(e,"__wrapped__"),N=C&&_e.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Mn),i(w,I,n,l,c)}}return!!T&&(c||(c=new Mn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:_e.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var f=a;++s<u;){var m=e[c=r[s]],h=t[c];if(l)var g=a?l(h,m,c,t,e,o):l(m,h,c,e,t,o);if(!(void 0===g?m===h||i(m,h,n,l,o):g)){v=!1;break}f||(f="constructor"==c)}if(v&&!f){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,c))}(e,t,n,l,yl,i))}function Sl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=ve(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[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?yl(c,s,3,l,d):p))return!1}}return!0}function _l(e){return!(!ja(e)||(t=e,Ae&&Ae in t))&&(Fa(e)?xe:ie).test(Co(e));var t}function bl(e){return"function"==typeof e?e:null==e?$r:"object"==typeof e?Oa(e)?xl(e[0],e[1]):Tl(e):Qr(e)}function Al(e){if(!so(e))return ln(e);var t=[];for(var n in ve(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dl(e,t){return e<t}function Cl(e,t){var n=-1,l=Pa(e)?v(e.length):[];return Qn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=Xi(e);return 1==t.length&&t[0][2]?po(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function xl(e,t){return ao(e)&&co(t)?po(Do(e),t):function(n){var l=vr(n,e);return void 0===l&&l===t?fr(n,e):yl(t,l,3)}}function Nl(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Mn),ja(o))!function(e,t,n,l,i,o,a){var r=ho(e,n),u=ho(t,n),s=a.get(u);if(s)jn(e,n,s);else{var c=o?o(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=Oa(u),v=!p&&ka(u),f=!p&&!v&&Xa(u);c=u,p||v||f?Oa(r)?c=r:Ra(r)?c=mi(r):v?(d=!1,c=si(u,!0)):f?(d=!1,c=di(u,!0)):c=[]:Ka(u)||Ia(u)?(c=r,Ia(r)?c=ir(r):ja(r)&&!Fa(r)||(c=no(u))):d=!1}d&&(a.set(u,c),i(c,u,l,o,a),a.delete(u)),jn(e,n,c)}}(e,t,a,n,Nl,l,i);else{var r=l?l(ho(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),jn(e,a,r)}},yr)}function wl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Oa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[$r];var l=-1;return t=st(t,xt(Gi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=pi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Ol(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,oi(a,e),r)}return o}function Ll(e,t,n,l){var i=l?Et:gt,o=-1,a=t.length,r=e;for(e===t&&(t=mi(t)),n&&(r=st(e,xt(n)));++o<a;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(r,c,u,l))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Pl(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;io(i)?qe.call(e,i,1):Zl(e,i)}}return e}function Rl(e,t){return e+Jt(sn()*(t-e+1))}function kl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Ml(e,t){return yo(vo(e,t,$r),e+"")}function Bl(e){return Fn(xr(e))}function Fl(e,t){var n=xr(e);return bo(n,Gn(t,0,n.length))}function Ul(e,t,n,l){if(!ja(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=ja(c)?c:io(t[i+1])?[]:{})}Wn(r,u,s),r=r[u]}return e}var Hl=gn?function(e,t){return gn.set(e,t),e}:$r,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:$r;function Wl(e){return bo(xr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=v(i);++l<i;)o[l]=e[l+t];return o}function $l(e,t){var n;return Qn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Ya(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return Vl(e,t,$r,n)}function Vl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Ya(t),s=void 0===t;i<o;){var c=Jt((i+o)/2),d=n(e[c]),p=void 0!==d,v=null===d,f=d==d,m=Ya(d);if(a)var h=l||f;else h=s?f&&(l||p):r?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!xa(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Gl(e){return"number"==typeof e?e:Ya(e)?NaN:+e}function Yl(e){if("string"==typeof e)return e;if(Oa(e))return st(e,Yl)+"";if(Ya(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:ki(e);if(s)return Ht(s);a=!1,i=wt,u=new kn}else u=t?[]:r;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),r.push(c)}else i(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function Zl(e,t){return null==(e=fo(e,t=oi(t,e)))||delete e[Do(Bo(t))]}function Jl(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function Ql(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof On&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var i=-1,o=v(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Jn(o[i]||a,e[r],t,n));return Xl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:$r}function oi(e,t){return Oa(e)?e:ao(e,t)?[e]:Ao(or(e))}var ai=Ml;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Gt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function di(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Ya(e),a=void 0!==t,r=null===t,u=t==t,s=Ya(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function vi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),c=v(u+s),d=!l;++r<u;)c[r]=t[r];for(;++i<a;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[r++]=e[i++];return c}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(o-r,0),d=v(c+s),p=!l;++i<c;)d[i]=e[i];for(var f=i;++u<s;)d[f+u]=t[u];for(;++a<r;)(p||i<o)&&(d[f+n[a]]=e[i++]);return d}function mi(e,t){var n=-1,l=e.length;for(t||(t=v(l));++n<l;)t[n]=e[n];return t}function hi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?Vn(n,r,u):Wn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=Oa(n)?nt:$n,o=t?t():{};return i(n,e,Gi(l,2),o)}}function Ei(e){return Ml(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!Pa(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=ve(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=ve(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function _i(e){return function(t){var n=Mt(t=or(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Fr(Ir(t).replace(Ne,"")),e,"")}}function Ai(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Nn(e.prototype),l=e.apply(n,t);return ja(l)?l:n}}function Di(e){return function(t,n,l){var i=ve(t);if(!Pa(t)){var o=Gi(n,3);t=Er(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Ci(e){return Wi(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new he(n);if(o&&!r&&"wrapper"==Vi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=Vi(a=t[i]),s="wrapper"==u?Ki(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[Vi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Oa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ti(e,t,n,l,i,o,a,r,u,s){var c=128&t,d=1&t,p=2&t,f=24&t,m=512&t,h=p?void 0:Ai(e);return function g(){for(var E=arguments.length,y=v(E),S=E;S--;)y[S]=arguments[S];if(f)var _=qi(g),b=Lt(y,_);if(l&&(y=vi(y,l,i,f)),o&&(y=fi(y,o,a,f)),E-=b,f&&E<s){var A=Ut(y,_);return Pi(e,t,Ti,g.placeholder,n,y,A,r,u,s-E)}var D=d?n:this,C=p?D[e]:e;return E=y.length,r?y=mo(y,r):m&&E>1&&y.reverse(),c&&u<E&&(y.length=u),this&&this!==ze&&this instanceof g&&(C=h||Ai(C)),C.apply(D,y)}}function xi(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ni(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=Yl(n),l=Yl(l)):(n=Gl(n),l=Gl(l)),i=e(n,l)}return i}}function wi(e){return Wi(function(t){return t=st(t,xt(Gi())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Yl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Zt(e/Wt(t)));return Mt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function Oi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n,l){for(var i=-1,o=on(Zt((t-e)/(n||1)),0),a=v(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:er(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=lr(t),n=lr(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,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?a:void 0,c?void 0:o,c?void 0:a,r,u,s],p=n.apply(void 0,d);return ro(e)&&go(p,d),p.placeholder=l,So(p,e,t)}function Ri(e){var t=pe[e];return function(e,n){if(e=lr(e),(n=null==n?0:an(tr(n),292))&&tn(e)){var l=(or(e)+"e").split("e");return+((l=(or(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Yr;function Mi(e){return function(t){var n=eo(t);return n==p?Bt(t):n==g?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,r,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=a=void 0),u=void 0===u?u:on(tr(u),0),s=void 0===s?s:tr(s),d-=a?a.length:0,64&t){var p=o,f=a;o=a=void 0}var m=c?void 0:Ki(e),h=[e,t,i,o,a,p,f,r,u,s];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(h,m),e=h[0],t=h[1],i=h[2],o=h[3],a=h[4],!(s=h[9]=void 0===h[9]?c?0:e.length:on(h[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=v(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=s.length)<n)return Pi(e,t,Ti,i.placeholder,void 0,a,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Ti.apply(void 0,h):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=v(s+r),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,i?n:this,c)}}(e,t,i,o);else var g=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((m?Hl:go)(g,h),e,t)}function Fi(e,t,n,l){return void 0===e||xa(e,Ee[n])&&!_e.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return ja(e)&&ja(t)&&(o.set(t,e),Nl(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Ka(e)?void 0:e}function ji(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,v=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var f=e[d],m=t[d];if(l)var h=a?l(m,f,d,t,e,o):l(f,m,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!wt(v,t)&&(f===e||i(f,e,n,l,o)))return v.push(t)})){p=!1;break}}else if(f!==m&&!i(f,m,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function Wi(e){return yo(vo(e,void 0,Lo),e+"")}function zi(e){return dl(e,Er,Ji)}function $i(e){return dl(e,yr,Qi)}var Ki=gn?function(e){return gn.get(e)}:Yr;function Vi(e){for(var t=e.name+"",n=En[t],l=_e.call(En,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(_e.call(xn,"placeholder")?xn:e).placeholder}function Gi(){var e=xn.iteratee||Kr;return e=e===Kr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Yi(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 Xi(e){for(var t=Er(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Zi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _l(n)?n:void 0}var Ji=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ke.call(e,t)}))}:nu,Qi=Qt?function(e){for(var t=[];e;)ct(t,Ji(e)),e=We(e);return t}:nu,eo=pl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=Do(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Ha(i)&&io(a,i)&&(Oa(e)||Ia(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:Nn(We(e))}function lo(e){return Oa(e)||Ia(e)||!!(Ge&&e&&e[Ge])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!ja(n))return!1;var l=typeof t;return!!("number"==l?Pa(n)&&io(t,n.length):"string"==l&&t in n)&&xa(n[t],e)}function ao(e,t){if(Oa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ya(e))||W.test(e)||!j.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Vi(e),n=xn[t];if("function"!=typeof n||!(t in On.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=b||pn&&eo(new pn)!=p||vn&&"[object Promise]"!=eo(vn.resolve())||fn&&eo(new fn)!=g||mn&&eo(new mn)!=S)&&(eo=function(e){var t=pl(e),n=t==m?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case yn:return b;case Sn:return p;case _n:return"[object Promise]";case bn:return g;case An:return S}return t});var uo=ye?Fa:lu;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function co(e){return e==e&&!ja(e)}function po(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=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=v(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=v(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function mo(e,t){for(var n=e.length,l=an(t.length,n),i=mi(e);l--;){var o=t[l];e[l]=io(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=_o(Hl),Eo=Xt||function(e,t){return ze.setTimeout(e,t)},yo=_o(jl);function So(e,t,n){var l=t+"";return yo(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(G,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(Y);return t?t[1].split(X):[]}(l),n)))}function _o(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Rl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao=function(e){var t=_a(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===n.size&&n.clear(),e}),n=t.cache;return t}();function Do(e){if("string"==typeof e||Ya(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function To(e){if(e instanceof On)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=mi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var xo=Ml(function(e,t){return Ra(e)?Jn(e,il(t,1,Ra,!0)):[]}),No=Ml(function(e,t){var n=Bo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),Gi(n,2)):[]}),wo=Ml(function(e,t){var n=Bo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),void 0,n):[]});function Io(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),ht(e,Gi(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=tr(n),i=n<0?on(l+i,0):an(i,l-1)),ht(e,Gi(t,3),i,!0)}function Lo(e){return null!=e&&e.length?il(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Ml(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),ko=Ml(function(e){var t=Bo(e),n=st(e,li);return t===Bo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Gi(t,2)):[]}),Mo=Ml(function(e){var t=Bo(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function Bo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fo=Ml(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Ho=Wi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Pl(e,st(t,function(e){return io(e,n)?+e:e}).sort(pi)),l});function jo(e){return null==e?e:cn.call(e)}var Wo=Ml(function(e){return Xl(il(e,1,Ra,!0))}),zo=Ml(function(e){var t=Bo(e);return Ra(t)&&(t=void 0),Xl(il(e,1,Ra,!0),Gi(t,2))}),$o=Ml(function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,Ra,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=on(e.length,t),!0}),Ct(t,function(t){return st(e,_t(t))})}function Vo(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 qo=Ml(function(e,t){return Ra(e)?Jn(e,t):[]}),Go=Ml(function(e){return ti(at(e,Ra))}),Yo=Ml(function(e){var t=Bo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),Gi(t,2))}),Xo=Ml(function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Zo=Ml(Ko),Jo=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,Vo(e,n)});function Qo(e){var t=xn(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=Wi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof On&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),na=gi(function(e,t,n){_e.call(e,n)?++e[n]:Vn(e,n,1)}),la=Di(Io),ia=Di(Oo);function oa(e,t){return(Oa(e)?lt:Qn)(e,Gi(t,3))}function aa(e,t){return(Oa(e)?it:el)(e,Gi(t,3))}var ra=gi(function(e,t,n){_e.call(e,n)?e[n].push(t):Vn(e,n,[t])}),ua=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Pa(e)?v(e.length):[];return Qn(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),sa=gi(function(e,t,n){Vn(e,n,t)});function ca(e,t){return(Oa(e)?st:Cl)(e,Gi(t,3))}var da=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Ml(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),va=Yt||function(){return ze.Date.now()};function fa(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 ma(e,t){var l;if("function"!=typeof t)throw new he(n);return e=tr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ha=Ml(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(ha));l|=32}return Bi(e,l,t,n,i)}),ga=Ml(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(ga));l|=32}return Bi(t,l,e,n,i)});function Ea(e,t,l){var i,o,a,r,u,s,c=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new he(n);function f(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function m(e){return c=e,u=Eo(g,t),d?f(e):r}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=a}function g(){var e=va();if(h(e))return E(e);u=Eo(g,function(e){var n=t-(e-s);return p?an(n,a-(e-c)):n}(e))}function E(e){return u=void 0,v&&i?f(e):(i=o=void 0,r)}function y(){var e=va(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return m(s);if(p)return ui(u),u=Eo(g,t),f(s)}return void 0===u&&(u=Eo(g,t)),r}return t=lr(t)||0,ja(l)&&(d=!!l.leading,a=(p="maxWait"in l)?on(lr(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),y.cancel=function(){void 0!==u&&ui(u),c=0,i=s=o=u=void 0},y.flush=function(){return void 0===u?r:E(va())},y}var ya=Ml(function(e,t){return Zn(e,1,t)}),Sa=Ml(function(e,t,n){return Zn(e,lr(t)||0,n)});function _a(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 a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(_a.Cache||Rn),l}function ba(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)}}_a.Cache=Rn;var Aa=ai(function(e,t){var n=(t=1==t.length&&Oa(t[0])?st(t[0],xt(Gi())):st(il(t,1),xt(Gi()))).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)})}),Da=Ml(function(e,t){return Bi(e,32,void 0,t,Ut(t,qi(Da)))}),Ca=Ml(function(e,t){return Bi(e,64,void 0,t,Ut(t,qi(Ca)))}),Ta=Wi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function xa(e,t){return e===t||e!=e&&t!=t}var Na=Li(vl),wa=Li(function(e,t){return e>=t}),Ia=El(function(){return arguments}())?El:function(e){return Wa(e)&&_e.call(e,"callee")&&!Ke.call(e,"callee")},Oa=v.isArray,La=Ye?xt(Ye):function(e){return Wa(e)&&pl(e)==_};function Pa(e){return null!=e&&Ha(e.length)&&!Fa(e)}function Ra(e){return Wa(e)&&Pa(e)}var ka=en||lu,Ma=Xe?xt(Xe):function(e){return Wa(e)&&pl(e)==u};function Ba(e){if(!Wa(e))return!1;var t=pl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Fa(e){if(!ja(e))return!1;var t=pl(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==tr(e)}function Ha(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var za=Ze?xt(Ze):function(e){return Wa(e)&&eo(e)==p};function $a(e){return"number"==typeof e||Wa(e)&&pl(e)==f}function Ka(e){if(!Wa(e)||pl(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var Va=Je?xt(Je):function(e){return Wa(e)&&pl(e)==h},qa=Qe?xt(Qe):function(e){return Wa(e)&&eo(e)==g};function Ga(e){return"string"==typeof e||!Oa(e)&&Wa(e)&&pl(e)==E}function Ya(e){return"symbol"==typeof e||Wa(e)&&pl(e)==y}var Xa=et?xt(et):function(e){return Wa(e)&&Ha(e.length)&&!!Me[pl(e)]},Za=Li(Dl),Ja=Li(function(e,t){return e<=t});function Qa(e){if(!e)return[];if(Pa(e))return Ga(e)?zt(e):mi(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=eo(e);return(t==p?Bt:t==g?Ht:xr)(e)}function er(e){return e?(e=lr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),n=t%1;return t==t?n?t-n:t:0}function nr(e){return e?Gn(tr(e),0,4294967295):0}function lr(e){if("number"==typeof e)return e;if(Ya(e))return NaN;if(ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=le.test(e);return n||oe.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ir(e){return hi(e,yr(e))}function or(e){return null==e?"":Yl(e)}var ar=Ei(function(e,t){if(so(t)||Pa(t))hi(t,Er(t),e);else for(var n in t)_e.call(t,n)&&Wn(e,n,t[n])}),rr=Ei(function(e,t){hi(t,yr(t),e)}),ur=Ei(function(e,t,n,l){hi(t,yr(t),e,l)}),sr=Ei(function(e,t,n,l){hi(t,Er(t),e,l)}),cr=Wi(qn),dr=Ml(function(e,t){e=ve(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=yr(o),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||xa(c,Ee[s])&&!_e.call(e,s))&&(e[s]=o[s])}return e}),pr=Ml(function(e){return e.push(void 0,Ui),tt(_r,void 0,e)});function vr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function fr(e,t){return null!=e&&to(e,t,ml)}var mr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},jr($r)),hr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Gi),gr=Ml(gl);function Er(e){return Pa(e)?Bn(e):Al(e)}function yr(e){return Pa(e)?Bn(e,!0):function(e){if(!ja(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&_e.call(e,l))&&n.push(l);return n}(e)}var Sr=Ei(function(e,t,n){Nl(e,t,n)}),_r=Ei(function(e,t,n,l){Nl(e,t,n,l)}),br=Wi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),hi(e,$i(e),n),l&&(n=Yn(n,7,Hi));for(var i=t.length;i--;)Zl(n,t[i]);return n}),Ar=Wi(function(e,t){return null==e?{}:function(e,t){return Ol(e,t,function(t,n){return fr(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st($i(e),function(e){return[e]});return t=Gi(t),Ol(e,n,function(e,n){return t(e,n[0])})}var Cr=Mi(Er),Tr=Mi(yr);function xr(e){return null==e?[]:Nt(e,Er(e))}var Nr=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return Br(or(e).toLowerCase())}function Ir(e){return(e=or(e))&&e.replace(re,Pt).replace(we,"")}var Or=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Lr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Pr=_i("toLowerCase"),Rr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,n){return e+(n?" ":"")+Br(t)}),Mr=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Br=_i("toUpperCase");function Fr(e,t,n){return e=or(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ur=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ba(e)?e:new ce(e)}}),Hr=Wi(function(e,t){return lt(t,function(t){t=Do(t),Vn(e,t,ha(e[t],e))}),e});function jr(e){return function(){return e}}var Wr=Ci(),zr=Ci(!0);function $r(e){return e}function Kr(e){return bl("function"==typeof e?e:Yn(e,1))}var Vr=Ml(function(e,t){return function(n){return gl(n,e,t)}}),qr=Ml(function(e,t){return function(n){return gl(e,n,t)}});function Gr(e,t,n){var l=Er(t),i=sl(t,l);null!=n||ja(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Er(t)));var o=!(ja(n)&&"chain"in n&&!n.chain),a=Fa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=mi(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 Yr(){}var Xr=wi(st),Zr=wi(ot),Jr=wi(vt);function Qr(e){return ao(e)?_t(Do(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=Oi(),tu=Oi(!0);function nu(){return[]}function lu(){return!1}var iu,ou=Ni(function(e,t){return e+t},0),au=Ri("ceil"),ru=Ni(function(e,t){return e/t},1),uu=Ri("floor"),su=Ni(function(e,t){return e*t},1),cu=Ri("round"),du=Ni(function(e,t){return e-t},0);return xn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=fa,xn.assign=ar,xn.assignIn=rr,xn.assignInWith=ur,xn.assignWith=sr,xn.at=cr,xn.before=ma,xn.bind=ha,xn.bindAll=Hr,xn.bindKey=ga,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Oa(e)?e:[e]},xn.chain=Qo,xn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(tr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=v(Zt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},xn.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},xn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=v(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Oa(n)?mi(n):[n],il(t,1))},xn.cond=function(e){var t=null==e?0:e.length,l=Gi();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)}})},xn.conforms=function(e){return function(e){var t=Er(e);return function(n){return Xn(n,e,t)}}(Yn(e,1))},xn.constant=jr,xn.countBy=na,xn.create=function(e,t){var n=Nn(e);return null==t?n:Kn(n,t)},xn.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},xn.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},xn.debounce=Ea,xn.defaults=dr,xn.defaultsDeep=pr,xn.defer=ya,xn.delay=Sa,xn.difference=xo,xn.differenceBy=No,xn.differenceWith=wo,xn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:tr(t))<0?0:t,l):[]},xn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t):[]},xn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Gi(t,3),!0,!0):[]},xn.dropWhile=function(e,t){return e&&e.length?Ql(e,Gi(t,3),!0):[]},xn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=tr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:tr(l))<0&&(l+=i),l=n>l?0:nr(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},xn.filter=function(e,t){return(Oa(e)?at:ll)(e,Gi(t,3))},xn.flatMap=function(e,t){return il(ca(e,t),1)},xn.flatMapDeep=function(e,t){return il(ca(e,t),1/0)},xn.flatMapDepth=function(e,t,n){return n=void 0===n?1:tr(n),il(ca(e,t),n)},xn.flatten=Lo,xn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},xn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:tr(t)):[]},xn.flip=function(e){return Bi(e,512)},xn.flow=Wr,xn.flowRight=zr,xn.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},xn.functions=function(e){return null==e?[]:sl(e,Er(e))},xn.functionsIn=function(e){return null==e?[]:sl(e,yr(e))},xn.groupBy=ra,xn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},xn.intersection=Ro,xn.intersectionBy=ko,xn.intersectionWith=Mo,xn.invert=mr,xn.invertBy=hr,xn.invokeMap=ua,xn.iteratee=Kr,xn.keyBy=sa,xn.keys=Er,xn.keysIn=yr,xn.map=ca,xn.mapKeys=function(e,t){var n={};return t=Gi(t,3),rl(e,function(e,l,i){Vn(n,t(e,l,i),e)}),n},xn.mapValues=function(e,t){var n={};return t=Gi(t,3),rl(e,function(e,l,i){Vn(n,l,t(e,l,i))}),n},xn.matches=function(e){return Tl(Yn(e,1))},xn.matchesProperty=function(e,t){return xl(e,Yn(t,1))},xn.memoize=_a,xn.merge=Sr,xn.mergeWith=_r,xn.method=Vr,xn.methodOf=qr,xn.mixin=Gr,xn.negate=ba,xn.nthArg=function(e){return e=tr(e),Ml(function(t){return wl(t,e)})},xn.omit=br,xn.omitBy=function(e,t){return Dr(e,ba(Gi(t)))},xn.once=function(e){return ma(2,e)},xn.orderBy=function(e,t,n,l){return null==e?[]:(Oa(t)||(t=null==t?[]:[t]),Oa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},xn.over=Xr,xn.overArgs=Aa,xn.overEvery=Zr,xn.overSome=Jr,xn.partial=Da,xn.partialRight=Ca,xn.partition=da,xn.pick=Ar,xn.pickBy=Dr,xn.property=Qr,xn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},xn.pull=Fo,xn.pullAll=Uo,xn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Gi(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},xn.pullAt=Ho,xn.range=eu,xn.rangeRight=tu,xn.rearg=Ta,xn.reject=function(e,t){return(Oa(e)?at:ll)(e,ba(Gi(t,3)))},xn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Gi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},xn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(e,t=void 0===t?t:tr(t))},xn.reverse=jo,xn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),(Oa(e)?Un:Fl)(e,t)},xn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},xn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},xn.shuffle=function(e){return(Oa(e)?Hn:Wl)(e)},xn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:tr(t),n=void 0===n?l:tr(n)),zl(e,t,n)):[]},xn.sortBy=pa,xn.sortedUniq=function(e){return e&&e.length?ql(e):[]},xn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Gi(t,2)):[]},xn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=Yl(t))&&Mt(e)?ri(zt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:on(tr(t),0),Ml(function(n){var l=n[t],i=ri(n,0,t);return l&&ct(i,l),tt(e,this,i)})},xn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:tr(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t,l):[]},xn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Gi(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?Ql(e,Gi(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new he(n);return ja(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},xn.thru=ea,xn.toArray=Qa,xn.toPairs=Cr,xn.toPairsIn=Tr,xn.toPath=function(e){return Oa(e)?st(e,Do):Ya(e)?[e]:mi(Ao(or(e)))},xn.toPlainObject=ir,xn.transform=function(e,t,n){var l=Oa(e),i=l||ka(e)||Xa(e);if(t=Gi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:ja(e)&&Fa(o)?Nn(We(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},xn.unary=function(e){return fa(e,1)},xn.union=Wo,xn.unionBy=zo,xn.unionWith=$o,xn.uniq=function(e){return e&&e.length?Xl(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Xl(e,Gi(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Zl(e,t)},xn.unzip=Ko,xn.unzipWith=Vo,xn.update=function(e,t,n){return null==e?e:Jl(e,t,ii(n))},xn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,ii(n),l)},xn.values=xr,xn.valuesIn=function(e){return null==e?[]:Nt(e,yr(e))},xn.without=qo,xn.words=Fr,xn.wrap=function(e,t){return Da(ii(t),e)},xn.xor=Go,xn.xorBy=Yo,xn.xorWith=Xo,xn.zip=Zo,xn.zipObject=function(e,t){return ni(e||[],t||[],Wn)},xn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},xn.zipWith=Jo,xn.entries=Cr,xn.entriesIn=Tr,xn.extend=rr,xn.extendWith=ur,Gr(xn,xn),xn.add=ou,xn.attempt=Ur,xn.camelCase=Nr,xn.capitalize=wr,xn.ceil=au,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=lr(n))==n?n:0),void 0!==t&&(t=(t=lr(t))==t?t:0),Gn(lr(e),t,n)},xn.clone=function(e){return Yn(e,4)},xn.cloneDeep=function(e){return Yn(e,5)},xn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Xn(e,t,Er(t))},xn.deburr=Ir,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=ru,xn.endsWith=function(e,t,n){e=or(e),t=Yl(t);var l=e.length,i=n=void 0===n?l:Gn(tr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},xn.eq=xa,xn.escape=function(e){return(e=or(e))&&B.test(e)?e.replace(k,Rt):e},xn.escapeRegExp=function(e){return(e=or(e))&&K.test(e)?e.replace($,"\\$&"):e},xn.every=function(e,t,n){var l=Oa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Gi(t,3))},xn.find=la,xn.findIndex=Io,xn.findKey=function(e,t){return mt(e,Gi(t,3),rl)},xn.findLast=ia,xn.findLastIndex=Oo,xn.findLastKey=function(e,t){return mt(e,Gi(t,3),ul)},xn.floor=uu,xn.forEach=oa,xn.forEachRight=aa,xn.forIn=function(e,t){return null==e?e:ol(e,Gi(t,3),yr)},xn.forInRight=function(e,t){return null==e?e:al(e,Gi(t,3),yr)},xn.forOwn=function(e,t){return e&&rl(e,Gi(t,3))},xn.forOwnRight=function(e,t){return e&&ul(e,Gi(t,3))},xn.get=vr,xn.gt=Na,xn.gte=wa,xn.has=function(e,t){return null!=e&&to(e,t,fl)},xn.hasIn=fr,xn.head=Po,xn.identity=$r,xn.includes=function(e,t,n,l){e=Pa(e)?e:xr(e),n=n&&!l?tr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ga(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&gt(e,t,n)>-1},xn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),gt(e,t,i)},xn.inRange=function(e,t,n){return t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=lr(e),t,n)},xn.invoke=gr,xn.isArguments=Ia,xn.isArray=Oa,xn.isArrayBuffer=La,xn.isArrayLike=Pa,xn.isArrayLikeObject=Ra,xn.isBoolean=function(e){return!0===e||!1===e||Wa(e)&&pl(e)==r},xn.isBuffer=ka,xn.isDate=Ma,xn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ka(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(Oa(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Xa(e)||Ia(e)))return!e.length;var t=eo(e);if(t==p||t==g)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},xn.isEqual=function(e,t){return yl(e,t)},xn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?yl(e,t,void 0,n):!!l},xn.isError=Ba,xn.isFinite=function(e){return"number"==typeof e&&tn(e)},xn.isFunction=Fa,xn.isInteger=Ua,xn.isLength=Ha,xn.isMap=za,xn.isMatch=function(e,t){return e===t||Sl(e,t,Xi(t))},xn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Xi(t),n)},xn.isNaN=function(e){return $a(e)&&e!=+e},xn.isNative=function(e){if(uo(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _l(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=$a,xn.isObject=ja,xn.isObjectLike=Wa,xn.isPlainObject=Ka,xn.isRegExp=Va,xn.isSafeInteger=function(e){return Ua(e)&&e>=-9007199254740991&&e<=9007199254740991},xn.isSet=qa,xn.isString=Ga,xn.isSymbol=Ya,xn.isTypedArray=Xa,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Wa(e)&&eo(e)==S},xn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==pl(e)},xn.join=function(e,t){return null==e?"":nn.call(e,t)},xn.kebabCase=Or,xn.last=Bo,xn.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=tr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ht(e,yt,i,!0)},xn.lowerCase=Lr,xn.lowerFirst=Pr,xn.lt=Za,xn.lte=Ja,xn.max=function(e){return e&&e.length?nl(e,$r,vl):void 0},xn.maxBy=function(e,t){return e&&e.length?nl(e,Gi(t,2),vl):void 0},xn.mean=function(e){return St(e,$r)},xn.meanBy=function(e,t){return St(e,Gi(t,2))},xn.min=function(e){return e&&e.length?nl(e,$r,Dl):void 0},xn.minBy=function(e,t){return e&&e.length?nl(e,Gi(t,2),Dl):void 0},xn.stubArray=nu,xn.stubFalse=lu,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=su,xn.nth=function(e,t){return e&&e.length?wl(e,tr(t)):void 0},xn.noConflict=function(){return ze._===this&&(ze._=Te),this},xn.noop=Yr,xn.now=va,xn.pad=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Jt(i),n)+e+Ii(Zt(i),n)},xn.padEnd=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;return t&&l<t?e+Ii(t-l,n):e},xn.padStart=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;return t&&l<t?Ii(t-l,n)+e:e},xn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(or(e).replace(V,""),t||0)},xn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(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=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Rl(e,t)},xn.reduce=function(e,t,n){var l=Oa(e)?dt:At,i=arguments.length<3;return l(e,Gi(t,4),n,i,Qn)},xn.reduceRight=function(e,t,n){var l=Oa(e)?pt:At,i=arguments.length<3;return l(e,Gi(t,4),n,i,el)},xn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),kl(or(e),t)},xn.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Do(t[l])];void 0===o&&(l=i,o=n),e=Fa(o)?o.call(e):o}return e},xn.round=cu,xn.runInContext=e,xn.sample=function(e){return(Oa(e)?Fn:Bl)(e)},xn.size=function(e){if(null==e)return 0;if(Pa(e))return Ga(e)?Wt(e):e.length;var t=eo(e);return t==p||t==g?e.size:Al(e).length},xn.snakeCase=Rr,xn.some=function(e,t,n){var l=Oa(e)?vt:$l;return n&&oo(e,t,n)&&(t=void 0),l(e,Gi(t,3))},xn.sortedIndex=function(e,t){return Kl(e,t)},xn.sortedIndexBy=function(e,t,n){return Vl(e,t,Gi(n,2))},xn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&xa(e[l],t))return l}return-1},xn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},xn.sortedLastIndexBy=function(e,t,n){return Vl(e,t,Gi(n,2),!0)},xn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(xa(e[n],t))return n}return-1},xn.startCase=kr,xn.startsWith=function(e,t,n){return e=or(e),n=null==n?0:Gn(tr(n),0,e.length),t=Yl(t),e.slice(n,n+t.length)==t},xn.subtract=du,xn.sum=function(e){return e&&e.length?Dt(e,$r):0},xn.sumBy=function(e,t){return e&&e.length?Dt(e,Gi(t,2)):0},xn.template=function(e,t,n){var l=xn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=or(e),t=ur({},t,l,Fi);var i,o,a=ur({},t.imports,l.imports,Fi),r=Er(a),u=Nt(a,r),s=0,c=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var f=_e.call(t,"variable")&&t.variable;if(f){if(J.test(f))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(O,""):d).replace(L,"$1").replace(P,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"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 m=Ur(function(){return de(r,v+"return "+d).apply(void 0,u)});if(m.source=d,Ba(m))throw m;return m},xn.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Gi(t));++n<e;)t(n);return i},xn.toFinite=er,xn.toInteger=tr,xn.toLength=nr,xn.toLower=function(e){return or(e).toLowerCase()},xn.toNumber=lr,xn.toSafeInteger=function(e){return e?Gn(tr(e),-9007199254740991,9007199254740991):0===e?e:0},xn.toString=or,xn.toUpper=function(e){return or(e).toUpperCase()},xn.trim=function(e,t,n){if((e=or(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Yl(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),Ot(l,i)+1).join("")},xn.trimEnd=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Yl(t)))return e;var l=zt(e);return ri(l,0,Ot(l,zt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.replace(V,"");if(!e||!(t=Yl(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},xn.truncate=function(e,t){var n=30,l="...";if(ja(t)){var i="separator"in t?t.separator:i;n="length"in t?tr(t.length):n,l="omission"in t?Yl(t.omission):l}var o=(e=or(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),Va(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=fe(i.source,or(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf(Yl(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},xn.unescape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Kt):e},xn.uniqueId=function(e){var t=++be;return or(e)+t},xn.upperCase=Mr,xn.upperFirst=Br,xn.each=oa,xn.eachRight=aa,xn.first=Po,Gr(xn,(iu={},rl(xn,function(e,t){_e.call(xn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),xn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){xn[e].placeholder=xn}),lt(["drop","take"],function(e,t){On.prototype[e]=function(n){n=void 0===n?1:on(tr(n),0);var l=this.__filtered__&&!t?new On(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},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Gi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}}),On.prototype.compact=function(){return this.filter($r)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new On(this):this.map(function(n){return gl(n,e,t)})}),On.prototype.reject=function(e){return this.filter(ba(Gi(e)))},On.prototype.slice=function(e,t){e=tr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=tr(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},rl(On.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=xn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(xn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof On,u=a[0],s=r||Oa(t),c=function(e){var t=i.apply(xn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,f=r&&!p;if(!o&&s){t=f?t:new On(this);var m=e.apply(t,a);return m.__actions__.push({func:ea,args:[c],thisArg:void 0}),new In(m,d)}return v&&f?e.apply(this,a):(m=this.thru(c),v?l?m.value()[0]:m.value():m)})}),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);xn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Oa(i)?i:[],e)}return this[n](function(n){return t.apply(Oa(n)?n:[],e)})}}),rl(On.prototype,function(e,t){var n=xn[t];if(n){var l=n.name+"";_e.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Oa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ei(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,h=e[s+=t];++m<d;){var g=c[m],E=g.type,y=(0,g.iteratee)(h);if(2==E)h=y;else if(!y){if(1==E)continue e;break e}}f[p++]=h}return f},xn.prototype.at=ta,xn.prototype.chain=function(){return Qo(this)},xn.prototype.commit=function(){return new In(this.value(),this.__chain__)},xn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Qa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof wn;){var l=To(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},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:ea,args:[jo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(jo)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,ft&&(xn.prototype[ft]=function(){return this}),xn}();Ke?((Ke.exports=Vt)._=Vt,$e._=Vt):ze._=Vt}).call(v)});const Ve=e=>l.createElement("h1",{className:"heading-m"},e.label),qe=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ge=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qe,null)),Ye=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:h,data:g}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[E,y]=n.useState({}),[S,_]=n.useState({}),[b,A]=n.useState([]),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState(null),[P,R]=n.useState([]),[k,M]=n.useState(null),[B,F]=n.useState(!1);function U(e){x(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&R(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(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=O(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{r&&y(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${i.action}_APPLICATION`,submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:P,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:v}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${i("ES_PT_ATTACH_FILE")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload: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:a,action:r,approvers:b,selectedApprover:D,setSelectedApprover:C,selectFile:U,uploadedFile:N,setUploadedFile:w,businessService:p}))},[r,b,P,k,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ve,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Ge,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:m||(null==r?void 0:r.docUploadRequired)&&!N,formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};d.creationReason="STATUS",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...d,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.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==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]),c({Property:{...d,workflow:t}})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},Xe=e=>l.createElement("h1",{className:"heading-m"},e.label),Ze=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ze,null)),Qe=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:m}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState({}),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState([]),[P,R]=n.useState(null);n.useEffect(()=>{var e;m&&m["egf-master"]&&L(null===(e=m["egf-master"])||void 0===e?void 0:e.FinancialYear)},[m]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){C(e.target.files[0])}return n.useEffect(()=>{if(v&&k){var e;const t=k["common-masters"].Department;_(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,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:`${null==e||null===(i=e.user)||void 0===i?void 0:i.name} - ${null==a?void 0:a.name}`}}))}},[v]),n.useEffect(()=>{!function(){try{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=O(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(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,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:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:M,uploadedFile:T,setUploadedFile:x,businessService:p}))},[r,S,I,P,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Je,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null},c({Licenses:[d]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},et=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),tt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),nt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tt,null)),lt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[m,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[_,b]=n.useState({}),[A,D]=n.useState(null),[C,T]=n.useState(null),[x,N]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function I(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{N(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))N(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=O(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?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{r&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(v=!1),i.isTerminateState&&(v=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:I,uploadedFile:C,setUploadedFile:T,businessService:p,error:x}))},[r,y,C,x]),r&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(et,{label:a(m.label.heading)}),headerBarEnd:l.createElement(nt,{onClick:s}),actionCancelLabel:a(m.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(m.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:m.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=_&&_.uuid?[null==_?void 0:_.uuid]:null,wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:null},c({Licenses:[d]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},it=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ot=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),at=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ot,null)),rt=e=>{var i,o,r,u,s,c,d,p,v,f,m,h;let{t:g,action:E,tenantId:y,closeModal:S,submitAction:_,applicationDetails:b,applicationData:A,businessService:D,workflowDetails:C,blockReason:T}=e;console.log("applicationData",A),console.log("workflowDetails",C),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===(c=s.address)||void 0===c?void 0:c.city:y,!1);const{data:x,isLoading:N}=Digit.Hooks.useEmployeeSearch(y,{roles:null==C||null===(d=C.data)||void 0===d||null===(p=d.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(f=v.filter(e=>(null==e?void 0:e.action)==(null==E?void 0:E.action)))||void 0===f||null===(m=f[0])||void 0===m||null===(h=m.assigneeRoles)||void 0===h?void 0:h.map(e=>({code:e})),isActive:!0},{enabled:!(null!=E&&E.isTerminateState)}),[w,I]=(a.useQueryClient(),n.useState({})),[L,P]=n.useState({}),[R,k]=n.useState([]),[M,B]=n.useState([]),[F,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[$,K]=n.useState(null),[V,q]=n.useState(null),[G,Y]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function Z(e){z(e.target.files[0])}n.useEffect(()=>{var e;k(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{q(null);const e=function(){if(W){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(W.size>=5242880)q(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))q(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=O(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?K(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):q(g("CS_FILE_UPLOAD_ERROR"))})},function(){q(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)}}()},[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,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),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===(a=l)||void 0===a?void 0:a.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,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},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(()=>{B(null==T?void 0:T.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),E&&I((e=>{var n,i,o,a,r,u,s;let{t:c,action:d,approvers:p,selectedApprover:v,setSelectedApprover:f,selectedBlockReason:m,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:y,assigneeLabel:S,businessService:_,error:b,blockReasonFiltered:A}=e,D=!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)||(D=!0),{label:{heading:`WF_${null==d?void 0:d.action}_APPLICATION`,submit:`WF_${_}_${null==d?void 0:d.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||D||"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(S||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||D||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:f,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:m,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:g,onDelete:()=>{y(null)},message:E?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:g,action:E,approvers:R,selectedApprover:F,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:$,setUploadedFile:K,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:V,blockReasonFiltered:M}))},[E,R,G,$,V]),E&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(it,{label:g(w.label.heading)}),headerBarEnd:l.createElement(at,{onClick:S}),actionCancelLabel:g(w.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(w.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"}:{}},N?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,a,r,u,s,c,d,p,v,f,m,h,D,T,x,N,w,I,O,L,P,R,k;A={...A,documents:te(),additionalDetails:{...null===(t=A)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(A),pendingapproval:ne(),blockingReason:null==H?void 0:H.name},workflow:{action:null==E?void 0:E.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==C||null===(i=C.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==C||null===(u=C.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!=F&&F.uuid?[null==F?void 0:F.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==C||null===(p=C.data)||void 0===p||null===(v=p.processInstances)||void 0===v||null===(f=v[0])||void 0===f||null===(m=f.state)||void 0===m?void 0:m.applicationStatus)?[null==C||null===(h=C.data)||void 0===h||null===(D=h.processInstances)||void 0===D||null===(T=D[0])||void 0===T||null===(x=T.assigner)||void 0===x?void 0:x.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,varificationDocuments:$?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null},action:null==E?void 0:E.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==C||null===(N=C.data)||void 0===N||null===(w=N.processInstances)||void 0===w||null===(I=w[0])||void 0===I||null===(O=I.state)||void 0===O?void 0:O.applicationStatus)?[null==C||null===(L=C.data)||void 0===L||null===(P=L.processInstances)||void 0===P||null===(R=P[0])||void 0===R||null===(k=R.assigner)||void 0===k?void 0:k.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,wfDocuments:$?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null};const M=function(e,t,n,l,i,o,a,r,u,s,c,d){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===(a=A)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=A)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.selfCertificationCharges)||void 0===d?void 0:d.BPA_GAUSHALA_CHARGES_CESS))){var p,v,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==b||null===(p=b.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(f=v.Noc)||void 0===f?void 0:f.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,a,r;"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===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=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,a,r,u,s,c,d,p,v,f,m;("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===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l||"FIRE_NOC"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.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?_({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 _({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)},ut=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),st=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),dt=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:v,businessService:f}=e;const{data:m,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[g,E]=(a.useQueryClient(),n.useState({})),[y,S]=n.useState({}),[_,b]=n.useState([]),[A,D]=n.useState({}),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function P(e){T(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=O(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",C,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(u("CS_FILE_UPLOAD_ERROR"))})},function(){I(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{s&&E((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(m=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${v}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:m,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload: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:f})}]}]}})({t:u,action:s,approvers:_,selectedApprover:A,setSelectedApprover:D,selectFile:P,uploadedFile:x,setUploadedFile:N,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[s,_,x,w]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ut,{label:u(g.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:d}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:d,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={...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==C?void 0:C.name,fileStoreId:x}]:null},documents:o},p({Noc:v},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};function pt(e){var t=this.__data__=new Ie(e);this.size=t.size}pt.prototype.clear=function(){this.__data__=new Ie,this.size=0},pt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},pt.prototype.get=function(e){return this.__data__.get(e)},pt.prototype.has=function(e){return this.__data__.has(e)},pt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ie){var l=n.__data__;if(!Oe||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Re(l)}return n.set(e,t),this.size=n.size,this};var vt=pt,ft=function(){try{var e=Se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),mt=function(e,t,n){"__proto__"==t&&ft?ft(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ht=Object.prototype.hasOwnProperty,gt=function(e,t,n){var l=e[t];ht.call(e,t)&&Te(l,n)&&(void 0!==n||t in e)||mt(e,t,n)},Et=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?mt(n,r,u):gt(n,r,u)}return n},yt=function(e){return ue(e)&&"[object Arguments]"==re(e)},St=Object.prototype,_t=St.hasOwnProperty,bt=St.propertyIsEnumerable,At=yt(function(){return arguments}())?yt:function(e){return ue(e)&&_t.call(e,"callee")&&!bt.call(e,"callee")},Dt=function(){return!1},Ct=f(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Q.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Dt}),Tt=/^(?:0|[1-9]\d*)$/,xt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Tt.test(e))&&e>-1&&e%1==0&&e<t},Nt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},wt={};wt["[object Float32Array]"]=wt["[object Float64Array]"]=wt["[object Int8Array]"]=wt["[object Int16Array]"]=wt["[object Int32Array]"]=wt["[object Uint8Array]"]=wt["[object Uint8ClampedArray]"]=wt["[object Uint16Array]"]=wt["[object Uint32Array]"]=!0,wt["[object Arguments]"]=wt["[object Array]"]=wt["[object ArrayBuffer]"]=wt["[object Boolean]"]=wt["[object DataView]"]=wt["[object Date]"]=wt["[object Error]"]=wt["[object Function]"]=wt["[object Map]"]=wt["[object Number]"]=wt["[object Object]"]=wt["[object RegExp]"]=wt["[object Set]"]=wt["[object String]"]=wt["[object WeakMap]"]=!1;var It=function(e){return function(t){return e(t)}},Ot=f(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&Z.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Lt=Ot&&Ot.isTypedArray,Pt=Lt?It(Lt):function(e){return ue(e)&&Nt(e.length)&&!!wt[re(e)]},Rt=Object.prototype.hasOwnProperty,kt=function(e,t){var n=X(e),l=!n&&At(e),i=!n&&!l&&Ct(e),o=!n&&!l&&!i&&Pt(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!Rt.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||xt(s,u))||r.push(s);return r},Mt=Object.prototype,Bt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Mt)},Ft=function(e,t){return function(n){return e(t(n))}},Ut=Ft(Object.keys,Object),Ht=Object.prototype.hasOwnProperty,jt=function(e){return null!=e&&Nt(e.length)&&!ve(e)},Wt=function(e){return jt(e)?kt(e):function(e){if(!Bt(e))return Ut(e);var t=[];for(var n in Object(e))Ht.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},zt=Object.prototype.hasOwnProperty,$t=function(e){return jt(e)?kt(e,!0):function(e){if(!pe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Bt(e),n=[];for(var l in e)("constructor"!=l||!t&&zt.call(e,l))&&n.push(l);return n}(e)},Kt=f(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Q.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}}),Vt=function(){return[]},qt=Object.prototype.propertyIsEnumerable,Gt=Object.getOwnPropertySymbols,Yt=Gt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];qt.call(e,r)&&(a[o++]=r)}return a}(Gt(e)))}:Vt,Xt=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Zt=Ft(Object.getPrototypeOf,Object),Jt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Xt(t,Yt(e)),e=Zt(e);return t}:Vt,Qt=function(e,t,n){var l=t(e);return X(e)?l:Xt(l,n(e))},en=function(e){return Qt(e,Wt,Yt)},tn=function(e){return Qt(e,$t,Jt)},nn=Se(Q,"DataView"),ln=Se(Q,"Promise"),on=Se(Q,"Set"),an=Se(Q,"WeakMap"),rn=ge(nn),un=ge(Oe),sn=ge(ln),cn=ge(on),dn=ge(an),pn=re;(nn&&"[object DataView]"!=pn(new nn(new ArrayBuffer(1)))||Oe&&"[object Map]"!=pn(new Oe)||ln&&"[object Promise]"!=pn(ln.resolve())||on&&"[object Set]"!=pn(new on)||an&&"[object WeakMap]"!=pn(new an))&&(pn=function(e){var t=re(e),n="[object Object]"==t?e.constructor:void 0,l=n?ge(n):"";if(l)switch(l){case rn:return"[object DataView]";case un:return"[object Map]";case sn:return"[object Promise]";case cn:return"[object Set]";case dn:return"[object WeakMap]"}return t});var vn=pn,fn=Object.prototype.hasOwnProperty,mn=Q.Uint8Array,hn=function(e){var t=new e.constructor(e.byteLength);return new mn(t).set(new mn(e)),t},gn=/\w*$/,En=ee?ee.prototype:void 0,yn=En?En.valueOf:void 0,Sn=Object.create,_n=function(){function e(){}return function(t){if(!pe(t))return{};if(Sn)return Sn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),bn=Ot&&Ot.isMap,An=bn?It(bn):function(e){return ue(e)&&"[object Map]"==vn(e)},Dn=Ot&&Ot.isSet,Cn=Dn?It(Dn):function(e){return ue(e)&&"[object Set]"==vn(e)},Tn={};Tn["[object Arguments]"]=Tn["[object Array]"]=Tn["[object ArrayBuffer]"]=Tn["[object DataView]"]=Tn["[object Boolean]"]=Tn["[object Date]"]=Tn["[object Float32Array]"]=Tn["[object Float64Array]"]=Tn["[object Int8Array]"]=Tn["[object Int16Array]"]=Tn["[object Int32Array]"]=Tn["[object Map]"]=Tn["[object Number]"]=Tn["[object Object]"]=Tn["[object RegExp]"]=Tn["[object Set]"]=Tn["[object String]"]=Tn["[object Symbol]"]=Tn["[object Uint8Array]"]=Tn["[object Uint8ClampedArray]"]=Tn["[object Uint16Array]"]=Tn["[object Uint32Array]"]=!0,Tn["[object Error]"]=Tn["[object Function]"]=Tn["[object WeakMap]"]=!1;var xn=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!pe(t))return t;var d=X(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&fn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var p=vn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(Ct(t))return Kt(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=s||v?{}:function(e){return"function"!=typeof e.constructor||Bt(e)?{}:_n(Zt(e))}(t),!u)return s?function(e,t){return Et(e,Jt(e),t)}(t,function(e,t){return e&&Et(t,$t(t),e)}(r,t)):function(e,t){return Et(e,Yt(e),t)}(t,function(e,t){return e&&Et(t,Wt(t),e)}(r,t))}else{if(!Tn[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return hn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?hn(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?hn(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,gn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return yn?Object(yn.call(e)):{}}}(t,p,u)}}a||(a=new vt);var f=a.get(t);if(f)return f;a.set(t,r),Cn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):An(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var m=d?void 0:(c?s?tn:en:s?$t:Wt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(m||t,function(i,o){m&&(i=t[o=i]),gt(r,o,e(i,n,l,o,t,a))}),r},Nn=function(e){return xn(e,5)};const wn=e=>l.createElement("h1",{className:"heading-m"},e.label),In=()=>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"})),On=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(In,null)),Ln=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}},Pn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[m,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[_,b]=n.useState({}),[A,D]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),L=window.location.href.includes("/employee");function P(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{w(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))w(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=O(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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=d)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=d)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&h((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:p,error:v}=e,f=!0,m=!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)||(m=!0),{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:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},m&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!m,type:"custom",populators:m?{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:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:P,uploadedFile:T,setUploadedFile:x,businessService:p,error:N})):r&&h((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:p,error:v}=e,f=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!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:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:P,uploadedFile:T,setUploadedFile:x,businessService:p,error:N}))},[r,y,T,N]),r&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(wn,{label:a(m.label.heading)}),headerBarEnd:l.createElement(On,{onClick:s}),actionCancelLabel:a(m.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&L?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,p,v,f;if(null!==(t=d)&&void 0!==t&&t.isBillAmend){var m,h,g,E,y,S,b,D,C;const t={...null===(m=d)||void 0===m||null===(h=m.billAmendmentDetails)||void 0===h?void 0:h.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(g=d)||void 0===g?void 0:g.billAmendmentDetails,workflow:{businessId:null===(E=d)||void 0===E||null===(y=E.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=d)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=d)&&void 0!==D&&null!==(C=D.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=_&&_.uuid?[{uuid:null==_?void 0:_.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=_&&_.uuid?[{uuid:null==_?void 0:_.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:[]}};c({AmendmentUpdate:n})}else{if(d={...d,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=_&&_.uuid?[null==_?void 0:_.uuid]:[],assignes:null!=_&&_.uuid?[{uuid:null==_?void 0:_.uuid}]:[],wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:null,processInstance:{...null===(n=d)||void 0===n?void 0:n.processInstance,action:null==r?void 0:r.action,assignes:null!=_&&_.uuid?[{uuid:null==_?void 0:_.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:T}]:[]}},null!=e&&e.date&&null!==(l=d)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=Nn(null==e?void 0:e.date);d.disconnectionExecutionDate=Ln(t)}else if(null!=e&&e.date){const t=Nn(null==e?void 0:e.date);d.connectionExecutionDate=Ln(t)}var x;if("DisconnectWSConnection"==(null===(o=d)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=d)||void 0===s||null===(p=s.processInstance)||void 0===p?void 0:p.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(x=d)||void 0===x?void 0:x.serviceType)?c({WaterConnection:d,disconnectRequest:!0}):c({SewerageConnection:d,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=d)||void 0===v?void 0:v.applicationType))c({SewerageConnection:d,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=d)||void 0===f?void 0:f.applicationType))c({WaterConnection:d,disconnectRequest:!1,reconnectRequest:!0});else{var N,w,I,O,L,P,R,k,M,B,F,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(d.additionalDetails.adhocPenalty=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenalty)||""),null!=t&&null!==(I=t.value)&&void 0!==I&&I.adhocPenaltyComment&&(d.additionalDetails.adhocPenaltyComment=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(d.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocRebate&&(d.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(d.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateReason&&(d.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=d)||void 0===H?void 0:H.serviceType)?c({WaterConnection:d,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:d,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Rn=e=>l.createElement("h1",{className:"heading-m"},e.label),kn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Mn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(kn,null)),Bn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[m,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[_,b]=n.useState(null),[A,D]=n.useState(null),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=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{N(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=O(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?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{r&&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:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Rn,{label:a(m.label.heading)}),headerBarEnd:l.createElement(Mn,{onClick:s}),actionCancelLabel:a(m.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};d.creationReason="CREATE",c({PetRegistrationApplications:[{...d,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=r&&r.isTerminateState||!_?[]:[_],C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]),c({PetRegistrationApplications:[{...d,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Fn=e=>l.createElement("h1",{className:"heading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),jn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const v=Digit.ULBService.getStateId(),{data:f,isLoading:m}=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",d);const[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState(""),[D,C]=n.useState([]),[T,x]=n.useState(null),N=null===(o=d)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",N);const w=n.useMemo(()=>{var e;if(m||!f||!N.length)return[];const t=new Set(N.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"]},[m,f,N]);return console.log("years",w),n.useEffect(()=>{u&&g((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,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:r,selected:a})}]}]}})({t:r,action:u,years:w,selectedApprover:b,setSelectedApprover:A,businessService:p}))},[u,w,D,T]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Fn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){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:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Wn=e=>l.createElement("h1",{className:"heading-m"},e.label),zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(zn,null)),Kn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[m,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[_,b]=n.useState(null),[A,D]=n.useState(null),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=n.useState(!1);function P(e){I(!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{N(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=L(function(){return O(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?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(I(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),console.log("actyhdesh,jhfsefsef",r,d),n.useEffect(()=>{h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,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:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:P,uploadedFile:C,setUploadedFile:T,businessService:p,isUploading:w}))},[r,y,C]),r&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wn,{label:a(m.label.heading)}),headerBarEnd:l.createElement($n,{onClick:s}),actionCancelLabel:a(m.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==d||null===(t=d.auditDetails)||void 0===t?void 0:t.createdBy]:null!=_&&_.uuid?[null==_?void 0:_.uuid]:null};C&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]),c({streetVendingDetail:{...d,workflow:n}})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Vn=e=>l.createElement("h1",{className:"heading-m"},e.label),qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qn,null)),Yn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[m,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[_,b]=n.useState(null),[A,D]=n.useState(null),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=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{N(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=O(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?T(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):N(a("CS_FILE_UPLOAD_ERROR"))})},function(){N(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{r&&h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${u}_${null==i?void 0:i.action}`,cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_CHB_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:_,setSelectedApprover:b,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vn,{label:a(m.label.heading)}),headerBarEnd:l.createElement(Gn,{onClick:s}),actionCancelLabel:a(m.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};C&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:C}]),c({hallsBookingApplication:[{...d,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Xn=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ye,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Bn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Qe,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(jn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(lt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(rt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(dt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Pn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Kn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Yn,e):void 0;function Zn(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!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)),a?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"}}),a?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(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 Jn=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,f]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[m,h]=n.useState(null),[g,E]=n.useState([]),[y,S]=n.useState(!0),[_,b]=n.useState(!1),[A,D]=n.useState(!1),{isLoading:C,data:T}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:x,data:N}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let 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==N||null===(t=N["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)),E(s)},[!C,!x]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,_]),n.useEffect(()=>{D("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Qn,{key:t,index:t,document:e,t:o,error:m,setError:h,setDocuments:f,documents:v,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function Qn(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[m,h]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey: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]:{}),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[_,b]=n.useState([]);return n.useEffect(()=>{null!=m&&m.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==m?void 0:m.code,fileStoreId:y,documentUid:y,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==m?void 0:m.code)))||void 0===t?void 0:t.id:void 0}]})},[y,m]),n.useEffect(()=>{try{_.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],_.map(e=>{var t,n,l;null!=m&&m.code&&r.newUploadedDocs.push({documentType:null==m?void 0:m.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),d[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[_,m]),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"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Zn,{documents:null==r?void 0:r.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!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:m,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&&b(l),(i=l[l.length-1])&&E(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function el(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,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)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${i+1}`),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(o=e.date)||void 0===o?void 0:o.split("-")[2]}/${null===(r=e.date)||void 0===r?void 0:r.split("-")[1]}/${null===(u=e.date)||void 0===u?void 0:u.split("-")[0]}`:null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(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:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Zn,{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 tl(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,f]=n.useState(null),[m,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==m?void 0:m.length)||null===m?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==m),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:m,documentUid:m,fileName:(null==v?void 0:v.name)||""}]})},[m]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=O(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&f(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const nl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==s?void 0:s.status)||"",f=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:m}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[E,y]=n.useState([]),[S,_]=n.useState([]),[b,A]=n.useState(!1),[D,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,x]=n.useState(null),N=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;y(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,c,d;l=u?null==m||null===(o=m.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==E||E.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)}),_(p))},[m,E]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===v&&(null==f?void 0:f.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:N?""+o(`BPA_${null==a?void 0:a.nocType}_HEADER`):o(`BPA_${null==a?void 0:a.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:N?""+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:N?""+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(Zn,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(tl,{key:t,document:e,t:o,error:T,setError:x,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:b}))))},ll=e=>{let{permissions:i,t:o}=e;const[a,r,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==a?void 0:a.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;r(()=>null==a?void 0:a.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 il(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=i.useTranslation(),[s,c]=n.useState(()=>[]),[d,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),f=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!f&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),f&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function ol(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function al(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 rl(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},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:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?`${a(null==e?void 0:e.title)} ${n+1}`:a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const ul=e=>{var o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S,_,b,A,D,C,T,x;let{scrutinyDetails:N,paymentsList:w=[],additionalDetails:I,applicationData:L}=e;const P=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==L?void 0:L.status))&&window.location.href.includes("bpa"),[R,k]=n.useState(),[M,B]=n.useState(),[F,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,$]=n.useState(),[K,V]=n.useState([]),[q,G]=n.useState(),[Y,X]=n.useState(""),[Z,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(q&&null!=q&&q.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==q||null===(t=q.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(q.size>=2e6)J(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=O(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",q,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?V([...K,{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(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[q]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(K))},[K]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(i=I.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}k(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(a=I.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),W(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),V(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:ae}=i.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(n.Fragment,null,!(null!=N&&N.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==N||null===(o=N.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:""+ae(""+e.title),text:null!=e&&e.value?`${re(e)} ${ae(null==e?void 0:e.isUnit)}`:ae("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==N||null===(a=N.permit)||void 0===a?void 0:a.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==N||null===(r=N.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==N||null===(u=N.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)}},ae("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},ae("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:R,disabled:!P,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,ae("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_OTHER_CHARGES)||0,value:M,disabled:!P,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!P,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!P,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(R)?parseFloat(R):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&P?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){$(e.target.files[0]),G(e.target.files[0])},disabled:!P,onDelete:()=>{$(null),G("")},message:z?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:Y})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(_=Q.fileStoreIds[(null==Q||null===(b=Q.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===_?void 0:_.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(R)?parseFloat(R):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(A=I.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_LABOUR_CESS)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_WATER_CHARGES)+parseFloat(null==I||null===(T=I.selfCertificationCharges)||void 0===T?void 0:T.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==N||null===(x=N.scruntinyDetails)||void 0===x?void 0:x.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},sl=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),f=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],m=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>f.map(e=>({Header:p(""+e.name),accessor:m(e.id),id:e.id})));function g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r,u,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===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function E(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===(a=c.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,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===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:E(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:h,getCellProps:e=>({style:{}})})))})))},cl=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))},dl=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:v}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(cl,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function pl(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 vl(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 fl=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const f=null==p?void 0:p.mode;var{connectionDetails:m,plumberDetails:h,roadCuttingDetails:g,roadCuttingAddlDetails:E,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==m?void 0:m.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===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=f&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=f&&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==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.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==E?void 0:E.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:""})))))))},ml=[{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"}],hl=[{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"}],gl=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[d,p,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,m,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[E,y]=n.useState(!1),[S,b]=n.useState(d||{}),[A,D]=n.useState(null),[T,x]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[N,w]=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==d||null===(n=d.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,c,v,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==d||null===(o=d.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==d||null===(r=d.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==d||null===(c=d.billDetails)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.taxAmount)}];w(e),x(null==d||null===(f=d.billDetails)||void 0===f?void 0:f[0])}else p(i),b(i)},[]);let O={};const L=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>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"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),k=function(e,t,n){void 0===t&&(t=!1);let l={...S};if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},N&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==N?void 0:N.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==T?void 0:T.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,E&&l.createElement(t.Modal,{headerBarMain:l.createElement(L,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{b(d),y(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{b(d),y(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,n=null!=S&&S.adhocRebate?Number(null==S?void 0:S.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))D({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,d,v,f,h,g,E;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,n={...null==s||null===(d=s.additionalDetails)||void 0===d||null===(v=d.appDetails)||void 0===v?void 0:v.additionalDetails,...S};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===(E=g.appDetails)||void 0===E?void 0:E.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,c,d,v,f,h,g,E;(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===(h=e.Calculation)||void 0===h||null===(g=h[0])||void 0===g||null===(E=g.taxHeadEstimates)||void 0===E||E.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const b=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(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===(v=d[0])||void 0===v?void 0:v.taxAmount}];m(Nn(e.Calculation[0])),x(null==e||null===(f=e.Calculation)||void 0===f?void 0:f[0]),w(b),S.billDetails=null==e?void 0:e.Calculation,p(S),y(!1)}).catch(e=>{var t,n,l,i,o,a;D({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?c(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else D({isError:!1,isWarning:!0,key:"warning",message:c("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(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"}},c("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:ml,optionKey:"title",select:e=>k("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==S||null===(r=S.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,C({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,C({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("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"}},c("PT_AD_REBATE")),l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:hl,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==S||null===(u=S.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,C({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,C({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:c(null==A?void 0:A.message),onClose:()=>{D(!1)},isDleteBtn:!0})))},El=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"})))},yl=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",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(a)+" ",l.createElement(El,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Sl=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[f,m]=n.useState(!1),[h,g]=n.useState({}),E=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"})),S=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),g(t),m(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,f&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{m(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==h||null===(a=h.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},_l={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:{}},bl=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:_l.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:_l.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{..._l.cell,..._l.cellLeft,..._l.cellHeader}},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{..._l.cell,...n.length==t+1?_l.cellRight:{},..._l.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{..._l.cell,..._l.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{..._l.cell,textAlign:"left",...n.length==i+1?_l.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{..._l.cell,..._l.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{..._l.cell,..._l.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:{..._l.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:_l.cell,key:t,numeric:!0})))))))},Al={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))"}},Dl=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==r||null===(t=r.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===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?`FY${n.getYear()+1900}-${l.getYear()-100}`:`${n.toLocaleDateString()}-${l.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let v={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let f=[];f=Object.keys(v),f.sort((e,t)=>v[e]-v[t]);const[m,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Al.headerStyle},u("CS_ARREARS_DETAILS")),m&&l.createElement(bl,{headers:[...f],values:s,arrears:p}),!m&&l.createElement("div",{style:Al.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),m&&l.createElement("div",{style:Al.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function Cl(e){var a,r,u,s,c,d,p,v,f,m,h,g,E,y;let{applicationDetails:S,demandData:b,workflowDetails:A,isDataLoading:D,applicationData:C,totalDemandTax:T,timelineStatusPrefix:x,showTimeLine:N=!0,statusAttribute:w="status",paymentsList:I,oldValue:O,isInfoLabel:L=!1}=e;const{t:P}=i.useTranslation();let R=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function k(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[M,B]=n.useState({}),[F,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||F.loading||F.loaded||F.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==F||!F.canLoad||F.loading||F.loaded||(U({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,B,U));const H=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:H(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(dl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,b,A,D;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},T=n[t-1],x={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==C||null===(c=C.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.uuid)&&null!=C&&null!==(m=C.processInstance)&&void 0!==m&&null!==(h=m.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==C||null===(E=C.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(A=e.assignes)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.mobileNumber,comment:P(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(dl,{data:x,OpenImage:k,privacy:i})}{var T,x,N,w,I;const t={date:H(null==C||null===(T=C.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(x=e.assignes)||void 0===x||null===(N=x[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(w=e.assignes)||void 0===w||null===(I=w[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(dl,{data:t})}},W=(e,t)=>e?t?e:P(e):P("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),V=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),q={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},G=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${P(null==e?void 0:e.isUnit)}`:P("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):P("N/A"),[Y,X]=n.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},L?l.createElement(yl,{t:P,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(a=S.applicationDetails)||void 0===a?void 0:a.map((e,i)=>{var a,r,u,s,c,d,p,v,f,m,h,g,E,y,_,b,D,C,T,x,N,w,L,k,B,F,U,H,j,W,q,Y,X,Z,J,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},$?""+P(e.title):P(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},P(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"}},P(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"}},P(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},P(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:P(n.title),label:P(n.title),text:l.createElement("img",{src:P(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:P(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"}},P(null==n?void 0:n.title)))):$||K?""+P(n.title):P(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:V(),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:""+P(""+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:P(n.title),label:P(n.title),text:G(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:V(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Dl,{bill:null===(r=M.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(ul,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:I,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(s=S.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(el,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(f=v.additionalDetails)||void 0===f?void 0:f.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(al,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(rl,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(vl,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(pl,{units:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.accessories}),!R&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==A||null===(T=A.data)||void 0===T||null===(x=T.nextActions)||void 0===x?void 0:x.length)>0&&l.createElement(ll,{applicationData:null==S?void 0:S.applicationData,t:P,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(Jn,{t:P,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:A})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(nl,{t:P,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:A}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.scruntinyDetails)&&l.createElement(ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(sl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(Zn,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(il,{documents:null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.documents}),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation)&&l.createElement(ol,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(fl,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(gl,{wsAdditionalDetails:e,workflowDetails:A}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Sl,{wsAdditionalDetails:e,workflowDetails:A}))}),N&&(null==A||null===(r=A.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==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"}},P("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=A&&null!==(s=A.data)&&void 0!==s&&s.timeline&&1===(null==A||null===(c=A.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:P(`${x}${null==A||null===(p=A.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:j(null==A||null===(f=A.data)||void 0===f?void 0:f.timeline[0],null==A||null===(m=A.data)||void 0===m?void 0:m.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==A||null===(h=A.data)||void 0===h?void 0:h.timeline)&&(null==A||null===(g=A.data)||void 0===g?void 0:g.timeline.slice(0,Y?null==A?void 0:A.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,c,d,p;return window.location.href.includes("/obps/")&&(a=null!=A&&null!==(r=A.data)&&void 0!==r&&null!==(u=r.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:P(`${x}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w]}${a}`),customChild:j(e,n,null==A||null===(o=A.data)||void 0===o?void 0:o.timeline)}))}))),(null==A||null===(E=A.data)||void 0===E||null===(y=E.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:P(Y?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:q.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:q.th},"Installments"),l.createElement("th",{colSpan:"3",style:q.th},"Demand"),l.createElement("th",{colSpan:"3",style:q.th},"Collection"),l.createElement("th",{colSpan:"3",style:q.th},"Balance"),l.createElement("th",{style:q.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:q.th}),l.createElement("th",{style:q.th},"Tax"),l.createElement("th",{style:q.th},"Interest"),l.createElement("th",{style:q.th},"Penalty"),l.createElement("th",{style:q.th},"Tax"),l.createElement("th",{style:q.th},"Interest"),l.createElement("th",{style:q.th},"Penalty"),l.createElement("th",{style:q.th},"Tax"),l.createElement("th",{style:q.th},"Interest"),l.createElement("th",{style:q.th},"Penalty"),l.createElement("th",{style:q.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:q.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:q.td},e.demandTax),l.createElement("td",{style:q.td},e.demandInterest),l.createElement("td",{style:q.td},e.demandPenality),l.createElement("td",{style:q.td},e.collectionTax),l.createElement("td",{style:q.td},e.collectionInterest),l.createElement("td",{style:q.td},e.collectionPenality),l.createElement("td",{style:q.td},e.balanceTax),l.createElement("td",{style:q.td},e.balanceInterest),l.createElement("td",{style:q.td},e.balancePenality),l.createElement("td",{style:q.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:q.th},"Total"),l.createElement("td",{style:q.td},T),l.createElement("td",{style:q.td},Z),l.createElement("td",{style:q.td},J),l.createElement("td",{style:q.td},Q),l.createElement("td",{style:q.td},ee),l.createElement("td",{style:q.td},te),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td})),l.createElement("tr",null,l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("th",{style:q.th},"Total"),l.createElement("td",{style:q.td},ne),l.createElement("td",{style:q.td},"0"),l.createElement("td",{style:q.td},"0"),l.createElement("td",{style:q.td},"0")),l.createElement("tr",null,l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("td",{style:q.td}),l.createElement("th",{style:q.th},"Total Balance"),l.createElement("td",{style:q.td},ne)))))}function Tl(e){var n,i,o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S;let{t:_,showToast:b,closeToast:A,businessService:D}=e;if(null!=D&&D.includes("NewTL")||null!=D&&D.includes("TL")||null!=D&&D.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:_("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:_("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:_("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:_("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:_("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:_("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:_("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:_(`ES_${D}_${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:A}))}if(null!=D&&D.includes("BPA")||null!=D&&D.includes("BPA_LOW")||null!=D&&D.includes("BPA_OC")){var T;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=D&&D.includes("BPA_OC")?_(e[1]):_(e[0]),n};let n="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.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===(E=b.error)||void 0===E?void 0:E.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:_(`ES_${D}_${null==b||null===(S=b.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:A}))}{var x,N;const e="error"===(null==b?void 0:b.key)?null==b||null===(x=b.error)||void 0===x?void 0:x.message:`ES_${D}_${null==b||null===(N=b.action)||void 0===N?void 0:N.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:_(e),onClose:A}))}}function xl(e){var o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S;let{workflowDetails:_,displayMenu:b,onActionSelect:A,setDisplayMenu:D,businessService:C,forcedActionPrefix:T,ActionBarStyle:x={},MenuStyle:N={}}=e;const{t:w}=i.useTranslation();let I=Digit.UserService.getUser();const O=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 L=null===(o=I)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let P=!1,R=!1,k=(null==_||null===(u=_.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.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==_||null===(d=_.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.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(O,()=>{D(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(v=k[0])&&void 0!==v&&null!==(f=v.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(R=!1,P=!0):(null==k?void 0:k.length)>0&&(R=!0,P=!1),l.createElement(l.Fragment,null,!(null!=_&&_.isLoading)&&R&&!P&&l.createElement(t.ActionBar,{style:{...x}},b&&(null!=_&&null!==(m=_.data)&&void 0!==m&&null!==(h=m.actionState)&&void 0!==h&&h.nextActions||null!=_&&null!==(g=_.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase()),options:k,optionKey:"action",t:w,onSelect:A,style:N}):null,l.createElement(t.SubmitBar,{ref:O,label:w("WF_TAKE_ACTION"),onSubmit:()=>D(!b)})),!(null!=_&&_.isLoading)&&!R&&P&&l.createElement(t.ActionBar,{style:{...x}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==k||null===(E=k[0])||void 0===E?void 0:E.action,value:null==k||null===(y=k[0])||void 0===y?void 0:y.action,onClick:e=>{A((null==k?void 0:k[0])||{})}},w(`${T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase())}_${null==k||null===(S=k[0])||void 0===S?void 0:S.action}`))))}const 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"})),wl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Nl,null));function Il(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(wl,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const Ol=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(d,"BPA",["BlockReason"]),{t:v}=i.useTranslation(),f=o.useHistory();let{id:m}=o.useParams();const[h,g]=n.useState(!1),[E,y]=n.useState(null),[S,_]=n.useState(!1),[b,A]=n.useState(!1),[D,C]=n.useState(!1),{data:T}=Digit.Hooks.obps.useMDMS(d,"BPA",["RiskTypeComputation"]),{applicationDetails:x,demandData:N,totalDemandTax:w,totalBalanceTax:I,showToast:L,setShowToast:P,isLoading:R,isDataLoading:k,applicationData:M,mutate:B,nocMutation:F,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:$,forcedActionPrefix:K,statusAttribute:V,ActionBarStyle:q,MenuStyle:G,paymentsList:Y,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{L&&U.revalidate()},[L]);const ee=a.useQueryClient(),te=()=>{y(null),_(!1)};return R||b?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Cl,{applicationDetails:x,demandData:N,id:H,workflowDetails:U,isDataLoading:k,applicationData:M,totalDemandTax:w,totalBalanceTax:I,businessService:j,timelineStatusPrefix:$,statusAttribute:V,paymentsList:Y,showTimeLine:X,oldValue:Z,isInfoLabel:J}),S?l.createElement(Xn,{t:v,action:E,tenantId:c,state:d,id:m,applicationDetails:x,applicationData:null==x?void 0:x.applicationData,closeModal:te,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,u,s,c,d,p,m,h,g,y,S,_,b,D,C){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[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===(m=e.Licenses)||void 0===m||null===(h=m[0])||void 0===h||null===(g=h.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(y=e.WaterConnection)||void 0===y||null===(S=y.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(_=e.SewerageConnection)||void 0===_||null===(b=_.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(C=D.comment)||void 0===C?void 0:C.length)){var T,x;"INITIATE"===(null==e||null===(T=e.Licenses)||void 0===T||null===(x=T[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,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;B&&(A(!0),B(e,{onError:(e,t)=>{A(!1),P({key:"error",error:e}),setTimeout(W,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),A(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=E,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,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===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,p,m,h,g,y;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?P({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")?P({key:"success",label:v("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(h=m.workflow)&&void 0!==h&&h.action.includes("APPROVE")?P({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(y=g.workflow)&&void 0!==y&&y.action.includes("REJECT")&&P({key:"success",label:v("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return P({key:"success",action:E}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));P({key:"success",action:E}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}A(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&F){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==F?void 0:F.mutateAsync(e)),i=O(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,a,r,u,s,c,d,p,f;A(!1);let m=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?v(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.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===(f=p[0])||void 0===f?void 0:f.message)||e;te(),P({key:"error",error:{message:m}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(v("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(u=p.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Il,{action:E,workflowDetails:U,businessService:j,isWarningPop:D,closeWarningPopup:()=>{C(!1)}}):null,l.createElement(Tl,{t:v,showToast:L,closeToast:W,businessService:j}),s?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:v("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==T||null===(t=T.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===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,a,r,s,d,p,f){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===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.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===(f=p.selfCertificationCharges)||void 0===f?void 0:f.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(v("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(xl,{workflowDetails:U,displayMenu:h,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)P({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(W,5e3);else if(null!=e&&e.isWarningPopUp)C(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.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;f.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"),_(!0);else{var p,v;f.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(v=e.redirectionUrl)||void 0===v?void 0:v.state}})}else _(!0);y(e),g(!1)},setDisplayMenu:g,businessService:j,forcedActionPrefix:K,ActionBarStyle:q,MenuStyle:G})))},Ll={ADSCreate:e=>{var n,r,u,s;const c=a.useQueryClient(),d=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:f}=o.useLocation(),m=o.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[E,y,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:_,isLoading:b}=Digit.Hooks.pt.useMDMS(h,"PropertyTax","CommonFieldsConfig");function A(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,y({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,y({...E,units:e})}else y({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,o=f.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=f.slice(0,-3),o=o.split("/").pop(),r=!0):(o=f.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=g.find(e=>e.route===(o||"0")),s=m.push;if(e&&(s=m.replace),n&&(u=l),null===u)return s(d.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?`${d.path}/${u}/${t}`:`${d.path}/${u}`,s(i)})(n,l,i,e)}const D=()=>{},C=()=>{};if(b)return l.createElement(t.Loader,null);_=p,_.forEach(e=>{g=g.concat(e.body.filter(e=>!e.hideInCitizen))}),g.indexRoute="searchads";const T=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSCheckPage"),x=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ADSAcknowledgement");return l.createElement(o.Switch,null,g.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:A,onSkip:D,t:v,formData:E,onAdd:C}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(T,{onSubmit:function(){try{return m.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(o.Route,{path:d.path+"/acknowledgement"},l.createElement(x,{data:E,onSuccess:()=>{S(),c.invalidateQueries("ADS_CREATE")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:`${d.path}/${g.indexRoute}`})))},ADSSearch:e=>{var i,a;let{t:u,onSelect:s,config:c,userType:d,formData:p}=e;o.useLocation();const v=Digit.UserService.getUser().info,[f,h]=n.useState(p.adslist&&p.adslist[0]&&p.adslist[0].cartDetails||(null==p||null===(i=p.adslist)||void 0===i?void 0:i.cartDetails)||[]),[g,E]=n.useState(null==p?void 0:p.adType),[S,_]=n.useState(null==p?void 0:p.location),[b,D]=n.useState(null==p?void 0:p.faceArea),[C,T]=n.useState(!0),[x,N]=n.useState(null==p?void 0:p.fromDate),[w,I]=n.useState([]),[O,L]=n.useState(null==p?void 0:p.toDate),[P,R]=n.useState(p.adslist&&p.adslist[0]&&p.adslist[0].Searchdata||(null==p||null===(a=p.adslist)||void 0===a?void 0:a.Searchdata)||[]),[k,M]=n.useState(null),[B,F]=n.useState(!1),[U,H]=n.useState(""),[j,W]=n.useState((null==p?void 0:p.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),z=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[$,K]=n.useState(!1);let V=[],q=[],G=[];const{data:Y}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Z}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:J}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});Y&&Y.map(e=>{V.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),X&&X.map(e=>{q.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Z&&Z.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Q=Digit.Hooks.ads.useADSSlotSearch();let ee={advertisementSlotSearchCriteria:[{bookingId:"",addType:P.addType,bookingStartDate:P.bookingStartDate,bookingEndDate:P.bookingEndDate,faceArea:P.faceArea,tenantId:z,location:P.location,nightLight:P.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(Q.data&&null!==(e=Q.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=Q.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+u(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+u(e.faceArea),locationCode:e.location,location:""+u(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:P.unitPrice,status:"AVAILABLE"===e.slotStaus?l.createElement("div",{className:"sla-cell-success"},"Available"):l.createElement("div",{className:"sla-cell-error"},"Booked")}));ne(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),ie(e=>e||!0)}},[Q.data,P]);const[te,ne]=n.useState(""),[le,ie]=n.useState(!1),oe=[{Header:""+u("ADS_TYPE"),accessor:"addType"},{Header:""+u("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+u("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+u("ADS_DATE"),accessor:"bookingDate"},{Header:""+u("ADS_STATUS"),accessor:"status"}],{control:ae}=r.useForm(),re=()=>{let e,t=p.adslist&&p.adslist[0];"citizen"===d?(e={...t,Searchdata:P,cartDetails:f,adsType:g,selectedLocation:S,selectedFace:b,selectNight:j,fromDate:x,toDate:O,existingDataSet:U},s(c.key,{...p[c.key],...e},!1,0)):(e={...t,Searchdata:P,cartDetails:f,adsType:g,selectNight:j,selectedLocation:S,selectedFace:b,fromDate:x,toDate:O,existingDataSet:U},s(c.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===d&&re()},[f,g,j,b,S,P]);const ue=[{id:"selection",Header:e=>l.createElement("div",{style:{paddingLeft:"50px"}},l.createElement("input",{type:"checkbox",checked:w.length===te.length,onChange:()=>{if(w.length===te.length)I([]);else{const e=te.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);I(e)}}})),Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},l.createElement("input",{type:"checkbox",checked:w.includes(t.original.slotId),onChange:()=>(e=>{const t=te[e].slotId;I(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...oe];return n.useEffect(()=>{if(null!=p&&p.adType&&null!=p&&p.faceArea&&null!=p&&p.fromDate&&null!=p&&p.toDate&&null!=p&&p.nightLight&&null!=p&&p.location&&J){var e,t,n,l,i;let u,s=null==p||null===(e=p.location)||void 0===e?void 0:e.value;const c=null==J?void 0:J.find(e=>(null==e?void 0:e.location)===s);if(c){var o,a,r;const e="CalculationType_"+(null==p||null===(o=p.faceArea)||void 0===o?void 0:o.code);u=null==c||null===(a=c[e])||void 0===a||null===(r=a[0])||void 0===r?void 0:r.amount}const d={addType:null==p||null===(t=p.adType)||void 0===t?void 0:t.code,faceArea:null==p||null===(n=p.faceArea)||void 0===n?void 0:n.code,location:null==p||null===(l=p.location)||void 0===l?void 0:l.code,nightLight:null==p||null===(i=p.nightLight)||void 0===i?void 0:i.value,bookingStartDate:null==p?void 0:p.fromDate,bookingEndDate:null==p?void 0:p.toDate,unitPrice:u};JSON.stringify(d)!==JSON.stringify(P)&&R(d)}},[p,J]),n.useEffect(()=>{if(k){const e=setTimeout(()=>{M(null)},1500);return()=>clearTimeout(e)}},[k]),n.useEffect(()=>{P.addType&&Q.mutate(ee)},[P]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen"),l.createElement(t.FormStep,{config:c,onSelect:re,onSkip:()=>s(),t:u},l.createElement(t.CardHeader,null,u("ADS_SEARCH_HEADER")),l.createElement(t.CardLabel,null,""+u("ADS_TYPE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ae,name:"adsType",defaultValue:g,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:g,select:e=>{E(e)},placeholder:"Select Advertisement Type",option:V,optionKey:"i18nKey",t:u})}),l.createElement(t.CardLabel,null,""+u("ADS_LOCATION")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ae,name:"selectedLocation",defaultValue:S,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:S,select:e=>{_(e)},placeholder:"Select Ad Type",option:q,optionKey:"i18nKey",t:u})}),l.createElement(t.CardLabel,null,""+u("ADS_FACE_AREA")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ae,name:"adsType",defaultValue:b,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},placeholder:"Select Ad Type",option:G,optionKey:"i18nKey",t:u})}),l.createElement(t.CardLabel,null,""+u("ADS_FROM_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:u,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:x,onChange:function(e){N(e.target.value)},style:{width:"EMPLOYEE"===v.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||u("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+u("ADS_TO_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:u,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:O,onChange:function(e){L(e.target.value)},style:{width:"EMPLOYEE"===v.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||u("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+u("ADS_NIGHT_LIGHT")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:u,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:j,selectedOption:j,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:W,isDependent:!0}),l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},l.createElement(t.SubmitBar,{label:u("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==g?void 0:g.code,t=x,n=O,l=null==b?void 0:b.code,i=null==S?void 0:S.value,o=null==j?void 0:j.value;let a;const r=null==J?void 0:J.find(e=>(null==e?void 0:e.location)===i);if(r){var s,c;const e="CalculationType_"+l;a=null==r||null===(s=r[e])||void 0===s||null===(c=s[0])||void 0===c?void 0:c.amount}if(g&&t&&n&&l&&i&&o){if(new Date(t)>new Date(n))return void M({error:!0,label:u("ADS_INVALID_DATE_RANGE")});R({addType:e,faceArea:l,location:i,nightLight:o,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else M({error:!0,label:u("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),l.createElement(t.SubmitBar,{label:u("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===w.length)return void M({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=te.filter(e=>w.includes(e.slotId)),t=f.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return M({error:!0,label:u("ADS_ITEM_ALREADY_IN_CART")}),void I([]);const l={};[...t,...n].forEach(e=>{const t=`${e.addType}-${e.location}-${e.faceArea}-${e.nightLight}`;l[t]||(l[t]=[]),l[t].push(e)});for(let e in l){const t=l[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return M({error:!0,label:u("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void I([])}h(e=>[...e,...n]),M({success:!0,label:n.length+" item(s) added to cart."}),I([])}}),l.createElement("div",null,l.createElement(t.SubmitBar,{label:u("ADS_VIEW_CART"),onSubmit:()=>{f.length>0?K(!0):M({error:!0,label:u("ADS_NO_ITEMS_IN_CART")})}})),l.createElement("div",{class:"container",style:{width:"1px"}},l.createElement("div",{style:{width:"1px",position:"relative"}},l.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},l.createElement("div",null," ",f.length)))),$&&l.createElement(A,{onClose:()=>{K(!1)},cartDetails:f,setCartDetails:h}),l.createElement(t.SubmitBar,{label:u("ADS_BOOK_NOW"),onSubmit:()=>{0===f.length?M({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")}):C?F(!0):re()}}))),le&&l.createElement(t.Card,{style:{overflowX:"auto"}},l.createElement(m,{t:u,data:te,columns:ue,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:te.length,style:{width:"100%",overflowX:"auto"}})),k&&l.createElement(t.Toast,{error:k.error,warning:k.warning,label:u(k.label),onClose:()=>{M(null)}}),B&&l.createElement(y,{t:u,closeModal:()=>F(!1),actionCancelOnSubmit:()=>F(!1),onSubmit:()=>{re(),F(!1)},setExistingDataSet:H,Searchdata:f}))},ADSCitizenDetails:e=>{var i,a,r,u,s,c,d,p,v,f,m,h,g,E,y;let{t:S,config:_,onSelect:b,userType:A,formData:D,value:T=D.adslist}=e;o.useLocation();let N=window.location.href.charAt(window.location.href.length-1),w={};const O=Digit.UserService.getUser().info,L=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),R=Digit.Hooks.ads.useADSCreateAPI(),[k,M]=n.useState(D.applicant&&D.applicant[N]&&D.applicant[N].applicantName||(null==D||null===(i=D.applicant)||void 0===i?void 0:i.applicantName)||(null==T||null===(a=T.existingDataSet)||void 0===a||null===(r=a.applicant)||void 0===r?void 0:r.applicantName)||""),[B,F]=n.useState(D.applicant&&D.applicant[N]&&D.applicant[N].emailId||(null==D||null===(u=D.applicant)||void 0===u?void 0:u.emailId)||(null==T||null===(s=T.existingDataSet)||void 0===s||null===(c=s.applicant)||void 0===c?void 0:c.emailId)||""),[U,H]=n.useState(D.applicant&&D.applicant[N]&&D.applicant[N].mobileNumber||(null==T||null===(d=T.existingDataSet)||void 0===d||null===(p=d.applicant)||void 0===p?void 0:p.mobileNumber)||(null==D||null===(v=D.applicant)||void 0===v?void 0:v.mobileNumber)||(null==O?void 0:O.mobileNumber)),[j,W]=n.useState(D.applicant&&D.applicant[N]&&D.applicant[N].alternateNumber||(null==D||null===(f=D.applicant)||void 0===f?void 0:f.alternateNumber)||(null==T||null===(m=T.existingDataSet)||void 0===m||null===(h=m.applicant)||void 0===h?void 0:h.alternateNumber)||""),z=()=>{let e=D.applicant&&D.applicant[N],t=null==T?void 0:T.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));R.mutate({bookingApplication:{tenantId:L,applicantDetail:{applicantName:k,applicantMobileNo:U,applicantAlternateMobileNo:j,applicantEmailId:B},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const l=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let i;"citizen"===A?(i={...e,applicantName:k,mobileNumber:U,alternateNumber:j,emailId:B,draftId:l},b(_.key,{...D[_.key],...i},!1,N)):(i={...e,applicantName:k,mobileNumber:U,alternateNumber:j,emailId:B,draftId:l},b(_.key,i,!1,N))}})};return n.useEffect(()=>{"citizen"===A&&z()},[]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(x,{currentStep:1}):null,l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(P,{timerValues:null==T||null===(g=T.existingDataSet)||void 0===g||null===(E=g.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==T?void 0:T.cartDetails,draftId:null==T||null===(y=T.existingDataSet)||void 0===y?void 0:y.draftId})),l.createElement(I,null))),l.createElement(t.FormStep,{config:_,onSelect:z,onSkip:()=>b(),t:S,isDisabled:!k||!U||!B},l.createElement("div",null,l.createElement(t.CardLabel,null,""+S("ADS_APPLICANT_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,C({t:S,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:k,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");M(t)},style:{width:"EMPLOYEE"===O.type?"51.6%":null},ValidationRequired:!0},w={pattern:"^[a-zA-Z ]+$",type:"tel",title:S("CHB_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+S("ADS_MOBILE_NUMBER")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.MobileNumber,{value:U,name:"mobileNumber",style:{width:"EMPLOYEE"===O.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>{H({value:e}.value)},pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:S("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+S("ADS_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:j,name:"alternateNumber",style:{width:"EMPLOYEE"===O.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>{W({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:S("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+S("ADS_EMAIL_ID")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,C({t:S,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:B,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===O.type?"51.6%":null},onChange:function(e){F(e.target.value)},ValidationRequired:!0},w={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:S("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var i,a,u,s,c,d,p,v,f,m,h,g,E,y,S,_,b,A,D,T,N,w,O,L,R,k,M,B,F,U;let{t:H,config:j,onSelect:W,userType:z,formData:$,value:K=$.adslist}=e;o.useLocation();let V=window.location.href.charAt(window.location.href.length-1);const q=Digit.Hooks.ads.useTenants(),G=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId();o.useLocation();let Y={};const X=Digit.UserService.getUser().info,Z=Digit.Hooks.ads.useADSCreateAPI(),[J,Q]=n.useState($.address&&$.address[V]&&$.address[V].pincode||(null==$||null===(i=$.address)||void 0===i?void 0:i.pincode)||(null==K||null===(a=K.existingDataSet)||void 0===a||null===(u=a.address)||void 0===u?void 0:u.pincode)||""),[ee,te]=n.useState($.address&&$.address[V]&&$.address[V].city||(null==$||null===(s=$.address)||void 0===s?void 0:s.city)||(null==K||null===(c=K.existingDataSet)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city)||""),[ne,le]=n.useState($.address&&$.address[V]&&$.address[V].locality||(null==$||null===(p=$.address)||void 0===p?void 0:p.locality)||(null==K||null===(v=K.existingDataSet)||void 0===v||null===(f=v.address)||void 0===f?void 0:f.locality)||""),[ie,oe]=n.useState($.address&&$.address[V]&&$.address[V].streetName||(null==$||null===(m=$.address)||void 0===m?void 0:m.streetName)||(null==K||null===(h=K.existingDataSet)||void 0===h||null===(g=h.address)||void 0===g?void 0:g.streetName)||""),[ae,re]=n.useState($.address&&$.address[V]&&$.address[V].houseNo||(null==$||null===(E=$.address)||void 0===E?void 0:E.houseNo)||(null==K||null===(y=K.existingDataSet)||void 0===y||null===(S=y.address)||void 0===S?void 0:S.houseNo)||""),[ue,se]=n.useState($.address&&$.address[V]&&$.address[V].landmark||(null==$||null===(_=$.address)||void 0===_?void 0:_.landmark)||(null==K||null===(b=K.existingDataSet)||void 0===b||null===(A=b.address)||void 0===A?void 0:A.landmark)||""),[ce,de]=n.useState($.address&&$.address[V]&&$.address[V].houseName||(null==$||null===(D=$.address)||void 0===D?void 0:D.houseName)||(null==K||null===(T=K.existingDataSet)||void 0===T||null===(N=T.address)||void 0===N?void 0:N.houseName)||""),[pe,ve]=n.useState($.address&&$.address[V]&&$.address[V].addressline1||(null==$||null===(w=$.address)||void 0===w?void 0:w.addressline1)||(null==K||null===(O=K.existingDataSet)||void 0===O||null===(L=O.address)||void 0===L?void 0:L.addressline1)||""),[fe,me]=n.useState($.address&&$.address[V]&&$.address[V].addressline2||(null==$||null===(R=$.address)||void 0===R?void 0:R.addressline2)||(null==K||null===(k=K.existingDataSet)||void 0===k||null===(M=k.address)||void 0===M?void 0:M.addressline2)||""),{data:he}=Digit.Hooks.useBoundaryLocalities(null==ee?void 0:ee.code,"revenue",{enabled:!!ee},H);let ge=[];he&&he.map((e,t)=>{ge.push({i18nKey:e.i18nkey,code:e.code,label:e.label,area:e.area,boundaryNum:e.boundaryNum})});const Ee=()=>{var e,t,n,l,i,o,a;let r=null==K?void 0:K.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const u={bookingApplication:{tenantId:G,draftId:null==$||null===(e=$.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==$||null===(t=$.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==$||null===(n=$.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==$||null===(l=$.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==$||null===(i=$.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:J,city:null==ee||null===(o=ee.city)||void 0===o?void 0:o.name,cityCode:null==ee||null===(a=ee.city)||void 0===a?void 0:a.code,locality:null==ne?void 0:ne.i18nKey,localityCode:null==ne?void 0:ne.code,streetName:ie,addressLine1:pe,addressLine2:fe,houseNo:ae,landmark:ue},cartDetails:r,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};Z.mutate(u);let s={...$.address&&$.address[V],pincode:J,city:ee,locality:ne,streetName:ie,houseNo:ae,landmark:ue,houseName:ce,addressline1:pe,addressline2:fe};W(j.key,{...$[j.key],...s},!1,V)},{control:ye}=r.useForm();return n.useEffect(()=>{"citizen"===z&&Ee()},[Ee,z]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(x,{currentStep:2}):null,l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(P,{timerValues:null==K||null===(B=K.existingDataSet)||void 0===B||null===(F=B.timervalue)||void 0===F?void 0:F.timervalue,SlotSearchData:null==K?void 0:K.cartDetails,draftId:null==K||null===(U=K.existingDataSet)||void 0===U?void 0:U.draftId})),l.createElement(I,null))),l.createElement(t.FormStep,{config:j,onSelect:Ee,onSkip:()=>W(),t:H,isDisabled:!(J&&ee&&ie&&ae&&ue&&ne&&pe)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("ADS_HOUSE_NO")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,C({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:ae,placeholder:"Enter House No",onChange:e=>{re(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0},Y={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:H("ADS_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_HOUSE_NAME")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseName",value:ce,placeholder:"Enter House Name",onChange:e=>{de(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_STREET_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,C({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"streetName",value:ie,placeholder:"Enter Street Name",onChange:e=>{oe(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0},Y={pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:H("ADS_STREET_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_LINE1")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:pe,placeholder:"Enter Address",onChange:e=>{ve(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_LINE2")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:fe,placeholder:"Enter Address",onChange:e=>{me(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_LANDMARK")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextArea,C({t:H,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:ue,placeholder:"Enter Landmark",onChange:e=>{se(e.target.value)},style:{width:"50%"},ValidationRequired:!0},Y={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"textarea",title:H("ADS_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_CITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ye,name:"city",defaultValue:ee,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:q,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("ADS_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ye,name:"locality",defaultValue:ne,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:ge,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_PINCODE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:J,onChange:e=>{const t=e.target.value.replace(/\D/g,"").slice(0,6);Q(t)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0,validation:{pattern:"[0-9]{6}",type:"text",title:H("CHB_ADDRESS_PINCODE_INVALID")},minLength:6,maxLength:6}))))},ADSDocumentDetails:e=>{var i,o,a,r,u,s,c,d;let{t:p,config:v,onSelect:f,formData:m,value:h=m.adslist}=e;const[g,E]=n.useState((null==m||null===(i=m.documents)||void 0===i?void 0:i.documents)||(null==h||null===(o=h.existingDataSet)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.documents)||[]),[y,S]=n.useState(null),[_,b]=n.useState(!0),[A,D]=n.useState(!1),C=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),T=Digit.Hooks.ads.useADSCreateAPI(),N=Digit.ULBService.getStateId(),{isLoading:w,data:O}=Digit.Hooks.ads.useADSDocumentsMDMS(N,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==O||null===(e=O.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;g.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),b("0"!=t&&0!=t||!(g.length>0))},[g,A]),l.createElement("div",null,l.createElement(x,{currentStep:3}),l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(P,{timerValues:null==h||null===(r=h.existingDataSet)||void 0===r||null===(u=r.timervalue)||void 0===u?void 0:u.timervalue,SlotSearchData:null==h?void 0:h.cartDetails,draftId:null==h||null===(s=h.existingDataSet)||void 0===s?void 0:s.draftId})),l.createElement(I,null))),w?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:v,onSelect:()=>{var e,t,n,l,i,o,a,r,u,s,c,d,p,E,y,S,_,b,A,D,x;let N=null==h?void 0:h.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const w={bookingApplication:{tenantId:C,draftId:null==m||null===(e=m.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==m||null===(t=m.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==m||null===(n=m.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==m||null===(l=m.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==m||null===(i=m.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:null==m||null===(o=m.address)||void 0===o?void 0:o.pincode,city:null==m||null===(a=m.address)||void 0===a||null===(r=a.city)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.name,cityCode:null==m||null===(s=m.address)||void 0===s||null===(c=s.city)||void 0===c||null===(d=c.city)||void 0===d?void 0:d.code,locality:null==m||null===(p=m.address)||void 0===p||null===(E=p.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==m||null===(y=m.address)||void 0===y||null===(S=y.locality)||void 0===S?void 0:S.code,streetName:null==m||null===(_=m.address)||void 0===_?void 0:_.streetName,addressLine1:null==m||null===(b=m.address)||void 0===b?void 0:b.addressline1,addressLine2:null==m||null===(A=m.address)||void 0===A?void 0:A.addressline2,houseNo:null==m||null===(D=m.address)||void 0===D?void 0:D.houseNo,landmark:null==m||null===(x=m.address)||void 0===x?void 0:x.landmark},documents:g,cartDetails:N,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let I;T.mutate(w),I={...m.documents,documents:g},f(v.key,I)},onSkip:()=>f(),isDisabled:_,onAdd:function(){}},l.createElement(t.CardSubHeader,null,p("ADS_PROOF_OF_DOCUMENTS")),l.createElement(t.CardLabelDesc,null,p("ADS_UPLOAD_RESTRICTIONS_TYPES")),l.createElement(t.CardLabelDesc,null,p("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==O||null===(c=O.Advertisement)||void 0===c||null===(d=c.Documents)||void 0===d?void 0:d.map((e,t)=>l.createElement(R,{key:t,document:e,t:p,error:y,setError:S,setDocuments:E,documents:g,setCheckRequiredFields:D})),y&&l.createElement(t.Toast,{label:y,onClose:()=>S(null),error:!0})))},ADSCheckPage:e=>{var a,r,s,c,d,p,v,f,h,g,E;let{onSubmit:y,value:S={}}=e;const{t:_}=i.useTranslation(),[b,A]=(o.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:D,isEditADS:C,isUpdateADS:T,documents:N,address:w}=S,I=C||T?"editbookad":"bookad",O=[{Header:""+_("ADS_TYPE"),accessor:"addType"},{Header:""+_("ADS_FACE_AREA"),accessor:"faceArea"},{Header:_("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,_(t?"Yes":"No"))}},{Header:""+_("ADS_DATE"),accessor:"bookingDate"},{Header:_("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>L(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],L=e=>{var t;const n={...b};null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},R=(null==b||null===(a=b.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[B,F]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(x,{currentStep:4}):null,l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement(t.CardHeader,null,_("ADS_SUMMARY")),l.createElement(t.CardSubHeader,null,l.createElement(P,{timerValues:null==b||null===(r=b.adslist)||void 0===r||null===(s=r.existingDataSet)||void 0===s||null===(c=s.timervalue)||void 0===c?void 0:c.timervalue,SlotSearchData:null==b||null===(d=b.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==b||null===(p=b.adslist)||void 0===p||null===(v=p.existingDataSet)||void 0===v?void 0:v.draftId}))),l.createElement("div",null,l.createElement(t.CardText,null,_("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("ADS_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:_("ADS_APPLICANT_NAME"),text:""+_(u(null==D?void 0:D.applicantName)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:_("ADS_MOBILE_NUMBER"),text:""+_(u(null==D?void 0:D.mobileNumber)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:_("ADS_ALT_MOBILE_NUMBER"),text:""+_(u(null==D?void 0:D.alternateNumber)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:_("ADS_EMAIL_ID"),text:""+_(u(null==D?void 0:D.emailId)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("ADS_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:_("ADS_HOUSE_NO"),text:""+_(u(null==w?void 0:w.houseNo)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_HOUSE_NAME"),text:""+_(u(null==w?void 0:w.houseName)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_STREET_NAME"),text:""+_(u(null==w?void 0:w.streetName)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_ADDRESS_LINE1"),text:""+_(u(null==w?void 0:w.addressline1)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_ADDRESS_LINE2"),text:""+_(u(null==w?void 0:w.addressline2)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_LANDMARK"),text:""+_(u(null==w?void 0:w.landmark)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_CITY"),text:""+_(u(null==w||null===(f=w.city)||void 0===f||null===(h=f.city)||void 0===h?void 0:h.name)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_LOCALITY"),text:""+_(u(null==w||null===(g=w.locality)||void 0===g?void 0:g.i18nKey)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:_("ADS_ADDRESS_PINCODE"),text:""+_(u(null==w?void 0:w.pincode)),actionButton:l.createElement(M,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("ADS_CART_DETAILS")),l.createElement(m,{t:_,data:R,columns:O,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==b||null===(E=b.adslist)||void 0===E?void 0:E.cartDetails.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},_("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Card,null,N&&(null==N?void 0:N.documents.map((e,t)=>l.createElement(k,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),l.createElement(t.CheckBox,{label:_("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{F(!B)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:_("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:y,disabled:!B})))},ADSAcknowledgement:e=>{var a,r;let{data:u,onSuccess:s}=e;const{t:c}=i.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),p=Digit.Hooks.ads.useADSCreateAPI(d),v=(Digit.Hooks.useStore.getInitData(),o.useRouteMatch(),o.useHistory()),f=Digit.UserService.getUser().info,[m,h]=n.useState(null),g=Digit.Hooks.ads.useADSSlotSearch();let E={advertisementSlotSearchCriteria:null===(a=p.data)||void 0===a||null===(r=a.bookingApplication[0])||void 0===r?void 0:r.cartDetails.map(e=>{var t;return{bookingId:null===(t=p.data)||void 0===t?void 0:t.bookingApplication[0].bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}})};return n.useEffect(()=>{try{u.tenantId=d;let e=(e=>({bookingApplication:{tenantId:(e=(e=>{var t;let{adslist:n}=e,l=(null==n?void 0:n.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"})))||[],i=null==n||null===(t=n.existingDataSet)||void 0===t?void 0:t.draftId;return e.adslist={cartDetails:l,draftId:i},e})(e=(e=>{var t,n,l,i,o,a;let{address:r}=e,u={pincode:null==r?void 0:r.pincode,city:null==r||null===(t=r.city)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.name,cityCode:null==r||null===(l=r.city)||void 0===l||null===(i=l.city)||void 0===i?void 0:i.code,locality:null==r||null===(o=r.locality)||void 0===o?void 0:o.i18nKey,localityCode:null==r||null===(a=r.locality)||void 0===a?void 0:a.code,streetName:null==r?void 0:r.streetName,addressLine1:null==r?void 0:r.addressline1,addressLine2:null==r?void 0:r.addressline2,houseNo:null==r?void 0:r.houseNo,landmark:null==r?void 0:r.landmark};return e.address=u,e})(e=(e=>{let{applicant:t}=e;return e.applicant={Applicant:{applicantName:null==t?void 0:t.applicantName,applicantMobileNo:null==t?void 0:t.mobileNumber,applicantAlternateMobileNo:null==t?void 0:t.alternateNumber,applicantEmailId:null==t?void 0:t.emailId},draftId:null==t?void 0:t.draftId},e})(e=(e=>{let{documents:t}=e,n={...t};return e.documents=n,e})(e))))).tenantId,draftId:e.applicant.draftId,applicantDetail:{...e.applicant.Applicant},address:e.address,...e.documents,bookingStatus:"BOOKING_CREATED",cartDetails:e.adslist.cartDetails,workflow:null}}))(u);p.mutate(e,{onSuccess:s})}catch(e){}},[]),n.useEffect(()=>{if(m){const e=setTimeout(()=>{h(null)},2e3);return()=>clearTimeout(e)}},[m]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(U,{t:c,data:p.data,isSuccess:p.isSuccess,isLoading:p.isIdle||p.isLoading}),l.createElement(t.StatusTable,null,p.isSuccess&&l.createElement(t.Row,{rowContainerStyle:F,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),p.isSuccess&&l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},"EMPLOYEE"===f.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),"CITIZEN"===f.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),l.createElement(t.SubmitBar,{label:c("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:function(){try{const e=O(function(){return Promise.resolve(g.mutateAsync(E)).then(function(e){var t,n,l,i;let o={bookingId:null===(t=p.data)||void 0===t?void 0:t.bookingApplication[0].bookingId,tenantId:d,cartDetails:null===(n=p.data)||void 0===n||null===(l=n.bookingApplication[0])||void 0===l?void 0:l.cartDetails};const a=null==e||null===(i=e.advertisementSlotAvailabiltityDetails)||void 0===i?void 0:i.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;if(a)h({error:!0,label:c("ADS_ADVERTISEMENT_ALREADY_BOOKED")});else if("CITIZEN"===f.type){var u,s,m,g;v.push({pathname:"/digit-ui/citizen/payment/my-bills/adv-services/"+(null===(u=p.data)||void 0===u||null===(s=u.bookingApplication[0])||void 0===s?void 0:s.bookingNo),state:{tenantId:d,bookingNo:null===(m=p.data)||void 0===m||null===(g=m.bookingApplication[0])||void 0===g?void 0:g.bookingNo,timerValue:r,SlotSearchData:o}})}else if("EMPLOYEE"===f.type){var E,y,S,_;v.push({pathname:"/digit-ui/employee/payment/collect/adv-services/"+(null===(E=p.data)||void 0===E||null===(y=E.bookingApplication[0])||void 0===y?void 0:y.bookingNo),state:{tenantId:d,bookingNo:null===(S=p.data)||void 0===S||null===(_=S.bookingApplication[0])||void 0===_?void 0:_.bookingNo,timerValue:r,SlotSearchData:o}})}})},function(){h({error:!0,label:c("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),!p.isSuccess&&"CITIZEN"===f.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),!p.isSuccess&&"EMPLOYEE"===f.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),m&&l.createElement(t.Toast,{error:m.error,warning:m.warning,label:c(m.label),onClose:()=>{h(null)}}))},ADSCard:H,ADSMyApplications:()=>{const{t:e}=i.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[u,s]=n.useState(""),[c,d]=n.useState(null),[p,v]=n.useState(null);let f,m,h=window.location.href.split("/").pop();isNaN(parseInt(h))?f=4:(m=h,f=parseInt(h)+50);let g=isNaN(parseInt(h))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:a,mobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:m,tenantId:a};n.useEffect(()=>{v(g)},[h]);const{isLoading:E,data:y}=Digit.Hooks.ads.useADSSearch({filters:p});if(E)return l.createElement(t.Loader,null);const S=[{i18nKey:"Booked",code:"BOOKED",value:e("ADS_BOOKED")},{i18nKey:"Booking in Progres",code:"BOOKING_CREATED",value:e("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:e("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:e("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:e("CANCELLED")}],_=(null==y?void 0:y.bookingApplication)||[];return l.createElement(l.Fragment,null,l.createElement(t.Header,null,`${e("ADS_MY_BOOKINGS_HEADER")} (${_.length})`),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("ADS_BOOKING_NO")),l.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:u,onChange:e=>s(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(t.Dropdown,{className:"form-field",selected:c,select:d,option:S,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{const e=u.trim(),t={...g,bookingNo:e||void 0,status:(null==c?void 0:c.code)||void 0};v(t)}}),l.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{s(""),d("")}},e("ES_COMMON_CLEAR_ALL"))))),l.createElement(o.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},l.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("ADS_NEW_BOOKING")+" +"})))),l.createElement("div",null,_.length>0&&_.map((t,n)=>l.createElement("div",{key:n},l.createElement(G,{application:t,tenantId:a,buttonLabel:e("ADS_SUMMARY")}))),0===_.length&&!E&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==_.length&&(null==y?void 0:y.count)>f&&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/ads/myBookings/"+f},e("ADS_LOAD_MORE_MSG")))))))},ApplicationDetails:l.memo(()=>{var e,a,r,u,s;const{t:c}=i.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),{id:p}=o.useParams(),[v,f]=n.useState(null),[m,h]=n.useState({}),[g,E]=n.useState(!1),{isLoading:y,data:S}=Digit.Hooks.ads.useADSApplicationDetail(c,d,p),_=Digit.Hooks.ads.useADSCreateAPI(d,!1),{data:b,refetch:A}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:{bookingNo:p,audit:!0}});n.useEffect(()=>{S&&h(Ke.cloneDeep(S))},[S]);const{data:D,isLoading:C}=Digit.Hooks.useRecieptSearch({tenantId:d,businessService:"adv-services",consumerCodes:null==m||null===(e=m.applicationData)||void 0===e||null===(a=e.applicationData)||void 0===a?void 0:a.bookingNo,isEmployee:!1},{enabled:!(null==m||null===(r=m.applicationData)||void 0===r||null===(u=r.applicationData)||void 0===u||!u.bookingNo)});let T=[];return D&&(null==D?void 0:D.Payments.length)>0&&0==C&&T.push({label:c("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{var i;function o(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:l})).then(function(e){window.open(e[l],"_blank")})}let e=null==b||null===(i=b.bookingApplication)||void 0===i?void 0:i[0],l=null==e?void 0:e.paymentReceiptFilestoreId;const a=function(){if(!l){let i={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...n}]},"advservice-receipt")).then(function(t){var n;i=t;const o={...e,paymentReceiptFilestoreId:null===(n=i)||void 0===n?void 0:n.filestoreIds[0]};return Promise.resolve(_.mutateAsync({bookingApplication:o})).then(function(){var e;l=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],A()})})}}();return Promise.resolve(a&&a.then?a.then(o):o())}catch(e){return Promise.reject(e)}}({tenantId:null==D||null===(e=D.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==D?void 0:D.Payments[0]})}}),D&&(null==D?void 0:D.Payments.length)>0&&0==C&&T.push({label:c("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,...n}=e;try{var l;function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=null==b||null===(l=b.bookingApplication)||void 0===l?void 0:l[0],n=null==e?void 0:e.permissionLetterFilestoreId;const o=function(){if(!n)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[e]},"advpermissionletter")).then(function(t){const l={...e,permissionLetterFilestoreId:null==t?void 0:t.filestoreIds[0]};return Promise.resolve(_.mutateAsync({bookingApplication:l})).then(function(){n=null==t?void 0:t.filestoreIds[0],A()})})}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==D||null===(e=D.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==D?void 0:D.Payments[0]})}}),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"}},c("ADS_BOOKING_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},T&&T.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>E(!g),displayOptions:g,options:T,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Ol,{applicationDetails:null==m?void 0:m.applicationData,isLoading:y,isDataLoading:y,applicationData:null==m||null===(s=m.applicationData)||void 0===s?void 0:s.applicationData,showToast:v,setShowToast:f,closeToast:()=>{f(null)},MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))}),ADSApplicationDetails:()=>{var e,a,r,u,s,c,d,p,v,f,h,g,E,y,S,_,b,A,D,C,T;const{t:x}=i.useTranslation(),{acknowledgementIds:N,tenantId:w}=(o.useHistory(),o.useParams()),[I,O]=n.useState([]),[L,P]=n.useState(!1),[R,M]=n.useState(!1),[B,F]=n.useState(null),{isLoading:U,data:H,refetch:j}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:w,filters:{bookingNo:N}})),W=Digit.Hooks.ads.useADSCreateAPI(w,!1),[z,$]=n.useState(null),K=$e(H,"bookingApplication",[]),V=$e(H,"bookingApplication[0].bookingNo",[]);let q=K&&K.length>0&&K[0]||{};const G=q;sessionStorage.setItem("ads",JSON.stringify(G));const[Y,X]=n.useState(!1);n.useEffect(()=>{!function(){try{X(!0),Promise.resolve(Digit.PaymentService.fetchBill(w,{businessService:"adv-services",consumerCode:N})).then(function(e){$(e),X(!1)})}catch(e){return Promise.reject(e)}}()},[w,N]);const{isLoading:Z}=Digit.Hooks.ads.useADSSearch({tenantId:w,filters:{bookingNo:V,audit:!0}},{enabled:!0}),{data:J,isLoading:Q}=Digit.Hooks.useRecieptSearch({tenantId:w,businessService:"adv-services",consumerCodes:N,isEmployee:!1},{enabled:!!N});let ee=[];if(ee=null==G?void 0:G.documents,U||Z)return l.createElement(t.Loader,null);let te=x("CS_NA");if(null!=q&&null!==(e=q.additionalDetails)&&void 0!==e&&e.documentDate){var ne;const e=new Date(null==q||null===(ne=q.additionalDetails)||void 0===ne?void 0:ne.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];te=`${e.getDate()} ${t} ${e.getFullYear()}`}let le=[];J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&le.push({label:x("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{var i;function o(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:l})).then(function(e){window.open(e[l],"_blank")})}let e=null==H||null===(i=H.bookingApplication)||void 0===i?void 0:i[0],l=null==e?void 0:e.paymentReceiptFilestoreId;const a=function(){if(!l){let i={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...n}]},"advservice-receipt")).then(function(t){var n;i=t;const o={...e,paymentReceiptFilestoreId:null===(n=i)||void 0===n?void 0:n.filestoreIds[0]};return Promise.resolve(W.mutateAsync({bookingApplication:o})).then(function(){var e;l=null===(e=i)||void 0===e?void 0:e.filestoreIds[0],j()})})}}();return Promise.resolve(a&&a.then?a.then(o):o())}catch(e){return Promise.reject(e)}}({tenantId:null==J||null===(e=J.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==J?void 0:J.Payments[0]})}}),J&&(null==J?void 0:J.Payments.length)>0&&0==Q&&le.push({label:x("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,...n}=e;try{var l;function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:n})).then(function(e){window.open(e[n],"_blank")})}let e=null==H||null===(l=H.bookingApplication)||void 0===l?void 0:l[0],n=null==e?void 0:e.permissionLetterFilestoreId;const o=function(){if(!n)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[e]},"advpermissionletter")).then(function(t){const l={...e,permissionLetterFilestoreId:null==t?void 0:t.filestoreIds[0]};return Promise.resolve(W.mutateAsync({bookingApplication:l})).then(function(){n=null==t?void 0:t.filestoreIds[0],j()})})}();return Promise.resolve(o&&o.then?o.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==J||null===(e=J.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==J?void 0:J.Payments[0]})}});const ie=[{Header:""+x("ADS_TYPE"),accessor:"addType"},{Header:""+x("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+x("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+x("ADS_BOOKING_DATE"),accessor:"bookingDate"},{Header:""+x("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"bookingStatus"}],oe=(null==q||null===(a=q.cartDetails)||void 0===a?void 0:a.map(e=>({addType:""+x(e.addType),faceArea:""+x(e.faceArea),nightLight:""+x(!0===e.nightLight?"Yes":"No"),bookingDate:""+x(e.bookingDate),bookingStatus:""+x(e.status)})))||[];return 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"}},x("ADS_BOOKING_DETAILS")),le&&le.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>P(!L),displayOptions:L,options:le})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:x("ADS_BOOKING_NO"),text:null==q?void 0:q.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},x("ADS_PAYMENT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:x("ADS_TOTAL_AMOUNT"),text:(null==z||null===(r=z.Bill)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.totalAmount)>0?l.createElement("span",null,"₹ ",(null==z||null===(s=z.Bill)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.totalAmount)||x("CS_NA")," ",l.createElement("strong",{style:{color:"#a82227"}},"(",x("PENDING_PAYMENT"),")")):l.createElement("span",null,"₹ ",(null==J||null===(d=J.Payments)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.totalAmountPaid)||x("CS_NA")," ",l.createElement("strong",{style:{color:"green"}},"(",x("PAYMENT_PAID"),")"))})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},x("ADS_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:x("ADS_APPLICANT_NAME"),text:(null==q||null===(v=q.applicantDetail)||void 0===v?void 0:v.applicantName)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_MOBILE_NUMBER"),text:(null==q||null===(f=q.applicantDetail)||void 0===f?void 0:f.applicantMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ALT_MOBILE_NUMBER"),text:(null==q||null===(h=q.applicantDetail)||void 0===h?void 0:h.applicantAlternateMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_EMAIL_ID"),text:(null==q||null===(g=q.applicantDetail)||void 0===g?void 0:g.applicantEmailId)||x("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},x("ADS_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:x("ADS_HOUSE_NO"),text:(null==q||null===(E=q.address)||void 0===E?void 0:E.houseNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_HOUSE_NAME"),text:(null==q||null===(y=q.address)||void 0===y?void 0:y.houseName)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_STREET_NAME"),text:(null==q||null===(S=q.address)||void 0===S?void 0:S.streetName)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ADDRESS_LINE1"),text:(null==q||null===(_=q.address)||void 0===_?void 0:_.addressLine1)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ADDRESS_LINE2"),text:(null==q||null===(b=q.address)||void 0===b?void 0:b.addressLine2)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_LANDMARK"),text:(null==q||null===(A=q.address)||void 0===A?void 0:A.landmark)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_CITY"),text:(null==q||null===(D=q.address)||void 0===D?void 0:D.city)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_LOCALITY"),text:(null==q||null===(C=q.address)||void 0===C?void 0:C.locality)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ADDRESS_PINCODE"),text:(null==q||null===(T=q.address)||void 0===T?void 0:T.pincode)||x("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},x("ADS_CART_DETAILS")),l.createElement(m,{t:x,data:oe,columns:ie,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:oe.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},x("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,ee.map((e,t)=>l.createElement(k,{value:ee,Code:null==e?void 0:e.documentType,index:t}))))))},ADSSearchApplication:K,ADSRequiredDoc:e=>{var n,i,o,a;let{t:r,onSelect:u,formData:c,value:d=c.adslist}=e;Digit.ULBService.getCurrentTenantId();const p=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:v,data:f={}}=Digit.Hooks.ads.useADSDocumentsMDMS(p,"Advertisement","Documents");let m=null==f||null===(n=f.Advertisement)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement(t.CardHeader,null,r("MODULE_ADS")),l.createElement(t.CardSubHeader,null,l.createElement(P,{timerValues:null==d||null===(i=d.existingDataSet)||void 0===i||null===(o=i.timervalue)||void 0===o?void 0:o.timervalue,SlotSearchData:null==d?void 0:d.cartDetails,draftId:null==d||null===(a=d.existingDataSet)||void 0===a?void 0:a.draftId}))),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,r("ADS_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_UPLOAD_RESTRICTIONS_TYPES")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_UPLOAD_RESTRICTIONS_SIZE")),l.createElement("div",null,v&&l.createElement(t.Loader,null),Array.isArray(m)?m.map((e,n)=>{let{code:i,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",r("ADS_"+s(i,".","_"))),o.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",r("ADS_"+s(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:r("ADS_COMMON_NEXT"),onSubmit:u}))))}},Pl=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:s}),Object.entries(Ll).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(q,{path:r,url:u,userType:i}):l.createElement(d,null)},Rl=e=>{const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:o("ADVERTISEMENT_MODULE"),links:[],Icon:()=>l.createElement(D,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:Pl,ADSLinks:Rl,ADSCard:H},exports.ADSLinks=Rl,exports.ADSModule=Pl;
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"),a=require("react-query"),r=require("react-hook-form");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function s(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}const c=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},d=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},p=["path","url"],v=[],f=()=>{var e,n,a,r,u,c;const d=o.useRouteMatch(),{path:f}=d,m=(s(d,p),i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("ADSCreate")),h=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSMyApplications"),g=null===(u=Digit)||void 0===u||null===(c=u.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ADSApplicationDetails");return l.createElement("span",{className:"ads-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(E=v)&&(E=[]),E.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:f+"/bookad",component:m}),l.createElement(t.PrivateRoute,{path:f+"/myBookings",component:h}),l.createElement(t.PrivateRoute,{path:f+"/application/:acknowledgementIds/:tenantId",component:g}))));var E},m=[{head:"ES_TITILE_APPLICANT_DETAILS",body:[{route:"searchads",component:"ADSSearch",nextStep:"info",key:"adslist",type:"component"},{route:"info",component:"ADSRequiredDoc",nextStep:"applicant-details",key:"Documents",type:"component"},{route:"applicant-details",component:"ADSCitizenDetails",withoutLabel:!0,key:"applicant",type:"component",nextStep:"address-details",hideInEmployee:!0,isMandatory:!0,texts:{header:"APPLICANT_PERSONAL_DETAILS",submitBarLabel:"ADS_COMMON_NEXT"}},{route:"address-details",component:"ADSAddress",withoutLabel:!0,key:"address",type:"component",nextStep:"document-details",hideInEmployee:!0,isMandatory:!0,texts:{header:"APPLICANT_ADDRESS_DETAILS",submitBarLabel:"ADS_COMMON_NEXT"}},{route:"document-details",component:"ADSDocumentDetails",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"ADS_COMMON_NEXT"}}]}];var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}g(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:h,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)},a=n.push,r=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),v={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},h=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var l,i,o=(n=n||h).createElement("script");if(o.text=e,t)for(l in g)(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 S=function(e,t){return new S.fn.init(e,t)};function _(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!f(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,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=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.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(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.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:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,l,i,o,a=arguments[0]||{},r=1,u=arguments.length,s=!1;for("boolean"==typeof a&&(s=a,a=arguments[r]||{},r++),"object"==typeof a||f(a)||(a={}),r===u&&(a=this,r--);r<u;r++)if(null!=(e=arguments[r]))for(t in e)l=e[t],"__proto__"!==t&&a!==l&&(s&&l&&(S.isPlainObject(l)||(i=Array.isArray(l)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(s,o,l)):void 0!==l&&(a[t]=l));return a},S.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){E(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(_(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&&(_(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:r.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,a=!n;i<o;i++)!t(e[i],i)!==a&&l.push(e[i]);return l},map:function(e,t,n){var l,i,a=0,r=[];if(_(e))for(l=e.length;a<l;a++)null!=(i=t(e[a],a,n))&&r.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&r.push(i);return o(r)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.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,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S="sizzle"+1*new Date,_=e.document,b=0,A=0,D=ue(),C=ue(),T=ue(),x=ue(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],O=I.pop,L=I.push,P=I.push,R=I.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(B+"+","g"),W=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),z=new RegExp("^"+B+"*,"+B+"*"),K=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),V=new RegExp(B+"|>"),q=new RegExp(H),G=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","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}"+B+"?|\\\\([^\\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()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(I=R.call(_.childNodes),_.childNodes)}catch(e){P={apply:I.length?function(e,t){L.apply(e,R.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function re(e,t,l,i){var o,r,s,c,d,f,g,E=t&&t.ownerDocument,_=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return l;if(!i&&(p(t),t=t||v,m)){if(11!==_&&(d=Q.exec(e)))if(o=d[1]){if(9===_){if(!(s=t.getElementById(o)))return l;if(s.id===o)return l.push(s),l}else if(E&&(s=E.getElementById(o))&&y(t,s)&&s.id===o)return l.push(s),l}else{if(d[2])return P.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return P.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!x[e+" "]&&(!h||!h.test(e))&&(1!==_||"object"!==t.nodeName.toLowerCase())){if(g=e,E=t,1===_&&(V.test(e)||K.test(e))){for((E=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,ie):t.setAttribute("id",c=S)),r=(f=a(e)).length;r--;)f[r]=(c?"#"+c:":scope")+" "+ye(f[r]);g=f.join(",")}try{return P.apply(l,E.querySelectorAll(g)),l}catch(t){x(e,!0)}finally{c===S&&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[S]=!0,e}function ce(e){var t=v.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ve(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(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&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(l[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=re.support={},o=re.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!$.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=re.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:_;return a!=v&&9===a.nodeType&&a.documentElement?(f=(v=a).documentElement,m=!o(v),_!=v&&(i=v.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return f.appendChild(e).appendChild(v.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(v.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(v.getElementsByClassName),n.getById=ce(function(e){return f.appendChild(e).id=S,!v.getElementsByName||!v.getElementsByName(S).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&&m){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&&m){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&&m)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(v.querySelectorAll))&&(ce(function(e){var t;f.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=v.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=v.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(E=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=E.call(e,"*"),E.call(e,"[s!='']:x"),g.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(f.compareDocumentPosition),y=t||J.test(f.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},N=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==v||e.ownerDocument==_&&y(_,e)?-1:t==v||t.ownerDocument==_&&y(_,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,a=[e],r=[t];if(!i||!o)return e==v?-1:t==v?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)r.unshift(n);for(;a[l]===r[l];)l++;return l?pe(a[l],r[l]):a[l]==_?-1:r[l]==_?1:0},v):v},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&m&&!x[t+" "]&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var l=E.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){x(t,!0)}return re(t,v,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!=v&&p(e),y(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=v&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&w.call(l.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},re.escape=function(e){return(e+"").replace(le,ie)},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,l=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),d){for(;t=e[o++];)t===e[o]&&(i=l.push(o));for(;i--;)e.splice(l[i],1)}return c=null,e},i=re.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=re.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]||re.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]&&re.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=a(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=D[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&D(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=re.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),a="last"!==e.slice(-4),r="of-type"===t;return 1===l&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,v,f,m=o!==a?"nextSibling":"previousSibling",h=t.parentNode,g=r&&t.nodeName.toLowerCase(),E=!u&&!r,y=!1;if(h){if(o){for(;m;){for(p=t;p=p[m];)if(r?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?h.firstChild:h.lastChild],a&&E){for(y=(v=(s=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=v&&h.childNodes[v];p=++v&&p&&p[m]||(y=v=0)||f.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[b,v,y];break}}else if(E&&(y=v=(s=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===y)for(;(p=++v&&p&&p[m]||(y=v=0)||f.pop())&&((r?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++y||(E&&((c=(d=p[S]||(p[S]={}))[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()]||re.error("unsupported pseudo: "+e);return i[S]?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),a=o.length;a--;)e[l=k(e,o[a])]=!(n[l]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],l=r(e.replace(W,"$1"));return l[S]?se(function(e,t,n,i){for(var o,a=l(e,null,i,[]),r=e.length;r--;)(o=a[r])&&(e[r]=!(t[r]=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 re(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||"")||re.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?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===f},focus:function(e){return e===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=ve(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=fe(t);function Ee(){}function ye(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function Se(e,t,n){var l=t.dir,i=t.next,o=i||l,a=n&&"parentNode"===o,r=A++;return t.first?function(t,n,i){for(;t=t[l];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var s,c,d,p=[b,r];if(u){for(;t=t[l];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||a)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[o])&&s[0]===b&&s[1]===r)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function _e(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,a=[],r=0,u=e.length,s=null!=t;r<u;r++)(o=e[r])&&(n&&!n(o,l,i)||(a.push(o),s&&t.push(r)));return a}function Ae(e,t,n,l,i,o){return l&&!l[S]&&(l=Ae(l)),i&&!i[S]&&(i=Ae(i,o)),se(function(o,a,r,u){var s,c,d,p=[],v=[],f=a.length,m=o||function(e,t,n){for(var l=0,i=t.length;l<i;l++)re(e,t[l],n);return n}(t||"*",r.nodeType?[r]:r,[]),h=!e||!o&&t?m:be(m,p,e,r,u),g=n?i||(o?e:f||l)?[]:a:h;if(n&&n(h,g,r,u),l)for(s=be(g,v),l(s,[],r,u),c=s.length;c--;)(d=s[c])&&(g[v[c]]=!(h[v[c]]=d));if(o){if(i||e){if(i){for(s=[],c=g.length;c--;)(d=g[c])&&s.push(h[c]=d);i(null,g=[],s,u)}for(c=g.length;c--;)(d=g[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(a[s]=d))}}else g=be(g===a?g.splice(f,g.length):g),i?i(null,a,g,u):P.apply(a,g)})}function De(e){for(var t,n,i,o=e.length,a=l.relative[e[0].type],r=a||l.relative[" "],u=a?1:0,c=Se(function(e){return e===t},r,!0),d=Se(function(e){return k(t,e)>-1},r,!0),p=[function(e,n,l){var i=!a&&(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=[Se(_e(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[S]){for(i=++u;i<o&&!l.relative[e[i].type];i++);return Ae(u>1&&_e(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<i&&De(e.slice(u,i)),i<o&&De(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return _e(p)}return Ee.prototype=l.filters=l.pseudos,l.setFilters=new Ee,a=re.tokenize=function(e,t){var n,i,o,a,r,u,s,c=C[e+" "];if(c)return t?0:c.slice(0);for(r=e,u=[],s=l.preFilter;r;){for(a in n&&!(i=z.exec(r))||(i&&(r=r.slice(i[0].length)||r),u.push(o=[])),n=!1,(i=K.exec(r))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),r=r.slice(n.length)),l.filter)!(i=Y[a].exec(r))||s[a]&&!(i=s[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),r=r.slice(n.length));if(!n)break}return t?r.length:r?re.error(e):C(e,u).slice(0)},r=re.compile=function(e,t){var n,i=[],o=[],r=T[e+" "];if(!r){for(t||(t=a(e)),n=t.length;n--;)(r=De(t[n]))[S]?i.push(r):o.push(r);(r=T(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,r,u,c){var d,f,h,g=0,E="0",y=o&&[],S=[],_=s,A=o||i&&l.find.TAG("*",c),D=b+=null==_?1:Math.random()||.1,C=A.length;for(c&&(s=a==v||a||c);E!==C&&null!=(d=A[E]);E++){if(i&&d){for(f=0,a||d.ownerDocument==v||(p(d),r=!m);h=e[f++];)if(h(d,a||v,r)){u.push(d);break}c&&(b=D)}n&&((d=!h&&d)&&g--,o&&y.push(d))}if(g+=E,n&&E!==g){for(f=0;h=t[f++];)h(y,S,a,r);if(o){if(g>0)for(;E--;)y[E]||S[E]||(S[E]=O.call(u));S=be(S)}P.apply(u,S),c&&!o&&S.length>0&&g+t.length>1&&re.uniqueSort(u)}return c&&(b=D,s=_),y};return n?se(o):o}(o,i))).selector=e}return r},u=re.select=function(e,t,n,i){var o,u,s,c,d,p="function"==typeof e&&e,v=!i&&a(e=p.selector||e);if(n=n||[],1===v.length){if((u=v[0]=v[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&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)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return P.apply(n,i),n;break}}return(p||r(e,v))(i,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=S.split("").sort(N).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(v.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),re}(e);S.find=b,S.expr=b.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=b.uniqueSort,S.text=b.getText,S.isXMLDoc=b.isXML,S.contains=b.contains,S.escapeSelector=b.escape;var A=function(e,t,n){for(var l=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;l.push(e)}return l},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=S.expr.match.needsContext;function T(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var x=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return f(t)?S.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return r.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?S.find.matchesSelector(l,e)?[l]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,l=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<l;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)S.find(e,i[t],n);return l>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&C.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var l,i;if(!e)return this;if(n=n||w,"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(S.merge(this,S.parseHTML(l[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),x.test(l[1])&&S.isPlainObject(t))for(l in t)f(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):f(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var O=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!C.test(e))for(;l<i;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?r.call(S(e),this[0]):r.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(T(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,l){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(i=S.filter(l,i)),this.length>1&&(L[e]||S.uniqueSort(i),O.test(e)&&i.reverse()),this.pushStack(i)}});var R=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function B(e,t,n,l){var i;try{e&&f(i=e.promise)?i.call(e).done(t).fail(n):e&&f(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,l,i,o=[],a=[],r=-1,u=function(){for(i=i||e.once,l=t=!0;a.length;r=-1)for(n=a.shift();++r<o.length;)!1===o[r].apply(n[0],n[1])&&e.stopOnFalse&&(r=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},s={add:function(){return o&&(n&&!t&&(r=o.length-1,a.push(n)),function t(n){S.each(n,function(n,l){f(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 S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,o,n))>-1;)o.splice(n,1),n<=r&&r--}),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.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 S.Deferred(function(t){S.each(n,function(n,l){var i=f(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&f(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 a(t,n,l,i){return function(){var r=this,u=arguments,s=function(){var e,s;if(!(t<o)){if((e=l.apply(r,u))===n.promise())throw new TypeError("Thenable self-resolution");f(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,a(o,n,k,i),a(o,n,M,i)):(o++,s.call(e,a(o,n,k,i),a(o,n,M,i),a(o,n,k,n.notifyWith))):(l!==k&&(r=void 0,u=[e]),(i||n.resolveWith)(r,u))}},c=i?s:function(){try{s()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(l!==M&&(r=void 0,u=[e]),n.rejectWith(r,u))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(a(0,e,f(i)?i:k,e.notifyWith)),n[1][3].add(a(0,e,f(t)?t:k)),n[2][3].add(a(0,e,f(l)?l:M))}).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(n,function(e,t){var a=t[2],r=t[5];i[t[1]]=a.add,r&&a.add(function(){l=r},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.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),a=S.Deferred(),r=function(e){return function(n){l[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(l,o)}};if(t<=1&&(B(e,a.done(r(n)).resolve,a.reject,!t),"pending"===a.state()||f(o[n]&&o[n].then)))return a.then();for(;n--;)B(o[n],r(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var U=S.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return U.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||U.resolveWith(h,[S]))}}),S.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(S.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var j=function(e,t,n,l,i,o,a){var r=0,u=e.length,s=null==n;if("object"===y(n))for(r in i=!0,n)j(e,t,r,n[r],!0,o,a);else if(void 0!==l&&(i=!0,f(l)||(a=!0),s&&(a?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(S(e),n)})),t))for(;r<u;r++)t(e[r],n,a?l:l.call(e[r],r,t(e[r],n)));return i?e:s?t.call(e):u?t(e[0],n):o},W=/^-ms-/,z=/-([a-z])/g;function K(e,t){return t.toUpperCase()}function V(e){return e.replace(W,"ms-").replace(z,K)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var l,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(l in t)i[V(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,l=e[this.expando];if(void 0!==l){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in l?[t]:t.match(R)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||S.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&&!S.isEmptyObject(t)}};var Y=new G,$=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){}$.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return $.hasData(e)||Y.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,l,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=$.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(l=a[n].name).indexOf("data-")&&(l=V(l.slice(5)),J(o,l,i[l]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){$.set(this,e)}):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)})}}),S.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,S.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),l=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),l--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.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:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,i=S.Deferred(),o=this,a=this.length,r=function(){--l||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(r));return r(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return S.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(le=function(e){return S.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"===S.css(e,"display")};function ae(e,t,n,l){var i,o,a=20,r=l?function(){return l.cur()}:function(){return S.css(e,t,"")},u=r(),s=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==s&&+u)&&ee.exec(S.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;a--;)S.style(e,t,c+s),(1-o)*(1-(o=r()/u||.5))<=0&&(a=0),c/=o;S.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 re={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,i=re[l];return i||(t=n.body.appendChild(n.createElement(l)),i=S.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),re[l]=i,i)}function se(e,t){for(var n,l,i=[],o=0,a=e.length;o<a;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<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}S.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)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&T(e,t)?S.merge([e],n):n}function ge(e,t){for(var n=0,l=e.length;n<l;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,v.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,a,r,u,s,c,d=t.createDocumentFragment(),p=[],v=0,f=e.length;v<f;v++)if((o=e[v])||0===o)if("object"===y(o))S.merge(p,o.nodeType?[o]:o);else if(Ee.test(o)){for(a=a||d.appendChild(t.createElement("div")),r=(ve.exec(o)||["",""])[1].toLowerCase(),a.innerHTML=(u=me[r]||me._default)[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(o));for(d.textContent="",v=0;o=p[v++];)if(l&&S.inArray(o,l)>-1)i&&i.push(o);else if(s=le(o),a=he(d.appendChild(o),"script"),s&&ge(a),n)for(c=0;o=a[c++];)fe.test(o.type||"")&&n.push(o);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function _e(){return!0}function be(){return!1}function Ae(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,n,l,i,o){var a,r;if("object"==typeof t){for(r in"string"!=typeof n&&(l=l||n,n=void 0),t)De(e,r,n,l,t[r],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&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,l,n)})}function Ce(e,t,n){n?(Y.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var l,o,a=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),Y.set(this,t,a),l=n(this,t),this[t](),a!==(o=Y.get(this,t))||l?Y.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(Y.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&S.event.add(e,t,_e)}S.event={global:{},add:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,v,f,m,h=Y.get(e);if(q(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(ne,i),n.guid||(n.guid=S.guid++),(u=h.events)||(u=h.events=Object.create(null)),(a=h.handle)||(a=h.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(R)||[""]).length;s--;)v=m=(r=Se.exec(t[s])||[])[1],f=(r[2]||"").split(".").sort(),v&&(d=S.event.special[v]||{},d=S.event.special[v=(i?d.delegateType:d.bindType)||v]||{},c=S.extend({type:v,origType:m,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=u[v])||((p=u[v]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,f,a)||e.addEventListener&&e.addEventListener(v,a)),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),S.event.global[v]=!0)},remove:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,v,f,m,h=Y.hasData(e)&&Y.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(R)||[""]).length;s--;)if(v=m=(r=Se.exec(t[s])||[])[1],f=(r[2]||"").split(".").sort(),v){for(d=S.event.special[v]||{},p=u[v=(l?d.delegateType:d.bindType)||v]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&m!==c.origType||n&&n.guid!==c.guid||r&&!r.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));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,f,h.handle)||S.removeEvent(e,v,h.handle),delete u[v])}else for(v in u)S.event.remove(e,v+t[s],n,l,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,l,i,o,a,r=new Array(arguments.length),u=S.event.fix(e),s=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(r[0]=u,t=1;t<arguments.length;t++)r[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,s),t=0;(i=a[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=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,r))&&!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,a,r=[],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=[],a={},n=0;n<u;n++)void 0===a[i=(l=t[n]).selector+" "]&&(a[i]=l.needsContext?S(i,this).index(s)>-1:S.find(i,this,null,[s]).length),a[i]&&o.push(l);o.length&&r.push({elem:s,handlers:o})}return s=this,u<t.length&&r.push({elem:s,handlers:t.slice(u)}),r},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:f(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[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click",_e),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&T(t,"input")&&Y.get(t,"click")||T(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?_e: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&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=_e,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=_e,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=_e,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ce(this,e,Ae),!1},trigger:function(){return Ce(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===l||S.contains(l,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,l){return De(this,e,t,n,l)},one:function(e,t,n,l){return De(this,e,t,n,l,1)},off:function(e,t,n){var l,i;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,S(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(){S.event.remove(this,e,n,t)})}});var Te=/<script|<style|<link/i,xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return T(e,"table")&&T(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,l,i,o,a,r;if(1===t.nodeType){if(Y.hasData(e)&&(r=Y.get(e).events))for(i in Y.remove(t,"handle events"),r)for(n=0,l=r[i].length;n<l;n++)S.event.add(t,i,r[i][n]);$.hasData(e)&&(o=$.access(e),a=S.extend({},o),$.set(t,a))}}function Pe(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 Re(e,t,n,l){t=o(t);var i,a,r,u,s,c,d=0,p=e.length,m=p-1,h=t[0],g=f(h);if(g||p>1&&"string"==typeof h&&!v.checkClone&&xe.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),Re(o,t,n,l)});if(p&&(a=(i=ye(t,e[0].ownerDocument,!1,e,l)).firstChild,1===i.childNodes.length&&(i=a),a||l)){for(u=(r=S.map(he(i,"script"),Ie)).length;d<p;d++)s=i,d!==m&&(s=S.clone(s,!0,!0),u&&S.merge(r,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=r[r.length-1].ownerDocument,S.map(r,Oe),d=0;d<u;d++)fe.test((s=r[d]).type||"")&&!Y.access(s,"globalEval")&&S.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?S._evalUrl&&!s.noModule&&S._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):E(s.textContent.replace(Ne,""),s,c))}return e}function ke(e,t,n){for(var l,i=t?S.filter(t,e):e,o=0;null!=(l=i[o]);o++)n||1!==l.nodeType||S.cleanData(he(l)),l.parentNode&&(n&&le(l)&&ge(he(l,"script")),l.parentNode.removeChild(l));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,i,o,a,r=e.cloneNode(!0),u=le(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=he(r),l=0,i=(o=he(e)).length;l<i;l++)Pe(o[l],a[l]);if(t)if(n)for(o=o||he(e),a=a||he(r),l=0,i=o.length;l<i;l++)Le(o[l],a[l]);else Le(e,r);return(a=he(r,"script")).length>0&&ge(a,!u&&he(e,"script")),r},cleanData:function(e){for(var t,n,l,i=S.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]?S.event.remove(n,l):S.removeEvent(n,l,t.handle);n[Y.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),S.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?S.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 Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(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&&(S.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.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&&!Te.test(e)&&!me[(ve.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,l=[],i=S(e),o=i.length-1,r=0;r<=o;r++)n=r===o?this:this.clone(!0),S(i[r])[t](n),a.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=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,a,r=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||le(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Me.test(a)&&Ue.test(t)&&(l=r.width,i=r.minWidth,o=r.maxWidth,r.minWidth=r.maxWidth=r.width=a,a=n.width,r.width=l,r.minWidth=i,r.maxWidth=o)),void 0!==a?a+"":a}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%",a=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,a,r,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,l,i;return null==r&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),i=e.getComputedStyle(n),r=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),r}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,Ke={};function Ve(e){return S.cssProps[e]||Ke[e]||(e in ze?e:Ke[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"},$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 a="width"===t?1:0,r=0,u=0;if(n===(l?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+te[a],!0,i)),l?("content"===n&&(u-=S.css(e,"padding"+te[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+te[a]+"Width",!0,i))):(u+=S.css(e,"padding"+te[a],!0,i),"padding"!==n?u+=S.css(e,"border"+te[a]+"Width",!0,i):r+=S.css(e,"border"+te[a]+"Width",!0,i));return!l&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-r-.5))||0),u}function Je(e,t,n){var l=Be(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,l),o=i,a=He(e,t,l),r="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&T(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,l))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,l),(o=r in e)&&(a=e[r])),(a=parseFloat(a)||0)+Ze(e,t,n||(i?"border":"content"),o,l,a)+"px"}function Qe(e,t,n,l,i){return new Qe.prototype.init(e,t,n,l,i)}S.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,a,r=V(t),u=Ge.test(t),s=e.style;if(u||(t=Ve(r)),a=S.cssHooks[t]||S.cssHooks[r],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,l))?i:s[t];"string"==(o=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=ae(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[r]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var i,o,a,r=V(t);return Ge.test(t)||(t=Ve(r)),(a=S.cssHooks[t]||S.cssHooks[r])&&"get"in a&&(i=a.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}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,l){if(n)return!qe.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Fe(e,Ye,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Be(e),a=!v.scrollboxSize()&&"absolute"===o.position,r=(a||l)&&"border-box"===S.css(e,"boxSizing",!1,o),u=l?Ze(e,t,l,r,o):0;return r&&a&&(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=S.css(e,t)),Xe(0,n,u)}}}),S.cssHooks.marginLeft=je(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.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&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return j(this,function(e,t,n){var l,i,o={},a=0;if(Array.isArray(t)){for(l=Be(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,l);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=o||(S.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?S.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=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.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)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function it(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(it):e.setTimeout(it,S.fx.interval),S.fx.tick())}function ot(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function at(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 rt(e,t,n){for(var l,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,a=i.length;o<a;o++)if(l=i[o].call(n,t,e))return l}function ut(e,t,n){var l,i,o=0,a=ut.prefilters.length,r=S.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,a=s.tweens.length;o<a;o++)s.tweens[o].run(l);return r.notifyWith(e,[s,l,n]),l<1&&a?n:(a||r.notifyWith(e,[s,1,0]),r.resolveWith(e,[s]),!1)},s=r.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var l=S.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?(r.notifyWith(e,[s,1,0]),r.resolveWith(e,[s,t])):r.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,i,o,a;for(n in e)if(i=t[l=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==l&&(e[l]=o,delete e[n]),(a=S.cssHooks[l])&&"expand"in a)for(n in o=a.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<a;o++)if(l=ut.prefilters[o].call(s,e,c,s.opts))return f(l.stop)&&(S._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return S.map(c,rt,s),f(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),S.fx.timer(S.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}S.Animation=S.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ae(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){f(e)?(t=e,e=["*"]):e=e.match(R);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,a,r,u,s,c,d="width"in t||"height"in t,p=this,v={},f=e.style,m=e.nodeType&&oe(e),h=Y.get(e,"fxshow");for(l in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,r=a.empty.fire,a.empty.fire=function(){a.unqueued||r()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(nt.test(i=t[l])){if(delete t[l],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;m=!0}v[l]=h&&h[l]||S.style(e,l)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(v))for(l in d&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(s=h&&h.display)&&(s=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=S.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===S.css(e,"float")&&(u||(p.done(function(){f.display=s}),null==s&&(s="none"===(c=f.display)?"":c)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]})),u=!1,v)u||(h?"hidden"in h&&(m=h.hidden):h=Y.access(e,"fxshow",{display:s}),o&&(h.hidden=!m),m&&se([e],!0),p.done(function(){for(l in m||se([e]),Y.remove(e,"fxshow"),v)S.style(e,l,v[l])})),u=rt(m?h[l]:0,l,p),l in h||(h[l]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),S.speed=function(e,t,n){var l=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||f(e)&&e,duration:e,easing:n&&t||t&&!f(t)&&t};return S.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in S.fx.speeds?S.fx.speeds[l.duration]:S.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){f(l.old)&&l.old.call(this),l.queue&&S.dequeue(this,l.queue)},l},S.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=S.isEmptyObject(e),o=S.speed(t,n,l),a=function(){var t=ut(this,S.extend({},e),o);(i||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},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=S.timers,a=Y.get(this);if(i)a[i]&&a[i].stop&&l(a[i]);else for(i in a)a[i]&&a[i].stop&&lt.test(i)&&l(a[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||S.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=S.timers,a=l?l.length:0;for(n.finish=!0,S.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<a;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,l,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,l,i)}}),S.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,it())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var i=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(i)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",v.checkOn=""!==e.value,v.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",v.radioValue="t"===e.value}();var st,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return j(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void S.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=S.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&T(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(R);if(i&&1===e.nodeType)for(;n=i[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,l){var i,o,a=t.toLowerCase();return l||(o=ct[a],ct[a]=i,i=null!=n(e,t,l)?a:null,ct[a]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function vt(e){return(e.match(R)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return j(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(i=S.propHooks[t=S.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=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,l,i,o,a,r,u=0;if(f(e))return this.each(function(t){S(this).addClass(e.call(this,t,ft(this)))});if((t=mt(e)).length)for(;n=this[u++];)if(i=ft(n),l=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(r=vt(l))&&n.setAttribute("class",r)}return this},removeClass:function(e){var t,n,l,i,o,a,r,u=0;if(f(e))return this.each(function(t){S(this).removeClass(e.call(this,t,ft(this)))});if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;n=this[u++];)if(i=ft(n),l=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(r=vt(l))&&n.setAttribute("class",r)}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):f(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,ft(this),t),t)}):this.each(function(){var t,i,o,a;if(l)for(i=0,o=S(this),a=mt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=ft(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&&(" "+vt(ft(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;S.fn.extend({val:function(e){var t,n,l,i=this[0];return arguments.length?(l=f(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=l?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ht,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,l,i=e.options,o=e.selectedIndex,a="select-one"===e.type,r=a?null:[],u=a?o+1:i.length;for(l=o<0?u:a?o:0;l<u;l++)if(((n=i[l]).selected||l===o)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;r.push(t)}return r},set:function(e,t){for(var n,l,i=e.options,o=S.makeArray(t),a=i.length;a--;)((l=i[a]).selected=S.inArray(S.valHooks.option.get(l),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,l,i){var o,a,r,u,s,d,p,v,g=[l||h],E=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(a=v=r=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!gt.test(E+S.event.triggered)&&(E.indexOf(".")>-1&&(y=E.split("."),E=y.shift(),y.sort()),s=E.indexOf(":")<0&&"on"+E,(t=t[S.expando]?t:new S.Event(E,"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]:S.makeArray(n,[t]),p=S.event.special[E]||{},i||!p.trigger||!1!==p.trigger.apply(l,n))){if(!i&&!p.noBubble&&!m(l)){for(gt.test((u=p.delegateType||E)+E)||(a=a.parentNode);a;a=a.parentNode)g.push(a),r=a;r===(l.ownerDocument||h)&&g.push(r.defaultView||r.parentWindow||e)}for(o=0;(a=g[o++])&&!t.isPropagationStopped();)v=a,t.type=o>1?u:p.bindType||E,(d=(Y.get(a,"events")||Object.create(null))[t.type]&&Y.get(a,"handle"))&&d.apply(a,n),(d=s&&a[s])&&d.apply&&q(a)&&(t.result=d.apply(a,n),!1===t.result&&t.preventDefault());return t.type=E,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),n)||!q(l)||s&&f(l[E])&&!m(l)&&((r=l[s])&&(l[s]=null),S.event.triggered=E,t.isPropagationStopped()&&v.addEventListener(E,Et),l[E](),t.isPropagationStopped()&&v.removeEventListener(E,Et),S.event.triggered=void 0,r&&(l[s]=r)),t.result}},simulate:function(e,t,n){var l=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(l,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.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,St={guid:Date.now()},_t=/\?/;S.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||S.error("Invalid XML: "+(l?S.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,l){var i;if(Array.isArray(t))S.each(t,function(t,i){n||bt.test(e)?l(e,i):Tt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,l)});else if(n||"object"!==y(t))l(e,t);else for(i in t)Tt(e+"["+i+"]",t[i],n,l)}S.param=function(e,t){var n,l=[],i=function(e,t){var n=f(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Tt(n,e[n],t,i);return l.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Ct.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var xt=/%20/g,Nt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Lt=/^\/\//,Pt={},Rt={},kt="*/".concat("*"),Mt=h.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(R)||[];if(f(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Ft(e,t,n,l){var i={},o=e===Rt;function a(r){var u;return i[r]=!0,S.each(e[r]||[],function(e,r){var s=r(t,n,l);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),a(s),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ut(e,t){var n,l,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:l||(l={}))[n]=t[n]);return l&&S.extend(!0,e,l),e}Mt.href=yt.href,S.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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,S.ajaxSettings),t):Ut(S.ajaxSettings,e)},ajaxPrefilter:Bt(Pt),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,a,r,u,s,c,d,p,v=S.ajaxSetup({},n=n||{}),f=v.context||v,m=v.context&&(f.nodeType||f.jquery)?S(f):S.event,g=S.Deferred(),E=S.Callbacks("once memory"),y=v.statusCode||{},_={},b={},A="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(s){if(!a)for(a={};t=It.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[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,_[e]=t),this},overrideMimeType:function(e){return null==s&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)D.always(e[D.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||A;return l&&l.abort(t),C(0,t),this}};if(g.promise(D),v.url=((t||v.url||yt.href)+"").replace(Lt,yt.protocol+"//"),v.type=n.method||n.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){u=h.createElement("a");try{u.href=v.url,u.href=u.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Ft(Pt,v,n,D),s)return D;for(d in(c=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),i=v.url.replace(Nt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(xt,"+")):(p=v.url.slice(i.length),v.data&&(v.processData||"string"==typeof v.data)&&(i+=(_t.test(i)?"&":"?")+v.data,delete v.data),!1===v.cache&&(i=i.replace(wt,"$1"),p=(_t.test(i)?"&":"?")+"_="+St.guid+++p),v.url=i+p),v.ifModified&&(S.lastModified[i]&&D.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&D.setRequestHeader("If-None-Match",S.etag[i])),(v.data&&v.hasContent&&!1!==v.contentType||n.contentType)&&D.setRequestHeader("Content-Type",v.contentType),D.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+kt+"; q=0.01":""):v.accepts["*"]),v.headers)D.setRequestHeader(d,v.headers[d]);if(v.beforeSend&&(!1===v.beforeSend.call(f,D,v)||s))return D.abort();if(A="abort",E.add(v.complete),D.done(v.success),D.fail(v.error),l=Ft(Rt,v,n,D)){if(D.readyState=1,c&&m.trigger("ajaxSend",[D,v]),s)return D;v.async&&v.timeout>0&&(r=e.setTimeout(function(){D.abort("timeout")},v.timeout));try{s=!1,l.send(_,C)}catch(e){if(s)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,a,u){var d,p,h,_,b,A=n;s||(s=!0,r&&e.clearTimeout(r),l=void 0,o=u||"",D.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(_=function(e,t,n){for(var l,i,o,a,r=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(i in r)if(r[i]&&r[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}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,D,a)),!d&&S.inArray("script",v.dataTypes)>-1&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),_=function(e,t,n,l){var i,o,a,r,u,s={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)s[a.toLowerCase()]=e.converters[a];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(!(a=s[u+" "+o]||s["* "+o]))for(i in s)if((r=i.split(" "))[1]===o&&(a=s[u+" "+r[0]]||s["* "+r[0]])){!0===a?a=s[i]:!0!==s[i]&&(o=r[0],c.unshift(r[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,_,D,d),d?(v.ifModified&&((b=D.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=b),(b=D.getResponseHeader("etag"))&&(S.etag[i]=b)),204===t||"HEAD"===v.type?A="nocontent":304===t?A="notmodified":(A=_.state,p=_.data,d=!(h=_.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(f,[p,A,D]):g.rejectWith(f,[D,A,h]),D.statusCode(y),y=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[D,v,d?p:h]),E.fireWith(f,[D,A]),c&&(m.trigger("ajaxComplete",[D,v]),--S.active||S.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,l,i){return f(n)&&(i=i||l,l=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:l},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(f(e)&&(e=e.call(this[0])),t=S(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 f(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=f(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=S.ajaxSettings.xhr();v.cors=!!jt&&"withCredentials"in jt,v.ajax=jt=!!jt,S.ajaxTransport(function(t){var n,l;if(v.cors||jt&&!t.crossDomain)return{send:function(i,o){var a,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)r[a]=t.xhrFields[a];for(a in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)r.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=l=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?o(0,"error"):o(r.status,r.statusText):o(Ht[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=n(),l=r.onerror=r.ontimeout=n("error"),void 0!==r.onabort?r.onabort=l:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{r.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.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 S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],Kt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,l){var i,o,a,r=!1!==t.jsonp&&(Kt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kt.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=f(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Kt,"$1"+i):!1!==t.jsonp&&(t.url+=(_t.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||S.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},l.always(function(){void 0===o?S(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),a&&f(o)&&o(a[0]),a=o=void 0}),"script"}),v.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),o=!n&&[],(i=x.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var l,i,o},S.fn.load=function(e,t,n){var l,i,o,a=this,r=e.indexOf(" ");return r>-1&&(l=vt(e.slice(r)),e=e.slice(0,r)),f(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(l?S("<div>").append(S.parseHTML(e)).find(l):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var l,i,o,a,r,u,s=S.css(e,"position"),c=S(e),d={};"static"===s&&(e.style.position="relative"),r=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===s||"fixed"===s)&&(o+u).indexOf("auto")>-1?(a=(l=c.position()).top,i=l.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),f(t)&&(t=t.call(e,n,S.extend({},r))),null!=t.top&&(d.top=t.top-r.top+a),null!=t.left&&(d.left=t.left-r.left+i),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.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"===S.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"===S.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(l,"marginTop",!0),left:t.left-i.left-S.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(l){return j(this,function(e,l,i){var o;if(m(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)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=je(v.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){S.fn[l]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),r=n||(!0===i||!0===o?"margin":"border");return j(this,function(t,n,i){var o;return m(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?S.css(t,n,r):S.style(t,n,i,r)},t,a?i:void 0,a)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.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)}}),S.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){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,l,o;if("string"==typeof t&&(n=e[t],t=e,e=n),f(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||S.guid++,o},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=T,S.isFunction=f,S.isWindow=m,S.camelCase=V,S.type=y,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var qt=e.jQuery,Gt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Gt),t&&e.jQuery===S&&(e.jQuery=qt),S},void 0===t&&(e.jQuery=e.$=S),S})});const E=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:v,pageSizeLimit:f,sortParams:m,totalRecords:h}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:u,isPaginationRequired:v,onPageSizeChange:p,onSort:s,sortParams:m,totalRecords:h})},y=e=>{let{onSubmit:o,setExistingDataSet:a,Searchdata:r}=e;const{t:s}=i.useTranslation(),c=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,p]=n.useState(null),[v,f]=n.useState(!1),m=Digit.UserService.getUser().info,h=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:r.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:c,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{v&&(o(),f(!1))},[v,o]);let E,y=window.location.href.split("/").pop();isNaN(parseInt(y))||(E=y);let S=isNaN(parseInt(y))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:c,mobileNumber:null==m?void 0:m.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:E,tenantId:c};n.useEffect(()=>{p(S)},[y]);const{isLoading:_,data:b}=Digit.Hooks.ads.useADSSearch({filters:d});if(_)return l.createElement(t.Loader,null);const A=(null==b?void 0:b.bookingApplication)||[],D={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},C={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return l.createElement(l.Fragment,null,l.createElement("div",null,A.length>0&&A.map((e,n)=>{var i;return l.createElement("div",{key:n},l.createElement(t.Card,{style:u({},D,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=C.backgroundColor,e.currentTarget.style.boxShadow=C.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(h.mutateAsync(g)).then(function(t){var n,l,i,o,r,u,s,c,d,p,v;const m=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,h={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(l=e.address)||void 0===l?void 0:l.pincode,houseNo:null==e||null===(i=e.address)||void 0===i?void 0:i.houseNo,streetName:null==e||null===(o=e.address)||void 0===o?void 0:o.streetName,landmark:null==e||null===(r=e.address)||void 0===r?void 0:r.landmark,addressline1:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine1,addressline2:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(v=e.applicantDetail)||void 0===v?void 0:v.applicantEmailId},timervalue:{timervalue:m||0},draftId:(null==t?void 0:t.draftId)||""};a(h),f(!0)})}catch(e){return Promise.reject(e)}}(e)}},l.createElement(t.KeyNote,{keyValue:s("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),l.createElement(t.KeyNote,{keyValue:s("ADS_APPLICANT_NAME"),note:null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantName}),l.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===A.length&&!_&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("ADS_NO_APPLICATION_FOUND_MSG"))))},S=()=>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"})),b=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(S,null)),A=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r,Searchdata:u}=e;const[s,c]=n.useState(!1),[d,p]=n.useState(!1),v=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),f=e=>s&&l.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),m=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:u.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:v,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(a(),p(!1))},[d,a]),l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement(f,{t:i}),headerBarEnd:l.createElement(b,{onClick:o}),actionCancelLabel:s&&i("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},s&&l.createElement(y,{onSubmit:a,setExistingDataSet:r,Searchdata:u}),l.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!s&&l.createElement(t.SubmitBar,{label:i("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!s&&l.createElement(t.SubmitBar,{label:i("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(m.mutateAsync(h)).then(function(e){r({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},D=()=>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"})),C=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(D,null)),T=e=>{let{onClose:n,cartDetails:a,setCartDetails:r}=e;const{t:u}=i.useTranslation(),s=(o.useLocation(),[{Header:()=>l.createElement("div",{style:{paddingLeft:"50px"}},u("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:u("ADD_TYPE"),accessor:"addType"},{Header:u("FACE_AREA"),accessor:"faceArea"},{Header:u("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,u(t?"Yes":"No"))}},{Header:u("BOOKING_DATE"),accessor:"bookingDate"},{Header:u("UNIT_PRICE"),accessor:"price"},{Header:u("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return l.createElement("div",{className:"sla-cell-success"},t)}},{Header:u("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>(e=>{const t=a.filter((t,n)=>n!==e);r(t)})(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(C,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},l.createElement(E,{t:u,data:a,columns:s,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:a.length}),l.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",a.reduce((e,t)=>e+Number(t.price),0)))},x=e=>{let{styles:t,className:n}=e;return l.createElement("svg",{width:"24",height:"24",className:n,style:u({},t),viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M7 10H4V17H7V10Z"}),l.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),l.createElement("path",{d:"M22 19H2V22H22V19Z"}),l.createElement("path",{d:"M20 10H17V17H20V10Z"}),l.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))};let N=[];const w=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":N=[];break;default:N=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(o),l.createElement("div",{className:"timeline-container",style:r?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},N.map((e,i,o)=>l.createElement("div",{className:"timeline-checkpoint",key:i},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(i<=n-1&&"active")},i<n-1?l.createElement(t.TickMark,null):i+1),l.createElement("span",{className:"secondary-color"},a(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))},I=()=>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=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(I,null))},L=()=>{var e,o,a,r,s,c,d,p,v,f,m,h,g,y,S;const[_,b]=n.useState(!1),[A,D]=n.useState(!1),{t:C}=i.useTranslation(),[T,x]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),N=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[w,I]=n.useState(!1),[L,P]=n.useState(!1),R=[{Header:()=>l.createElement("div",{style:{paddingLeft:"50px"}},C("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:C("ADD_TYPE"),accessor:"addType"},{Header:C("FACE_AREA"),accessor:"faceArea"},{Header:C("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,C(t?"Yes":"No"))}},{Header:C("BOOKING_DATE"),accessor:"bookingDate"},{Header:C("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>(e=>{var t;const n=u({},T);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),x(n)})(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let k={tenantId:N,cartDetails:null==T||null===(e=T.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},M=Digit.Hooks.ads.useADSDemandEstimation();!1===w&&(M.mutate(k),I(!0));const B=()=>{D(e=>!e)},F=()=>{P(!L)},U=()=>{b(e=>!e)},H=(null===(o=M.data)||void 0===o?void 0:o.demands[0])&&(null===(a=M.data)||void 0===a||null===(r=a.demands[0])||void 0===r?void 0:r.additionalDetails);return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement("div",null,l.createElement("div",{onClick:B,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},l.createElement("div",{class:"container",style:{width:"1px"}}," ",l.createElement("div",{style:{width:"20px",position:"relative"}},l.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},l.createElement("div",null," ",null==T||null===(s=T.adslist)||void 0===s?void 0:s.cartDetails.length)))),"View Cart"),l.createElement("div",{onClick:U,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),l.createElement("div",{onClick:F,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",l.createElement("strong",null,H," INR"))),_&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:l.createElement(O,{onClick:U}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:_,onClose:U}),A&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(O,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},l.createElement(E,{t:C,data:null==T||null===(c=T.adslist)||void 0===c?void 0:c.cartDetails,columns:R,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==T||null===(d=T.adslist)||void 0===d?void 0:d.cartDetails.length})),L&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:l.createElement(O,{onClick:F}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:l.createElement("div",null,l.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),l.createElement("ul",null,(null===(p=M.data)||void 0===p||null===(v=p.demands[0])||void 0===v?void 0:v.demandDetails)&&(null===(f=M.data)||void 0===f||null===(m=f.demands[0])||void 0===m?void 0:m.demandDetails.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},l.createElement(t.CardText,null,C(""+e.taxHeadMasterCode)),l.createElement(t.CardText,null,"Rs ",e.taxAmount))))),l.createElement("hr",null),l.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},l.createElement(t.CardLabelDesc,null,"Total"),l.createElement(t.CardLabelDesc,null,"Rs ",(null===(h=M.data)||void 0===h||null===(g=h.demands[0])||void 0===g?void 0:g.demandDetails)&&(j=null===(y=M.data)||void 0===y||null===(S=y.demands[0])||void 0===S?void 0:S.demandDetails,j.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:L,onClose:F}));var j};function P(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function R(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const k=e=>{let{t:i,SlotSearchData:o,draftId:a=""}=e;const[r,u]=n.useState(0),[s,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,v]=n.useState(!1),f=Digit.Hooks.ads.useADSSlotSearch(),m={advertisementSlotSearchCriteria:o.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:a,isTimerRequired:!0}))};return n.useEffect(()=>{0!==r||p||(function(){try{const e=P(function(){return Promise.resolve(f.mutateAsync(m)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),l=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:i("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):u(l||0)})},function(){c({error:!0,label:i("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),v(!0))},[i,r,p]),n.useEffect(()=>{if(r>0){const e=setInterval(()=>{u(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[r]),n.useEffect(()=>{if(s){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[s]),l.createElement("div",null,l.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return Math.floor(e/60)+":"+(t<10?"0":"")+t})(r)),s&&l.createElement(t.Toast,{error:s.error,warning:s.warning,label:i(s.label),onClose:()=>{c(null)}}))};function M(e){var i;let{t:o,document:a,setDocuments:r,setError:s,documents:c,action:d,formData:p,id:v}=e;const f=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],m=Digit.UserService.getUser().info,[h,g]=(Digit.ULBService.getCurrentTenantId(),n.useState(f?u({},f,{active:!0,code:null==f?void 0:f.documentType,i18nKey:"ADS_"+(null==f?void 0:f.documentType.replaceAll(".","_"))}):(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)>0?null==a?void 0:a.dropdownData[0]:{})),[E,y]=n.useState(null),[S,_]=n.useState(()=>(null==f?void 0:f.fileStoreId)||null),[b,A]=n.useState(!1),{dropdownData:D}=a;var C=D;const[T,x]=n.useState(!1),N=()=>l.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=h&&h.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==h?void 0:h.code,fileStoreId:S,documentUid:S}]})},[S,h]),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==a?void 0:a.code))[0],l=C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return u({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(g(l),_(null==n?void 0:n.fileStoreId)):x(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(E){const e=function(){if(E.size>=5242880)s(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=R(function(){return P(function(){return _(null),A(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",E,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?_(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):s(o("CS_FILE_UPLOAD_ERROR"))})},function(){s(o("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(A(!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)}}()},[E]),n.useEffect(()=>{T&&_(null)},[T]),l.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o("ADS_"+(null==a?void 0:a.code.replaceAll(".","_")))," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"EMPLOYEE"===m.type?"50%":"100%"},placeholder:"Select "+o("ADS_"+(null==a?void 0:a.code.replaceAll(".","_"))),option:C.map(e=>{var t;return u({},e,{i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))})}),select:e=>g(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){y(e.target.files[0])},onDelete:()=>{_(null)},id:v,message:b?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(N,null),l.createElement("span",null,"Uploading...")):S?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function B(e){let{value:n={},Code:o,index:a,showFileName:r=!1}=e;const{t:s}=i.useTranslation(),{isLoading:c,data:d}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},o,a),p=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("rect",{width:"24",height:"24",rx:"4",fill:"#D32F2F"}),l.createElement("text",{x:"0",y:"16","font-family":"Arial, sans-serif","font-size":"12","font-weight":"bold",fill:"#FFFFFF"},"PDF")),v=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===o).map(e=>u({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===o).map(e=>u({},e,{documentType:e.documentType.replace(/\./g,"_")}));return c?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(l.Fragment,null,l.createElement("div",null,v.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let l=e[t]||"",i=(null==l?void 0:l.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(d.pdfFiles,e.fileStoreId);return l.createElement("a",{target:"_",href:n,style:{minWidth:"160px",display:"flex",alignItems:"center"},key:t},l.createElement("p",{style:{marginRight:"8px",margin:"5px",color:"blue",fontWeight:"bold"}},s("ADS_"+(null==o?void 0:o.split(".").slice(0,4).join("_")))),l.createElement(p,null))}))))}const F=e=>{let{jumpTo:n}=e;const{t:a}=i.useTranslation(),r=o.useHistory();return l.createElement(t.LinkButton,{label:a("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){r.push(n)}})},U=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_SUCCESS"):t("ES_ADS_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_PENDING"):t("CS_ADS_BOOKING_PENDING"):e.isSuccess?void 0:window.location.href.includes("editbookads")?t("CS_ADS_UPDATE_BOOKING_FAILED"):t("CS_ADS_BOOKING_FAILED")},H={padding:"4px 0px",justifyContent:"space-between"},j=e=>{var n;return l.createElement(t.Banner,{message:U(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.bookingApplication[0].bookingNo,info:e.isSuccess?e.t("ADS_BOOKING_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},W=()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const r=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],u=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,s={Icon:l.createElement(x,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:r.filter(e=>!(null!=e&&e.role)||u)};return l.createElement(t.EmployeeModuleCard,s)},z=e=>l.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),K=()=>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"})),V=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(K,null)),q=e=>{let{t:i,closeModal:o,actionCancelLabel:a,actionCancelOnSubmit:u,actionSaveLabel:s,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,v]=n.useState(!1),{handleSubmit:f}=r.useForm();return l.createElement(t.Modal,{headerBarMain:l.createElement(z,{t:i}),headerBarEnd:l.createElement(V,{onClick:o}),actionCancelLabel:i(a),actionCancelOnSubmit:u,actionSaveLabel:i(s),actionSaveOnSubmit:f(c),isDisabled:!p,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("form",{onSubmit:f(d)},l.createElement(t.CheckBox,{label:i("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{v(!p)},style:{height:"auto"}}))))},G=e=>{var i,a;let{tenantId:s,isLoading:c,t:d,onSubmit:p,data:v,count:f,setShowToast:m}=e;const h=window.Digit.Utils.browser.isMobile(),{register:g,control:E,handleSubmit:y,setValue:S,getValues:_,reset:b,formState:A}=r.useForm({defaultValues:{offset:0,limit:!h&&10,sortBy:"commencementDate",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:{i18nKey:"Booked",code:"BOOKED",value:d("CHB_BOOKED")}}});n.useEffect(()=>{g("offset",0),g("limit",10),g("sortBy","commencementDate"),g("sortOrder","DESC"),y(p)()},[g]);const[D,C]=n.useState(""),[T,x]=n.useState(!1),N=Digit.Hooks.ads.useADSCreateAPI(s,!1),{data:w}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}});let I=[];w&&w.map(e=>{I.push({i18nKey:""+e.code,code:""+e.code,value:""+e.name})});const O=e=>l.createElement("span",{className:"cell-text"},e),L=function(){try{x(!1);const e=u({},D,{bookingStatus:"CANCELLED"});return Promise.resolve(N.mutateAsync({bookingApplication:e})).then(function(){y(p)()})}catch(e){return Promise.reject(e)}},R=n.useMemo(()=>[{Header:d("ADS_BOOKING_NO"),accessor:"bookingNo",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/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:d("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,l;return O(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(l=n.applicantDetail)||void 0===l?void 0:l.applicantName))},disableSortBy:!0},{Header:d("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const l=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,i=null==l?void 0:l.map(e=>null==e?void 0:e.location).join(", ");return O(i)},disableSortBy:!0},{Header:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return O(""+d(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0},{Header:d("ADS_ACTIONS"),Cell:e=>{let{row:i}=e;const[a,r]=n.useState(!1),u=n.useRef(),c=o.useHistory(),p=e=>{u.current&&!u.current.contains(e.target)&&r(!1)};l.useEffect(()=>(document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}),[]);let v=null==i?void 0:i.original;const f=Digit.Hooks.ads.useADSSlotSearch();let h={advertisementSlotSearchCriteria:null==v?void 0:v.cartDetails.map(e=>({bookingId:null==v?void 0:v.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:s,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return l.createElement("div",{ref:u},l.createElement(l.Fragment,null,l.createElement(t.SubmitBar,{label:d("WF_TAKE_ACTION"),onSubmit:()=>{r(!a)},disabled:"CANCELLED"===(null==v?void 0:v.bookingStatus)||"EXPIRED"===(null==v?void 0:v.bookingStatus)}),a&&l.createElement("div",{style:{position:"absolute",backgroundColor:"white",border:"1px solid #ccc",borderRadius:"4px",padding:"8px",zIndex:1e3}},"BOOKED"===(null==v?void 0:v.bookingStatus)&&l.createElement("div",{onClick:function(){try{return x(!0),C(null==i?void 0:i.original),Promise.resolve()}catch(e){return Promise.reject(e)}},style:{display:"block",padding:"8px",textDecoration:"none",color:"black",cursor:"pointer"}},d("ADS_CANCEL")),"BOOKED"!==(null==v?void 0:v.bookingStatus)&&l.createElement("div",{onClick:()=>function(){try{const e=P(function(){return Promise.resolve(f.mutateAsync(h)).then(function(e){var t;let n={bookingId:null==v?void 0:v.bookingId,tenantId:s,cartDetails:null==v?void 0:v.cartDetails};const l=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),i=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;l?m({error:!0,label:d("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):c.push({pathname:"/digit-ui/employee/payment/collect/adv-services/"+(null==v?void 0:v.bookingNo),state:{tenantId:null==v?void 0:v.tenantId,bookingNo:null==v?void 0:v.bookingNo,timerValue:i,SlotSearchData:n}})})},function(){m({error:!0,label:d("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),style:{display:"block",padding:"8px",textDecoration:"none",color:"black",cursor:"pointer"}},d("ADS_COLLECT_PAYMENT")))))}}],[]),k=[{i18nKey:"Booked",code:"BOOKED",value:d("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:d("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:d("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:d("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:d("ADS_CANCELLED")}],M=n.useCallback(e=>{0!==e.length&&(S("sortBy",e.id),S("sortOrder",e.desc?"DESC":"ASC"))},[]);function B(){S("offset",_("offset")-_("limit")),y(p)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,d("ADS_SEARCH_BOOKINGS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},d("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:p,handleSubmit:y},l.createElement(t.SearchField,null,l.createElement("label",null,d("ADS_BOOKING_NO")),l.createElement(t.TextInput,{name:"bookingNo",inputRef:g({})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("ADS_APPLICANT_NAME")),l.createElement(t.TextInput,{name:"applicantName",inputRef:g({})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("ADS_FACE_AREA")),l.createElement(r.Controller,{control:E,name:"faceArea",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:I,optionKey:"i18nKey",t:d,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(r.Controller,{control:E,name:"status",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:k,optionKey:"i18nKey",t:d,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,d("ADS_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:g({minLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:d("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:d("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==A||null===(i=A.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,d("FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:E})),l.createElement(t.SearchField,null,l.createElement("label",null,d("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:d("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{b({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),m(null),B()}},d("ES_COMMON_CLEAR_ALL")))),!c&&null!=v&&v.display?l.createElement(t.Card,{style:{marginTop:20}},d(v.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):c||""===v?""!==v||c&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:d,data:v,totalRecords:f,columns:R,getCellProps:e=>({style:{minWidth:e.column.Header===d("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){S("limit",Number(e.target.value)),y(p)()},currentPage:_("offset")/_("limit"),onNextPage:function(){S("offset",_("offset")+_("limit")),y(p)()},onPrevPage:B,pageSizeLimit:_("limit"),onSort:M,disableSort:!1,sortParams:[{id:_("sortBy"),desc:"DESC"===_("sortOrder")}]})),T&&l.createElement(q,{t:d,closeModal:()=>x(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>x(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:L,onSubmit:L}))},Y=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState({}),[d,p]=n.useState(null);n.useEffect(()=>{if(d){const e=setTimeout(()=>{p(null)},1e3);return()=>clearTimeout(e)}},[d]);const v={enabled:!!(s&&Object.keys(s).length>0)},{isLoading:f,isSuccess:m,data:{bookingApplication:h,Count:g}={}}=Digit.Hooks.ads.useADSSearch({tenantId:r,filters:s},v);return l.createElement(l.Fragment,null,l.createElement(G,{t:a,isLoading:f,tenantId:r,setShowToast:p,onSubmit:function(e){const t=u({},e,e.toDate?{toDate:null==e?void 0:e.toDate}:{},e.fromDate?{fromDate:null==e?void 0:e.fromDate}:{});let n=Object.keys(t).filter(e=>t[e]).reduce((e,n)=>u({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{});!(Object.entries(n).length>0)||n.bookingNo||n.fromDate||n.status||n.applicantName||n.faceArea||n.toDate||n.mobileNumber?Object.entries(n).length>0&&n.fromDate&&!n.toDate||!n.fromDate&&n.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):c(n):p({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:m&&!f?h.length>0?h:{display:"ES_COMMON_NO_DATA"}:"",count:g}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:a(d.label),onClose:()=>{p(null)}}))},$=e=>{var n,a,r,s;let{path:c}=e;i.useTranslation();const d=o.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const p=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ADSCreate"),v=null===(r=Digit)||void 0===r||null===(s=r.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ApplicationDetails"),f=window.location.href.includes("ads/response"),m=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details");return l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},f?null:l.createElement("div",{style:m?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},l.createElement(t.BackButton,{location:d})),l.createElement(t.PrivateRoute,{path:c+"/bookad",component:p}),l.createElement(t.PrivateRoute,{path:c+"/my-applications",component:e=>l.createElement(Y,u({},e,{parentRoute:c}))}),l.createElement(t.PrivateRoute,{path:c+"/applicationsearch/application-details/:id",component:()=>l.createElement(v,{parentRoute:c})})))))},X=e=>{var a;let{application:r,tenantId:u,buttonLabel:s}=e;const{t:c}=i.useTranslation(),d=o.useHistory(),[p,v]=n.useState(null),f=Digit.Hooks.ads.useADSSlotSearch();let m={advertisementSlotSearchCriteria:null==r?void 0:r.cartDetails.map(e=>({bookingId:null==r?void 0:r.bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{if(p){const e=setTimeout(()=>{v(null)},2e3);return()=>clearTimeout(e)}},[p]),l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_NO"),note:null==r?void 0:r.bookingNo}),l.createElement(t.KeyNote,{keyValue:c("ADS_APPLICANT_NAME"),note:null==r||null===(a=r.applicantDetail)||void 0===a?void 0:a.applicantName}),l.createElement(t.KeyNote,{keyValue:c("ADS_BOOKING_DATE"),note:(e=>{var t,n;if(!e||0===e.length)return c("CS_NA");const l=null===(t=e[0])||void 0===t?void 0:t.bookingDate,i=null===(n=e[e.length-1])||void 0===n?void 0:n.bookingDate;return l===i?l:l&&i?l+" - "+i:c("CS_NA")})(null==r?void 0:r.cartDetails)}),l.createElement(t.KeyNote,{keyValue:c("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:c(""+(null==r?void 0:r.bookingStatus))}),l.createElement("div",null,l.createElement(o.Link,{to:"/digit-ui/citizen/ads/application/"+(null==r?void 0:r.bookingNo)+"/"+(null==r?void 0:r.tenantId)},l.createElement(t.SubmitBar,{label:s})),("BOOKING_CREATED"===r.bookingStatus||"PAYMENT_FAILED"===r.bookingStatus||"PENDING_FOR_PAYMENT"===r.bookingStatus)&&l.createElement(t.SubmitBar,{label:c("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:function(){try{const e=P(function(){return Promise.resolve(f.mutateAsync(m)).then(function(e){var t;let n={bookingId:null==r?void 0:r.bookingId,tenantId:u,cartDetails:null==r?void 0:r.cartDetails};const l=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),i=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;l?v({error:!0,label:c("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):d.push({pathname:"/digit-ui/citizen/payment/my-bills/adv-services/"+(null==r?void 0:r.bookingNo),state:{tenantId:null==r?void 0:r.tenantId,bookingNo:null==r?void 0:r.bookingNo,timerValue:i,SlotSearchData:n}})})},function(){v({error:!0,label:c("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},style:{margin:"20px"}})),p&&l.createElement(t.Toast,{error:p.error,warning:p.warning,label:c(p.label),onClose:()=>{v(null)}}))};var Z,J=Array.isArray,Q="object"==typeof h&&h&&h.Object===Object&&h,ee="object"==typeof self&&self&&self.Object===Object&&self,te=Q||ee||Function("return this")(),ne=te.Symbol,le=Object.prototype,ie=le.hasOwnProperty,oe=le.toString,ae=ne?ne.toStringTag:void 0,re=Object.prototype.toString,ue=ne?ne.toStringTag:void 0,se=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ue&&ue in Object(e)?function(e){var t=ie.call(e,ae),n=e[ae];try{e[ae]=void 0;var l=!0}catch(e){}var i=oe.call(e);return l&&(t?e[ae]=n:delete e[ae]),i}(e):function(e){return re.call(e)}(e)},ce=function(e){return null!=e&&"object"==typeof e},de=function(e){return"symbol"==typeof e||ce(e)&&"[object Symbol]"==se(e)},pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ve=/^\w*$/,fe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},me=function(e){if(!fe(e))return!1;var t=se(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},he=te["__core-js_shared__"],ge=(Z=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+Z:"",Ee=Function.prototype.toString,ye=function(e){if(null!=e){try{return Ee.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Se=/^\[object .+?Constructor\]$/,_e=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!fe(e)||(t=e,ge&&ge in t))&&(me(e)?_e:Se).test(ye(e));var t}(n)?n:void 0},Ae=be(Object,"create"),De=Object.prototype.hasOwnProperty,Ce=Object.prototype.hasOwnProperty;function Te(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])}}Te.prototype.clear=function(){this.__data__=Ae?Ae(null):{},this.size=0},Te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Te.prototype.get=function(e){var t=this.__data__;if(Ae){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return De.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return Ae?void 0!==t[e]:Ce.call(t,e)},Te.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ae&&void 0===t?"__lodash_hash_undefined__":t,this};var xe=Te,Ne=function(e,t){return e===t||e!=e&&t!=t},we=function(e,t){for(var n=e.length;n--;)if(Ne(e[n][0],t))return n;return-1},Ie=Array.prototype.splice;function Oe(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])}}Oe.prototype.clear=function(){this.__data__=[],this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=we(t,e);return!(n<0||(n==t.length-1?t.pop():Ie.call(t,n,1),--this.size,0))},Oe.prototype.get=function(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]},Oe.prototype.has=function(e){return we(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var n=this.__data__,l=we(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Le=Oe,Pe=be(te,"Map"),Re=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 ke(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])}}ke.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(Pe||Le),string:new xe}},ke.prototype.delete=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},ke.prototype.get=function(e){return Re(this,e).get(e)},ke.prototype.has=function(e){return Re(this,e).has(e)},ke.prototype.set=function(e,t){var n=Re(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Me=ke;function Be(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(Be.Cache||Me),n}Be.Cache=Me;var Fe,Ue,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,je=/\\(\\)?/g,We=(Fe=Be(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(He,function(e,n,l,i){t.push(l?i.replace(je,"$1"):n||e)}),t},function(e){return 500===Ue.size&&Ue.clear(),e}),Ue=Fe.cache,Fe),ze=ne?ne.prototype:void 0,Ke=ze?ze.toString:void 0,Ve=function(e){if("string"==typeof e||de(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},qe=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&&!de(e))||ve.test(e)||!pe.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(de(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[Ve(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},Ge=g(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",v="[object Number]",f="[object Object]",m="[object RegExp]",g="[object Set]",E="[object String]",y="[object Symbol]",S="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",A="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",x="[object Int32Array]",N="[object Uint8Array]",w="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(R.source),B=RegExp(k.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,V=RegExp(K.source),q=/^\s+/,G=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+ce+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+he+")",Ae="(?:"+_e+"|"+he+")",De="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,ye,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",ye,Se].join("|")+")"+Ce,xe="(?:"+[Ee+ve+"?",ve,ye,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Oe=RegExp([_e+"?"+me+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,_e,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,_e+be,"$"].join("|")+")",_e+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,Te].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ke=-1,Me={};Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[o]=Me[a]=Me[_]=Me[r]=Me[b]=Me[u]=Me[s]=Me[c]=Me[p]=Me[v]=Me[f]=Me[m]=Me[g]=Me[E]=Me[S]=!1;var Be={};Be[o]=Be[a]=Be[_]=Be[b]=Be[r]=Be[u]=Be[A]=Be[D]=Be[C]=Be[T]=Be[x]=Be[p]=Be[v]=Be[f]=Be[m]=Be[g]=Be[E]=Be[y]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[s]=Be[c]=Be[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof h&&h&&h.Object===Object&&h,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ke=t&&!t.nodeType&&t,Ve=Ke&&e&&!e.nodeType&&e,qe=Ve&&Ve.exports===Ke,Ge=qe&&je.process,Ye=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&gt(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var ft=_t("length");function mt(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):ht(e,yt,n)}function Et(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 St(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function _t(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 At(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Dt(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Tt(e){return e?e.slice(0,Kt(e)+1).replace(q,""):e}function xt(e){return function(t){return e(t)}}function Nt(e,t){return st(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&gt(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length;n--&&gt(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=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"}),Rt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Fe[e]}function Mt(e){return Le.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Kt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Vt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),qt=function e(t){var h=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,Re))).Array,G=t.Date,ce=t.Error,de=t.Function,pe=t.Math,ve=t.Object,fe=t.RegExp,me=t.String,he=t.TypeError,ge=h.prototype,Ee=ve.prototype,ye=t["__core-js_shared__"],Se=de.prototype.toString,_e=Ee.hasOwnProperty,be=0,Ae=function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=Ee.toString,Ce=Se.call(ve),Te=ze._,xe=fe("^"+Se.call(_e).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=qe?t.Buffer:void 0,Le=t.Symbol,Fe=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,We=Ft(ve.getPrototypeOf,ve),Ke=ve.create,Ve=Ee.propertyIsEnumerable,Ge=ge.splice,Ye=Le?Le.isConcatSpreadable:void 0,ft=Le?Le.iterator:void 0,bt=Le?Le.toStringTag:void 0,Gt=function(){try{var e=Zi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,$t=G&&G.now!==ze.Date.now&&G.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=pe.ceil,Jt=pe.floor,Qt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ft(ve.keys,ve),on=pe.max,an=pe.min,rn=G.now,un=t.parseInt,sn=pe.random,cn=ge.reverse,dn=Zi(t,"DataView"),pn=Zi(t,"Map"),vn=Zi(t,"Promise"),fn=Zi(t,"Set"),mn=Zi(t,"WeakMap"),hn=Zi(ve,"create"),gn=mn&&new mn,En={},yn=Co(dn),Sn=Co(pn),_n=Co(vn),bn=Co(fn),An=Co(mn),Dn=Le?Le.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,Tn=Dn?Dn.toString:void 0;function xn(e){if(Wa(e)&&!Oa(e)&&!(e instanceof On)){if(e instanceof In)return e;if(_e.call(e,"__wrapped__"))return To(e)}return new In(e)}var Nn=function(){function e(){}return function(t){if(!ja(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function 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 Pn(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 Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Rn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Bn(e,t){var n=Oa(e),l=!n&&Ia(e),i=!n&&!l&&ka(e),o=!n&&!l&&!i&&Xa(e),a=n||l||i||o,r=a?Ct(e.length,me):[],u=r.length;for(var s in e)!t&&!_e.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||io(s,u))||r.push(s);return r}function Fn(e){var t=e.length;return t?e[Rl(0,t-1)]:void 0}function Un(e,t){return bo(mi(e),Yn(t,0,e.length))}function Hn(e){return bo(mi(e))}function jn(e,t,n){(void 0!==n&&!xa(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}function Wn(e,t,n){var l=e[t];_e.call(e,t)&&xa(l,n)&&(void 0!==n||t in e)||qn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(xa(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return Qn(e,function(e,i,o){t(l,e,n(e),o)}),l}function Vn(e,t){return e&&hi(t,Er(t),e)}function qn(e,t,n){"__proto__"==t&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Gn(e,t){for(var n=-1,l=t.length,i=h(l),o=null==e;++n<l;)i[n]=o?void 0:vr(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function $n(e,t,n,l,i,a){var s,h=1&t,S=2&t,O=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!ja(e))return e;var L=Oa(e);if(L){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!h)return mi(e,s)}else{var P=eo(e),R=P==c||P==d;if(ka(e))return si(e,h);if(P==f||P==o||R&&!i){if(s=S||R?{}:no(e),!h)return S?function(e,t){return hi(e,Qi(e),t)}(e,function(e,t){return e&&hi(t,yr(t),e)}(s,e)):function(e,t){return hi(e,Ji(e),t)}(e,Vn(s,e))}else{if(!Be[P])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case _:return ci(e);case r:case u:return new l(+e);case b:return function(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case A:case D:case C:case T:case x:case N:case"[object Uint8ClampedArray]":case w:case I:return di(e,n);case p:return new l;case v:case E:return new l(e);case m:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new l;case y:return Cn?ve(Cn.call(e)):{}}}(e,P,h)}}a||(a=new Mn);var k=a.get(e);if(k)return k;a.set(e,s),Ga(e)?e.forEach(function(l){s.add($n(l,t,n,l,e,a))}):za(e)&&e.forEach(function(l,i){s.set(i,$n(l,t,n,i,e,a))});var M=L?void 0:(O?S?Ki:zi:S?yr:Er)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),Wn(s,i,$n(l,t,n,i,e,a))}),s}function Xn(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 Zn(e,t,l){if("function"!=typeof e)throw new he(n);return Eo(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],s=t.length;if(!r)return u;n&&(t=st(t,xt(n))),l?(o=ut,a=!1):t.length>=200&&(o=wt,a=!1,t=new kn(t));e:for(;++i<r;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,a&&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}xn.templateSettings={escape:F,evaluate:U,interpolate:H,variable:"",imports:{_:xn}},(xn.prototype=wn.prototype).constructor=xn,(In.prototype=Nn(wn.prototype)).constructor=In,(On.prototype=Nn(wn.prototype)).constructor=On,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 _e.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:_e.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},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return zn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(pn||Pn),string:new Ln}},Rn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return $i(this,e).get(e)},Rn.prototype.has=function(e){return $i(this,e).has(e)},Rn.prototype.set=function(e,t){var n=$i(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new Pn,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 Pn){var l=n.__data__;if(!pn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(l)}return n.set(e,t),this.size=n.size,this};var Qn=yi(rl),el=yi(ul,!0);function tl(e,t){var n=!0;return Qn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!$a(a):n(a,r)))var r=a,u=o}return u}function ll(e,t){var n=[];return Qn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=lo),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?il(r,t-1,n,l,i):ct(i,r):l||(i[i.length]=r)}return i}var ol=Si(),al=Si(!0);function rl(e,t){return e&&ol(e,t,Er)}function ul(e,t){return e&&al(e,t,Er)}function sl(e,t){return at(t,function(t){return Fa(e[t])})}function cl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Do(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return Oa(e)?l:ct(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=_e.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=De.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return De.call(e)}(e)}function vl(e,t){return e>t}function fl(e,t){return null!=e&&_e.call(e,t)}function ml(e,t){return null!=e&&t in ve(e)}function hl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=h(o),u=Infinity,s=[];a--;){var c=e[a];a&&t&&(c=st(c,xt(t))),u=an(c.length,u),r[a]=!n&&(t||i>=120&&c.length>=120)?new kn(a&&c):void 0}c=e[0];var d=-1,p=r[0];e:for(;++d<i&&s.length<u;){var v=c[d],f=t?t(v):v;if(v=n||0!==v?v:0,!(p?wt(p,f):l(s,f,n))){for(a=o;--a;){var m=r[a];if(!(m?wt(m,f):l(e[a],f,n)))continue e}p&&p.push(f),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=fo(e,t=oi(t,e)))?e:e[Do(Bo(t))];return null==l?void 0:tt(l,e,n)}function El(e){return Wa(e)&&pl(e)==o}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Wa(e)&&!Wa(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=Oa(e),h=Oa(t),S=d?a:eo(e),A=h?a:eo(t),D=(S=S==o?f:S)==f,C=(A=A==o?f:A)==f,T=S==A;if(T&&ka(e)){if(!ka(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Mn),d||Xa(e)?ji(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case v:return xa(+e,+t);case s:return e.name==t.name&&e.message==t.message;case m:case E:return e==t+"";case p:var c=Bt;case g:if(c||(c=Ht),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var f=ji(c(e),c(t),l,i,o,a);return a.delete(e),f;case y:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,S,n,l,i,c);if(!(1&n)){var x=D&&_e.call(e,"__wrapped__"),N=C&&_e.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Mn),i(w,I,n,l,c)}}return!!T&&(c||(c=new Mn),function(e,t,n,l,i,o){var a=1&n,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var s=u;s--;){var c=r[s];if(!(a?c in t:_e.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var f=a;++s<u;){var m=e[c=r[s]],h=t[c];if(l)var g=a?l(h,m,c,t,e,o):l(m,h,c,e,t,o);if(!(void 0===g?m===h||i(m,h,n,l,o):g)){v=!1;break}f||(f="constructor"==c)}if(v&&!f){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,c))}(e,t,n,l,yl,i))}function Sl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=ve(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[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?yl(c,s,3,l,d):p))return!1}}return!0}function _l(e){return!(!ja(e)||(t=e,Ae&&Ae in t))&&(Fa(e)?xe:ie).test(Co(e));var t}function bl(e){return"function"==typeof e?e:null==e?Kr:"object"==typeof e?Oa(e)?xl(e[0],e[1]):Tl(e):Qr(e)}function Al(e){if(!so(e))return ln(e);var t=[];for(var n in ve(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dl(e,t){return e<t}function Cl(e,t){var n=-1,l=Pa(e)?h(e.length):[];return Qn(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Tl(e){var t=Xi(e);return 1==t.length&&t[0][2]?po(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function xl(e,t){return ao(e)&&co(t)?po(Do(e),t):function(n){var l=vr(n,e);return void 0===l&&l===t?fr(n,e):yl(t,l,3)}}function Nl(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Mn),ja(o))!function(e,t,n,l,i,o,a){var r=ho(e,n),u=ho(t,n),s=a.get(u);if(s)jn(e,n,s);else{var c=o?o(r,u,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=Oa(u),v=!p&&ka(u),f=!p&&!v&&Xa(u);c=u,p||v||f?Oa(r)?c=r:Ra(r)?c=mi(r):v?(d=!1,c=si(u,!0)):f?(d=!1,c=di(u,!0)):c=[]:Va(u)||Ia(u)?(c=r,Ia(r)?c=ir(r):ja(r)&&!Fa(r)||(c=no(u))):d=!1}d&&(a.set(u,c),i(c,u,l,o,a),a.delete(u)),jn(e,n,c)}}(e,t,a,n,Nl,l,i);else{var r=l?l(ho(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),jn(e,a,r)}},yr)}function wl(e,t){var n=e.length;if(n)return io(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Oa(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Kr];var l=-1;return t=st(t,xt(Yi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=pi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Ol(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=cl(e,a);n(r,a)&&Ul(o,oi(a,e),r)}return o}function Ll(e,t,n,l){var i=l?Et:gt,o=-1,a=t.length,r=e;for(e===t&&(t=mi(t)),n&&(r=st(e,xt(n)));++o<a;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(r,c,u,l))>-1;)r!==e&&Ge.call(r,u,1),Ge.call(e,u,1);return e}function Pl(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;io(i)?Ge.call(e,i,1):Zl(e,i)}}return e}function Rl(e,t){return e+Jt(sn()*(t-e+1))}function kl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Ml(e,t){return yo(vo(e,t,Kr),e+"")}function Bl(e){return Fn(xr(e))}function Fl(e,t){var n=xr(e);return bo(n,Yn(t,0,n.length))}function Ul(e,t,n,l){if(!ja(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=r[u];void 0===(s=l?l(c,u,r):void 0)&&(s=ja(c)?c:io(t[i+1])?[]:{})}Wn(r,u,s),r=r[u]}return e}var Hl=gn?function(e,t){return gn.set(e,t),e}:Kr,jl=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:Kr;function Wl(e){return bo(xr(e))}function zl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=h(i);++l<i;)o[l]=e[l+t];return o}function Kl(e,t){var n;return Qn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Vl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!$a(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return ql(e,t,Kr,n)}function ql(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=$a(t),s=void 0===t;i<o;){var c=Jt((i+o)/2),d=n(e[c]),p=void 0!==d,v=null===d,f=d==d,m=$a(d);if(a)var h=l||f;else h=s?f&&(l||p):r?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function Gl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!xa(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Yl(e){return"number"==typeof e?e:$a(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(Oa(e))return st(e,$l)+"";if($a(e))return Tn?Tn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var s=t?null:ki(e);if(s)return Ht(s);a=!1,i=wt,u=new kn}else u=t?[]:r;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),r.push(c)}else i(u,d,n)||(u!==r&&u.push(d),r.push(c))}return r}function Zl(e,t){return null==(e=fo(e,t=oi(t,e)))||delete e[Do(Bo(t))]}function Jl(e,t,n,l){return Ul(e,t,n(cl(e,t)),l)}function Ql(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?zl(e,l?0:o,l?o+1:i):zl(e,l?o+1:0,l?i:o)}function ei(e,t){var n=e;return n instanceof On&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Xl(e[0]):[];for(var i=-1,o=h(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Jn(o[i]||a,e[r],t,n));return Xl(il(o,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function li(e){return Ra(e)?e:[]}function ii(e){return"function"==typeof e?e:Kr}function oi(e,t){return Oa(e)?e:ao(e,t)?[e]:Ao(or(e))}var ai=Ml;function ri(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=Yt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=je?je(n):new e.constructor(n);return e.copy(l),l}function ci(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function di(e,t){var n=t?ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=$a(e),a=void 0!==t,r=null===t,u=t==t,s=$a(t);if(!r&&!s&&!o&&e>t||o&&a&&u&&!r&&!s||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function vi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,s=on(o-a,0),c=h(u+s),d=!l;++r<u;)c[r]=t[r];for(;++i<a;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[r++]=e[i++];return c}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,s=t.length,c=on(o-r,0),d=h(c+s),p=!l;++i<c;)d[i]=e[i];for(var v=i;++u<s;)d[v+u]=t[u];for(;++a<r;)(p||i<o)&&(d[v+n[a]]=e[i++]);return d}function mi(e,t){var n=-1,l=e.length;for(t||(t=h(l));++n<l;)t[n]=e[n];return t}function hi(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?qn(n,r,u):Wn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=Oa(n)?nt:Kn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function Ei(e){return Ml(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!Pa(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=ve(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=ve(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function _i(e){return function(t){var n=Mt(t=or(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ri(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Fr(Ir(t).replace(Ne,"")),e,"")}}function Ai(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Nn(e.prototype),l=e.apply(n,t);return ja(l)?l:n}}function Di(e){return function(t,n,l){var i=ve(t);if(!Pa(t)){var o=Yi(n,3);t=Er(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Ci(e){return Wi(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new he(n);if(o&&!r&&"wrapper"==qi(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=qi(a=t[i]),s="wrapper"==u?Vi(a):void 0;r=s&&ro(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?r[qi(s[0])].apply(r,s[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&Oa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ti(e,t,n,l,i,o,a,r,u,s){var c=128&t,d=1&t,p=2&t,v=24&t,f=512&t,m=p?void 0:Ai(e);return function g(){for(var E=arguments.length,y=h(E),S=E;S--;)y[S]=arguments[S];if(v)var _=Gi(g),b=Lt(y,_);if(l&&(y=vi(y,l,i,v)),o&&(y=fi(y,o,a,v)),E-=b,v&&E<s){var A=Ut(y,_);return Pi(e,t,Ti,g.placeholder,n,y,A,r,u,s-E)}var D=d?n:this,C=p?D[e]:e;return E=y.length,r?y=mo(y,r):f&&E>1&&y.reverse(),c&&u<E&&(y.length=u),this&&this!==ze&&this instanceof g&&(C=m||Ai(C)),C.apply(D,y)}}function xi(e,t){return function(n,l){return function(e,t,n,l){return rl(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ni(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=$l(n),l=$l(l)):(n=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function wi(e){return Wi(function(t){return t=st(t,xt(Yi())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":$l(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Zt(e/Wt(t)));return Mt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function Oi(e){return function(t,n,l){return l&&"number"!=typeof l&&oo(t,n,l)&&(n=l=void 0),t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n,l){for(var i=-1,o=on(Zt((t-e)/(n||1)),0),a=h(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:er(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=lr(t),n=lr(n)),e(t,n)}}function Pi(e,t,n,l,i,o,a,r,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?a:void 0,c?void 0:o,c?void 0:a,r,u,s],p=n.apply(void 0,d);return ro(e)&&go(p,d),p.placeholder=l,So(p,e,t)}function Ri(e){var t=pe[e];return function(e,n){if(e=lr(e),(n=null==n?0:an(tr(n),292))&&tn(e)){var l=(or(e)+"e").split("e");return+((l=(or(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:$r;function Mi(e){return function(t){var n=eo(t);return n==p?Bt(t):n==g?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,r,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=a=void 0),u=void 0===u?u:on(tr(u),0),s=void 0===s?s:tr(s),d-=a?a.length:0,64&t){var p=o,v=a;o=a=void 0}var f=c?void 0:Vi(e),m=[e,t,i,o,a,p,v,r,u,s];if(f&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(m,f),e=m[0],t=m[1],i=m[2],o=m[3],a=m[4],!(s=m[9]=void 0===m[9]?c?0:e.length:on(m[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=h(o),r=o,u=Gi(i);r--;)a[r]=arguments[r];var s=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=s.length)<n)return Pi(e,t,Ti,i.placeholder,void 0,a,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,a)}}(e,t,s):32!=t&&33!=t||a.length?Ti.apply(void 0,m):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,u=-1,s=l.length,c=h(s+r),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;r--;)c[u++]=arguments[++a];return tt(d,i?n:this,c)}}(e,t,i,o);else var g=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return So((f?Hl:go)(g,m),e,t)}function Fi(e,t,n,l){return void 0===e||xa(e,Ee[n])&&!_e.call(l,n)?t:e}function Ui(e,t,n,l,i,o){return ja(e)&&ja(t)&&(o.set(t,e),Nl(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Va(e)?void 0:e}function ji(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,v=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var f=e[d],m=t[d];if(l)var h=a?l(m,f,d,t,e,o):l(f,m,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!wt(v,t)&&(f===e||i(f,e,n,l,o)))return v.push(t)})){p=!1;break}}else if(f!==m&&!i(f,m,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function Wi(e){return yo(vo(e,void 0,Lo),e+"")}function zi(e){return dl(e,Er,Ji)}function Ki(e){return dl(e,yr,Qi)}var Vi=gn?function(e){return gn.get(e)}:$r;function qi(e){for(var t=e.name+"",n=En[t],l=_e.call(En,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Gi(e){return(_e.call(xn,"placeholder")?xn:e).placeholder}function Yi(){var e=xn.iteratee||Vr;return e=e===Vr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function $i(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 Xi(e){for(var t=Er(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,co(i)]}return t}function Zi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _l(n)?n:void 0}var Ji=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ve.call(e,t)}))}:nu,Qi=Qt?function(e){for(var t=[];e;)ct(t,Ji(e)),e=We(e);return t}:nu,eo=pl;function to(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,o=!1;++l<i;){var a=Do(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&Ha(i)&&io(a,i)&&(Oa(e)||Ia(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:Nn(We(e))}function lo(e){return Oa(e)||Ia(e)||!!(Ye&&e&&e[Ye])}function io(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,n){if(!ja(n))return!1;var l=typeof t;return!!("number"==l?Pa(n)&&io(t,n.length):"string"==l&&t in n)&&xa(n[t],e)}function ao(e,t){if(Oa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$a(e))||W.test(e)||!j.test(e)||null!=t&&e in ve(t)}function ro(e){var t=qi(e),n=xn[t];if("function"!=typeof n||!(t in On.prototype))return!1;if(e===n)return!0;var l=Vi(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=b||pn&&eo(new pn)!=p||vn&&"[object Promise]"!=eo(vn.resolve())||fn&&eo(new fn)!=g||mn&&eo(new mn)!=S)&&(eo=function(e){var t=pl(e),n=t==f?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case yn:return b;case Sn:return p;case _n:return"[object Promise]";case bn:return g;case An:return S}return t});var uo=ye?Fa:lu;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function co(e){return e==e&&!ja(e)}function po(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=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=on(l.length-t,0),a=h(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=h(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function mo(e,t){for(var n=e.length,l=an(t.length,n),i=mi(e);l--;){var o=t[l];e[l]=io(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=_o(Hl),Eo=Xt||function(e,t){return ze.setTimeout(e,t)},yo=_o(jl);function So(e,t,n){var l=t+"";return yo(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]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(l),n)))}function _o(e){var t=0,n=0;return function(){var l=rn(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Rl(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao=function(e){var t=_a(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===n.size&&n.clear(),e}),n=t.cache;return t}();function Do(e){if("string"==typeof e||$a(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Co(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function To(e){if(e instanceof On)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=mi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var xo=Ml(function(e,t){return Ra(e)?Jn(e,il(t,1,Ra,!0)):[]}),No=Ml(function(e,t){var n=Bo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),Yi(n,2)):[]}),wo=Ml(function(e,t){var n=Bo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),void 0,n):[]});function Io(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),ht(e,Yi(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=tr(n),i=n<0?on(l+i,0):an(i,l-1)),ht(e,Yi(t,3),i,!0)}function Lo(e){return null!=e&&e.length?il(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Ml(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),ko=Ml(function(e){var t=Bo(e),n=st(e,li);return t===Bo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Yi(t,2)):[]}),Mo=Ml(function(e){var t=Bo(e),n=st(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hl(n,void 0,t):[]});function Bo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fo=Ml(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var Ho=Wi(function(e,t){var n=null==e?0:e.length,l=Gn(e,t);return Pl(e,st(t,function(e){return io(e,n)?+e:e}).sort(pi)),l});function jo(e){return null==e?e:cn.call(e)}var Wo=Ml(function(e){return Xl(il(e,1,Ra,!0))}),zo=Ml(function(e){var t=Bo(e);return Ra(t)&&(t=void 0),Xl(il(e,1,Ra,!0),Yi(t,2))}),Ko=Ml(function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,Ra,!0),void 0,t)});function Vo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ra(e))return t=on(e.length,t),!0}),Ct(t,function(t){return st(e,_t(t))})}function qo(e,t){if(!e||!e.length)return[];var n=Vo(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Go=Ml(function(e,t){return Ra(e)?Jn(e,t):[]}),Yo=Ml(function(e){return ti(at(e,Ra))}),$o=Ml(function(e){var t=Bo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),Yi(t,2))}),Xo=Ml(function(e){var t=Bo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Zo=Ml(Vo),Jo=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,qo(e,n)});function Qo(e){var t=xn(e);return t.__chain__=!0,t}function ea(e,t){return t(e)}var ta=Wi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof On&&io(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),na=gi(function(e,t,n){_e.call(e,n)?++e[n]:qn(e,n,1)}),la=Di(Io),ia=Di(Oo);function oa(e,t){return(Oa(e)?lt:Qn)(e,Yi(t,3))}function aa(e,t){return(Oa(e)?it:el)(e,Yi(t,3))}var ra=gi(function(e,t,n){_e.call(e,n)?e[n].push(t):qn(e,n,[t])}),ua=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Pa(e)?h(e.length):[];return Qn(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),sa=gi(function(e,t,n){qn(e,n,t)});function ca(e,t){return(Oa(e)?st:Cl)(e,Yi(t,3))}var da=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Ml(function(e,t){if(null==e)return[];var n=t.length;return n>1&&oo(e,t[0],t[1])?t=[]:n>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),va=$t||function(){return ze.Date.now()};function fa(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 ma(e,t){var l;if("function"!=typeof t)throw new he(n);return e=tr(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ha=Ml(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Gi(ha));l|=32}return Bi(e,l,t,n,i)}),ga=Ml(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Gi(ga));l|=32}return Bi(t,l,e,n,i)});function Ea(e,t,l){var i,o,a,r,u,s,c=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new he(n);function f(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function m(e){return c=e,u=Eo(g,t),d?f(e):r}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=a}function g(){var e=va();if(h(e))return E(e);u=Eo(g,function(e){var n=t-(e-s);return p?an(n,a-(e-c)):n}(e))}function E(e){return u=void 0,v&&i?f(e):(i=o=void 0,r)}function y(){var e=va(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return m(s);if(p)return ui(u),u=Eo(g,t),f(s)}return void 0===u&&(u=Eo(g,t)),r}return t=lr(t)||0,ja(l)&&(d=!!l.leading,a=(p="maxWait"in l)?on(lr(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),y.cancel=function(){void 0!==u&&ui(u),c=0,i=s=o=u=void 0},y.flush=function(){return void 0===u?r:E(va())},y}var ya=Ml(function(e,t){return Zn(e,1,t)}),Sa=Ml(function(e,t,n){return Zn(e,lr(t)||0,n)});function _a(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 a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(_a.Cache||Rn),l}function ba(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)}}_a.Cache=Rn;var Aa=ai(function(e,t){var n=(t=1==t.length&&Oa(t[0])?st(t[0],xt(Yi())):st(il(t,1),xt(Yi()))).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)})}),Da=Ml(function(e,t){return Bi(e,32,void 0,t,Ut(t,Gi(Da)))}),Ca=Ml(function(e,t){return Bi(e,64,void 0,t,Ut(t,Gi(Ca)))}),Ta=Wi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function xa(e,t){return e===t||e!=e&&t!=t}var Na=Li(vl),wa=Li(function(e,t){return e>=t}),Ia=El(function(){return arguments}())?El:function(e){return Wa(e)&&_e.call(e,"callee")&&!Ve.call(e,"callee")},Oa=h.isArray,La=$e?xt($e):function(e){return Wa(e)&&pl(e)==_};function Pa(e){return null!=e&&Ha(e.length)&&!Fa(e)}function Ra(e){return Wa(e)&&Pa(e)}var ka=en||lu,Ma=Xe?xt(Xe):function(e){return Wa(e)&&pl(e)==u};function Ba(e){if(!Wa(e))return!1;var t=pl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Va(e)}function Fa(e){if(!ja(e))return!1;var t=pl(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ua(e){return"number"==typeof e&&e==tr(e)}function Ha(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wa(e){return null!=e&&"object"==typeof e}var za=Ze?xt(Ze):function(e){return Wa(e)&&eo(e)==p};function Ka(e){return"number"==typeof e||Wa(e)&&pl(e)==v}function Va(e){if(!Wa(e)||pl(e)!=f)return!1;var t=We(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var qa=Je?xt(Je):function(e){return Wa(e)&&pl(e)==m},Ga=Qe?xt(Qe):function(e){return Wa(e)&&eo(e)==g};function Ya(e){return"string"==typeof e||!Oa(e)&&Wa(e)&&pl(e)==E}function $a(e){return"symbol"==typeof e||Wa(e)&&pl(e)==y}var Xa=et?xt(et):function(e){return Wa(e)&&Ha(e.length)&&!!Me[pl(e)]},Za=Li(Dl),Ja=Li(function(e,t){return e<=t});function Qa(e){if(!e)return[];if(Pa(e))return Ya(e)?zt(e):mi(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=eo(e);return(t==p?Bt:t==g?Ht:xr)(e)}function er(e){return e?(e=lr(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function tr(e){var t=er(e),n=t%1;return t==t?n?t-n:t:0}function nr(e){return e?Yn(tr(e),0,4294967295):0}function lr(e){if("number"==typeof e)return e;if($a(e))return NaN;if(ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=le.test(e);return n||oe.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ir(e){return hi(e,yr(e))}function or(e){return null==e?"":$l(e)}var ar=Ei(function(e,t){if(so(t)||Pa(t))hi(t,Er(t),e);else for(var n in t)_e.call(t,n)&&Wn(e,n,t[n])}),rr=Ei(function(e,t){hi(t,yr(t),e)}),ur=Ei(function(e,t,n,l){hi(t,yr(t),e,l)}),sr=Ei(function(e,t,n,l){hi(t,Er(t),e,l)}),cr=Wi(Gn),dr=Ml(function(e,t){e=ve(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=yr(o),r=-1,u=a.length;++r<u;){var s=a[r],c=e[s];(void 0===c||xa(c,Ee[s])&&!_e.call(e,s))&&(e[s]=o[s])}return e}),pr=Ml(function(e){return e.push(void 0,Ui),tt(_r,void 0,e)});function vr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function fr(e,t){return null!=e&&to(e,t,ml)}var mr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},jr(Kr)),hr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Yi),gr=Ml(gl);function Er(e){return Pa(e)?Bn(e):Al(e)}function yr(e){return Pa(e)?Bn(e,!0):function(e){if(!ja(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&_e.call(e,l))&&n.push(l);return n}(e)}var Sr=Ei(function(e,t,n){Nl(e,t,n)}),_r=Ei(function(e,t,n,l){Nl(e,t,n,l)}),br=Wi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),hi(e,Ki(e),n),l&&(n=$n(n,7,Hi));for(var i=t.length;i--;)Zl(n,t[i]);return n}),Ar=Wi(function(e,t){return null==e?{}:function(e,t){return Ol(e,t,function(t,n){return fr(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st(Ki(e),function(e){return[e]});return t=Yi(t),Ol(e,n,function(e,n){return t(e,n[0])})}var Cr=Mi(Er),Tr=Mi(yr);function xr(e){return null==e?[]:Nt(e,Er(e))}var Nr=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return Br(or(e).toLowerCase())}function Ir(e){return(e=or(e))&&e.replace(re,Pt).replace(we,"")}var Or=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Lr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Pr=_i("toLowerCase"),Rr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,n){return e+(n?" ":"")+Br(t)}),Mr=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Br=_i("toUpperCase");function Fr(e,t,n){return e=or(e),void 0===(t=n?void 0:t)?function(e){return Pe.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ur=Ml(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ba(e)?e:new ce(e)}}),Hr=Wi(function(e,t){return lt(t,function(t){t=Do(t),qn(e,t,ha(e[t],e))}),e});function jr(e){return function(){return e}}var Wr=Ci(),zr=Ci(!0);function Kr(e){return e}function Vr(e){return bl("function"==typeof e?e:$n(e,1))}var qr=Ml(function(e,t){return function(n){return gl(n,e,t)}}),Gr=Ml(function(e,t){return function(n){return gl(e,n,t)}});function Yr(e,t,n){var l=Er(t),i=sl(t,l);null!=n||ja(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Er(t)));var o=!(ja(n)&&"chain"in n&&!n.chain),a=Fa(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=mi(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 $r(){}var Xr=wi(st),Zr=wi(ot),Jr=wi(vt);function Qr(e){return ao(e)?_t(Do(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=Oi(),tu=Oi(!0);function nu(){return[]}function lu(){return!1}var iu,ou=Ni(function(e,t){return e+t},0),au=Ri("ceil"),ru=Ni(function(e,t){return e/t},1),uu=Ri("floor"),su=Ni(function(e,t){return e*t},1),cu=Ri("round"),du=Ni(function(e,t){return e-t},0);return xn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=tr(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=fa,xn.assign=ar,xn.assignIn=rr,xn.assignInWith=ur,xn.assignWith=sr,xn.at=cr,xn.before=ma,xn.bind=ha,xn.bindAll=Hr,xn.bindKey=ga,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Oa(e)?e:[e]},xn.chain=Qo,xn.chunk=function(e,t,n){t=(n?oo(e,t,n):void 0===t)?1:on(tr(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=h(Zt(l/t));i<l;)a[o++]=zl(e,i,i+=t);return a},xn.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},xn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=h(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Oa(n)?mi(n):[n],il(t,1))},xn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new 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)}})},xn.conforms=function(e){return function(e){var t=Er(e);return function(n){return Xn(n,e,t)}}($n(e,1))},xn.constant=jr,xn.countBy=na,xn.create=function(e,t){var n=Nn(e);return null==t?n:Vn(n,t)},xn.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},xn.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},xn.debounce=Ea,xn.defaults=dr,xn.defaultsDeep=pr,xn.defer=ya,xn.delay=Sa,xn.difference=xo,xn.differenceBy=No,xn.differenceWith=wo,xn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:tr(t))<0?0:t,l):[]},xn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t):[]},xn.dropRightWhile=function(e,t){return e&&e.length?Ql(e,Yi(t,3),!0,!0):[]},xn.dropWhile=function(e,t){return e&&e.length?Ql(e,Yi(t,3),!0):[]},xn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&oo(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=tr(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:tr(l))<0&&(l+=i),l=n>l?0:nr(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},xn.filter=function(e,t){return(Oa(e)?at:ll)(e,Yi(t,3))},xn.flatMap=function(e,t){return il(ca(e,t),1)},xn.flatMapDeep=function(e,t){return il(ca(e,t),1/0)},xn.flatMapDepth=function(e,t,n){return n=void 0===n?1:tr(n),il(ca(e,t),n)},xn.flatten=Lo,xn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},xn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:tr(t)):[]},xn.flip=function(e){return Bi(e,512)},xn.flow=Wr,xn.flowRight=zr,xn.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},xn.functions=function(e){return null==e?[]:sl(e,Er(e))},xn.functionsIn=function(e){return null==e?[]:sl(e,yr(e))},xn.groupBy=ra,xn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},xn.intersection=Ro,xn.intersectionBy=ko,xn.intersectionWith=Mo,xn.invert=mr,xn.invertBy=hr,xn.invokeMap=ua,xn.iteratee=Vr,xn.keyBy=sa,xn.keys=Er,xn.keysIn=yr,xn.map=ca,xn.mapKeys=function(e,t){var n={};return t=Yi(t,3),rl(e,function(e,l,i){qn(n,t(e,l,i),e)}),n},xn.mapValues=function(e,t){var n={};return t=Yi(t,3),rl(e,function(e,l,i){qn(n,l,t(e,l,i))}),n},xn.matches=function(e){return Tl($n(e,1))},xn.matchesProperty=function(e,t){return xl(e,$n(t,1))},xn.memoize=_a,xn.merge=Sr,xn.mergeWith=_r,xn.method=qr,xn.methodOf=Gr,xn.mixin=Yr,xn.negate=ba,xn.nthArg=function(e){return e=tr(e),Ml(function(t){return wl(t,e)})},xn.omit=br,xn.omitBy=function(e,t){return Dr(e,ba(Yi(t)))},xn.once=function(e){return ma(2,e)},xn.orderBy=function(e,t,n,l){return null==e?[]:(Oa(t)||(t=null==t?[]:[t]),Oa(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},xn.over=Xr,xn.overArgs=Aa,xn.overEvery=Zr,xn.overSome=Jr,xn.partial=Da,xn.partialRight=Ca,xn.partition=da,xn.pick=Ar,xn.pickBy=Dr,xn.property=Qr,xn.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},xn.pull=Fo,xn.pullAll=Uo,xn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Yi(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},xn.pullAt=Ho,xn.range=eu,xn.rangeRight=tu,xn.rearg=Ta,xn.reject=function(e,t){return(Oa(e)?at:ll)(e,ba(Yi(t,3)))},xn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return Pl(e,i),n},xn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(e,t=void 0===t?t:tr(t))},xn.reverse=jo,xn.sampleSize=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),(Oa(e)?Un:Fl)(e,t)},xn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},xn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},xn.shuffle=function(e){return(Oa(e)?Hn:Wl)(e)},xn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&oo(e,t,n)?(t=0,n=l):(t=null==t?0:tr(t),n=void 0===n?l:tr(n)),zl(e,t,n)):[]},xn.sortBy=pa,xn.sortedUniq=function(e){return e&&e.length?Gl(e):[]},xn.sortedUniqBy=function(e,t){return e&&e.length?Gl(e,Yi(t,2)):[]},xn.split=function(e,t,n){return n&&"number"!=typeof n&&oo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=or(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=$l(t))&&Mt(e)?ri(zt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:on(tr(t),0),Ml(function(n){var l=n[t],i=ri(n,0,t);return l&&ct(i,l),tt(e,this,i)})},xn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:tr(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:tr(t)))<0?0:t,l):[]},xn.takeRightWhile=function(e,t){return e&&e.length?Ql(e,Yi(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?Ql(e,Yi(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new he(n);return ja(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},xn.thru=ea,xn.toArray=Qa,xn.toPairs=Cr,xn.toPairsIn=Tr,xn.toPath=function(e){return Oa(e)?st(e,Do):$a(e)?[e]:mi(Ao(or(e)))},xn.toPlainObject=ir,xn.transform=function(e,t,n){var l=Oa(e),i=l||ka(e)||Xa(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:ja(e)&&Fa(o)?Nn(We(e)):{}}return(i?lt:rl)(e,function(e,l,i){return t(n,e,l,i)}),n},xn.unary=function(e){return fa(e,1)},xn.union=Wo,xn.unionBy=zo,xn.unionWith=Ko,xn.uniq=function(e){return e&&e.length?Xl(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Xl(e,Yi(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Zl(e,t)},xn.unzip=Vo,xn.unzipWith=qo,xn.update=function(e,t,n){return null==e?e:Jl(e,t,ii(n))},xn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,ii(n),l)},xn.values=xr,xn.valuesIn=function(e){return null==e?[]:Nt(e,yr(e))},xn.without=Go,xn.words=Fr,xn.wrap=function(e,t){return Da(ii(t),e)},xn.xor=Yo,xn.xorBy=$o,xn.xorWith=Xo,xn.zip=Zo,xn.zipObject=function(e,t){return ni(e||[],t||[],Wn)},xn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},xn.zipWith=Jo,xn.entries=Cr,xn.entriesIn=Tr,xn.extend=rr,xn.extendWith=ur,Yr(xn,xn),xn.add=ou,xn.attempt=Ur,xn.camelCase=Nr,xn.capitalize=wr,xn.ceil=au,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=lr(n))==n?n:0),void 0!==t&&(t=(t=lr(t))==t?t:0),Yn(lr(e),t,n)},xn.clone=function(e){return $n(e,4)},xn.cloneDeep=function(e){return $n(e,5)},xn.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Xn(e,t,Er(t))},xn.deburr=Ir,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=ru,xn.endsWith=function(e,t,n){e=or(e),t=$l(t);var l=e.length,i=n=void 0===n?l:Yn(tr(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},xn.eq=xa,xn.escape=function(e){return(e=or(e))&&B.test(e)?e.replace(k,Rt):e},xn.escapeRegExp=function(e){return(e=or(e))&&V.test(e)?e.replace(K,"\\$&"):e},xn.every=function(e,t,n){var l=Oa(e)?ot:tl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},xn.find=la,xn.findIndex=Io,xn.findKey=function(e,t){return mt(e,Yi(t,3),rl)},xn.findLast=ia,xn.findLastIndex=Oo,xn.findLastKey=function(e,t){return mt(e,Yi(t,3),ul)},xn.floor=uu,xn.forEach=oa,xn.forEachRight=aa,xn.forIn=function(e,t){return null==e?e:ol(e,Yi(t,3),yr)},xn.forInRight=function(e,t){return null==e?e:al(e,Yi(t,3),yr)},xn.forOwn=function(e,t){return e&&rl(e,Yi(t,3))},xn.forOwnRight=function(e,t){return e&&ul(e,Yi(t,3))},xn.get=vr,xn.gt=Na,xn.gte=wa,xn.has=function(e,t){return null!=e&&to(e,t,fl)},xn.hasIn=fr,xn.head=Po,xn.identity=Kr,xn.includes=function(e,t,n,l){e=Pa(e)?e:xr(e),n=n&&!l?tr(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Ya(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&gt(e,t,n)>-1},xn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:tr(n);return i<0&&(i=on(l+i,0)),gt(e,t,i)},xn.inRange=function(e,t,n){return t=er(t),void 0===n?(n=t,t=0):n=er(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=lr(e),t,n)},xn.invoke=gr,xn.isArguments=Ia,xn.isArray=Oa,xn.isArrayBuffer=La,xn.isArrayLike=Pa,xn.isArrayLikeObject=Ra,xn.isBoolean=function(e){return!0===e||!1===e||Wa(e)&&pl(e)==r},xn.isBuffer=ka,xn.isDate=Ma,xn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Va(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(Oa(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Xa(e)||Ia(e)))return!e.length;var t=eo(e);if(t==p||t==g)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},xn.isEqual=function(e,t){return yl(e,t)},xn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?yl(e,t,void 0,n):!!l},xn.isError=Ba,xn.isFinite=function(e){return"number"==typeof e&&tn(e)},xn.isFunction=Fa,xn.isInteger=Ua,xn.isLength=Ha,xn.isMap=za,xn.isMatch=function(e,t){return e===t||Sl(e,t,Xi(t))},xn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Xi(t),n)},xn.isNaN=function(e){return Ka(e)&&e!=+e},xn.isNative=function(e){if(uo(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _l(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Ka,xn.isObject=ja,xn.isObjectLike=Wa,xn.isPlainObject=Va,xn.isRegExp=qa,xn.isSafeInteger=function(e){return Ua(e)&&e>=-9007199254740991&&e<=9007199254740991},xn.isSet=Ga,xn.isString=Ya,xn.isSymbol=$a,xn.isTypedArray=Xa,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Wa(e)&&eo(e)==S},xn.isWeakSet=function(e){return Wa(e)&&"[object WeakSet]"==pl(e)},xn.join=function(e,t){return null==e?"":nn.call(e,t)},xn.kebabCase=Or,xn.last=Bo,xn.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=tr(n))<0?on(l+i,0):an(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):ht(e,yt,i,!0)},xn.lowerCase=Lr,xn.lowerFirst=Pr,xn.lt=Za,xn.lte=Ja,xn.max=function(e){return e&&e.length?nl(e,Kr,vl):void 0},xn.maxBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),vl):void 0},xn.mean=function(e){return St(e,Kr)},xn.meanBy=function(e,t){return St(e,Yi(t,2))},xn.min=function(e){return e&&e.length?nl(e,Kr,Dl):void 0},xn.minBy=function(e,t){return e&&e.length?nl(e,Yi(t,2),Dl):void 0},xn.stubArray=nu,xn.stubFalse=lu,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=su,xn.nth=function(e,t){return e&&e.length?wl(e,tr(t)):void 0},xn.noConflict=function(){return ze._===this&&(ze._=Te),this},xn.noop=$r,xn.now=va,xn.pad=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Jt(i),n)+e+Ii(Zt(i),n)},xn.padEnd=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;return t&&l<t?e+Ii(t-l,n):e},xn.padStart=function(e,t,n){e=or(e);var l=(t=tr(t))?Wt(e):0;return t&&l<t?Ii(t-l,n)+e:e},xn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(or(e).replace(q,""),t||0)},xn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&oo(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=er(e),void 0===t?(t=e,e=0):t=er(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Rl(e,t)},xn.reduce=function(e,t,n){var l=Oa(e)?dt:At,i=arguments.length<3;return l(e,Yi(t,4),n,i,Qn)},xn.reduceRight=function(e,t,n){var l=Oa(e)?pt:At,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},xn.repeat=function(e,t,n){return t=(n?oo(e,t,n):void 0===t)?1:tr(t),kl(or(e),t)},xn.replace=function(){var e=arguments,t=or(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[Do(t[l])];void 0===o&&(l=i,o=n),e=Fa(o)?o.call(e):o}return e},xn.round=cu,xn.runInContext=e,xn.sample=function(e){return(Oa(e)?Fn:Bl)(e)},xn.size=function(e){if(null==e)return 0;if(Pa(e))return Ya(e)?Wt(e):e.length;var t=eo(e);return t==p||t==g?e.size:Al(e).length},xn.snakeCase=Rr,xn.some=function(e,t,n){var l=Oa(e)?vt:Kl;return n&&oo(e,t,n)&&(t=void 0),l(e,Yi(t,3))},xn.sortedIndex=function(e,t){return Vl(e,t)},xn.sortedIndexBy=function(e,t,n){return ql(e,t,Yi(n,2))},xn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Vl(e,t);if(l<n&&xa(e[l],t))return l}return-1},xn.sortedLastIndex=function(e,t){return Vl(e,t,!0)},xn.sortedLastIndexBy=function(e,t,n){return ql(e,t,Yi(n,2),!0)},xn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Vl(e,t,!0)-1;if(xa(e[n],t))return n}return-1},xn.startCase=kr,xn.startsWith=function(e,t,n){return e=or(e),n=null==n?0:Yn(tr(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},xn.subtract=du,xn.sum=function(e){return e&&e.length?Dt(e,Kr):0},xn.sumBy=function(e,t){return e&&e.length?Dt(e,Yi(t,2)):0},xn.template=function(e,t,n){var l=xn.templateSettings;n&&oo(e,t,n)&&(t=void 0),e=or(e),t=ur({},t,l,Fi);var i,o,a=ur({},t.imports,l.imports,Fi),r=Er(a),u=Nt(a,r),s=0,c=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(s,u).replace(se,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var f=_e.call(t,"variable")&&t.variable;if(f){if(J.test(f))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(O,""):d).replace(L,"$1").replace(P,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"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 m=Ur(function(){return de(r,v+"return "+d).apply(void 0,u)});if(m.source=d,Ba(m))throw m;return m},xn.times=function(e,t){if((e=tr(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Yi(t));++n<e;)t(n);return i},xn.toFinite=er,xn.toInteger=tr,xn.toLength=nr,xn.toLower=function(e){return or(e).toLowerCase()},xn.toNumber=lr,xn.toSafeInteger=function(e){return e?Yn(tr(e),-9007199254740991,9007199254740991):0===e?e:0},xn.toString=or,xn.toUpper=function(e){return or(e).toUpperCase()},xn.trim=function(e,t,n){if((e=or(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=$l(t)))return e;var l=zt(e),i=zt(t);return ri(l,It(l,i),Ot(l,i)+1).join("")},xn.trimEnd=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.slice(0,Kt(e)+1);if(!e||!(t=$l(t)))return e;var l=zt(e);return ri(l,0,Ot(l,zt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.replace(q,"");if(!e||!(t=$l(t)))return e;var l=zt(e);return ri(l,It(l,zt(t))).join("")},xn.truncate=function(e,t){var n=30,l="...";if(ja(t)){var i="separator"in t?t.separator:i;n="length"in t?tr(t.length):n,l="omission"in t?$l(t.omission):l}var o=(e=or(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=fe(i.source,or(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf($l(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},xn.unescape=function(e){return(e=or(e))&&M.test(e)?e.replace(R,Vt):e},xn.uniqueId=function(e){var t=++be;return or(e)+t},xn.upperCase=Mr,xn.upperFirst=Br,xn.each=oa,xn.eachRight=aa,xn.first=Po,Yr(xn,(iu={},rl(xn,function(e,t){_e.call(xn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),xn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){xn[e].placeholder=xn}),lt(["drop","take"],function(e,t){On.prototype[e]=function(n){n=void 0===n?1:on(tr(n),0);var l=this.__filtered__&&!t?new On(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},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}}),On.prototype.compact=function(){return this.filter(Kr)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new On(this):this.map(function(n){return gl(n,e,t)})}),On.prototype.reject=function(e){return this.filter(ba(Yi(e)))},On.prototype.slice=function(e,t){e=tr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=tr(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},rl(On.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=xn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(xn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof On,u=a[0],s=r||Oa(t),c=function(e){var t=i.apply(xn,ct([e],a));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(r=s=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,f=r&&!p;if(!o&&s){t=f?t:new On(this);var m=e.apply(t,a);return m.__actions__.push({func:ea,args:[c],thisArg:void 0}),new In(m,d)}return v&&f?e.apply(this,a):(m=this.thru(c),v?l?m.value()[0]:m.value():m)})}),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);xn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Oa(i)?i:[],e)}return this[n](function(n){return t.apply(Oa(n)?n:[],e)})}}),rl(On.prototype,function(e,t){var n=xn[t];if(n){var l=n.name+"";_e.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Oa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=an(t,e+a);break;case"takeRight":e=on(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,s=l?r:a-1,c=this.__iteratees__,d=c.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ei(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,h=e[s+=t];++m<d;){var g=c[m],E=g.type,y=(0,g.iteratee)(h);if(2==E)h=y;else if(!y){if(1==E)continue e;break e}}f[p++]=h}return f},xn.prototype.at=ta,xn.prototype.chain=function(){return Qo(this)},xn.prototype.commit=function(){return new In(this.value(),this.__chain__)},xn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Qa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof wn;){var l=To(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},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:ea,args:[jo],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(jo)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,ft&&(xn.prototype[ft]=function(){return this}),xn}();Ve?((Ve.exports=qt)._=qt,Ke._=qt):ze._=qt}).call(h)});const Ye=["tenantId","payments"],$e=["tenantId","payments"],Xe=e=>l.createElement("h1",{className:"heading-m"},e.label),Ze=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ze,null)),Qe=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m,isLoading:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:E}=Digit.Hooks.pt.useMDMS(s,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[y,S]=n.useState({}),[_,b]=n.useState({}),[A,D]=n.useState([]),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=n.useState(null),[O,L]=n.useState(null),[R,k]=n.useState([]),[M,B]=n.useState(null),[F,U]=n.useState(!1);function H(e){N(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&k(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.useEffect(()=>{var e;D(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{L(null);const e=function(){if(x){const e=function(){if(x.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",x,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):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[x]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:M,setSelectedFinancialYear:B}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:v}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload: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:a,action:r,approvers:A,selectedApprover:C,setSelectedApprover:T,selectFile:H,uploadedFile:w,setUploadedFile:I,businessService:v}))},[r,A,R,M,w]),r&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:a(y.label.heading)}),headerBarEnd:l.createElement(Je,{onClick:c}),actionCancelLabel:a(y.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(y.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!M:h||(null==r?void 0:r.docUploadRequired)&&!w,formId:"modal-action"},g?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==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};p.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},p,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==p?void 0:p.propertyId,tenantId:s,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};t.assignes=null!=r&&r.isTerminateState||!C?[]:[C],w&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]),d({Property:u({},p,{workflow:t})})}},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},et=e=>l.createElement("h1",{className:"heading-m"},e.label),tt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),nt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tt,null)),lt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:m,data:h}=Digit.Hooks.pt.useMDMS(s,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,E]=n.useState({}),[y,S]=n.useState({}),[_,b]=n.useState([]),[A,D]=n.useState({}),[C,T]=n.useState(null),[x,N]=n.useState(null),[w,I]=n.useState(null),[O,L]=n.useState([]),[R,k]=n.useState(null);n.useEffect(()=>{var e;h&&h["egf-master"]&&L(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]);const{data:M}=Digit.Hooks.useCustomMDMS(s,"common-masters",[{name:"Department"}]);function B(e){T(e.target.files[0])}return n.useEffect(()=>{if(f&&M){var e;const t=M["common-masters"].Department;b(null==f||null===(e=f.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,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&E((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,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:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:_,selectedApprover:A,setSelectedApprover:D,selectFile:B,uploadedFile:x,setUploadedFile:N,businessService:v}))},[r,_,O,R,x]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(et,{label:a(g.label.heading)}),headerBarEnd:l.createElement(nt,{onClick:c}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:x?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:x}]:null}),d({Licenses:[p]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},it=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ot=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),at=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ot,null)),rt=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState({}),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function O(e){C(e.target.files[0])}return n.useEffect(()=>{var e;_(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(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",D,Digit.ULBService.getStateId()||(null==s?void 0:s.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:O,uploadedFile:T,setUploadedFile:x,businessService:v,error:N}))},[r,S,T,N]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(it,{label:a(h.label.heading)}),headerBarEnd:l.createElement(at,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.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"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},ut=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),st=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),dt=e=>{var i,o,r,s,c,d,p,v,f,m,h,g;let{t:E,action:y,tenantId:S,closeModal:_,submitAction:b,applicationDetails:A,applicationData:D,businessService:C,workflowDetails:T,blockReason:x}=e;console.log("applicationData",D),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(i=D)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(s=D)||void 0===s||null===(c=s.landInfo)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city:S,!1);const{data:N,isLoading:w}=Digit.Hooks.useEmployeeSearch(S,{roles:null==T||null===(p=T.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(f=v.nextActions)||void 0===f||null===(m=f.filter(e=>(null==e?void 0:e.action)==(null==y?void 0:y.action)))||void 0===m||null===(h=m[0])||void 0===h||null===(g=h.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=y&&y.isTerminateState)}),[I,O]=(a.useQueryClient(),n.useState({})),[L,R]=n.useState({}),[k,M]=n.useState([]),[B,F]=n.useState([]),[U,H]=n.useState({}),[j,W]=n.useState({}),[z,K]=n.useState(null),[V,q]=n.useState(null),[G,Y]=n.useState(null),[$,X]=n.useState(null),Z=!!Digit.Utils.browser.isMobile();function J(e){K(e.target.files[0])}n.useEffect(()=>{var e;M(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),n.useEffect(()=>{!function(){try{Y(null);const e=function(){if(z){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(z.size>=5242880)Y(E("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=z&&z.type&&!e.test(null==z?void 0:z.type))Y(E("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",z,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?q(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):Y(E("CS_FILE_UPLOAD_ERROR"))})},function(){Y(E("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[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,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),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===(a=l)||void 0===a?void 0:a.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,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},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(()=>{F(null==x?void 0:x.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),y&&O((e=>{var n,i,o,a,r,u,s;let{t:c,action:d,approvers:p,selectedApprover:v,setSelectedApprover:f,selectedBlockReason:m,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:y,assigneeLabel:S,businessService:_,error:b,blockReasonFiltered:A}=e,D=!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)||(D=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+_+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||D||"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(S||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||D||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:f,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:m,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:g,onDelete:()=>{y(null)},message:E?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:E,action:y,approvers:k,selectedApprover:U,setSelectedApprover:H,selectedBlockReason:j,setBlockReason:W,selectFile:J,uploadedFile:V,setUploadedFile:q,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:B}))},[y,k,$,V,G]),y&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ut,{label:E(I.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:_}),actionCancelLabel:E(I.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:E(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Z?{width:"720px"}:{},style:Z?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Z?{paddingLeft:"5px"}:{}},w?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a,r,s,c,d,p,v,f,m,h,g,C,x,N,w,I,O,L,P,R,k,M;D=u({},D,{documents:ne(),additionalDetails:u({},null===(t=D)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:te(D),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==T||null===(i=T.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==T||null===(s=T.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.assigner)||void 0===p?void 0:p.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(v=T.data)||void 0===v||null===(f=v.processInstances)||void 0===f||null===(m=f[0])||void 0===m||null===(h=m.state)||void 0===h?void 0:h.applicationStatus)?[null==T||null===(g=T.data)||void 0===g||null===(C=g.processInstances)||void 0===C||null===(x=C[0])||void 0===x||null===(N=x.assigner)||void 0===N?void 0:N.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:V?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:V}]:null},action:null==y?void 0:y.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(w=T.data)||void 0===w||null===(I=w.processInstances)||void 0===I||null===(O=I[0])||void 0===O||null===(L=O.state)||void 0===L?void 0:L.applicationStatus)?[null==T||null===(P=T.data)||void 0===P||null===(R=P.processInstances)||void 0===R||null===(k=R[0])||void 0===k||null===(M=k.assigner)||void 0===M?void 0:M.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:V?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:V}]:null});const B=function(e,t,n,l,i,o,a,r,s,c,d,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=D)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=D)||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===(a=D)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null===(c=D)||void 0===c||null===(d=c.additionalDetails)||void 0===d||null===(p=d.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS))){var v,f,m;D.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",D.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",D.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",D.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),D.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==A||null===(v=A.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(f=e[0])||void 0===f||null===(m=f.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,a,r;"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===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=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,a,r,u,s,c,d,p,v,f,m;("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===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l||"FIRE_NOC"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==D.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:D},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(_(),alert(E("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:D},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}_(),alert(E("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},pt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),vt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ft=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vt,null)),mt=e=>{var i,r;let{t:s,action:c,tenantId:d,closeModal:p,submitAction:v,applicationData:f,businessService:m}=e;const{data:h,isLoading:g}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[E,y]=(a.useQueryClient(),n.useState({})),[S,_]=n.useState({}),[b,A]=n.useState([]),[D,C]=n.useState({}),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,O]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function R(e){x(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;A(null==h||null===(e=h.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[h]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)O(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))O(s("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(s("CS_FILE_UPLOAD_ERROR"))})},function(){O(s("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{c&&y((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(m=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:m,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload: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:f})}]}]}})({t:s,action:c,approvers:b,selectedApprover:D,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:w,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[c,b,N,I]),c&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(pt,{label:s(E.label.heading)}),headerBarEnd:l.createElement(ft,{onClick:p}),actionCancelLabel:s(E.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:s(E.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"}:{}},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=f)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=f)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),f=u({},f,{workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,documents:N?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:null},documents:o}),v({Noc:f},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)};function ht(e){var t=this.__data__=new Le(e);this.size=t.size}ht.prototype.clear=function(){this.__data__=new Le,this.size=0},ht.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ht.prototype.get=function(e){return this.__data__.get(e)},ht.prototype.has=function(e){return this.__data__.has(e)},ht.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Le){var l=n.__data__;if(!Pe||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Me(l)}return n.set(e,t),this.size=n.size,this};var gt=ht,Et=function(){try{var e=be(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),yt=function(e,t,n){"__proto__"==t&&Et?Et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},St=Object.prototype.hasOwnProperty,_t=function(e,t,n){var l=e[t];St.call(e,t)&&Ne(l,n)&&(void 0!==n||t in e)||yt(e,t,n)},bt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?yt(n,r,u):_t(n,r,u)}return n},At=function(e){return ce(e)&&"[object Arguments]"==se(e)},Dt=Object.prototype,Ct=Dt.hasOwnProperty,Tt=Dt.propertyIsEnumerable,xt=At(function(){return arguments}())?At:function(e){return ce(e)&&Ct.call(e,"callee")&&!Tt.call(e,"callee")},Nt=function(){return!1},wt=g(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?te.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Nt}),It=/^(?:0|[1-9]\d*)$/,Ot=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&It.test(e))&&e>-1&&e%1==0&&e<t},Lt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Pt={};Pt["[object Float32Array]"]=Pt["[object Float64Array]"]=Pt["[object Int8Array]"]=Pt["[object Int16Array]"]=Pt["[object Int32Array]"]=Pt["[object Uint8Array]"]=Pt["[object Uint8ClampedArray]"]=Pt["[object Uint16Array]"]=Pt["[object Uint32Array]"]=!0,Pt["[object Arguments]"]=Pt["[object Array]"]=Pt["[object ArrayBuffer]"]=Pt["[object Boolean]"]=Pt["[object DataView]"]=Pt["[object Date]"]=Pt["[object Error]"]=Pt["[object Function]"]=Pt["[object Map]"]=Pt["[object Number]"]=Pt["[object Object]"]=Pt["[object RegExp]"]=Pt["[object Set]"]=Pt["[object String]"]=Pt["[object WeakMap]"]=!1;var Rt=function(e){return function(t){return e(t)}},kt=g(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&Q.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Mt=kt&&kt.isTypedArray,Bt=Mt?Rt(Mt):function(e){return ce(e)&&Lt(e.length)&&!!Pt[se(e)]},Ft=Object.prototype.hasOwnProperty,Ut=function(e,t){var n=J(e),l=!n&&xt(e),i=!n&&!l&&wt(e),o=!n&&!l&&!i&&Bt(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var s in e)!t&&!Ft.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ot(s,u))||r.push(s);return r},Ht=Object.prototype,jt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ht)},Wt=function(e,t){return function(n){return e(t(n))}},zt=Wt(Object.keys,Object),Kt=Object.prototype.hasOwnProperty,Vt=function(e){return null!=e&&Lt(e.length)&&!me(e)},qt=function(e){return Vt(e)?Ut(e):function(e){if(!jt(e))return zt(e);var t=[];for(var n in Object(e))Kt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Gt=Object.prototype.hasOwnProperty,Yt=function(e){return Vt(e)?Ut(e,!0):function(e){if(!fe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=jt(e),n=[];for(var l in e)("constructor"!=l||!t&&Gt.call(e,l))&&n.push(l);return n}(e)},$t=g(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?te.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),Xt=function(){return[]},Zt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];Zt.call(e,r)&&(a[o++]=r)}return a}(Jt(e)))}:Xt,en=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},tn=Wt(Object.getPrototypeOf,Object),nn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)en(t,Qt(e)),e=tn(e);return t}:Xt,ln=function(e,t,n){var l=t(e);return J(e)?l:en(l,n(e))},on=function(e){return ln(e,qt,Qt)},an=function(e){return ln(e,Yt,nn)},rn=be(te,"DataView"),un=be(te,"Promise"),sn=be(te,"Set"),cn=be(te,"WeakMap"),dn=ye(rn),pn=ye(Pe),vn=ye(un),fn=ye(sn),mn=ye(cn),hn=se;(rn&&"[object DataView]"!=hn(new rn(new ArrayBuffer(1)))||Pe&&"[object Map]"!=hn(new Pe)||un&&"[object Promise]"!=hn(un.resolve())||sn&&"[object Set]"!=hn(new sn)||cn&&"[object WeakMap]"!=hn(new cn))&&(hn=function(e){var t=se(e),n="[object Object]"==t?e.constructor:void 0,l=n?ye(n):"";if(l)switch(l){case dn:return"[object DataView]";case pn:return"[object Map]";case vn:return"[object Promise]";case fn:return"[object Set]";case mn:return"[object WeakMap]"}return t});var gn=hn,En=Object.prototype.hasOwnProperty,yn=te.Uint8Array,Sn=function(e){var t=new e.constructor(e.byteLength);return new yn(t).set(new yn(e)),t},_n=/\w*$/,bn=ne?ne.prototype:void 0,An=bn?bn.valueOf:void 0,Dn=Object.create,Cn=function(){function e(){}return function(t){if(!fe(t))return{};if(Dn)return Dn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Tn=kt&&kt.isMap,xn=Tn?Rt(Tn):function(e){return ce(e)&&"[object Map]"==gn(e)},Nn=kt&&kt.isSet,wn=Nn?Rt(Nn):function(e){return ce(e)&&"[object Set]"==gn(e)},In={};In["[object Arguments]"]=In["[object Array]"]=In["[object ArrayBuffer]"]=In["[object DataView]"]=In["[object Boolean]"]=In["[object Date]"]=In["[object Float32Array]"]=In["[object Float64Array]"]=In["[object Int8Array]"]=In["[object Int16Array]"]=In["[object Int32Array]"]=In["[object Map]"]=In["[object Number]"]=In["[object Object]"]=In["[object RegExp]"]=In["[object Set]"]=In["[object String]"]=In["[object Symbol]"]=In["[object Uint8Array]"]=In["[object Uint8ClampedArray]"]=In["[object Uint16Array]"]=In["[object Uint32Array]"]=!0,In["[object Error]"]=In["[object Function]"]=In["[object WeakMap]"]=!1;var On=function e(t,n,l,i,o,a){var r,u=1&n,s=2&n,c=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!fe(t))return t;var d=J(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&En.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var p=gn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(wt(t))return $t(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=s||v?{}:function(e){return"function"!=typeof e.constructor||jt(e)?{}:Cn(tn(e))}(t),!u)return s?function(e,t){return bt(e,nn(e),t)}(t,function(e,t){return e&&bt(t,Yt(t),e)}(r,t)):function(e,t){return bt(e,Qt(e),t)}(t,function(e,t){return e&&bt(t,qt(t),e)}(r,t))}else{if(!In[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Sn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Sn(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?Sn(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,_n.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return An?Object(An.call(e)):{}}}(t,p,u)}}a||(a=new gt);var f=a.get(t);if(f)return f;a.set(t,r),wn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):xn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var m=d?void 0:(c?s?an:on:s?Yt:qt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(m||t,function(i,o){m&&(i=t[o=i]),_t(r,o,e(i,n,l,o,t,a))}),r},Ln=function(e){return On(e,5)};const Pn=e=>l.createElement("h1",{className:"heading-m"},e.label),Rn=()=>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(Rn,null)),Mn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Bn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState({}),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function L(e){C(e.target.files[0])}return n.useEffect(()=>{var e;_(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(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",D,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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=p)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:p,businessService:v,error:f}=e,m=!0,h=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:r}):null},h&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:f,iserror:f,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:x,businessService:v,error:N})):r&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:p,error:v}=e,f=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!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:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:x,businessService:v,error:N}))},[r,S,T,N]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pn,{label:a(h.label.heading)}),headerBarEnd:l.createElement(kn,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&O?{width:"100%",height:"auto"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,c,v,f,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var h,g,E,y,S,_,A,C,x;const t=u({},null===(h=p)||void 0===h||null===(g=h.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(E=p)||void 0===E?void 0:E.billAmendmentDetails,{workflow:{businessId:null===(y=p)||void 0===y||null===(S=y.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:s,businessService:null!==(_=p)&&void 0!==_&&null!==(A=_.applicationType)&&void 0!==A&&A.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=p)&&void 0!==C&&null!==(x=C.applicationType)&&void 0!==x&&x.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:[]}});d({AmendmentUpdate:n})}else{if(p=u({},p,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null,processInstance:u({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:[]})}),null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=Ln(null==e?void 0:e.date);p.disconnectionExecutionDate=Mn(t)}else if(null!=e&&e.date){const t=Ln(null==e?void 0:e.date);p.connectionExecutionDate=Mn(t)}var N;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(c=p)||void 0===c||null===(v=c.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(N=p)||void 0===N?void 0:N.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(f=p)||void 0===f?void 0:f.applicationType))d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var w,I,O,L,P,R,k,M,B,F,U,H,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyComment)||""),null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.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:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Fn=e=>l.createElement("h1",{className:"heading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),jn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;console.log("applicationData",p);const{data:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState(null),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,O]=n.useState(!1);function L(e){C(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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",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(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((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:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:x,businessService:v}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Fn,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};p.creationReason="CREATE",d({PetRegistrationApplications:[u({},p,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:f};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Wn=e=>l.createElement("h1",{className:"heading-m"},e.label),zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(zn,null)),Vn=e=>{var i,o,a;let{t:r,action:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const f=Digit.ULBService.getStateId(),{data:m,isLoading:h}=Digit.Hooks.tl.useTradeLicenseMDMS(f,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(i=m.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",p);const[g,E]=n.useState({}),[y,S]=n.useState({}),[_,b]=n.useState([]),[A,D]=n.useState(""),[C,T]=n.useState([]),[x,N]=n.useState(null),w=null===(o=p)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",w);const I=n.useMemo(()=>{var e;if(h||!m||!w.length)return[];const t=new Set(w.map(e=>e.tradeType)),n=(null===(e=m.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[h,m,w]);return console.log("years",I),n.useEffect(()=>{s&&E((e=>{let{t:n,action:i,years:o,selectedApprover:a,setSelectedApprover:r,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:r,selected:a})}]}]}})({t:r,action:s,years:I,selectedApprover:A,setSelectedApprover:D,businessService:v}))},[s,I,C,x]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:c}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=p)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);p=u({},p,{financialYear:i,action:"INITIATE",additionalDetail:u({},p.additionalDetail,{validityYears:A.length>0?parseInt(A):""})}),d({Licenses:[p]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Gn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Yn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null)),$n=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState(null),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,O]=n.useState(!1);function L(e){O(!0),C(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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=R(function(){return P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",D,s)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(O(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),console.log("actyhdesh,jhfsefsef",r,p),n.useEffect(()=>{g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,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:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:x,businessService:v,isUploading:I}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qn,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Yn,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:f,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};T&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Xn=e=>l.createElement("h1",{className:"heading-m"},e.label),Zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zn,null)),Qn=e=>{var i,o;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v,moduleCode:f}=e;console.log("applicationData",p);const{data:m}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,_]=n.useState([]),[b,A]=n.useState(null),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,O]=n.useState(!1);function L(e){C(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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",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(a("CS_FILE_UPLOAD_ERROR"))})},function(){w(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{r&&g((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:T,setUploadedFile:x,businessService:v}))},[r,S,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xn,{label:a(h.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:c}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:f};T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,filestoreId:T}]),d({hallsBookingApplication:[u({},p,{workflow:t})]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>l.createElement("h1",{className:"heading-m"},e.label),tl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tl,null)),ll=e=>{var i,a,r;let{t:s,action:c,tenantId:d,closeModal:p,submitAction:v,applicationData:f,businessService:m,moduleCode:h}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),E=o.useHistory(),[y,S]=n.useState({}),[_,b]=n.useState({}),[A,D]=n.useState([]),[C,T]=n.useState(null),[x,N]=n.useState(null);return n.useEffect(()=>{var e;D(null==g||null===(e=g.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}}))},[g]),n.useEffect(()=>{"INITIATED"===(null==c?void 0:c.state)?E.push("/digit-ui/employee/asset/assetservice/edit/"+(null==f?void 0:f.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:s,action:c,approvers:A,selectedApprover:C,setSelectedApprover:T,uploadedFile:x,setUploadedFile:N,businessService:m}))},[c,A,x]),c&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(el,{label:s(y.label.heading)}),headerBarEnd:l.createElement(nl,{onClick:p}),actionCancelLabel:s(y.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:s(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:y.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==c?void 0:c.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:h};x&&(t.documents=[]),v({Asset:u({},f,{workflow:t})})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},il=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Qe,e):null!=e&&e.businessService.includes("ptr")?l.createElement(jn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(lt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Vn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(rt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(dt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(mt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Bn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement($n,e):null!=e&&e.businessService.includes("chb")?l.createElement(Qn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ll,e):void 0;function ol(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!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)),a?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"}}),a?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(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 al=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:s}=e;const c=(null==r?void 0:r.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,f]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[m,h]=n.useState(null),[g,E]=n.useState([]),[y,S]=n.useState(!0),[_,b]=n.useState(!1),[A,D]=n.useState(!1),{isLoading:C,data:T}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:x,data:N}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let 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==N||null===(t=N["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)),E(s)},[!C,!x]),n.useEffect(()=>{let e=0;g.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,_]),n.useEffect(()=>{D("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[r,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(rl,{key:t,index:t,document:e,t:o,error:m,setError:h,setDocuments:f,documents:v,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function rl(e){var i,o;let{t:a,document:r,setDocuments:s,documents:c,index:d,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const f=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],m=Digit.ULBService.getStateId(),[h,g]=n.useState(f?u({},f,{active:!0,code:null==f?void 0:f.documentType,i18nKey: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]:{}),[E,y]=n.useState(null),[S,_]=n.useState(()=>(null==f?void 0:f.fileStoreId)||null),[b,A]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&s(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==h?void 0:h.code,fileStoreId:S,documentUid:S,fileName:(null==E?void 0:E.name)||"",id:c?null===(t=c.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[S,h]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=h&&h.code&&r.newUploadedDocs.push({documentType:null==h?void 0:h.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),p[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,h]),n.useEffect(()=>{},[E]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(ol,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:h,optionKey:"i18nKey",select:e=>g(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&A(l),(i=l[l.length-1])&&y(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function ul(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,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)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(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:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(ol,{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 sl(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,f]=n.useState(null),[m,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==m?void 0:m.length)||null===m?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==m),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:m,documentUid:m,fileName:(null==v?void 0:v.name)||""}]})},[m]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&f(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const cl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==s?void 0:s.status)||"",f=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:m}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[E,y]=n.useState([]),[S,_]=n.useState([]),[b,A]=n.useState(!1),[D,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,x]=n.useState(null),N=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;y(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,c,d;l=u?null==m||null===(o=m.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==E||E.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)}),_(p))},[m,E]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===v&&(null==f?void 0:f.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:N?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.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:N?""+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:N?""+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(ol,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(sl,{key:t,document:e,t:o,error:T,setError:x,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:b}))))},dl=e=>{let{permissions:i,t:o}=e;const[a,r,s]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[c,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==c?void 0:c.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==c?void 0:c.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...c,{label:""}])}}))};function pl(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=i.useTranslation(),[s,c]=n.useState(()=>[]),[d,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),f=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!f&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),f&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function vl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function fl(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 ml(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let s={marginTop:"19px"},c={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?s={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(s={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(s=u({},s,{maxWidth:"950px"}),s=u({},s,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:s,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:c},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const hl=e=>{var o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S,_,b,A,D,C,T,x;let{scrutinyDetails:N,paymentsList:w=[],additionalDetails:I,applicationData:O}=e;const L=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==O?void 0:O.status))&&window.location.href.includes("bpa"),[R,k]=n.useState(),[M,B]=n.useState(),[F,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,K]=n.useState(),[V,q]=n.useState([]),[G,Y]=n.useState(),[$,X]=n.useState(""),[Z,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(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(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?q([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):J(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,i,o,a;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(i=I.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}k(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),B(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(a=I.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),W(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),q(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:ae}=i.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(n.Fragment,null,!(null!=N&&N.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==N||null===(o=N.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:""+ae(""+e.title),text:null!=e&&e.value?re(e)+" "+ae(null==e?void 0:e.isUnit):ae("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==N||null===(a=N.permit)||void 0===a?void 0:a.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==N||null===(r=N.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==N||null===(u=N.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)}},ae("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},ae("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:R,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,ae("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_OTHER_CHARGES)||0,value:M,disabled:!L,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(B(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.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,ae("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!L,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(R)?parseFloat(R):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&L?l.createElement("div",null,l.createElement(t.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){K(e.target.files[0]),Y(e.target.files[0])},disabled:!L,onDelete:()=>{K(null),Y("")},message:z?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:$})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==I||null===(E=I.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(_=Q.fileStoreIds[(null==Q||null===(b=Q.fileStoreIds)||void 0===b?void 0:b.length)-1])||void 0===_?void 0:_.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(R)?parseFloat(R):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(A=I.selfCertificationCharges)||void 0===A?void 0:A.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_LABOUR_CESS)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_WATER_CHARGES)+parseFloat(null==I||null===(T=I.selfCertificationCharges)||void 0===T?void 0:T.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==N||null===(x=N.scruntinyDetails)||void 0===x?void 0:x.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},gl=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),f=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],m=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>f.map(e=>({Header:p(""+e.name),accessor:m(e.id),id:e.id})));function g(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r,u,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===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function E(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===(a=c.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,a,r,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===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:E(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:h,getCellProps:e=>({style:{}})})))})))},El=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))},yl=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:v}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(El,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Sl(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 _l(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 bl=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const f=null==p?void 0:p.mode;var{connectionDetails:m,plumberDetails:h,roadCuttingDetails:g,roadCuttingAddlDetails:E,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==m?void 0:m.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===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=f&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=f&&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==g?void 0:g.map(e=>{var n;return l.createElement("div",{style:(null==g?void 0:g.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==E?void 0:E.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:""})))))))},Al=[{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"}],Dl=[{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"}],Cl=e=>{var o,a,r,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation(),[p,v,f]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,h,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),E=!(null==c||null===(o=c.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,A]=n.useState(p||{}),[D,C]=n.useState(null),[T,x]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[N,w]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==c||null===(e=c.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,s,d,f,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(f=d[0])||void 0===f?void 0:f.taxAmount)}];w(e),x(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else v(i),A(i)},[]);let O={};const L=e=>l.createElement("h1",{className:"heading-m"},e.label),P=()=>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"})),R=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(P,null)),k=function(e,t,n){void 0===t&&(t=!1);let l=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}A(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},N&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==N?void 0:N.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==T?void 0:T.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(E?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:E?{color:"#00703C"}:{color:"#D4351C"}}))),null!=c&&null!==(a=c.additionalDetails)&&void 0!==a&&a.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(L,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(R,{onClick:()=>{A(p),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{A(p),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,s,p,f,m,g,E,y;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==c||null===(r=c.additionalDetails)||void 0===r||null===(s=r.appDetails)||void 0===s?void 0:s.tenantId,n=u({},null==c||null===(p=c.additionalDetails)||void 0===p||null===(f=p.appDetails)||void 0===f?void 0:f.additionalDetails,b);c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(m=c.additionalDetails)||void 0===m||null===(g=m.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(E=c.additionalDetails)||void 0===E||null===(y=E.appDetails)||void 0===y?void 0:y.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,s,c,d,p,f,m,g,E;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(m=e.Calculation)||void 0===m||null===(g=m[0])||void 0===g||null===(E=g.taxHeadEstimates)||void 0===E||E.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const y=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.fee},{title:"WS_SERVICE_FEE_HEADER",value:null===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];h(Ln(e.Calculation[0])),x(null==e||null===(f=e.Calculation)||void 0===f?void 0:f[0]),w(y),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,i,o,a;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Al,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===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Dl,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),D&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==D?void 0:D.isWarning,error:null==D||!D.isWarning,label:d(null==D?void 0:D.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Tl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},xl=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const 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(a)+" ",l.createElement(Tl,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Nl=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[f,m]=n.useState(!1),[h,g]=n.useState({}),E=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"})),S=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),g(t),m(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,f&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{m(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==h||null===(a=h.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},wl={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Il=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:wl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:wl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},wl.cell,wl.cellLeft,wl.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},wl.cell,n.length==t+1?wl.cellRight:{},wl.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},wl.cell,wl.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},wl.cell,{textAlign:"left"},n.length==i+1?wl.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},wl.cell,wl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},wl.cell,wl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:u({},wl.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:wl.cell,key:t,numeric:!0})))))))},Ol={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))"}},Ll=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==r||null===(t=r.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===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));c.map(e=>{let t=function(e){var t,n,l;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);s[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let v={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let f=[];f=Object.keys(v),f.sort((e,t)=>v[e]-v[t]);const[m,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Ol.headerStyle},u("CS_ARREARS_DETAILS")),m&&l.createElement(Il,{headers:[...f],values:s,arrears:p}),!m&&l.createElement("div",{style:Ol.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),m&&l.createElement("div",{style:Ol.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function Pl(e){var a,r,u,s,c,d,p,v,f,m,h,g,E,y;let{applicationDetails:S,demandData:b,workflowDetails:A,isDataLoading:D,applicationData:C,totalDemandTax:T,timelineStatusPrefix:x,showTimeLine:N=!0,statusAttribute:w="status",paymentsList:I,oldValue:O,isInfoLabel:L=!1}=e;const{t:P}=i.useTranslation();let R=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function k(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[M,B]=n.useState({}),[F,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||F.loading||F.loaded||F.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==F||!F.canLoad||F.loading||F.loaded||(U({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,B,U));const H=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:H(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(yl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,b,A,D;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==S?void 0:S.tenantId,businessIds:null==S?void 0:S.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},T=n[t-1],x={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==C||null===(c=C.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.uuid)&&null!=C&&null!==(m=C.processInstance)&&void 0!==m&&null!==(h=m.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==C||null===(E=C.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(A=e.assignes)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.mobileNumber,comment:P(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(yl,{data:x,OpenImage:k,privacy:i})}{var T,x,N,w,I;const t={date:H(null==C||null===(T=C.auditDetails)||void 0===T?void 0:T.lastModifiedTime),name:null==e||null===(x=e.assignes)||void 0===x||null===(N=x[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(w=e.assignes)||void 0===w||null===(I=w[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(yl,{data:t})}},W=(e,t)=>e?t?e:P(e):P("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/obps"),q=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),G={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},Y=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+P(null==e?void 0:e.isUnit):P("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):P("N/A"),[$,X]=n.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},L?l.createElement(xl,{t:P,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==S||null===(a=S.applicationDetails)||void 0===a?void 0:a.map((e,i)=>{var a,r,u,s,c,d,p,v,f,m,h,g,E,y,_,b,D,C,T,x,N,w,L,k,B,F,U,H,j,W,G,$,X,Z,J,Q,ee,te,ne,le;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},K?""+P(e.title):P(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},P(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"}},P(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"}},P(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},P(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((n,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:P(n.title),label:P(n.title),text:l.createElement("img",{src:P(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:P(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"}},P(null==n?void 0:n.title)))):K||V?""+P(n.title):P(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+P(""+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:P(n.title),label:P(n.title),text:Y(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Ll,{bill:null===(r=M.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(hl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:I,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(s=S.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(ul,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(f=v.additionalDetails)||void 0===f?void 0:f.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(fl,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&l.createElement(ml,{owners:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(_l,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(Sl,{units:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.accessories}),!R&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==A||null===(T=A.data)||void 0===T||null===(x=T.nextActions)||void 0===x?void 0:x.length)>0&&l.createElement(dl,{applicationData:null==S?void 0:S.applicationData,t:P,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(al,{t:P,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:A})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(cl,{t:P,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:A}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.scruntinyDetails)&&l.createElement(hl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(hl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(gl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(ol,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(pl,{documents:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.documents}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.taxHeadEstimatesCalculation)&&l.createElement(vl,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(bl,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Cl,{wsAdditionalDetails:e,workflowDetails:A}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Nl,{wsAdditionalDetails:e,workflowDetails:A}))}),N&&(null==A||null===(r=A.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==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"}},P("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=A&&null!==(s=A.data)&&void 0!==s&&s.timeline&&1===(null==A||null===(c=A.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:P(""+x+(null==A||null===(p=A.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state)),customChild:j(null==A||null===(f=A.data)||void 0===f?void 0:f.timeline[0],null==A||null===(m=A.data)||void 0===m?void 0:m.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==A||null===(h=A.data)||void 0===h?void 0:h.timeline)&&(null==A||null===(g=A.data)||void 0===g?void 0:g.timeline.slice(0,$?null==A?void 0:A.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,s,c,d,p;return window.location.href.includes("/obps/")&&(a=null!=A&&null!==(r=A.data)&&void 0!==r&&null!==(u=r.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:P(""+x+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:j(e,n,null==A||null===(o=A.data)||void 0===o?void 0:o.timeline)}))}))),(null==A||null===(E=A.data)||void 0===E||null===(y=E.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:P($?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:G.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:G.th},"Installments"),l.createElement("th",{colSpan:"3",style:G.th},"Demand"),l.createElement("th",{colSpan:"3",style:G.th},"Collection"),l.createElement("th",{colSpan:"3",style:G.th},"Balance"),l.createElement("th",{style:G.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:G.th}),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:G.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:G.td},e.demandTax),l.createElement("td",{style:G.td},e.demandInterest),l.createElement("td",{style:G.td},e.demandPenality),l.createElement("td",{style:G.td},e.collectionTax),l.createElement("td",{style:G.td},e.collectionInterest),l.createElement("td",{style:G.td},e.collectionPenality),l.createElement("td",{style:G.td},e.balanceTax),l.createElement("td",{style:G.td},e.balanceInterest),l.createElement("td",{style:G.td},e.balancePenality),l.createElement("td",{style:G.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},T),l.createElement("td",{style:G.td},Z),l.createElement("td",{style:G.td},J),l.createElement("td",{style:G.td},Q),l.createElement("td",{style:G.td},ee),l.createElement("td",{style:G.td},te),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td})),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},ne),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0")),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total Balance"),l.createElement("td",{style:G.td},ne)))))}function Rl(e){var n,i,o,a,r,u,s,c,d,p,v,f,m,h,g,E,y,S;let{t:_,showToast:b,closeToast:A,businessService:D}=e;if(null!=D&&D.includes("NewTL")||null!=D&&D.includes("TL")||null!=D&&D.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:_("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:_("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:_("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:_("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:_("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:_("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:_("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:_("ES_"+D+"_"+(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:A}))}if(null!=D&&D.includes("BPA")||null!=D&&D.includes("BPA_LOW")||null!=D&&D.includes("BPA_OC")){var T;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=D&&D.includes("BPA_OC")?_(e[1]):_(e[0]),n};let n="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.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===(E=b.error)||void 0===E?void 0:E.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:_("ES_"+D+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:A}))}{var x,N;const e="error"===(null==b?void 0:b.key)?null==b||null===(x=b.error)||void 0===x?void 0:x.message:"ES_"+D+"_"+(null==b||null===(N=b.action)||void 0===N?void 0:N.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:_(e),onClose:A}))}}function kl(e){var o,a,r,s,c,d,p,v,f,m,h,g,E,y,S,_;let{workflowDetails:b,displayMenu:A,onActionSelect:D,setDisplayMenu:C,businessService:T,forcedActionPrefix:x,ActionBarStyle:N={},MenuStyle:w={}}=e;const{t:I}=i.useTranslation();let O=Digit.UserService.getUser();const L=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):{};O=null==t?void 0:t.value}const P=null===(o=O)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,k=!1,M=(null==b||null===(s=b.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(d=c.nextActions)||void 0===d?void 0:d.filter(e=>(null==P?void 0:P.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===(v=p.nextActions)||void 0===v?void 0:v.filter(e=>(null==P?void 0:P.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(L,()=>{C(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(f=M[0])&&void 0!==f&&null!==(m=f.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(k=!1,R=!0):(null==M?void 0:M.length)>0&&(k=!0,R=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&k&&!R&&l.createElement(t.ActionBar,{style:u({},N)},A&&(null!=b&&null!==(h=b.data)&&void 0!==h&&null!==(g=h.actionState)&&void 0!==g&&g.nextActions||null!=b&&null!==(E=b.data)&&void 0!==E&&E.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:x||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:M,optionKey:"action",t:I,onSelect:D,style:w}):null,l.createElement(t.SubmitBar,{ref:L,label:I("WF_TAKE_ACTION"),onSubmit:()=>C(!A)})),!(null!=b&&b.isLoading)&&!k&&R&&l.createElement(t.ActionBar,{style:u({},N)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(y=M[0])||void 0===y?void 0:y.action,value:null==M||null===(S=M[0])||void 0===S?void 0:S.action,onClick:e=>{D((null==M?void 0:M[0])||{})}},I((x||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()))+"_"+(null==M||null===(_=M[0])||void 0===_?void 0:_.action)))))}const Ml=()=>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"})),Bl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ml,null));function Fl(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Bl,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Ul=e=>{var r,s;console.log("props",e);let c=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(p,"BPA",["BlockReason"]),{t:f}=i.useTranslation(),m=o.useHistory();let{id:h}=o.useParams();const[g,E]=n.useState(!1),[y,S]=n.useState(null),[_,b]=n.useState(!1),[A,D]=n.useState(!1),[C,T]=n.useState(!1),{data:x}=Digit.Hooks.obps.useMDMS(p,"BPA",["RiskTypeComputation"]),{applicationDetails:N,demandData:w,totalDemandTax:I,totalBalanceTax:O,showToast:L,setShowToast:R,isLoading:k,isDataLoading:M,applicationData:B,mutate:F,nocMutation:U,workflowDetails:H,id:j,businessService:W,closeToast:z,moduleCode:K,timelineStatusPrefix:V,forcedActionPrefix:q,statusAttribute:G,ActionBarStyle:Y,MenuStyle:$,paymentsList:X,showTimeLine:Z=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:ee}=e;n.useEffect(()=>{L&&H.revalidate()},[L]);const te=a.useQueryClient(),ne=()=>{S(null),b(!1)};return k||A?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Pl,{applicationDetails:N,demandData:w,id:j,workflowDetails:H,isDataLoading:M,applicationData:B,totalDemandTax:I,totalBalanceTax:O,businessService:W,timelineStatusPrefix:V,statusAttribute:G,paymentsList:X,showTimeLine:Z,oldValue:J,isInfoLabel:Q}),_?l.createElement(il,{t:f,action:y,tenantId:d,state:p,id:h,applicationDetails:N,applicationData:null==N?void 0:N.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,a,r,s,c,d,p,v,h,g,E,S,_,b,A,C,T){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.action)?0==(null==e||null===(c=e.Licenses)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.additionalDetail)||void 0===p||null===(v=p.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(h=e.Licenses)||void 0===h||null===(g=h[0])||void 0===g||null===(E=g.comment)||void 0===E?void 0:E.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(_=S.comment)||void 0===_?void 0:_.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(A=b.comment)||void 0===A?void 0:A.length)||0==(null==e||null===(C=e.BPA)||void 0===C||null===(T=C.comment)||void 0===T?void 0:T.length)){var x,N;"INITIATE"===(null==e||null===(x=e.Licenses)||void 0===x||null===(N=x[0])||void 0===N?void 0:N.action)?alert(f("Please fill in the validity before submitting")):alert(f("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,s){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(s=r.workflow)||void 0===s?void 0:s.action)){function c(t){if(l)return t;F&&(D(!0),F(e,{onError:(e,t)=>{D(!1),R({key:"error",error:e}),setTimeout(z,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),D(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=y,m.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=y,m.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&m.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,p,v,h,g,E;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?R({key:"success",label:f("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")?R({key:"success",label:f("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(h=v.workflow)&&void 0!==h&&h.action.includes("APPROVE")?R({key:"success",label:f("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(E=g.workflow)&&void 0!==E&&E.action.includes("REJECT")&&R({key:"success",label:f("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var S;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return R({key:"success",action:y}),void m.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));R({key:"success",action:y}),ee&&setTimeout(ee,3e3),setTimeout(z,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}D(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=P(function(){return D(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,s,c,d,p,v;D(!1);let m=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?f(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.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(),R({key:"error",error:{message:m}}),setTimeout(z,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(c):c(i)}alert(f("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:K,blockReason:null==v||null===(s=v.BPA)||void 0===s?void 0:s.BlockReason}):null,C?l.createElement(Fl,{action:y,workflowDetails:H,businessService:W,isWarningPop:C,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(Rl,{t:f,showToast:L,closeToast:z,businessService:W}),c?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:f("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,n,l,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==x||null===(t=x.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==N||null===(n=N.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==N||null===(o=N.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,a,r,s,c,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===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(s=r.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===(v=p.selfCertificationCharges)||void 0===v?void 0:v.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(f("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(kl,{workflowDetails:H,displayMenu:g,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)R({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(z,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,s;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))m.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(s=location)||void 0===s?void 0:s.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var c,d;m.push(""+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var p;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(p=e.redirectionUrll)||void 0===p?void 0:p.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var v,f;m.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:u({},null===(f=e.redirectionUrl)||void 0===f?void 0:f.state)})}else b(!0);S(e),E(!1)},setDisplayMenu:E,businessService:W,forcedActionPrefix:q,ActionBarStyle:Y,MenuStyle:$})))},Hl=["tenantId","payments"],jl=["tenantId","payments"],Wl={ADSCreate:e=>{var n,r,s,c;const d=a.useQueryClient(),p=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:f}=o.useLocation(),h=o.useHistory(),g=Digit.ULBService.getStateId();let E=[];const[y,S,_]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:A}=Digit.Hooks.pt.useMDMS(g,"PropertyTax","CommonFieldsConfig");function D(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=y.owners||[];n[l]=t,S(u({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,S(u({},y,{units:e}))}else S(u({},y,{[e]:u({},y[e],t)}));((e,t,n,l)=>{let i,o=f.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=f.slice(0,-3),o=o.split("/").pop(),r=!0):(o=f.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),s=h.push;if(e&&(s=h.replace),n&&(u=l),null===u)return s(p.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,s(i)})(n,l,i,e)}const C=()=>{},T=()=>{};if(A)return l.createElement(t.Loader,null);b=m,b.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="searchads";const x=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSCheckPage"),N=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ADSAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:D,onSkip:C,t:v,formData:y,onAdd:T}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(x,{onSubmit:function(){try{return h.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(N,{data:y,onSuccess:()=>{_(),d.invalidateQueries("ADS_CREATE")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},ADSSearch:e=>{var i,a;let{t:s,onSelect:c,config:d,userType:p,formData:v}=e;o.useLocation();const f=Digit.UserService.getUser().info,[m,h]=n.useState(v.adslist&&v.adslist[0]&&v.adslist[0].cartDetails||(null==v||null===(i=v.adslist)||void 0===i?void 0:i.cartDetails)||[]),[g,y]=n.useState(null==v?void 0:v.adType),[S,_]=n.useState(null==v?void 0:v.location),[b,D]=n.useState(null==v?void 0:v.faceArea),[C,x]=n.useState(!0),[N,w]=n.useState(null==v?void 0:v.fromDate),[I,O]=n.useState([]),[L,P]=n.useState(null==v?void 0:v.toDate),[R,k]=n.useState(v.adslist&&v.adslist[0]&&v.adslist[0].Searchdata||(null==v||null===(a=v.adslist)||void 0===a?void 0:a.Searchdata)||[]),[M,B]=n.useState(null),[F,U]=n.useState(!1),[H,j]=n.useState(""),[W,z]=n.useState((null==v?void 0:v.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),K=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[V,q]=n.useState(!1);let G=[],Y=[],$=[];const{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Z}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:J}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Q}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});X&&X.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Z&&Z.map(e=>{Y.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),J&&J.map(e=>{$.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const ee=Digit.Hooks.ads.useADSSlotSearch();let te={advertisementSlotSearchCriteria:[{bookingId:"",addType:R.addType,bookingStartDate:R.bookingStartDate,bookingEndDate:R.bookingEndDate,faceArea:R.faceArea,tenantId:K,location:R.location,nightLight:R.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(ee.data&&null!==(e=ee.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=ee.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+s(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+s(e.faceArea),locationCode:e.location,location:""+s(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:R.unitPrice,status:"AVAILABLE"===e.slotStaus?l.createElement("div",{className:"sla-cell-success"},"Available"):l.createElement("div",{className:"sla-cell-error"},"Booked")}));le(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),oe(e=>e||!0)}},[ee.data,R]);const[ne,le]=n.useState(""),[ie,oe]=n.useState(!1),ae=[{Header:""+s("ADS_TYPE"),accessor:"addType"},{Header:""+s("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+s("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+s("ADS_DATE"),accessor:"bookingDate"},{Header:""+s("ADS_STATUS"),accessor:"status"}],{control:re}=r.useForm(),ue=()=>{let e,t=v.adslist&&v.adslist[0];"citizen"===p?(e=u({},t,{Searchdata:R,cartDetails:m,adsType:g,selectedLocation:S,selectedFace:b,selectNight:W,fromDate:N,toDate:L,existingDataSet:H}),c(d.key,u({},v[d.key],e),!1,0)):(e=u({},t,{Searchdata:R,cartDetails:m,adsType:g,selectNight:W,selectedLocation:S,selectedFace:b,fromDate:N,toDate:L,existingDataSet:H}),c(d.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===p&&ue()},[m,g,W,b,S,R]);const se=[{id:"selection",Header:e=>l.createElement("div",{style:{paddingLeft:"50px"}},l.createElement("input",{type:"checkbox",checked:I.length===ne.length,onChange:()=>{if(I.length===ne.length)O([]);else{const e=ne.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);O(e)}}})),Cell:e=>{let{row:t}=e;return l.createElement("div",{style:{paddingLeft:"50px"}},l.createElement("input",{type:"checkbox",checked:I.includes(t.original.slotId),onChange:()=>(e=>{const t=ne[e].slotId;O(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...ae];return n.useEffect(()=>{if(null!=v&&v.adType&&null!=v&&v.faceArea&&null!=v&&v.fromDate&&null!=v&&v.toDate&&null!=v&&v.nightLight&&null!=v&&v.location&&Q){var e,t,n,l,i;let u,s=null==v||null===(e=v.location)||void 0===e?void 0:e.value;const c=null==Q?void 0:Q.find(e=>(null==e?void 0:e.location)===s);if(c){var o,a,r;const e="CalculationType_"+(null==v||null===(o=v.faceArea)||void 0===o?void 0:o.code);u=null==c||null===(a=c[e])||void 0===a||null===(r=a[0])||void 0===r?void 0:r.amount}const d={addType:null==v||null===(t=v.adType)||void 0===t?void 0:t.code,faceArea:null==v||null===(n=v.faceArea)||void 0===n?void 0:n.code,location:null==v||null===(l=v.location)||void 0===l?void 0:l.code,nightLight:null==v||null===(i=v.nightLight)||void 0===i?void 0:i.value,bookingStartDate:null==v?void 0:v.fromDate,bookingEndDate:null==v?void 0:v.toDate,unitPrice:u};JSON.stringify(d)!==JSON.stringify(R)&&k(d)}},[v,Q]),n.useEffect(()=>{if(M){const e=setTimeout(()=>{B(null)},1500);return()=>clearTimeout(e)}},[M]),n.useEffect(()=>{R.addType&&ee.mutate(te)},[R]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen"),l.createElement(t.FormStep,{config:d,onSelect:ue,onSkip:()=>c(),t:s},l.createElement(t.CardHeader,null,s("ADS_SEARCH_HEADER")),l.createElement(t.CardLabel,null,""+s("ADS_TYPE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:re,name:"adsType",defaultValue:g,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:g,select:e=>{y(e)},placeholder:"Select Advertisement Type",option:G,optionKey:"i18nKey",t:s})}),l.createElement(t.CardLabel,null,""+s("ADS_LOCATION")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:re,name:"selectedLocation",defaultValue:S,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:S,select:e=>{_(e)},placeholder:"Select Ad Type",option:Y,optionKey:"i18nKey",t:s})}),l.createElement(t.CardLabel,null,""+s("ADS_FACE_AREA")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:re,name:"adsType",defaultValue:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{D(e)},placeholder:"Select Ad Type",option:$,optionKey:"i18nKey",t:s})}),l.createElement(t.CardLabel,null,""+s("ADS_FROM_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:N,onChange:function(e){w(e.target.value)},style:{width:"EMPLOYEE"===f.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+s("ADS_TO_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:L,onChange:function(e){P(e.target.value)},style:{width:"EMPLOYEE"===f.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+s("ADS_NIGHT_LIGHT")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:s,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:W,selectedOption:W,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:z,isDependent:!0}),l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},l.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==g?void 0:g.code,t=N,n=L,l=null==b?void 0:b.code,i=null==S?void 0:S.value,o=null==W?void 0:W.value;let a;const r=null==Q?void 0:Q.find(e=>(null==e?void 0:e.location)===i);if(r){var u,c;const e="CalculationType_"+l;a=null==r||null===(u=r[e])||void 0===u||null===(c=u[0])||void 0===c?void 0:c.amount}if(g&&t&&n&&l&&i&&o){if(new Date(t)>new Date(n))return void B({error:!0,label:s("ADS_INVALID_DATE_RANGE")});k({addType:e,faceArea:l,location:i,nightLight:o,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else B({error:!0,label:s("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),l.createElement(t.SubmitBar,{label:s("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===I.length)return void B({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=ne.filter(e=>I.includes(e.slotId)),t=m.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return B({error:!0,label:s("ADS_ITEM_ALREADY_IN_CART")}),void O([]);const l={};[...t,...n].forEach(e=>{const t=e.addType+"-"+e.location+"-"+e.faceArea+"-"+e.nightLight;l[t]||(l[t]=[]),l[t].push(e)});for(let e in l){const t=l[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return B({error:!0,label:s("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void O([])}h(e=>[...e,...n]),B({success:!0,label:n.length+" item(s) added to cart."}),O([])}}),l.createElement("div",null,l.createElement(t.SubmitBar,{label:s("ADS_VIEW_CART"),onSubmit:()=>{m.length>0?q(!0):B({error:!0,label:s("ADS_NO_ITEMS_IN_CART")})}})),l.createElement("div",{class:"container",style:{width:"1px"}},l.createElement("div",{style:{width:"1px",position:"relative"}},l.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},l.createElement("div",null," ",m.length)))),V&&l.createElement(T,{onClose:()=>{q(!1)},cartDetails:m,setCartDetails:h}),l.createElement(t.SubmitBar,{label:s("ADS_BOOK_NOW"),onSubmit:()=>{0===m.length?B({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")}):C?U(!0):ue()}}))),ie&&l.createElement(t.Card,{style:{overflowX:"auto"}},l.createElement(E,{t:s,data:ne,columns:se,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:ne.length,style:{width:"100%",overflowX:"auto"}})),M&&l.createElement(t.Toast,{error:M.error,warning:M.warning,label:s(M.label),onClose:()=>{B(null)}}),F&&l.createElement(A,{t:s,closeModal:()=>U(!1),actionCancelOnSubmit:()=>U(!1),onSubmit:()=>{ue(),U(!1)},setExistingDataSet:j,Searchdata:m}))},ADSCitizenDetails:e=>{var i,a,r,s,c,d,p,v,f,m,h,g,E,y,S;let{t:_,config:b,onSelect:A,userType:D,formData:C,value:T=C.adslist}=e;o.useLocation();let x=window.location.href.charAt(window.location.href.length-1),N={};const I=Digit.UserService.getUser().info,O=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),P=Digit.Hooks.ads.useADSCreateAPI(),[R,M]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].applicantName||(null==C||null===(i=C.applicant)||void 0===i?void 0:i.applicantName)||(null==T||null===(a=T.existingDataSet)||void 0===a||null===(r=a.applicant)||void 0===r?void 0:r.applicantName)||""),[B,F]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].emailId||(null==C||null===(s=C.applicant)||void 0===s?void 0:s.emailId)||(null==T||null===(c=T.existingDataSet)||void 0===c||null===(d=c.applicant)||void 0===d?void 0:d.emailId)||""),[U,H]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].mobileNumber||(null==T||null===(p=T.existingDataSet)||void 0===p||null===(v=p.applicant)||void 0===v?void 0:v.mobileNumber)||(null==C||null===(f=C.applicant)||void 0===f?void 0:f.mobileNumber)||(null==I?void 0:I.mobileNumber)),[j,W]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].alternateNumber||(null==C||null===(m=C.applicant)||void 0===m?void 0:m.alternateNumber)||(null==T||null===(h=T.existingDataSet)||void 0===h||null===(g=h.applicant)||void 0===g?void 0:g.alternateNumber)||""),z=()=>{let e=C.applicant&&C.applicant[x],t=null==T?void 0:T.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));P.mutate({bookingApplication:{tenantId:O,applicantDetail:{applicantName:R,applicantMobileNo:U,applicantAlternateMobileNo:j,applicantEmailId:B},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const l=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let i;"citizen"===D?(i=u({},e,{applicantName:R,mobileNumber:U,alternateNumber:j,emailId:B,draftId:l}),A(b.key,u({},C[b.key],i),!1,x)):(i=u({},e,{applicantName:R,mobileNumber:U,alternateNumber:j,emailId:B,draftId:l}),A(b.key,i,!1,x))}})};return n.useEffect(()=>{"citizen"===D&&z()},[]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(w,{currentStep:1}):null,l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(k,{timerValues:null==T||null===(E=T.existingDataSet)||void 0===E||null===(y=E.timervalue)||void 0===y?void 0:y.timervalue,SlotSearchData:null==T?void 0:T.cartDetails,draftId:null==T||null===(S=T.existingDataSet)||void 0===S?void 0:S.draftId})),l.createElement(L,null))),l.createElement(t.FormStep,{config:b,onSelect:z,onSkip:()=>A(),t:_,isDisabled:!R||!U||!B},l.createElement("div",null,l.createElement(t.CardLabel,null,""+_("ADS_APPLICANT_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:_,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:R,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");M(t)},style:{width:"EMPLOYEE"===I.type?"51.6%":null},ValidationRequired:!0},N={pattern:"^[a-zA-Z ]+$",type:"tel",title:_("CHB_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+_("ADS_MOBILE_NUMBER")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.MobileNumber,{value:U,name:"mobileNumber",style:{width:"EMPLOYEE"===I.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>{H({value:e}.value)},pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:_("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+_("ADS_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:j,name:"alternateNumber",style:{width:"EMPLOYEE"===I.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>{W({value:e}.value)},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:_("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+_("ADS_EMAIL_ID")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:_,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:B,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===I.type?"51.6%":null},onChange:function(e){F(e.target.value)},ValidationRequired:!0},N={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:_("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var i,a,s,c,d,p,v,f,m,h,g,E,y,S,_,b,A,D,C,T,x,N,I,O,P,R,M,B,F,U;let{t:H,config:j,onSelect:W,userType:z,formData:K,value:V=K.adslist}=e;o.useLocation();let q=window.location.href.charAt(window.location.href.length-1);const G=Digit.Hooks.ads.useTenants(),Y=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId();o.useLocation();let $={};const X=Digit.UserService.getUser().info,Z=Digit.Hooks.ads.useADSCreateAPI(),[J,Q]=n.useState(K.address&&K.address[q]&&K.address[q].pincode||(null==K||null===(i=K.address)||void 0===i?void 0:i.pincode)||(null==V||null===(a=V.existingDataSet)||void 0===a||null===(s=a.address)||void 0===s?void 0:s.pincode)||""),[ee,te]=n.useState(K.address&&K.address[q]&&K.address[q].city||(null==K||null===(c=K.address)||void 0===c?void 0:c.city)||(null==V||null===(d=V.existingDataSet)||void 0===d||null===(p=d.address)||void 0===p?void 0:p.city)||""),[ne,le]=n.useState(K.address&&K.address[q]&&K.address[q].locality||(null==K||null===(v=K.address)||void 0===v?void 0:v.locality)||(null==V||null===(f=V.existingDataSet)||void 0===f||null===(m=f.address)||void 0===m?void 0:m.locality)||""),[ie,oe]=n.useState(K.address&&K.address[q]&&K.address[q].streetName||(null==K||null===(h=K.address)||void 0===h?void 0:h.streetName)||(null==V||null===(g=V.existingDataSet)||void 0===g||null===(E=g.address)||void 0===E?void 0:E.streetName)||""),[ae,re]=n.useState(K.address&&K.address[q]&&K.address[q].houseNo||(null==K||null===(y=K.address)||void 0===y?void 0:y.houseNo)||(null==V||null===(S=V.existingDataSet)||void 0===S||null===(_=S.address)||void 0===_?void 0:_.houseNo)||""),[ue,se]=n.useState(K.address&&K.address[q]&&K.address[q].landmark||(null==K||null===(b=K.address)||void 0===b?void 0:b.landmark)||(null==V||null===(A=V.existingDataSet)||void 0===A||null===(D=A.address)||void 0===D?void 0:D.landmark)||""),[ce,de]=n.useState(K.address&&K.address[q]&&K.address[q].houseName||(null==K||null===(C=K.address)||void 0===C?void 0:C.houseName)||(null==V||null===(T=V.existingDataSet)||void 0===T||null===(x=T.address)||void 0===x?void 0:x.houseName)||""),[pe,ve]=n.useState(K.address&&K.address[q]&&K.address[q].addressline1||(null==K||null===(N=K.address)||void 0===N?void 0:N.addressline1)||(null==V||null===(I=V.existingDataSet)||void 0===I||null===(O=I.address)||void 0===O?void 0:O.addressline1)||""),[fe,me]=n.useState(K.address&&K.address[q]&&K.address[q].addressline2||(null==K||null===(P=K.address)||void 0===P?void 0:P.addressline2)||(null==V||null===(R=V.existingDataSet)||void 0===R||null===(M=R.address)||void 0===M?void 0:M.addressline2)||""),{data:he}=Digit.Hooks.useBoundaryLocalities(null==ee?void 0:ee.code,"revenue",{enabled:!!ee},H);let ge=[];he&&he.map((e,t)=>{ge.push({i18nKey:e.i18nkey,code:e.code,label:e.label,area:e.area,boundaryNum:e.boundaryNum})});const Ee=()=>{var e,t,n,l,i,o,a;let r=null==V?void 0:V.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const s={bookingApplication:{tenantId:Y,draftId:null==K||null===(e=K.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==K||null===(t=K.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==K||null===(n=K.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==K||null===(l=K.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==K||null===(i=K.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:J,city:null==ee||null===(o=ee.city)||void 0===o?void 0:o.name,cityCode:null==ee||null===(a=ee.city)||void 0===a?void 0:a.code,locality:null==ne?void 0:ne.i18nKey,localityCode:null==ne?void 0:ne.code,streetName:ie,addressLine1:pe,addressLine2:fe,houseNo:ae,landmark:ue},cartDetails:r,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};Z.mutate(s);let c=u({},K.address&&K.address[q],{pincode:J,city:ee,locality:ne,streetName:ie,houseNo:ae,landmark:ue,houseName:ce,addressline1:pe,addressline2:fe});W(j.key,u({},K[j.key],c),!1,q)},{control:ye}=r.useForm();return n.useEffect(()=>{"citizen"===z&&Ee()},[Ee,z]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(w,{currentStep:2}):null,l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(k,{timerValues:null==V||null===(B=V.existingDataSet)||void 0===B||null===(F=B.timervalue)||void 0===F?void 0:F.timervalue,SlotSearchData:null==V?void 0:V.cartDetails,draftId:null==V||null===(U=V.existingDataSet)||void 0===U?void 0:U.draftId})),l.createElement(L,null))),l.createElement(t.FormStep,{config:j,onSelect:Ee,onSkip:()=>W(),t:H,isDisabled:!(J&&ee&&ie&&ae&&ue&&ne&&pe)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("ADS_HOUSE_NO")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:ae,placeholder:"Enter House No",onChange:e=>{re(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0},$={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:H("ADS_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_HOUSE_NAME")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseName",value:ce,placeholder:"Enter House Name",onChange:e=>{de(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_STREET_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"streetName",value:ie,placeholder:"Enter Street Name",onChange:e=>{oe(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0},$={pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:H("ADS_STREET_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_LINE1")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:pe,placeholder:"Enter Address",onChange:e=>{ve(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_LINE2")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:fe,placeholder:"Enter Address",onChange:e=>{me(e.target.value)},style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+H("ADS_LANDMARK")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextArea,u({t:H,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:ue,placeholder:"Enter Landmark",onChange:e=>{se(e.target.value)},style:{width:"50%"},ValidationRequired:!0},$={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"textarea",title:H("ADS_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("ADS_CITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ye,name:"city",defaultValue:ee,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:G,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("ADS_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(r.Controller,{control:ye,name:"locality",defaultValue:ne,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:ge,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("ADS_ADDRESS_PINCODE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:J,onChange:e=>{const t=e.target.value.replace(/\D/g,"").slice(0,6);Q(t)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===X.type?"50%":"86%"},ValidationRequired:!0,validation:{pattern:"[0-9]{6}",type:"text",title:H("CHB_ADDRESS_PINCODE_INVALID")},minLength:6,maxLength:6}))))},ADSDocumentDetails:e=>{var i,o,a,r,s,c,d,p;let{t:v,config:f,onSelect:m,formData:h,value:g=h.adslist}=e;const[E,y]=n.useState((null==h||null===(i=h.documents)||void 0===i?void 0:i.documents)||(null==g||null===(o=g.existingDataSet)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.documents)||[]),[S,_]=n.useState(null),[b,A]=n.useState(!0),[D,C]=n.useState(!1),T=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),x=Digit.Hooks.ads.useADSCreateAPI(),N=Digit.ULBService.getStateId(),{isLoading:I,data:O}=Digit.Hooks.ads.useADSDocumentsMDMS(N,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==O||null===(e=O.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;E.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),A("0"!=t&&0!=t||!(E.length>0))},[E,D]),l.createElement("div",null,l.createElement(w,{currentStep:3}),l.createElement(t.Card,null,l.createElement("div",{style:{position:"relative"}},l.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},l.createElement(k,{timerValues:null==g||null===(r=g.existingDataSet)||void 0===r||null===(s=r.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==g?void 0:g.cartDetails,draftId:null==g||null===(c=g.existingDataSet)||void 0===c?void 0:c.draftId})),l.createElement(L,null))),I?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:v,config:f,onSelect:()=>{var e,t,n,l,i,o,a,r,s,c,d,p,v,y,S,_,b,A,D,C,N;let w=null==g?void 0:g.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const I={bookingApplication:{tenantId:T,draftId:null==h||null===(e=h.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==h||null===(t=h.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==h||null===(n=h.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==h||null===(l=h.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==h||null===(i=h.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:null==h||null===(o=h.address)||void 0===o?void 0:o.pincode,city:null==h||null===(a=h.address)||void 0===a||null===(r=a.city)||void 0===r||null===(s=r.city)||void 0===s?void 0:s.name,cityCode:null==h||null===(c=h.address)||void 0===c||null===(d=c.city)||void 0===d||null===(p=d.city)||void 0===p?void 0:p.code,locality:null==h||null===(v=h.address)||void 0===v||null===(y=v.locality)||void 0===y?void 0:y.i18nKey,localityCode:null==h||null===(S=h.address)||void 0===S||null===(_=S.locality)||void 0===_?void 0:_.code,streetName:null==h||null===(b=h.address)||void 0===b?void 0:b.streetName,addressLine1:null==h||null===(A=h.address)||void 0===A?void 0:A.addressline1,addressLine2:null==h||null===(D=h.address)||void 0===D?void 0:D.addressline2,houseNo:null==h||null===(C=h.address)||void 0===C?void 0:C.houseNo,landmark:null==h||null===(N=h.address)||void 0===N?void 0:N.landmark},documents:E,cartDetails:w,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let O;x.mutate(I),O=u({},h.documents,{documents:E}),m(f.key,O)},onSkip:()=>m(),isDisabled:b,onAdd:function(){}},l.createElement(t.CardSubHeader,null,v("ADS_PROOF_OF_DOCUMENTS")),l.createElement(t.CardLabelDesc,null,v("ADS_UPLOAD_RESTRICTIONS_TYPES")),l.createElement(t.CardLabelDesc,null,v("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==O||null===(d=O.Advertisement)||void 0===d||null===(p=d.Documents)||void 0===p?void 0:p.map((e,t)=>l.createElement(M,{key:t,document:e,t:v,error:S,setError:_,setDocuments:y,documents:E,setCheckRequiredFields:C})),S&&l.createElement(t.Toast,{label:S,onClose:()=>_(null),error:!0})))},ADSCheckPage:e=>{var a,r,s,d,p,v,f,m,h,g,y;let{onSubmit:S,value:_={}}=e;const{t:b}=i.useTranslation(),[A,D]=(o.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:C,isEditADS:T,isUpdateADS:x,documents:N,address:I}=_,O=T||x?"editbookad":"bookad",L=[{Header:""+b("ADS_TYPE"),accessor:"addType"},{Header:""+b("ADS_FACE_AREA"),accessor:"faceArea"},{Header:b("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return l.createElement("div",null,b(t?"Yes":"No"))}},{Header:""+b("ADS_DATE"),accessor:"bookingDate"},{Header:b("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return l.createElement("button",{onClick:()=>P(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],P=e=>{var t;const n=u({},A);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),D(n)},R=(null==A||null===(a=A.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[M,U]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(w,{currentStep:4}):null,l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement(t.CardHeader,null,b("ADS_SUMMARY")),l.createElement(t.CardSubHeader,null,l.createElement(k,{timerValues:null==A||null===(r=A.adslist)||void 0===r||null===(s=r.existingDataSet)||void 0===s||null===(d=s.timervalue)||void 0===d?void 0:d.timervalue,SlotSearchData:null==A||null===(p=A.adslist)||void 0===p?void 0:p.cartDetails,draftId:null==A||null===(v=A.adslist)||void 0===v||null===(f=v.existingDataSet)||void 0===f?void 0:f.draftId}))),l.createElement("div",null,l.createElement(t.CardText,null,b("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:b("ADS_APPLICANT_NAME"),text:""+b(c(null==C?void 0:C.applicantName)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/applicant-details"})}),l.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(c(null==C?void 0:C.mobileNumber)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/applicant-details"})}),l.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(c(null==C?void 0:C.alternateNumber)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/applicant-details"})}),l.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(c(null==C?void 0:C.emailId)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/applicant-details"})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:b("ADS_HOUSE_NO"),text:""+b(c(null==I?void 0:I.houseNo)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(c(null==I?void 0:I.houseName)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(c(null==I?void 0:I.streetName)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(c(null==I?void 0:I.addressline1)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(c(null==I?void 0:I.addressline2)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(c(null==I?void 0:I.landmark)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(c(null==I||null===(m=I.city)||void 0===m||null===(h=m.city)||void 0===h?void 0:h.name)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(c(null==I||null===(g=I.locality)||void 0===g?void 0:g.i18nKey)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(c(null==I?void 0:I.pincode)),actionButton:l.createElement(F,{jumpTo:"/digit-ui/citizen/ads/"+O+"/address-details"})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),l.createElement(E,{t:b,data:R,columns:L,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==A||null===(y=A.adslist)||void 0===y?void 0:y.cartDetails.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Card,null,N&&(null==N?void 0:N.documents.map((e,t)=>l.createElement(B,{value:_,Code:null==e?void 0:e.documentType,index:t}))))),l.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{U(!M)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:S,disabled:!M})))},ADSAcknowledgement:e=>{var a,r;let{data:s,onSuccess:c}=e;const{t:d}=i.useTranslation(),p=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),v=Digit.Hooks.ads.useADSCreateAPI(p),f=(Digit.Hooks.useStore.getInitData(),o.useRouteMatch(),o.useHistory()),m=Digit.UserService.getUser().info,[h,g]=n.useState(null),E=Digit.Hooks.ads.useADSSlotSearch();let y={advertisementSlotSearchCriteria:null===(a=v.data)||void 0===a||null===(r=a.bookingApplication[0])||void 0===r?void 0:r.cartDetails.map(e=>{var t;return{bookingId:null===(t=v.data)||void 0===t?void 0:t.bookingApplication[0].bookingId,addType:null==e?void 0:e.addType,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceArea,tenantId:p,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}})};return n.useEffect(()=>{try{s.tenantId=p;let e=(e=>(e=(e=>{let{documents:t}=e,n=u({},t);return e.documents=n,e})(e),{bookingApplication:u({tenantId:(e=(e=>{var t;let{adslist:n}=e,l=(null==n?void 0:n.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"})))||[],i=null==n||null===(t=n.existingDataSet)||void 0===t?void 0:t.draftId;return e.adslist={cartDetails:l,draftId:i},e})(e=(e=>{var t,n,l,i,o,a;let{address:r}=e,u={pincode:null==r?void 0:r.pincode,city:null==r||null===(t=r.city)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.name,cityCode:null==r||null===(l=r.city)||void 0===l||null===(i=l.city)||void 0===i?void 0:i.code,locality:null==r||null===(o=r.locality)||void 0===o?void 0:o.i18nKey,localityCode:null==r||null===(a=r.locality)||void 0===a?void 0:a.code,streetName:null==r?void 0:r.streetName,addressLine1:null==r?void 0:r.addressline1,addressLine2:null==r?void 0:r.addressline2,houseNo:null==r?void 0:r.houseNo,landmark:null==r?void 0:r.landmark};return e.address=u,e})(e=(e=>{let{applicant:t}=e;return e.applicant={Applicant:{applicantName:null==t?void 0:t.applicantName,applicantMobileNo:null==t?void 0:t.mobileNumber,applicantAlternateMobileNo:null==t?void 0:t.alternateNumber,applicantEmailId:null==t?void 0:t.emailId},draftId:null==t?void 0:t.draftId},e})(e)))).tenantId,draftId:e.applicant.draftId,applicantDetail:u({},e.applicant.Applicant),address:e.address},e.documents,{bookingStatus:"BOOKING_CREATED",cartDetails:e.adslist.cartDetails,workflow:null})}))(s);v.mutate(e,{onSuccess:c})}catch(e){}},[]),n.useEffect(()=>{if(h){const e=setTimeout(()=>{g(null)},2e3);return()=>clearTimeout(e)}},[h]),v.isLoading||v.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(j,{t:d,data:v.data,isSuccess:v.isSuccess,isLoading:v.isIdle||v.isLoading}),l.createElement(t.StatusTable,null,v.isSuccess&&l.createElement(t.Row,{rowContainerStyle:H,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),v.isSuccess&&l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},"EMPLOYEE"===m.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})),"CITIZEN"===m.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})),l.createElement(t.SubmitBar,{label:d("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:function(){try{const e=P(function(){return Promise.resolve(E.mutateAsync(y)).then(function(e){var t,n,l,i;let o={bookingId:null===(t=v.data)||void 0===t?void 0:t.bookingApplication[0].bookingId,tenantId:p,cartDetails:null===(n=v.data)||void 0===n||null===(l=n.bookingApplication[0])||void 0===l?void 0:l.cartDetails};const a=null==e||null===(i=e.advertisementSlotAvailabiltityDetails)||void 0===i?void 0:i.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;if(a)g({error:!0,label:d("ADS_ADVERTISEMENT_ALREADY_BOOKED")});else if("CITIZEN"===m.type){var u,s,c,h;f.push({pathname:"/digit-ui/citizen/payment/my-bills/adv-services/"+(null===(u=v.data)||void 0===u||null===(s=u.bookingApplication[0])||void 0===s?void 0:s.bookingNo),state:{tenantId:p,bookingNo:null===(c=v.data)||void 0===c||null===(h=c.bookingApplication[0])||void 0===h?void 0:h.bookingNo,timerValue:r,SlotSearchData:o}})}else if("EMPLOYEE"===m.type){var E,y,S,_;f.push({pathname:"/digit-ui/employee/payment/collect/adv-services/"+(null===(E=v.data)||void 0===E||null===(y=E.bookingApplication[0])||void 0===y?void 0:y.bookingNo),state:{tenantId:p,bookingNo:null===(S=v.data)||void 0===S||null===(_=S.bookingApplication[0])||void 0===_?void 0:_.bookingNo,timerValue:r,SlotSearchData:o}})}})},function(){g({error:!0,label:d("CS_SOMETHING_WENT_WRONG")})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})),!v.isSuccess&&"CITIZEN"===m.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})),!v.isSuccess&&"EMPLOYEE"===m.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})),h&&l.createElement(t.Toast,{error:h.error,warning:h.warning,label:d(h.label),onClose:()=>{g(null)}}))},ADSCard:W,ADSMyApplications:()=>{const{t:e}=i.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info,[s,c]=n.useState(""),[d,p]=n.useState(null),[v,f]=n.useState(null);let m,h,g=window.location.href.split("/").pop();isNaN(parseInt(g))?m=4:(h=g,m=parseInt(g)+50);let E=isNaN(parseInt(g))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:a,mobileNumber:null==r?void 0:r.mobileNumber}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:h,tenantId:a};n.useEffect(()=>{f(E)},[g]);const{isLoading:y,data:S}=Digit.Hooks.ads.useADSSearch({filters:v});if(y)return l.createElement(t.Loader,null);const _=[{i18nKey:"Booked",code:"BOOKED",value:e("ADS_BOOKED")},{i18nKey:"Booking in Progres",code:"BOOKING_CREATED",value:e("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:e("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:e("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:e("CANCELLED")}],b=(null==S?void 0:S.bookingApplication)||[];return l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("ADS_MY_BOOKINGS_HEADER")+" ("+b.length+")"),l.createElement(t.Card,null,l.createElement("div",{style:{marginLeft:"16px"}},l.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"16px"}},l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("ADS_BOOKING_NO")),l.createElement(t.TextInput,{placeholder:e("Enter Booking No."),value:s,onChange:e=>c(e.target.value),style:{width:"100%",padding:"8px",height:"150%"}}))),l.createElement("div",{style:{flex:1}},l.createElement("div",{style:{display:"flex",flexDirection:"column"}},l.createElement(t.CardLabel,null,e("PT_COMMON_TABLE_COL_STATUS_LABEL")),l.createElement(t.Dropdown,{className:"form-field",selected:d,select:p,option:_,placeholder:e("Select Status"),optionKey:"value",style:{width:"100%"},t:e}))),l.createElement("div",null,l.createElement("div",{style:{marginTop:"17%"}},l.createElement(t.SubmitBar,{label:e("ES_COMMON_SEARCH"),onSubmit:()=>{const e=s.trim(),t=u({},E,{bookingNo:e||void 0,status:(null==d?void 0:d.code)||void 0});f(t)}}),l.createElement("p",{className:"link",style:{marginLeft:"30%",marginTop:"10px",display:"block"},onClick:()=>{c(""),p("")}},e("ES_COMMON_CLEAR_ALL"))))),l.createElement(o.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},l.createElement(t.SubmitBar,{style:{borderRadius:"30px",width:"20%"},label:e("ADS_NEW_BOOKING")+" +"})))),l.createElement("div",null,b.length>0&&b.map((t,n)=>l.createElement("div",{key:n},l.createElement(X,{application:t,tenantId:a,buttonLabel:e("ADS_SUMMARY")}))),0===b.length&&!y&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==b.length&&(null==S?void 0:S.count)>m&&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/ads/myBookings/"+m},e("ADS_LOAD_MORE_MSG")))))))},ApplicationDetails:l.memo(()=>{var e,a,r,c,d;const{t:p}=i.useTranslation(),v=Digit.ULBService.getCurrentTenantId(),{id:f}=o.useParams(),[m,h]=n.useState(null),[g,E]=n.useState({}),[y,S]=n.useState(!1),{isLoading:_,data:b}=Digit.Hooks.ads.useADSApplicationDetail(p,v,f),A=Digit.Hooks.ads.useADSCreateAPI(v,!1),{data:D,refetch:C}=Digit.Hooks.ads.useADSSearch({tenantId:v,filters:{bookingNo:f,audit:!0}});n.useEffect(()=>{b&&E(Ge.cloneDeep(b))},[b]);const{data:T,isLoading:x}=Digit.Hooks.useRecieptSearch({tenantId:v,businessService:"adv-services",consumerCodes:null==g||null===(e=g.applicationData)||void 0===e||null===(a=e.applicationData)||void 0===a?void 0:a.bookingNo,isEmployee:!1},{enabled:!(null==g||null===(r=g.applicationData)||void 0===r||null===(c=r.applicationData)||void 0===c||!c.bookingNo)});let N=[];return T&&(null==T?void 0:T.Payments.length)>0&&0==x&&N.push({label:p("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,jl);try{var l;function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=null==D||null===(l=D.bookingApplication)||void 0===l?void 0:l[0],o=null==e?void 0:e.paymentReceiptFilestoreId;const a=function(){if(!o){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"advservice-receipt")).then(function(t){var n;l=t;const i=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(A.mutateAsync({bookingApplication:i})).then(function(){var e;o=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],C()})})}}();return Promise.resolve(a&&a.then?a.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==T||null===(e=T.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==T?void 0:T.Payments[0]})}}),T&&(null==T?void 0:T.Payments.length)>0&&0==x&&N.push({label:p("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;s(e,Hl);try{var n;function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=null==D||null===(n=D.bookingApplication)||void 0===n?void 0:n[0],i=null==e?void 0:e.permissionLetterFilestoreId;const o=function(){if(!i)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[e]},"advpermissionletter")).then(function(t){const n=u({},e,{permissionLetterFilestoreId:null==t?void 0:t.filestoreIds[0]});return Promise.resolve(A.mutateAsync({bookingApplication:n})).then(function(){i=null==t?void 0:t.filestoreIds[0],C()})})}();return Promise.resolve(o&&o.then?o.then(l):l())}catch(e){return Promise.reject(e)}}({tenantId:null==T||null===(e=T.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==T?void 0:T.Payments[0]})}}),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"}},p("ADS_BOOKING_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},N&&N.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>S(!y),displayOptions:y,options:N,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Ul,{applicationDetails:null==g?void 0:g.applicationData,isLoading:_,isDataLoading:_,applicationData:null==g||null===(d=g.applicationData)||void 0===d?void 0:d.applicationData,showToast:m,setShowToast:h,closeToast:()=>{h(null)},MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))}),ADSApplicationDetails:()=>{var e,a,r,c,d,p,v,f,m,h,g,y,S,_,b,A,D,C,T,x,N;const{t:w}=i.useTranslation(),{acknowledgementIds:I,tenantId:O}=(o.useHistory(),o.useParams()),[L,P]=n.useState([]),[R,k]=n.useState(!1),[M,F]=n.useState(!1),[U,H]=n.useState(null),{isLoading:j,data:W,refetch:z}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:O,filters:{bookingNo:I}})),K=Digit.Hooks.ads.useADSCreateAPI(O,!1),[V,q]=n.useState(null),G=qe(W,"bookingApplication",[]),Y=qe(W,"bookingApplication[0].bookingNo",[]);let $=G&&G.length>0&&G[0]||{};const X=$;sessionStorage.setItem("ads",JSON.stringify(X));const[Z,J]=n.useState(!1);n.useEffect(()=>{!function(){try{J(!0),Promise.resolve(Digit.PaymentService.fetchBill(O,{businessService:"adv-services",consumerCode:I})).then(function(e){q(e),J(!1)})}catch(e){return Promise.reject(e)}}()},[O,I]);const{isLoading:Q}=Digit.Hooks.ads.useADSSearch({tenantId:O,filters:{bookingNo:Y,audit:!0}},{enabled:!0}),{data:ee,isLoading:te}=Digit.Hooks.useRecieptSearch({tenantId:O,businessService:"adv-services",consumerCodes:I,isEmployee:!1},{enabled:!!I});let ne=[];if(ne=null==X?void 0:X.documents,j||Q)return l.createElement(t.Loader,null);let le=w("CS_NA");if(null!=$&&null!==(e=$.additionalDetails)&&void 0!==e&&e.documentDate){var ie;const e=new Date(null==$||null===(ie=$.additionalDetails)||void 0===ie?void 0:ie.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];le=e.getDate()+" "+t+" "+e.getFullYear()}let oe=[];ee&&(null==ee?void 0:ee.Payments.length)>0&&0==te&&oe.push({label:w("ADS_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,$e);try{var l;function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=null==W||null===(l=W.bookingApplication)||void 0===l?void 0:l[0],o=null==e?void 0:e.paymentReceiptFilestoreId;const a=function(){if(!o){let l={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"advservice-receipt")).then(function(t){var n;l=t;const i=u({},e,{paymentReceiptFilestoreId:null===(n=l)||void 0===n?void 0:n.filestoreIds[0]});return Promise.resolve(K.mutateAsync({bookingApplication:i})).then(function(){var e;o=null===(e=l)||void 0===e?void 0:e.filestoreIds[0],z()})})}}();return Promise.resolve(a&&a.then?a.then(i):i())}catch(e){return Promise.reject(e)}}({tenantId:null==ee||null===(e=ee.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ee?void 0:ee.Payments[0]})}}),ee&&(null==ee?void 0:ee.Payments.length)>0&&0==te&&oe.push({label:w("ADS_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;s(e,Ye);try{var n;function l(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:i})).then(function(e){window.open(e[i],"_blank")})}let e=null==W||null===(n=W.bookingApplication)||void 0===n?void 0:n[0],i=null==e?void 0:e.permissionLetterFilestoreId;const o=function(){if(!i)return Promise.resolve(Digit.PaymentService.generatePdf(t,{bookingApplication:[e]},"advpermissionletter")).then(function(t){const n=u({},e,{permissionLetterFilestoreId:null==t?void 0:t.filestoreIds[0]});return Promise.resolve(K.mutateAsync({bookingApplication:n})).then(function(){i=null==t?void 0:t.filestoreIds[0],z()})})}();return Promise.resolve(o&&o.then?o.then(l):l())}catch(e){return Promise.reject(e)}}({tenantId:null==ee||null===(e=ee.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ee?void 0:ee.Payments[0]})}});const ae=[{Header:""+w("ADS_TYPE"),accessor:"addType"},{Header:""+w("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+w("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+w("ADS_BOOKING_DATE"),accessor:"bookingDate"},{Header:""+w("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:"bookingStatus"}],re=(null==$||null===(a=$.cartDetails)||void 0===a?void 0:a.map(e=>({addType:""+w(e.addType),faceArea:""+w(e.faceArea),nightLight:""+w(!0===e.nightLight?"Yes":"No"),bookingDate:""+w(e.bookingDate),bookingStatus:""+w(e.status)})))||[];return 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"}},w("ADS_BOOKING_DETAILS")),oe&&oe.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>k(!R),displayOptions:R,options:oe})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("ADS_BOOKING_NO"),text:null==$?void 0:$.bookingNo})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("ADS_PAYMENT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("ADS_TOTAL_AMOUNT"),text:(null==V||null===(r=V.Bill)||void 0===r||null===(c=r[0])||void 0===c?void 0:c.totalAmount)>0?l.createElement("span",null,"₹ ",(null==V||null===(d=V.Bill)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.totalAmount)||w("CS_NA")," ",l.createElement("strong",{style:{color:"#a82227"}},"(",w("PENDING_PAYMENT"),")")):l.createElement("span",null,"₹ ",(null==ee||null===(v=ee.Payments)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.totalAmountPaid)||w("CS_NA")," ",l.createElement("strong",{style:{color:"green"}},"(",w("PAYMENT_PAID"),")"))})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("ADS_APPLICANT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("ADS_APPLICANT_NAME"),text:(null==$||null===(m=$.applicantDetail)||void 0===m?void 0:m.applicantName)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_MOBILE_NUMBER"),text:(null==$||null===(h=$.applicantDetail)||void 0===h?void 0:h.applicantMobileNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_ALT_MOBILE_NUMBER"),text:(null==$||null===(g=$.applicantDetail)||void 0===g?void 0:g.applicantAlternateMobileNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_EMAIL_ID"),text:(null==$||null===(y=$.applicantDetail)||void 0===y?void 0:y.applicantEmailId)||w("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("ADS_ADDRESS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:w("ADS_HOUSE_NO"),text:(null==$||null===(S=$.address)||void 0===S?void 0:S.houseNo)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_HOUSE_NAME"),text:(null==$||null===(_=$.address)||void 0===_?void 0:_.houseName)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_STREET_NAME"),text:(null==$||null===(b=$.address)||void 0===b?void 0:b.streetName)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_ADDRESS_LINE1"),text:(null==$||null===(A=$.address)||void 0===A?void 0:A.addressLine1)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_ADDRESS_LINE2"),text:(null==$||null===(D=$.address)||void 0===D?void 0:D.addressLine2)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_LANDMARK"),text:(null==$||null===(C=$.address)||void 0===C?void 0:C.landmark)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_CITY"),text:(null==$||null===(T=$.address)||void 0===T?void 0:T.city)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_LOCALITY"),text:(null==$||null===(x=$.address)||void 0===x?void 0:x.locality)||w("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:w("ADS_ADDRESS_PINCODE"),text:(null==$||null===(N=$.address)||void 0===N?void 0:N.pincode)||w("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("ADS_CART_DETAILS")),l.createElement(E,{t:w,data:re,columns:ae,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:re.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},w("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,ne.map((e,t)=>l.createElement(B,{value:ne,Code:null==e?void 0:e.documentType,index:t}))))))},ADSSearchApplication:G,ADSRequiredDoc:e=>{var n,i,o,a;let{t:r,onSelect:u,formData:s,value:c=s.adslist}=e;Digit.ULBService.getCurrentTenantId();const p=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:v,data:f={}}=Digit.Hooks.ads.useADSDocumentsMDMS(p,"Advertisement","Documents");let m=null==f||null===(n=f.Advertisement)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},l.createElement(t.CardHeader,null,r("MODULE_ADS")),l.createElement(t.CardSubHeader,null,l.createElement(k,{timerValues:null==c||null===(i=c.existingDataSet)||void 0===i||null===(o=i.timervalue)||void 0===o?void 0:o.timervalue,SlotSearchData:null==c?void 0:c.cartDetails,draftId:null==c||null===(a=c.existingDataSet)||void 0===a?void 0:a.draftId}))),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,r("ADS_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_UPLOAD_RESTRICTIONS_TYPES")),l.createElement(t.CardText,{className:"primaryColor"},r("ADS_UPLOAD_RESTRICTIONS_SIZE")),l.createElement("div",null,v&&l.createElement(t.Loader,null),Array.isArray(m)?m.map((e,n)=>{let{code:i,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",r("ADS_"+d(i,".","_"))),o.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",r("ADS_"+d(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:r("ADS_COMMON_NEXT"),onSubmit:u}))))}},zl=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:s}),Object.entries(Wl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement($,{path:r,url:u,userType:i}):l.createElement(f,null)},Kl=e=>{const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:o("ADVERTISEMENT_MODULE"),links:[],Icon:()=>l.createElement(x,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:zl,ADSLinks:Kl,ADSCard:W},exports.ADSLinks=Kl,exports.ADSModule=zl;