text: !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var n=[],i=Object.getPrototypeOf,a=n.slice,s=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},o=n.push,r=n.indexOf,l={},c=l.toString,d=l.hasOwnProperty,u=d.toString,h=u.call(Object),p={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},m=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var i,a,s=(n=n||g).createElement("script");if(s.text=e,t)for(i in v)(a=t[i]||t.getAttribute&&t.getAttribute(i))&&s.setAttribute(i,a);n.head.appendChild(s).parentNode.removeChild(s)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.5.1",C=function(e,t){return new C.fn.init(e,t)};function x(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!f(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}C.fn=C.prototype={jquery:b,constructor:C,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=C.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return C.each(this,e)},map:function(e){return this.pushStack(C.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(C.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(C.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},C.extend=C.fn.extend=function(){var e,t,n,i,a,s,o=arguments[0]||{},r=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[r]||{},r++),"object"==typeof o||f(o)||(o={}),r===l&&(o=this,r--);r<l;r++)if(null!=(e=arguments[r]))for(t in e)i=e[t],"__proto__"!==t&&o!==i&&(c&&i&&(C.isPlainObject(i)||(a=Array.isArray(i)))?(n=o[t],s=a&&!Array.isArray(n)?[]:a||C.isPlainObject(n)?n:{},a=!1,o[t]=C.extend(c,s,i)):void 0!==i&&(o[t]=i));return o},C.extend({expando:"jQuery"+(b+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]"!==c.call(e)||(t=i(e))&&("function"!=typeof(n=d.call(t,"constructor")&&t.constructor)||u.call(n)!==h))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,i=0;if(x(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(x(Object(e))?C.merge(n,"string"==typeof e?[e]:e):o.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,i=0,a=e.length;i<n;i++)e[a++]=t[i];return e.length=a,e},grep:function(e,t,n){for(var i=[],a=0,s=e.length,o=!n;a<s;a++)!t(e[a],a)!==o&&i.push(e[a]);return i},map:function(e,t,n){var i,a,o=0,r=[];if(x(e))for(i=e.length;o<i;o++)null!=(a=t(e[o],o,n))&&r.push(a);else for(o in e)null!=(a=t(e[o],o,n))&&r.push(a);return s(r)},guid:1,support:p}),"function"==typeof Symbol&&(C.fn[Symbol.iterator]=n[Symbol.iterator]),C.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}));var T=function(e){var t,n,i,a,s,o,r,l,c,d,u,h,p,f,m,g,v,y,w,b="sizzle"+1*new Date,C=e.document,x=0,T=0,_=le(),$=le(),S=le(),k=le(),M=function(e,t){return e===t&&(u=!0),0},D={}.hasOwnProperty,L=[],A=L.pop,E=L.push,H=L.push,N=L.slice,I=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},j="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",R="(?:\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",q="\\["+O+"*("+R+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+O+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",P=new RegExp(O+"+","g"),B=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),U=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),J=new RegExp(O+"|>"),z=new RegExp(W),Q=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\([^\\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))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ae=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},se=function(){h()},oe=be((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{H.apply(L=N.call(C.childNodes),C.childNodes),L[C.childNodes.length].nodeType}catch(t){H={apply:L.length?function(e,t){E.apply(e,N.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function re(e,t,i,a){var s,r,c,d,u,f,v,y=t&&t.ownerDocument,C=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==C&&9!==C&&11!==C)return i;if(!a&&(h(t),t=t||p,m)){if(11!==C&&(u=Z.exec(e)))if(s=u[1]){if(9===C){if(!(c=t.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(y&&(c=y.getElementById(s))&&w(t,c)&&c.id===s)return i.push(c),i}else{if(u[2])return H.apply(i,t.getElementsByTagName(e)),i;if((s=u[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(i,t.getElementsByClassName(s)),i}if(n.qsa&&!k[e+" "]&&(!g||!g.test(e))&&(1!==C||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===C&&(J.test(e)||U.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((d=t.getAttribute("id"))?d=d.replace(ie,ae):t.setAttribute("id",d=b)),r=(f=o(e)).length;r--;)f[r]=(d?"#"+d:":scope")+" "+we(f[r]);v=f.join(",")}try{return H.apply(i,y.querySelectorAll(v)),i}catch(t){k(e,!0)}finally{d===b&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,i,a)}function le(){var e=[];return function t(n,a){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=a}}function ce(e){return e[b]=!0,e}function de(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),a=n.length;a--;)i.attrHandle[n[a]]=t}function he(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,i){for(var a,s=e([],n.length,t),o=s.length;o--;)n[a=s[o]]&&(n[a]=!(i[a]=n[a]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=re.support={},s=re.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!G.test(t||n&&n.nodeName||"HTML")},h=re.setDocument=function(e){var t,a,o=e?e.ownerDocument||e:C;return o!=p&&9===o.nodeType&&o.documentElement&&(f=(p=o).documentElement,m=!s(p),C!=p&&(a=p.defaultView)&&a.top!==a&&(a.addEventListener?a.addEventListener("unload",se,!1):a.attachEvent&&a.attachEvent("onunload",se)),n.scope=de((function(e){return f.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=de((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=de((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=de((function(e){return f.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.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}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,a,s=t.getElementById(e);if(s){if((n=s.getAttributeNode("id"))&&n.value===e)return[s];for(a=t.getElementsByName(e),i=0;s=a[i++];)if((n=s.getAttributeNode("id"))&&n.value===e)return[s]}return[]}}),i.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,i=[],a=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[a++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=K.test(p.querySelectorAll))&&(de((function(e){var t;f.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+O+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+O+"*name"+O+"*="+O+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),de((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+O+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=K.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&de((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",W)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=K.test(f.compareDocumentPosition),w=t||K.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},M=t?function(e,t){if(e===t)return u=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==p||e.ownerDocument==C&&w(C,e)?-1:t==p||t.ownerDocument==C&&w(C,t)?1:d?I(d,e)-I(d,t):0:4&i?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,i=0,a=e.parentNode,s=t.parentNode,o=[e],r=[t];if(!a||!s)return e==p?-1:t==p?1:a?-1:s?1:d?I(d,e)-I(d,t):0;if(a===s)return he(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)r.unshift(n);for(;o[i]===r[i];)i++;return i?he(o[i],r[i]):o[i]==C?-1:r[i]==C?1:0}),p},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!k[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){k(t,!0)}return 0<re(t,p,null,[e]).length},re.contains=function(e,t){return(e.ownerDocument||e)!=p&&h(e),w(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=p&&h(e);var a=i.attrHandle[t.toLowerCase()],s=a&&D.call(i.attrHandle,t.toLowerCase())?a(e,t,!m):void 0;return void 0!==s?s:n.attributes||!m?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},re.escape=function(e){return(e+"").replace(ie,ae)},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,i=[],a=0,s=0;if(u=!n.detectDuplicates,d=!n.sortStable&&e.slice(0),e.sort(M),u){for(;t=e[s++];)t===e[s]&&(a=i.push(s));for(;a--;)e.splice(i[a],1)}return d=null,e},a=re.getText=function(e){var t,n="",i=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[i++];)n+=a(t);return n},(i=re.selectors={cacheLength:50,createPseudo:ce,match:V,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 V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&z.test(n)&&(t=o(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=_[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&_(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(i){var a=re.attr(i,e);return null==a?"!="===t:!t||(a+="","="===t?a===n:"!="===t?a!==n:"^="===t?n&&0===a.indexOf(n):"*="===t?n&&-1<a.indexOf(n):"$="===t?n&&a.slice(-n.length)===n:"~="===t?-1<(" "+a.replace(P," ")+" ").indexOf(n):"|="===t&&(a===n||a.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,a){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),r="of-type"===t;return 1===i&&0===a?function(e){return!!e.parentNode}:function(t,n,l){var c,d,u,h,p,f,m=s!==o?"nextSibling":"previousSibling",g=t.parentNode,v=r&&t.nodeName.toLowerCase(),y=!l&&!r,w=!1;if(g){if(s){for(;m;){for(h=t;h=h[m];)if(r?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&y){for(w=(p=(c=(d=(u=(h=g)[b]||(h[b]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===x&&c[1])&&c[2],h=p&&g.childNodes[p];h=++p&&h&&h[m]||(w=p=0)||f.pop();)if(1===h.nodeType&&++w&&h===t){d[e]=[x,p,w];break}}else if(y&&(w=p=(c=(d=(u=(h=t)[b]||(h[b]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===x&&c[1]),!1===w)for(;(h=++p&&h&&h[m]||(w=p=0)||f.pop())&&((r?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++w||(y&&((d=(u=h[b]||(h[b]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]=[x,w]),h!==t)););return(w-=a)===i||w%i==0&&0<=w/i}}},PSEUDO:function(e,t){var n,a=i.pseudos[e]||i.setFilters[e.toLowerCase()]||re.error("unsupported pseudo: "+e);return a[b]?a(t):1<a.length?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var i,s=a(e,t),o=s.length;o--;)e[i=I(e,s[o])]=!(n[i]=s[o])})):function(e){return a(e,0,n)}):a}},pseudos:{not:ce((function(e){var t=[],n=[],i=r(e.replace(B,"$1"));return i[b]?ce((function(e,t,n,a){for(var s,o=i(e,null,a,[]),r=e.length;r--;)(s=o[r])&&(e[r]=!(t[r]=s))})):function(e,a,s){return t[0]=e,i(t,null,s,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return 0<re(e,t).length}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return-1<(t.textContent||a(t)).indexOf(e)}})),lang:ce((function(e){return Q.test(e||"")||re.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!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!i.pseudos.empty(e)},header:function(e){return Y.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:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ge((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ge((function(e,t,n){for(var i=n<0?n+t:t<n?t:n;0<=--i;)e.push(i);return e})),gt:ge((function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e}))}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pe(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=fe(t);function ye(){}function we(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function be(e,t,n){var i=t.dir,a=t.next,s=a||i,o=n&&"parentNode"===s,r=T++;return t.first?function(t,n,a){for(;t=t[i];)if(1===t.nodeType||o)return e(t,n,a);return!1}:function(t,n,l){var c,d,u,h=[x,r];if(l){for(;t=t[i];)if((1===t.nodeType||o)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||o)if(d=(u=t[b]||(t[b]={}))[t.uniqueID]||(u[t.uniqueID]={}),a&&a===t.nodeName.toLowerCase())t=t[i]||t;else{if((c=d[s])&&c[0]===x&&c[1]===r)return h[2]=c[2];if((d[s]=h)[2]=e(t,n,l))return!0}return!1}}function Ce(e){return 1<e.length?function(t,n,i){for(var a=e.length;a--;)if(!e[a](t,n,i))return!1;return!0}:e[0]}function xe(e,t,n,i,a){for(var s,o=[],r=0,l=e.length,c=null!=t;r<l;r++)(s=e[r])&&(n&&!n(s,i,a)||(o.push(s),c&&t.push(r)));return o}function Te(e,t,n,i,a,s){return i&&!i[b]&&(i=Te(i)),a&&!a[b]&&(a=Te(a,s)),ce((function(s,o,r,l){var c,d,u,h=[],p=[],f=o.length,m=s||function(e,t,n){for(var i=0,a=t.length;i<a;i++)re(e,t[i],n);return n}(t||"*",r.nodeType?[r]:r,[]),g=!e||!s&&t?m:xe(m,h,e,r,l),v=n?a||(s?e:f||i)?[]:o:g;if(n&&n(g,v,r,l),i)for(c=xe(v,p),i(c,[],r,l),d=c.length;d--;)(u=c[d])&&(v[p[d]]=!(g[p[d]]=u));if(s){if(a||e){if(a){for(c=[],d=v.length;d--;)(u=v[d])&&c.push(g[d]=u);a(null,v=[],c,l)}for(d=v.length;d--;)(u=v[d])&&-1<(c=a?I(s,u):h[d])&&(s[c]=!(o[c]=u))}}else v=xe(v===o?v.splice(f,v.length):v),a?a(null,o,v,l):H.apply(o,v)}))}function _e(e){for(var t,n,a,s=e.length,o=i.relative[e[0].type],r=o||i.relative[" "],l=o?1:0,d=be((function(e){return e===t}),r,!0),u=be((function(e){return-1<I(t,e)}),r,!0),h=[function(e,n,i){var a=!o&&(i||n!==c)||((t=n).nodeType?d(e,n,i):u(e,n,i));return t=null,a}];l<s;l++)if(n=i.relative[e[l].type])h=[be(Ce(h),n)];else{if((n=i.filter[e[l].type].apply(null,e[l].matches))[b]){for(a=++l;a<s&&!i.relative[e[a].type];a++);return Te(1<l&&Ce(h),1<l&&we(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l<a&&_e(e.slice(l,a)),a<s&&_e(e=e.slice(a)),a<s&&we(e))}h.push(n)}return Ce(h)}return ye.prototype=i.filters=i.pseudos,i.setFilters=new ye,o=re.tokenize=function(e,t){var n,a,s,o,r,l,c,d=$[e+" "];if(d)return t?0:d.slice(0);for(r=e,l=[],c=i.preFilter;r;){for(o in n&&!(a=F.exec(r))||(a&&(r=r.slice(a[0].length)||r),l.push(s=[])),n=!1,(a=U.exec(r))&&(n=a.shift(),s.push({value:n,type:a[0].replace(B," ")}),r=r.slice(n.length)),i.filter)!(a=V[o].exec(r))||c[o]&&!(a=c[o](a))||(n=a.shift(),s.push({value:n,type:o,matches:a}),r=r.slice(n.length));if(!n)break}return t?r.length:r?re.error(e):$(e,l).slice(0)},r=re.compile=function(e,t){var n,a,s,r,l,d,u=[],f=[],g=S[e+" "];if(!g){for(t||(t=o(e)),n=t.length;n--;)(g=_e(t[n]))[b]?u.push(g):f.push(g);(g=S(e,(a=f,r=0<(s=u).length,l=0<a.length,d=function(e,t,n,o,d){var u,f,g,v=0,y="0",w=e&&[],b=[],C=c,T=e||l&&i.find.TAG("*",d),_=x+=null==C?1:Math.random()||.1,$=T.length;for(d&&(c=t==p||t||d);y!==$&&null!=(u=T[y]);y++){if(l&&u){for(f=0,t||u.ownerDocument==p||(h(u),n=!m);g=a[f++];)if(g(u,t||p,n)){o.push(u);break}d&&(x=_)}r&&((u=!g&&u)&&v--,e&&w.push(u))}if(v+=y,r&&y!==v){for(f=0;g=s[f++];)g(w,b,t,n);if(e){if(0<v)for(;y--;)w[y]||b[y]||(b[y]=A.call(o));b=xe(b)}H.apply(o,b),d&&!e&&0<b.length&&1<v+s.length&&re.uniqueSort(o)}return d&&(x=_,c=C),w},r?ce(d):d))).selector=e}return g},l=re.select=function(e,t,n,a){var s,l,c,d,u,h="function"==typeof e&&e,p=!a&&o(e=h.selector||e);if(n=n||[],1===p.length){if(2<(l=p[0]=p[0].slice(0)).length&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&i.relative[l[1].type]){if(!(t=(i.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(s=V.needsContext.test(e)?0:l.length;s--&&(c=l[s],!i.relative[d=c.type]);)if((u=i.find[d])&&(a=u(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(s,1),!(e=a.length&&we(l)))return H.apply(n,a),n;break}}return(h||r(e,p))(a,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=b.split("").sort(M).join("")===b,n.detectDuplicates=!!u,h(),n.sortDetached=de((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),de((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||ue("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&de((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ue("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),de((function(e){return null==e.getAttribute("disabled")}))||ue(j,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),re}(e);C.find=T,C.expr=T.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=T.uniqueSort,C.text=T.getText,C.isXMLDoc=T.isXML,C.contains=T.contains,C.escapeSelector=T.escape;var _=function(e,t,n){for(var i=[],a=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&C(e).is(n))break;i.push(e)}return i},$=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=C.expr.match.needsContext;function k(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return f(t)?C.grep(e,(function(e,i){return!!t.call(e,i,e)!==n})):t.nodeType?C.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?C.grep(e,(function(e){return-1<r.call(t,e)!==n})):C.filter(t,e,n)}C.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?C.find.matchesSelector(i,e)?[i]:[]:C.find.matches(e,C.grep(t,(function(e){return 1===e.nodeType})))},C.fn.extend({find:function(e){var t,n,i=this.length,a=this;if("string"!=typeof e)return this.pushStack(C(e).filter((function(){for(t=0;t<i;t++)if(C.contains(a[t],this))return!0})));for(n=this.pushStack([]),t=0;t<i;t++)C.find(e,a[t],n);return 1<i?C.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&S.test(e)?C(e):e||[],!1).length}});var L,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(e,t,n){var i,a;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:A.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),M.test(i[1])&&C.isPlainObject(t))for(i in t)f(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(a=g.getElementById(i[2]))&&(this[0]=a,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):f(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this)}).prototype=C.fn,L=C(g);var E=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(C.contains(this,t[e]))return!0}))},closest:function(e,t){var n,i=0,a=this.length,s=[],o="string"!=typeof e&&C(e);if(!S.test(e))for(;i<a;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?-1<o.index(n):1===n.nodeType&&C.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(1<s.length?C.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?r.call(C(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(C.uniqueSort(C.merge(this.get(),C(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),C.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return _(e,"parentNode")},parentsUntil:function(e,t,n){return _(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return _(e,"nextSibling")},prevAll:function(e){return _(e,"previousSibling")},nextUntil:function(e,t,n){return _(e,"nextSibling",n)},prevUntil:function(e,t,n){return _(e,"previousSibling",n)},siblings:function(e){return $((e.parentNode||{}).firstChild,e)},children:function(e){return $(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(k(e,"template")&&(e=e.content||e),C.merge([],e.childNodes))}},(function(e,t){C.fn[e]=function(n,i){var a=C.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(a=C.filter(i,a)),1<this.length&&(H[e]||C.uniqueSort(a),E.test(e)&&a.reverse()),this.pushStack(a)}}));var I=/[^\x20\t\r\n\f]+/g;function j(e){return e}function O(e){throw e}function R(e,t,n,i){var a;try{e&&f(a=e.promise)?a.call(e).done(t).fail(n):e&&f(a=e.then)?a.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}C.Callbacks=function(e){var t,n;e="string"==typeof e?(t=e,n={},C.each(t.match(I)||[],(function(e,t){n[t]=!0})),n):C.extend({},e);var i,a,s,o,r=[],l=[],c=-1,d=function(){for(o=o||e.once,s=i=!0;l.length;c=-1)for(a=l.shift();++c<r.length;)!1===r[c].apply(a[0],a[1])&&e.stopOnFalse&&(c=r.length,a=!1);e.memory||(a=!1),i=!1,o&&(r=a?[]:"")},u={add:function(){return r&&(a&&!i&&(c=r.length-1,l.push(a)),function t(n){C.each(n,(function(n,i){f(i)?e.unique&&u.has(i)||r.push(i):i&&i.length&&"string"!==w(i)&&t(i)}))}(arguments),a&&!i&&d()),this},remove:function(){return C.each(arguments,(function(e,t){for(var n;-1<(n=C.inArray(t,r,n));)r.splice(n,1),n<=c&&c--})),this},has:function(e){return e?-1<C.inArray(e,r):0<r.length},empty:function(){return r&&(r=[]),this},disable:function(){return o=l=[],r=a="",this},disabled:function(){return!r},lock:function(){return o=l=[],a||i||(r=a=""),this},locked:function(){return!!o},fireWith:function(e,t){return o||(t=[e,(t=t||[]).slice?t.slice():t],l.push(t),i||d()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!s}};return u},C.extend({Deferred:function(t){var n=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return a.then(null,e)},pipe:function(){var e=arguments;return C.Deferred((function(t){C.each(n,(function(n,i){var a=f(e[i[4]])&&e[i[4]];s[i[1]]((function(){var e=a&&a.apply(this,arguments);e&&f(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,a?[e]:arguments)}))})),e=null})).promise()},then:function(t,i,a){var s=0;function o(t,n,i,a){return function(){var r=this,l=arguments,c=function(){var e,c;if(!(t<s)){if((e=i.apply(r,l))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,f(c)?a?c.call(e,o(s,n,j,a),o(s,n,O,a)):(s++,c.call(e,o(s,n,j,a),o(s,n,O,a),o(s,n,j,n.notifyWith))):(i!==j&&(r=void 0,l=[e]),(a||n.resolveWith)(r,l))}},d=a?c:function(){try{c()}catch(e){C.Deferred.exceptionHook&&C.Deferred.exceptionHook(e,d.stackTrace),s<=t+1&&(i!==O&&(r=void 0,l=[e]),n.rejectWith(r,l))}};t?d():(C.Deferred.getStackHook&&(d.stackTrace=C.Deferred.getStackHook()),e.setTimeout(d))}}return C.Deferred((function(e){n[0][3].add(o(0,e,f(a)?a:j,e.notifyWith)),n[1][3].add(o(0,e,f(t)?t:j)),n[2][3].add(o(0,e,f(i)?i:O))})).promise()},promise:function(e){return null!=e?C.extend(e,a):a}},s={};return C.each(n,(function(e,t){var o=t[2],r=t[5];a[t[1]]=o.add,r&&o.add((function(){i=r}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),o.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=o.fireWith})),a.promise(s),t&&t.call(s,s),s},when:function(e){var t=arguments.length,n=t,i=Array(n),s=a.call(arguments),o=C.Deferred(),r=function(e){return function(n){i[e]=this,s[e]=1<arguments.length?a.call(arguments):n,--t||o.resolveWith(i,s)}};if(t<=1&&(R(e,o.done(r(n)).resolve,o.reject,!t),"pending"===o.state()||f(s[n]&&s[n].then)))return o.then();for(;n--;)R(s[n],r(n),o.reject);return o.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&q.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},C.readyException=function(t){e.setTimeout((function(){throw t}))};var W=C.Deferred();function P(){g.removeEventListener("DOMContentLoaded",P),e.removeEventListener("load",P),C.ready()}C.fn.ready=function(e){return W.then(e).catch((function(e){C.readyException(e)})),this},C.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--C.readyWait:C.isReady)||(C.isReady=!0)!==e&&0<--C.readyWait||W.resolveWith(g,[C])}}),C.ready.then=W.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(C.ready):(g.addEventListener("DOMContentLoaded",P),e.addEventListener("load",P));var B=function(e,t,n,i,a,s,o){var r=0,l=e.length,c=null==n;if("object"===w(n))for(r in a=!0,n)B(e,t,r,n[r],!0,s,o);else if(void 0!==i&&(a=!0,f(i)||(o=!0),c&&(o?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(C(e),n)})),t))for(;r<l;r++)t(e[r],n,o?i:i.call(e[r],r,t(e[r],n)));return a?e:c?t.call(e):l?t(e[0],n):s},F=/^-ms-/,U=/-([a-z])/g;function J(e,t){return t.toUpperCase()}function z(e){return e.replace(F,"ms-").replace(U,J)}var Q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function V(){this.expando=C.expando+V.uid++}V.uid=1,V.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,a=this.cache(e);if("string"==typeof t)a[z(t)]=n;else for(i in t)a[z(i)]=t[i];return a},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][z(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,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(z):(t=z(t))in i?[t]:t.match(I)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||C.isEmptyObject(i))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!C.isEmptyObject(t)}};var G=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var i,a;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===(a=n)||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}catch(e){}X.set(e,t,n)}else n=void 0;return n}C.extend({hasData:function(e){return X.hasData(e)||G.hasData(e)},data:function(e,t,n){return X.access(e,t,n)},removeData:function(e,t){X.remove(e,t)},_data:function(e,t,n){return G.access(e,t,n)},_removeData:function(e,t){G.remove(e,t)}}),C.fn.extend({data:function(e,t){var n,i,a,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(a=X.get(s),1===s.nodeType&&!G.get(s,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&(i=z(i.slice(5)),Z(s,i,a[i]));G.set(s,"hasDataAttrs",!0)}return a}return"object"==typeof e?this.each((function(){X.set(this,e)})):B(this,(function(t){var n;if(s&&void 0===t)return void 0!==(n=X.get(s,e))||void 0!==(n=Z(s,e))?n:void 0;this.each((function(){X.set(this,e,t)}))}),null,t,1<arguments.length,null,!0)},removeData:function(e){return this.each((function(){X.remove(this,e)}))}}),C.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=G.get(e,t),n&&(!i||Array.isArray(n)?i=G.access(e,t,C.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=C.queue(e,t),i=n.length,a=n.shift(),s=C._queueHooks(e,t);"inprogress"===a&&(a=n.shift(),i--),a&&("fx"===t&&n.unshift("inprogress"),delete s.stop,a.call(e,(function(){C.dequeue(e,t)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:C.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),C.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?C.queue(this[0],e):void 0===t?this:this.each((function(){var n=C.queue(this,e,t);C._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&C.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){C.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,a=C.Deferred(),s=this,o=this.length,r=function(){--i||a.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=G.get(s[o],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(r));return r(),a.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],ie=g.documentElement,ae=function(e){return C.contains(e.ownerDocument,e)},se={composed:!0};ie.getRootNode&&(ae=function(e){return C.contains(e.ownerDocument,e)||e.getRootNode(se)===e.ownerDocument});var oe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ae(e)&&"none"===C.css(e,"display")};function re(e,t,n,i){var a,s,o=20,r=i?function(){return i.cur()}:function(){return C.css(e,t,"")},l=r(),c=n&&n[3]||(C.cssNumber[t]?"":"px"),d=e.nodeType&&(C.cssNumber[t]||"px"!==c&&+l)&&te.exec(C.css(e,t));if(d&&d[3]!==c){for(l/=2,c=c||d[3],d=+l||1;o--;)C.style(e,t,d+c),(1-s)*(1-(s=r()/l||.5))<=0&&(o=0),d/=s;d*=2,C.style(e,t,d+c),n=n||[]}return n&&(d=+d||+l||0,a=n[1]?d+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=d,i.end=a)),a}var le={};function ce(e,t){for(var n,i,a,s,o,r,l,c=[],d=0,u=e.length;d<u;d++)(i=e[d]).style&&(n=i.style.display,t?("none"===n&&(c[d]=G.get(i,"display")||null,c[d]||(i.style.display="")),""===i.style.display&&oe(i)&&(c[d]=(l=o=s=void 0,o=(a=i).ownerDocument,r=a.nodeName,(l=le[r])||(s=o.body.appendChild(o.createElement(r)),l=C.css(s,"display"),s.parentNode.removeChild(s),"none"===l&&(l="block"),le[r]=l)))):"none"!==n&&(c[d]="none",G.set(i,"display",n)));for(d=0;d<u;d++)null!=c[d]&&(e[d].style.display=c[d]);return e}C.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){oe(this)?C(this).show():C(this).hide()}))}});var de,ue,he=/^(?:checkbox|radio)$/i,pe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;de=g.createDocumentFragment().appendChild(g.createElement("div")),(ue=g.createElement("input")).setAttribute("type","radio"),ue.setAttribute("checked","checked"),ue.setAttribute("name","t"),de.appendChild(ue),p.checkClone=de.cloneNode(!0).cloneNode(!0).lastChild.checked,de.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!de.cloneNode(!0).lastChild.defaultValue,de.innerHTML="<option></option>",p.option=!!de.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&k(e,t)?C.merge([e],n):n}function ve(e,t){for(var n=0,i=e.length;n<i;n++)G.set(e[n],"globalEval",!t||G.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,p.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function we(e,t,n,i,a){for(var s,o,r,l,c,d,u=t.createDocumentFragment(),h=[],p=0,f=e.length;p<f;p++)if((s=e[p])||0===s)if("object"===w(s))C.merge(h,s.nodeType?[s]:s);else if(ye.test(s)){for(o=o||u.appendChild(t.createElement("div")),r=(pe.exec(s)||["",""])[1].toLowerCase(),l=me[r]||me._default,o.innerHTML=l[1]+C.htmlPrefilter(s)+l[2],d=l[0];d--;)o=o.lastChild;C.merge(h,o.childNodes),(o=u.firstChild).textContent=""}else h.push(t.createTextNode(s));for(u.textContent="",p=0;s=h[p++];)if(i&&-1<C.inArray(s,i))a&&a.push(s);else if(c=ae(s),o=ge(u.appendChild(s),"script"),c&&ve(o),n)for(d=0;s=o[d++];)fe.test(s.type||"")&&n.push(s);return u}var be=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xe=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function _e(){return!1}function $e(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function Se(e,t,n,i,a,s){var o,r;if("object"==typeof t){for(r in"string"!=typeof n&&(i=i||n,n=void 0),t)Se(e,r,n,i,t[r],s);return e}if(null==i&&null==a?(a=n,i=n=void 0):null==a&&("string"==typeof n?(a=i,i=void 0):(a=i,i=n,n=void 0)),!1===a)a=_e;else if(!a)return e;return 1===s&&(o=a,(a=function(e){return C().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=C.guid++)),e.each((function(){C.event.add(this,t,a,i,n)}))}function ke(e,t,n){n?(G.set(e,t,!1),C.event.add(e,t,{namespace:!1,handler:function(e){var i,s,o=G.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(C.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=a.call(arguments),G.set(this,t,o),i=n(this,t),this[t](),o!==(s=G.get(this,t))||i?G.set(this,t,!1):s={},o!==s)return e.stopImmediatePropagation(),e.preventDefault(),s.value}else o.length&&(G.set(this,t,{value:C.event.trigger(C.extend(o[0],C.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&C.event.add(e,t,Te)}C.event={global:{},add:function(e,t,n,i,a){var s,o,r,l,c,d,u,h,p,f,m,g=G.get(e);if(Q(e))for(n.handler&&(n=(s=n).handler,a=s.selector),a&&C.find.matchesSelector(ie,a),n.guid||(n.guid=C.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return void 0!==C&&C.event.triggered!==t.type?C.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(I)||[""]).length;c--;)p=m=(r=xe.exec(t[c])||[])[1],f=(r[2]||"").split(".").sort(),p&&(u=C.event.special[p]||{},p=(a?u.delegateType:u.bindType)||p,u=C.event.special[p]||{},d=C.extend({type:p,origType:m,data:i,handler:n,guid:n.guid,selector:a,needsContext:a&&C.expr.match.needsContext.test(a),namespace:f.join(".")},s),(h=l[p])||((h=l[p]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,i,f,o)||e.addEventListener&&e.addEventListener(p,o)),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),C.event.global[p]=!0)},remove:function(e,t,n,i,a){var s,o,r,l,c,d,u,h,p,f,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(I)||[""]).length;c--;)if(p=m=(r=xe.exec(t[c])||[])[1],f=(r[2]||"").split(".").sort(),p){for(u=C.event.special[p]||{},h=l[p=(i?u.delegateType:u.bindType)||p]||[],r=r[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;s--;)d=h[s],!a&&m!==d.origType||n&&n.guid!==d.guid||r&&!r.test(d.namespace)||i&&i!==d.selector&&("**"!==i||!d.selector)||(h.splice(s,1),d.selector&&h.delegateCount--,u.remove&&u.remove.call(e,d));o&&!h.length&&(u.teardown&&!1!==u.teardown.call(e,f,g.handle)||C.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)C.event.remove(e,p+t[c],n,i,!0);C.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,i,a,s,o,r=new Array(arguments.length),l=C.event.fix(e),c=(G.get(this,"events")||Object.create(null))[l.type]||[],d=C.event.special[l.type]||{};for(r[0]=l,t=1;t<arguments.length;t++)r[t]=arguments[t];if(l.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,l)){for(o=C.event.handlers.call(this,l,c),t=0;(a=o[t++])&&!l.isPropagationStopped();)for(l.currentTarget=a.elem,n=0;(s=a.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(i=((C.event.special[s.origType]||{}).handle||s.handler).apply(a.elem,r))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,a,s,o,r=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&1<=e.button))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(s=[],o={},n=0;n<l;n++)void 0===o[a=(i=t[n]).selector+" "]&&(o[a]=i.needsContext?-1<C(a,this).index(c):C.find(a,this,null,[c]).length),o[a]&&s.push(i);s.length&&r.push({elem:c,handlers:s})}return c=this,l<t.length&&r.push({elem:c,handlers:t.slice(l)}),r},addProp:function(e,t){Object.defineProperty(C.Event.prototype,e,{enumerable:!0,configurable:!0,get:f(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[C.expando]?e:new C.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return he.test(t.type)&&t.click&&k(t,"input")&&ke(t,"click",Te),!1},trigger:function(e){var t=this||e;return he.test(t.type)&&t.click&&k(t,"input")&&ke(t,"click"),!0},_default:function(e){var t=e.target;return he.test(t.type)&&t.click&&k(t,"input")&&G.get(t,"click")||k(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},C.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},C.Event=function(e,t){if(!(this instanceof C.Event))return new C.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Te:_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&&C.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[C.expando]=!0},C.Event.prototype={constructor:C.Event,isDefaultPrevented:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Te,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Te,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Te,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},C.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:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},C.event.addProp),C.each({focus:"focusin",blur:"focusout"},(function(e,t){C.event.special[e]={setup:function(){return ke(this,e,$e),!1},trigger:function(){return ke(this,e),!0},delegateType:t}})),C.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){C.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=e.relatedTarget,a=e.handleObj;return i&&(i===this||C.contains(this,i))||(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}})),C.fn.extend({on:function(e,t,n,i){return Se(this,e,t,n,i)},one:function(e,t,n,i){return Se(this,e,t,n,i,1)},off:function(e,t,n){var i,a;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,C(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(a in e)this.off(a,t,e[a]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=_e),this.each((function(){C.event.remove(this,e,n,t)}))}});var Me=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,Le=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ae(e,t){return k(e,"table")&&k(11!==t.nodeType?t:t.firstChild,"tr")&&C(e).children("tbody")[0]||e}function Ee(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ne(e,t){var n,i,a,s,o,r;if(1===t.nodeType){if(G.hasData(e)&&(r=G.get(e).events))for(a in G.remove(t,"handle events"),r)for(n=0,i=r[a].length;n<i;n++)C.event.add(t,a,r[a][n]);X.hasData(e)&&(s=X.access(e),o=C.extend({},s),X.set(t,o))}}function Ie(e,t,n,i){t=s(t);var a,o,r,l,c,d,u=0,h=e.length,m=h-1,g=t[0],v=f(g);if(v||1<h&&"string"==typeof g&&!p.checkClone&&De.test(g))return e.each((function(a){var s=e.eq(a);v&&(t[0]=g.call(this,a,s.html())),Ie(s,t,n,i)}));if(h&&(o=(a=we(t,e[0].ownerDocument,!1,e,i)).firstChild,1===a.childNodes.length&&(a=o),o||i)){for(l=(r=C.map(ge(a,"script"),Ee)).length;u<h;u++)c=a,u!==m&&(c=C.clone(c,!0,!0),l&&C.merge(r,ge(c,"script"))),n.call(e[u],c,u);if(l)for(d=r[r.length-1].ownerDocument,C.map(r,He),u=0;u<l;u++)c=r[u],fe.test(c.type||"")&&!G.access(c,"globalEval")&&C.contains(d,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?C._evalUrl&&!c.noModule&&C._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},d):y(c.textContent.replace(Le,""),c,d))}return e}function je(e,t,n){for(var i,a=t?C.filter(t,e):e,s=0;null!=(i=a[s]);s++)n||1!==i.nodeType||C.cleanData(ge(i)),i.parentNode&&(n&&ae(i)&&ve(ge(i,"script")),i.parentNode.removeChild(i));return e}C.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,a,s,o,r,l,c,d=e.cloneNode(!0),u=ae(e);if(!(p.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||C.isXMLDoc(e)))for(o=ge(d),i=0,a=(s=ge(e)).length;i<a;i++)r=s[i],"input"===(c=(l=o[i]).nodeName.toLowerCase())&&he.test(r.type)?l.checked=r.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=r.defaultValue);if(t)if(n)for(s=s||ge(e),o=o||ge(d),i=0,a=s.length;i<a;i++)Ne(s[i],o[i]);else Ne(e,d);return 0<(o=ge(d,"script")).length&&ve(o,!u&&ge(e,"script")),d},cleanData:function(e){for(var t,n,i,a=C.event.special,s=0;void 0!==(n=e[s]);s++)if(Q(n)){if(t=n[G.expando]){if(t.events)for(i in t.events)a[i]?C.event.remove(n,i):C.removeEvent(n,i,t.handle);n[G.expando]=void 0}n[X.expando]&&(n[X.expando]=void 0)}}}),C.fn.extend({detach:function(e){return je(this,e,!0)},remove:function(e){return je(this,e)},text:function(e){return B(this,(function(e){return void 0===e?C.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 Ie(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ae(this,e).appendChild(e)}))},prepend:function(){return Ie(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ae(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ie(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ie(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&&(C.cleanData(ge(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return C.clone(this,e,t)}))},html:function(e){return B(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Me.test(e)&&!me[(pe.exec(e)||["",""])[1].toLowerCase()]){e=C.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(C.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ie(this,arguments,(function(t){var n=this.parentNode;C.inArray(this,e)<0&&(C.cleanData(ge(this)),n&&n.replaceChild(t,this))}),e)}}),C.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){C.fn[e]=function(e){for(var n,i=[],a=C(e),s=a.length-1,r=0;r<=s;r++)n=r===s?this:this.clone(!0),C(a[r])[t](n),o.apply(i,n.get());return this.pushStack(i)}}));var Oe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},qe=function(e,t,n){var i,a,s={};for(a in t)s[a]=e.style[a],e.style[a]=t[a];for(a in i=n.call(e),t)e.style[a]=s[a];return i},We=new RegExp(ne.join("|"),"i");function Pe(e,t,n){var i,a,s,o,r=e.style;return(n=n||Re(e))&&(""!==(o=n.getPropertyValue(t)||n[t])||ae(e)||(o=C.style(e,t)),!p.pixelBoxStyles()&&Oe.test(o)&&We.test(t)&&(i=r.width,a=r.minWidth,s=r.maxWidth,r.minWidth=r.maxWidth=r.width=o,o=n.width,r.width=i,r.minWidth=a,r.maxWidth=s)),void 0!==o?o+"":o}function Be(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(d){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(c).appendChild(d);var t=e.getComputedStyle(d);i="1%"!==t.top,l=12===n(t.marginLeft),d.style.right="60%",o=36===n(t.right),a=36===n(t.width),d.style.position="absolute",s=12===n(d.offsetWidth/3),ie.removeChild(c),d=null}}function n(e){return Math.round(parseFloat(e))}var i,a,s,o,r,l,c=g.createElement("div"),d=g.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===d.style.backgroundClip,C.extend(p,{boxSizingReliable:function(){return t(),a},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,n,i,a;return null==r&&(t=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",i.style.height="9px",ie.appendChild(t).appendChild(n).appendChild(i),a=e.getComputedStyle(n),r=3<parseInt(a.height),ie.removeChild(t)),r}}))}();var Fe=["Webkit","Moz","ms"],Ue=g.createElement("div").style,Je={};function ze(e){return C.cssProps[e]||Je[e]||(e in Ue?e:Je[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Fe.length;n--;)if((e=Fe[n]+t)in Ue)return e}(e)||e)}var Qe=/^(none|table(?!-c[ea]).+)/,Ve=/^--/,Ge={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var i=te.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function Ke(e,t,n,i,a,s){var o="width"===t?1:0,r=0,l=0;if(n===(i?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=C.css(e,n+ne[o],!0,a)),i?("content"===n&&(l-=C.css(e,"padding"+ne[o],!0,a)),"margin"!==n&&(l-=C.css(e,"border"+ne[o]+"Width",!0,a))):(l+=C.css(e,"padding"+ne[o],!0,a),"padding"!==n?l+=C.css(e,"border"+ne[o]+"Width",!0,a):r+=C.css(e,"border"+ne[o]+"Width",!0,a));return!i&&0<=s&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-s-l-r-.5))||0),l}function Ze(e,t,n){var i=Re(e),a=(!p.boxSizingReliable()||n)&&"border-box"===C.css(e,"boxSizing",!1,i),s=a,o=Pe(e,t,i),r="offset"+t[0].toUpperCase()+t.slice(1);if(Oe.test(o)){if(!n)return o;o="auto"}return(!p.boxSizingReliable()&&a||!p.reliableTrDimensions()&&k(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===C.css(e,"display",!1,i))&&e.getClientRects().length&&(a="border-box"===C.css(e,"boxSizing",!1,i),(s=r in e)&&(o=e[r])),(o=parseFloat(o)||0)+Ke(e,t,n||(a?"border":"content"),s,i,o)+"px"}function et(e,t,n,i,a){return new et.prototype.init(e,t,n,i,a)}C.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Pe(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,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,s,o,r=z(t),l=Ve.test(t),c=e.style;if(l||(t=ze(r)),o=C.cssHooks[t]||C.cssHooks[r],void 0===n)return o&&"get"in o&&void 0!==(a=o.get(e,!1,i))?a:c[t];"string"==(s=typeof n)&&(a=te.exec(n))&&a[1]&&(n=re(e,t,a),s="number"),null!=n&&n==n&&("number"!==s||l||(n+=a&&a[3]||(C.cssNumber[r]?"":"px")),p.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var a,s,o,r=z(t);return Ve.test(t)||(t=ze(r)),(o=C.cssHooks[t]||C.cssHooks[r])&&"get"in o&&(a=o.get(e,!0,n)),void 0===a&&(a=Pe(e,t,i)),"normal"===a&&t in Xe&&(a=Xe[t]),""===n||n?(s=parseFloat(a),!0===n||isFinite(s)?s||0:a):a}}),C.each(["height","width"],(function(e,t){C.cssHooks[t]={get:function(e,n,i){if(n)return!Qe.test(C.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,t,i):qe(e,Ge,(function(){return Ze(e,t,i)}))},set:function(e,n,i){var a,s=Re(e),o=!p.scrollboxSize()&&"absolute"===s.position,r=(o||i)&&"border-box"===C.css(e,"boxSizing",!1,s),l=i?Ke(e,t,i,r,s):0;return r&&o&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(s[t])-Ke(e,t,"border",!1,s)-.5)),l&&(a=te.exec(n))&&"px"!==(a[3]||"px")&&(e.style[t]=n,n=C.css(e,t)),Ye(0,n,l)}}})),C.cssHooks.marginLeft=Be(p.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Pe(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),C.each({margin:"",padding:"",border:"Width"},(function(e,t){C.cssHooks[e+t]={expand:function(n){for(var i=0,a={},s="string"==typeof n?n.split(" "):[n];i<4;i++)a[e+ne[i]+t]=s[i]||s[i-2]||s[0];return a}},"margin"!==e&&(C.cssHooks[e+t].set=Ye)})),C.fn.extend({css:function(e,t){return B(this,(function(e,t,n){var i,a,s={},o=0;if(Array.isArray(t)){for(i=Re(e),a=t.length;o<a;o++)s[t[o]]=C.css(e,t[o],!1,i);return s}return void 0!==n?C.style(e,t,n):C.css(e,t)}),e,t,1<arguments.length)}}),((C.Tween=et).prototype={constructor:et,init:function(e,t,n,i,a,s){this.elem=e,this.prop=n,this.easing=a||C.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(C.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=C.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=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):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.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=C.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){C.fx.step[e.prop]?C.fx.step[e.prop](e):1!==e.elem.nodeType||!C.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:C.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},C.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},C.fx=et.prototype.init,C.fx.step={};var tt,nt,it,at,st=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function rt(){nt&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,C.fx.interval),C.fx.tick())}function lt(){return e.setTimeout((function(){tt=void 0})),tt=Date.now()}function ct(e,t){var n,i=0,a={height:e};for(t=t?1:0;i<4;i+=2-t)a["margin"+(n=ne[i])]=a["padding"+n]=e;return t&&(a.opacity=a.width=e),a}function dt(e,t,n){for(var i,a=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),s=0,o=a.length;s<o;s++)if(i=a[s].call(n,t,e))return i}function ut(e,t,n){var i,a,s=0,o=ut.prefilters.length,r=C.Deferred().always((function(){delete l.elem})),l=function(){if(a)return!1;for(var t=tt||lt(),n=Math.max(0,c.startTime+c.duration-t),i=1-(n/c.duration||0),s=0,o=c.tweens.length;s<o;s++)c.tweens[s].run(i);return r.notifyWith(e,[c,i,n]),i<1&&o?n:(o||r.notifyWith(e,[c,1,0]),r.resolveWith(e,[c]),!1)},c=r.promise({elem:e,props:C.extend({},t),opts:C.extend(!0,{specialEasing:{},easing:C.easing._default},n),originalProperties:t,originalOptions:n,startTime:tt||lt(),duration:n.duration,tweens:[],createTween:function(t,n){var i=C.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(a)return this;for(a=!0;n<i;n++)c.tweens[n].run(1);return t?(r.notifyWith(e,[c,1,0]),r.resolveWith(e,[c,t])):r.rejectWith(e,[c,t]),this}}),d=c.props;for(function(e,t){var n,i,a,s,o;for(n in e)if(a=t[i=z(n)],s=e[n],Array.isArray(s)&&(a=s[1],s=e[n]=s[0]),n!==i&&(e[i]=s,delete e[n]),(o=C.cssHooks[i])&&"expand"in o)for(n in s=o.expand(s),delete e[i],s)n in e||(e[n]=s[n],t[n]=a);else t[i]=a}(d,c.opts.specialEasing);s<o;s++)if(i=ut.prefilters[s].call(c,e,d,c.opts))return f(i.stop)&&(C._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return C.map(d,dt,c),f(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),C.fx.timer(C.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}C.Animation=C.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return re(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){f(e)?(t=e,e=["*"]):e=e.match(I);for(var n,i=0,a=e.length;i<a;i++)n=e[i],ut.tweeners[n]=ut.tweeners[n]||[],ut.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,a,s,o,r,l,c,d,u="width"in t||"height"in t,h=this,p={},f=e.style,m=e.nodeType&&oe(e),g=G.get(e,"fxshow");for(i in n.queue||(null==(o=C._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,r=o.empty.fire,o.empty.fire=function(){o.unqueued||r()}),o.unqueued++,h.always((function(){h.always((function(){o.unqueued--,C.queue(e,"fx").length||o.empty.fire()}))}))),t)if(a=t[i],st.test(a)){if(delete t[i],s=s||"toggle"===a,a===(m?"hide":"show")){if("show"!==a||!g||void 0===g[i])continue;m=!0}p[i]=g&&g[i]||C.style(e,i)}if((l=!C.isEmptyObject(t))||!C.isEmptyObject(p))for(i in u&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=G.get(e,"display")),"none"===(d=C.css(e,"display"))&&(c?d=c:(ce([e],!0),c=e.style.display||c,d=C.css(e,"display"),ce([e]))),("inline"===d||"inline-block"===d&&null!=c)&&"none"===C.css(e,"float")&&(l||(h.done((function(){f.display=c})),null==c&&(d=f.display,c="none"===d?"":d)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",h.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=G.access(e,"fxshow",{display:c}),s&&(g.hidden=!m),m&&ce([e],!0),h.done((function(){for(i in m||ce([e]),G.remove(e,"fxshow"),p)C.style(e,i,p[i])}))),l=dt(m?g[i]:0,i,h),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),C.speed=function(e,t,n){var i=e&&"object"==typeof e?C.extend({},e):{complete:n||!n&&t||f(e)&&e,duration:e,easing:n&&t||t&&!f(t)&&t};return C.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in C.fx.speeds?i.duration=C.fx.speeds[i.duration]:i.duration=C.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){f(i.old)&&i.old.call(this),i.queue&&C.dequeue(this,i.queue)},i},C.fn.extend({fadeTo:function(e,t,n,i){return this.filter(oe).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var a=C.isEmptyObject(e),s=C.speed(t,n,i),o=function(){var t=ut(this,C.extend({},e),s);(a||G.get(this,"finish"))&&t.stop(!0)};return o.finish=o,a||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var i=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,a=null!=e&&e+"queueHooks",s=C.timers,o=G.get(this);if(a)o[a]&&o[a].stop&&i(o[a]);else for(a in o)o[a]&&o[a].stop&&ot.test(a)&&i(o[a]);for(a=s.length;a--;)s[a].elem!==this||null!=e&&s[a].queue!==e||(s[a].anim.stop(n),t=!1,s.splice(a,1));!t&&n||C.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=G.get(this),i=n[e+"queue"],a=n[e+"queueHooks"],s=C.timers,o=i?i.length:0;for(n.finish=!0,C.queue(this,e,[]),a&&a.stop&&a.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish}))}}),C.each(["toggle","show","hide"],(function(e,t){var n=C.fn[t];C.fn[t]=function(e,i,a){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ct(t,!0),e,i,a)}})),C.each({slideDown:ct("show"),slideUp:ct("hide"),slideToggle:ct("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){C.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}})),C.timers=[],C.fx.tick=function(){var e,t=0,n=C.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||C.fx.stop(),tt=void 0},C.fx.timer=function(e){C.timers.push(e),C.fx.start()},C.fx.interval=13,C.fx.start=function(){nt||(nt=!0,rt())},C.fx.stop=function(){nt=null},C.fx.speeds={slow:600,fast:200,_default:400},C.fn.delay=function(t,n){return t=C.fx&&C.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,i){var a=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(a)}}))},it=g.createElement("input"),at=g.createElement("select").appendChild(g.createElement("option")),it.type="checkbox",p.checkOn=""!==it.value,p.optSelected=at.selected,(it=g.createElement("input")).value="t",it.type="radio",p.radioValue="t"===it.value;var ht,pt=C.expr.attrHandle;C.fn.extend({attr:function(e,t){return B(this,C.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each((function(){C.removeAttr(this,e)}))}}),C.extend({attr:function(e,t,n){var i,a,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?C.prop(e,t,n):(1===s&&C.isXMLDoc(e)||(a=C.attrHooks[t.toLowerCase()]||(C.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void C.removeAttr(e,t):a&&"set"in a&&void 0!==(i=a.set(e,n,t))?i:(e.setAttribute(t,n+""),n):a&&"get"in a&&null!==(i=a.get(e,t))?i:null==(i=C.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&"radio"===t&&k(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,a=t&&t.match(I);if(a&&1===e.nodeType)for(;n=a[i++];)e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?C.removeAttr(e,n):e.setAttribute(n,n),n}},C.each(C.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=pt[t]||C.find.attr;pt[t]=function(e,t,i){var a,s,o=t.toLowerCase();return i||(s=pt[o],pt[o]=a,a=null!=n(e,t,i)?o:null,pt[o]=s),a}}));var ft=/^(?:input|select|textarea|button)$/i,mt=/^(?:a|area)$/i;function gt(e){return(e.match(I)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function yt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)||[]}C.fn.extend({prop:function(e,t){return B(this,C.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each((function(){delete this[C.propFix[e]||e]}))}}),C.extend({prop:function(e,t,n){var i,a,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&C.isXMLDoc(e)||(t=C.propFix[t]||t,a=C.propHooks[t]),void 0!==n?a&&"set"in a&&void 0!==(i=a.set(e,n,t))?i:e[t]=n:a&&"get"in a&&null!==(i=a.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=C.find.attr(e,"tabindex");return t?parseInt(t,10):ft.test(e.nodeName)||mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(C.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){C.propFix[this.toLowerCase()]=this})),C.fn.extend({addClass:function(e){var t,n,i,a,s,o,r,l=0;if(f(e))return this.each((function(t){C(this).addClass(e.call(this,t,vt(this)))}));if((t=yt(e)).length)for(;n=this[l++];)if(a=vt(n),i=1===n.nodeType&&" "+gt(a)+" "){for(o=0;s=t[o++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");a!==(r=gt(i))&&n.setAttribute("class",r)}return this},removeClass:function(e){var t,n,i,a,s,o,r,l=0;if(f(e))return this.each((function(t){C(this).removeClass(e.call(this,t,vt(this)))}));if(!arguments.length)return this.attr("class","");if((t=yt(e)).length)for(;n=this[l++];)if(a=vt(n),i=1===n.nodeType&&" "+gt(a)+" "){for(o=0;s=t[o++];)for(;-1<i.indexOf(" "+s+" ");)i=i.replace(" "+s+" "," ");a!==(r=gt(i))&&n.setAttribute("class",r)}return this},toggleClass:function(e,t){var n=typeof e,i="string"===n||Array.isArray(e);return"boolean"==typeof t&&i?t?this.addClass(e):this.removeClass(e):f(e)?this.each((function(n){C(this).toggleClass(e.call(this,n,vt(this),t),t)})):this.each((function(){var t,a,s,o;if(i)for(a=0,s=C(this),o=yt(e);t=o[a++];)s.hasClass(t)?s.removeClass(t):s.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,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&-1<(" "+gt(vt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;C.fn.extend({val:function(e){var t,n,i,a=this[0];return arguments.length?(i=f(e),this.each((function(n){var a;1===this.nodeType&&(null==(a=i?e.call(this,n,C(this).val()):e)?a="":"number"==typeof a?a+="":Array.isArray(a)&&(a=C.map(a,(function(e){return null==e?"":e+""}))),(t=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,a,"value")||(this.value=a))}))):a?(t=C.valHooks[a.type]||C.valHooks[a.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(a,"value"))?n:"string"==typeof(n=a.value)?n.replace(wt,""):null==n?"":n:void 0}}),C.extend({valHooks:{option:{get:function(e){var t=C.find.attr(e,"value");return null!=t?t:gt(C.text(e))}},select:{get:function(e){var t,n,i,a=e.options,s=e.selectedIndex,o="select-one"===e.type,r=o?null:[],l=o?s+1:a.length;for(i=s<0?l:o?s:0;i<l;i++)if(((n=a[i]).selected||i===s)&&!n.disabled&&(!n.parentNode.disabled||!k(n.parentNode,"optgroup"))){if(t=C(n).val(),o)return t;r.push(t)}return r},set:function(e,t){for(var n,i,a=e.options,s=C.makeArray(t),o=a.length;o--;)((i=a[o]).selected=-1<C.inArray(C.valHooks.option.get(i),s))&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),C.each(["radio","checkbox"],(function(){C.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<C.inArray(C(e).val(),t)}},p.checkOn||(C.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),p.focusin="onfocusin"in e;var bt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};C.extend(C.event,{trigger:function(t,n,i,a){var s,o,r,l,c,u,h,p,v=[i||g],y=d.call(t,"type")?t.type:t,w=d.call(t,"namespace")?t.namespace.split("."):[];if(o=p=r=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!bt.test(y+C.event.triggered)&&(-1<y.indexOf(".")&&(y=(w=y.split(".")).shift(),w.sort()),c=y.indexOf(":")<0&&"on"+y,(t=t[C.expando]?t:new C.Event(y,"object"==typeof t&&t)).isTrigger=a?2:3,t.namespace=w.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:C.makeArray(n,[t]),h=C.event.special[y]||{},a||!h.trigger||!1!==h.trigger.apply(i,n))){if(!a&&!h.noBubble&&!m(i)){for(l=h.delegateType||y,bt.test(l+y)||(o=o.parentNode);o;o=o.parentNode)v.push(o),r=o;r===(i.ownerDocument||g)&&v.push(r.defaultView||r.parentWindow||e)}for(s=0;(o=v[s++])&&!t.isPropagationStopped();)p=o,t.type=1<s?l:h.bindType||y,(u=(G.get(o,"events")||Object.create(null))[t.type]&&G.get(o,"handle"))&&u.apply(o,n),(u=c&&o[c])&&u.apply&&Q(o)&&(t.result=u.apply(o,n),!1===t.result&&t.preventDefault());return t.type=y,a||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(v.pop(),n)||!Q(i)||c&&f(i[y])&&!m(i)&&((r=i[c])&&(i[c]=null),C.event.triggered=y,t.isPropagationStopped()&&p.addEventListener(y,Ct),i[y](),t.isPropagationStopped()&&p.removeEventListener(y,Ct),C.event.triggered=void 0,r&&(i[c]=r)),t.result}},simulate:function(e,t,n){var i=C.extend(new C.Event,n,{type:e,isSimulated:!0});C.event.trigger(i,null,t)}}),C.fn.extend({trigger:function(e,t){return this.each((function(){C.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return C.event.trigger(e,t,n,!0)}}),p.focusin||C.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){C.event.simulate(t,e.target,C.event.fix(e))};C.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,a=G.access(i,t);a||i.addEventListener(e,n,!0),G.access(i,t,(a||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,a=G.access(i,t)-1;a?G.access(i,t,a):(i.removeEventListener(e,n,!0),G.remove(i,t))}}}));var xt=e.location,Tt={guid:Date.now()},_t=/\?/;C.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||C.error("Invalid XML: "+t),n};var $t=/\[\]$/,St=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Mt=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,i){var a;if(Array.isArray(t))C.each(t,(function(t,a){n||$t.test(e)?i(e,a):Dt(e+"["+("object"==typeof a&&null!=a?t:"")+"]",a,n,i)}));else if(n||"object"!==w(t))i(e,t);else for(a in t)Dt(e+"["+a+"]",t[a],n,i)}C.param=function(e,t){var n,i=[],a=function(e,t){var n=f(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!C.isPlainObject(e))C.each(e,(function(){a(this.name,this.value)}));else for(n in e)Dt(n,e[n],t,a);return i.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=C.prop(this,"elements");return e?C.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!C(this).is(":disabled")&&Mt.test(this.nodeName)&&!kt.test(e)&&(this.checked||!he.test(e))})).map((function(e,t){var n=C(this).val();return null==n?null:Array.isArray(n)?C.map(n,(function(e){return{name:t.name,value:e.replace(St,"\r\n")}})):{name:t.name,value:n.replace(St,"\r\n")}})).get()}});var Lt=/%20/g,At=/#.*$/,Et=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,It=/^\/\//,jt={},Ot={},Rt="*/".concat("*"),qt=g.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,a=0,s=t.toLowerCase().match(I)||[];if(f(n))for(;i=s[a++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Pt(e,t,n,i){var a={},s=e===Ot;function o(r){var l;return a[r]=!0,C.each(e[r]||[],(function(e,r){var c=r(t,n,i);return"string"!=typeof c||s||a[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)})),l}return o(t.dataTypes[0])||!a["*"]&&o("*")}function Bt(e,t){var n,i,a=C.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((a[n]?e:i||(i={}))[n]=t[n]);return i&&C.extend(!0,e,i),e}qt.href=xt.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,C.ajaxSettings),t):Bt(C.ajaxSettings,e)},ajaxPrefilter:Wt(jt),ajaxTransport:Wt(Ot),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,a,s,o,r,l,c,d,u,h,p=C.ajaxSetup({},n),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?C(f):C.event,v=C.Deferred(),y=C.Callbacks("once memory"),w=p.statusCode||{},b={},x={},T="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(c){if(!o)for(o={};t=Ht.exec(s);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(e,t){return null==c&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)_.always(e[_.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),$(0,t),this}};if(v.promise(_),p.url=((t||p.url||xt.href)+"").replace(It,xt.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(I)||[""],null==p.crossDomain){l=g.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=qt.protocol+"//"+qt.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),Pt(jt,p,n,_),c)return _;for(u in(d=C.event&&p.global)&&0==C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nt.test(p.type),a=p.url.replace(At,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Lt,"+")):(h=p.url.slice(a.length),p.data&&(p.processData||"string"==typeof p.data)&&(a+=(_t.test(a)?"&":"?")+p.data,delete p.data),!1===p.cache&&(a=a.replace(Et,"$1"),h=(_t.test(a)?"&":"?")+"_="+Tt.guid+++h),p.url=a+h),p.ifModified&&(C.lastModified[a]&&_.setRequestHeader("If-Modified-Since",C.lastModified[a]),C.etag[a]&&_.setRequestHeader("If-None-Match",C.etag[a])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&_.setRequestHeader("Content-Type",p.contentType),_.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Rt+"; q=0.01":""):p.accepts["*"]),p.headers)_.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(f,_,p)||c))return _.abort();if(T="abort",y.add(p.complete),_.done(p.success),_.fail(p.error),i=Pt(Ot,p,n,_)){if(_.readyState=1,d&&m.trigger("ajaxSend",[_,p]),c)return _;p.async&&0<p.timeout&&(r=e.setTimeout((function(){_.abort("timeout")}),p.timeout));try{c=!1,i.send(b,$)}catch(t){if(c)throw t;$(-1,t)}}else $(-1,"No Transport");function $(t,n,o,l){var u,h,g,b,x,T=n;c||(c=!0,r&&e.clearTimeout(r),i=void 0,s=l||"",_.readyState=0<t?4:0,u=200<=t&&t<300||304===t,o&&(b=function(e,t,n){for(var i,a,s,o,r=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(a in r)if(r[a]&&r[a].test(i)){l.unshift(a);break}if(l[0]in n)s=l[0];else{for(a in n){if(!l[0]||e.converters[a+" "+l[0]]){s=a;break}o||(o=a)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),n[s]}(p,_,o)),!u&&-1<C.inArray("script",p.dataTypes)&&(p.converters["text script"]=function(){}),b=function(e,t,n,i){var a,s,o,r,l,c={},d=e.dataTypes.slice();if(d[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(s=d.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=c[l+" "+s]||c["* "+s]))for(a in c)if((r=a.split(" "))[1]===s&&(o=c[l+" "+r[0]]||c["* "+r[0]])){!0===o?o=c[a]:!0!==c[a]&&(s=r[0],d.unshift(r[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(p,b,_,u),u?(p.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(C.lastModified[a]=x),(x=_.getResponseHeader("etag"))&&(C.etag[a]=x)),204===t||"HEAD"===p.type?T="nocontent":304===t?T="notmodified":(T=b.state,h=b.data,u=!(g=b.error))):(g=T,!t&&T||(T="error",t<0&&(t=0))),_.status=t,_.statusText=(n||T)+"",u?v.resolveWith(f,[h,T,_]):v.rejectWith(f,[_,T,g]),_.statusCode(w),w=void 0,d&&m.trigger(u?"ajaxSuccess":"ajaxError",[_,p,u?h:g]),y.fireWith(f,[_,T]),d&&(m.trigger("ajaxComplete",[_,p]),--C.active||C.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return C.get(e,t,n,"json")},getScript:function(e,t){return C.get(e,void 0,t,"script")}}),C.each(["get","post"],(function(e,t){C[t]=function(e,n,i,a){return f(n)&&(a=a||i,i=n,n=void 0),C.ajax(C.extend({url:e,type:t,dataType:a,data:n,success:i},C.isPlainObject(e)&&e))}})),C.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),C._evalUrl=function(e,t,n){return C.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){C.globalEval(e,t,n)}})},C.fn.extend({wrapAll:function(e){var t;return this[0]&&(f(e)&&(e=e.call(this[0])),t=C(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return f(e)?this.each((function(t){C(this).wrapInner(e.call(this,t))})):this.each((function(){var t=C(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=f(e);return this.each((function(n){C(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){C(this).replaceWith(this.childNodes)})),this}}),C.expr.pseudos.hidden=function(e){return!C.expr.pseudos.visible(e)},C.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ft={0:200,1223:204},Ut=C.ajaxSettings.xhr();p.cors=!!Ut&&"withCredentials"in Ut,p.ajax=Ut=!!Ut,C.ajaxTransport((function(t){var n,i;if(p.cors||Ut&&!t.crossDomain)return{send:function(a,s){var o,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)r[o]=t.xhrFields[o];for(o in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||a["X-Requested-With"]||(a["X-Requested-With"]="XMLHttpRequest"),a)r.setRequestHeader(o,a[o]);n=function(e){return function(){n&&(n=i=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Ft[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(),i=r.onerror=r.ontimeout=n("error"),void 0!==r.onabort?r.onabort=i:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout((function(){n&&i()}))},n=n("abort");try{r.send(t.hasContent&&t.data||null)}catch(a){if(n)throw a}},abort:function(){n&&n()}}})),C.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),C.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 C.globalEval(e),e}}}),C.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),C.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,a){t=C("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&a("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Jt,zt=[],Qt=/(=)\?(?=&|$)|\?\?/;C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||C.expando+"_"+Tt.guid++;return this[e]=!0,e}}),C.ajaxPrefilter("json jsonp",(function(t,n,i){var a,s,o,r=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return a=t.jsonpCallback=f(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(Qt,"$1"+a):!1!==t.jsonp&&(t.url+=(_t.test(t.url)?"&":"?")+t.jsonp+"="+a),t.converters["script json"]=function(){return o||C.error(a+" was not called"),o[0]},t.dataTypes[0]="json",s=e[a],e[a]=function(){o=arguments},i.always((function(){void 0===s?C(e).removeProp(a):e[a]=s,t[a]&&(t.jsonpCallback=n.jsonpCallback,zt.push(a)),o&&f(s)&&s(o[0]),o=s=void 0})),"script"})),p.createHTMLDocument=((Jt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),C.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(p.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),s=!n&&[],(a=M.exec(e))?[t.createElement(a[1])]:(a=we([e],t,s),s&&s.length&&C(s).remove(),C.merge([],a.childNodes)));var i,a,s},C.fn.load=function(e,t,n){var i,a,s,o=this,r=e.indexOf(" ");return-1<r&&(i=gt(e.slice(r)),e=e.slice(0,r)),f(t)?(n=t,t=void 0):t&&"object"==typeof t&&(a="POST"),0<o.length&&C.ajax({url:e,type:a||"GET",dataType:"html",data:t}).done((function(e){s=arguments,o.html(i?C("<div>").append(C.parseHTML(e)).find(i):e)})).always(n&&function(e,t){o.each((function(){n.apply(this,s||[e.responseText,t,e])}))}),this},C.expr.pseudos.animated=function(e){return C.grep(C.timers,(function(t){return e===t.elem})).length},C.offset={setOffset:function(e,t,n){var i,a,s,o,r,l,c=C.css(e,"position"),d=C(e),u={};"static"===c&&(e.style.position="relative"),r=d.offset(),s=C.css(e,"top"),l=C.css(e,"left"),("absolute"===c||"fixed"===c)&&-1<(s+l).indexOf("auto")?(o=(i=d.position()).top,a=i.left):(o=parseFloat(s)||0,a=parseFloat(l)||0),f(t)&&(t=t.call(e,n,C.extend({},r))),null!=t.top&&(u.top=t.top-r.top+o),null!=t.left&&(u.left=t.left-r.left+a),"using"in t?t.using.call(e,u):("number"==typeof u.top&&(u.top+="px"),"number"==typeof u.left&&(u.left+="px"),d.css(u))}},C.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){C.offset.setOffset(this,e,t)}));var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],a={top:0,left:0};if("fixed"===C.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===C.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((a=C(e).offset()).top+=C.css(e,"borderTopWidth",!0),a.left+=C.css(e,"borderLeftWidth",!0))}return{top:t.top-a.top-C.css(i,"marginTop",!0),left:t.left-a.left-C.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===C.css(e,"position");)e=e.offsetParent;return e||ie}))}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;C.fn[e]=function(i){return B(this,(function(e,i,a){var s;if(m(e)?s=e:9===e.nodeType&&(s=e.defaultView),void 0===a)return s?s[t]:e[i];s?s.scrollTo(n?s.pageXOffset:a,n?a:s.pageYOffset):e[i]=a}),e,i,arguments.length)}})),C.each(["top","left"],(function(e,t){C.cssHooks[t]=Be(p.pixelPosition,(function(e,n){if(n)return n=Pe(e,t),Oe.test(n)?C(e).position()[t]+"px":n}))})),C.each({Height:"height",Width:"width"},(function(e,t){C.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){C.fn[i]=function(a,s){var o=arguments.length&&(n||"boolean"!=typeof a),r=n||(!0===a||!0===s?"margin":"border");return B(this,(function(t,n,a){var s;return m(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===a?C.css(t,n,r):C.style(t,n,a,r)}),t,o?a:void 0,o)}}))})),C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){C.fn[t]=function(e){return this.on(t,e)}})),C.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,i){return this.on(t,e,n,i)},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)}}),C.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){C.fn[t]=function(e,n){return 0<arguments.length?this.on(t,null,e,n):this.trigger(t)}}));var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;C.proxy=function(e,t){var n,i,s;if("string"==typeof t&&(n=e[t],t=e,e=n),f(e))return i=a.call(arguments,2),(s=function(){return e.apply(t||this,i.concat(a.call(arguments)))}).guid=e.guid=e.guid||C.guid++,s},C.holdReady=function(e){e?C.readyWait++:C.ready(!0)},C.isArray=Array.isArray,C.parseJSON=JSON.parse,C.nodeName=k,C.isFunction=f,C.isWindow=m,C.camelCase=z,C.type=w,C.now=Date.now,C.isNumeric=function(e){var t=C.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},C.trim=function(e){return null==e?"":(e+"").replace(Vt,"")},"function"==typeof define&&define.amd&&define("jquery",[],(function(){return C}));var Gt=e.jQuery,Xt=e.$;return C.noConflict=function(t){return e.$===C&&(e.$=Xt),t&&e.jQuery===C&&(e.jQuery=Gt),C},void 0===t&&(e.jQuery=e.$=C),C})),window.Modernizr=function(e,t,n){function i(e){d.cssText=e}function a(e,t){return typeof e===t}var s,o,r={},l=t.documentElement,c=t.createElement("modernizr"),d=c.style,u={},h=[],p=h.slice,f={}.hasOwnProperty;for(var m in o=a(f,"undefined")||a(f.call,"undefined")?function(e,t){return t in e&&a(e.constructor.prototype[t],"undefined")}:function(e,t){return f.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=p.call(arguments,1),i=function(){if(this instanceof i){var a=function(){};a.prototype=t.prototype;var s=new a,o=t.apply(s,n.concat(p.call(arguments)));return Object(o)===o?o:s}return t.apply(e,n.concat(p.call(arguments)))};return i}),u.audio=function(){var e=t.createElement("audio"),n=!1;try{(n=!!e.canPlayType)&&((n=new Boolean(n)).ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(e){}return n},u)o(u,m)&&(s=m.toLowerCase(),r[s]=u[m](),h.push((r[s]?"":"no-")+s));return r.addTest=function(e,t){if("object"==typeof e)for(var i in e)o(e,i)&&r.addTest(i,e[i]);else{if(e=e.toLowerCase(),r[e]!==n)return r;t="function"==typeof t?t():t,"undefined"!=typeof enableClasses&&enableClasses&&(l.className+=" "+(t?"":"no-")+e),r[e]=t}return r},i(""),c=null,r._version="2.6.2",r}(0,this.document);var lhcError={log:function(e,t,n,i,a){var s;(s={}).message=e||"",s.location=location&&location.href?location.href:"",s.message+="\n"+window.navigator.userAgent,s.file=t||"",s.line=n||"",s.column=a||"",s.stack=i?JSON.stringify(i):"",s.stack=s.stack.replace(/(\r\n|\n|\r)/gm,"");var o=new XMLHttpRequest;o.open("POST",WWW_DIR_JAVASCRIPT+"/audit/logjserror",!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send("data="+encodeURIComponent(JSON.stringify(s)))}};window.addEventListener("error",(function(e){!lhcError||-1===e.filename.indexOf("js_static")&&-1===e.filename.indexOf("compiledtemplates")&&-1===e.filename.indexOf("defaulttheme")||lhcError.log(e.message,e.filename,e.lineNumber||e.lineno,e.error.stack,e.colno)}));try{function csrfSafeMethod(e){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(e)}$.ajaxSetup({crossDomain:!1,cache:!1,beforeSend:function(e,t){csrfSafeMethod(t.type)||e.setRequestHeader("X-CSRFToken",confLH.csrf_token)}}),$.postJSON=function(e,t,n){return $.post(e,t,n,"json")};var LHCCallbacks={};function lh(){this.wwwDir=WWW_DIR_JAVASCRIPT,this.addmsgurl="chat/addmsgadmin/",this.addmsgurluser="chat/addmsguser/",this.addmsgurluserchatbox="chatbox/addmsguser/",this.syncuser="chat/syncuser/",this.syncadmin="chat/syncadmin/",this.closechatadmin="chat/closechatadmin/",this.deletechatadmin="chat/deletechatadmin/",this.checkchatstatus="chat/checkchatstatus/",this.syncadmininterfaceurl="chat/syncadmininterface/",this.accepttransfer="chat/accepttransfer/",this.trasnsferuser="chat/transferuser/",this.userclosechaturl="chat/userclosechat/",this.disableremember=!1,this.operatorTyping=!1,this.forceBottomScroll=!1,this.appendSyncArgument="",this.nodeJsMode=!1,this.previous_chat_id=0,this.gmaps_loaded=!1,this.disableSync=!1,this.chat_id=null,this.hash=null,this.soundIsPlaying=!1,this.soundPlayedTimes=0,this.last_message_id=0,this.isSinchronizing=!1,this.isWidgetMode=!1,this.isEmbedMode=!1,this.syncroRequestSend=!1,this.currentMessageText="",this.setWidgetMode=function(e){this.isWidgetMode=e},this.setEmbedMode=function(e){this.isEmbedMode=e},this.setSynchronizationRequestSend=function(e){this.syncroRequestSend=e},this.setSyncUserURL=function(e){this.syncuser=e},this.chatsSynchronising=[],this.chatsSynchronisingMsg=[],this.notificationsArray=[],this.speechHandler=!1,this.underMessageAdd=!1,this.closeWindowOnChatCloseDelete=!1,this.userTimeout=!1,this.lastOnlineSyncTimeout=!1,this.setLastUserMessageID=function(e){this.last_message_id=e},this.setChatID=function(e){this.chat_id=e},this.setwwwDir=function(e){this.wwwDir=e},this.setCloseWindowOnEvent=function(e){this.closeWindowOnChatCloseDelete=e},this.setDisableRemember=function(e){this.disableremember=e},this.setSynchronizationStatus=function(e){this.underMessageAdd=e},this.tabIconContent="face",this.tabIconClass="icon-user-status material-icons icon-user-online",this.audio=void 0!==window.Audio?new Audio:null,null!==this.audio&&(this.audio.autoplay="autoplay"),this.reloadTab=function(e,t,n){$("#ntab-chat-"+e).text(n),0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),this.removeSynchroChat(e),this.removeBackgroundChat(e),this.hideNotification(e);var i=this;$.get(this.wwwDir+"chat/adminchat/"+e+"/(remember)/true",(function(t){$("#chat-id-"+e).html(t),$("#CSChatMessage-"+e).focus(),i.rememberTab(e),i.addQuateHandler(e),i.loadMainData(e),ee.emitEvent("chatTabLoaded",[e]),ee.emitEvent("chatStartTab",[e,{name:n,focus:!0}])}))},this.loadMainData=function(e){$.getJSON(this.wwwDir+"chat/loadmaindata/"+e,{},(function(t){$.each(t.items,(function(e,t){var n=$(t.selector);void 0!==t.attr&&$.each(t.attr,(function(e,t){"text"==e?n.text(t):n.attr(e,t)})),void 0!==t.action&&("hide"==t.action?n.hide():"show"==t.action?n.show():"remove"==t.action?n.remove():"event"==t.action?ee.emitEvent(t.event_name,t.event_value):"click"==t.action&&(n.attr("auto-scroll",1),n.click()))})),ee.emitEvent("mainChatDataLoaded",[e,t])})).fail((function(){}))},this.getSelectedText=function(){var e,t="";return window.getSelection?t=(e=window.getSelection()).toString():document.selection&&"Control"!==document.selection.type&&(t=(e=document.selection.createRange()).text),{selection:e,text:t}},this.popoverShown=!1,this.popoverShownNow=!1,this.selection=null,this.mouseContextMenu=function(e){if(3==e.which&&void 0!==$(this).attr("id")){$(".popover-copy").popover("dispose");var t=e.data.that.getSelectedText(),n=!1;!t.text.length||null!==e.data.that.selection&&e.data.that.selection.text===t.text||(n=!0,e.data.that.selection=t);var i=$(this).attr("id").replace("msg-",""),a=$(this).attr("data-op-id")==confLH.user_id,s={placement:"right",trigger:"manual",animation:!1,html:!0,container:"#chat-id-"+e.data.chat_id,template:'<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-body"></div></div>',content:function(){return'<a href="#" id="copy-popover-'+e.data.chat_id+'" ><i class="material-icons">&#xE244;</i>'+confLH.transLation.quote+"</a>"+(a?'<br/><a href="#" id="edit-popover-'+e.data.chat_id+'" ><i class="material-icons">edit</i>'+confLH.transLation.edit+"</a>":"")+'<br/><a href="#" id="ask-help-popover-'+e.data.chat_id+'" ><i class="material-icons">supervisor_account</i>'+confLH.transLation.ask_help+"</a>"+(n?'<br/><a href="#" id="copy-text-popover-'+e.data.chat_id+'" ><i class="material-icons">content_copy</i>'+confLH.transLation.copy+" (Ctrl+C)</a>":"")+(n?"":'<br/><a href="#" id="copy-all-text-popover-'+e.data.chat_id+'" ><i class="material-icons">content_copy</i>'+confLH.transLation.copy+' (Ctrl+C)</a><br/><a href="#" id="copy-group-text-popover-'+e.data.chat_id+'" ><i class="material-icons">content_copy</i>'+confLH.transLation.copy_group+"</a>")+(n?"":'<br/><a href="#" id="translate-msg-'+e.data.chat_id+'" ><i class="material-icons">language</i>'+confLH.transLation.translate+"</a>")}},o=$("#messagesBlock-"+e.data.chat_id+" > #msg-"+i+" > .msg-body");if(0==o.length)return;return ee.emitEvent("quoteActionRight",[s,e.data.chat_id,i]),o.popover(s).popover("show").addClass("popover-copy"),$("#copy-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){t.msg&&e.data.that.insertTextToMessageArea(e.data.chat_id,t.msg),e.data.that.hidePopover()}))})),$("#ask-help-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){$("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded")?($("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded",!0).click(),ee.emitEvent("groupChatPrefillMessage",[e.data.chat_id,t.msg])):($("#private-chat-tab-link-"+e.data.chat_id).attr("private-loaded",!0).click(),ee.emitEvent("privateChatStart",[e.data.chat_id,{default_message:t.msg}])),e.data.that.hidePopover()}))})),!n&&$("#translate-msg-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),lhc.methodCall("lhc.translation","translateMessageVisitor",{msg_id:i,chat_id:e.data.chat_id}),e.data.that.hidePopover()})),!n&&$("#copy-all-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i,(function(t){var n=$("#CSChatMessage-"+e.data.chat_id),i=n.val();n.val(t.msg),n.select(),document.execCommand("copy"),n.val(i),e.data.that.hidePopover()}))})),!n&&$("#copy-group-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/quotemessage/"+i+"/(type)/group",(function(t){var n=$("#CSChatMessage-"+e.data.chat_id),i=n.val();n.val(t.msg),n.select(),document.execCommand("copy"),n.val(i),e.data.that.hidePopover()}))})),a&&$("#edit-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault(),$.getJSON(e.data.that.wwwDir+"chat/editprevious/"+e.data.chat_id+"/"+i,(function(t){if("f"==t.error){var n=$("#CSChatMessage-"+e.data.chat_id);n.val(t.msg).attr("data-msgid",t.id).addClass("edit-mode"),$("#msg-"+t.id).addClass("edit-mode"),n.focus()}else alert(t.error)})),e.data.that.hidePopover()})),n&&$("#copy-text-popover-"+e.data.chat_id).click((function(t){t.stopPropagation(),t.preventDefault();var n=e.data.that.getSelectedTextPlain(),i=$("#CSChatMessage-"+e.data.chat_id),a=i.val();i.val(n),i.select(),document.execCommand("copy"),i.val(a),e.data.that.hidePopover()})),e.data.that.popoverShown=!0,e.data.that.popoverShownNow=!1,!1}},this.insertTextToMessageArea=function(e,t){var n=$("#CSChatMessage-"+e),i=n.val().replace(/^\s*\n/g,"");n.val((""!=i?i+"[quote]"+t+"[/quote]":"[quote]"+t+"[/quote]")+"\n").focus();var a=n[0];for(a.clientHeight,a.rows;a.scrollHeight>a.clientHeight&&!window.opera&&a.rows<30;)a.style.overflow="hidden",a.rows+=1;a.scrollHeight>a.clientHeight&&(a.style.overflow="auto")},this.mouseClicked=function(e){if(selected=e.data.that.getSelectedText(),$(".popover-copy").popover("dispose"),!selected.text.length||null!==e.data.that.selection&&e.data.that.selection.text===selected.text)e.data.that.selection=null;else{e.data.that.selection=selected;var t={placement:"right",trigger:"manual",animation:!1,html:!0,container:"#chat-id-"+e.data.chat_id,template:'<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-body"></div></div>',content:function(){return'<a href="#" id="copy-popover-'+e.data.chat_id+'" ><i class="material-icons">&#xE244;</i>'+confLH.transLation.quote+"</a>"}},n=void 0!==$(this).attr("id")?"#messagesBlock-"+e.data.chat_id+" > #msg-"+$(this).attr("id").replace("msg-","")+" > .msg-body":this,i=$(n);if(0==i.length)return;ee.emitEvent("quoteAction",[t,e.data.chat_id]),i.popover(t).popover("show").addClass("popover-copy"),$("#copy-popover-"+e.data.chat_id).click((function(){lhinst.quateSelection(e.data.chat_id)})),e.data.that.popoverShown=!0,e.data.that.popoverShownNow=!0}},this.addQuateHandler=function(e){this.popoverShown=!1,$("#messagesBlock-"+e+" > .message-row:not([qt])").on("mouseup",{chat_id:e,that:this},lhinst.mouseClicked).on("contextmenu",{chat_id:e,that:this},lhinst.mouseContextMenu).attr("qt",1)},this.getSelectedTextPlain=function(){var e=this.selection.text.replace(/[\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA]/g,"");return e=(e=(e=(e=e.replace(/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.*)/gm,"")).replace(/^[0-9]{2}:[0-9]{2}:[0-9]{2}(.*)/gm,"")).replace(/^\s*\n/gm,"")).replace(/^ /gm,"")},this.quateSelection=function(e){$(".popover-copy").popover("dispose");var t=this.getSelectedTextPlain();window.textreplace=t,this.insertTextToMessageArea(e,t),this.popoverShown=!1},this.hidePopover=function(){!0===this.popoverShownNow?this.popoverShownNow=!1:!0===this.popoverShown&&(this.popoverShown=!1,$(".popover-copy").popover("dispose"))},this.addTab=function(e,t,n,i,a,s){if(!(e.find("#chat-tab-link-"+i).length>0)){var o=confLH.new_dashboard&&confLH.hide_tabs?" d-none":"",r='<li role="presentation" id="chat-tab-li-'+i+'" class="nav-item'+o+'"><a class="nav-link" href="#chat-id-'+i+'" id="chat-tab-link-'+i+'" aria-controls="chat-id-'+i+'" role="tab" data-toggle="tab"><i id="msg-send-status-'+i+'" class="material-icons send-status-icon icon-user-online">send</i><i id="user-chat-status-'+i+'" class="'+this.tabIconClass+'">'+this.tabIconContent+'</i><span class="ntab" id="ntab-chat-'+i+'">'+n.replace(/</g,"&lt;").replace(/>/g,"&gt;")+'</span><span onclick="return lhinst.removeDialogTab('+i+',$(\'#tabs\'),true)" class="material-icons icon-close-chat">close</span></a></li>';void 0===s||0==parseInt(s)?e.find("> ul").append(r):e.find("> ul > li:eq("+(s-1)+")").after(r),$("#chat-tab-link-"+i).click((function(){lhinst.previous_chat_id>0&&$("#unread-separator-"+lhinst.previous_chat_id).remove(),lhinst.previous_chat_id=i,setTimeout((function(){$("#CSChatMessage-"+i).focus()}),2);var e=$(this);setTimeout((function(){e.find(".msg-nm").remove();var t=!1;e.hasClass("has-pm")&&(t=!0,e.removeClass("has-pm")),1==t&&$("#messagesBlock-"+i).prop("scrollTop",$("#messagesBlock-"+i).prop("scrollHeight"))}),500),ee.emitEvent("chatTabClicked",[i,e])}));var l=window.location.hash.replace("#/","#"),c=this;$.get(t,(function(t){""!=t?(void 0===a||!0===a||l=="#chat-id-"+i?(e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > #chat-tab-li-"+i+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content").append('<div role="tabpanel" class="tab-pane active" id="chat-id-'+i+'"></div>'),window.location.hash="#/chat-id-"+i):e.find("> div.tab-content").append('<div role="tabpanel" class="tab-pane" id="chat-id-'+i+'"></div>'),$("#chat-id-"+i).html(t),$("#CSChatMessage-"+i).focus(),0==c.disableremember&&c.rememberTab(i),c.addQuateHandler(i),c.loadMainData(i),ee.emitEvent("chatTabLoaded",[i])):c.removeDialogTab(i,e,!0)}))}},this.rememberTab=function(e){if(localStorage)try{e=parseInt(e);var t=localStorage.getItem("achat_id"),n=new Array;if(null!==t)n=t.split(",").map(Number);-1===n.indexOf(e)&&n.push(e),localStorage.setItem("achat_id",n.join(","))}catch(e){console.log(e)}},this.forgetChat=function(e,t){if(localStorage)try{e=parseInt(e);var n=localStorage.getItem(t),i=new Array;null!==n&&(i=n.split(",").map(Number)),-1!==i.indexOf(e)&&i.splice(i.indexOf(e),1),localStorage.setItem(t,i.join(","))}catch(e){console.log(e)}},this.attachTabNavigator=function(){$("#tabs > ul.nav > li > a").click((function(){$(this).find(".msg-nm").remove(),$(this).removeClass("has-pm")}))},this.holdAction=function(e,t){if(!$("#CSChatMessage-"+e).is("[readonly]")){var n=this;$.postJSON(this.wwwDir+"chat/holdaction/"+e,(function(i){0==i.error?(1==i.hold?t.addClass("btn-outline-info"):t.removeClass("btn-outline-info"),""!=i.msg&&$("#messagesBlock-"+e).append(i.msg).scrollTop($("#messagesBlock-"+e).prop("scrollHeight")),n.syncadmincall()):alert(i.msg)}))}},this.copyContent=function(e){var t,n=document.createElement("textarea");n.value=e.attr("data-copy"),n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")}catch(e){alert("Oops, unable to copy")}document.body.removeChild(n),e.tooltip({trigger:"click",placement:"top"}),t=e.attr("data-success"),e.tooltip("hide").attr("data-original-title",t).tooltip("show"),setTimeout((function(){e.tooltip("hide")}),1e3)},this.copyMessages=function(e){var t;return $("#chat-copy-messages").select(),document.execCommand("copy"),e.tooltip({trigger:"click",placement:"top"}),t=e.attr("data-success"),e.tooltip("hide").attr("data-original-title",t).tooltip("show"),setTimeout((function(){e.tooltip("hide")}),3e3),!1},this.removeDialogTabGroup=function(e,t){ee.emitEvent("unloadGroupChat",[e]);this.smartTabFocus(t,e)},this.addGroupTab=function(e,t,n,i){if(e.find("#chat-tab-link-"+n).length>0)return e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > li#chat-tab-li-"+n+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content > #chat-id-"+n).addClass("active"),void ee.emitEvent("groupChatTabClicked",[n]);var a='<li role="presentation" id="chat-tab-li-'+n+'" class="nav-item"><a class="nav-link" href="#chat-id-'+n+'" id="chat-tab-link-'+n+'" aria-controls="chat-id-'+n+'" role="tab" data-toggle="tab"><i id="msg-send-status-'+n+'" class="material-icons send-status-icon icon-user-online">send</i><i class="whatshot blink-ani d-none text-warning material-icons">whatshot</i><i id="user-chat-status-'+n+'" class="'+this.tabIconClass+'">group</i><span class="ntab" id="ntab-chat-'+n+'">'+t.replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</span><span onclick=\"return lhinst.removeDialogTabGroup('"+n+"',$('#tabs'),true)\" class=\"material-icons icon-close-chat\">close</span></a></li>";e.find("> ul").append(a);window.location.hash.replace("#/","#");!0!==i?(e.find("> ul > li > a.active").removeClass("active"),e.find("> ul > #chat-tab-li-"+n+" > a").addClass("active"),e.find("> div.tab-content > div.active").removeClass("active"),e.find("> div.tab-content").append('<div role="tabpanel" class="tab-pane active" id="chat-id-'+n+'"></div>')):e.find("> div.tab-content").append('<div role="tabpanel" class="tab-pane" id="chat-id-'+n+'"></div>'),ee.emitEvent("groupChatTabLoaded",[n]),$("#chat-tab-link-"+n).click((function(){ee.emitEvent("groupChatTabClicked",[n.replace("gc","")])}))},this.startGroupChat=function(e,t,n,i){this.addGroupTab(t,n,"gc"+e,i)},this.hideShowAction=function(e){var t=$("#messagesBlock-"+e.chat_id),n=t.prop("scrollTop")+t.height()+30>t.prop("scrollHeight"),i=$("#message-more-"+e.id);i.hasClass("hide")?(i.removeClass("hide"),0==e.hide_show?$("#hide-show-action-"+e.id).remove():$("#hide-show-action-"+e.id).text(e.hide_text)):(i.addClass("hide"),1==e.hide_show&&$("#hide-show-action-"+e.id).text(e.show_text)),n&&t.scrollTop(t.prop("scrollHeight"))},this.buttonAction=function(e,t){var n=e.closest(".message-row");$.getJSON(this.wwwDir+"chat/abstractclick/"+n.attr("id").replace("msg-","")+"/"+t,(function(e){if(e.error)alert(e.error);else if(e.replace_id&&e.html){var t=$("#messagesBlock-"+e.chat_id),n=t.prop("scrollTop")+t.height()+30>t.prop("scrollHeight");$(e.replace_id).replaceWith(e.html),lhinst.addQuateHandler(e.chat_id),n&&t.scrollTop(t.prop("scrollHeight"))}else e.modal&&lhc.revealModal({url:WWW_DIR_JAVASCRIPT+e.modal})}))},this.startChat=function(e,t,n,i,a){if(this.removeBackgroundChat(e),this.hideNotification(e),$("#sub-tabs").length>0&&$("#sub-tabs a[href='#sub-tabs-open']").tab("show"),0==this.chatUnderSynchronization(e)){var s=void 0===i||i,o=0==this.disableremember?"/(remember)/true":"";this.addTab(t,this.wwwDir+"chat/adminchat/"+e+o,n,e,s,a);var r=this;setTimeout((function(){r.syncadmininterfacestatic()}),1e3)}else t.find("> ul > li > a.active").removeClass("active"),t.find("> ul > li#chat-tab-li-"+e+" > a").addClass("active"),t.find("> div.tab-content > div.active").removeClass("active"),t.find("> div.tab-content > #chat-id-"+e).addClass("active"),window.location.hash="#/chat-id-"+e;ee.emitEvent("chatStartTab",[e,{name:n,focus:void 0===i||i,position:a}])},this.backgroundChats=[],this.startChatBackground=function(e,t,n,i){if(0==this.chatUnderSynchronization(e)){this.backgroundChats.push(parseInt(e));var a=0==this.disableremember?"/(remember)/true":"";return i||(i="background"),this.addTab(t,this.wwwDir+"chat/adminchat/"+e+a+"/(arg)/"+i,n,e,!1),ee.emitEvent("chatStartBackground",[e,{name:n}]),!0}return!1},this.protectCSFR=function(){$("a.csfr-required").click((function(){var e=$(this);e.attr("data-secured")||(e.attr("href",e.attr("href")+"/(csfr)/"+confLH.csrf_token),e.attr("data-secured",1))}))},this.setChatHash=function(e){this.hash=e},this.addSynchroChat=function(e,t){this.chatsSynchronising.push(e),this.chatsSynchronisingMsg.push(e+","+t),LHCCallbacks.addSynchroChat&&LHCCallbacks.addSynchroChat(e,t)},this.removeSynchroChat=function(e){for(var t=0;t<this.chatsSynchronising.length;)this.chatsSynchronising[t]==e?(this.chatsSynchronising.splice(t,1),this.chatsSynchronisingMsg.splice(t,1)):t++;this.forgetChat(e,"achat_id"),ee.emitEvent("removeSynchroChat",[e]),LHCCallbacks.removeSynchroChat&&LHCCallbacks.removeSynchroChat(e)},this.is_typing=!1,this.typing_timeout=null,this.operatorTypingCallback=function(e){var t=this.wwwDir,n=this;0==n.is_typing?(n.is_typing=!0,clearTimeout(n.typing_timeout),1==n.nodeJsMode?(n.typing_timeout=setTimeout((function(){n.typingStoppedOperator(e)}),3e3),ee.emitEvent("operatorTyping",[{chat_id:e,status:!0}])):$.getJSON(t+"chat/operatortyping/"+e+"/true",{},(function(t){n.typing_timeout=setTimeout((function(){n.typingStoppedOperator(e)}),3e3),LHCCallbacks.initTypingMonitoringAdmin&&LHCCallbacks.initTypingMonitoringAdmin(e,!0)})).fail((function(){n.typing_timeout=setTimeout((function(){n.typingStoppedOperator(e)}),3e3)}))):(clearTimeout(n.typing_timeout),n.typing_timeout=setTimeout((function(){n.typingStoppedOperator(e)}),3e3))},this.initTypingMonitoringAdmin=function(e){var t=this;jQuery("#CSChatMessage-"+e).bind("keyup",(function(n){t.operatorTypingCallback(e)}))},this.remarksTimeout=null,this.saveRemarks=function(e){clearTimeout(this.remarksTimeout),$("#remarks-status-"+e).addClass("text-warning"),$("#main-user-info-remarks-"+e+" .alert").remove();var t=this;this.remarksTimeout=setTimeout((function(){$.postJSON(t.wwwDir+"chat/saveremarks/"+e,{data:$("#ChatRemarks-"+e).val()},(function(t){"false"==t.error?$("#remarks-status-"+e).removeClass("text-warning"):$("#main-user-info-remarks-"+e).prepend(t.result)}))}),500)},this.saveNotes=function(e){clearTimeout(this.remarksTimeout),$("#remarks-status-online-"+e).addClass("text-warning");var t=this;this.remarksTimeout=setTimeout((function(){$.postJSON(t.wwwDir+"chat/saveonlinenotes/"+e,{data:$("#OnlineRemarks-"+e).val()},(function(t){$("#remarks-status-online-"+e).removeClass("text-warning")}))}),500)},this.surveyShowed=!1,this.closeWindow=function(){null!==this.survey&&0==this.surveyShowed?(this.surveyShowed=!0,this.chatClosed()):(window.open("","_self",""),window.close(),parent.postMessage("lhc_chat_closed_explicit","*"))},this.typingStoppedOperator=function(e){var t=this;1==t.is_typing&&(1==lhinst.nodeJsMode?(t.is_typing=!1,ee.emitEvent("operatorTyping",[{chat_id:e,status:!1}])):$.getJSON(this.wwwDir+"chat/operatortyping/"+e+"/false",{},(function(n){t.is_typing=!1,LHCCallbacks.initTypingMonitoringAdmin&&LHCCallbacks.initTypingMonitoringAdmin(e,!1)})).fail((function(){t.is_typing=!1})))},this.sendemail=function(){$.postJSON(this.wwwDir+"chat/sendchat/"+this.chat_id+"/"+this.hash,{csfr_token:confLH.csrf_token,email:$('input[name="UserEmail"]').val()},(function(e){"false"==e.error?$("#myModal").modal("hide"):($("#user-action .alert-box").remove(),$("#user-action").prepend(e.result))}))},this.initTypingMonitoringUser=function(e){var t=this.wwwDir,n=this;try{sessionStorage&&sessionStorage.getItem("lhc_ttxt")&&""!=sessionStorage.getItem("lhc_ttxt")&&jQuery("#CSChatMessage").val(sessionStorage.getItem("lhc_ttxt"))}catch(e){}var i=!1;""!=jQuery("#CSChatMessage").val()?($("#lhc-send-icon").show(),$("#lhc-mic-icon").hide()):$("#lhc-mic-icon").length>0&&($("#lhc-send-icon").hide(),$("#lhc-mic-icon").show(),i=!0),jQuery("#CSChatMessage").bind("keyup",(function(a){try{sessionStorage&&sessionStorage.setItem("lhc_ttxt",$(this).val())}catch(e){}var s=$(this)[0];s.style.height="5px",1==i&&(""!=$(this).val()?($("#lhc-send-icon").show(),$("#lhc-mic-icon").hide(),$("#voice-control-message").hide()):($("#lhc-send-icon").hide(),$("#lhc-mic-icon").show()));var o=s.scrollHeight+3;if(o>48&&(o+=10,s.style.overflowY=o>90?"auto":"hidden"),s.style.height=o+"px",0==n.is_typing)clearTimeout(n.typing_timeout),LHCCallbacks.initTypingMonitoringUserInform?(n.typing_timeout=setTimeout((function(){ee.emitEvent("visitorTypingStopped",[{chat_id:e,hash:n.hash}])}),3e3),ee.emitEvent("visitorTyping",[{chat_id:e,hash:n.hash,status:!0,msg:$(this).val()}])):(n.is_typing=!0,$.postJSON(t+"chat/usertyping/"+e+"/"+n.hash+"/true",{msg:$(this).val()},(function(t){n.typing_timeout=setTimeout((function(){n.typingStoppedUser(e)}),3e3),LHCCallbacks.initTypingMonitoringUser&&ee.emitEvent("initVisitorTyping",[e,!0])})).fail((function(){n.typing_timeout=setTimeout((function(){n.typingStoppedUser(e)}),3e3)})));else{clearTimeout(n.typing_timeout),n.typing_timeout=setTimeout((function(){n.typingStoppedUser(e)}),3e3);var r=$(this).val();n.currentMessageText!=r&&Math.abs(n.currentMessageText.length-r.length)>6&&(n.currentMessageText=r,LHCCallbacks.initTypingMonitoringUserInform?ee.emitEvent("visitorTyping",[{chat_id:e,hash:n.hash,status:!0,msg:$(this).val()}]):$.postJSON(t+"chat/usertyping/"+e+"/"+n.hash+"/true",{msg:r},(function(t){LHCCallbacks.initTypingMonitoringUser&&ee.emitEvent("initVisitorTyping",[e,!0])})))}}))},this.typingStoppedUser=function(e){var t=this;1==t.is_typing&&(LHCCallbacks.typingStoppedUserInform?(t.is_typing=!1,ee.emitEvent("visitorTypingStopped",[{chat_id:e,hash:this.hash,status:!1}])):$.getJSON(this.wwwDir+"chat/usertyping/"+e+"/"+this.hash+"/false",{},(function(n){t.is_typing=!1,LHCCallbacks.initTypingMonitoringUser&&ee.emitEvent("initVisitorTyping",[e,!1])})).fail((function(){t.is_typing=!1})))},this.refreshFootPrint=function(e){e.addClass("disabled"),$.get(this.wwwDir+"chat/chatfootprint/"+e.attr("rel"),{},(function(t){$("#footprint-"+e.attr("rel")).html(t),e.removeClass("disabled")}))},this.makeAbstractRequest=function(e,t){return $.get(t.attr("href"),(function(t){lhinst.syncadmininterfacestatic(),LHCCallbacks.userRedirectedSurvey&&LHCCallbacks.userRedirectedSurvey(e)})),!1},this.refreshOnlineUserInfo=function(e){e.addClass("disabled"),$.get(this.wwwDir+"chat/refreshonlineinfo/"+e.attr("rel"),{},(function(t){$("#online-user-info-"+e.attr("rel")).html(t),e.removeClass("disabled")}))},this.processCollapse=function(e){if("chevron_right"==$("#chat-main-column-"+e+" .collapse-right").text()){$("#chat-right-column-"+e).hide(),$("#chat-main-column-"+e).removeClass("col-sm-7").addClass("col-sm-12"),$("#chat-main-column-"+e+" .collapse-right").text("chevron_left");try{localStorage&&localStorage.setItem("lhc_rch",1)}catch(e){}}else{$("#chat-right-column-"+e).show(),$("#chat-main-column-"+e).removeClass("col-sm-12").addClass("col-sm-7"),$("#chat-main-column-"+e+" .collapse-right").text("chevron_right");try{localStorage&&localStorage.removeItem("lhc_rch")}catch(e){}}},this.chatUnderSynchronization=function(e){for(var t=0;t<this.chatsSynchronising.length;){if(this.chatsSynchronising[t]==e)return!0;t++}return!1},this.getChatIndex=function(e){for(var t=0;t<this.chatsSynchronising.length;){if(this.chatsSynchronising[t]==e)return t;t++}return!1},this.updateUserSyncInterface=function(e,t){try{if("false"==t.error)if("true"!=t.blocked){if("false"!=t.result&&"true"==t.status){var n=$("#messagesBlock"),i=n.prop("scrollHeight"),a=Math.abs(i-n.prop("scrollTop")-n.prop("clientHeight"));i=n.prop("scrollHeight"),n.find(".pending-storage").remove(),n.append(t.result),n.find(".meta-auto-hide").hide(),n.find(".message-row").last().find(".meta-auto-hide").show(),(a<20||1==e.forceBottomScroll)&&(e.forceBottomScroll=!1,n.scrollTop(i+2e3)),1==confLH.new_message_sound_user_enabled&&"false"==t.uw&&e.playNewMessageSound(),e.last_message_id>0&&($("#msg-"+e.last_message_id).attr("data-op-id")==t.msop&&$("#msg-"+e.last_message_id+" > .usr-tit").text()===$("#msg-"+t.message_id+" > .usr-tit").text()||$("#msg-"+e.last_message_id).next().addClass("operator-changes")),e.last_message_id=t.message_id,"false"==t.uw&&e.isWidgetMode&&"undefined"!=typeof parent&&parent.postMessage("lhc_newopmsg","*")}else"true"!=t.status&&$("#status-chat").html(t.status);if(e.userTimeout=setTimeout(chatsyncuser,confLH.chat_message_sinterval),"t"==t.cs&&e.chatsyncuserpending(),""!=t.ott&&"f"!=t.ott){var s=$("#id-operator-typing");s.text(t.ott),s.css("visibility","visible"),e.operatorTyping=!0}else"f"==t.ott&&(e.operatorTyping=!1,$("#id-operator-typing").css("visibility","hidden"));""!=t.op&&e.executeRemoteCommands(t.op)}else $("#status-chat").html(t.status),$("#ChatMessageContainer").remove(),$("#ChatSendButtonContainer").remove(),$("#id-operator-typing").css("visibility","hidden"),e.operatorTyping=!1,void 0!==t.op&&""!=t.op&&e.executeRemoteCommands(t.op),t.closed&&1==t.closed&&(ee.emitEvent("chatClosedSyncUser",[e.chat_id]),e.isWidgetMode&&"undefined"!=typeof parent&&window.location!==window.parent.location?parent.postMessage("lhc_chat_closed"+(void 0!==t.closed_arg?":"+t.closed_arg:""),"*"):(void 0!==t.closed_arg&&e.parseCloseArgs(t.closed_arg.split(":")),e.chatClosed()))}catch(t){e.userTimeout=setTimeout(chatsyncuser,confLH.chat_message_sinterval)}e.syncroRequestSend=!1},this.parseCloseArgs=function(e){var t=e.length/2;for(i=0;i<t;i++){var n=e[2*i],a=e[2*i+1];"survey_id"==n&&(this.survey=a)}},this.chatClosed=function(){if(null!==this.survey){var e=1==this.isWidgetMode?"/(mode)/widget":"",t=1==this.operatorTyping?"/(ot)/t":"",n=null!==this.theme?"/(theme)/"+this.theme:"",i=1==this.isEmbedMode?"/(modeembed)/embed":"",a=1==this.isWidgetMode?"fillwidget":"fill",s=1==this.explicitClose?"/(eclose)/t":"";return document.location.replace(this.wwwDir+"survey/"+a+"/(survey)/"+this.survey+"/(chatid)/"+this.chat_id+"/(hash)/"+this.hash+e+t+n+i+s),!0}return!1},this.executeRemoteCommands=function(operations){var inst=this;$.each(operations,(function(i,item){if(-1!=item.indexOf("lhinst."))try{eval(item)}catch(e){console.log(e)}else if(-1!=item.indexOf("lhc_ui_refresh")){var option=item.split(":")[1];1==option?lhinst.enableFileUpload():lhinst.disableFileUpload()}else inst.isWidgetMode?parent.postMessage(item,"*"):window.opener&&window.opener.postMessage(item,"*")}))},this.disableFileUpload=function(){$("#fileupload").fileupload("destroy"),$("#ChatMessageContainer .dropdown-menu .flex-row .file-uploader").remove()},this.syncusercall=function(){var e=this;if(0==this.syncroRequestSend){clearTimeout(this.userTimeout),this.syncroRequestSend=!0;var t=1==this.isWidgetMode?"/(mode)/widget":"",n=1==this.operatorTyping?"/(ot)/t":"",i=null!==this.theme?"/(theme)/"+this.theme:"",a=1==this.isEmbedMode?"/(modeembed)/embed":"";$.getJSON(this.wwwDir+this.syncuser+this.chat_id+"/"+this.last_message_id+"/"+this.hash+t+n+i+a,{},(function(t){e.updateUserSyncInterface(e,t),LHCCallbacks.syncusercall&&LHCCallbacks.syncusercall(e,t),ee.emitEvent("syncUserCall",[e,t])})).fail((function(){e.syncroRequestSend=!1,e.userTimeout=setTimeout(chatsyncuser,confLH.chat_message_sinterval)}))}},this.scheduleSync=function(){this.syncroRequestSend=!1,clearTimeout(this.userTimeout),this.userTimeout=setTimeout(chatsyncuser,confLH.chat_message_sinterval)},this.closeActiveChatDialog=function(e,t,n){if(ee.emitEvent("angularSyncDisabled",[!0]),$.postJSON(this.wwwDir+this.closechatadmin+e,(function(e){ee.emitEvent("angularSyncDisabled",[!1]),0==e.error?ee.emitEvent("angularLoadChatList"):alert(e.result)})).fail((function(e,t,n){ee.emitEvent("angularSyncDisabled",[!1]),console.dir(e)})),0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),window.postMessage&&window.opener&&window.opener.postMessage("lhc_ch:chatclosed:"+e,"*"),this.removeSynchroChat(e),1==n){var i=this.smartTabFocus(t,e);setTimeout((function(){window.location.hash=i}),500),1==this.closeWindowOnChatCloseDelete&&window.close()}LHCCallbacks.chatClosedCallback&&LHCCallbacks.chatClosedCallback(e)},this.smartTabFocus=function(e,t,n){var i=e.find("> ul > #chat-tab-li-"+t).index();n||(n={});var a=1==n.up||void 0===n.up?1:-1;n.keep?e.find("> ul > li > a.active").removeClass("active"):(e.find("> ul > #chat-tab-li-"+t).remove(),e.find("#chat-id-"+t).remove());var s=e.find("> ul > li:eq("+(i-a)+")");if(void 0!==s.attr("id"))var o=s.find("> a");else if(linkTabRight=e.find("> ul > li:eq("+i+")"),linkTabRight.length>0)o=linkTabRight.find("> a");else o=s.find("> a");if(!e.find("> ul > li > a.active").length&&(o.tab("show"),void 0!==o.attr("id"))){var r=o.attr("href").replace("#chat-id-","");this.removeBackgroundChat(r),this.hideNotification(r),n.keep||ee.emitEvent("chatTabFocused",[r])}return void 0!==o.attr("href")?o.attr("href").replace("#","#/"):"#"},this.startChatCloseTabNewWindow=function(e,t,n){return window.open(this.wwwDir+"chat/single/"+e,"chatwindow-chat-id-"+e,"menubar=1,resizable=1,width=800,height=650"),this.smartTabFocus(t,e),1==this.closeWindowOnChatCloseDelete&&window.close(),this.removeSynchroChat(e),this.syncadmininterfacestatic(),!1},this.removeDialogTab=function(e,t,n){if(0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),this.removeSynchroChat(e),1==n){var i=this.smartTabFocus(t,e);setTimeout((function(){window.location.hash=i}),500),1==this.closeWindowOnChatCloseDelete&&window.close()}this.syncadmininterfacestatic()},this.removeActiveDialogTag=function(e){1==this.closeWindowOnChatCloseDelete&&window.close()},this.deleteChat=function(e,t,n){if(confirm(confLH.transLation.delete_confirm)){var i=this;$.postJSON(this.wwwDir+this.deletechatadmin+e,(function(a){if(1==a.error)alert(a.result);else{if(0!=$("#CSChatMessage-"+e).length&&($("#CSChatMessage-"+e).unbind("keydown",(function(){})),$("#CSChatMessage-"+e).unbind("keyup",(function(){}))),i.removeSynchroChat(e),1==n){var s=i.smartTabFocus(t,e);setTimeout((function(){window.location.hash=s}),500),1==i.closeWindowOnChatCloseDelete&&window.close()}LHCCallbacks.chatDeletedCallback&&LHCCallbacks.chatDeletedCallback(e),i.syncadmininterfacestatic()}})).fail((function(e,t,n){console.dir(e),alert("getJSON request failed! "+t+":"+n+":"+e.responseText)}))}},this.rejectPendingChat=function(e,t){var n=this;$.postJSON(this.wwwDir+this.deletechatadmin+e,{},(function(e){n.syncadmininterfacestatic()})).fail((function(e,t,n){console.dir(e),alert("getJSON request failed! "+t+":"+n+":"+e.responseText)}))},this.startChatNewWindow=function(e,t){var n=window.open(this.wwwDir+"chat/single/"+e,"chatwindow-chat-id-"+e,"menubar=1,resizable=1,width=800,height=650");if(null!==n){n.focus();var i=this;setTimeout((function(){i.syncadmininterfacestatic()}),1e3),ee.emitEvent("chatStartOpenWindow",[e])}},this.startChatNewWindowArchive=function(e,t,n){var i=window.open(this.wwwDir+"chatarchive/viewarchivedchat/"+e+"/"+t+"/(mode)/popup","chatwindow-chat-id-"+t,"menubar=1,resizable=1,width=800,height=650");null!==i&&(i.focus(),ee.emitEvent("chatStartOpenWindowArchive",[e,t]))},this.startCoBrowse=function(e){return popupWindow=window.open(this.wwwDir+"cobrowse/browse/"+e,"chatwindow-cobrowse-chat-id-"+e,"menubar=1,resizable=1,width=800,height=650"),null!==popupWindow&&popupWindow.focus(),!1},this.speechToText=function(e){0==this.speechHandler&&(this.speechHandler=new LHCSpeechToText),this.speechHandler.listen({chat_id:e})},this.startChatTransfer=function(e,t,n,i){var a=this;$.getJSON(this.wwwDir+this.accepttransfer+i,{},(function(i){a.startChat(e,t,n),LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e)})).fail((function(){a.startChat(e,t,n)}))},this.startChatNewWindowTransfer=function(e,t,n){return $.getJSON(this.wwwDir+this.accepttransfer+n,{},(function(t){LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e)})),this.startChatNewWindow(e,t)},this.startChatNewWindowTransferByTransfer=function(e,t){var n=this;return $.ajax({type:"GET",url:this.wwwDir+this.accepttransfer+e+"/(mode)/chat",cache:!1,dataType:"json"}).done((function(e){$("#tabs").length>0?(window.focus(),n.startChat(e.chat_id,$("#tabs"),t)):n.startChatNewWindow(e.chat_id,""),LHCCallbacks.operatorAcceptedTransfer&&LHCCallbacks.operatorAcceptedTransfer(e.chat_id)})),this.syncadmininterfacestatic(),!1},this.switchLang=function(e,t){var n='<input type="hidden" value="'+t+'" name="switchLang" />';return e.append(n),e.submit(),!1},this.sendLinkToMail=function(e,t){var n=window.parent.$("#MailMessage").val();window.parent.$("#MailMessage").val((""!=n?n+"\n":n)+e),$("#embed-button-"+t).addClass("btn-success")},this.sendLinkToEditor=function(e,t,n){var i=window.parent.$("#CSChatMessage-"+e).val();window.parent.$("#CSChatMessage-"+e).val((""!=i?i+"\n":i)+t),$("#embed-button-"+n).addClass("btn-success")},this.sendLinkToGeneralEditor=function(e,t){var n=window.parent.$(".embed-into"),i=n.val();n.val((""!=i?i+"\n":i)+e),$("#embed-button-"+t).addClass("btn-success")},this.hideTransferModal=function(e){var t=this;setTimeout((function(){$("#myModal").modal("hide"),$("#tabs").length>0&&t.removeDialogTab(e,$("#tabs"),!0)}),1e3)},this.transferChat=function(e){var t=this,n=$("[name=TransferTo"+e+"]:checked").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"user"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.changeOwner=function(e){var t=this,n=$("#id_new_user_id").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"change_owner"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.chooseSurvey=function(e){var t=$("[name=SurveyItem"+e+"]:checked").val();$.postJSON(this.wwwDir+"survey/choosesurvey/"+e+"/"+t,(function(e){"false"==e.error&&$("#survey-block-"+e.chat_id).html(e.result)}))},this.redirectContact=function(e,t){(void 0===t||confirm(t))&&$.postJSON(this.wwwDir+"chat/redirectcontact/"+e,(function(t){lhinst.syncadmininterfacestatic(),LHCCallbacks.userRedirectedContact&&LHCCallbacks.userRedirectedContact(e)}))},this.redirectToURL=function(e,t){var n=prompt(t,"");null!=n&&lhinst.addRemoteCommand(e,"lhc_chat_redirect:"+n.replace(new RegExp(":","g"),"__SPLIT__"))},this.redirectToURLOnline=function(e,t){var n=prompt(t,"");null!=n&&(lhinst.addRemoteOnlineCommand(e,"lhc_chat_redirect:"+n.replace(new RegExp(":","g"),"__SPLIT__")),lhinst.addExecutionCommand(e,"lhc_cobrowse_multi_command__lhc_chat_redirect:"+n.replace(new RegExp(":","g"),"__SPLIT__")))},this.transferChatDep=function(e){var t=this,n=$("[name=DepartamentID"+e+"]:checked").val();$.postJSON(this.wwwDir+this.trasnsferuser+e+"/"+n,{type:"dep"},(function(n){"false"==n.error&&($("#transfer-block-"+n.chat_id).html(n.result),t.hideTransferModal(e))}))},this.chatTabsOpen=function(){return window.open(this.wwwDir+"chat/chattabs/","chatwindows","menubar=1,resizable=1,width=800,height=650"),!1},this.userclosedchat=function(){LHCCallbacks.userleftchatNotification&&LHCCallbacks.userleftchatNotification(this.chat_id),$.ajax({type:"GET",url:this.wwwDir+this.userclosechaturl+this.chat_id+"/"+this.hash,cache:!1})},this.userclosedchatembed=function(){window.postMessage&&"undefined"!=typeof parent&&window.location!==window.parent.location?parent.postMessage("lhc_chat_closed_explicit","*"):0==this.chatClosed()&&window.close()},this.continueChatFromSurvey=function(e){return this.isWidgetMode&&"undefined"!=typeof parent&&window.location!==window.parent.location?$.postJSON(this.wwwDir+"survey/backtochat/"+this.chat_id+"/"+this.hash+"/"+e,(function(e){parent.postMessage("lhc_continue_chat","*")})):this.chatClosed(),!1},this.explicitClose=!1,this.explicitChatCloseByUser=function(){return this.explicitClose=!0,ee.emitEvent("endedChat",[]),this.isWidgetMode&&"undefined"!=typeof parent&&window.location!==window.parent.location?parent.postMessage("lhc_chat_closed_explicit","*"):0==this.chatClosed()&&window.close(),!1},this.restoreWidget=function(e){window.postMessage&&window.opener&&(window.opener.postMessage("lhc_ch:hash:"+e,"*"),window.opener.postMessage("lhc_ch:hash_resume:"+e,"*"),window.opener.postMessage("lhc_open_restore","*"),window.close())},this.userclosedchatandbrowser=function(){LHCCallbacks.userleftchatNotification&&LHCCallbacks.userleftchatNotification(this.chat_id),$.get(this.wwwDir+this.userclosechaturl+this.chat_id+"/"+this.hash+"/(eclose)/t",(function(e){lhinst.closeWindow()}))},this.sendCannedMessage=function(e,t){if($("#id_CannedMessage-"+e).val()>0){t.addClass("secondary");var n=1e3*parseInt($("#id_CannedMessage-"+e).find(":selected").attr("data-delay")),i=this.wwwDir,a=this;if(0==a.is_typing?(a.is_typing=!0,clearTimeout(a.typing_timeout),LHCCallbacks.initTypingMonitoringAdminInform&&LHCCallbacks.initTypingMonitoringAdminInform({chat_id:e,status:!0}),$.getJSON(i+"chat/operatortyping/"+e+"/true",{},(function(i){LHCCallbacks.initTypingMonitoringAdmin&&LHCCallbacks.initTypingMonitoringAdmin(e,!0),a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e),t.removeClass("secondary")}),n>3e3?n:3e3)})).fail((function(){a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e)}),3e3)}))):(clearTimeout(a.typing_timeout),a.typing_timeout=setTimeout((function(){a.typingStoppedOperator(e)}),3e3),t.removeClass("secondary")),n>0)setTimeout((function(){var t={msg:$("#id_CannedMessage-"+e).find(":selected").attr("data-msg")};$("#CSChatMessage-"+e).val(""),$.postJSON(i+a.addmsgurl+e,t,(function(t){return LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.syncadmincall(),!0}))}),n);else{var s={msg:$("#id_CannedMessage-"+e).find(":selected").attr("data-msg")};$("#CSChatMessage-"+e).val(""),$.postJSON(this.wwwDir+this.addmsgurl+e,s,(function(t){return LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.syncadmincall(),!0}))}}return!1},this.voteAction=function(e){var t=this.chat_id;$.postJSON(this.wwwDir+"chat/voteaction/"+this.chat_id+"/"+this.hash+"/"+e.attr("data-id"),{},(function(e){"false"==e.error&&(LHCCallbacks.uservoted&&LHCCallbacks.uservoted(t),0==e.status?($(".up-vote-action").removeClass("up-voted"),$(".down-vote-action").removeClass("down-voted")):1==e.status?($(".up-vote-action").addClass("up-voted"),$(".down-vote-action").removeClass("down-voted")):2==e.status&&($(".up-vote-action").removeClass("up-voted"),$(".down-vote-action").addClass("down-voted")))}))},this.theme=null,this.checkChatStatusTimeout=null,this.chatStatus=null,this.chatsyncuserpending=function(){var e=1==this.isWidgetMode?"/(mode)/widget":"",t=null!==this.theme?"/(theme)/"+this.theme:"";clearTimeout(this.checkChatStatusTimeout);var n=this;$.getJSON(this.wwwDir+this.checkchatstatus+this.chat_id+"/"+this.hash+e+t,{},(function(e){ee.emitEvent("checkChatStatus",[n.chat_id,e]),n.chatStatus=e.status,"false"==e.error&&("false"==e.activated?("false"!=e.result&&$("#status-chat").html(e.result),""!=e.ru&&document.location.replace(e.ru),n.checkChatStatusTimeout=setTimeout(chatsyncuserpending,confLH.chat_message_sinterval)):($("#status-chat").html(e.result),e.closed&&1==e.closed&&(ee.emitEvent("chatClosedCheckStatus",[n.chat_id]),n.isWidgetMode&&"undefined"!=typeof parent&&window.location!==window.parent.location?parent.postMessage("lhc_chat_closed","*"):n.chatClosed())))})).fail((function(){setTimeout(chatsyncuserpending,confLH.chat_message_sinterval)}))},this.setTheme=function(e){this.theme=e},this.survey=null,this.setSurvey=function(e){this.survey=e},this.isBlinking=!1,this.startBlinking=function(){if(0==this.isBlinking){var e=this;(n=document.title,i="!!! "+document.title,a=function(){document.title=document.title==i?" ":i},s=function(){clearInterval(t),document.title=n,window.onmousemove=null,t=null,e.isBlinking=!1},function(){t||(t=setInterval(a,1e3),window.onmousemove=s)})(),this.isBlinking=!0}var t,n,i,a,s},this.playNewMessageSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/new_message.ogg?v=3":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/new_message.mp3?v=3":WWW_DIR_JAVASCRIPT_FILES+"/new_message.wav?v=3",this.audio.load()),$("textarea[name=ChatMessage]").is(":focus")||this.startBlinking()},this.playInvitationSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/invitation.ogg":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/invitation.mp3":WWW_DIR_JAVASCRIPT_FILES+"/invitation.wav",this.audio.load())},this.playPreloadSound=function(){Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/silence.ogg":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/silence.mp3":WWW_DIR_JAVASCRIPT_FILES+"/silence.wav",this.audio.load())},this.loadPreviousMessages=function(e){$.getJSON(this.wwwDir+"chat/loadpreviousmessages/"+e.attr("chat-id")+"/"+e.attr("message-id")+"/(initial)/"+e.attr("data-initial"),(function(t){if(0==t.error){e.attr("data-initial",0);var n=$("#messagesBlock-"+e.attr("chat-original-id"));n.prepend(t.result),1==e.attr("auto-scroll")&&(e.attr("auto-scroll",0),n.scrollTop(n.prop("scrollHeight"))),1==t.has_messages?(e.attr("message-id",t.message_id),e.attr("chat-id",t.chat_id)):e.remove()}}))},this.hidenicknamesstatus=null,this.onScrollAdmin=function(e){var t=$("#messagesBlock-"+e),n=t.prop("scrollHeight");Math.abs(n-t.prop("scrollTop")-t.prop("clientHeight"))>20?$("#scroll-button-admin-"+e).removeClass("d-none"):$("#scroll-button-admin-"+e).addClass("d-none").find("> button").text($("#scroll-button-admin-"+e+" > button").attr("data-default"))},this.scrollToTheBottomMessage=function(e){var t=$("#unread-separator-"+e);if(t.length>0)t[0].scrollIntoView(),setTimeout((function(){t.remove()}),1e3);else{var n=$("#messagesBlock-"+e);n.scrollTop(n.prop("scrollHeight"))}},this.syncadmincall=function(){this.chatsSynchronising.length>0?0==this.underMessageAdd&&0==this.syncroRequestSend?(this.syncroRequestSend=!0,$.postJSON(this.wwwDir+this.syncadmin,{"chats[]":this.chatsSynchronisingMsg},(function(e){void 0!==e.error_url&&document.location.replace(e.error_url);try{if("false"==e.error){if("false"!=e.result){var t=!1;$.each(e.result,(function(n,i){var a=$("#messagesBlock-"+i.chat_id),s=a.prop("scrollHeight"),o=Math.abs(s-a.prop("scrollTop")-a.prop("clientHeight"));a.find(".pending-storage").slice(0,i.mn).remove();var r=$("#chat-tab-link-"+i.chat_id),l=!focused;if(!r.hasClass("active"))if(r.find("span.msg-nm").length>0){var c=parseInt(r.find("span.msg-nm").attr("rel"))+i.mn;r.find("span.msg-nm").html(" ("+c+")").attr("rel",c)}else l=!0,r.append('<span rel="'+i.mn+'" class="msg-nm"> ('+i.mn+")</span>"),r.addClass("has-pm");o>20&&(l=!0,$("#scroll-button-admin-"+i.chat_id+" > button").text($("#scroll-button-admin-"+i.chat_id+" > button").attr("data-new"))),1==l&&null===document.getElementById("unread-separator-"+i.chat_id)&&(i.content=i.content.replace('<span class="usr-tit','<div id="unread-separator-'+i.chat_id+'" class="new-msg-holder border-bottom border-danger text-center"><span class="new-msg bg-danger text-white d-inline-block fs12 rounded-top">'+confLH.transLation.new+'</span></div><span class="usr-tit')),a.append(i.content),a.find(".pending-storage").appendTo(a),lhinst.addQuateHandler(i.chat_id),o<20&&a.scrollTop(s),lhinst.updateChatLastMessageID(i.chat_id,i.message_id),0!=t||"false"!=e.uw||void 0!==i.ignore&&!1!==typeof i.ignore||(t=!0),1!=confLH.new_message_browser_notification||"false"!=e.uw||void 0!==i.ignore&&!1!==typeof i.ignore||lhinst.showNewMessageNotification(i.chat_id,i.msg,i.nck),i.msfrom>0&&$("#msg-"+i.msfrom).attr("data-op-id")!=i.msop&&$("#msg-"+i.msfrom).next().addClass("operator-changes"),ee.emitEvent("eventSyncAdmin",[i,n])})),1==confLH.new_message_sound_admin_enabled&&"false"==e.uw&&1==t&&lhinst.playNewMessageSound()}if("false"!=e.result_status){var n=$("#group-chats-status").hasClass("chat-active");$.each(e.result_status,(function(e,t){var i=$("#user-is-typing-"+t.chat_id);"true"==t.tp?(0==lhinst.nodeJsMode&&i.html(t.tx),"hidden"==i.css("visibility")&&i.css("visibility","visible")):0==lhinst.nodeJsMode&&i.css("visibility","hidden"),$("#last-msg-chat-"+t.chat_id).text(t.lmsg);var a=$("#user-chat-status-"+t.chat_id),s=a.hasClass("icon-user-online");$("#chat-duration-"+t.chat_id).text(t.cdur),a.removeClass("icon-user-online icon-user-away icon-user-pageview"),$("#msg-send-status-"+t.chat_id).removeClass("icon-user-online icon-user-offline"),0==t.us?a.addClass("icon-user-online"):2==t.us?a.addClass("icon-user-away"):3==t.us&&a.addClass("icon-user-pageview"),1==n?1==s&&0!=t.us||lhinst.hidenicknamesstatus!=n&&0!=t.us?$("#ntab-chat-"+t.chat_id).hide():(0==s&&0==t.us||lhinst.hidenicknamesstatus!=n&&0==t.us)&&$("#ntab-chat-"+t.chat_id).show():lhinst.hidenicknamesstatus!=n&&$("#ntab-chat-"+t.chat_id).show();var o=$("#chat-id-"+t.chat_id+"-mds");if(o.attr("data-chat-status")==t.cs&&o.attr("data-chat-user")==t.co||lhinst.updateVoteStatus(t.chat_id),1==t.um?(o.addClass("chat-unread"),$("#msg-send-status-"+t.chat_id).addClass("icon-user-offline")):($("#msg-send-status-"+t.chat_id).addClass("icon-user-online"),o.removeClass("chat-unread")),!1!==t.lp?o.attr("title",t.lp+" s."):o.attr("title",""),void 0!==t.oad&&1==t.oad){$("#lhc_sync_operation").remove();var r=document.getElementsByTagName("head")[0],l=document.createElement("script");l.setAttribute("id","lhc_sync_operation"),l.setAttribute("type","text/javascript"),l.setAttribute("src",WWW_DIR_JAVASCRIPT+"chat/loadoperatorjs/(type)/chat/(id)/"+t.chat_id),r.appendChild(l)}}))}e.cg&&$.each(e.cg,(function(e,t){return lhinst.removeDialogTab(t,$("#tabs"),!0)})),lhinst.hidenicknamesstatus=n,clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval),ee.emitEvent("chatAdminSync",[e])}}catch(e){clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval)}lhinst.setSynchronizationRequestSend(!1),LHCCallbacks.syncadmincall&&LHCCallbacks.syncadmincall(lhinst,e)})).fail((function(){clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval),lhinst.setSynchronizationRequestSend(!1)}))):(clearTimeout(lhinst.userTimeout),lhinst.userTimeout=setTimeout(chatsyncadmin,confLH.chat_message_sinterval)):this.isSinchronizing=!1},this.updateVoteStatus=function(e){$.getJSON(this.wwwDir+"chat/updatechatstatus/"+e,{},(function(t){$("#main-user-info-tab-"+e).html(t.result),$("#messagesBlock-"+e+" span.vis-tit").each((function(e){var n=$(this).children();$(this).text(" "+t.nick).prepend(n)})),$("#ntab-chat-"+e).text(t.nick),ee.emitEvent("chatTabInfoReload",[e])}))},this.updateChatLastMessageID=function(e,t){this.chatsSynchronisingMsg[this.getChatIndex(e)]=e+","+t},this.requestNotificationPermission=function(){window.webkitNotifications?window.webkitNotifications.requestPermission():window.Notification?Notification.requestPermission((function(e){})):alert("Notification API in your browser is not supported.")},this.playNewChatAudio=function(e){if(clearTimeout(this.soundIsPlaying),this.soundPlayedTimes++,Modernizr.audio&&null!==this.audio&&(this.audio.src=Modernizr.audio.ogg?WWW_DIR_JAVASCRIPT_FILES+"/"+e+".ogg?v=4":Modernizr.audio.mp3?WWW_DIR_JAVASCRIPT_FILES+"/"+e+".mp3?v=4":WWW_DIR_JAVASCRIPT_FILES+"/"+e+".wav?v=4",this.audio.load(),confLH.repeat_sound>this.soundPlayedTimes)){var t=this;this.soundIsPlaying=setTimeout((function(){t.playNewChatAudio(e)}),1e3*confLH.repeat_sound_delay)}},this.focusChanged=function(e){if(1==confLH.new_message_browser_notification&&1==e&&(window.webkitNotifications||window.Notification)){var t=this;$.each(this.chatsSynchronising,(function(e,n){void 0!==t.notificationsArrayMessages[n]&&(window.webkitNotifications?t.notificationsArrayMessages[n].cancel():t.notificationsArrayMessages[n].close(),delete t.notificationsArrayMessages[n])}))}parseInt(this.chat_id)>0&&this.scheduleSync()},this.notificationsArrayMessages=[],this.showNewMessageNotification=function(e,t,n){try{if(window.Notification&&0==focused&&"granted"==window.Notification.permission){void 0!==this.notificationsArrayMessages[e]&&(this.notificationsArrayMessages[e].close(),delete this.notificationsArrayMessages[e]);var i=new Notification(n,{icon:WWW_DIR_JAVASCRIPT_FILES_NOTIFICATION+"/notification.png",body:t}),a=this;i.onclick=function(){window.focus(),i.close(),delete a.notificationsArrayMessages[e]},i.onclose=function(){void 0!==a.notificationsArrayMessages[e]&&delete a.notificationsArrayMessages[e]},this.notificationsArrayMessages[e]=i,this.scheduleNewMessageClose(i,e)}}catch(e){console.log(e)}},this.scheduleNewMessageClose=function(e,t){var n=this;setTimeout((function(){window.webkitNotifications?e.cancel():e.close(),void 0!==n.notificationsArrayMessages[t]&&delete n.notificationsArrayMessages[t]}),1e4)},this.playSoundNewAction=function(e,t,n,i,a){if(-1==this.backgroundChats.indexOf(parseInt(t))){1!=confLH.new_chat_sound_enabled||1!=confLH.sn_off&&"flash_on"!=$("#online-offline-user").text()||"active_chats"!=e&&"bot_chats"!=e&&"pending_chat"!=e&&"transfer_chat"!=e&&"unread_chat"!=e&&"pending_transfered"!=e||(this.soundPlayedTimes=0,this.playNewChatAudio("active_chats"==e?"alert":"new_chat")),$("textarea[name=ChatMessage]").is(":focus")||1!=confLH.sn_off&&"flash_on"!=$("#online-offline-user").text()||"active_chats"!=e&&"bot_chats"!=e&&"pending_chat"!=e&&"transfer_chat"!=e&&"unread_chat"!=e&&"pending_transfered"!=e||this.startBlinking();var s=this;if(("active_chats"==e||"pending_chat"==e||"transfer_chat"==e||"unread_chat"==e||"bot_chats"==e||"pending_transfered"==e)&&(1==confLH.sn_off||"flash_on"==$("#online-offline-user").text())&&window.Notification&&"granted"==window.Notification.permission){var o=new Notification(n,{icon:WWW_DIR_JAVASCRIPT_FILES_NOTIFICATION+"/notification.png",body:i,requireInteraction:!0});o.onclick=function(){"active_chats"==e||"pending_chat"==e||"unread_chat"==e||"pending_transfered"==e||"bot_chats"==e?$("#tabs").length>0?(window.focus(),s.startChat(t,$("#tabs"),a)):s.startChatNewWindow(t,"ChatRequest"):s.startChatNewWindowTransferByTransfer(t,a),o.close()},"pending_transfered"!=e&&("undefined"!==this.notificationsArray[t]&&o.close(),this.notificationsArray[t]=o)}("transfer_chat"==e&&confLH.accept_chats||"transfer_chat"==e&&1==confLH.show_alert_transfer&&confirm(confLH.transLation.transfered+"\n\n"+i))&&s.startChatNewWindowTransferByTransfer(t,a),1==confLH.show_alert&&confirm(confLH.transLation.new_chat+"\n\n"+i)&&("pending_chat"==e||"unread_chat"==e||"pending_transfered"==e||"bot_chats"==e?$("#tabs").length>0?(window.focus(),s.startChat(t,$("#tabs"),a)):s.startChatNewWindow(t,"ChatRequest"):s.startChatNewWindowTransferByTransfer(t,a))}},this.syncadmininterfacestatic=function(){try{ee.emitEvent("angularLoadChatList")}catch(e){}},this.addingUserMessage=!1,this.addUserMessageQueue=[],this.addDelayedTimeout=null,this.addmsgadmin=function(e,t){$("#unread-separator-"+e).remove();var n=$("#CSChatMessage-"+e);if(!n.is("[readonly]")){var i={msg:t||n.val()};if(n.attr("meta-msg")&&(i.meta_msg=n.attr("meta-msg"),n.removeAttr("meta-msg")),""!=i.msg){!1!==this.speechHandler&&this.speechHandler.messageSend(),t||n.val("");var a=n.attr("placeholder");if(n.attr("placeholder",confLH.transLation.sending||"Sending..."),n.hasClass("edit-mode"))i.msgid=n.attr("data-msgid"),$.postJSON(this.wwwDir+"chat/updatemsg/"+e,i,(function(t){if(n.attr("placeholder",a),"f"==t.error)return n.removeClass("edit-mode"),n.removeAttr("data-msgid"),$("#msg-"+i.msgid).replaceWith(t.msg),LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),lhinst.addQuateHandler(e),!0}));else{var s=this,o=$("#messagesBlock-"+e);t||o.append('<div class="message-row message-admin pending-storage"><div class="msg-body"><span class="material-icons lhc-spin">autorenew</span>'+$("<div>").text(i.msg).html()+"</div></div>"),o.scrollTop(o.prop("scrollHeight")),0==this.addingUserMessage?(this.addingUserMessage=!0,$.postJSON(this.wwwDir+this.addmsgurl+e,i,(function(t){if(n.removeAttr("readonly").attr("placeholder",a),"false"==t.error)LHCCallbacks.addmsgadmin&&LHCCallbacks.addmsgadmin(e),ee.emitEvent("chatAddMsgAdmin",[e]),""!=t.r&&$("#messagesBlock-"+e).append(t.r).scrollTop($("#messagesBlock-"+e).prop("scrollHeight")),!0===t.hold_removed?$("#hold-action-"+e).removeClass("btn-outline-info"):!0===t.hold_added&&$("#hold-action-"+e).addClass("btn-outline-info"),lhinst.syncadmincall();else{void 0!==t.token&&(confLH.csrf_token=t.token),n.attr("placeholder",a).val((n.val()+" "+i.msg).trim()),$(".pending-storage").first().remove();var o='<div style="margin:10px 10px 30px 10px;" class="alert alert-warning" role="alert">'+$("<div>").text(t.r).html()+"</div>";$("#messagesBlock-"+e).append(o).scrollTop($("#messagesBlock-"+e).prop("scrollHeight"))}if(s.addingUserMessage=!1,s.addUserMessageQueue.length>0){var r=s.addUserMessageQueue.shift();s.addmsgadmin(r.chat_id,r.msg)}return!0})).fail((function(t){n.attr("placeholder",a).val(n.val()+" "+i.msg);var o='<div style="margin:10px 10px 30px 10px;" class="alert alert-warning" role="alert">'+$("<div>").text("You have weak internet connection or the server has problems. Try to refresh the page or send the message again."+(void 0!==t.status?" Error code ["+t.status+"]":"")+(void 0!==t.responseText?t.responseText:"")).html()+"</div>";if($("#messagesBlock-"+e).append(o).scrollTop($("#messagesBlock-"+e).prop("scrollHeight")),$(".pending-storage").first().remove(),s.addingUserMessage=!1,s.addUserMessageQueue.length>0){var r=s.addUserMessageQueue.shift();s.addmsgadmin(r.chat_id,r.msg)}}))):(n.attr("placeholder",a),this.addUserMessageQueue.push({chat_id:e,msg:i.msg}))}}}},this.editPrevious=function(e){var t=$("#CSChatMessage-"+e);""==t.val()&&$.getJSON(this.wwwDir+"chat/editprevious/"+e,(function(n){"f"==n.error&&(t.val(n.msg),t.attr("data-msgid",n.id),t.addClass("edit-mode"),$("#msg-"+n.id).addClass("edit-mode"),LHCCallbacks.editPrevious&&LHCCallbacks.editPrevious(e,n))}))},this.editPreviousUser=function(){var e=$("#CSChatMessage");""==e.val()&&$.getJSON(this.wwwDir+"chat/editprevioususer/"+this.chat_id+"/"+this.hash,(function(t){"f"==t.error&&(e.val(t.msg),e.attr("data-msgid",t.id),e.addClass("edit-mode"),$("#msg-"+t.id).addClass("edit-mode"),LHCCallbacks.editPreviousUser&&LHCCallbacks.editPreviousUser(t))}))},this.afterAdminChatInit=function(e){LHCCallbacks.afterAdminChatInit&&LHCCallbacks.afterAdminChatInit(e)},this.afterUserChatInit=function(){LHCCallbacks.afterUserChatInit&&LHCCallbacks.afterUserChatInit()},this.afterChatWidgetInit=function(){LHCCallbacks.afterChatWidgetInit&&LHCCallbacks.afterChatWidgetInit()},this.getInputSelection=function(t){return void 0!==t?(s=t[0].selectionStart,e=t[0].selectionEnd,t.val().substring(s,e)):""},this.handleBBCode=function(e){var t=$(e.attr("data-selector")).val(),n=$(e.attr("data-selector"));if(void 0!==n)var i=n[0].selectionStart,a=n[0].selectionEnd,s=t.substring(i,a);else s="";var o=void 0!==e.attr("data-bbcode-end")?e.attr("data-bbcode-end"):e.attr("data-bbcode");return s.length>0?$(e.attr("data-selector")).val(t.substr(0,i)+"["+e.attr("data-bbcode")+"]"+s+"[/"+o+"]"+t.substring(a)):$(e.attr("data-selector")).val(t+"["+e.attr("data-bbcode")+"][/"+o+"]"),!1},this.addAdminChatFinished=function(e,t,n){var i=this,a=jQuery("#CSChatMessage-"+e);new LHCCannedMessageAutoSuggest({chat_id:e,uppercase_enabled:confLH.auto_uppercase});if(null!==document.getElementById("color-picker-chat-"+e)){var s=new ColorPicker({dom:document.getElementById("color-picker-chat-"+e),value:"#0F0"});s.addEventListener("change",(function(t){$("#color-apply-"+e).attr("data-bbcode","color="+s.getValue("hex"))})),$(".downdown-menu-color-"+e).on("click",(function(e){if($(this).parent().is(".show")){var t=$(e.target);return!t.hasClass("keepopen")&&!t.parents(".keepopen").length}})),$(".downdown-menu-color-"+e+" .color-item").on("click",(function(){s.setValue($(this).attr("data-color"))}))}a.bind("keydown","return",(function(t){return i.addmsgadmin(e),ee.emitEvent("afterAdminMessageSent",[e]),a[0].rows=2,!1})),a.bind("keyup","up",(function(t){i.editPrevious(e)})),a.bind("keyup",(function(t){if(""!=a.val()||!t.altKey||38!=t.which&&40!=t.which){var n=a[0];for(n.clientHeight,n.rows;n.scrollHeight>n.clientHeight&&!window.opera&&n.rows<30;)n.style.overflow="hidden",n.rows+=1;n.scrollHeight>n.clientHeight&&(n.style.overflow="auto")}else if(1==confLH.new_dashboard)ee.emitEvent("activateNextTab",[e,38==t.which]);else{if(38==t.which)var i=lhinst.smartTabFocus($("#tabs"),e,{keep:!0,up:!0});else i=lhinst.smartTabFocus($("#tabs"),e,{keep:!0,up:!1});var s=i.split("chat-id-");s[1]&&!isNaN(s[1])&&$("#chat-tab-link-"+s[1]).click()}})),$messageBlock=$("#messagesBlock-"+e),$messageBlock.css("height",this.getLocalValue("lhc_mheight",confLH.defaultm_hegiht)),$messageBlock.data("resized",!1),$messageBlock.data("y",$messageBlock.outerHeight()),$messageBlock.bind("mouseup mousemove",(function(e){var t=jQuery(this);t.outerHeight()!=t.data("y")&&(0==t.data("resized")&&(t.css("height","1px"),t.data("resized",!0)),this.resize_timeout&&clearTimeout(this.resize_timeout),this.resize_timeout=setTimeout((function(){i.setLocalValue("lhc_mheight",t.outerHeight()),t.data("y",t.outerHeight())}),100))})),this.initTypingMonitoringAdmin(e),this.afterAdminChatInit(e),this.addSynchroChat(e,t),$messageBlock.prop("scrollTop",$messageBlock.prop("scrollHeight")),this.startSyncAdmin(),null===n||"object"!=typeof n||-1===n.indexOf("background")?this.hideNotification(e):$("#chat-tab-link-"+e).click((function(){i.removeBackgroundChat(parseInt(e)),i.hideNotification(parseInt(e))}));try{localStorage&&1==localStorage.getItem("lhc_rch")&&this.processCollapse(e)}catch(e){}$("#chat-tab-items-"+e+" > li > a").click((function(){ee.emitEvent("adminChatTabSubtabClicked",[e,$(this)])})),$("#chat-write-button-"+e).click((function(){$("#CSChatMessage-"+e).show().focus(),$(this).removeClass("btn-outline-secondary").addClass("btn-outline-primary"),$("#chat-preview-button-"+e).removeClass("btn-outline-primary").addClass("btn-outline-secondary"),$("#chat-preview-container-"+e).hide()})),$("#chat-preview-button-"+e).click((function(){$("#chat-preview-container-"+e).html("...").show(),$("#CSChatMessage-"+e).hide(),$(this).removeClass("btn-outline-secondary").addClass("btn-outline-primary"),$("#chat-write-button-"+e).removeClass("btn-outline-primary").addClass("btn-outline-secondary"),jQuery.post(WWW_DIR_JAVASCRIPT+"chat/previewmessage",{msg_body:!0,msg:$("#CSChatMessage-"+e).val()},(function(t){$("#chat-preview-container-"+e).html(t)}))})),ee.emitEvent("adminChatLoaded",[e,t,n])},this.removeBackgroundChat=function(e){var t=this.backgroundChats.indexOf(parseInt(e));-1!==t&&delete this.backgroundChats[t]},this.getLocalValue=function(e,t){try{if(localStorage){var n=localStorage.getItem(e);return null!==n?n:t}}catch(e){}return t},this.executeExtension=function(e,t){if(null===document.getElementById("ext-"+e)){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),a=new Date;i.setAttribute("type","text/javascript"),i.setAttribute("src",WWW_DIR_LHC_WEBPACK_ADMIN.replace("/design/defaulttheme/js/admin/dist/","")+"/extension/"+e+"/design/"+e+"theme/js/"+e+".legacy.js?v="+a.getFullYear()+a.getMonth()+a.getDate()),i.setAttribute("id","ext-"+e),n.appendChild(i),i.onreadystatechange=i.onload=function(){ee.emitEvent(e+".init",[t])}}else ee.emitEvent(e+".init",[t])},this.setLocalValue=function(e,t){try{localStorage&&localStorage.setItem(e,t)}catch(e){}},this.hideNotification=function(e){e=parseInt(e),void 0!==this.notificationsArray[e]&&-1==this.backgroundChats.indexOf(e)&&(this.notificationsArray[e].close(),delete this.notificationsArray[e]),clearTimeout(this.soundIsPlaying)},this.showMyPermissions=function(e){$.get(this.wwwDir+"permission/getpermissionsummary/"+e,(function(e){$("#permissions-summary").html(e)}))},this.addmsguserchatbox=function(e){var t=!1,n={msg:$("#CSChatMessage").val(),nick:$("#CSChatNick").val()},i=1==this.isWidgetMode?"/(mode)/widget":"";$("#CSChatMessage").val("");var a=this;$.postJSON(this.wwwDir+this.addmsgurluserchatbox+this.chat_id+"/"+this.hash+i+this.appendSyncArgument,n,(function(e){"f"==e.error?(LHCCallbacks.addmsguserchatbox&&LHCCallbacks.addmsguserchatbox(a,{chat_id:a.chat_id,data:e}),a.syncusercall()):alert(e.or)})),t!=$("#CSChatNick").val()&&window.postMessage&&parent&&(parent.postMessage("lhc_chb:nick:"+$("#CSChatNick").val(),"*"),t=$("#CSChatNick").val())},this.updateMessageRow=function(e){var t=1==this.isWidgetMode?"/(mode)/widget":"";$.getJSON(this.wwwDir+"chat/getmessage/"+this.chat_id+"/"+this.hash+"/"+e+t,(function(t){"f"==t.error&&($("#msg-"+e).replaceWith(t.msg),$("#msg-"+e).addClass("bg-success"),setTimeout((function(){$("#msg-"+e).removeClass("bg-success")}),2e3))}))},this.updateMessageRowAdmin=function(e,t){$.getJSON(this.wwwDir+"chat/getmessageadmin/"+e+"/"+t,(function(n){if("f"==n.error){var i=$("#messagesBlock-"+e),a=i.prop("scrollTop")+i.height()+30>i.prop("scrollHeight");$("#msg-"+t).replaceWith(n.msg),lhinst.addQuateHandler(e),$("#msg-"+t).addClass("bg-success"),setTimeout((function(){$("#msg-"+t).removeClass("bg-success")}),2e3),a&&i.scrollTop(i.prop("scrollHeight"))}}))},this.addmsguser=function(e){LHCCallbacks.addmsguserbefore&&LHCCallbacks.addmsguserbefore(this);var t=$("#CSChatMessage"),n={msg:t.val()},i=1==this.isWidgetMode?"/(mode)/widget":"";t.val("");var a=this;$("#lhc-mic-icon").length>0&&($("#lhc-send-icon").hide(),$("#lhc-mic-icon").show(),$("#voice-control-message").hide());try{ee.emitEvent("messageSend",[{chat_id:this.chat_id,hash:this.hash,msg:n.msg}]),sessionStorage&&sessionStorage.setItem("lhc_ttxt","")}catch(e){}if(t.hasClass("edit-mode"))n.msgid=t.attr("data-msgid"),$.postJSON(this.wwwDir+"chat/updatemsguser/"+this.chat_id+"/"+this.hash+i,n,(function(e){if("f"==e.error)return t.removeClass("edit-mode"),t.removeAttr("data-msgid"),$("#msg-"+n.msgid).replaceWith(e.msg),!0}));else{var s=$("#messagesBlock");s.append('<div class="message-row response pending-storage"><div class="msg-body">'+$("<div>").text(n.msg).html()+"</div></div>"),s.scrollTop(s.prop("scrollHeight")),0==this.addingUserMessage&&0==this.addUserMessageQueue.length?(this.addingUserMessage=!0,$.postJSON(this.wwwDir+this.addmsgurluser+this.chat_id+"/"+this.hash+i,n,(function(e){if("f"==e.error)LHCCallbacks.addmsguser&&LHCCallbacks.addmsguser(a,e),a.syncusercall();else{$(".pending-storage").remove(),$("#CSChatMessage").val(n.msg);var t=$("#id-operator-typing");t.html(e.r),t.css("visibility","visible"),setTimeout((function(){0==a.operatorTyping&&$("#id-operator-typing").css("visibility","hidden")}),3e3)}a.addingUserMessage=!1})).fail((function(e){$("#CSChatMessage").val(t.val()+" "+n.msg);var i=$("#id-operator-typing");i.html("You have weak internet connection or the server has problems. Try to send the message again."),i.css("visibility","visible"),setTimeout((function(){0==a.operatorTyping&&$("#id-operator-typing").html("").css("visibility","hidden")}),5e3),$(".pending-storage").remove(),a.addingUserMessage=!1,a.addUserMessageQueue.length>0&&a.addDelayedMessage()}))):(this.addUserMessageQueue.push({retries:0,pdata:n,url:this.wwwDir+this.addmsgurluser+this.chat_id+"/"+this.hash+i}),clearTimeout(this.addDelayedTimeout),this.addDelayedTimeout=setTimeout((function(){a.addDelayedMessage()}),50))}},this.addMessagesToStore=function(e){for(var t=1==this.isWidgetMode?"/(mode)/widget":"",n=e.length,i=0;i<n;i++)this.addUserMessageQueue.push({retries:0,pdata:{msg:e[i]},url:this.wwwDir+this.addmsgurluser+this.chat_id+"/"+this.hash+t});this.addDelayedMessage()},this.addDelayedMessage=function(){var e=this;if(0==this.addingUserMessage){if(this.addUserMessageQueue.length>0){var t=this.addUserMessageQueue.shift();this.addingUserMessage=!0;var n=[];n.push(t.pdata.msg);for(var i=this.addUserMessageQueue.length,a=0;a<i;a++)n.push(this.addUserMessageQueue[a].pdata.msg);this.addUserMessageQueue=[],$.postJSON(t.url,{msg:n.join("[[msgitm]]")},(function(t){"f"==t.error&&(LHCCallbacks.addmsguser&&LHCCallbacks.addmsguser(e,t),e.syncusercall()),e.addingUserMessage=!1,e.addUserMessageQueue.length>0&&(clearTimeout(e.addDelayedTimeout),e.addDelayedMessage())})).fail((function(){e.addingUserMessage=!1}))}}else clearTimeout(this.addDelayedTimeout),this.addDelayedTimeout=setTimeout((function(){e.addDelayedMessage()}),50)},this.startSyncAdmin=function(){0==this.isSinchronizing&&(this.isSinchronizing=!0,this.syncadmincall())},this.disableChatSoundAdmin=function(e){return"I"!=e.prop("tagName")&&(e=e.find("> i.material-icons")),"volume_off"==e.text()?($.get(this.wwwDir+"user/setsettingajax/chat_message/1"),confLH.new_message_sound_admin_enabled=1,e.text("volume_up")):($.get(this.wwwDir+"user/setsettingajax/chat_message/0"),confLH.new_message_sound_admin_enabled=0,e.text("volume_off")),!1},this.disableNewChatSoundAdmin=function(e){return"I"!=e.prop("tagName")&&(e=e.find("> i.material-icons")),"volume_off"==e.text()?($.get(this.wwwDir+"user/setsettingajax/new_chat_sound/1"),confLH.new_chat_sound_enabled=1,e.text("volume_up")):($.get(this.wwwDir+"user/setsettingajax/new_chat_sound/0"),confLH.new_chat_sound_enabled=0,e.text("volume_off")),!1},this.changeUserSettings=function(e,t){$.get(this.wwwDir+"user/setsettingajax/"+e+"/"+t)},this.changeUserSettingsIndifferent=function(e,t){$.get(this.wwwDir+"user/setsettingajax/"+e+"/"+encodeURIComponent(t)+"/(indifferent)/true")},this.switchToOfflineForm=function(){var e=$("#form-start-chat");return e.attr("action",$("#form-start-chat").attr("action")+"/(switchform)/true/(offline)/true/(leaveamessage)/true/(department)/"+$("#id_DepartamentID").val()),e.submit(),!1},this.changeStatusAction=function(e,t){var n=this;return $.postJSON(e.attr("action"),e.serialize(),(function(e){"false"==e.error?($("#myModal").modal("hide"),n.updateVoteStatus(t),!0===e.is_owner&&($("#CSChatMessage-"+t).attr("placeholder",""),$("#CSChatMessage-"+t).focus())):alert(e.result)})),!1},this.submitModalForm=function(e){return $.post(e.attr("action"),e.serialize(),(function(e){var t=$("#myModal > .modal-dialog")[0].style.cssText;$("#myModal").html(e),$("#myModal > .modal-dialog")[0].style.cssText=t})),!1},this.disableChatSoundUser=function(e){return"volume_off"==e.find("> i").text()?($.get(this.wwwDir+"user/setsettingajax/chat_message/1"),confLH.new_message_sound_user_enabled=1,e.find("> i").text("volume_up")):($.get(this.wwwDir+"user/setsettingajax/chat_message/0"),confLH.new_message_sound_user_enabled=0,e.find("> i").text("volume_off")),window.postMessage&&parent&&("volume_off"==e.find("> i").text()?parent.postMessage("lhc_ch:s:0","*"):parent.postMessage("lhc_ch:s:1","*")),!1},this.pendingMessagesToStore=[],this.prestartChat=function(e,t){if(0==t.find(".form-protected").length){if(1!=t.attr("lhc-captcha-submitted"))t.attr("lhc-captcha-submitted",1),t.find('input[type="submit"]').attr("disabled","disabled"),$.getJSON(this.wwwDir+"captcha/captchastring/form/"+e,(function(n){t.append('<input type="hidden" value="'+e+'" name="captcha_'+n.result+'" /><input type="hidden" value="'+e+'" name="tscaptcha" /><input type="hidden" class="form-protected" value="1" />'),t.submit()})),1==(n=1==t.attr("key-up-started"))&&(jQuery("<div/>",{class:"message-row response",text:$("#id_Question").val()}).appendTo("#messagesBlock").prepend('<span class="usr-tit vis-tit">'+visitorTitle+"</span>"),$("#messagesBlock").scrollTop($("#messagesBlock").prop("scrollHeight")),this.pendingMessagesToStore.push($("#id_Question").val()),$("#id_Question").val(""));else $("#messagesBlock").length>0&&(jQuery("<div/>",{class:"message-row response",text:$("#id_Question").val()}).appendTo("#messagesBlock").prepend('<span class="usr-tit vis-tit">'+visitorTitle+"</span>"),$("#messagesBlock").scrollTop($("#messagesBlock").prop("scrollHeight"))),this.pendingMessagesToStore.push($("#id_Question").val()),$("#id_Question").val("");return!1}if(1==t.find("#hasFormExtraField").length)return!0;if(1!=t.attr("lhc-form-submitted")){t.attr("lhc-form-submitted",1);var n,i=this;1==(n=1==t.attr("key-up-started"))&&t.append('<input type="hidden" value="1" name="keyUpStarted" />'),$.post(t.attr("action"),t.serialize(),(function(e){var t=$("#id_Question").val();try{sessionStorage&&sessionStorage.setItem("lhc_ttxt",t)}catch(e){}$("head > script");var n=$("head"),a=[];$("head > script").each((function(){var e=$(this);void 0!==e.attr("src")&&a.push(e.attr("src"))})),$("<div>").html(e).find("> script").each((function(){var e=$(this);void 0===e.attr("src")?n.append(e):-1==a.indexOf(e.attr("src"))&&n.append('<script src="'+e.attr("src")+'"><\/script>')})),paramsDocument="<script>lhinst.addMessagesToStore("+JSON.stringify(i.pendingMessagesToStore)+")<\/script>",$("#widget-layout").html($("<div>").html(e).find("#widget-layout").html()),$("#widget-layout-js").html($("<div>").html(e).find("#widget-layout-js").html()+paramsDocument)})),0==n&&$("#id_Question").val("")}else $("#messagesBlock").length>0&&(jQuery("<div/>",{class:"message-row response",text:$("#id_Question").val()}).appendTo("#messagesBlock").prepend('<span class="usr-tit vis-tit">'+visitorTitle+"</span>"),$("#messagesBlock").scrollTop($("#messagesBlock").prop("scrollHeight"))),this.pendingMessagesToStore.push($("#id_Question").val()),$("#id_Question").val("");return!1},this.addCaptcha=function(e,t){return 0!=t.find(".form-protected").length||(t.find('input[type="submit"]').attr("disabled","disabled"),$.getJSON(this.wwwDir+"captcha/captchastring/form/"+e,(function(n){t.append('<input type="hidden" value="'+e+'" name="captcha_'+n.result+'" /><input type="hidden" value="'+e+'" name="tscaptcha" /><input type="hidden" class="form-protected" value="1" />'),t.submit()})),!1)},this.setSubject=function(e,t){$("#subject-message-"+t).text("..."),$.postJSON(this.wwwDir+"chat/subject/"+t+"/(subject)/"+e.val()+"/(status)/"+e.is(":checked"),{update:!0},(function(e){lhinst.updateVoteStatus(t),$("#subject-message-"+t).text(e.message)}))},this.addCaptchaSubmit=function(e,t){return 0==t.find(".form-protected").length&&(t.find('input[type="submit"]').attr("disabled","disabled"),t.find("#ChatSendButtonContainer").remove(),t.find("#id_Question").attr("readonly","readonly"),"undefined"!=typeof formSubmitted&&(formSubmitted=!0),$.getJSON(this.wwwDir+"captcha/captchastring/form/"+e,(function(n){if(t.append('<input type="hidden" value="'+e+'" name="captcha_'+n.result+'" /><input type="hidden" value="'+e+'" name="tscaptcha" /><input type="hidden" class="form-protected" value="1" />'),window.FormData)try{var i=new FormData(t[0]),a=new XMLHttpRequest;a.addEventListener("readystatechange",(function(e){var t,n;try{n=e.target.readyState,e.target.responseText,t=e.target.status}catch(e){return}4==n&&"200"==t&&e.target.responseText&&(-1==a.getResponseHeader("Content-Type").indexOf("application/json")?$("#widget-content-body").html(e.target.responseText):location.replace(jQuery.parseJSON(e.target.responseText).location))}),!1);var s=t.attr("action");""!=s?a.open("POST",s+"/(ajaxmode)/true",!0):a.open("POST",document.location+"&ajaxmode=true",!0),a.send(i)}catch(e){return!1}else t.submit()})),!1)},this.deleteChatfile=function(e){$.postJSON(this.wwwDir+"file/deletechatfile/"+e,(function(t){"false"==t.error?$("#file-id-"+e).remove():alert(t.result)}))},this.chooseFile=function(){document.getElementById("fileupload")&&document.getElementById("fileupload").click()},this.enableFileUpload=function(){$.getJSON(this.wwwDir+"file/fileoptions/"+this.chat_id+"/"+this.hash,(function(e){$("#ChatMessageContainer .dropdown-menu .flex-row").prepend(e.html),e.options.ft_us=new RegExp("(.|/)("+e.options.ft_us+")$","i"),lhinst.addFileUserUpload(e.options)}))},this.addFileUserUpload=function(e){$("#fileupload").fileupload({url:this.wwwDir+"file/uploadfile/"+e.chat_id+"/"+e.hash,dataType:"json",add:function(t,n){var i=[],a=e.ft_us;a.test(n.originalFiles[0].type)||a.test(n.originalFiles[0].name)||i.push(e.ft_msg),n.originalFiles[0].size>e.fs&&i.push(e.fs_msg),i.length>0?alert(i.join("\n")):n.submit()},done:function(t,n){var i=n.response();null!=i&&null!=i.result&&"true"==i.result.error&&null!=i.result.error_msg&&alert(i.result.error_msg),LHCCallbacks.addFileUserUpload&&LHCCallbacks.addFileUserUpload(e.chat_id)},progressall:function(e,t){var n=parseInt(t.loaded/t.total*100,10);$("#id-operator-typing").css("visibility","visible"),$("#id-operator-typing").html(n+"%")}}).prop("disabled",!$.support.fileInput).parent().addClass($.support.fileInput?void 0:"disabled")},this.addFileUserUploadOnline=function(e,t){var n=this;$("#fileuploadonline").fileupload({url:this.wwwDir+"file/uploadfileonline/"+e.online_user_vid,dataType:"json",add:function(t,n){var i=[],a=e.ft_us;a.test(n.originalFiles[0].type)||a.test(n.originalFiles[0].name)||i.push(e.ft_msg),n.originalFiles[0].size>e.fs&&i.push(e.fs_msg),i.length>0?alert(i.join("\n")):n.submit()},done:function(i,a){n.updateOnlineFilesUser(e.online_user_vid),t&&t(e.online_user_vid)},progressall:function(e,t){var n=parseInt(t.loaded/t.total*100,10);$("#upload-status-user-online").html(n+"%")}}).prop("disabled",!$.support.fileInput).parent().addClass($.support.fileInput?void 0:"disabled")},this.updateChatFiles=function(e){$.postJSON(this.wwwDir+"file/chatfileslist/"+e,(function(t){$("#chat-files-list-"+e).html(t.result)}))},this.updateOnlineFiles=function(e){$.postJSON(this.wwwDir+"file/onlinefileslist/"+e,(function(t){$("#online-user-files-list-"+e).html(t.result)}))},this.updateOnlineFilesUser=function(e){$.postJSON(this.wwwDir+"file/useronlinefileslist/"+e,(function(e){$("#user-online-files-list").html(e.result)}))},this.addFileUpload=function(e){$("#fileupload-"+e.chat_id).fileupload({url:this.wwwDir+"file/uploadfileadmin/"+e.chat_id,dataType:"json",add:function(t,n){var i=[],a=e.ft_op;a.test(n.originalFiles[0].type)||a.test(n.originalFiles[0].name)||i.push(e.ft_msg),n.originalFiles[0].size>e.fs&&i.push(e.fs_msg),i.length>0?alert(i.join("\n")):n.submit()},done:function(t,n){var i=n.response();if(null!=i&&null!=i.result&&"true"==i.result.error&&null!=i.result.error_msg)alert(i.result.error_msg);else{lhinst.updateChatFiles(e.chat_id);var a=$("#CSChatMessage-"+e.chat_id),s=jQuery.trim(a.val());a.val(s+(""!=s?"\n":"")+i.result.msg+"\n")}LHCCallbacks.addFileUpload&&LHCCallbacks.addFileUpload(e.chat_id)},dropZone:$("#CSChatMessage-"+e.chat_id),pasteZone:$("#CSChatMessage-"+e.chat_id),progressall:function(t,n){var i=parseInt(n.loaded/n.total*100,10);$("#user-is-typing-"+e.chat_id).css("visibility","visible"),$("#user-is-typing-"+e.chat_id).html(i+"%")}}).prop("disabled",!$.support.fileInput).parent().addClass($.support.fileInput?void 0:"disabled")},this.addFileUploadOnlineUser=function(e,t){var n=this;$("#fileupload-online-user-"+e.online_user_id).fileupload({url:this.wwwDir+"file/uploadfileadminonlineuser/"+e.online_user_id,dataType:"json",add:function(t,n){var i=[],a=e.ft_op;a.test(n.originalFiles[0].type)||a.test(n.originalFiles[0].name)||i.push(e.ft_msg),n.originalFiles[0].size>e.fs&&i.push(e.fs_msg),i.length>0?alert(i.join("\n")):n.submit()},done:function(i,a){t&&t(e.online_user_id),n.updateOnlineFiles(e.online_user_id)},dropZone:$("#drop-zone-online-user-"+e.online_user_id),progressall:function(t,n){var i=parseInt(n.loaded/n.total*100,10);$("#upload-status-admin-"+e.online_user_id).html(i+"%")}}).prop("disabled",!$.support.fileInput).parent().addClass($.support.fileInput?void 0:"disabled")},this.addExecutionCommand=function(e,t){if($.postJSON(this.wwwDir+"chat/addonlineoperation/"+e,{operation:t},(function(t){LHCCallbacks.addExecutionCommand&&LHCCallbacks.addExecutionCommand(e)})),"lhc_screenshot"==t){$("#user-screenshot-container").html("").addClass("screenshot-pending");var n=this;setTimeout((function(){n.updateScreenshotOnline(e)}),15e3)}},this.addRemoteCommand=function(e,t){if($.postJSON(this.wwwDir+"chat/addoperation/"+e,{operation:t},(function(t){LHCCallbacks.addRemoteCommand&&LHCCallbacks.addRemoteCommand(e),"true"==t.error&&null!=t.errors&&alert(t.errors.join("\n"))})),"lhc_screenshot"==t){$("#user-screenshot-container").html("").addClass("screenshot-pending");var n=this;setTimeout((function(){n.updateScreenshot(e)}),5e3)}},this.addRemoteOnlineCommand=function(e,t){$.postJSON(this.wwwDir+"chat/addonlineoperationiframe/"+e,{operation:t},(function(t){LHCCallbacks.addRemoteOnlineCommand&&LHCCallbacks.addRemoteOnlineCommand(e)}))},this.updateScreenshot=function(e){$("#user-screenshot-container").html("").addClass("screenshot-pending"),$.get(this.wwwDir+"chat/checkscreenshot/"+e,(function(t){$("#user-screenshot-container-"+e).html(t),$("#user-screenshot-container-"+e).removeClass("screenshot-pending")}))},this.updateScreenshotOnline=function(e){$("#user-screenshot-container").html("").addClass("screenshot-pending"),$.get(this.wwwDir+"chat/checkscreenshotonline/"+e,(function(t){$("#user-screenshot-container-"+e).html(t),$("#user-screenshot-container-"+e).removeClass("screenshot-pending")}))},this.eNick=function(){lhc.revealModal({url:WWW_DIR_JAVASCRIPT+"chat/editnick/"+this.chat_id+"/"+this.hash})},this.enableVisitorEditor=function(){$("#ChatMessageContainer").removeClass("hide"),$("#CSChatMessage").focus()},this.disableVisitorEditor=function(){$("#ChatMessageContainer").addClass("hide")},this.buttonClicked=function(e,t,n,i){null==n.attr("data-no-change")&&(n.attr("disabled","disabled"),n.prepend('<i class="material-icons lhc-spin">loop</i>'));var a=$("#messagesBlock"),s=a.prop("scrollHeight");a.scrollTop(s),this.syncroRequestSend=!0,clearTimeout(this.userTimeout),$.get(this.wwwDir+"genericbot/buttonclicked/"+this.chat_id+"/"+this.hash,{payload:e,id:t,processed:void 0===i||0==i},(function(e){void 0!==i&&!1!==i||$(".meta-message-"+t).remove();var n=a.prop("scrollHeight");a.scrollTop(n),lhinst.forceBottomScroll=!0,lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})).fail((function(){lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})),lhinst.focusUserText()},this.editGenericStep=function(e,t){var n=$("#messagesBlock"),i=n.prop("scrollHeight");n.scrollTop(i),this.syncroRequestSend=!0,clearTimeout(this.userTimeout),$.get(this.wwwDir+"genericbot/buttonclicked/"+this.chat_id+"/"+this.hash+"/(type)/editgenericstep",{payload:e,id:t},(function(e){var t=n.prop("scrollHeight");n.scrollTop(t),lhinst.forceBottomScroll=!0,lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})).fail((function(){lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})),lhinst.focusUserText()},this.updateTriggerClicked=function(e,t,n,i){null==n.attr("data-no-change")&&(n.attr("disabled","disabled"),n.prepend('<i class="material-icons lhc-spin">loop</i>'));var a=$("#messagesBlock"),s=a.prop("scrollHeight");a.scrollTop(s),this.syncroRequestSend=!0,clearTimeout(this.userTimeout),$.get(this.wwwDir+"genericbot/buttonclicked/"+this.chat_id+"/"+this.hash+"/(type)/triggerclicked",{payload:e,id:t,processed:void 0===i||0==i},(function(e){void 0!==i&&!1!==i||$(".meta-message-"+t).remove();var n=a.prop("scrollHeight");a.scrollTop(n),lhinst.forceBottomScroll=!0,lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})).fail((function(){lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})),lhinst.focusUserText()},this.updateChatClicked=function(e,t,n,i){null==n.attr("data-no-change")&&(n.attr("disabled","disabled"),n.prepend('<i class="material-icons lhc-spin">loop</i>'));var a=$("#messagesBlock"),s=a.prop("scrollHeight");a.scrollTop(s),lhinst.syncroRequestSend=!0,clearTimeout(this.userTimeout),$.get(this.wwwDir+"genericbot/updatebuttonclicked/"+this.chat_id+"/"+this.hash,{payload:e,id:t,processed:void 0===i||0==i},(function(e){void 0!==i&&!1!==i||$(".meta-message-"+t).remove();var n=a.prop("scrollHeight");a.scrollTop(n),lhinst.forceBottomScroll=!0,lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})).fail((function(){lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})),lhinst.focusUserText()},this.dropdownClicked=function(e,t){null==t.attr("data-no-change")&&(t.attr("disabled","disabled"),t.prepend('<i class="material-icons lhc-spin">loop</i>'));var n=$("#messagesBlock"),i=n.prop("scrollHeight");n.scrollTop(i),""!=$("#generic_list-"+e).val()?(this.syncroRequestSend=!0,clearTimeout(this.userTimeout),$.get(this.wwwDir+"genericbot/buttonclicked/"+this.chat_id+"/"+this.hash+"/(type)/valueclicked",{payload:$("#id_generic_list-"+e).val(),id:e},(function(t){$(".meta-message-"+e).remove();var i=n.prop("scrollHeight");n.scrollTop(i),lhinst.forceBottomScroll=!0,lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})).fail((function(){lhinst.syncroRequestSend=!1,lhinst.enableVisitorEditor(),lhinst.syncusercall()})),lhinst.focusUserText()):alert("Please choose!")},this.focusUserText=function(){$("#CSChatMessage").focus()},this.delayQueue=[],this.delayed=!1,this.intervalPending=null,this.setDelay=function(e){var t=e.id,n=e.duration,i=e.delay,a=e.untill_message;i>0&&$("#msg-"+t).addClass("hide"),1==a&&$("#msg-"+t).nextUntil("message-admin").length>0||setTimeout((function(){if(0==lhinst.delayed){if(1==a)clearInterval(lhinst.intervalPending),lhinst.intervalPending=setInterval((function(){if($("#msg-"+t).nextUntil("message-admin").length>0)lhinst.unhideDelayed(t),$("#messagesBlock > #msg-"+t).remove(),clearInterval(lhinst.intervalPending);else if(!$("#msg-"+t).hasClass("meta-hider")){$("#msg-"+t).addClass("meta-hider message-row-typing"),$("#msg-"+t).removeClass("hide"),$("#msg-"+t+" .msg-body").removeClass("hide");var e=$("#messagesBlock"),n=e.prop("scrollHeight");e.find(".meta-auto-hide").hide(),e.find(".message-row").last().find(".meta-auto-hide").show(),n=e.prop("scrollHeight"),e.find(".pending-storage").remove(),e.scrollTop(n+2e3)}}),500);else if(lhinst.delayed=!0,$("#msg-"+t).addClass("meta-hider message-row-typing").nextUntil("meta-hider").addClass("hide"),setTimeout((function(){lhinst.unhideDelayed(t)}),1e3*n),$("#msg-"+t).removeClass("hide"),$("#msg-"+t+" .msg-body").removeClass("hide"),i>0){var e=$("#messagesBlock"),s=e.prop("scrollHeight");e.find(".meta-auto-hide").hide(),e.find(".message-row").last().find(".meta-auto-hide").show(),s=e.prop("scrollHeight"),e.find(".pending-storage").remove(),e.scrollTop(s+2e3)}}else lhinst.delayQueue.push({id:t,delay:n})}),1e3*i)},this.sendHTML=function(e,t){"undefined"!=typeof parent&&window.location!==window.parent.location&&parent.postMessage("lhc_html_snippet:"+e+":"+t.type+"_"+t.id,"*")},this.unhideDelayed=function(e){var t=$("#messagesBlock > #msg-"+e);t.nextUntil(".meta-hider").removeClass("hide"),t.remove();var n=$("#messagesBlock"),i=n.prop("scrollHeight");if(n.find(".meta-auto-hide").hide(),n.find(".message-row").last().find(".meta-auto-hide").show(),i=n.prop("scrollHeight"),n.find(".pending-storage").remove(),n.scrollTop(i+2e3),this.delayQueue.length>0){var a=lhinst.delayQueue.pop();setTimeout((function(){lhinst.unhideDelayed(a.id)}),1e3*a.delay),$("#msg-"+a.id).removeClass("hide"),$("#msg-"+a.id+" .msg-body").removeClass("hide")}else lhinst.delayed=!1},this.gmaps_loading=!1,this.queue_render=[],this.showMessageLocation=function(e,t,n){var i={lat:t,lng:n};if(1==this.gmaps_loaded){var a=new google.maps.Map(document.getElementById("msg-location-"+e),{zoom:13,center:i});new google.maps.Marker({position:i,map:a,title:t+","+n})}else if(0==this.gmaps_loading){this.gmaps_loading=!0;var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src="https://maps.googleapis.com/maps/api/js?key="+confLH.gmaps_api_key+"&callback=chatMapLoaded";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(s,o),lhinst.queue_render.push({id:e,lat:t,lon:n})}else lhinst.queue_render.push({id:e,lat:t,lon:n})}}function chatMapLoaded(){if(lhinst.queue_render.length>0){lhinst.gmaps_loaded=!0;var e=lhinst.queue_render.pop(),t={lat:e.lat,lng:e.lon},n=new google.maps.Map(document.getElementById("msg-location-"+e.id),{zoom:13,center:t});new google.maps.Marker({position:t,map:n,title:e.lat+","+e.lon});lhinst.queue_render.length>0&&chatMapLoaded()}}var lhinst=new lh;function preloadSound(){lhinst.playPreloadSound(),jQuery(document).off("click",preloadSound),jQuery(document).off("touchstart",preloadSound)}function gMapsCallback(){lhinst.gmaps_loaded=!0;var e=$("#map_canvas"),t=new google.maps.Map(e[0],{zoom:GeoLocationData.zoom,center:new google.maps.LatLng(GeoLocationData.lat,GeoLocationData.lng),mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:!0,options:{zoomControl:!0,scrollwheel:!0,streetViewControl:!0}}),n=!1,i=!1,a=!1,s=!1;google.maps.event.addListener(t,"idle",r);var o=$("#map-activator");function r(){0==i?o.hasClass("active")?(i=!0,$.ajax({url:WWW_DIR_JAVASCRIPT+"chat/jsononlineusers"+(parseInt($("#id_department_map_id").val())>0?"/(department)/"+parseInt($("#id_department_map_id").val()):"")+(parseInt($("#maxRows").val())>0?"/(maxrows)/"+parseInt($("#maxRows").val()):"")+(parseInt($("#userTimeout").val())>0?"/(timeout)/"+parseInt($("#userTimeout").val()):""),dataType:"json",error:function(){clearTimeout(s),s=setTimeout((function(){r()}),1e4)},success:function(e){$(e.result).each((function(e,n){if(-1==$.inArray(n.Id,l)){var i=new google.maps.LatLng(n.Latitude,n.Longitude),a=new google.maps.Marker({position:i,icon:n.icon,map:t});google.maps.event.addListener(a,"click",(function(){lhc.revealModal({url:WWW_DIR_JAVASCRIPT+"chat/getonlineuserinfo/"+n.Id})})),a.setVisible(!0),a.setAnimation(google.maps.Animation.DROP),c[n.Id]=a,l.push(n.Id),clearTimeout(c[n.Id].timeOutMarker),c[n.Id].timeOutMarker=setTimeout((function(){l.splice($.inArray(n.Id,l),1),google.maps.event.clearInstanceListeners(c[n.Id]),c[n.Id].setMap(null),c[n.Id]=null}),1e3*parseInt($("#markerTimeout option:selected").val()))}else c[n.Id].setIcon(n.icon),clearTimeout(c[n.Id].timeOutMarker),c[n.Id].timeOutMarker=setTimeout((function(){l.splice($.inArray(n.Id,l),1),google.maps.event.clearInstanceListeners(c[n.Id]),c[n.Id].setMap(null),c[n.Id]=null}),1e3*parseInt($("#markerTimeout option:selected").val()))})),i=!1,clearTimeout(s),1==a?(a=!1,r()):s=setTimeout((function(){r()}),1e4)}})):s=setTimeout((function(){r()}),1e4):a=!0}var l=[],c=[];new google.maps.InfoWindow({content:"Loading..."});$("#id_department_map_id").change((function(){r(),lhinst.changeUserSettingsIndifferent("omap_depid",$(this).val())})),$("#markerTimeout").change((function(){r(),lhinst.changeUserSettingsIndifferent("omap_mtimeout",$(this).val())})),$("#map-activator").click((function(){setTimeout((function(){google.maps.event.trigger(t,"resize"),0==n&&(n=!0,t.setCenter(new google.maps.LatLng(GeoLocationData.lat,GeoLocationData.lng)))}),500),r()}))}lhinst.playPreloadSound(),jQuery(document).on("click",preloadSound),jQuery(document).on("click",(function(){lhinst.hidePopover()})),jQuery(document).on("touchstart",preloadSound),$.fn.makeDropdown=function(){var e=this.find(".btn-block-department-filter > input");this.click((function(){setTimeout((function(){e.focus()}),50)})),this.on("click","[data-stopPropagation]",(function(e){e.stopPropagation()}));this.attr("data-limit")&&parseInt(this.attr("data-limit"));this.each((function(){var e=$(this).find(".selected-items-filter");$(this).find(".btn-department-dropdown").attr("data-text",$(this).find(".btn-department-dropdown").text());var t=e.find(".delete-item").length;if(t>0){var n=1==t?e.find(".delete-item").first().parent().text().trim().replace("delete",""):"";$(this).find(".btn-department-dropdown").text((1==t?n:"["+t+"] ")+(1!=t?$(this).find(".btn-department-dropdown").attr("data-text"):""))}var i=$(this);i.on("change","li input:checkbox",(function(){var t,n;$(this).is(":checked")?0==e.find('.delete-item[data-value="'+$(this).val()+'"]').length&&e.prepend('<div class="fs12"><a data-stoppropagation="true" class="delete-item" data-value="'+$(this).val()+'"><input type="hidden" value="'+$(this).val()+'" name="'+i.find(".btn-block-department-filter > input").attr("data-scope")+'[]" /><i class="material-icons chat-unread">delete</i>'+$(this).parent().text().trim()+"</a></div>"):e.find('.delete-item[data-value="'+$(this).val()+'"]').remove(),n=1==(t=e.find(".delete-item").length)?e.find(".delete-item").first().parent().text().trim().replace("delete",""):"",t>0?i.find(".btn-department-dropdown").text((1==t?n:"["+t+"] ")+(1!=t?i.find(".btn-department-dropdown").attr("data-text"):"")):i.find(".btn-department-dropdown").text(i.find(".btn-department-dropdown").attr("data-text"))})),$(this).on("click",".delete-item",(function(){i.find("input[value="+$(this).attr("data-value")+"]").prop("checked",!1),$(this).parent().remove();var e=i.find("li input:checked").length;e>0?i.find(".btn-department-dropdown").text("["+e+"] "+i.find(".btn-department-dropdown").attr("data-text")):i.find(".btn-department-dropdown").text(i.find(".btn-department-dropdown").attr("data-text"))}))}));e.keyup((function(){if($(this).attr("ajax-provider")){var e=$(this).parent().parent(),t=$(this).parent();$.getJSON(WWW_DIR_JAVASCRIPT+"chat/searchprovider/"+$(this).attr("ajax-provider")+"/?q="+encodeURIComponent($(this).val()),(function(n){var i="";n.items.forEach((function(e){var a=1==t.find('.delete-item[data-value="'+e.id+'"]').length;i+='<li class="search-option-item" data-stoppropagation="true"><label><input type="checkbox" '+(a?' checked="checked" ':"")+' name="selector-'+n.props.list_id+'[]" value="'+e.id+'"> '+e.name+"</label></li>"})),e.find(".search-option-item").remove(),e.append(i)}))}else{var n=$(this).val();$(this).parent().parent().children("li").each((function(e){e>0&&($(this).text().toLowerCase().includes(n)||""==n?$(this).show():$(this).hide())}))}}))};var focused=!0;function chatsyncuser(){lhinst.syncusercall()}function chatsyncuserpending(){lhinst.chatsyncuserpending()}function chatsyncadmin(){lhinst.syncadmincall()}window.onfocus=window.onblur=function(e){focused="focus"===(e||event).type,lhinst.focusChanged(focused)},window.lhcSelector=null}catch(e){if(!lhcError)throw Error("lhc : "+e.message);lhcError.log(e.message,"lh.js",e.lineNumber||e.line,e.stack)}!function(e){function t(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var n=t.handler,i=t.data.keys.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!(e.hotkeys.options.filterInputAcceptingElements&&e.hotkeys.textInputTypes.test(t.target.nodeName)||e.hotkeys.options.filterContentEditable&&e(t.target).attr("contenteditable")||e.hotkeys.options.filterTextInputs&&e.inArray(t.target.type,e.hotkeys.textAcceptingInputTypes)>-1)){var a="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),o="",r={};e.each(["alt","ctrl","shift"],(function(e,n){t[n+"Key"]&&a!==n&&(o+=n+"+")})),t.metaKey&&!t.ctrlKey&&"meta"!==a&&(o+="meta+"),t.metaKey&&"meta"!==a&&o.indexOf("alt+ctrl+shift+")>-1&&(o=o.replace("alt+ctrl+shift+","hyper+")),a?r[o+a]=!0:(r[o+s]=!0,r[o+e.hotkeys.shiftNums[s]]=!0,"shift+"===o&&(r[e.hotkeys.shiftNums[s]]=!0));for(var l=0,c=i.length;c>l;l++)if(r[i[l]])return n.apply(this,arguments)}}}}e.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},e.each(["keydown","keyup","keypress"],(function(){e.event.special[this]={add:t}}))}(jQuery||this.jQuery||window.jQuery);
  //# sourceMappingURL=54bcce5942dd8e6e1e1e0c29802cfbef.js.map
  