@mseva/upyog-ui-module-ads 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-query"),r=require("react-hook-form"),u=require("react-redux"),s=require("redux");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=[],m=()=>{var e,n,a,r,u,s;const{path:c,...d}=o.useRouteMatch(),m=(i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),v=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSMyApplications"),f=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=p)&&(h=[]),h.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:c+"/bookad",component:m}),l.createElement(t.PrivateRoute,{path:c+"/myBookings",component:v}),l.createElement(t.PrivateRoute,{path:c+"/application/:acknowledgementIds/:tenantId",component:f}))));var h},v=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e,t){return e(t={exports:{}},t.exports),t.exports}h(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:f,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),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},h=e.document,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 b(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!v(e)&&!f(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}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||v(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(b(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&&(b(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(b(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:m}),"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 _=function(e){var t,n,l,i,o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S="sizzle"+1*new Date,b=e.document,_=0,A=0,D=ue(),C=ue(),T=ue(),x=ue(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],L=I.pop,O=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},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+M+"*("+F+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+M+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(M+"+","g"),W=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),z=new RegExp("^"+M+"*,"+M+"*"),V=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),K=new RegExp(M+"|>"),$=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)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","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}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){P={apply:I.length?function(e,t){O.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,v,g,E=t&&t.ownerDocument,b=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return l;if(!i&&(p(t),t=t||m,f)){if(11!==b&&(d=Q.exec(e)))if(o=d[1]){if(9===b){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!==b||"object"!==t.nodeName.toLowerCase())){if(g=e,E=t,1===b&&(K.test(e)||V.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=(v=a(e)).length;r--;)v[r]=(c?"#"+c:":scope")+" "+ye(v[r]);g=v.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=m.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function me(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ve(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&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:b;return a!=m&&9===a.nodeType&&a.documentElement?(v=(m=a).documentElement,f=!o(m),b!=m&&(i=m.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return v.appendChild(e).appendChild(m.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(m.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(m.getElementsByClassName),n.getById=ce(function(e){return v.appendChild(e).id=S,!m.getElementsByName||!m.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&&f){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,l,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),l=0;o=i[l++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&l.push(n);return l}return o},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(m.querySelectorAll))&&(ce(function(e){var t;v.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+M+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=m.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),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=m.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(E=v.matches||v.webkitMatchesSelector||v.mozMatchesSelector||v.oMatchesSelector||v.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(v.compareDocumentPosition),y=t||J.test(v.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},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==m||e.ownerDocument==b&&y(b,e)?-1:t==m||t.ownerDocument==b&&y(b,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==m?-1:t==m?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)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]==b?-1:r[l]==b?1:0},m):m},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&f&&!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,m,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!=m&&p(e),y(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=m&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&w.call(l.attrHandle,t.toLowerCase())?i(e,t,!f):void 0;return void 0!==o?o:n.attributes||!f?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},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&&$.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("(^|"+M+")"+e+"("+M+"|$)"))&&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,m,v,f=o!==a?"nextSibling":"previousSibling",h=t.parentNode,g=r&&t.nodeName.toLowerCase(),E=!u&&!r,y=!1;if(h){if(o){for(;f;){for(p=t;p=p[f];)if(r?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;v=f="only"===e&&!v&&"nextSibling"}return!0}if(v=[a?h.firstChild:h.lastChild],a&&E){for(y=(m=(s=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&s[1])&&s[2],p=m&&h.childNodes[m];p=++m&&p&&p[f]||(y=m=0)||v.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[_,m,y];break}}else if(E&&(y=m=(s=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&s[1]),!1===y)for(;(p=++m&&p&&p[f]||(y=m=0)||v.pop())&&((r?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++y||(E&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[_,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=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===v},focus:function(e){return e===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=me(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=ve(t);function 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=[_,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]===_&&s[1]===r)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function be(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 _e(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=[],m=[],v=a.length,f=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?f:_e(f,p,e,r,u),g=n?i||(o?e:v||l)?[]:a:h;if(n&&n(h,g,r,u),l)for(s=_e(g,m),l(s,[],r,u),c=s.length;c--;)(d=s[c])&&(g[m[c]]=!(h[m[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=_e(g===a?g.splice(v,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(be(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&&be(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 be(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=V.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,v,h,g=0,E="0",y=o&&[],S=[],b=s,A=o||i&&l.find.TAG("*",c),D=_+=null==b?1:Math.random()||.1,C=A.length;for(c&&(s=a==m||a||c);E!==C&&null!=(d=A[E]);E++){if(i&&d){for(v=0,a||d.ownerDocument==m||(p(d),r=!f);h=e[v++];)if(h(d,a||m,r)){u.push(d);break}c&&(_=D)}n&&((d=!h&&d)&&g--,o&&y.push(d))}if(g+=E,n&&E!==g){for(v=0;h=t[v++];)h(y,S,a,r);if(o){if(g>0)for(;E--;)y[E]||S[E]||(S[E]=L.call(u));S=_e(S)}P.apply(u,S),c&&!o&&S.length>0&&g+t.length>1&&re.uniqueSort(u)}return c&&(_=D,s=b),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,m=!i&&a(e=p.selector||e);if(n=n||[],1===m.length){if((u=m[0]=m[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&f&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=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,m))(i,t,!f,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(m.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(B,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=_,S.expr=_.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=_.uniqueSort,S.text=_.getText,S.isXMLDoc=_.isXML,S.contains=_.contains,S.escapeSelector=_.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 v(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)v(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var L=/^(?:parents|prev(?:Until|All))/,O={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&&(O[e]||S.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var R=/[^\x20\t\r\n\f]+/g;function k(e){return e}function B(e){throw e}function M(e,t,n,l){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}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){v(l)?e.unique&&s.has(l)||o.push(l):l&&l.length&&"string"!==y(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return 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=v(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,l,i){var o=0;function 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");v(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,a(o,n,k,i),a(o,n,B,i)):(o++,s.call(e,a(o,n,k,i),a(o,n,B,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!==B&&(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,v(i)?i:k,e.notifyWith)),n[1][3].add(a(0,e,v(t)?t:k)),n[2][3].add(a(0,e,v(l)?l:B))}).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&&(M(e,a.done(r(n)).resolve,a.reject,!t),"pending"===a.state()||v(o[n]&&o[n].then)))return a.then();for(;n--;)M(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,v(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 V(e,t){return t.toUpperCase()}function K(e){return e.replace(W,"ms-").replace(z,V)}var $=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={},$(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,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),m.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",m.option=!!ce.lastChild;var fe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&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"))}fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td,m.option||(fe.optgroup=fe.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,a,r,u,s,c,d=t.createDocumentFragment(),p=[],m=0,v=e.length;m<v;m++)if((o=e[m])||0===o)if("object"===y(o))S.merge(p,o.nodeType?[o]:o);else if(Ee.test(o)){for(a=a||d.appendChild(t.createElement("div")),r=(me.exec(o)||["",""])[1].toLowerCase(),a.innerHTML=(u=fe[r]||fe._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="",m=0;o=p[m++];)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++];)ve.test(o.type||"")&&n.push(o);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function _e(){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=_e;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,be)}S.event={global:{},add:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,m,v,f,h=G.get(e);if($(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--;)m=f=(r=Se.exec(t[s])||[])[1],v=(r[2]||"").split(".").sort(),m&&(d=S.event.special[m]||{},d=S.event.special[m=(i?d.delegateType:d.bindType)||m]||{},c=S.extend({type:m,origType:f,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:v.join(".")},o),(p=u[m])||((p=u[m]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,v,a)||e.addEventListener&&e.addEventListener(m,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[m]=!0)},remove:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,m,v,f,h=G.hasData(e)&&G.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(R)||[""]).length;s--;)if(m=f=(r=Se.exec(t[s])||[])[1],v=(r[2]||"").split(".").sort(),m){for(d=S.event.special[m]||{},p=u[m=(l?d.delegateType:d.bindType)||m]||[],r=r[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&f!==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,v,h.handle)||S.removeEvent(e,m,h.handle),delete u[m])}else for(m in u)S.event.remove(e,m+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:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[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",be),!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?be:_e,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:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,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=_e),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 Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(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,f=p-1,h=t[0],g=v(h);if(g||p>1&&"string"==typeof h&&!m.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!==f&&(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,Le),d=0;d<u;d++)ve.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(!(m.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++)Oe(o[l],a[l]);else Oe(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($(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)&&!fe[(me.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 Be=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Me=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||Me(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||le(e)||(a=S.style(e,t)),!m.pixelBoxStyles()&&Be.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="",m.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(m,{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,Ve={};function Ke(e){return S.cssProps[e]||Ve[e]||(e in ze?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var $e=/^(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=Me(e),i=(!m.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(Be.test(a)){if(!n)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.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")),m.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!$e.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=Me(e),a=!m.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(m.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=Me(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 v(l.stop)&&(S._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return S.map(c,rt,s),v(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),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){v(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,m={},v=e.style,f=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===(f?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;f=!0}m[l]=h&&h[l]||S.style(e,l)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(m))for(l in d&&1===e.nodeType&&(n.overflow=[v.overflow,v.overflowX,v.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(){v.display=s}),null==s&&(s="none"===(c=v.display)?"":c)),v.display="inline-block")),n.overflow&&(v.overflow="hidden",p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]})),u=!1,m)u||(h?"hidden"in h&&(f=h.hidden):h=G.access(e,"fxshow",{display:s}),o&&(h.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),G.remove(e,"fxshow"),m)S.style(e,l,m[l])})),u=rt(f?h[l]:0,l,p),l in h||(h[l]=u.start,f&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),S.speed=function(e,t,n){var l=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(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(){v(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&<.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",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var st,ct=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(!m.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 mt(e){return(e.match(R)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(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"}}),m.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(v(e))return this.each(function(t){S(this).addClass(e.call(this,t,vt(this)))});if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(a=0;o=t[a++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(r=mt(l))&&n.setAttribute("class",r)}return this},removeClass:function(e){var t,n,l,i,o,a,r,u=0;if(v(e))return this.each(function(t){S(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(a=0;o=t[a++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(r=mt(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):v(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,i,o,a;if(l)for(i=0,o=S(this),a=ft(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(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&&(" "+mt(vt(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=v(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:mt(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}},m.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),m.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,m,g=[l||h],E=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(a=m=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&&!f(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();)m=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&&$(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)||!$(l)||s&&v(l[E])&&!f(l)&&((r=l[s])&&(l[s]=null),S.event.triggered=E,t.isPropagationStopped()&&m.addEventListener(E,Et),l[E](),t.isPropagationStopped()&&m.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)}}),m.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()},bt=/\?/;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 _t=/\[\]$/,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||_t.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=v(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,Lt=/^(?:GET|HEAD)$/,Ot=/^\/\//,Pt={},Rt={},kt="*/".concat("*"),Bt=h.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(R)||[];if(v(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function 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}Bt.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:Mt(Pt),ajaxTransport:Mt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,a,r,u,s,c,d,p,m=S.ajaxSetup({},n=n||{}),v=m.context||m,f=m.context&&(v.nodeType||v.jquery)?S(v):S.event,g=S.Deferred(),E=S.Callbacks("once memory"),y=m.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=_[e.toLowerCase()]=_[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==s&&(m.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),m.url=((t||m.url||yt.href)+"").replace(Ot,yt.protocol+"//"),m.type=n.method||n.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(R)||[""],null==m.crossDomain){u=h.createElement("a");try{u.href=m.url,u.href=u.href,m.crossDomain=Bt.protocol+"//"+Bt.host!=u.protocol+"//"+u.host}catch(e){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=S.param(m.data,m.traditional)),Ft(Pt,m,n,D),s)return D;for(d in(c=S.event&&m.global)&&0==S.active++&&S.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Lt.test(m.type),i=m.url.replace(Nt,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(xt,"+")):(p=m.url.slice(i.length),m.data&&(m.processData||"string"==typeof m.data)&&(i+=(bt.test(i)?"&":"?")+m.data,delete m.data),!1===m.cache&&(i=i.replace(wt,"$1"),p=(bt.test(i)?"&":"?")+"_="+St.guid+++p),m.url=i+p),m.ifModified&&(S.lastModified[i]&&D.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&D.setRequestHeader("If-None-Match",S.etag[i])),(m.data&&m.hasContent&&!1!==m.contentType||n.contentType)&&D.setRequestHeader("Content-Type",m.contentType),D.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+kt+"; q=0.01":""):m.accepts["*"]),m.headers)D.setRequestHeader(d,m.headers[d]);if(m.beforeSend&&(!1===m.beforeSend.call(v,D,m)||s))return D.abort();if(A="abort",E.add(m.complete),D.done(m.success),D.fail(m.error),l=Ft(Rt,m,n,D)){if(D.readyState=1,c&&f.trigger("ajaxSend",[D,m]),s)return D;m.async&&m.timeout>0&&(r=e.setTimeout(function(){D.abort("timeout")},m.timeout));try{s=!1,l.send(b,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&&(b=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]}(m,D,a)),!d&&S.inArray("script",m.dataTypes)>-1&&S.inArray("json",m.dataTypes)<0&&(m.converters["text script"]=function(){}),b=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}}(m,b,D,d),d?(m.ifModified&&((_=D.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=_),(_=D.getResponseHeader("etag"))&&(S.etag[i]=_)),204===t||"HEAD"===m.type?A="nocontent":304===t?A="notmodified":(A=b.state,p=b.data,d=!(h=b.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(v,[p,A,D]):g.rejectWith(v,[D,A,h]),D.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[D,m,d?p:h]),E.fireWith(v,[D,A]),c&&(f.trigger("ajaxComplete",[D,m]),--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 v(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]&&(v(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 v(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=v(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();m.cors=!!jt&&"withCredentials"in jt,m.ajax=jt=!!jt,S.ajaxTransport(function(t){var n,l;if(m.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=[],Vt=/(=)\?(?=&|$)|\?\?/;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&&(Vt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Vt,"$1"+i):!1!==t.jsonp&&(t.url+=(bt.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&&v(o)&&o(a[0]),a=o=void 0}),"script"}),m.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||(m.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=mt(e.slice(r)),e=e.slice(0,r)),v(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),v(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(f(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[l];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[l]=i},e,l,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=je(m.pixelPosition,function(e,n){if(n)return n=He(e,t),Be.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 f(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?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),v(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||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=v,S.isWindow=f,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 $t=e.jQuery,qt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=qt),t&&e.jQuery===S&&(e.jQuery=$t),S},void 0===t&&(e.jQuery=e.$=S),S})});const g=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:m,pageSizeLimit:v,sortParams:f,totalRecords:h}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:c,onPrevPage:d,pageSizeLimit:v,disableSort:u,isPaginationRequired:m,onPageSizeChange:p,onSort:s,sortParams:f,totalRecords:h})},E=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,m]=n.useState(!1),v=Digit.UserService.getUser().info,f=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(),m(!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==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:g,tenantId:s};n.useEffect(()=>{d(y)},[E]);const{isLoading:S,data:b}=Digit.Hooks.ads.useADSSearch({filters:c});if(S)return l.createElement(t.Loader,null);const _=(null==b?void 0:b.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,_.length>0&&_.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(f.mutateAsync(h)).then(function(t){var n,l,i,o,r,u,s,c,d,p,v;const f=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:f||0},draftId:(null==t?void 0:t.draftId)||""};a(h),m(!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===_.length&&!S&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("ADS_NO_APPLICATION_FOUND_MSG"))))},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)),b=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r,Searchdata:u}=e;const[s,c]=n.useState(!1),[d,p]=n.useState(!1),m=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),v=e=>s&&l.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),f=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:m,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(v,{t:i}),headerBarEnd:l.createElement(S,{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(E,{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(f.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)}}})))))},A=()=>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"})),D=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(A,null)),C=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(D,{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(g,{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)))},T=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 x(){return(x=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 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"})),L=e=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(I,null))},O=()=>{var e,o,a,r,u,s,c,d,p,m,v,f,h,E,y;const[S,b]=n.useState(!1),[_,A]=n.useState(!1),{t:D}=i.useTranslation(),[C,T]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),x=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[N,w]=n.useState(!1),[I,O]=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),w(!0));const B=()=>{A(e=>!e)},M=()=>{O(!I)},F=()=>{b(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: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==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:M,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(L,{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}),_&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(L,{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(g,{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})),I&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:l.createElement(L,{onClick:M}),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===(m=k.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.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===(f=k.data)||void 0===f||null===(h=f.demands[0])||void 0===h?void 0:h.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:I,onClose:M}));var H};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,m]=n.useState(!1),v=Digit.Hooks.ads.useADSSlotSearch(),f={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(v.mutateAsync(f)).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)}}(),m(!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 B(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:c,formData:d,id:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.UserService.getUser().info,[f,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.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==m?void 0:m.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!=f&&f.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y}]})},[y,f]),n.useEffect(()=>{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=R(function(){return P(function(){return S(null),_(!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(_(!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:f,style:{width:"EMPLOYEE"===v.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:b?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 M(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 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(T,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")),V=()=>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"})),K=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(V,null)),$=e=>{let{t:i,closeModal:o,actionCancelLabel:a,actionCancelOnSubmit:u,actionSaveLabel:s,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,m]=n.useState(!1),{handleSubmit:v}=r.useForm();return l.createElement(t.Modal,{headerBarMain:l.createElement(z,{t:i}),headerBarEnd:l.createElement(K,{onClick:o}),actionCancelLabel:i(a),actionCancelOnSubmit:u,actionSaveLabel:i(s),actionSaveOnSubmit:v(c),isDisabled:!p,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("form",{onSubmit:v(d)},l.createElement(t.CheckBox,{label:i("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{m(!p)},style:{height:"auto"}}))))},q=e=>{var i,a;let{tenantId:u,isLoading:s,t:c,onSubmit:d,data:p,count:m,setShowToast:v}=e;const f=window.Digit.Utils.browser.isMobile(),{register:h,control:g,handleSubmit:E,setValue:y,getValues:S,reset:b,formState:_}=r.useForm({defaultValues:{offset:0,limit:!f&&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)}},O=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 m=null==i?void 0:i.original;const f=Digit.Hooks.ads.useADSSlotSearch();let h={advertisementSlotSearchCriteria:null==m?void 0:m.cartDetails.map(e=>({bookingId:null==m?void 0:m.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==m?void 0:m.bookingStatus)||"EXPIRED"===(null==m?void 0:m.bookingStatus)}),a&&l.createElement("div",{style:{position:"absolute",backgroundColor:"white",border:"1px solid #ccc",borderRadius:"4px",padding:"8px",zIndex:1e3}},"BOOKED"===(null==m?void 0:m.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==m?void 0:m.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==m?void 0:m.bookingId,tenantId:u,cartDetails:null==m?void 0:m.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/employee/payment/collect/adv-services/"+(null==m?void 0:m.bookingNo),state:{tenantId:null==m?void 0:m.tenantId,bookingNo:null==m?void 0:m.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:{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 B(){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==_||null===(i=_.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:()=>{b({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),B()}},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:m,columns:O,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:B,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}))},G=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:m,isSuccess:v,data:{bookingApplication:f,Count:h}={}}=Digit.Hooks.ads.useADSSearch({tenantId:r,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(q,{t:a,isLoading:m,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:v&&!m?f.length>0?f:{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)}}))},Y=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"),m=window.location.href.includes("ads/response"),v=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"},m?null:l.createElement("div",{style:v?{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(G,x({},e,{parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/applicationsearch/application-details/:id",component:()=>l.createElement(p,{parentRoute:s})})))))},X=e=>{var a;let{application:r,tenantId:u,buttonLabel:s}=e;const{t:c}=i.useTranslation(),d=o.useHistory(),[p,m]=n.useState(null),v=Digit.Hooks.ads.useADSSlotSearch();let f={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(()=>{m(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(v.mutateAsync(f)).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?m({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(){m({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:()=>{m(null)}}))};var Z,J=Array.isArray,Q="object"==typeof f&&f&&f.Object===Object&&f,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)\]/,me=/^\w*$/,ve=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},fe=function(e){if(!ve(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\]$/,be=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ve(e)||(t=e,ge&&ge in t))&&(fe(e)?be:Se).test(ye(e));var t}(n)?n:void 0},Ae=_e(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 Le(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])}}Le.prototype.clear=function(){this.__data__=[],this.size=0},Le.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))},Le.prototype.get=function(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]},Le.prototype.has=function(e){return we(this.__data__,e)>-1},Le.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 Oe=Le,Pe=_e(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||Oe),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 Be=ke;function Me(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(Me.Cache||Be),n}Me.Cache=Be;var Fe,Ue,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,je=/\\(\\)?/g,We=(Fe=Me(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,Ve=ze?ze.toString:void 0,Ke=function(e){if("string"==typeof e||de(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 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))||me.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 Ve?Ve.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[Ke(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},qe=h(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]",m="[object Number]",v="[object Object]",h="[object RegExp]",g="[object Set]",E="[object String]",y="[object Symbol]",S="[object WeakMap]",b="[object ArrayBuffer]",_="[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]",L=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,B=RegExp(R.source),M=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,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),$=/^\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+"]",me="["+ce+"]",ve="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",_e="(?:"+fe+"|"+he+")",Ae="(?:"+be+"|"+he+")",De="(?:"+me+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,ye,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",ye,Se].join("|")+")"+Ce,xe="(?:"+[Ee+me+"?",me,ye,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(me,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Le=RegExp([be+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+_e,"$"].join("|")+")",be+"?"+_e+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Te].join("|"),"g"),Oe=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,Be={};Be[A]=Be[D]=Be[C]=Be[T]=Be[x]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[o]=Be[a]=Be[b]=Be[r]=Be[_]=Be[u]=Be[s]=Be[c]=Be[p]=Be[m]=Be[v]=Be[h]=Be[g]=Be[E]=Be[S]=!1;var Me={};Me[o]=Me[a]=Me[b]=Me[_]=Me[r]=Me[u]=Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me[p]=Me[m]=Me[v]=Me[h]=Me[g]=Me[E]=Me[y]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[s]=Me[c]=Me[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof f&&f&&f.Object===Object&&f,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,$e=Ke&&Ke.exports===Ve,qe=$e&&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)&>(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var vt=bt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function 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 bt(e){return function(t){return null==t?void 0:t[e]}}function _t(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,Vt(e)+1).replace($,""):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&>(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=_t({"À":"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=_t({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Fe[e]}function Bt(e){return Oe.test(e)}function Mt(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 Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):vt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=_t({"&":"&","<":"<",">":">",""":'"',"'":"'"}),$t=function e(t){var f=(t=null==t?ze:$t.defaults(ze.Object(),t,$t.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,pe=t.Math,me=t.Object,ve=t.RegExp,fe=t.String,he=t.TypeError,ge=f.prototype,Ee=me.prototype,ye=t["__core-js_shared__"],Se=de.prototype.toString,be=Ee.hasOwnProperty,_e=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(me),Te=ze._,xe=ve("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=$e?t.Buffer:void 0,Oe=t.Symbol,Fe=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,We=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,qe=ge.splice,Ge=Oe?Oe.isConcatSpreadable:void 0,vt=Oe?Oe.iterator:void 0,_t=Oe?Oe.toStringTag:void 0,qt=function(){try{var e=Zi(me,"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=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ft(me.keys,me),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"),mn=Zi(t,"Promise"),vn=Zi(t,"Set"),fn=Zi(t,"WeakMap"),hn=Zi(me,"create"),gn=fn&&new fn,En={},yn=Co(dn),Sn=Co(pn),bn=Co(mn),_n=Co(vn),An=Co(fn),Dn=Oe?Oe.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,Tn=Dn?Dn.toString:void 0;function xn(e){if(Wa(e)&&!La(e)&&!(e instanceof Ln)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return To(e)}return new In(e)}var Nn=function(){function e(){}return function(t){if(!ja(t))return{};if(Ve)return Ve(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 Ln(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 Bn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=La(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,fe):[],u=r.length;for(var s in e)!t&&!be.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 _o(fi(e),Gn(t,0,e.length))}function Hn(e){return _o(fi(e))}function jn(e,t,n){(void 0!==n&&!xa(e[t],n)||void 0===n&&!(t in e))&&$n(e,t,n)}function Wn(e,t,n){var l=e[t];be.call(e,t)&&xa(l,n)&&(void 0!==n||t in e)||$n(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(xa(e[n][0],t))return n;return-1}function Vn(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 $n(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=f(l),o=null==e;++n<l;)i[n]=o?void 0:mr(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,f=1&t,S=2&t,L=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!ja(e))return e;var O=La(e);if(O){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!f)return fi(e,s)}else{var P=eo(e),R=P==c||P==d;if(ka(e))return si(e,f);if(P==v||P==o||R&&!i){if(s=S||R?{}:no(e),!f)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(!Me[P])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case b:return ci(e);case r:case u:return new l(+e);case _: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 m: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?me(Cn.call(e)):{}}}(e,P,f)}}a||(a=new Bn);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 B=O?void 0:(L?S?Vi:zi:S?yr:Er)(e);return lt(B||e,function(l,i){B&&(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=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function 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,(Ln.prototype=Nn(wn.prototype)).constructor=Ln,On.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:be.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=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 On,map:new(pn||Pn),string:new On}},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)},Bn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.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 La(e)?l:ct(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_t&&_t in me(e)?function(e){var t=be.call(e,_t),n=e[_t];try{e[_t]=void 0;var l=!0}catch(e){}var i=De.call(e);return l&&(t?e[_t]=n:delete e[_t]),i}(e):function(e){return De.call(e)}(e)}function ml(e,t){return e>t}function vl(e,t){return null!=e&&be.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function hl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=f(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 m=c[d],v=t?t(m):m;if(m=n||0!==m?m:0,!(p?wt(p,v):l(s,v,n))){for(a=o;--a;){var h=r[a];if(!(h?wt(h,v):l(e[a],v,n)))continue e}p&&p.push(v),s.push(m)}}return s}function gl(e,t,n){var l=null==(e=vo(e,t=oi(t,e)))?e:e[Do(Mo(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=La(e),f=La(t),S=d?a:eo(e),A=f?a:eo(t),D=(S=S==o?v:S)==v,C=(A=A==o?v:A)==v,T=S==A;if(T&&ka(e)){if(!ka(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Bn),d||Xa(e)?ji(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case m: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=Mt;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&&be.call(e,"__wrapped__"),N=C&&be.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Bn),i(w,I,n,l,c)}}return!!T&&(c||(c=new Bn),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:be.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++s<u;){var f=e[c=r[s]],h=t[c];if(l)var g=a?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===g?f===h||i(f,h,n,l,o):g)){m=!1;break}v||(v="constructor"==c)}if(m&&!v){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||(m=!1)}return o.delete(e),o.delete(t),m}(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=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Bn;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 bl(e){return!(!ja(e)||(t=e,Ae&&Ae in t))&&(Fa(e)?xe:ie).test(Co(e));var t}function _l(e){return"function"==typeof e?e:null==e?Vr:"object"==typeof e?La(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 me(e))be.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)?f(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=mr(n,e);return void 0===l&&l===t?vr(n,e):yl(t,l,3)}}function Nl(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Bn),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=La(u),m=!p&&ka(u),v=!p&&!m&&Xa(u);c=u,p||m||v?La(r)?c=r:Ra(r)?c=fi(r):m?(d=!1,c=si(u,!0)):v?(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 La(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Vr];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 Ll(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 Ol(e,t,n,l){var i=l?Et:gt,o=-1,a=t.length,r=e;for(e===t&&(t=fi(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 Bl(e,t){return yo(mo(e,t,Vr),e+"")}function Ml(e){return Fn(xr(e))}function Fl(e,t){var n=xr(e);return _o(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}:Vr,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:Vr;function Wl(e){return _o(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=f(i);++l<i;)o[l]=e[l+t];return o}function Vl(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 $l(e,t,Vr,n)}function $l(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,m=null===d,v=d==d,f=Ya(d);if(a)var h=l||v;else h=s?v&&(l||p):r?v&&p&&(l||!m):u?v&&p&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function 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(La(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=vo(e,t=oi(t,e)))||delete e[Do(Mo(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 Ln&&(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=f(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:Vr}function oi(e,t){return La(e)?e:ao(e,t)?[e]:Ao(or(e))}var ai=Bl;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 mi(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=f(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 vi(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=f(c+s),p=!l;++i<c;)d[i]=e[i];for(var m=i;++u<s;)d[m+u]=t[u];for(;++a<r;)(p||i<o)&&(d[m+n[a]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=f(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?$n(n,r,u):Wn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=La(n)?nt:Vn,o=t?t():{};return i(n,e,Gi(l,2),o)}}function Ei(e){return Bl(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=me(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=me(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=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Bt(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 _i(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=me(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"==$i(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=$i(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[$i(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&&La(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,m=24&t,v=512&t,h=p?void 0:Ai(e);return function g(){for(var E=arguments.length,y=f(E),S=E;S--;)y[S]=arguments[S];if(m)var b=qi(g),_=Ot(y,b);if(l&&(y=mi(y,l,i,m)),o&&(y=vi(y,o,a,m)),E-=_,m&&E<s){var A=Ut(y,b);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=fo(y,r):v&&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())),Bl(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 Bt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function Li(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=f(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 Oi(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=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Yr;function Bi(e){return function(t){var n=eo(t);return n==p?Mt(t):n==g?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(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,m=a;o=a=void 0}var v=c?void 0:Ki(e),h=[e,t,i,o,a,p,m,r,u,s];if(v&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?vi(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,v),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=f(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=f(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((v?Hl:go)(g,h),e,t)}function Fi(e,t,n,l){return void 0===e||xa(e,Ee[n])&&!be.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,m=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var v=e[d],f=t[d];if(l)var h=a?l(f,v,d,t,e,o):l(v,f,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(m){if(!mt(t,function(e,t){if(!wt(m,t)&&(v===e||i(v,e,n,l,o)))return m.push(t)})){p=!1;break}}else if(v!==f&&!i(v,f,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function Wi(e){return yo(mo(e,void 0,Oo),e+"")}function zi(e){return dl(e,Er,Ji)}function Vi(e){return dl(e,yr,Qi)}var Ki=gn?function(e){return gn.get(e)}:Yr;function $i(e){for(var t=e.name+"",n=En[t],l=be.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(be.call(xn,"placeholder")?xn:e).placeholder}function Gi(){var e=xn.iteratee||Kr;return e=e===Kr?_l: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 bl(n)?n:void 0}var Ji=Qt?function(e){return null==e?[]:(e=me(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)&&(La(e)||Ia(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:Nn(We(e))}function lo(e){return La(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(La(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 me(t)}function ro(e){var t=$i(e),n=xn[t];if("function"!=typeof n||!(t in Ln.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=_||pn&&eo(new pn)!=p||mn&&"[object Promise]"!=eo(mn.resolve())||vn&&eo(new vn)!=g||fn&&eo(new fn)!=S)&&(eo=function(e){var t=pl(e),n=t==v?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case yn:return _;case Sn:return p;case bn:return"[object Promise]";case _n: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 me(n))}}function mo(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=f(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=f(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function vo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(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=bo(Hl),Eo=Xt||function(e,t){return ze.setTimeout(e,t)},yo=bo(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 bo(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 _o(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=ba(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 Ln)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var xo=Bl(function(e,t){return Ra(e)?Jn(e,il(t,1,Ra,!0)):[]}),No=Bl(function(e,t){var n=Mo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),Gi(n,2)):[]}),wo=Bl(function(e,t){var n=Mo(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 Lo(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 Oo(e){return null!=e&&e.length?il(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Bl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),ko=Bl(function(e){var t=Mo(e),n=st(e,li);return t===Mo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Gi(t,2)):[]}),Bo=Bl(function(e){var t=Mo(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 Mo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fo=Bl(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Ol(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=Bl(function(e){return Xl(il(e,1,Ra,!0))}),zo=Bl(function(e){var t=Mo(e);return Ra(t)&&(t=void 0),Xl(il(e,1,Ra,!0),Gi(t,2))}),Vo=Bl(function(e){var t=Mo(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,bt(t))})}function $o(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var qo=Bl(function(e,t){return Ra(e)?Jn(e,t):[]}),Go=Bl(function(e){return ti(at(e,Ra))}),Yo=Bl(function(e){var t=Mo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),Gi(t,2))}),Xo=Bl(function(e){var t=Mo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Zo=Bl(Ko),Jo=Bl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$o(e,n)});function 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 Ln&&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){be.call(e,n)?++e[n]:$n(e,n,1)}),la=Di(Io),ia=Di(Lo);function oa(e,t){return(La(e)?lt:Qn)(e,Gi(t,3))}function aa(e,t){return(La(e)?it:el)(e,Gi(t,3))}var ra=gi(function(e,t,n){be.call(e,n)?e[n].push(t):$n(e,n,[t])}),ua=Bl(function(e,t,n){var l=-1,i="function"==typeof t,o=Pa(e)?f(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){$n(e,n,t)});function ca(e,t){return(La(e)?st:Cl)(e,Gi(t,3))}var da=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Bl(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),[])}),ma=Yt||function(){return ze.Date.now()};function va(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fa(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=Bl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(ha));l|=32}return Mi(e,l,t,n,i)}),ga=Bl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(ga));l|=32}return Mi(t,l,e,n,i)});function Ea(e,t,l){var i,o,a,r,u,s,c=0,d=!1,p=!1,m=!0;if("function"!=typeof e)throw new he(n);function v(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function f(e){return c=e,u=Eo(g,t),d?v(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=ma();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,m&&i?v(e):(i=o=void 0,r)}function y(){var e=ma(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return ui(u),u=Eo(g,t),v(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,m="trailing"in l?!!l.trailing:m),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(ma())},y}var ya=Bl(function(e,t){return Zn(e,1,t)}),Sa=Bl(function(e,t,n){return Zn(e,lr(t)||0,n)});function ba(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(ba.Cache||Rn),l}function _a(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)}}ba.Cache=Rn;var Aa=ai(function(e,t){var n=(t=1==t.length&&La(t[0])?st(t[0],xt(Gi())):st(il(t,1),xt(Gi()))).length;return Bl(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=Bl(function(e,t){return Mi(e,32,void 0,t,Ut(t,qi(Da)))}),Ca=Bl(function(e,t){return Mi(e,64,void 0,t,Ut(t,qi(Ca)))}),Ta=Wi(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function xa(e,t){return e===t||e!=e&&t!=t}var Na=Oi(ml),wa=Oi(function(e,t){return e>=t}),Ia=El(function(){return arguments}())?El:function(e){return Wa(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},La=f.isArray,Oa=Ye?xt(Ye):function(e){return Wa(e)&&pl(e)==b};function Pa(e){return null!=e&&Ha(e.length)&&!Fa(e)}function Ra(e){return Wa(e)&&Pa(e)}var ka=en||lu,Ba=Xe?xt(Xe):function(e){return Wa(e)&&pl(e)==u};function Ma(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 Va(e){return"number"==typeof e||Wa(e)&&pl(e)==m}function Ka(e){if(!Wa(e)||pl(e)!=v)return!1;var t=We(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var $a=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||!La(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)&&!!Be[pl(e)]},Za=Oi(Dl),Ja=Oi(function(e,t){return e<=t});function Qa(e){if(!e)return[];if(Pa(e))return Ga(e)?zt(e):fi(e);if(vt&&e[vt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[vt]());var t=eo(e);return(t==p?Mt: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)be.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=Bl(function(e,t){e=me(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])&&!be.call(e,s))&&(e[s]=o[s])}return e}),pr=Bl(function(e){return e.push(void 0,Ui),tt(br,void 0,e)});function mr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function vr(e,t){return null!=e&&to(e,t,fl)}var fr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},jr(Vr)),hr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Gi),gr=Bl(gl);function Er(e){return Pa(e)?Mn(e):Al(e)}function yr(e){return Pa(e)?Mn(e,!0):function(e){if(!ja(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Sr=Ei(function(e,t,n){Nl(e,t,n)}),br=Ei(function(e,t,n,l){Nl(e,t,n,l)}),_r=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,Vi(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 Ll(e,t,function(t,n){return vr(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Gi(t),Ll(e,n,function(e,n){return t(e,n[0])})}var Cr=Bi(Er),Tr=Bi(yr);function xr(e){return null==e?[]:Nt(e,Er(e))}var Nr=_i(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return Mr(or(e).toLowerCase())}function Ir(e){return(e=or(e))&&e.replace(re,Pt).replace(we,"")}var Lr=_i(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Or=_i(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Pr=bi("toLowerCase"),Rr=_i(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kr=_i(function(e,t,n){return e+(n?" ":"")+Mr(t)}),Br=_i(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Mr=bi("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(Le)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ur=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ma(e)?e:new ce(e)}}),Hr=Wi(function(e,t){return lt(t,function(t){t=Do(t),$n(e,t,ha(e[t],e))}),e});function jr(e){return function(){return e}}var Wr=Ci(),zr=Ci(!0);function Vr(e){return e}function Kr(e){return _l("function"==typeof e?e:Yn(e,1))}var $r=Bl(function(e,t){return function(n){return gl(n,e,t)}}),qr=Bl(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__=fi(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(mt);function Qr(e){return ao(e)?bt(Do(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=Li(),tu=Li(!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=va,xn.assign=ar,xn.assignIn=rr,xn.assignInWith=ur,xn.assignWith=sr,xn.at=cr,xn.before=fa,xn.bind=ha,xn.bindAll=Hr,xn.bindKey=ga,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(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=f(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=f(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(La(n)?fi(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]]}):[],Bl(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=Mi(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=Mi(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(La(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=Oo,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 Mi(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=Bo,xn.invert=fr,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){$n(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){$n(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=ba,xn.merge=Sr,xn.mergeWith=br,xn.method=$r,xn.methodOf=qr,xn.mixin=Gr,xn.negate=_a,xn.nthArg=function(e){return e=tr(e),Bl(function(t){return wl(t,e)})},xn.omit=_r,xn.omitBy=function(e,t){return Dr(e,_a(Gi(t)))},xn.once=function(e){return fa(2,e)},xn.orderBy=function(e,t,n,l){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(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?Ol(e,t,Gi(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,void 0,n):e},xn.pullAt=Ho,xn.range=eu,xn.rangeRight=tu,xn.rearg=Ta,xn.reject=function(e,t){return(La(e)?at:ll)(e,_a(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 Bl(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),(La(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(La(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&&!$a(t))&&!(t=Yl(t))&&Bt(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),Bl(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 La(e)?st(e,Do):Ya(e)?[e]:fi(Ao(or(e)))},xn.toPlainObject=ir,xn.transform=function(e,t,n){var l=La(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 va(e,1)},xn.union=Wo,xn.unionBy=zo,xn.unionWith=Vo,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=$o,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))&&M.test(e)?e.replace(k,Rt):e},xn.escapeRegExp=function(e){return(e=or(e))&&K.test(e)?e.replace(V,"\\$&"):e},xn.every=function(e,t,n){var l=La(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 ft(e,Gi(t,3),rl)},xn.findLast=ia,xn.findLastIndex=Lo,xn.findLastKey=function(e,t){return ft(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=mr,xn.gt=Na,xn.gte=wa,xn.has=function(e,t){return null!=e&&to(e,t,vl)},xn.hasIn=vr,xn.head=Po,xn.identity=Vr,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&>(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=La,xn.isArrayBuffer=Oa,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=Ba,xn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ka(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(La(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(be.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=Ma,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 Va(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 bl(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Va,xn.isObject=ja,xn.isObjectLike=Wa,xn.isPlainObject=Ka,xn.isRegExp=$a,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=Lr,xn.last=Mo,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=Or,xn.lowerFirst=Pr,xn.lt=Za,xn.lte=Ja,xn.max=function(e){return e&&e.length?nl(e,Vr,ml):void 0},xn.maxBy=function(e,t){return e&&e.length?nl(e,Gi(t,2),ml):void 0},xn.mean=function(e){return St(e,Vr)},xn.meanBy=function(e,t){return St(e,Gi(t,2))},xn.min=function(e){return e&&e.length?nl(e,Vr,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=ma,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($,""),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=La(e)?dt:At,i=arguments.length<3;return l(e,Gi(t,4),n,i,Qn)},xn.reduceRight=function(e,t,n){var l=La(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(La(e)?Fn:Ml)(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=La(e)?mt:Vl;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 $l(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 $l(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,Vr):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=ve((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,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 v=be.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(L,""):d).replace(O,"$1").replace(P,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Ur(function(){return de(r,m+"return "+d).apply(void 0,u)});if(f.source=d,Ma(f))throw f;return f},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),Lt(l,i)+1).join("")},xn.trimEnd=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Yl(t)))return e;var l=zt(e);return ri(l,0,Lt(l,zt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.replace($,"");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(Bt(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),$a(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=ve(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))&&B.test(e)?e.replace(R,Kt):e},xn.uniqueId=function(e){var t=++_e;return or(e)+t},xn.upperCase=Br,xn.upperFirst=Mr,xn.each=oa,xn.eachRight=aa,xn.first=Po,Gr(xn,(iu={},rl(xn,function(e,t){be.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){Ln.prototype[e]=function(n){n=void 0===n?1:on(tr(n),0);var l=this.__filtered__&&!t?new Ln(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},Ln.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;Ln.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":"");Ln.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Ln.prototype[e]=function(){return this.__filtered__?new Ln(this):this[n](1)}}),Ln.prototype.compact=function(){return this.filter(Vr)},Ln.prototype.find=function(e){return this.filter(e).head()},Ln.prototype.findLast=function(e){return this.reverse().find(e)},Ln.prototype.invokeMap=Bl(function(e,t){return"function"==typeof e?new Ln(this):this.map(function(n){return gl(n,e,t)})}),Ln.prototype.reject=function(e){return this.filter(_a(Gi(e)))},Ln.prototype.slice=function(e,t){e=tr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ln(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)},Ln.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295)},rl(Ln.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 Ln,u=a[0],s=r||La(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,m=o&&!d,v=r&&!p;if(!o&&s){t=v?t:new Ln(this);var f=e.apply(t,a);return f.__actions__.push({func:ea,args:[c],thisArg:void 0}),new In(f,d)}return m&&v?e.apply(this,a):(f=this.thru(c),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),rl(Ln.prototype,function(e,t){var n=xn[t];if(n){var l=n.name+"";be.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Ln.prototype.clone=function(){var e=new Ln(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},Ln.prototype.reverse=function(){if(this.__filtered__){var e=new Ln(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ln.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(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,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var v=[];e:for(;u--&&p<m;){for(var f=-1,h=e[s+=t];++f<d;){var g=c[f],E=g.type,y=(0,g.iteratee)(h);if(2==E)h=y;else if(!y){if(1==E)continue e;break e}}v[p++]=h}return v},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 Ln){var t=e;return this.__actions__.length&&(t=new Ln(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,vt&&(xn.prototype[vt]=function(){return this}),xn}();Ke?((Ke.exports=$t)._=$t,Ve._=$t):ze._=$t}).call(f)});const Ge=e=>l.createElement("h1",{className:"heading-m"},e.label),Ye=()=>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"})),Xe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ye,null)),Ze=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=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)}),{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,b]=n.useState({}),[_,A]=n.useState([]),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState(null),[O,R]=n.useState([]),[k,B]=n.useState(null),[M,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==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{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:O,selectedFinancialYear:k,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:m}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option: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:_,selectedApprover:D,setSelectedApprover:C,selectFile:U,uploadedFile:N,setUploadedFile:w,businessService:p}))},[r,_,O,k,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ge,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Xe,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:f||(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:m};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)},Je=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"})),et=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qe,null)),tt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data: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:v,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,b]=n.useState([]),[_,A]=n.useState({}),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState([]),[O,R]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&L(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){C(e.target.files[0])}return n.useEffect(()=>{if(m&&k){var e;const t=k["common-masters"].Department;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,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}`}}))}},[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("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:_,setSelectedApprover:A,selectFile:B,uploadedFile:T,setUploadedFile:x,businessService:p}))},[r,S,I,O,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Je,{label:a(h.label.heading)}),headerBarEnd:l.createElement(et,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},v?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!=_&&_.uuid?[null==_?void 0:_.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)},nt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),lt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),it=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(lt,null)),ot=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:m,isLoading: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)}),[f,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==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{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=P(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,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select: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:b,setSelectedApprover:_,selectFile:I,uploadedFile:C,setUploadedFile:T,businessService:p,error:x}))},[r,y,C,x]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nt,{label:a(f.label.heading)}),headerBarEnd:l.createElement(it,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.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"}:{}},v?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==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: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)},at=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ut=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rt,null)),st=e=>{var i,o,r,u,s,c,d,p,m,v,f,h;let{t:g,action:E,tenantId:y,closeModal:S,submitAction:b,applicationDetails:_,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===(m=p.nextActions)||void 0===m||null===(v=m.filter(e=>(null==e?void 0:e.action)==(null==E?void 0:E.action)))||void 0===v||null===(f=v[0])||void 0===f||null===(h=f.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,O]=n.useState({}),[R,k]=n.useState([]),[B,M]=n.useState([]),[F,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[V,K]=n.useState(null),[$,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=P(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(()=>{M(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:m,setSelectedApprover:v,selectedBlockReason:f,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:y,assigneeLabel:S,businessService:b,error:_,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_${b}_${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:v,selected:m})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{y(null)},message:E?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:_})}]}]}})({t:g,action:E,approvers:R,selectedApprover:F,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:V,setUploadedFile:K,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:$,blockReasonFiltered:B}))},[E,R,G,V,$]),E&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:g(w.label.heading)}),headerBarEnd:l.createElement(ut,{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,m,v,f,h,D,T,x,N,w,I,L,O,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===(m=p.processInstances)||void 0===m||null===(v=m[0])||void 0===v||null===(f=v.state)||void 0===f?void 0:f.applicationStatus)?[null==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:V?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]: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===(L=I.state)||void 0===L?void 0:L.applicationStatus)?[null==C||null===(O=C.data)||void 0===O||null===(P=O.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:V?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null};const B=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,m,v;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==_||null===(p=_.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(v=m.Noc)||void 0===v?void 0:v.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,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,m,v,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(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===(m=p.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(v=e.Noc)||void 0===v?void 0:v.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==A.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({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 b({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(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},ct=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),dt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(dt,null)),mt=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[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 O(e){T(e.target.files[0])}return o.useHistory(),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{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=P(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:m,error:v}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:u,action:s,approvers:b,selectedApprover:A,setSelectedApprover:D,selectFile:O,uploadedFile:x,setUploadedFile:N,businessService:v,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[s,b,x,w]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ct,{label:u(g.label.heading)}),headerBarEnd:l.createElement(pt,{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=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=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:m},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};function vt(e){var t=this.__data__=new Oe(e);this.size=t.size}vt.prototype.clear=function(){this.__data__=new Oe,this.size=0},vt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},vt.prototype.get=function(e){return this.__data__.get(e)},vt.prototype.has=function(e){return this.__data__.has(e)},vt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Oe){var l=n.__data__;if(!Pe||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Be(l)}return n.set(e,t),this.size=n.size,this};var ft=vt,ht=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),gt=function(e,t,n){"__proto__"==t&&ht?ht(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Et=Object.prototype.hasOwnProperty,yt=function(e,t,n){var l=e[t];Et.call(e,t)&&Ne(l,n)&&(void 0!==n||t in e)||gt(e,t,n)},St=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?gt(n,r,u):yt(n,r,u)}return n},bt=function(e){return ce(e)&&"[object Arguments]"==se(e)},_t=Object.prototype,At=_t.hasOwnProperty,Dt=_t.propertyIsEnumerable,Ct=bt(function(){return arguments}())?bt:function(e){return ce(e)&&At.call(e,"callee")&&!Dt.call(e,"callee")},Tt=function(){return!1},xt=h(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)||Tt}),Nt=/^(?:0|[1-9]\d*)$/,wt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Nt.test(e))&&e>-1&&e%1==0&&e<t},It=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var Ot=function(e){return function(t){return e(t)}},Pt=h(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}),Rt=Pt&&Pt.isTypedArray,kt=Rt?Ot(Rt):function(e){return ce(e)&&It(e.length)&&!!Lt[se(e)]},Bt=Object.prototype.hasOwnProperty,Mt=function(e,t){var n=J(e),l=!n&&Ct(e),i=!n&&!l&&xt(e),o=!n&&!l&&!i&&kt(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&&!Bt.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wt(s,u))||r.push(s);return r},Ft=Object.prototype,Ut=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ft)},Ht=function(e,t){return function(n){return e(t(n))}},jt=Ht(Object.keys,Object),Wt=Object.prototype.hasOwnProperty,zt=function(e){return null!=e&&It(e.length)&&!fe(e)},Vt=function(e){return zt(e)?Mt(e):function(e){if(!Ut(e))return jt(e);var t=[];for(var n in Object(e))Wt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Kt=Object.prototype.hasOwnProperty,$t=function(e){return zt(e)?Mt(e,!0):function(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ut(e),n=[];for(var l in e)("constructor"!=l||!t&&Kt.call(e,l))&&n.push(l);return n}(e)},qt=h(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}}),Gt=function(){return[]},Yt=Object.prototype.propertyIsEnumerable,Xt=Object.getOwnPropertySymbols,Zt=Xt?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];Yt.call(e,r)&&(a[o++]=r)}return a}(Xt(e)))}:Gt,Jt=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Qt=Ht(Object.getPrototypeOf,Object),en=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Jt(t,Zt(e)),e=Qt(e);return t}:Gt,tn=function(e,t,n){var l=t(e);return J(e)?l:Jt(l,n(e))},nn=function(e){return tn(e,Vt,Zt)},ln=function(e){return tn(e,$t,en)},on=_e(te,"DataView"),an=_e(te,"Promise"),rn=_e(te,"Set"),un=_e(te,"WeakMap"),sn=ye(on),cn=ye(Pe),dn=ye(an),pn=ye(rn),mn=ye(un),vn=se;(on&&"[object DataView]"!=vn(new on(new ArrayBuffer(1)))||Pe&&"[object Map]"!=vn(new Pe)||an&&"[object Promise]"!=vn(an.resolve())||rn&&"[object Set]"!=vn(new rn)||un&&"[object WeakMap]"!=vn(new un))&&(vn=function(e){var t=se(e),n="[object Object]"==t?e.constructor:void 0,l=n?ye(n):"";if(l)switch(l){case sn:return"[object DataView]";case cn:return"[object Map]";case dn:return"[object Promise]";case pn:return"[object Set]";case mn:return"[object WeakMap]"}return t});var fn=vn,hn=Object.prototype.hasOwnProperty,gn=te.Uint8Array,En=function(e){var t=new e.constructor(e.byteLength);return new gn(t).set(new gn(e)),t},yn=/\w*$/,Sn=ne?ne.prototype:void 0,bn=Sn?Sn.valueOf:void 0,_n=Object.create,An=function(){function e(){}return function(t){if(!ve(t))return{};if(_n)return _n(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Dn=Pt&&Pt.isMap,Cn=Dn?Ot(Dn):function(e){return ce(e)&&"[object Map]"==fn(e)},Tn=Pt&&Pt.isSet,xn=Tn?Ot(Tn):function(e){return ce(e)&&"[object Set]"==fn(e)},Nn={};Nn["[object Arguments]"]=Nn["[object Array]"]=Nn["[object ArrayBuffer]"]=Nn["[object DataView]"]=Nn["[object Boolean]"]=Nn["[object Date]"]=Nn["[object Float32Array]"]=Nn["[object Float64Array]"]=Nn["[object Int8Array]"]=Nn["[object Int16Array]"]=Nn["[object Int32Array]"]=Nn["[object Map]"]=Nn["[object Number]"]=Nn["[object Object]"]=Nn["[object RegExp]"]=Nn["[object Set]"]=Nn["[object String]"]=Nn["[object Symbol]"]=Nn["[object Uint8Array]"]=Nn["[object Uint8ClampedArray]"]=Nn["[object Uint16Array]"]=Nn["[object Uint32Array]"]=!0,Nn["[object Error]"]=Nn["[object Function]"]=Nn["[object WeakMap]"]=!1;var wn=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(!ve(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]&&hn.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=fn(t),m="[object Function]"==p||"[object GeneratorFunction]"==p;if(xt(t))return qt(t,u);if("[object Object]"==p||"[object Arguments]"==p||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Ut(e)?{}:An(Qt(e))}(t),!u)return s?function(e,t){return St(e,en(e),t)}(t,function(e,t){return e&&St(t,$t(t),e)}(r,t)):function(e,t){return St(e,Zt(e),t)}(t,function(e,t){return e&&St(t,Vt(t),e)}(r,t))}else{if(!Nn[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return En(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?En(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?En(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,yn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return bn?Object(bn.call(e)):{}}}(t,p,u)}}a||(a=new ft);var v=a.get(t);if(v)return v;a.set(t,r),xn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):Cn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(c?s?ln:nn:s?$t:Vt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),yt(r,o,e(i,n,l,o,t,a))}),r},In=function(e){return wn(e,5)};const Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),On=()=>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"})),Pn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),Rn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},kn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:m,isLoading: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)}),[f,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[b,_]=n.useState({}),[A,D]=n.useState(null),[C,T]=n.useState(null),[N,w]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),L=window.location.href.includes("/employee");function O(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{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=P(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?T(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:m}=e,v=!0,f=!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))&&(v=!1),o.isTerminateState&&(v=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!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:v?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,x({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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:_,selectFile:O,uploadedFile:C,setUploadedFile:T,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:m}=e,v=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:v?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option: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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:_,selectFile:O,uploadedFile:C,setUploadedFile:T,businessService:p,error:N}))},[r,y,C,N]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Pn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&L?{width:"100%",height:"auto"}:{}},v?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,p,m,v;if(null!==(t=d)&&void 0!==t&&t.isBillAmend){var f,h,g,E,y,S,_,D,T;const t={...null===(f=d)||void 0===f||null===(h=f.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!==(_=S.applicationType)&&void 0!==_&&_.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=d)&&void 0!==D&&null!==(T=D.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]: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:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]}};c({AmendmentUpdate:n})}else{if(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]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:null,processInstance:{...null===(n=d)||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:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]}},null!=e&&e.date&&null!==(l=d)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=In(null==e?void 0:e.date);d.disconnectionExecutionDate=Rn(t)}else if(null!=e&&e.date){const t=In(null==e?void 0:e.date);d.connectionExecutionDate=Rn(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===(m=d)||void 0===m?void 0:m.applicationType))c({SewerageConnection:d,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(v=d)||void 0===v?void 0:v.applicationType))c({WaterConnection:d,disconnectRequest:!1,reconnectRequest:!0});else{var N,w,I,L,O,P,R,k,B,M,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===(L=t.value)||void 0===L?void 0:L.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.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!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(d.additionalDetails.adhocRebateComment=(null==t||null===(M=t.value)||void 0===M?void 0:M.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)},Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Mn=()=>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"})),Fn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Mn,null)),Un=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==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)}),[f,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==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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Fn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==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:m};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],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)},Hn=e=>l.createElement("h1",{className:"heading-m"},e.label),jn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Wn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jn,null)),zn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const m=Digit.ULBService.getStateId(),{data:v,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==v||null===(i=v.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",d);const[h,g]=n.useState({}),[E,y]=n.useState({}),[S,b]=n.useState([]),[_,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(f||!v||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),n=(null===(e=v.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[f,v,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:_,setSelectedApprover:A,businessService:p}))},[u,w,D,T]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Hn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Wn,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){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:_.length>0?parseInt(_):""}},c({Licenses:[d]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Vn=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"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null)),qn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=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?void 0:r.isTerminateState}),[f,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){I(!0),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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=R(function(){return P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p,isUploading:w}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vn,{label:a(f.label.heading)}),headerBarEnd:l.createElement($n,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==d||null===(t=d.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};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)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),Yn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,null)),Zn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==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)}),[f,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==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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Xn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};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)},Jn=e=>l.createElement("h1",{className:"heading-m"},e.label),Qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),el=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qn,null)),tl=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v,moduleCode:f}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),g=o.useHistory(),[E,y]=n.useState({}),[S,b]=n.useState({}),[_,A]=n.useState([]),[D,C]=n.useState(null),[T,x]=n.useState(null);return 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(()=>{"INITIATED"===(null==s?void 0:s.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):y((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${l}_${null==n?void 0:n.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:_,selectedApprover:D,setSelectedApprover:C,uploadedFile:T,setUploadedFile:x,businessService:v}))},[s,_,T]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Jn,{label:u(E.label.heading)}),headerBarEnd:l.createElement(el,{onClick:d}),actionCancelLabel:u(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};T&&(t.documents=[]),p({Asset:{...m,workflow:t}})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},nl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ze,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Un,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(tt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(zn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ot,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(st,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(mt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(kn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(qn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Zn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(tl,e):void 0;function ll(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 il=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(),[m,v]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,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;m.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||!(m.length>0))},[m,b]),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(ol,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:v,documents:m,setCheckRequiredFields:_,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function ol(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],v=Digit.ULBService.getStateId(),[f,h]=n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,_]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[y,f]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=f&&f.code&&r.newUploadedDocs.push({documentType:null==f?void 0:f.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),d[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[b,f]),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(ll,{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:f,optionKey:"i18nKey",select:e=>h(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:v,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&_(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 al(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(ll,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function rl(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(),[m,v]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):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)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&v(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const ul=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(),m=(null==s?void 0:s.status)||"",v=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[E,y]=n.useState([]),[S,b]=n.useState([]),[_,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==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==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)}),b(p))},[f,E]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===m&&(null==v?void 0:v.length)>0)},[s,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label: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(ll,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),_&&(null==S?void 0:S.map((e,t)=>l.createElement(rl,{key:t,document:e,t:o,error:T,setError:x,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:_}))))},sl=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 cl(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 dl(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 pl(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 ml=e=>{var o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,x;let{scrutinyDetails:N,paymentsList:w=[],additionalDetails:I,applicationData:L}=e;const O=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==L?void 0:L.status))&&window.location.href.includes("bpa"),[R,k]=n.useState(),[B,M]=n.useState(),[F,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,V]=n.useState(),[K,$]=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=P(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?$([...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),M(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),$(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===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:R,disabled:!O,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(k(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:B,disabled:!O,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>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===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!O,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,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:!O,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(R)?parseFloat(R):0)+parseFloat(B?parseFloat(B):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&&O?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){V(e.target.files[0]),G(e.target.files[0])},disabled:!O,onDelete:()=>{V(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===(b=Q.fileStoreIds[(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(R)?parseFloat(R):0)+parseFloat(B?parseFloat(B):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))))))))},vl=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),m=window.Digit.Utils.browser.isMobile(),v=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function 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")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:h,getCellProps:e=>({style:{}})})))})))},fl=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))},hl=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:m}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(fl,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},m("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},m("View Less")))))):null,(null==u||null===(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,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function gl(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${n+1}`),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function El(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${n+1}`),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const yl=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const v=null==p?void 0:p.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails: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==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},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"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==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:""})))))))},Sl=[{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"}],bl=[{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"}],_l=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[d,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[v,f,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),[C,T]=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,m,v;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===(m=c[0])||void 0===m?void 0:m.taxAmount)}];w(e),T(null==d||null===(v=d.billDetails)||void 0===v?void 0:v[0])}else p(i),b(i)},[]);let L={};const O=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==C?void 0:C.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(O,{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,m,v,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===(m=d.appDetails)||void 0===m?void 0:m.additionalDetails,...S};s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(v=s.additionalDetails)||void 0===v||null===(h=v.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,m,v,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===(m=d[0])||void 0===m?void 0:m.taxAmount}];f(In(e.Calculation[0])),T(null==e||null===(v=e.Calculation)||void 0===v?void 0:v[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:Sl,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,x({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},L={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,x({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},L={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:bl,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,x({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},L={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,x({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},L={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})))},Al=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"})))},Dl=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(Al,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Cl=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:m}=i.useTranslation(),[v,f]=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),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,v&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("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:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Tl={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:{}},xl=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:Tl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Tl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Tl.cell,...Tl.cellLeft,...Tl.cellHeader}},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Tl.cell,...n.length==t+1?Tl.cellRight:{},...Tl.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Tl.cell,...Tl.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...Tl.cell,textAlign:"left",...n.length==i+1?Tl.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Tl.cell,...Tl.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Tl.cell,...Tl.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:{...Tl.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Tl.cell,key:t,numeric:!0})))))))},Nl={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},wl=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 m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let v=[];v=Object.keys(m),v.sort((e,t)=>m[e]-m[t]);const[f,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Nl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(xl,{headers:[...v],values:s,arrears:p}),!f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))},Il=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))},Ll=e=>{var t;let{applicationData:i}=e;const[a,r]=n.useState(!1);return o.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Ol=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function Pl(e){var a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b;let{applicationDetails:A,demandData:D,workflowDetails:C,isDataLoading:T,applicationData:x,timelineStatusPrefix:N,showTimeLine:w=!0,statusAttribute:I="status",paymentsList:L,oldValue:O,isInfoLabel:P=!1,propertyId:R}=e;const{t:k}=i.useTranslation(),B=o.useHistory(),M=Digit.ULBService.getCurrentTenantId(),[F,U]=n.useState(null),[H,j]=n.useState([]);let W=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function z(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",A);const[V,K]=n.useState({}),[$,q]=n.useState(),[G,Y]=n.useState([]),[X,Z]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==x?void 0:x.status)||X.loading||X.loaded||X.canLoad||Z({loading:!1,loaded:!1,canLoad:!0}),null==X||!X.canLoad||X.loading||X.loaded||(Z({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(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){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=`${function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)}_${e.financialYear}`,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return Y(o),console.log(o),q(null==i?void 0:i.Assessments),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==x?void 0:x.tenantId)||M,null==x?void 0:x.propertyId,K,Z));const J=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},Q=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:J(null==x||null===(i=x.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==x?void 0:x.channel)||""};return l.createElement(hl,{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,m,v,f,h,g,E,y,S,b,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==A?void 0:A.tenantId,businessIds:null==A?void 0:A.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},C=n[t-1],T={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==x||null===(c=x.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.uuid)&&null!=x&&null!==(f=x.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==x||null===(E=x.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(S=y[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.mobileNumber,comment:k(null==e?void 0:e.comment),wfComment:C?C.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(hl,{data:T,OpenImage:z,privacy:i})}{var C,T,N,w,I;const t={date:J(null==x||null===(C=x.auditDetails)||void 0===C?void 0:C.lastModifiedTime),name:null==e||null===(T=e.assignes)||void 0===T||null===(N=T[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(hl,{data:t})}},ee=(e,t)=>e?t?e:k(e):k("NA"),te=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ne=window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),oe=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${k(null==e?void 0:e.isUnit)}`:k("N/A"):null!=e&&e.value?ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):k("N/A"),[ae,re]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const ue=function(e,t,n){try{if(!window.confirm(`Are you sure you want to make this property ${t}?`))return Promise.resolve();const l={...e,status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:{...e.additionalDetails,propertytobestatus:t},workflow:{...e.workflow,businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"}};return Promise.resolve(Digit.PTService.updatePT({Property:{...l}},M,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},se=null==A?void 0:A.applicationData,ce=(null==A||null===(a=A.applicationData)||void 0===a?void 0:a.propertyId)||"",de=null==A||null===(r=A.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",A),console.log("infolabel",P),console.log("assessment details",$),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:M,filters:{consumerCodes:R},auth:!0}).then(e=>{j(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?l.createElement(Dl,{t:k,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==A||null===(u=A.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,D,T,x,N,w,I,P,R,B,M,F,U,H,j,z,K,$,q,G,Y,X;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:te?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&te?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ne?""+k(e.title):k(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},k(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},k(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},k(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},k(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(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:k(n.title),label:k(n.title),text:l.createElement("img",{src:k(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:k(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},k(null==n?void 0:n.title)))):ne||le?""+k(n.title):k(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+k(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:k(n.title),label:k(n.title),text:oe(n),last:i===(null==e||null===(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:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(wl,{bill:null===(r=V.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(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,additionalDetails:null==A||null===(u=A.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==A?void 0:A.applicationData}),(null==A||null===(s=A.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(al,{fiReport:null==A||null===(m=A.applicationData)||void 0===m||null===(v=m.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(dl,{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(pl,{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(El,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(gl,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories}),!W&&(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions)&&(null==C||null===(T=C.data)||void 0===T||null===(x=T.nextActions)||void 0===x?void 0:x.length)>0&&l.createElement(sl,{applicationData:null==A?void 0:A.applicationData,t:k,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(il,{t:k,applicationData:null==A?void 0:A.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:C})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(ul,{t:k,isNoc:!0,NOCdata:e.values,applicationData:null==A?void 0:A.applicationData,docs:e.additionalDetails.noc,noc:null===(P=e.additionalDetails)||void 0===P?void 0:P.data,bpaActionsDetails:C}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(vl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==A?void 0:A.applicationData}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.documentsWithUrl)&&l.createElement(ll,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(cl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(yl,{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===(K=e.additionalDetails)||void 0===K||null===($=K.redirectUrl)||void 0===$?void 0:$.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(q=e.additionalDetails)||void 0===q||null===(G=q.redirectUrl)||void 0===G?void 0:G.title))),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.estimationDetails)&&l.createElement(_l,{wsAdditionalDetails:e,workflowDetails:C}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Cl,{wsAdditionalDetails:e,workflowDetails:C}))}),(null==$?void 0:$.length)>0&&l.createElement(Il,{assessmentData:G}),l.createElement(Ol,{payments:H}),l.createElement(Ll,{applicationData:null==A?void 0:A.applicationData}),w&&(null==C||null===(s=C.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==C?void 0:C.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=C&&C.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},k("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=C&&null!==(d=C.data)&&void 0!==d&&d.timeline&&1===(null==C||null===(p=C.data)||void 0===p||null===(m=p.timeline)||void 0===m?void 0:m.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:k(`${N}${null==C||null===(v=C.data)||void 0===v||null===(f=v.timeline[0])||void 0===f?void 0:f.state}`),customChild:Q(null==C||null===(h=C.data)||void 0===h?void 0:h.timeline[0],null==C||null===(g=C.data)||void 0===g?void 0:g.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==C||null===(E=C.data)||void 0===E?void 0:E.timeline)&&(null==C||null===(y=C.data)||void 0===y?void 0:y.timeline.slice(0,ae?null==C?void 0:C.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!=C&&null!==(r=C.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!=C&&null!==(c=C.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(p=d.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:k(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${a}`),customChild:Q(e,n,null==C||null===(o=C.data)||void 0===o?void 0:o.timeline)}))}))),(null==C||null===(S=C.data)||void 0===S||null===(b=S.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:k(ae?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{re(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==de?ue(se,"ACTIVE",ce):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==de?ue(se,"INACTIVE",ce):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==A||null===(e=A.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==A||null===(n=A.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==A||null===(l=A.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==A||null===(i=A.applicationData)||void 0===i?void 0:i.status)&&B.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==A||null===(o=A.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==A||null===(a=A.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==A||null===(r=A.applicationData)||void 0===r?void 0:r.status)&&B.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),F&&l.createElement(t.Toast,{error:F.isError,label:k(F.label),onClose:()=>{U(null)},isDleteBtn:"false"}))}function Rl(e){var n,i,o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S;let{t:b,showToast:_,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==_||null===(C=_.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==_?void 0:_.key)?null==_||null===(n=_.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==_?void 0:_.key)?null==_||null===(i=_.error)||void 0===i?void 0:i.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==_?void 0:_.key)?null==_||null===(o=_.error)||void 0===o?void 0:o.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==_?void 0:_.key)?null==_||null===(a=_.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==_?void 0:_.key)?null==_||null===(r=_.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==_?void 0:_.key)?null==_||null===(u=_.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==_?void 0:_.key)?null==_||null===(s=_.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==_?void 0:_.key)?null==_||null===(c=_.error)||void 0===c?void 0:c.message:b(`ES_${D}_${null==_||null===(d=_.action)||void 0===d?void 0:d.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.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")?b(e[1]):b(e[0]),n};let n="";switch(null==_||null===(T=_.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==_?void 0:_.key)?null==_||null===(p=_.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==_?void 0:_.key)?null==_||null===(m=_.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==_?void 0:_.key)?null==_||null===(v=_.error)||void 0===v?void 0:v.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==_?void 0:_.key)?null==_||null===(f=_.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==_?void 0:_.key)?null==_||null===(h=_.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==_?void 0:_.key)?null==_||null===(g=_.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==_?void 0:_.key)?null==_||null===(E=_.error)||void 0===E?void 0:E.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==_?void 0:_.key)?null==_||null===(y=_.error)||void 0===y?void 0:y.message:b(`ES_${D}_${null==_||null===(S=_.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.key,label:n,onClose:A}))}{var x,N;const e="error"===(null==_?void 0:_.key)?null==_||null===(x=_.error)||void 0===x?void 0:x.message:`ES_${D}_${null==_||null===(N=_.action)||void 0===N?void 0:N.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.key,label:b(e),onClose:A}))}}function kl(e){var o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S;let{workflowDetails:b,displayMenu:_,onActionSelect:A,setDisplayMenu:D,businessService:C,forcedActionPrefix:T,ActionBarStyle:x={},MenuStyle:N={}}=e;const{t:w}=i.useTranslation();let I=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):{};I=null==t?void 0:t.value}const O=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==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(d=b.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(L,()=>{D(!1)},_),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(m=k[0])&&void 0!==m&&null!==(v=m.redirectionUrl)&&void 0!==v&&v.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(R=!1,P=!0):(null==k?void 0:k.length)>0&&(R=!0,P=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&R&&!P&&l.createElement(t.ActionBar,{style:{...x}},_&&(null!=b&&null!==(f=b.data)&&void 0!==f&&null!==(h=f.actionState)&&void 0!==h&&h.nextActions||null!=b&&null!==(g=b.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:L,label:w("WF_TAKE_ACTION"),onSubmit:()=>D(!_)})),!(null!=b&&b.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 Bl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bl,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(Ml,{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,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(d,"BPA",["BlockReason"]),{t:m}=i.useTranslation(),v=o.useHistory();let{id:f}=o.useParams();const[h,g]=n.useState(!1),[E,y]=n.useState(null),[S,b]=n.useState(!1),[_,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:O,isLoading:R,isDataLoading:k,applicationData:B,mutate:M,nocMutation:F,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:K,statusAttribute:$,ActionBarStyle:q,MenuStyle:G,paymentsList:Y,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{L&&U.revalidate()},[L]);const te=a.useQueryClient(),ne=()=>{y(null),b(!1)};return R||_?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Pl,{applicationDetails:x,demandData:N,id:H,workflowDetails:U,isDataLoading:k,applicationData:B,totalDemandTax:w,totalBalanceTax:I,businessService:j,timelineStatusPrefix:V,statusAttribute:$,paymentsList:Y,showTimeLine:X,oldValue:Z,isInfoLabel:J,propertyId:ee}),S?l.createElement(nl,{t:m,action:E,tenantId:c,state:d,id:f,applicationDetails:x,applicationData:null==x?void 0:x.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,u,s,c,d,p,f,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===(f=e.Licenses)||void 0===f||null===(h=f[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===(b=e.SewerageConnection)||void 0===b||null===(_=b.comment)||void 0===_?void 0:_.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(m("Please fill in the validity before submitting")):alert(m("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;M&&(A(!0),M(e,{onError:(e,t)=>{A(!1),O({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,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&v.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,p,f,h,g,y;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?O({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?O({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(h=f.workflow)&&void 0!==h&&h.action.includes("APPROVE")?O({key:"success",label:m("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")&&O({key:"success",label:m("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 O({key:"success",action:E}),void v.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));O({key:"success",action:E}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}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=P(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,v;A(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?m(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(),O({key:"error",error:{message:f}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(u=p.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Fl,{action:E,workflowDetails:U,businessService:j,isWarningPop:D,closeWarningPopup:()=>{C(!1)}}):null,l.createElement(Rl,{t:m,showToast:L,closeToast:W,businessService:j}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.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,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===(d=u.BPA)||void 0===d||null===(p=d.additionalDetails)||void 0===p||null===(v=p.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(kl,{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]);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))v.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;v.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var d;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var p,m;v.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(m=e.redirectionUrl)||void 0===m?void 0:m.state}})}else b(!0);y(e),g(!1)},setDisplayMenu:g,businessService:j,forcedActionPrefix:K,ActionBarStyle:q,MenuStyle:G}))))};var Hl=l.memo(()=>{var e,a,r,u,s;const{t:c}=i.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),{id:p}=o.useParams(),[m,v]=n.useState(null),[f,h]=n.useState({}),[g,E]=n.useState(!1),{isLoading:y,data:S}=Digit.Hooks.ads.useADSApplicationDetail(c,d,p),b=Digit.Hooks.ads.useADSCreateAPI(d,!1),{data:_,refetch:A}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:{bookingNo:p,audit:!0}});n.useEffect(()=>{S&&h(qe.cloneDeep(S))},[S]);const{data:D,isLoading:C}=Digit.Hooks.useRecieptSearch({tenantId:d,businessService:"adv-services",consumerCodes:null==f||null===(e=f.applicationData)||void 0===e||null===(a=e.applicationData)||void 0===a?void 0:a.bookingNo,isEmployee:!1},{enabled:!(null==f||null===(r=f.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==_||null===(i=_.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(b.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==_||null===(l=_.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(b.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(Ul,{applicationDetails:null==f?void 0:f.applicationData,isLoading:y,isDataLoading:y,applicationData:null==f||null===(s=f.applicationData)||void 0===s?void 0:s.applicationData,showToast:m,setShowToast:v,closeToast:()=>{v(null)},MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const jl=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:a}=i.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},Wl=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<r.length?d():o===r.length&&n()}function c(){o>1&&p()}const d=()=>a(o+1),p=()=>a(o-1);return l.createElement(jl,{currentStep:o,nextStep:d,prevStep:p,stepsList:r},(()=>{var e,t;const n=r[o-1],{component:i,key:a,texts:d,currStepConfig:p}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:d,component:i,currStepNumber:o,currStepConfig:p},onGoNext:s,onBackClick:c,t:u}))})())},zl=[{head:"ES_TITILE_OWNER_DETAILS",stepNumber:1,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_PET_DETAILS",stepNumber:2,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Vl=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Kl=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),$l=[{head:"OWNER DETAILS",stepLabel:"ES_TITILE_OWNER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>({...e,currStepConfig:zl.filter(t=>t.stepNumber===e.stepNumber)})),ql=e=>{let{t:i,goNext:o,currentStepData:a}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.ownerDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+i("NDC_FIRST_NAME")),l.createElement(r.Controller,{control:u,name:"firstName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NDC_LAST_NAME")),l.createElement(r.Controller,{control:u,name:"lastName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_EMAIL_LABEL")),l.createElement(r.Controller,{control:u,name:"emailId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(r.Controller,{control:u,name:"mobileNumber",render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:i})}),l.createElement(t.CardLabel,null,""+i("ADVT_CHALLAN_UNDER_SECTION_122_123_SGST")),l.createElement(r.Controller,{control:u,name:"SGST",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("PT_COMMON_COL_ADDRESS")),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{name:"address",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement("div",{style:{marginTop:"20px"}},l.createElement(r.Controller,{control:u,name:"selfDeclaration",render:e=>l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"}},l.createElement("input",{value:e.value,type:"checkbox",id:"selfDeclaration",checked:e.value||!1,onChange:t=>e.onChange(t.target.checked),onBlur:e.onBlur,style:{width:"18px",height:"18px",cursor:"pointer"}}),l.createElement("label",{htmlFor:"selfDeclaration",style:{fontSize:"14px",lineHeight:"1.5",cursor:"pointer"}},i("BILLAMENDMENT_SELFDECLARATION_LABEL")))}))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},Gl=[{i18nKey:"PTR_GENDER",code:"123",name:"test"}],Yl=e=>{let{onGoBack:i,goNext:o,currentStepData:a}=e;const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.pets;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,"Search By site id"),l.createElement(r.Controller,{control:u,name:"siteId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Site Name"),l.createElement(r.Controller,{control:u,name:"siteName",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Geo Location"),l.createElement(r.Controller,{control:u,name:"geoLocation",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Address"),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Size"),l.createElement(r.Controller,{control:u,name:"size",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Advertisement Type"),l.createElement(r.Controller,{control:u,name:"advertisementType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Start Date"),l.createElement(r.Controller,{control:u,name:"startDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"End Date"),l.createElement(r.Controller,{control:u,name:"endDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:i}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function Xl(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:c,formData:d,handleSubmit:p,id:m}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[f,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?{...v,active:!0===(null==a?void 0:a.active),code:null==v?void 0:v.documentType}:1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:b}=a;var _=b;const[A,D]=n.useState(!1),[C,T]=n.useState(!1);return n.useEffect(()=>{null!=f&&f.code&&(console.log("selectedDocument",s),r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==f?void 0:f.code,filestoreId:y,documentUid:y}]}))},[y,f]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents",s),p())},[s]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=_.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)):D(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||h({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(g){T(!0);const e=function(){if(g.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",g,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;T(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?S(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){T(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[g]),n.useEffect(()=>{A&&S(null)},[A]),l.createElement("div",{style:{marginBottom:"24px"}},C&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:f,style:{width:"100%"},option:_.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>h(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))+" *")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{S(null)},id:m,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}))))}const Zl={step:1,isValid:!1,formData:{}},Jl=function(e,t){switch(void 0===e&&(e=Zl),t.type){case"UPDATE_ADSNewApplication_FORM":return{...e,formData:{...e.formData,[t.payload.key]:t.payload.value}};case"SET_ADSNewApplication_STEP":return{...e,step:t.payload};case"RESET_ADS_NEW_APPLICATION_FORM":return Zl;default:return e}},Ql={ADSCreate:e=>{var n,r,u,s;const c=a.useQueryClient(),d=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[E,y,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:_}=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=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=g.find(e=>e.route===(o||"0")),s=f.push;if(e&&(s=f.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(_)return l.createElement(t.Loader,null);b=v,b.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:p,formData:E,onAdd:C}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(T,{onSubmit:function(){try{return f.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 m=Digit.UserService.getUser().info,[v,f]=n.useState(p.adslist&&p.adslist[0]&&p.adslist[0].cartDetails||(null==p||null===(i=p.adslist)||void 0===i?void 0:i.cartDetails)||[]),[h,E]=n.useState(null==p?void 0:p.adType),[y,S]=n.useState(null==p?void 0:p.location),[_,A]=n.useState(null==p?void 0:p.faceArea),[D,T]=n.useState(!0),[x,N]=n.useState(null==p?void 0:p.fromDate),[w,I]=n.useState([]),[L,O]=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,B]=n.useState(null),[M,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(),[V,K]=n.useState(!1);let $=[],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=>{$.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:v,adsType:h,selectedLocation:y,selectedFace:_,selectNight:j,fromDate:x,toDate:L,existingDataSet:U},s(c.key,{...p[c.key],...e},!1,0)):(e={...t,Searchdata:P,cartDetails:v,adsType:h,selectNight:j,selectedLocation:y,selectedFace:_,fromDate:x,toDate:L,existingDataSet:U},s(c.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===d&&re()},[v,h,j,_,y,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(()=>{B(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:h,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:h,select:e=>{E(e)},placeholder:"Select Advertisement Type",option:$,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:y,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:y,select:e=>{S(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:_,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:_,select:e=>{A(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"===m.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:L,onChange:function(e){O(e.target.value)},style:{width:"EMPLOYEE"===m.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==h?void 0:h.code,t=x,n=L,l=null==_?void 0:_.code,i=null==y?void 0:y.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(h&&t&&n&&l&&i&&o){if(new Date(t)>new Date(n))return void B({error:!0,label:u("ADS_INVALID_DATE_RANGE")});R({addType:e,faceArea:l,location:i,nightLight:o,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else B({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 B({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=te.filter(e=>w.includes(e.slotId)),t=v.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: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 B({error:!0,label:u("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void I([])}f(e=>[...e,...n]),B({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:()=>{v.length>0?K(!0):B({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," ",v.length)))),V&&l.createElement(C,{onClose:()=>{K(!1)},cartDetails:v,setCartDetails:f}),l.createElement(t.SubmitBar,{label:u("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?B({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")}):D?F(!0):re()}}))),le&&l.createElement(t.Card,{style:{overflowX:"auto"}},l.createElement(g,{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:()=>{B(null)}}),M&&l.createElement(b,{t:u,closeModal:()=>F(!1),actionCancelOnSubmit:()=>F(!1),onSubmit:()=>{re(),F(!1)},setExistingDataSet:H,Searchdata:v}))},ADSCitizenDetails:e=>{var i,a,r,u,s,c,d,p,m,v,f,h,g,E,y;let{t:S,config:b,onSelect:_,userType:A,formData:D,value:C=D.adslist}=e;o.useLocation();let T=window.location.href.charAt(window.location.href.length-1),N={};const I=Digit.UserService.getUser().info,L=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),P=Digit.Hooks.ads.useADSCreateAPI(),[R,B]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].applicantName||(null==D||null===(i=D.applicant)||void 0===i?void 0:i.applicantName)||(null==C||null===(a=C.existingDataSet)||void 0===a||null===(r=a.applicant)||void 0===r?void 0:r.applicantName)||""),[M,F]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].emailId||(null==D||null===(u=D.applicant)||void 0===u?void 0:u.emailId)||(null==C||null===(s=C.existingDataSet)||void 0===s||null===(c=s.applicant)||void 0===c?void 0:c.emailId)||""),[U,H]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].mobileNumber||(null==C||null===(d=C.existingDataSet)||void 0===d||null===(p=d.applicant)||void 0===p?void 0:p.mobileNumber)||(null==D||null===(m=D.applicant)||void 0===m?void 0:m.mobileNumber)||(null==I?void 0:I.mobileNumber)),[j,W]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].alternateNumber||(null==D||null===(v=D.applicant)||void 0===v?void 0:v.alternateNumber)||(null==C||null===(f=C.existingDataSet)||void 0===f||null===(h=f.applicant)||void 0===h?void 0:h.alternateNumber)||""),z=()=>{let e=D.applicant&&D.applicant[T],t=null==C?void 0:C.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:L,applicantDetail:{applicantName:R,applicantMobileNo:U,applicantAlternateMobileNo:j,applicantEmailId:M},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:R,mobileNumber:U,alternateNumber:j,emailId:M,draftId:l},_(b.key,{...D[b.key],...i},!1,T)):(i={...e,applicantName:R,mobileNumber:U,alternateNumber:j,emailId:M,draftId:l},_(b.key,i,!1,T))}})};return n.useEffect(()=>{"citizen"===A&&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==C||null===(g=C.existingDataSet)||void 0===g||null===(E=g.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==C?void 0:C.cartDetails,draftId:null==C||null===(y=C.existingDataSet)||void 0===y?void 0:y.draftId})),l.createElement(O,null))),l.createElement(t.FormStep,{config:b,onSelect:z,onSkip:()=>_(),t:S,isDisabled:!R||!U||!M},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,x({t:S,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,"");B(t)},style:{width:"EMPLOYEE"===I.type?"51.6%":null},ValidationRequired:!0},N={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"===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: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"===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: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,x({t:S,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:M,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:S("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var i,a,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,N,I,L,P,R,B,M,F,U;let{t:H,config:j,onSelect:W,userType:z,formData:V,value:K=V.adslist}=e;o.useLocation();let $=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(V.address&&V.address[$]&&V.address[$].pincode||(null==V||null===(i=V.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(V.address&&V.address[$]&&V.address[$].city||(null==V||null===(s=V.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(V.address&&V.address[$]&&V.address[$].locality||(null==V||null===(p=V.address)||void 0===p?void 0:p.locality)||(null==K||null===(m=K.existingDataSet)||void 0===m||null===(v=m.address)||void 0===v?void 0:v.locality)||""),[ie,oe]=n.useState(V.address&&V.address[$]&&V.address[$].streetName||(null==V||null===(f=V.address)||void 0===f?void 0:f.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(V.address&&V.address[$]&&V.address[$].houseNo||(null==V||null===(E=V.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(V.address&&V.address[$]&&V.address[$].landmark||(null==V||null===(b=V.address)||void 0===b?void 0:b.landmark)||(null==K||null===(_=K.existingDataSet)||void 0===_||null===(A=_.address)||void 0===A?void 0:A.landmark)||""),[ce,de]=n.useState(V.address&&V.address[$]&&V.address[$].houseName||(null==V||null===(D=V.address)||void 0===D?void 0:D.houseName)||(null==K||null===(C=K.existingDataSet)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.houseName)||""),[pe,me]=n.useState(V.address&&V.address[$]&&V.address[$].addressline1||(null==V||null===(N=V.address)||void 0===N?void 0:N.addressline1)||(null==K||null===(I=K.existingDataSet)||void 0===I||null===(L=I.address)||void 0===L?void 0:L.addressline1)||""),[ve,fe]=n.useState(V.address&&V.address[$]&&V.address[$].addressline2||(null==V||null===(P=V.address)||void 0===P?void 0:P.addressline2)||(null==K||null===(R=K.existingDataSet)||void 0===R||null===(B=R.address)||void 0===B?void 0:B.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==V||null===(e=V.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==V||null===(t=V.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==V||null===(n=V.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==V||null===(l=V.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==V||null===(i=V.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:ve,houseNo:ae,landmark:ue},cartDetails:r,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};Z.mutate(u);let s={...V.address&&V.address[$],pincode:J,city:ee,locality:ne,streetName:ie,houseNo:ae,landmark:ue,houseName:ce,addressline1:pe,addressline2:ve};W(j.key,{...V[j.key],...s},!1,$)},{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==K||null===(M=K.existingDataSet)||void 0===M||null===(F=M.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(O,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,x({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,x({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=>{me(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:ve,placeholder:"Enter Address",onChange:e=>{fe(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,x({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:m,onSelect:v,formData:f,value:h=f.adslist}=e;const[g,E]=n.useState((null==f||null===(i=f.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(),x=Digit.ULBService.getStateId(),{isLoading:N,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(x,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.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)}),_("0"!=t&&0!=t||!(g.length>0))},[g,A]),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==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(O,null))),N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:m,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==f||null===(e=f.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==f||null===(t=f.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==f||null===(n=f.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==f||null===(l=f.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==f||null===(i=f.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:null==f||null===(o=f.address)||void 0===o?void 0:o.pincode,city:null==f||null===(a=f.address)||void 0===a||null===(r=a.city)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.name,cityCode:null==f||null===(s=f.address)||void 0===s||null===(c=s.city)||void 0===c||null===(d=c.city)||void 0===d?void 0:d.code,locality:null==f||null===(p=f.address)||void 0===p||null===(E=p.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==f||null===(y=f.address)||void 0===y||null===(S=y.locality)||void 0===S?void 0:S.code,streetName:null==f||null===(b=f.address)||void 0===b?void 0:b.streetName,addressLine1:null==f||null===(_=f.address)||void 0===_?void 0:_.addressline1,addressLine2:null==f||null===(A=f.address)||void 0===A?void 0:A.addressline2,houseNo:null==f||null===(D=f.address)||void 0===D?void 0:D.houseNo,landmark:null==f||null===(x=f.address)||void 0===x?void 0:x.landmark},documents:g,cartDetails:N,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let I;T.mutate(w),I={...f.documents,documents:g},v(m.key,I)},onSkip:()=>v(),isDisabled:b,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==I||null===(c=I.Advertisement)||void 0===c||null===(d=c.Documents)||void 0===d?void 0:d.map((e,t)=>l.createElement(B,{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,u,s,d,p,m,v,f,h,E;let{onSubmit:y,value:S={}}=e;const{t:b}=i.useTranslation(),[_,A]=(o.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:D,isEditADS:C,isUpdateADS:T,documents:x,address:N}=S,I=C||T?"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:()=>O(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],O=e=>{var t;const n={..._};null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},P=(null==_||null===(a=_.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[R,B]=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==_||null===(r=_.adslist)||void 0===r||null===(u=r.existingDataSet)||void 0===u||null===(s=u.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==_||null===(d=_.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==_||null===(p=_.adslist)||void 0===p||null===(m=p.existingDataSet)||void 0===m?void 0:m.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==D?void 0:D.applicantName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(c(null==D?void 0:D.mobileNumber)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(c(null==D?void 0:D.alternateNumber)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(c(null==D?void 0:D.emailId)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/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==N?void 0:N.houseNo)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(c(null==N?void 0:N.houseName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(c(null==N?void 0:N.streetName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(c(null==N?void 0:N.addressline1)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(c(null==N?void 0:N.addressline2)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(c(null==N?void 0:N.landmark)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(c(null==N||null===(v=N.city)||void 0===v||null===(f=v.city)||void 0===f?void 0:f.name)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(c(null==N||null===(h=N.locality)||void 0===h?void 0:h.i18nKey)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(c(null==N?void 0:N.pincode)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),l.createElement(g,{t:b,data:P,columns:L,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==_||null===(E=_.adslist)||void 0===E?void 0:E.cartDetails.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Card,null,x&&(null==x?void 0:x.documents.map((e,t)=>l.createElement(M,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),l.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{B(!R)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:y,disabled:!R})))},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),m=(Digit.Hooks.useStore.getInitData(),o.useRouteMatch(),o.useHistory()),v=Digit.UserService.getUser().info,[f,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(f){const e=setTimeout(()=>{h(null)},2e3);return()=>clearTimeout(e)}},[f]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(j,{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:H,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),p.isSuccess&&l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},"EMPLOYEE"===v.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),"CITIZEN"===v.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=P(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"===v.type){var u,s,f,g;m.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===(f=p.data)||void 0===f||null===(g=f.bookingApplication[0])||void 0===g?void 0:g.bookingNo,timerValue:r,SlotSearchData:o}})}else if("EMPLOYEE"===v.type){var E,y,S,b;m.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===(b=S.bookingApplication[0])||void 0===b?void 0:b.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"===v.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),!p.isSuccess&&"EMPLOYEE"===v.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),f&&l.createElement(t.Toast,{error:f.error,warning:f.warning,label:c(f.label),onClose:()=>{h(null)}}))},ADSCard:W,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,m]=n.useState(null);let v,f,h=window.location.href.split("/").pop();isNaN(parseInt(h))?v=4:(f=h,v=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:f,tenantId:a};n.useEffect(()=>{m(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")}],b=(null==y?void 0:y.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: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};m(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,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&&!E&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==b.length&&(null==y?void 0:y.count)>v&&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/"+v},e("ADS_LOAD_MORE_MSG")))))))},ApplicationDetails:Hl,ADSApplicationDetails:()=>{var e,a,r,u,s,c,d,p,m,v,f,h,E,y,S,b,_,A,D,C,T;const{t:x}=i.useTranslation(),{acknowledgementIds:N,tenantId:w}=(o.useHistory(),o.useParams()),[I,L]=n.useState([]),[O,P]=n.useState(!1),[R,k]=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,V]=n.useState(null),K=$e(H,"bookingApplication",[]),$=$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){V(e),X(!1)})}catch(e){return Promise.reject(e)}}()},[w,N]);const{isLoading:Z}=Digit.Hooks.ads.useADSSearch({tenantId:w,filters:{bookingNo:$,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(!O),displayOptions:O,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===(m=q.applicantDetail)||void 0===m?void 0:m.applicantName)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_MOBILE_NUMBER"),text:(null==q||null===(v=q.applicantDetail)||void 0===v?void 0:v.applicantMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ALT_MOBILE_NUMBER"),text:(null==q||null===(f=q.applicantDetail)||void 0===f?void 0:f.applicantAlternateMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_EMAIL_ID"),text:(null==q||null===(h=q.applicantDetail)||void 0===h?void 0:h.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===(b=q.address)||void 0===b?void 0:b.addressLine1)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ADDRESS_LINE2"),text:(null==q||null===(_=q.address)||void 0===_?void 0:_.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(g,{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(M,{value:ee,Code:null==e?void 0:e.documentType,index:t}))))))},ADSSearchApplication:q,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:m,data:v={}}=Digit.Hooks.ads.useADSDocumentsMDMS(p,"Advertisement","Documents");let f=null==v||null===(n=v.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,m&&l.createElement(t.Loader,null),Array.isArray(f)?f.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}))))},NewADSStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=u.useDispatch(),[r,s]=n.useState(null),c=u.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("ADS_REGISTRATION_APPLICATION")),l.createElement(Wl,{stepsList:$l,onSubmit:e=>{console.log("dataGet===",e)},step:c,setStep:e=>{a(Kl(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{s(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{let{config:o,onGoNext:a,onBackClick:r}=e;const s=u.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(ql,{onGoBack:function(e){r(o.key,e)},goNext:function(e){s(Vl(o.key,e)),a()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewADSStepFormTwo:e=>{let{config:o,onBackClick:a,onGoNext:r}=e;const{t:s}=i.useTranslation(),c=u.useDispatch(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(Yl,{onGoBack:function(e){a(o.key,e)},goNext:function(e){c(Vl(o.key,e)),r()},currentStepData:f,t:s}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewADSStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const s=u.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),v=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.ads.ADSNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:v,config:i.currStepConfig,onSubmit:function(e){console.log("goNext data in NewPTRStepFormThree: ",e);const{missingFields:t}={missingFields:[],notFormattedFields:[]};if(t.length>0)return m("Please fill the following field: "+t[0]),void d(!0);o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!qe.isEqual(t,v)),qe.isEqual(t,v)||s(Vl(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},NewADSStepFormFour:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const s=u.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),v=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData||{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:v,config:i.currStepConfig,onSubmit:function(e){o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!qe.isEqual(t,v)),qe.isEqual(t,v)||s(Vl(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},ADSCitizenDetailsNew:ql,ADSCitizenSecond:Yl,ADSSelectProofIdentity:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[d,p]=n.useState(null==c||null===(i=c.documents)||void 0===i?void 0:i.documents),[m,v]=n.useState(null),[f,h]=n.useState(!0),[g,E]=n.useState(!1),y=Digit.ULBService.getStateId(),{isLoading:S,data:b}=Digit.Hooks.pt.usePropertyMDMS(y,"NDC",["Documents"]);console.log("formDataINPTRDOCUMENT",d,c);const _=()=>{let e;e={...c.documents,documents:d},s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==b||null===(e=b.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==d||d.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),h("0"!=n&&0!=n||!((null==d?void 0:d.length)>0))},[d,g]),l.createElement("div",null,S?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:_,onSkip:()=>s(),isDisabled:f,onAdd:function(){}},null==b||null===(o=b.NDC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(Xl,{key:t,document:e,t:r,error:m,setError:v,setDocuments:p,documents:d,setCheckRequiredFields:E,handleSubmit:_})),m&&l.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0})))},ADSSummary:function(e){var n,i,a,r,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,x,N,w,I,L,O,P,R,k,B;let{formData:M,t:F}=e;o.useLocation(),o.useHistory();const U=u.useDispatch();return l.createElement("div",{className:"application-summary"},l.createElement("h2",{style:{fontSize:"20px",fontWeight:"bold"}},F("Application Summary")),l.createElement(t.Card,{className:"summary-section",style:{padding:"2px"}},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Owner Details")),l.createElement("label",{onClick:()=>U(Kl(1))},F("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("First Name")),l.createElement("div",null,(null==M||null===(n=M.ownerss)||void 0===n||null===(i=n.ownerss)||void 0===i?void 0:i.firstName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Last Name")),l.createElement("div",null,(null==M||null===(a=M.ownerss)||void 0===a||null===(r=a.ownerss)||void 0===r?void 0:r.lastName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Father's Name")),l.createElement("div",null,(null==M||null===(s=M.ownerss)||void 0===s||null===(c=s.ownerss)||void 0===c?void 0:c.fatherName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Mobile Number")),l.createElement("div",null,(null==M||null===(d=M.ownerss)||void 0===d||null===(p=d.ownerss)||void 0===p?void 0:p.mobileNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Email ID")),l.createElement("div",null,(null==M||null===(m=M.ownerss)||void 0===m||null===(v=m.ownerss)||void 0===v?void 0:v.emailId)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Address")),l.createElement("div",null,(null==M||null===(f=M.ownerss)||void 0===f||null===(h=f.ownerss)||void 0===h?void 0:h.address)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Pet Details")),l.createElement("label",{onClick:()=>U(Kl(2))},F("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Name")),l.createElement("div",null,(null==M||null===(g=M.pets)||void 0===g||null===(E=g.pets)||void 0===E?void 0:E.petName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Type")),l.createElement("div",null,(null==M||null===(y=M.pets)||void 0===y||null===(S=y.pets)||void 0===S||null===(b=S.petType)||void 0===b?void 0:b.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Breed Type")),l.createElement("div",null,(null==M||null===(_=M.pets)||void 0===_||null===(A=_.pets)||void 0===A||null===(D=A.breedType)||void 0===D?void 0:D.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Gender")),l.createElement("div",null,(null==M||null===(C=M.pets)||void 0===C||null===(T=C.pets)||void 0===T||null===(x=T.petGender)||void 0===x?void 0:x.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Color")),l.createElement("div",null,(null==M||null===(N=M.pets)||void 0===N||null===(w=N.pets)||void 0===w?void 0:w.color)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Vaccination Number")),l.createElement("div",null,(null==M||null===(I=M.pets)||void 0===I||null===(L=I.pets)||void 0===L?void 0:L.vaccinationNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Last Vaccine Date")),l.createElement("div",null,(null==M||null===(O=M.pets)||void 0===O||null===(P=O.pets)||void 0===P?void 0:P.lastVaccineDate)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Documents")),l.createElement("label",{onClick:()=>U(Kl(3))},F("EDIT"))),l.createElement("div",{className:"section-content"},null==M||null===(R=M.documents)||void 0===R||null===(k=R.documents)||void 0===k||null===(B=k.documents)||void 0===B?void 0:B.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Document Type")),l.createElement("div",null,F(null==e?void 0:e.documentType)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Document UID")),l.createElement("div",null,(null==e?void 0:e.documentUid)||"NA")))))))}},ei=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(Ql).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(Y,{path:r,url:u,userType:i}):l.createElement(m,null)},ti=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(T,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:ei,ADSLinks:ti,ADSCard:W},exports.ADSLinks=ti,exports.ADSModule=ei,exports.ADSReducers=()=>s.combineReducers({ADSNewApplicationFormReducer:Jl});
|
|
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"),u=require("react-redux"),s=require("redux");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=[],m=()=>{var e,n,a,r,u,s;const{path:c,...d}=o.useRouteMatch(),m=(i.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),v=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("ADSMyApplications"),f=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=p)&&(h=[]),h.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:c+"/bookad",component:m}),l.createElement(t.PrivateRoute,{path:c+"/myBookings",component:v}),l.createElement(t.PrivateRoute,{path:c+"/application/:acknowledgementIds/:tenantId",component:f}))));var h},v=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e,t){return e(t={exports:{}},t.exports),t.exports}h(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:f,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),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},h=e.document,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 b(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!v(e)&&!f(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}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||v(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(b(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&&(b(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(b(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:m}),"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 _=function(e){var t,n,l,i,o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S="sizzle"+1*new Date,b=e.document,_=0,A=0,D=ue(),C=ue(),T=ue(),x=ue(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],L=I.pop,O=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},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+M+"*("+F+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+M+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(M+"+","g"),W=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),z=new RegExp("^"+M+"*,"+M+"*"),V=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),K=new RegExp(M+"|>"),$=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)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","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}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{P.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){P={apply:I.length?function(e,t){O.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,v,g,E=t&&t.ownerDocument,b=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return l;if(!i&&(p(t),t=t||m,f)){if(11!==b&&(d=Q.exec(e)))if(o=d[1]){if(9===b){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!==b||"object"!==t.nodeName.toLowerCase())){if(g=e,E=t,1===b&&(K.test(e)||V.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=(v=a(e)).length;r--;)v[r]=(c?"#"+c:":scope")+" "+ye(v[r]);g=v.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=m.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function me(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ve(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&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:b;return a!=m&&9===a.nodeType&&a.documentElement?(v=(m=a).documentElement,f=!o(m),b!=m&&(i=m.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return v.appendChild(e).appendChild(m.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(m.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(m.getElementsByClassName),n.getById=ce(function(e){return v.appendChild(e).id=S,!m.getElementsByName||!m.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&&f){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,l,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),l=0;o=i[l++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&l.push(n);return l}return o},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(m.querySelectorAll))&&(ce(function(e){var t;v.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+M+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=m.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),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=m.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(E=v.matches||v.webkitMatchesSelector||v.mozMatchesSelector||v.oMatchesSelector||v.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(v.compareDocumentPosition),y=t||J.test(v.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},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==m||e.ownerDocument==b&&y(b,e)?-1:t==m||t.ownerDocument==b&&y(b,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==m?-1:t==m?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)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]==b?-1:r[l]==b?1:0},m):m},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&f&&!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,m,null,[e]).length>0},re.contains=function(e,t){return(e.ownerDocument||e)!=m&&p(e),y(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=m&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&w.call(l.attrHandle,t.toLowerCase())?i(e,t,!f):void 0;return void 0!==o?o:n.attributes||!f?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},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&&$.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("(^|"+M+")"+e+"("+M+"|$)"))&&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,m,v,f=o!==a?"nextSibling":"previousSibling",h=t.parentNode,g=r&&t.nodeName.toLowerCase(),E=!u&&!r,y=!1;if(h){if(o){for(;f;){for(p=t;p=p[f];)if(r?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;v=f="only"===e&&!v&&"nextSibling"}return!0}if(v=[a?h.firstChild:h.lastChild],a&&E){for(y=(m=(s=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&s[1])&&s[2],p=m&&h.childNodes[m];p=++m&&p&&p[f]||(y=m=0)||v.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[_,m,y];break}}else if(E&&(y=m=(s=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&s[1]),!1===y)for(;(p=++m&&p&&p[f]||(y=m=0)||v.pop())&&((r?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++y||(E&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[_,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=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===v},focus:function(e){return e===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=me(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=ve(t);function 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=[_,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]===_&&s[1]===r)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function be(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 _e(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=[],m=[],v=a.length,f=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?f:_e(f,p,e,r,u),g=n?i||(o?e:v||l)?[]:a:h;if(n&&n(h,g,r,u),l)for(s=_e(g,m),l(s,[],r,u),c=s.length;c--;)(d=s[c])&&(g[m[c]]=!(h[m[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=_e(g===a?g.splice(v,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(be(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&&be(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 be(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=V.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,v,h,g=0,E="0",y=o&&[],S=[],b=s,A=o||i&&l.find.TAG("*",c),D=_+=null==b?1:Math.random()||.1,C=A.length;for(c&&(s=a==m||a||c);E!==C&&null!=(d=A[E]);E++){if(i&&d){for(v=0,a||d.ownerDocument==m||(p(d),r=!f);h=e[v++];)if(h(d,a||m,r)){u.push(d);break}c&&(_=D)}n&&((d=!h&&d)&&g--,o&&y.push(d))}if(g+=E,n&&E!==g){for(v=0;h=t[v++];)h(y,S,a,r);if(o){if(g>0)for(;E--;)y[E]||S[E]||(S[E]=L.call(u));S=_e(S)}P.apply(u,S),c&&!o&&S.length>0&&g+t.length>1&&re.uniqueSort(u)}return c&&(_=D,s=b),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,m=!i&&a(e=p.selector||e);if(n=n||[],1===m.length){if((u=m[0]=m[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&f&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=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,m))(i,t,!f,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(m.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(B,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=_,S.expr=_.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=_.uniqueSort,S.text=_.getText,S.isXMLDoc=_.isXML,S.contains=_.contains,S.escapeSelector=_.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 v(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)v(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var L=/^(?:parents|prev(?:Until|All))/,O={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&&(O[e]||S.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var R=/[^\x20\t\r\n\f]+/g;function k(e){return e}function B(e){throw e}function M(e,t,n,l){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}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){v(l)?e.unique&&s.has(l)||o.push(l):l&&l.length&&"string"!==y(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return 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=v(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,l,i){var o=0;function 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");v(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,a(o,n,k,i),a(o,n,B,i)):(o++,s.call(e,a(o,n,k,i),a(o,n,B,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!==B&&(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,v(i)?i:k,e.notifyWith)),n[1][3].add(a(0,e,v(t)?t:k)),n[2][3].add(a(0,e,v(l)?l:B))}).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&&(M(e,a.done(r(n)).resolve,a.reject,!t),"pending"===a.state()||v(o[n]&&o[n].then)))return a.then();for(;n--;)M(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,v(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 V(e,t){return t.toUpperCase()}function K(e){return e.replace(W,"ms-").replace(z,V)}var $=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={},$(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,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),m.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",m.option=!!ce.lastChild;var fe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&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"))}fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td,m.option||(fe.optgroup=fe.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,a,r,u,s,c,d=t.createDocumentFragment(),p=[],m=0,v=e.length;m<v;m++)if((o=e[m])||0===o)if("object"===y(o))S.merge(p,o.nodeType?[o]:o);else if(Ee.test(o)){for(a=a||d.appendChild(t.createElement("div")),r=(me.exec(o)||["",""])[1].toLowerCase(),a.innerHTML=(u=fe[r]||fe._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="",m=0;o=p[m++];)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++];)ve.test(o.type||"")&&n.push(o);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function _e(){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=_e;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,be)}S.event={global:{},add:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,m,v,f,h=G.get(e);if($(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--;)m=f=(r=Se.exec(t[s])||[])[1],v=(r[2]||"").split(".").sort(),m&&(d=S.event.special[m]||{},d=S.event.special[m=(i?d.delegateType:d.bindType)||m]||{},c=S.extend({type:m,origType:f,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:v.join(".")},o),(p=u[m])||((p=u[m]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,v,a)||e.addEventListener&&e.addEventListener(m,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[m]=!0)},remove:function(e,t,n,l,i){var o,a,r,u,s,c,d,p,m,v,f,h=G.hasData(e)&&G.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(R)||[""]).length;s--;)if(m=f=(r=Se.exec(t[s])||[])[1],v=(r[2]||"").split(".").sort(),m){for(d=S.event.special[m]||{},p=u[m=(l?d.delegateType:d.bindType)||m]||[],r=r[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&f!==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,v,h.handle)||S.removeEvent(e,m,h.handle),delete u[m])}else for(m in u)S.event.remove(e,m+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:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[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",be),!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?be:_e,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:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,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=_e),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 Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(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,f=p-1,h=t[0],g=v(h);if(g||p>1&&"string"==typeof h&&!m.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!==f&&(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,Le),d=0;d<u;d++)ve.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(!(m.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++)Oe(o[l],a[l]);else Oe(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($(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)&&!fe[(me.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 Be=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Me=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||Me(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||le(e)||(a=S.style(e,t)),!m.pixelBoxStyles()&&Be.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="",m.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(m,{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,Ve={};function Ke(e){return S.cssProps[e]||Ve[e]||(e in ze?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var $e=/^(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=Me(e),i=(!m.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(Be.test(a)){if(!n)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.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")),m.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!$e.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=Me(e),a=!m.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(m.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=Me(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 v(l.stop)&&(S._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return S.map(c,rt,s),v(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),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){v(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,m={},v=e.style,f=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===(f?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;f=!0}m[l]=h&&h[l]||S.style(e,l)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(m))for(l in d&&1===e.nodeType&&(n.overflow=[v.overflow,v.overflowX,v.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(){v.display=s}),null==s&&(s="none"===(c=v.display)?"":c)),v.display="inline-block")),n.overflow&&(v.overflow="hidden",p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]})),u=!1,m)u||(h?"hidden"in h&&(f=h.hidden):h=G.access(e,"fxshow",{display:s}),o&&(h.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),G.remove(e,"fxshow"),m)S.style(e,l,m[l])})),u=rt(f?h[l]:0,l,p),l in h||(h[l]=u.start,f&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),S.speed=function(e,t,n){var l=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(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(){v(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&<.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",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var st,ct=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(!m.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 mt(e){return(e.match(R)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(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"}}),m.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(v(e))return this.each(function(t){S(this).addClass(e.call(this,t,vt(this)))});if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(a=0;o=t[a++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(r=mt(l))&&n.setAttribute("class",r)}return this},removeClass:function(e){var t,n,l,i,o,a,r,u=0;if(v(e))return this.each(function(t){S(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(a=0;o=t[a++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(r=mt(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):v(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,i,o,a;if(l)for(i=0,o=S(this),a=ft(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(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&&(" "+mt(vt(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=v(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:mt(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}},m.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),m.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,m,g=[l||h],E=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(a=m=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&&!f(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();)m=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&&$(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)||!$(l)||s&&v(l[E])&&!f(l)&&((r=l[s])&&(l[s]=null),S.event.triggered=E,t.isPropagationStopped()&&m.addEventListener(E,Et),l[E](),t.isPropagationStopped()&&m.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)}}),m.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()},bt=/\?/;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 _t=/\[\]$/,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||_t.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=v(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,Lt=/^(?:GET|HEAD)$/,Ot=/^\/\//,Pt={},Rt={},kt="*/".concat("*"),Bt=h.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(R)||[];if(v(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function 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}Bt.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:Mt(Pt),ajaxTransport:Mt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,a,r,u,s,c,d,p,m=S.ajaxSetup({},n=n||{}),v=m.context||m,f=m.context&&(v.nodeType||v.jquery)?S(v):S.event,g=S.Deferred(),E=S.Callbacks("once memory"),y=m.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=_[e.toLowerCase()]=_[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==s&&(m.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),m.url=((t||m.url||yt.href)+"").replace(Ot,yt.protocol+"//"),m.type=n.method||n.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(R)||[""],null==m.crossDomain){u=h.createElement("a");try{u.href=m.url,u.href=u.href,m.crossDomain=Bt.protocol+"//"+Bt.host!=u.protocol+"//"+u.host}catch(e){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=S.param(m.data,m.traditional)),Ft(Pt,m,n,D),s)return D;for(d in(c=S.event&&m.global)&&0==S.active++&&S.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Lt.test(m.type),i=m.url.replace(Nt,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(xt,"+")):(p=m.url.slice(i.length),m.data&&(m.processData||"string"==typeof m.data)&&(i+=(bt.test(i)?"&":"?")+m.data,delete m.data),!1===m.cache&&(i=i.replace(wt,"$1"),p=(bt.test(i)?"&":"?")+"_="+St.guid+++p),m.url=i+p),m.ifModified&&(S.lastModified[i]&&D.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&D.setRequestHeader("If-None-Match",S.etag[i])),(m.data&&m.hasContent&&!1!==m.contentType||n.contentType)&&D.setRequestHeader("Content-Type",m.contentType),D.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+kt+"; q=0.01":""):m.accepts["*"]),m.headers)D.setRequestHeader(d,m.headers[d]);if(m.beforeSend&&(!1===m.beforeSend.call(v,D,m)||s))return D.abort();if(A="abort",E.add(m.complete),D.done(m.success),D.fail(m.error),l=Ft(Rt,m,n,D)){if(D.readyState=1,c&&f.trigger("ajaxSend",[D,m]),s)return D;m.async&&m.timeout>0&&(r=e.setTimeout(function(){D.abort("timeout")},m.timeout));try{s=!1,l.send(b,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&&(b=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]}(m,D,a)),!d&&S.inArray("script",m.dataTypes)>-1&&S.inArray("json",m.dataTypes)<0&&(m.converters["text script"]=function(){}),b=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}}(m,b,D,d),d?(m.ifModified&&((_=D.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=_),(_=D.getResponseHeader("etag"))&&(S.etag[i]=_)),204===t||"HEAD"===m.type?A="nocontent":304===t?A="notmodified":(A=b.state,p=b.data,d=!(h=b.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(v,[p,A,D]):g.rejectWith(v,[D,A,h]),D.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[D,m,d?p:h]),E.fireWith(v,[D,A]),c&&(f.trigger("ajaxComplete",[D,m]),--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 v(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]&&(v(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 v(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=v(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();m.cors=!!jt&&"withCredentials"in jt,m.ajax=jt=!!jt,S.ajaxTransport(function(t){var n,l;if(m.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=[],Vt=/(=)\?(?=&|$)|\?\?/;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&&(Vt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Vt,"$1"+i):!1!==t.jsonp&&(t.url+=(bt.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&&v(o)&&o(a[0]),a=o=void 0}),"script"}),m.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||(m.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=mt(e.slice(r)),e=e.slice(0,r)),v(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),v(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(f(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[l];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[l]=i},e,l,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=je(m.pixelPosition,function(e,n){if(n)return n=He(e,t),Be.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 f(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?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),v(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||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=v,S.isWindow=f,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 $t=e.jQuery,qt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=qt),t&&e.jQuery===S&&(e.jQuery=$t),S},void 0===t&&(e.jQuery=e.$=S),S})});const g=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:m,pageSizeLimit:v,sortParams:f,totalRecords:h}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:c,onPrevPage:d,pageSizeLimit:v,disableSort:u,isPaginationRequired:m,onPageSizeChange:p,onSort:s,sortParams:f,totalRecords:h})},E=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,m]=n.useState(!1),v=Digit.UserService.getUser().info,f=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(),m(!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==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:g,tenantId:s};n.useEffect(()=>{d(y)},[E]);const{isLoading:S,data:b}=Digit.Hooks.ads.useADSSearch({filters:c});if(S)return l.createElement(t.Loader,null);const _=(null==b?void 0:b.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,_.length>0&&_.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(f.mutateAsync(h)).then(function(t){var n,l,i,o,r,u,s,c,d,p,v;const f=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:f||0},draftId:(null==t?void 0:t.draftId)||""};a(h),m(!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===_.length&&!S&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},u("ADS_NO_APPLICATION_FOUND_MSG"))))},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)),b=e=>{let{t:i,closeModal:o,onSubmit:a,setExistingDataSet:r,Searchdata:u}=e;const[s,c]=n.useState(!1),[d,p]=n.useState(!1),m=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),v=e=>s&&l.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),f=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:m,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(v,{t:i}),headerBarEnd:l.createElement(S,{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(E,{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(f.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)}}})))))},A=()=>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"})),D=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(A,null)),C=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(D,{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(g,{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)))},T=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 x(){return(x=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 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"})),L=e=>{let{onClick:t}=e;return l.createElement("div",{className:"icon-bg-secondary",onClick:t},l.createElement(I,null))},O=()=>{var e,o,a,r,u,s,c,d,p,m,v,f,h,E,y;const[S,b]=n.useState(!1),[_,A]=n.useState(!1),{t:D}=i.useTranslation(),[C,T]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),x=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[N,w]=n.useState(!1),[I,O]=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),w(!0));const B=()=>{A(e=>!e)},M=()=>{O(!I)},F=()=>{b(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: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==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:M,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(L,{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}),_&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:l.createElement(L,{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(g,{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})),I&&l.createElement(t.Modal,{headerBarMain:l.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:l.createElement(L,{onClick:M}),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===(m=k.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.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===(f=k.data)||void 0===f||null===(h=f.demands[0])||void 0===h?void 0:h.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:I,onClose:M}));var H};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,m]=n.useState(!1),v=Digit.Hooks.ads.useADSSlotSearch(),f={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(v.mutateAsync(f)).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)}}(),m(!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 B(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:c,formData:d,id:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.UserService.getUser().info,[f,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.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==m?void 0:m.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!=f&&f.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y}]})},[y,f]),n.useEffect(()=>{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=R(function(){return P(function(){return S(null),_(!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(_(!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:f,style:{width:"EMPLOYEE"===v.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:b?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 M(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 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(T,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")),V=()=>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"})),K=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(V,null)),$=e=>{let{t:i,closeModal:o,actionCancelLabel:a,actionCancelOnSubmit:u,actionSaveLabel:s,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,m]=n.useState(!1),{handleSubmit:v}=r.useForm();return l.createElement(t.Modal,{headerBarMain:l.createElement(z,{t:i}),headerBarEnd:l.createElement(K,{onClick:o}),actionCancelLabel:i(a),actionCancelOnSubmit:u,actionSaveLabel:i(s),actionSaveOnSubmit:v(c),isDisabled:!p,formId:"modal-action"},l.createElement(t.Card,{style:{boxShadow:"none"}},l.createElement("form",{onSubmit:v(d)},l.createElement(t.CheckBox,{label:i("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{m(!p)},style:{height:"auto"}}))))},q=e=>{var i,a;let{tenantId:u,isLoading:s,t:c,onSubmit:d,data:p,count:m,setShowToast:v}=e;const f=window.Digit.Utils.browser.isMobile(),{register:h,control:g,handleSubmit:E,setValue:y,getValues:S,reset:b,formState:_}=r.useForm({defaultValues:{offset:0,limit:!f&&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)}},O=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 m=null==i?void 0:i.original;const f=Digit.Hooks.ads.useADSSlotSearch();let h={advertisementSlotSearchCriteria:null==m?void 0:m.cartDetails.map(e=>({bookingId:null==m?void 0:m.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==m?void 0:m.bookingStatus)||"EXPIRED"===(null==m?void 0:m.bookingStatus)}),a&&l.createElement("div",{style:{position:"absolute",backgroundColor:"white",border:"1px solid #ccc",borderRadius:"4px",padding:"8px",zIndex:1e3}},"BOOKED"===(null==m?void 0:m.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==m?void 0:m.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==m?void 0:m.bookingId,tenantId:u,cartDetails:null==m?void 0:m.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/employee/payment/collect/adv-services/"+(null==m?void 0:m.bookingNo),state:{tenantId:null==m?void 0:m.tenantId,bookingNo:null==m?void 0:m.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:{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 B(){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==_||null===(i=_.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:()=>{b({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),B()}},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:m,columns:O,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:B,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}))},G=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:m,isSuccess:v,data:{bookingApplication:f,Count:h}={}}=Digit.Hooks.ads.useADSSearch({tenantId:r,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(q,{t:a,isLoading:m,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:v&&!m?f.length>0?f:{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)}}))},Y=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"),m=window.location.href.includes("ads/response"),v=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"},m?null:l.createElement("div",{style:v?{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(G,x({},e,{parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/applicationsearch/application-details/:id",component:()=>l.createElement(p,{parentRoute:s})})))))},X=e=>{var a;let{application:r,tenantId:u,buttonLabel:s}=e;const{t:c}=i.useTranslation(),d=o.useHistory(),[p,m]=n.useState(null),v=Digit.Hooks.ads.useADSSlotSearch();let f={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(()=>{m(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(v.mutateAsync(f)).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?m({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(){m({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:()=>{m(null)}}))};var Z,J=Array.isArray,Q="object"==typeof f&&f&&f.Object===Object&&f,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)\]/,me=/^\w*$/,ve=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},fe=function(e){if(!ve(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\]$/,be=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ve(e)||(t=e,ge&&ge in t))&&(fe(e)?be:Se).test(ye(e));var t}(n)?n:void 0},Ae=_e(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 Le(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])}}Le.prototype.clear=function(){this.__data__=[],this.size=0},Le.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))},Le.prototype.get=function(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]},Le.prototype.has=function(e){return we(this.__data__,e)>-1},Le.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 Oe=Le,Pe=_e(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||Oe),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 Be=ke;function Me(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(Me.Cache||Be),n}Me.Cache=Be;var Fe,Ue,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,je=/\\(\\)?/g,We=(Fe=Me(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,Ve=ze?ze.toString:void 0,Ke=function(e){if("string"==typeof e||de(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 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))||me.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 Ve?Ve.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[Ke(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l},qe=h(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]",m="[object Number]",v="[object Object]",h="[object RegExp]",g="[object Set]",E="[object String]",y="[object Symbol]",S="[object WeakMap]",b="[object ArrayBuffer]",_="[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]",L=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,B=RegExp(R.source),M=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,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),$=/^\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+"]",me="["+ce+"]",ve="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",_e="(?:"+fe+"|"+he+")",Ae="(?:"+be+"|"+he+")",De="(?:"+me+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[Ee,ye,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",ye,Se].join("|")+")"+Ce,xe="(?:"+[Ee+me+"?",me,ye,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(me,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Le=RegExp([be+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+_e,"$"].join("|")+")",be+"?"+_e+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Te].join("|"),"g"),Oe=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,Be={};Be[A]=Be[D]=Be[C]=Be[T]=Be[x]=Be[N]=Be["[object Uint8ClampedArray]"]=Be[w]=Be[I]=!0,Be[o]=Be[a]=Be[b]=Be[r]=Be[_]=Be[u]=Be[s]=Be[c]=Be[p]=Be[m]=Be[v]=Be[h]=Be[g]=Be[E]=Be[S]=!1;var Me={};Me[o]=Me[a]=Me[b]=Me[_]=Me[r]=Me[u]=Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me[p]=Me[m]=Me[v]=Me[h]=Me[g]=Me[E]=Me[y]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[w]=Me[I]=!0,Me[s]=Me[c]=Me[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof f&&f&&f.Object===Object&&f,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,$e=Ke&&Ke.exports===Ve,qe=$e&&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)&>(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function st(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function ct(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function mt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var vt=bt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function ht(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function 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 bt(e){return function(t){return null==t?void 0:t[e]}}function _t(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,Vt(e)+1).replace($,""):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&>(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Pt=_t({"À":"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=_t({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Fe[e]}function Bt(e){return Oe.test(e)}function Mt(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 Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):vt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=_t({"&":"&","<":"<",">":">",""":'"',"'":"'"}),$t=function e(t){var f=(t=null==t?ze:$t.defaults(ze.Object(),t,$t.pick(ze,Re))).Array,q=t.Date,ce=t.Error,de=t.Function,pe=t.Math,me=t.Object,ve=t.RegExp,fe=t.String,he=t.TypeError,ge=f.prototype,Ee=me.prototype,ye=t["__core-js_shared__"],Se=de.prototype.toString,be=Ee.hasOwnProperty,_e=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(me),Te=ze._,xe=ve("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=$e?t.Buffer:void 0,Oe=t.Symbol,Fe=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,We=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,qe=ge.splice,Ge=Oe?Oe.isConcatSpreadable:void 0,vt=Oe?Oe.iterator:void 0,_t=Oe?Oe.toStringTag:void 0,qt=function(){try{var e=Zi(me,"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=me.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=ge.join,ln=Ft(me.keys,me),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"),mn=Zi(t,"Promise"),vn=Zi(t,"Set"),fn=Zi(t,"WeakMap"),hn=Zi(me,"create"),gn=fn&&new fn,En={},yn=Co(dn),Sn=Co(pn),bn=Co(mn),_n=Co(vn),An=Co(fn),Dn=Oe?Oe.prototype:void 0,Cn=Dn?Dn.valueOf:void 0,Tn=Dn?Dn.toString:void 0;function xn(e){if(Wa(e)&&!La(e)&&!(e instanceof Ln)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return To(e)}return new In(e)}var Nn=function(){function e(){}return function(t){if(!ja(t))return{};if(Ve)return Ve(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 Ln(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 Bn(e){var t=this.__data__=new Pn(e);this.size=t.size}function Mn(e,t){var n=La(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,fe):[],u=r.length;for(var s in e)!t&&!be.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 _o(fi(e),Gn(t,0,e.length))}function Hn(e){return _o(fi(e))}function jn(e,t,n){(void 0!==n&&!xa(e[t],n)||void 0===n&&!(t in e))&&$n(e,t,n)}function Wn(e,t,n){var l=e[t];be.call(e,t)&&xa(l,n)&&(void 0!==n||t in e)||$n(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(xa(e[n][0],t))return n;return-1}function Vn(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 $n(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=f(l),o=null==e;++n<l;)i[n]=o?void 0:mr(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,f=1&t,S=2&t,L=4&t;if(n&&(s=i?n(e,l,i,a):n(e)),void 0!==s)return s;if(!ja(e))return e;var O=La(e);if(O){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!f)return fi(e,s)}else{var P=eo(e),R=P==c||P==d;if(ka(e))return si(e,f);if(P==v||P==o||R&&!i){if(s=S||R?{}:no(e),!f)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(!Me[P])return i?e:{};s=function(e,t,n){var l=e.constructor;switch(t){case b:return ci(e);case r:case u:return new l(+e);case _: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 m: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?me(Cn.call(e)):{}}}(e,P,f)}}a||(a=new Bn);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 B=O?void 0:(L?S?Vi:zi:S?yr:Er)(e);return lt(B||e,function(l,i){B&&(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=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function 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,(Ln.prototype=Nn(wn.prototype)).constructor=Ln,On.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:be.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=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 On,map:new(pn||Pn),string:new On}},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)},Bn.prototype.clear=function(){this.__data__=new Pn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.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 La(e)?l:ct(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_t&&_t in me(e)?function(e){var t=be.call(e,_t),n=e[_t];try{e[_t]=void 0;var l=!0}catch(e){}var i=De.call(e);return l&&(t?e[_t]=n:delete e[_t]),i}(e):function(e){return De.call(e)}(e)}function ml(e,t){return e>t}function vl(e,t){return null!=e&&be.call(e,t)}function fl(e,t){return null!=e&&t in me(e)}function hl(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=f(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 m=c[d],v=t?t(m):m;if(m=n||0!==m?m:0,!(p?wt(p,v):l(s,v,n))){for(a=o;--a;){var h=r[a];if(!(h?wt(h,v):l(e[a],v,n)))continue e}p&&p.push(v),s.push(m)}}return s}function gl(e,t,n){var l=null==(e=vo(e,t=oi(t,e)))?e:e[Do(Mo(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=La(e),f=La(t),S=d?a:eo(e),A=f?a:eo(t),D=(S=S==o?v:S)==v,C=(A=A==o?v:A)==v,T=S==A;if(T&&ka(e)){if(!ka(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Bn),d||Xa(e)?ji(e,t,n,l,i,c):function(e,t,n,l,i,o,a){switch(n){case _:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case m: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=Mt;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&&be.call(e,"__wrapped__"),N=C&&be.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Bn),i(w,I,n,l,c)}}return!!T&&(c||(c=new Bn),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:be.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=a;++s<u;){var f=e[c=r[s]],h=t[c];if(l)var g=a?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===g?f===h||i(f,h,n,l,o):g)){m=!1;break}v||(v="constructor"==c)}if(m&&!v){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||(m=!1)}return o.delete(e),o.delete(t),m}(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=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],s=e[u],c=r[1];if(a&&r[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Bn;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 bl(e){return!(!ja(e)||(t=e,Ae&&Ae in t))&&(Fa(e)?xe:ie).test(Co(e));var t}function _l(e){return"function"==typeof e?e:null==e?Vr:"object"==typeof e?La(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 me(e))be.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)?f(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=mr(n,e);return void 0===l&&l===t?vr(n,e):yl(t,l,3)}}function Nl(e,t,n,l,i){e!==t&&ol(t,function(o,a){if(i||(i=new Bn),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=La(u),m=!p&&ka(u),v=!p&&!m&&Xa(u);c=u,p||m||v?La(r)?c=r:Ra(r)?c=fi(r):m?(d=!1,c=si(u,!0)):v?(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 La(e)?function(t){return cl(t,1===e.length?e[0]:e)}:e}):[Vr];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 Ll(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 Ol(e,t,n,l){var i=l?Et:gt,o=-1,a=t.length,r=e;for(e===t&&(t=fi(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 Bl(e,t){return yo(mo(e,t,Vr),e+"")}function Ml(e){return Fn(xr(e))}function Fl(e,t){var n=xr(e);return _o(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}:Vr,jl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:jr(t),writable:!0})}:Vr;function Wl(e){return _o(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=f(i);++l<i;)o[l]=e[l+t];return o}function Vl(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 $l(e,t,Vr,n)}function $l(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,m=null===d,v=d==d,f=Ya(d);if(a)var h=l||v;else h=s?v&&(l||p):r?v&&p&&(l||!m):u?v&&p&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function 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(La(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=vo(e,t=oi(t,e)))||delete e[Do(Mo(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 Ln&&(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=f(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:Vr}function oi(e,t){return La(e)?e:ao(e,t)?[e]:Ao(or(e))}var ai=Bl;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 mi(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=f(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 vi(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=f(c+s),p=!l;++i<c;)d[i]=e[i];for(var m=i;++u<s;)d[m+u]=t[u];for(;++a<r;)(p||i<o)&&(d[m+n[a]]=e[i++]);return d}function fi(e,t){var n=-1,l=e.length;for(t||(t=f(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?$n(n,r,u):Wn(n,r,u)}return n}function gi(e,t){return function(n,l){var i=La(n)?nt:Vn,o=t?t():{};return i(n,e,Gi(l,2),o)}}function Ei(e){return Bl(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=me(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=me(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=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Bt(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 _i(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=me(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"==$i(a))var r=new In([],!0)}for(i=r?i:l;++i<l;){var u=$i(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[$i(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&&La(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,m=24&t,v=512&t,h=p?void 0:Ai(e);return function g(){for(var E=arguments.length,y=f(E),S=E;S--;)y[S]=arguments[S];if(m)var b=qi(g),_=Ot(y,b);if(l&&(y=mi(y,l,i,m)),o&&(y=vi(y,o,a,m)),E-=_,m&&E<s){var A=Ut(y,b);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=fo(y,r):v&&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())),Bl(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 Bt(t)?ri(zt(l),0,e).join(""):l.slice(0,e)}function Li(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=f(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 Oi(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=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Yr;function Bi(e){return function(t){var n=eo(t);return n==p?Mt(t):n==g?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(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,m=a;o=a=void 0}var v=c?void 0:Ki(e),h=[e,t,i,o,a,p,m,r,u,s];if(v&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?vi(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,v),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=f(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=f(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((v?Hl:go)(g,h),e,t)}function Fi(e,t,n,l){return void 0===e||xa(e,Ee[n])&&!be.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,m=2&n?new kn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var v=e[d],f=t[d];if(l)var h=a?l(f,v,d,t,e,o):l(v,f,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(m){if(!mt(t,function(e,t){if(!wt(m,t)&&(v===e||i(v,e,n,l,o)))return m.push(t)})){p=!1;break}}else if(v!==f&&!i(v,f,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function Wi(e){return yo(mo(e,void 0,Oo),e+"")}function zi(e){return dl(e,Er,Ji)}function Vi(e){return dl(e,yr,Qi)}var Ki=gn?function(e){return gn.get(e)}:Yr;function $i(e){for(var t=e.name+"",n=En[t],l=be.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(be.call(xn,"placeholder")?xn:e).placeholder}function Gi(){var e=xn.iteratee||Kr;return e=e===Kr?_l: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 bl(n)?n:void 0}var Ji=Qt?function(e){return null==e?[]:(e=me(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)&&(La(e)||Ia(e))}function no(e){return"function"!=typeof e.constructor||so(e)?{}:Nn(We(e))}function lo(e){return La(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(La(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 me(t)}function ro(e){var t=$i(e),n=xn[t];if("function"!=typeof n||!(t in Ln.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(dn&&eo(new dn(new ArrayBuffer(1)))!=_||pn&&eo(new pn)!=p||mn&&"[object Promise]"!=eo(mn.resolve())||vn&&eo(new vn)!=g||fn&&eo(new fn)!=S)&&(eo=function(e){var t=pl(e),n=t==v?e.constructor:void 0,l=n?Co(n):"";if(l)switch(l){case yn:return _;case Sn:return p;case bn:return"[object Promise]";case _n: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 me(n))}}function mo(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=f(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=f(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function vo(e,t){return t.length<2?e:cl(e,zl(t,0,-1))}function fo(e,t){for(var n=e.length,l=an(t.length,n),i=fi(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=bo(Hl),Eo=Xt||function(e,t){return ze.setTimeout(e,t)},yo=bo(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 bo(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 _o(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=ba(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 Ln)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var xo=Bl(function(e,t){return Ra(e)?Jn(e,il(t,1,Ra,!0)):[]}),No=Bl(function(e,t){var n=Mo(t);return Ra(n)&&(n=void 0),Ra(e)?Jn(e,il(t,1,Ra,!0),Gi(n,2)):[]}),wo=Bl(function(e,t){var n=Mo(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 Lo(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 Oo(e){return null!=e&&e.length?il(e,1):[]}function Po(e){return e&&e.length?e[0]:void 0}var Ro=Bl(function(e){var t=st(e,li);return t.length&&t[0]===e[0]?hl(t):[]}),ko=Bl(function(e){var t=Mo(e),n=st(e,li);return t===Mo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hl(n,Gi(t,2)):[]}),Bo=Bl(function(e){var t=Mo(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 Mo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fo=Bl(Uo);function Uo(e,t){return e&&e.length&&t&&t.length?Ol(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=Bl(function(e){return Xl(il(e,1,Ra,!0))}),zo=Bl(function(e){var t=Mo(e);return Ra(t)&&(t=void 0),Xl(il(e,1,Ra,!0),Gi(t,2))}),Vo=Bl(function(e){var t=Mo(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,bt(t))})}function $o(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var qo=Bl(function(e,t){return Ra(e)?Jn(e,t):[]}),Go=Bl(function(e){return ti(at(e,Ra))}),Yo=Bl(function(e){var t=Mo(e);return Ra(t)&&(t=void 0),ti(at(e,Ra),Gi(t,2))}),Xo=Bl(function(e){var t=Mo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ra),void 0,t)}),Zo=Bl(Ko),Jo=Bl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$o(e,n)});function 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 Ln&&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){be.call(e,n)?++e[n]:$n(e,n,1)}),la=Di(Io),ia=Di(Lo);function oa(e,t){return(La(e)?lt:Qn)(e,Gi(t,3))}function aa(e,t){return(La(e)?it:el)(e,Gi(t,3))}var ra=gi(function(e,t,n){be.call(e,n)?e[n].push(t):$n(e,n,[t])}),ua=Bl(function(e,t,n){var l=-1,i="function"==typeof t,o=Pa(e)?f(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){$n(e,n,t)});function ca(e,t){return(La(e)?st:Cl)(e,Gi(t,3))}var da=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pa=Bl(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),[])}),ma=Yt||function(){return ze.Date.now()};function va(e,t,n){return t=n?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fa(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=Bl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(ha));l|=32}return Mi(e,l,t,n,i)}),ga=Bl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(ga));l|=32}return Mi(t,l,e,n,i)});function Ea(e,t,l){var i,o,a,r,u,s,c=0,d=!1,p=!1,m=!0;if("function"!=typeof e)throw new he(n);function v(t){var n=i,l=o;return i=o=void 0,c=t,r=e.apply(l,n)}function f(e){return c=e,u=Eo(g,t),d?v(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=ma();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,m&&i?v(e):(i=o=void 0,r)}function y(){var e=ma(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return ui(u),u=Eo(g,t),v(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,m="trailing"in l?!!l.trailing:m),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(ma())},y}var ya=Bl(function(e,t){return Zn(e,1,t)}),Sa=Bl(function(e,t,n){return Zn(e,lr(t)||0,n)});function ba(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(ba.Cache||Rn),l}function _a(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)}}ba.Cache=Rn;var Aa=ai(function(e,t){var n=(t=1==t.length&&La(t[0])?st(t[0],xt(Gi())):st(il(t,1),xt(Gi()))).length;return Bl(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=Bl(function(e,t){return Mi(e,32,void 0,t,Ut(t,qi(Da)))}),Ca=Bl(function(e,t){return Mi(e,64,void 0,t,Ut(t,qi(Ca)))}),Ta=Wi(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function xa(e,t){return e===t||e!=e&&t!=t}var Na=Oi(ml),wa=Oi(function(e,t){return e>=t}),Ia=El(function(){return arguments}())?El:function(e){return Wa(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},La=f.isArray,Oa=Ye?xt(Ye):function(e){return Wa(e)&&pl(e)==b};function Pa(e){return null!=e&&Ha(e.length)&&!Fa(e)}function Ra(e){return Wa(e)&&Pa(e)}var ka=en||lu,Ba=Xe?xt(Xe):function(e){return Wa(e)&&pl(e)==u};function Ma(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 Va(e){return"number"==typeof e||Wa(e)&&pl(e)==m}function Ka(e){if(!Wa(e)||pl(e)!=v)return!1;var t=We(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Ce}var $a=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||!La(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)&&!!Be[pl(e)]},Za=Oi(Dl),Ja=Oi(function(e,t){return e<=t});function Qa(e){if(!e)return[];if(Pa(e))return Ga(e)?zt(e):fi(e);if(vt&&e[vt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[vt]());var t=eo(e);return(t==p?Mt: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)be.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=Bl(function(e,t){e=me(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])&&!be.call(e,s))&&(e[s]=o[s])}return e}),pr=Bl(function(e){return e.push(void 0,Ui),tt(br,void 0,e)});function mr(e,t,n){var l=null==e?void 0:cl(e,t);return void 0===l?n:l}function vr(e,t){return null!=e&&to(e,t,fl)}var fr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=n},jr(Vr)),hr=xi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Gi),gr=Bl(gl);function Er(e){return Pa(e)?Mn(e):Al(e)}function yr(e){return Pa(e)?Mn(e,!0):function(e){if(!ja(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Sr=Ei(function(e,t,n){Nl(e,t,n)}),br=Ei(function(e,t,n,l){Nl(e,t,n,l)}),_r=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,Vi(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 Ll(e,t,function(t,n){return vr(e,n)})}(e,t)});function Dr(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Gi(t),Ll(e,n,function(e,n){return t(e,n[0])})}var Cr=Bi(Er),Tr=Bi(yr);function xr(e){return null==e?[]:Nt(e,Er(e))}var Nr=_i(function(e,t,n){return t=t.toLowerCase(),e+(n?wr(t):t)});function wr(e){return Mr(or(e).toLowerCase())}function Ir(e){return(e=or(e))&&e.replace(re,Pt).replace(we,"")}var Lr=_i(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Or=_i(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Pr=bi("toLowerCase"),Rr=_i(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kr=_i(function(e,t,n){return e+(n?" ":"")+Mr(t)}),Br=_i(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Mr=bi("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(Le)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Ur=Bl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ma(e)?e:new ce(e)}}),Hr=Wi(function(e,t){return lt(t,function(t){t=Do(t),$n(e,t,ha(e[t],e))}),e});function jr(e){return function(){return e}}var Wr=Ci(),zr=Ci(!0);function Vr(e){return e}function Kr(e){return _l("function"==typeof e?e:Yn(e,1))}var $r=Bl(function(e,t){return function(n){return gl(n,e,t)}}),qr=Bl(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__=fi(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(mt);function Qr(e){return ao(e)?bt(Do(e)):function(e){return function(t){return cl(t,e)}}(e)}var eu=Li(),tu=Li(!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=va,xn.assign=ar,xn.assignIn=rr,xn.assignInWith=ur,xn.assignWith=sr,xn.at=cr,xn.before=fa,xn.bind=ha,xn.bindAll=Hr,xn.bindKey=ga,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return La(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=f(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=f(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(La(n)?fi(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]]}):[],Bl(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=Mi(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=Mi(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(La(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=Oo,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 Mi(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=Bo,xn.invert=fr,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){$n(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){$n(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=ba,xn.merge=Sr,xn.mergeWith=br,xn.method=$r,xn.methodOf=qr,xn.mixin=Gr,xn.negate=_a,xn.nthArg=function(e){return e=tr(e),Bl(function(t){return wl(t,e)})},xn.omit=_r,xn.omitBy=function(e,t){return Dr(e,_a(Gi(t)))},xn.once=function(e){return fa(2,e)},xn.orderBy=function(e,t,n,l){return null==e?[]:(La(t)||(t=null==t?[]:[t]),La(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?Ol(e,t,Gi(n,2)):e},xn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,void 0,n):e},xn.pullAt=Ho,xn.range=eu,xn.rangeRight=tu,xn.rearg=Ta,xn.reject=function(e,t){return(La(e)?at:ll)(e,_a(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 Bl(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),(La(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(La(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&&!$a(t))&&!(t=Yl(t))&&Bt(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),Bl(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 La(e)?st(e,Do):Ya(e)?[e]:fi(Ao(or(e)))},xn.toPlainObject=ir,xn.transform=function(e,t,n){var l=La(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 va(e,1)},xn.union=Wo,xn.unionBy=zo,xn.unionWith=Vo,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=$o,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))&&M.test(e)?e.replace(k,Rt):e},xn.escapeRegExp=function(e){return(e=or(e))&&K.test(e)?e.replace(V,"\\$&"):e},xn.every=function(e,t,n){var l=La(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 ft(e,Gi(t,3),rl)},xn.findLast=ia,xn.findLastIndex=Lo,xn.findLastKey=function(e,t){return ft(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=mr,xn.gt=Na,xn.gte=wa,xn.has=function(e,t){return null!=e&&to(e,t,vl)},xn.hasIn=vr,xn.head=Po,xn.identity=Vr,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&>(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=La,xn.isArrayBuffer=Oa,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=Ba,xn.isElement=function(e){return Wa(e)&&1===e.nodeType&&!Ka(e)},xn.isEmpty=function(e){if(null==e)return!0;if(Pa(e)&&(La(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(be.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=Ma,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 Va(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 bl(e)},xn.isNil=function(e){return null==e},xn.isNull=function(e){return null===e},xn.isNumber=Va,xn.isObject=ja,xn.isObjectLike=Wa,xn.isPlainObject=Ka,xn.isRegExp=$a,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=Lr,xn.last=Mo,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=Or,xn.lowerFirst=Pr,xn.lt=Za,xn.lte=Ja,xn.max=function(e){return e&&e.length?nl(e,Vr,ml):void 0},xn.maxBy=function(e,t){return e&&e.length?nl(e,Gi(t,2),ml):void 0},xn.mean=function(e){return St(e,Vr)},xn.meanBy=function(e,t){return St(e,Gi(t,2))},xn.min=function(e){return e&&e.length?nl(e,Vr,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=ma,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($,""),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=La(e)?dt:At,i=arguments.length<3;return l(e,Gi(t,4),n,i,Qn)},xn.reduceRight=function(e,t,n){var l=La(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(La(e)?Fn:Ml)(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=La(e)?mt:Vl;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 $l(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 $l(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,Vr):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=ve((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,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 v=be.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(L,""):d).replace(O,"$1").replace(P,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var f=Ur(function(){return de(r,m+"return "+d).apply(void 0,u)});if(f.source=d,Ma(f))throw f;return f},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),Lt(l,i)+1).join("")},xn.trimEnd=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Yl(t)))return e;var l=zt(e);return ri(l,0,Lt(l,zt(t))+1).join("")},xn.trimStart=function(e,t,n){if((e=or(e))&&(n||void 0===t))return e.replace($,"");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(Bt(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),$a(i)){if(e.slice(r).search(i)){var s,c=u;for(i.global||(i=ve(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))&&B.test(e)?e.replace(R,Kt):e},xn.uniqueId=function(e){var t=++_e;return or(e)+t},xn.upperCase=Br,xn.upperFirst=Mr,xn.each=oa,xn.eachRight=aa,xn.first=Po,Gr(xn,(iu={},rl(xn,function(e,t){be.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){Ln.prototype[e]=function(n){n=void 0===n?1:on(tr(n),0);var l=this.__filtered__&&!t?new Ln(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},Ln.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;Ln.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":"");Ln.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Ln.prototype[e]=function(){return this.__filtered__?new Ln(this):this[n](1)}}),Ln.prototype.compact=function(){return this.filter(Vr)},Ln.prototype.find=function(e){return this.filter(e).head()},Ln.prototype.findLast=function(e){return this.reverse().find(e)},Ln.prototype.invokeMap=Bl(function(e,t){return"function"==typeof e?new Ln(this):this.map(function(n){return gl(n,e,t)})}),Ln.prototype.reject=function(e){return this.filter(_a(Gi(e)))},Ln.prototype.slice=function(e,t){e=tr(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ln(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)},Ln.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295)},rl(Ln.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 Ln,u=a[0],s=r||La(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,m=o&&!d,v=r&&!p;if(!o&&s){t=v?t:new Ln(this);var f=e.apply(t,a);return f.__actions__.push({func:ea,args:[c],thisArg:void 0}),new In(f,d)}return m&&v?e.apply(this,a):(f=this.thru(c),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(La(i)?i:[],e)}return this[n](function(n){return t.apply(La(n)?n:[],e)})}}),rl(Ln.prototype,function(e,t){var n=xn[t];if(n){var l=n.name+"";be.call(En,l)||(En[l]=[]),En[l].push({name:t,func:n})}}),En[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],Ln.prototype.clone=function(){var e=new Ln(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},Ln.prototype.reverse=function(){if(this.__filtered__){var e=new Ln(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ln.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=La(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,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ei(e,this.__actions__);var v=[];e:for(;u--&&p<m;){for(var f=-1,h=e[s+=t];++f<d;){var g=c[f],E=g.type,y=(0,g.iteratee)(h);if(2==E)h=y;else if(!y){if(1==E)continue e;break e}}v[p++]=h}return v},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 Ln){var t=e;return this.__actions__.length&&(t=new Ln(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,vt&&(xn.prototype[vt]=function(){return this}),xn}();Ke?((Ke.exports=$t)._=$t,Ve._=$t):ze._=$t}).call(f)});const Ge=e=>l.createElement("h1",{className:"heading-m"},e.label),Ye=()=>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"})),Xe=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ye,null)),Ze=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=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)}),{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,b]=n.useState({}),[_,A]=n.useState([]),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState(null),[O,R]=n.useState([]),[k,B]=n.useState(null),[M,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==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{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:O,selectedFinancialYear:k,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:m}=e;return{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option: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:_,selectedApprover:D,setSelectedApprover:C,selectFile:U,uploadedFile:N,setUploadedFile:w,businessService:p}))},[r,_,O,k,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ge,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Xe,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!k:f||(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:m};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)},Je=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"})),et=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qe,null)),tt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;console.log("ActionModalActions: ",r);const{data: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:v,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,g]=n.useState({}),[E,y]=n.useState({}),[S,b]=n.useState([]),[_,A]=n.useState({}),[D,C]=n.useState(null),[T,x]=n.useState(null),[N,w]=n.useState(null),[I,L]=n.useState([]),[O,R]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&L(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){C(e.target.files[0])}return n.useEffect(()=>{if(m&&k){var e;const t=k["common-masters"].Department;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,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}`}}))}},[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("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:_,setSelectedApprover:A,selectFile:B,uploadedFile:T,setUploadedFile:x,businessService:p}))},[r,S,I,O,T]),r&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Je,{label:a(h.label.heading)}),headerBarEnd:l.createElement(et,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},v?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!=_&&_.uuid?[null==_?void 0:_.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)},nt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),lt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),it=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(lt,null)),ot=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:m,isLoading: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)}),[f,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==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{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=P(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,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select: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:b,setSelectedApprover:_,selectFile:I,uploadedFile:C,setUploadedFile:T,businessService:p,error:x}))},[r,y,C,x]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nt,{label:a(f.label.heading)}),headerBarEnd:l.createElement(it,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.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"}:{}},v?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==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: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)},at=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ut=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rt,null)),st=e=>{var i,o,r,u,s,c,d,p,m,v,f,h;let{t:g,action:E,tenantId:y,closeModal:S,submitAction:b,applicationDetails:_,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===(m=p.nextActions)||void 0===m||null===(v=m.filter(e=>(null==e?void 0:e.action)==(null==E?void 0:E.action)))||void 0===v||null===(f=v[0])||void 0===f||null===(h=f.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,O]=n.useState({}),[R,k]=n.useState([]),[B,M]=n.useState([]),[F,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[V,K]=n.useState(null),[$,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=P(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(()=>{M(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:m,setSelectedApprover:v,selectedBlockReason:f,setBlockReason:h,selectFile:g,uploadedFile:E,setUploadedFile:y,assigneeLabel:S,businessService:b,error:_,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_${b}_${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:v,selected:m})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:A,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:g,onDelete:()=>{y(null)},message:E?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:_})}]}]}})({t:g,action:E,approvers:R,selectedApprover:F,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:V,setUploadedFile:K,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:$,blockReasonFiltered:B}))},[E,R,G,V,$]),E&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:g(w.label.heading)}),headerBarEnd:l.createElement(ut,{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,m,v,f,h,D,T,x,N,w,I,L,O,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===(m=p.processInstances)||void 0===m||null===(v=m[0])||void 0===v||null===(f=v.state)||void 0===f?void 0:f.applicationStatus)?[null==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:V?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]: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===(L=I.state)||void 0===L?void 0:L.applicationStatus)?[null==C||null===(O=C.data)||void 0===O||null===(P=O.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:V?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null};const B=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,m,v;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==_||null===(p=_.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(v=m.Noc)||void 0===v?void 0:v.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,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,m,v,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(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===(m=p.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(v=e.Noc)||void 0===v?void 0:v.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==A.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({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 b({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(B&&B.then?B.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},ct=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),dt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(dt,null)),mt=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[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 O(e){T(e.target.files[0])}return o.useHistory(),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{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=P(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:m,error:v}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:u,action:s,approvers:b,selectedApprover:A,setSelectedApprover:D,selectFile:O,uploadedFile:x,setUploadedFile:N,businessService:v,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[s,b,x,w]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ct,{label:u(g.label.heading)}),headerBarEnd:l.createElement(pt,{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=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=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:m},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};function vt(e){var t=this.__data__=new Oe(e);this.size=t.size}vt.prototype.clear=function(){this.__data__=new Oe,this.size=0},vt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},vt.prototype.get=function(e){return this.__data__.get(e)},vt.prototype.has=function(e){return this.__data__.has(e)},vt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Oe){var l=n.__data__;if(!Pe||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Be(l)}return n.set(e,t),this.size=n.size,this};var ft=vt,ht=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),gt=function(e,t,n){"__proto__"==t&&ht?ht(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Et=Object.prototype.hasOwnProperty,yt=function(e,t,n){var l=e[t];Et.call(e,t)&&Ne(l,n)&&(void 0!==n||t in e)||gt(e,t,n)},St=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?gt(n,r,u):yt(n,r,u)}return n},bt=function(e){return ce(e)&&"[object Arguments]"==se(e)},_t=Object.prototype,At=_t.hasOwnProperty,Dt=_t.propertyIsEnumerable,Ct=bt(function(){return arguments}())?bt:function(e){return ce(e)&&At.call(e,"callee")&&!Dt.call(e,"callee")},Tt=function(){return!1},xt=h(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)||Tt}),Nt=/^(?:0|[1-9]\d*)$/,wt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Nt.test(e))&&e>-1&&e%1==0&&e<t},It=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var Ot=function(e){return function(t){return e(t)}},Pt=h(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}),Rt=Pt&&Pt.isTypedArray,kt=Rt?Ot(Rt):function(e){return ce(e)&&It(e.length)&&!!Lt[se(e)]},Bt=Object.prototype.hasOwnProperty,Mt=function(e,t){var n=J(e),l=!n&&Ct(e),i=!n&&!l&&xt(e),o=!n&&!l&&!i&&kt(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&&!Bt.call(e,s)||a&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wt(s,u))||r.push(s);return r},Ft=Object.prototype,Ut=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ft)},Ht=function(e,t){return function(n){return e(t(n))}},jt=Ht(Object.keys,Object),Wt=Object.prototype.hasOwnProperty,zt=function(e){return null!=e&&It(e.length)&&!fe(e)},Vt=function(e){return zt(e)?Mt(e):function(e){if(!Ut(e))return jt(e);var t=[];for(var n in Object(e))Wt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Kt=Object.prototype.hasOwnProperty,$t=function(e){return zt(e)?Mt(e,!0):function(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Ut(e),n=[];for(var l in e)("constructor"!=l||!t&&Kt.call(e,l))&&n.push(l);return n}(e)},qt=h(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}}),Gt=function(){return[]},Yt=Object.prototype.propertyIsEnumerable,Xt=Object.getOwnPropertySymbols,Zt=Xt?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];Yt.call(e,r)&&(a[o++]=r)}return a}(Xt(e)))}:Gt,Jt=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},Qt=Ht(Object.getPrototypeOf,Object),en=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Jt(t,Zt(e)),e=Qt(e);return t}:Gt,tn=function(e,t,n){var l=t(e);return J(e)?l:Jt(l,n(e))},nn=function(e){return tn(e,Vt,Zt)},ln=function(e){return tn(e,$t,en)},on=_e(te,"DataView"),an=_e(te,"Promise"),rn=_e(te,"Set"),un=_e(te,"WeakMap"),sn=ye(on),cn=ye(Pe),dn=ye(an),pn=ye(rn),mn=ye(un),vn=se;(on&&"[object DataView]"!=vn(new on(new ArrayBuffer(1)))||Pe&&"[object Map]"!=vn(new Pe)||an&&"[object Promise]"!=vn(an.resolve())||rn&&"[object Set]"!=vn(new rn)||un&&"[object WeakMap]"!=vn(new un))&&(vn=function(e){var t=se(e),n="[object Object]"==t?e.constructor:void 0,l=n?ye(n):"";if(l)switch(l){case sn:return"[object DataView]";case cn:return"[object Map]";case dn:return"[object Promise]";case pn:return"[object Set]";case mn:return"[object WeakMap]"}return t});var fn=vn,hn=Object.prototype.hasOwnProperty,gn=te.Uint8Array,En=function(e){var t=new e.constructor(e.byteLength);return new gn(t).set(new gn(e)),t},yn=/\w*$/,Sn=ne?ne.prototype:void 0,bn=Sn?Sn.valueOf:void 0,_n=Object.create,An=function(){function e(){}return function(t){if(!ve(t))return{};if(_n)return _n(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Dn=Pt&&Pt.isMap,Cn=Dn?Ot(Dn):function(e){return ce(e)&&"[object Map]"==fn(e)},Tn=Pt&&Pt.isSet,xn=Tn?Ot(Tn):function(e){return ce(e)&&"[object Set]"==fn(e)},Nn={};Nn["[object Arguments]"]=Nn["[object Array]"]=Nn["[object ArrayBuffer]"]=Nn["[object DataView]"]=Nn["[object Boolean]"]=Nn["[object Date]"]=Nn["[object Float32Array]"]=Nn["[object Float64Array]"]=Nn["[object Int8Array]"]=Nn["[object Int16Array]"]=Nn["[object Int32Array]"]=Nn["[object Map]"]=Nn["[object Number]"]=Nn["[object Object]"]=Nn["[object RegExp]"]=Nn["[object Set]"]=Nn["[object String]"]=Nn["[object Symbol]"]=Nn["[object Uint8Array]"]=Nn["[object Uint8ClampedArray]"]=Nn["[object Uint16Array]"]=Nn["[object Uint32Array]"]=!0,Nn["[object Error]"]=Nn["[object Function]"]=Nn["[object WeakMap]"]=!1;var wn=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(!ve(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]&&hn.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=fn(t),m="[object Function]"==p||"[object GeneratorFunction]"==p;if(xt(t))return qt(t,u);if("[object Object]"==p||"[object Arguments]"==p||m&&!o){if(r=s||m?{}:function(e){return"function"!=typeof e.constructor||Ut(e)?{}:An(Qt(e))}(t),!u)return s?function(e,t){return St(e,en(e),t)}(t,function(e,t){return e&&St(t,$t(t),e)}(r,t)):function(e,t){return St(e,Zt(e),t)}(t,function(e,t){return e&&St(t,Vt(t),e)}(r,t))}else{if(!Nn[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return En(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?En(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?En(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,yn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return bn?Object(bn.call(e)):{}}}(t,p,u)}}a||(a=new ft);var v=a.get(t);if(v)return v;a.set(t,r),xn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):Cn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(c?s?ln:nn:s?$t:Vt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),yt(r,o,e(i,n,l,o,t,a))}),r},In=function(e){return wn(e,5)};const Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),On=()=>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"})),Pn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),Rn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},kn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:m,isLoading: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)}),[f,h]=n.useState({}),[g,E]=n.useState({}),[y,S]=n.useState([]),[b,_]=n.useState({}),[A,D]=n.useState(null),[C,T]=n.useState(null),[N,w]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),L=window.location.href.includes("/employee");function O(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{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=P(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?T(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:m}=e,v=!0,f=!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))&&(v=!1),o.isTerminateState&&(v=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!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:v?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,x({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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:_,selectFile:O,uploadedFile:C,setUploadedFile:T,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:m}=e,v=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==o?void 0:o.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:v?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option: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:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:y,selectedApprover:b,setSelectedApprover:_,selectFile:O,uploadedFile:C,setUploadedFile:T,businessService:p,error:N}))},[r,y,C,N]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ln,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Pn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&L?{width:"100%",height:"auto"}:{}},v?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,p,m,v;if(null!==(t=d)&&void 0!==t&&t.isBillAmend){var f,h,g,E,y,S,_,D,T;const t={...null===(f=d)||void 0===f||null===(h=f.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!==(_=S.applicationType)&&void 0!==_&&_.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(D=d)&&void 0!==D&&null!==(T=D.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]: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:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]}};c({AmendmentUpdate:n})}else{if(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]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:null,processInstance:{...null===(n=d)||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:C?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:C}]:[]}},null!=e&&e.date&&null!==(l=d)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=In(null==e?void 0:e.date);d.disconnectionExecutionDate=Rn(t)}else if(null!=e&&e.date){const t=In(null==e?void 0:e.date);d.connectionExecutionDate=Rn(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===(m=d)||void 0===m?void 0:m.applicationType))c({SewerageConnection:d,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(v=d)||void 0===v?void 0:v.applicationType))c({WaterConnection:d,disconnectRequest:!1,reconnectRequest:!0});else{var N,w,I,L,O,P,R,k,B,M,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===(L=t.value)||void 0===L?void 0:L.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.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!==(B=t.value)&&void 0!==B&&B.adhocRebateComment&&(d.additionalDetails.adhocRebateComment=(null==t||null===(M=t.value)||void 0===M?void 0:M.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)},Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Mn=()=>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"})),Fn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Mn,null)),Un=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==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)}),[f,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==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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Fn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==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:m};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],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)},Hn=e=>l.createElement("h1",{className:"heading-m"},e.label),jn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Wn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jn,null)),zn=e=>{var i,o,a;let{t:r,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const m=Digit.ULBService.getStateId(),{data:v,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==v||null===(i=v.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",d);const[h,g]=n.useState({}),[E,y]=n.useState({}),[S,b]=n.useState([]),[_,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(f||!v||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),n=(null===(e=v.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[f,v,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:_,setSelectedApprover:A,businessService:p}))},[u,w,D,T]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Hn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Wn,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){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:_.length>0?parseInt(_):""}},c({Licenses:[d]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Vn=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"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null)),qn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=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?void 0:r.isTerminateState}),[f,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){I(!0),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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=R(function(){return P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p,isUploading:w}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vn,{label:a(f.label.heading)}),headerBarEnd:l.createElement($n,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==d||null===(t=d.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};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)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),Yn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,null)),Zn=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==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)}),[f,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==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=function(){if(A.size>=5242880)N(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(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:b,setSelectedApprover:_,selectFile:L,uploadedFile:C,setUploadedFile:T,businessService:p}))},[r,y,C]),r&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Xn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};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)},Jn=e=>l.createElement("h1",{className:"heading-m"},e.label),Qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),el=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qn,null)),tl=e=>{var i,a,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v,moduleCode:f}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),g=o.useHistory(),[E,y]=n.useState({}),[S,b]=n.useState({}),[_,A]=n.useState([]),[D,C]=n.useState(null),[T,x]=n.useState(null);return 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(()=>{"INITIATED"===(null==s?void 0:s.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):y((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${l}_${null==n?void 0:n.action}`,cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:_,selectedApprover:D,setSelectedApprover:C,uploadedFile:T,setUploadedFile:x,businessService:v}))},[s,_,T]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Jn,{label:u(E.label.heading)}),headerBarEnd:l.createElement(el,{onClick:d}),actionCancelLabel:u(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};T&&(t.documents=[]),p({Asset:{...m,workflow:t}})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},nl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ze,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Un,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(tt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(zn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(ot,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(st,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(mt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(kn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(qn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Zn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(tl,e):void 0;function ll(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 il=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(),[m,v]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,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;m.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||!(m.length>0))},[m,b]),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(ol,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:v,documents:m,setCheckRequiredFields:_,applicationStatus:c,actions:d,bpaTaxDocuments:g,checkEnablingDocs:A}))))};function ol(e){var i,o;let{t:a,document:r,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],v=Digit.ULBService.getStateId(),[f,h]=n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,_]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[y,f]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=f&&f.code&&r.newUploadedDocs.push({documentType:null==f?void 0:f.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),d[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[b,f]),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(ll,{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:f,optionKey:"i18nKey",select:e=>h(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:v,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&_(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 al(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(ll,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function rl(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(),[m,v]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=P(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):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)}}()},[m]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&v(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const ul=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(),m=(null==s?void 0:s.status)||"",v=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[E,y]=n.useState([]),[S,b]=n.useState([]),[_,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==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==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)}),b(p))},[f,E]),n.useEffect(()=>{A("NOC_VERIFICATION_INPROGRESS"===m&&(null==v?void 0:v.length)>0)},[s,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label: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(ll,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),_&&(null==S?void 0:S.map((e,t)=>l.createElement(rl,{key:t,document:e,t:o,error:T,setError:x,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:_}))))},sl=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 cl(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 dl(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 pl(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 ml=e=>{var o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,x;let{scrutinyDetails:N,paymentsList:w=[],additionalDetails:I,applicationData:L}=e;const O=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==L?void 0:L.status))&&window.location.href.includes("bpa"),[R,k]=n.useState(),[B,M]=n.useState(),[F,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,V]=n.useState(),[K,$]=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=P(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?$([...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),M(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),$(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===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:R,disabled:!O,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(k(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:B,disabled:!O,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>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===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!O,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,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:!O,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(R)?parseFloat(R):0)+parseFloat(B?parseFloat(B):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&&O?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){V(e.target.files[0]),G(e.target.files[0])},disabled:!O,onDelete:()=>{V(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===(b=Q.fileStoreIds[(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(R)?parseFloat(R):0)+parseFloat(B?parseFloat(B):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))))))))},vl=e=>{var o,a,r,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),m=window.Digit.Utils.browser.isMobile(),v=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function 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")||m?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:g(e),columns:h,getCellProps:e=>({style:{}})})))})))},fl=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))},hl=e=>{var o,a,r;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:m}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(fl,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},m("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},m("View Less")))))):null,(null==u||null===(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,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function gl(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${n+1}`),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function El(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${n+1}`),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const yl=e=>{var o,a,r,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const v=null==p?void 0:p.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails: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==f?void 0:f.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},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"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==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:""})))))))},Sl=[{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"}],bl=[{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"}],_l=e=>{var o,a,r,u;let{wsAdditionalDetails:s}=e;const{t:c}=i.useTranslation(),[d,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[v,f,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),[C,T]=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,m,v;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===(m=c[0])||void 0===m?void 0:m.taxAmount)}];w(e),T(null==d||null===(v=d.billDetails)||void 0===v?void 0:v[0])}else p(i),b(i)},[]);let L={};const O=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==C?void 0:C.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(O,{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,m,v,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===(m=d.appDetails)||void 0===m?void 0:m.additionalDetails,...S};s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(v=s.additionalDetails)||void 0===v||null===(h=v.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,m,v,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===(m=d[0])||void 0===m?void 0:m.taxAmount}];f(In(e.Calculation[0])),T(null==e||null===(v=e.Calculation)||void 0===v?void 0:v[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:Sl,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,x({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},L={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,x({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},L={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:bl,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,x({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},L={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,x({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},L={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})))},Al=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"})))},Dl=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(Al,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Cl=e=>{var o,a,r,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:m}=i.useTranslation(),[v,f]=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),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,v&&l.createElement(t.Modal,{headerBarMain:l.createElement(E,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("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:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Tl={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:{}},xl=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:Tl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Tl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Tl.cell,...Tl.cellLeft,...Tl.cellHeader}},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Tl.cell,...n.length==t+1?Tl.cellRight:{},...Tl.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Tl.cell,...Tl.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...Tl.cell,textAlign:"left",...n.length==i+1?Tl.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Tl.cell,...Tl.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Tl.cell,...Tl.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:{...Tl.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Tl.cell,key:t,numeric:!0})))))))},Nl={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},wl=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 m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let v=[];v=Object.keys(m),v.sort((e,t)=>m[e]-m[t]);const[f,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Nl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(xl,{headers:[...v],values:s,arrears:p}),!f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))},Il=e=>{let{assessmentData:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))},Ll=e=>{var t;let{applicationData:i}=e;const[a,r]=n.useState(!1);return o.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Ol=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function Pl(e){var a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b;let{applicationDetails:A,demandData:D,workflowDetails:C,isDataLoading:T,applicationData:x,timelineStatusPrefix:N,showTimeLine:w=!0,statusAttribute:I="status",paymentsList:L,oldValue:O,isInfoLabel:P=!1,propertyId:R}=e;const{t:k}=i.useTranslation(),B=o.useHistory(),M=Digit.ULBService.getCurrentTenantId(),[F,U]=n.useState(null),[H,j]=n.useState([]);let W=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function z(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",A);const[V,K]=n.useState({}),[$,q]=n.useState(),[G,Y]=n.useState([]),[X,Z]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==x?void 0:x.status)||X.loading||X.loaded||X.canLoad||Z({loading:!1,loaded:!1,canLoad:!0}),null==X||!X.canLoad||X.loading||X.loaded||(Z({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(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){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=`${function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)}_${e.financialYear}`,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return Y(o),console.log(o),q(null==i?void 0:i.Assessments),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==x?void 0:x.tenantId)||M,null==x?void 0:x.propertyId,K,Z));const J=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},Q=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:J(null==x||null===(i=x.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==x?void 0:x.channel)||""};return l.createElement(hl,{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,m,v,f,h,g,E,y,S,b,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==A?void 0:A.tenantId,businessIds:null==A?void 0:A.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),n}}},C=n[t-1],T={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==x||null===(c=x.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.uuid)&&null!=x&&null!==(f=x.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(g=h[0])&&void 0!==g&&g.mobileNumber?null==x||null===(E=x.processInstance)||void 0===E||null===(y=E.assignes)||void 0===y||null===(S=y[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(D=b[0])||void 0===D?void 0:D.mobileNumber,comment:k(null==e?void 0:e.comment),wfComment:C?C.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(hl,{data:T,OpenImage:z,privacy:i})}{var C,T,N,w,I;const t={date:J(null==x||null===(C=x.auditDetails)||void 0===C?void 0:C.lastModifiedTime),name:null==e||null===(T=e.assignes)||void 0===T||null===(N=T[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(hl,{data:t})}},ee=(e,t)=>e?t?e:k(e):k("NA"),te=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ne=window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),oe=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${k(null==e?void 0:e.isUnit)}`:k("N/A"):null!=e&&e.value?ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):k("N/A"),[ae,re]=n.useState(!1);console.log("demand Data arr",D),null==D||D.reduce((e,t)=>e+t.demandInterest,0),null==D||D.reduce((e,t)=>e+t.demandPenality,0),null==D||D.reduce((e,t)=>e+t.collectionTax,0),null==D||D.reduce((e,t)=>e+t.collectionInterest,0),null==D||D.reduce((e,t)=>e+t.collectionPenality,0),null==D||D.reduce((e,t)=>e+t.balanceTax,0),null==D||D.reduce((e,t)=>e+t.balanceInterest,0),null==D||D.reduce((e,t)=>e+t.balancePenality,0);const ue=function(e,t,n){try{if(!window.confirm(`Are you sure you want to make this property ${t}?`))return Promise.resolve();const l={...e,status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:{...e.additionalDetails,propertytobestatus:t},workflow:{...e.workflow,businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"}};return Promise.resolve(Digit.PTService.updatePT({Property:{...l}},M,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},se=null==A?void 0:A.applicationData,ce=(null==A||null===(a=A.applicationData)||void 0===a?void 0:a.propertyId)||"",de=null==A||null===(r=A.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return console.log("applicationDetails?.applicationDetails",A),console.log("infolabel",P),console.log("assessment details",$),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:M,filters:{consumerCodes:R},auth:!0}).then(e=>{j(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?l.createElement(Dl,{t:k,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==A||null===(u=A.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,D,T,x,N,w,I,P,R,B,M,F,U,H,j,z,K,$,q,G,Y,X;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:te?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&te?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ne?""+k(e.title):k(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},k(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},k(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},k(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},k(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(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:k(n.title),label:k(n.title),text:l.createElement("img",{src:k(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:k(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},k(null==n?void 0:n.title)))):ne||le?""+k(n.title):k(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+k(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:k(n.title),label:k(n.title),text:oe(n),last:i===(null==e||null===(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:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(wl,{bill:null===(r=V.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(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,additionalDetails:null==A||null===(u=A.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==A?void 0:A.applicationData}),(null==A||null===(s=A.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(al,{fiReport:null==A||null===(m=A.applicationData)||void 0===m||null===(v=m.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(dl,{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(pl,{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(El,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(gl,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories}),!W&&(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions)&&(null==C||null===(T=C.data)||void 0===T||null===(x=T.nextActions)||void 0===x?void 0:x.length)>0&&l.createElement(sl,{applicationData:null==A?void 0:A.applicationData,t:k,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(il,{t:k,applicationData:null==A?void 0:A.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:C})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(ul,{t:k,isNoc:!0,NOCdata:e.values,applicationData:null==A?void 0:A.applicationData,docs:e.additionalDetails.noc,noc:null===(P=e.additionalDetails)||void 0===P?void 0:P.data,bpaActionsDetails:C}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.scruntinyDetails)&&l.createElement(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(ml,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(vl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==A?void 0:A.applicationData}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.documentsWithUrl)&&l.createElement(ll,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(cl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(yl,{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===(K=e.additionalDetails)||void 0===K||null===($=K.redirectUrl)||void 0===$?void 0:$.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(q=e.additionalDetails)||void 0===q||null===(G=q.redirectUrl)||void 0===G?void 0:G.title))),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.estimationDetails)&&l.createElement(_l,{wsAdditionalDetails:e,workflowDetails:C}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Cl,{wsAdditionalDetails:e,workflowDetails:C}))}),(null==$?void 0:$.length)>0&&l.createElement(Il,{assessmentData:G}),l.createElement(Ol,{payments:H}),l.createElement(Ll,{applicationData:null==A?void 0:A.applicationData}),w&&(null==C||null===(s=C.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==C?void 0:C.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=C&&C.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},k("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=C&&null!==(d=C.data)&&void 0!==d&&d.timeline&&1===(null==C||null===(p=C.data)||void 0===p||null===(m=p.timeline)||void 0===m?void 0:m.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:k(`${N}${null==C||null===(v=C.data)||void 0===v||null===(f=v.timeline[0])||void 0===f?void 0:f.state}`),customChild:Q(null==C||null===(h=C.data)||void 0===h?void 0:h.timeline[0],null==C||null===(g=C.data)||void 0===g?void 0:g.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==C||null===(E=C.data)||void 0===E?void 0:E.timeline)&&(null==C||null===(y=C.data)||void 0===y?void 0:y.timeline.slice(0,ae?null==C?void 0:C.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!=C&&null!==(r=C.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!=C&&null!==(c=C.data)&&void 0!==c&&null!==(d=c.timeline[n-1])&&void 0!==d&&null!==(p=d.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:k(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${a}`),customChild:Q(e,n,null==C||null===(o=C.data)||void 0===o?void 0:o.timeline)}))}))),(null==C||null===(S=C.data)||void 0===S||null===(b=S.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:k(ae?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{re(e=>!e)}})))),window.location.href.includes("/pt/")?l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==de?ue(se,"ACTIVE",ce):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==de?ue(se,"INACTIVE",ce):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==A||null===(e=A.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==A||null===(n=A.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==A||null===(l=A.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==A||null===(i=A.applicationData)||void 0===i?void 0:i.status)&&B.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==A||null===(o=A.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==A||null===(a=A.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==A||null===(r=A.applicationData)||void 0===r?void 0:r.status)&&B.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),F&&l.createElement(t.Toast,{error:F.isError,label:k(F.label),onClose:()=>{U(null)},isDleteBtn:"false"}))}function Rl(e){var n,i,o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S;let{t:b,showToast:_,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==_||null===(C=_.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==_?void 0:_.key)?null==_||null===(n=_.error)||void 0===n?void 0:n.message:b("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==_?void 0:_.key)?null==_||null===(i=_.error)||void 0===i?void 0:i.message:b("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==_?void 0:_.key)?null==_||null===(o=_.error)||void 0===o?void 0:o.message:b("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==_?void 0:_.key)?null==_||null===(a=_.error)||void 0===a?void 0:a.message:b("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==_?void 0:_.key)?null==_||null===(r=_.error)||void 0===r?void 0:r.message:b("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==_?void 0:_.key)?null==_||null===(u=_.error)||void 0===u?void 0:u.message:b("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==_?void 0:_.key)?null==_||null===(s=_.error)||void 0===s?void 0:s.message:b("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==_?void 0:_.key)?null==_||null===(c=_.error)||void 0===c?void 0:c.message:b(`ES_${D}_${null==_||null===(d=_.action)||void 0===d?void 0:d.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.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")?b(e[1]):b(e[0]),n};let n="";switch(null==_||null===(T=_.action)||void 0===T?void 0:T.action){case"REVOCATE":n="error"===(null==_?void 0:_.key)?null==_||null===(p=_.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==_?void 0:_.key)?null==_||null===(m=_.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==_?void 0:_.key)?null==_||null===(v=_.error)||void 0===v?void 0:v.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==_?void 0:_.key)?null==_||null===(f=_.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==_?void 0:_.key)?null==_||null===(h=_.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==_?void 0:_.key)?null==_||null===(g=_.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==_?void 0:_.key)?null==_||null===(E=_.error)||void 0===E?void 0:E.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==_?void 0:_.key)?null==_||null===(y=_.error)||void 0===y?void 0:y.message:b(`ES_${D}_${null==_||null===(S=_.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.key,label:n,onClose:A}))}{var x,N;const e="error"===(null==_?void 0:_.key)?null==_||null===(x=_.error)||void 0===x?void 0:x.message:`ES_${D}_${null==_||null===(N=_.action)||void 0===N?void 0:N.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,_&&l.createElement(t.Toast,{error:"error"===_.key,label:b(e),onClose:A}))}}function kl(e){var o,a,r,u,s,c,d,p,m,v,f,h,g,E,y,S;let{workflowDetails:b,displayMenu:_,onActionSelect:A,setDisplayMenu:D,businessService:C,forcedActionPrefix:T,ActionBarStyle:x={},MenuStyle:N={}}=e;const{t:w}=i.useTranslation();let I=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):{};I=null==t?void 0:t.value}const O=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==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(d=b.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(L,()=>{D(!1)},_),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(m=k[0])&&void 0!==m&&null!==(v=m.redirectionUrl)&&void 0!==v&&v.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(R=!1,P=!0):(null==k?void 0:k.length)>0&&(R=!0,P=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&R&&!P&&l.createElement(t.ActionBar,{style:{...x}},_&&(null!=b&&null!==(f=b.data)&&void 0!==f&&null!==(h=f.actionState)&&void 0!==h&&h.nextActions||null!=b&&null!==(g=b.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:L,label:w("WF_TAKE_ACTION"),onSubmit:()=>D(!_)})),!(null!=b&&b.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 Bl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bl,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(Ml,{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,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(d,"BPA",["BlockReason"]),{t:m}=i.useTranslation(),v=o.useHistory();let{id:f}=o.useParams();const[h,g]=n.useState(!1),[E,y]=n.useState(null),[S,b]=n.useState(!1),[_,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:O,isLoading:R,isDataLoading:k,applicationData:B,mutate:M,nocMutation:F,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:K,statusAttribute:$,ActionBarStyle:q,MenuStyle:G,paymentsList:Y,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{L&&U.revalidate()},[L]);const te=a.useQueryClient(),ne=()=>{y(null),b(!1)};return R||_?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,R?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Pl,{applicationDetails:x,demandData:N,id:H,workflowDetails:U,isDataLoading:k,applicationData:B,totalDemandTax:w,totalBalanceTax:I,businessService:j,timelineStatusPrefix:V,statusAttribute:$,paymentsList:Y,showTimeLine:X,oldValue:Z,isInfoLabel:J,propertyId:ee}),S?l.createElement(nl,{t:m,action:E,tenantId:c,state:d,id:f,applicationDetails:x,applicationData:null==x?void 0:x.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,u,s,c,d,p,f,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===(f=e.Licenses)||void 0===f||null===(h=f[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===(b=e.SewerageConnection)||void 0===b||null===(_=b.comment)||void 0===_?void 0:_.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(m("Please fill in the validity before submitting")):alert(m("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;M&&(A(!0),M(e,{onError:(e,t)=>{A(!1),O({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,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&v.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var s,c,d,p,f,h,g,y;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?O({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?O({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(h=f.workflow)&&void 0!==h&&h.action.includes("APPROVE")?O({key:"success",label:m("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")&&O({key:"success",label:m("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 O({key:"success",action:E}),void v.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber));O({key:"success",action:E}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}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=P(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,v;A(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?m(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(),O({key:"error",error:{message:f}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(u=p.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Fl,{action:E,workflowDetails:U,businessService:j,isWarningPop:D,closeWarningPopup:()=>{C(!1)}}):null,l.createElement(Rl,{t:m,showToast:L,closeToast:W,businessService:j}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==B?void 0:B.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,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===(d=u.BPA)||void 0===d||null===(p=d.additionalDetails)||void 0===p||null===(v=p.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(kl,{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]);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))v.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;v.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var d;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var p,m;v.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(m=e.redirectionUrl)||void 0===m?void 0:m.state}})}else b(!0);y(e),g(!1)},setDisplayMenu:g,businessService:j,forcedActionPrefix:K,ActionBarStyle:q,MenuStyle:G}))))};var Hl=l.memo(()=>{var e,a,r,u,s;const{t:c}=i.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),{id:p}=o.useParams(),[m,v]=n.useState(null),[f,h]=n.useState({}),[g,E]=n.useState(!1),{isLoading:y,data:S}=Digit.Hooks.ads.useADSApplicationDetail(c,d,p),b=Digit.Hooks.ads.useADSCreateAPI(d,!1),{data:_,refetch:A}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:{bookingNo:p,audit:!0}});n.useEffect(()=>{S&&h(qe.cloneDeep(S))},[S]);const{data:D,isLoading:C}=Digit.Hooks.useRecieptSearch({tenantId:d,businessService:"adv-services",consumerCodes:null==f||null===(e=f.applicationData)||void 0===e||null===(a=e.applicationData)||void 0===a?void 0:a.bookingNo,isEmployee:!1},{enabled:!(null==f||null===(r=f.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==_||null===(i=_.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(b.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==_||null===(l=_.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(b.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(Ul,{applicationDetails:null==f?void 0:f.applicationData,isLoading:y,isDataLoading:y,applicationData:null==f||null===(s=f.applicationData)||void 0===s?void 0:s.applicationData,showToast:m,setShowToast:v,closeToast:()=>{v(null)},MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const jl=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:a}=i.useTranslation(),r=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},a(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:r(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},Wl=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<r.length?d():o===r.length&&n()}function c(){o>1&&p()}const d=()=>a(o+1),p=()=>a(o-1);return l.createElement(jl,{currentStep:o,nextStep:d,prevStep:p,stepsList:r},(()=>{var e,t;const n=r[o-1],{component:i,key:a,texts:d,currStepConfig:p}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:a,texts:d,component:i,currStepNumber:o,currStepConfig:p},onGoNext:s,onBackClick:c,t:u}))})())},zl=[{head:"ES_TITILE_OWNER_DETAILS",stepNumber:1,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_PET_DETAILS",stepNumber:2,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Vl=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Kl=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),$l=[{head:"OWNER DETAILS",stepLabel:"ES_TITILE_OWNER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>({...e,currStepConfig:zl.filter(t=>t.stepNumber===e.stepNumber)})),ql=e=>{let{t:i,goNext:o,currentStepData:a}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.ownerDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+i("NDC_FIRST_NAME")),l.createElement(r.Controller,{control:u,name:"firstName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NDC_LAST_NAME")),l.createElement(r.Controller,{control:u,name:"lastName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_EMAIL_LABEL")),l.createElement(r.Controller,{control:u,name:"emailId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(r.Controller,{control:u,name:"mobileNumber",render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:i})}),l.createElement(t.CardLabel,null,""+i("ADVT_CHALLAN_UNDER_SECTION_122_123_SGST")),l.createElement(r.Controller,{control:u,name:"SGST",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("PT_COMMON_COL_ADDRESS")),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{name:"address",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement("div",{style:{marginTop:"20px"}},l.createElement(r.Controller,{control:u,name:"selfDeclaration",render:e=>l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"}},l.createElement("input",{value:e.value,type:"checkbox",id:"selfDeclaration",checked:e.value||!1,onChange:t=>e.onChange(t.target.checked),onBlur:e.onBlur,style:{width:"18px",height:"18px",cursor:"pointer"}}),l.createElement("label",{htmlFor:"selfDeclaration",style:{fontSize:"14px",lineHeight:"1.5",cursor:"pointer"}},i("BILLAMENDMENT_SELFDECLARATION_LABEL")))}))),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},Gl=[{i18nKey:"PTR_GENDER",code:"123",name:"test"}],Yl=e=>{let{onGoBack:i,goNext:o,currentStepData:a}=e;const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.pets;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,"Search By site id"),l.createElement(r.Controller,{control:u,name:"siteId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Site Name"),l.createElement(r.Controller,{control:u,name:"siteName",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Geo Location"),l.createElement(r.Controller,{control:u,name:"geoLocation",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Address"),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Size"),l.createElement(r.Controller,{control:u,name:"size",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"Advertisement Type"),l.createElement(r.Controller,{control:u,name:"advertisementType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:Gl,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,"Start Date"),l.createElement(r.Controller,{control:u,name:"startDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,"End Date"),l.createElement(r.Controller,{control:u,name:"endDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:i}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function Xl(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:s,action:c,formData:d,handleSubmit:p,id:m}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[f,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?{...v,active:!0===(null==a?void 0:a.active),code:null==v?void 0:v.documentType}:1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[g,E]=n.useState(null),[y,S]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:b}=a;var _=b;const[A,D]=n.useState(!1),[C,T]=n.useState(!1);return n.useEffect(()=>{null!=f&&f.code&&(console.log("selectedDocument",s),r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==f?void 0:f.code,filestoreId:y,documentUid:y}]}))},[y,f]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents",s),p())},[s]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],l=_.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)):D(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||h({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(g){T(!0);const e=function(){if(g.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=P(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",g,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;T(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?S(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){T(!1),u(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[g]),n.useEffect(()=>{A&&S(null)},[A]),l.createElement("div",{style:{marginBottom:"24px"}},C&&l.createElement(t.Loader,null),null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))),l.createElement(t.Dropdown,{className:"form-field",selected:f,style:{width:"100%"},option:_.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>h(e),optionKey:"i18nKey",t:o})):null,null!=a&&a.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))+" *")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{S(null)},id:m,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}))))}const Zl={step:1,isValid:!1,formData:{}},Jl=function(e,t){switch(void 0===e&&(e=Zl),t.type){case"UPDATE_ADSNewApplication_FORM":return{...e,formData:{...e.formData,[t.payload.key]:t.payload.value}};case"SET_ADSNewApplication_STEP":return{...e,step:t.payload};case"RESET_ADS_NEW_APPLICATION_FORM":return Zl;default:return e}},Ql={ADSCreate:e=>{var n,r,u,s;const c=a.useQueryClient(),d=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[E,y,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:_}=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=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=g.find(e=>e.route===(o||"0")),s=f.push;if(e&&(s=f.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(_)return l.createElement(t.Loader,null);b=v,b.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:p,formData:E,onAdd:C}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(T,{onSubmit:function(){try{return f.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 m=Digit.UserService.getUser().info,[v,f]=n.useState(p.adslist&&p.adslist[0]&&p.adslist[0].cartDetails||(null==p||null===(i=p.adslist)||void 0===i?void 0:i.cartDetails)||[]),[h,E]=n.useState(null==p?void 0:p.adType),[y,S]=n.useState(null==p?void 0:p.location),[_,A]=n.useState(null==p?void 0:p.faceArea),[D,T]=n.useState(!0),[x,N]=n.useState(null==p?void 0:p.fromDate),[w,I]=n.useState([]),[L,O]=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,B]=n.useState(null),[M,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(),[V,K]=n.useState(!1);let $=[],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=>{$.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:v,adsType:h,selectedLocation:y,selectedFace:_,selectNight:j,fromDate:x,toDate:L,existingDataSet:U},s(c.key,{...p[c.key],...e},!1,0)):(e={...t,Searchdata:P,cartDetails:v,adsType:h,selectNight:j,selectedLocation:y,selectedFace:_,fromDate:x,toDate:L,existingDataSet:U},s(c.key,e,!1,0)),console.log("ownerStep",e)};n.useEffect(()=>{"citizen"===d&&re()},[v,h,j,_,y,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(()=>{B(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:h,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:h,select:e=>{E(e)},placeholder:"Select Advertisement Type",option:$,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:y,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:y,select:e=>{S(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:_,rules:{required:u("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:_,select:e=>{A(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"===m.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:L,onChange:function(e){O(e.target.value)},style:{width:"EMPLOYEE"===m.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==h?void 0:h.code,t=x,n=L,l=null==_?void 0:_.code,i=null==y?void 0:y.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(h&&t&&n&&l&&i&&o){if(new Date(t)>new Date(n))return void B({error:!0,label:u("ADS_INVALID_DATE_RANGE")});R({addType:e,faceArea:l,location:i,nightLight:o,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else B({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 B({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=te.filter(e=>w.includes(e.slotId)),t=v.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: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 B({error:!0,label:u("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void I([])}f(e=>[...e,...n]),B({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:()=>{v.length>0?K(!0):B({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," ",v.length)))),V&&l.createElement(C,{onClose:()=>{K(!1)},cartDetails:v,setCartDetails:f}),l.createElement(t.SubmitBar,{label:u("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?B({error:!0,label:u("ADS_SELECT_AT_LEAST_ONE_SLOT")}):D?F(!0):re()}}))),le&&l.createElement(t.Card,{style:{overflowX:"auto"}},l.createElement(g,{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:()=>{B(null)}}),M&&l.createElement(b,{t:u,closeModal:()=>F(!1),actionCancelOnSubmit:()=>F(!1),onSubmit:()=>{re(),F(!1)},setExistingDataSet:H,Searchdata:v}))},ADSCitizenDetails:e=>{var i,a,r,u,s,c,d,p,m,v,f,h,g,E,y;let{t:S,config:b,onSelect:_,userType:A,formData:D,value:C=D.adslist}=e;o.useLocation();let T=window.location.href.charAt(window.location.href.length-1),N={};const I=Digit.UserService.getUser().info,L=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),P=Digit.Hooks.ads.useADSCreateAPI(),[R,B]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].applicantName||(null==D||null===(i=D.applicant)||void 0===i?void 0:i.applicantName)||(null==C||null===(a=C.existingDataSet)||void 0===a||null===(r=a.applicant)||void 0===r?void 0:r.applicantName)||""),[M,F]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].emailId||(null==D||null===(u=D.applicant)||void 0===u?void 0:u.emailId)||(null==C||null===(s=C.existingDataSet)||void 0===s||null===(c=s.applicant)||void 0===c?void 0:c.emailId)||""),[U,H]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].mobileNumber||(null==C||null===(d=C.existingDataSet)||void 0===d||null===(p=d.applicant)||void 0===p?void 0:p.mobileNumber)||(null==D||null===(m=D.applicant)||void 0===m?void 0:m.mobileNumber)||(null==I?void 0:I.mobileNumber)),[j,W]=n.useState(D.applicant&&D.applicant[T]&&D.applicant[T].alternateNumber||(null==D||null===(v=D.applicant)||void 0===v?void 0:v.alternateNumber)||(null==C||null===(f=C.existingDataSet)||void 0===f||null===(h=f.applicant)||void 0===h?void 0:h.alternateNumber)||""),z=()=>{let e=D.applicant&&D.applicant[T],t=null==C?void 0:C.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:L,applicantDetail:{applicantName:R,applicantMobileNo:U,applicantAlternateMobileNo:j,applicantEmailId:M},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:R,mobileNumber:U,alternateNumber:j,emailId:M,draftId:l},_(b.key,{...D[b.key],...i},!1,T)):(i={...e,applicantName:R,mobileNumber:U,alternateNumber:j,emailId:M,draftId:l},_(b.key,i,!1,T))}})};return n.useEffect(()=>{"citizen"===A&&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==C||null===(g=C.existingDataSet)||void 0===g||null===(E=g.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==C?void 0:C.cartDetails,draftId:null==C||null===(y=C.existingDataSet)||void 0===y?void 0:y.draftId})),l.createElement(O,null))),l.createElement(t.FormStep,{config:b,onSelect:z,onSkip:()=>_(),t:S,isDisabled:!R||!U||!M},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,x({t:S,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,"");B(t)},style:{width:"EMPLOYEE"===I.type?"51.6%":null},ValidationRequired:!0},N={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"===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: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"===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: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,x({t:S,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:M,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:S("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var i,a,u,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,N,I,L,P,R,B,M,F,U;let{t:H,config:j,onSelect:W,userType:z,formData:V,value:K=V.adslist}=e;o.useLocation();let $=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(V.address&&V.address[$]&&V.address[$].pincode||(null==V||null===(i=V.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(V.address&&V.address[$]&&V.address[$].city||(null==V||null===(s=V.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(V.address&&V.address[$]&&V.address[$].locality||(null==V||null===(p=V.address)||void 0===p?void 0:p.locality)||(null==K||null===(m=K.existingDataSet)||void 0===m||null===(v=m.address)||void 0===v?void 0:v.locality)||""),[ie,oe]=n.useState(V.address&&V.address[$]&&V.address[$].streetName||(null==V||null===(f=V.address)||void 0===f?void 0:f.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(V.address&&V.address[$]&&V.address[$].houseNo||(null==V||null===(E=V.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(V.address&&V.address[$]&&V.address[$].landmark||(null==V||null===(b=V.address)||void 0===b?void 0:b.landmark)||(null==K||null===(_=K.existingDataSet)||void 0===_||null===(A=_.address)||void 0===A?void 0:A.landmark)||""),[ce,de]=n.useState(V.address&&V.address[$]&&V.address[$].houseName||(null==V||null===(D=V.address)||void 0===D?void 0:D.houseName)||(null==K||null===(C=K.existingDataSet)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.houseName)||""),[pe,me]=n.useState(V.address&&V.address[$]&&V.address[$].addressline1||(null==V||null===(N=V.address)||void 0===N?void 0:N.addressline1)||(null==K||null===(I=K.existingDataSet)||void 0===I||null===(L=I.address)||void 0===L?void 0:L.addressline1)||""),[ve,fe]=n.useState(V.address&&V.address[$]&&V.address[$].addressline2||(null==V||null===(P=V.address)||void 0===P?void 0:P.addressline2)||(null==K||null===(R=K.existingDataSet)||void 0===R||null===(B=R.address)||void 0===B?void 0:B.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==V||null===(e=V.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==V||null===(t=V.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==V||null===(n=V.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==V||null===(l=V.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==V||null===(i=V.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:ve,houseNo:ae,landmark:ue},cartDetails:r,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};Z.mutate(u);let s={...V.address&&V.address[$],pincode:J,city:ee,locality:ne,streetName:ie,houseNo:ae,landmark:ue,houseName:ce,addressline1:pe,addressline2:ve};W(j.key,{...V[j.key],...s},!1,$)},{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==K||null===(M=K.existingDataSet)||void 0===M||null===(F=M.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(O,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,x({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,x({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=>{me(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:ve,placeholder:"Enter Address",onChange:e=>{fe(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,x({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:m,onSelect:v,formData:f,value:h=f.adslist}=e;const[g,E]=n.useState((null==f||null===(i=f.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(),x=Digit.ULBService.getStateId(),{isLoading:N,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(x,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.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)}),_("0"!=t&&0!=t||!(g.length>0))},[g,A]),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==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(O,null))),N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:p,config:m,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==f||null===(e=f.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==f||null===(t=f.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==f||null===(n=f.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==f||null===(l=f.applicant)||void 0===l?void 0:l.alternateNumber,applicantEmailId:null==f||null===(i=f.applicant)||void 0===i?void 0:i.emailId},addressdetails:{pincode:null==f||null===(o=f.address)||void 0===o?void 0:o.pincode,city:null==f||null===(a=f.address)||void 0===a||null===(r=a.city)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.name,cityCode:null==f||null===(s=f.address)||void 0===s||null===(c=s.city)||void 0===c||null===(d=c.city)||void 0===d?void 0:d.code,locality:null==f||null===(p=f.address)||void 0===p||null===(E=p.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==f||null===(y=f.address)||void 0===y||null===(S=y.locality)||void 0===S?void 0:S.code,streetName:null==f||null===(b=f.address)||void 0===b?void 0:b.streetName,addressLine1:null==f||null===(_=f.address)||void 0===_?void 0:_.addressline1,addressLine2:null==f||null===(A=f.address)||void 0===A?void 0:A.addressline2,houseNo:null==f||null===(D=f.address)||void 0===D?void 0:D.houseNo,landmark:null==f||null===(x=f.address)||void 0===x?void 0:x.landmark},documents:g,cartDetails:N,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let I;T.mutate(w),I={...f.documents,documents:g},v(m.key,I)},onSkip:()=>v(),isDisabled:b,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==I||null===(c=I.Advertisement)||void 0===c||null===(d=c.Documents)||void 0===d?void 0:d.map((e,t)=>l.createElement(B,{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,u,s,d,p,m,v,f,h,E;let{onSubmit:y,value:S={}}=e;const{t:b}=i.useTranslation(),[_,A]=(o.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:D,isEditADS:C,isUpdateADS:T,documents:x,address:N}=S,I=C||T?"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:()=>O(n.index)},l.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],O=e=>{var t;const n={..._};null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},P=(null==_||null===(a=_.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[R,B]=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==_||null===(r=_.adslist)||void 0===r||null===(u=r.existingDataSet)||void 0===u||null===(s=u.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==_||null===(d=_.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==_||null===(p=_.adslist)||void 0===p||null===(m=p.existingDataSet)||void 0===m?void 0:m.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==D?void 0:D.applicantName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(c(null==D?void 0:D.mobileNumber)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(c(null==D?void 0:D.alternateNumber)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/applicant-details`})}),l.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(c(null==D?void 0:D.emailId)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/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==N?void 0:N.houseNo)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(c(null==N?void 0:N.houseName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(c(null==N?void 0:N.streetName)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(c(null==N?void 0:N.addressline1)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(c(null==N?void 0:N.addressline2)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(c(null==N?void 0:N.landmark)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(c(null==N||null===(v=N.city)||void 0===v||null===(f=v.city)||void 0===f?void 0:f.name)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(c(null==N||null===(h=N.locality)||void 0===h?void 0:h.i18nKey)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})}),l.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(c(null==N?void 0:N.pincode)),actionButton:l.createElement(F,{jumpTo:`/digit-ui/citizen/ads/${I}/address-details`})})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),l.createElement(g,{t:b,data:P,columns:L,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==_||null===(E=_.adslist)||void 0===E?void 0:E.cartDetails.length}),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Card,null,x&&(null==x?void 0:x.documents.map((e,t)=>l.createElement(M,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),l.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{B(!R)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:y,disabled:!R})))},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),m=(Digit.Hooks.useStore.getInitData(),o.useRouteMatch(),o.useHistory()),v=Digit.UserService.getUser().info,[f,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(f){const e=setTimeout(()=>{h(null)},2e3);return()=>clearTimeout(e)}},[f]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(j,{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:H,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),p.isSuccess&&l.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},"EMPLOYEE"===v.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),"CITIZEN"===v.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=P(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"===v.type){var u,s,f,g;m.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===(f=p.data)||void 0===f||null===(g=f.bookingApplication[0])||void 0===g?void 0:g.bookingNo,timerValue:r,SlotSearchData:o}})}else if("EMPLOYEE"===v.type){var E,y,S,b;m.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===(b=S.bookingApplication[0])||void 0===b?void 0:b.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"===v.type&&l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),!p.isSuccess&&"EMPLOYEE"===v.type&&l.createElement(o.Link,{to:"/digit-ui/employee"},l.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME")})),f&&l.createElement(t.Toast,{error:f.error,warning:f.warning,label:c(f.label),onClose:()=>{h(null)}}))},ADSCard:W,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,m]=n.useState(null);let v,f,h=window.location.href.split("/").pop();isNaN(parseInt(h))?v=4:(f=h,v=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:f,tenantId:a};n.useEffect(()=>{m(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")}],b=(null==y?void 0:y.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: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};m(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,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&&!E&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),0!==b.length&&(null==y?void 0:y.count)>v&&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/"+v},e("ADS_LOAD_MORE_MSG")))))))},ApplicationDetails:Hl,ADSApplicationDetails:()=>{var e,a,r,u,s,c,d,p,m,v,f,h,E,y,S,b,_,A,D,C,T;const{t:x}=i.useTranslation(),{acknowledgementIds:N,tenantId:w}=(o.useHistory(),o.useParams()),[I,L]=n.useState([]),[O,P]=n.useState(!1),[R,k]=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,V]=n.useState(null),K=$e(H,"bookingApplication",[]),$=$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){V(e),X(!1)})}catch(e){return Promise.reject(e)}}()},[w,N]);const{isLoading:Z}=Digit.Hooks.ads.useADSSearch({tenantId:w,filters:{bookingNo:$,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(!O),displayOptions:O,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===(m=q.applicantDetail)||void 0===m?void 0:m.applicantName)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_MOBILE_NUMBER"),text:(null==q||null===(v=q.applicantDetail)||void 0===v?void 0:v.applicantMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ALT_MOBILE_NUMBER"),text:(null==q||null===(f=q.applicantDetail)||void 0===f?void 0:f.applicantAlternateMobileNo)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_EMAIL_ID"),text:(null==q||null===(h=q.applicantDetail)||void 0===h?void 0:h.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===(b=q.address)||void 0===b?void 0:b.addressLine1)||x("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:x("ADS_ADDRESS_LINE2"),text:(null==q||null===(_=q.address)||void 0===_?void 0:_.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(g,{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(M,{value:ee,Code:null==e?void 0:e.documentType,index:t}))))))},ADSSearchApplication:q,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:m,data:v={}}=Digit.Hooks.ads.useADSDocumentsMDMS(p,"Advertisement","Documents");let f=null==v||null===(n=v.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,m&&l.createElement(t.Loader,null),Array.isArray(f)?f.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}))))},NewADSStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=u.useDispatch(),[r,s]=n.useState(null),c=u.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{a({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("ADS_REGISTRATION_APPLICATION")),l.createElement(Wl,{stepsList:$l,onSubmit:e=>{console.log("dataGet===",e)},step:c,setStep:e=>{a(Kl(e))}}),r&&l.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{s(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{let{config:o,onGoNext:a,onBackClick:r}=e;const s=u.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(ql,{onGoBack:function(e){r(o.key,e)},goNext:function(e){s(Vl(o.key,e)),a()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewADSStepFormTwo:e=>{let{config:o,onBackClick:a,onGoNext:r}=e;const{t:s}=i.useTranslation(),c=u.useDispatch(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(Yl,{onGoBack:function(e){a(o.key,e)},goNext:function(e){c(Vl(o.key,e)),r()},currentStepData:f,t:s}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewADSStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const s=u.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),v=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.ads.ADSNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:v,config:i.currStepConfig,onSubmit:function(e){console.log("goNext data in NewPTRStepFormThree: ",e);const{missingFields:t}={missingFields:[],notFormattedFields:[]};if(t.length>0)return m("Please fill the following field: "+t[0]),void d(!0);o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!qe.isEqual(t,v)),qe.isEqual(t,v)||s(Vl(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},NewADSStepFormFour:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const s=u.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),v=u.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData||{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:v,config:i.currStepConfig,onSubmit:function(e){o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!qe.isEqual(t,v)),qe.isEqual(t,v)||s(Vl(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},ADSCitizenDetailsNew:ql,ADSCitizenSecond:Yl,ADSSelectProofIdentity:e=>{var i,o,a;let{t:r,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[d,p]=n.useState(null==c||null===(i=c.documents)||void 0===i?void 0:i.documents),[m,v]=n.useState(null),[f,h]=n.useState(!0),[g,E]=n.useState(!1),y=Digit.ULBService.getStateId(),{isLoading:S,data:b}=Digit.Hooks.pt.usePropertyMDMS(y,"NDC",["Documents"]);console.log("formDataINPTRDOCUMENT",d,c);const _=()=>{let e;e={...c.documents,documents:d},s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==b||null===(e=b.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==d||d.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),h("0"!=n&&0!=n||!((null==d?void 0:d.length)>0))},[d,g]),l.createElement("div",null,S?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:r,config:u,onSelect:_,onSkip:()=>s(),isDisabled:f,onAdd:function(){}},null==b||null===(o=b.NDC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>l.createElement(Xl,{key:t,document:e,t:r,error:m,setError:v,setDocuments:p,documents:d,setCheckRequiredFields:E,handleSubmit:_})),m&&l.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0})))},ADSSummary:function(e){var n,i,a,r,s,c,d,p,m,v,f,h,g,E,y,S,b,_,A,D,C,T,x,N,w,I,L,O,P,R,k,B;let{formData:M,t:F}=e;o.useLocation(),o.useHistory();const U=u.useDispatch();return l.createElement("div",{className:"application-summary"},l.createElement("h2",{style:{fontSize:"20px",fontWeight:"bold"}},F("Application Summary")),l.createElement(t.Card,{className:"summary-section",style:{padding:"2px"}},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Owner Details")),l.createElement("label",{onClick:()=>U(Kl(1))},F("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("First Name")),l.createElement("div",null,(null==M||null===(n=M.ownerss)||void 0===n||null===(i=n.ownerss)||void 0===i?void 0:i.firstName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Last Name")),l.createElement("div",null,(null==M||null===(a=M.ownerss)||void 0===a||null===(r=a.ownerss)||void 0===r?void 0:r.lastName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Father's Name")),l.createElement("div",null,(null==M||null===(s=M.ownerss)||void 0===s||null===(c=s.ownerss)||void 0===c?void 0:c.fatherName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Mobile Number")),l.createElement("div",null,(null==M||null===(d=M.ownerss)||void 0===d||null===(p=d.ownerss)||void 0===p?void 0:p.mobileNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Email ID")),l.createElement("div",null,(null==M||null===(m=M.ownerss)||void 0===m||null===(v=m.ownerss)||void 0===v?void 0:v.emailId)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Address")),l.createElement("div",null,(null==M||null===(f=M.ownerss)||void 0===f||null===(h=f.ownerss)||void 0===h?void 0:h.address)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Pet Details")),l.createElement("label",{onClick:()=>U(Kl(2))},F("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Name")),l.createElement("div",null,(null==M||null===(g=M.pets)||void 0===g||null===(E=g.pets)||void 0===E?void 0:E.petName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Type")),l.createElement("div",null,(null==M||null===(y=M.pets)||void 0===y||null===(S=y.pets)||void 0===S||null===(b=S.petType)||void 0===b?void 0:b.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Breed Type")),l.createElement("div",null,(null==M||null===(_=M.pets)||void 0===_||null===(A=_.pets)||void 0===A||null===(D=A.breedType)||void 0===D?void 0:D.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Pet Gender")),l.createElement("div",null,(null==M||null===(C=M.pets)||void 0===C||null===(T=C.pets)||void 0===T||null===(x=T.petGender)||void 0===x?void 0:x.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Color")),l.createElement("div",null,(null==M||null===(N=M.pets)||void 0===N||null===(w=N.pets)||void 0===w?void 0:w.color)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Vaccination Number")),l.createElement("div",null,(null==M||null===(I=M.pets)||void 0===I||null===(L=I.pets)||void 0===L?void 0:L.vaccinationNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Last Vaccine Date")),l.createElement("div",null,(null==M||null===(O=M.pets)||void 0===O||null===(P=O.pets)||void 0===P?void 0:P.lastVaccineDate)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,F("Documents")),l.createElement("label",{onClick:()=>U(Kl(3))},F("EDIT"))),l.createElement("div",{className:"section-content"},null==M||null===(R=M.documents)||void 0===R||null===(k=R.documents)||void 0===k||null===(B=k.documents)||void 0===B?void 0:B.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Document Type")),l.createElement("div",null,F(null==e?void 0:e.documentType)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,F("Document UID")),l.createElement("div",null,(null==e?void 0:e.documentUid)||"NA")))))))}},ei=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(Ql).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(Y,{path:r,url:u,userType:i}):l.createElement(m,null)},ti=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(T,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:ei,ADSLinks:ti,ADSCard:W},exports.ADSLinks=ti,exports.ADSModule=ei,exports.ADSReducers=()=>s.combineReducers({ADSNewApplicationFormReducer:Jl});
|