/*
 jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}
function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=
ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;
t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}
function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<
o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,
t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=
Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),
Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),
s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,
f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=
e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}
function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=
u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);
if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,
t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)===
"inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,
"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,
s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&
e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==
t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,
t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},
v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===
v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},
isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e);},parseHTML:function(e,
t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||
typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===
t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r)if(u)for(i in e){if(n.apply(e[i],r)===!1)break}else for(;s<o;){if(n.apply(e[s++],r)===!1)break}else if(u)for(i in e){if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==
null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},
map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,
n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",
A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?
M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&
v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};
return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?
e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),
o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),
cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,
s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=
a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",
a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",
t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML=
"",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,
object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,
n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],
!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));
v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,
e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,
t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},
clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});
if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=
this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":
"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in
n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;
return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),
n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),
s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,
"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),
o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,
n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable=
{get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;
return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,
K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===
e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?
e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:
p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,
"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=
n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=
l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==
0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==
!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=
c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==
null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||
o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},
blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,
n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=
tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]=
{delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",
function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName===
"checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=
e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,
r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,
r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,
t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||
0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&
(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1])if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else{if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&
u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,
r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||
(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=
!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,
h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,
e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",
x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<
i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");
if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],
e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+
O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+
O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";
var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+
0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i)if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else{if(i===3||i===4)return e.nodeValue}else for(;t=
e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),
(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);
return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},
relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;
if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),
function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>
-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case "only":case "first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case "last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,
t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,
null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},
empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();
return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=
2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,
a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e);
},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||
i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!==
"object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&
!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,
contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},
not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);
break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=
v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,
"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),
v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],
thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===
t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,
t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,
!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);
return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=
t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);
n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,
n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],
"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)===
"<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===
1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],
i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],
c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=
0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},
cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||
/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&
(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz",
"ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},
cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");
if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);
for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),
Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):
0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||
(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},
v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},
serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=
encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=
/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,
t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,
t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,
"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,
l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||
{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,
x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),
kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&
x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=
1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&
!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&
(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||
i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,
1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),
!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?
u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,
e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=
this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.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):Yn.propHooks._default.set(this),
this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&
e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};
return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),
v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;
if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,
v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===
l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),
{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;
var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;
return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&
(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);(function(){var d;window.AmCharts?d=window.AmCharts:(d={},window.AmCharts=d,d.themes={},d.maps={},d.inheriting={},d.charts=[],d.onReadyArray=[],d.useUTC=!1,d.updateRate=60,d.uid=0,d.lang={},d.translations={},d.mapTranslations={},d.windows={},d.initHandlers=[]);d.Class=function(a){var b=function(){arguments[0]!==d.inheriting&&(this.events={},this.construct.apply(this,arguments))};a.inherits?(b.prototype=new a.inherits(d.inheriting),b.base=a.inherits.prototype,delete a.inherits):(b.prototype.createEvents=
function(){for(var a=0,b=arguments.length;a<b;a++)this.events[arguments[a]]=[]},b.prototype.listenTo=function(a,b,c){this.removeListener(a,b,c);a.events[b].push({handler:c,scope:this})},b.prototype.addListener=function(a,b,c){this.removeListener(this,a,b);a&&this.events[a]&&this.events[a].push({handler:b,scope:c})},b.prototype.removeListener=function(a,b,c){if(a&&a.events&&(a=a.events[b]))for(b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a){for(var b=this.events[a.type],
c=0,d=b.length;c<d;c++){var k=b[c];k.handler.call(k.scope,a)}});for(var c in a)b.prototype[c]=a[c];return b};d.addChart=function(a){window.requestAnimationFrame?d.animationRequested||(d.animationRequested=!0,window.requestAnimationFrame(d.update)):d.updateInt||(d.updateInt=setInterval(function(){d.update()},Math.round(1E3/d.updateRate)));d.charts.push(a)};d.removeChart=function(a){for(var b=d.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);0===b.length&&d.updateInt&&(clearInterval(d.updateInt),
d.updateInt=NaN)};d.isModern=!0;d.getIEVersion=function(){var a=0,b,c;"Microsoft Internet Explorer"==navigator.appName&&(b=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/,null!==c.exec(b)&&(a=parseFloat(RegExp.$1)));return a};d.applyLang=function(a,b){var c=d.translations;b.dayNames=d.extend({},d.dayNames);b.shortDayNames=d.extend({},d.shortDayNames);b.monthNames=d.extend({},d.monthNames);b.shortMonthNames=d.extend({},d.shortMonthNames);b.amString="am";b.pmString="pm";c&&(c=c[a])&&(d.lang=c,c.monthNames&&
(b.dayNames=d.extend({},c.dayNames),b.shortDayNames=d.extend({},c.shortDayNames),b.monthNames=d.extend({},c.monthNames),b.shortMonthNames=d.extend({},c.shortMonthNames)),c.am&&(b.amString=c.am),c.pm&&(b.pmString=c.pm))};d.IEversion=d.getIEVersion();9>d.IEversion&&0<d.IEversion&&(d.isModern=!1,d.isIE=!0);d.dx=0;d.dy=0;if(document.addEventListener||window.opera)d.isNN=!0,d.isIE=!1,d.dx=.5,d.dy=.5;document.attachEvent&&(d.isNN=!1,d.isIE=!0,d.isModern||(d.dx=0,d.dy=0));window.chrome&&(d.chrome=!0);d.handleMouseUp=
function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleReleaseOutside&&e.handleReleaseOutside(a)}};d.handleMouseMove=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];e&&e.handleMouseMove&&e.handleMouseMove(a)}};d.handleWheel=function(a){for(var b=d.charts,c=0;c<b.length;c++){var e=b[c];if(e&&e.mouseIsOver){e.mouseWheelScrollEnabled||e.mouseWheelZoomEnabled?e.handleWheel&&e.handleWheel(a):a.stopPropagation&&a.stopPropagation();break}}};d.resetMouseOver=function(){for(var a=
d.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};d.ready=function(a){d.onReadyArray.push(a)};d.handleLoad=function(){d.isReady=!0;for(var a=d.onReadyArray,b=0;b<a.length;b++){var c=a[b];isNaN(d.processDelay)?c():setTimeout(c,d.processDelay*b)}};d.addInitHandler=function(a,b){d.initHandlers.push({method:a,types:b})};d.callInitHandler=function(a){var b=d.initHandlers;if(d.initHandlers)for(var c=0;c<b.length;c++){var e=b[c];e.types?d.isInArray(e.types,a.type)&&e.method(a):e.method(a)}};
d.getUniqueId=function(){d.uid++;return"AmChartsEl-"+d.uid};d.isNN&&(document.addEventListener("mousemove",d.handleMouseMove),document.addEventListener("mouseup",d.handleMouseUp,!0),window.addEventListener("load",d.handleLoad,!0),window.addEventListener("DOMMouseScroll",d.handleWheel,!0),document.addEventListener("mousewheel",d.handleWheel,!0));d.isIE&&(document.attachEvent("onmousemove",d.handleMouseMove),document.attachEvent("onmouseup",d.handleMouseUp),window.attachEvent("onload",d.handleLoad),
document.attachEvent("onmousewheel",d.handleWheel));d.clear=function(){var a=d.charts;if(a)for(var b=a.length-1;0<=b;b--)a[b].clear();d.updateInt&&clearInterval(d.updateInt);d.charts=[];d.isNN&&(document.removeEventListener("mousemove",d.handleMouseMove,!0),document.removeEventListener("mouseup",d.handleMouseUp,!0),window.removeEventListener("load",d.handleLoad,!0),window.removeEventListener("DOMMouseScroll",d.handleWheel,!0),document.removeEventListener("mousewheel",d.handleWheel,!0));d.isIE&&(document.detachEvent("onmousemove",
d.handleMouseMove),document.detachEvent("onmouseup",d.handleMouseUp),window.detachEvent("onload",d.handleLoad))};d.makeChart=function(a,b,c){var e=b.type,h=b.theme;d.isString(h)&&(h=d.themes[h],b.theme=h);var f;switch(e){case "serial":f=new d.AmSerialChart(h);break;case "xy":f=new d.AmXYChart(h);break;case "pie":f=new d.AmPieChart(h);break;case "radar":f=new d.AmRadarChart(h);break;case "gauge":f=new d.AmAngularGauge(h);break;case "funnel":f=new d.AmFunnelChart(h);break;case "map":f=new d.AmMap(h);
break;case "stock":f=new d.AmStockChart(h);break;case "gantt":f=new d.AmGanttChart(h)}d.extend(f,b);d.isReady?isNaN(c)?f.write(a):setTimeout(function(){d.realWrite(f,a)},c):d.ready(function(){isNaN(c)?f.write(a):setTimeout(function(){d.realWrite(f,a)},c)});return f};d.realWrite=function(a,b){a.write(b)};d.updateCount=0;d.validateAt=Math.round(d.updateRate/10);d.update=function(){var a=d.charts;d.updateCount++;var b=!1;d.updateCount==d.validateAt&&(b=!0,d.updateCount=0);if(a)for(var c=a.length-1;0<=
c;c--)a[c].update&&a[c].update(),b&&(a[c].autoResize?a[c].validateSize&&a[c].validateSize():a[c].premeasure&&a[c].premeasure());window.requestAnimationFrame&&window.requestAnimationFrame(d.update)};d.bezierX=3;d.bezierY=6;"complete"==document.readyState&&d.handleLoad()})();
(function(){var d=window.AmCharts;d.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}};d.removeFromArray=function(a,b){var c;if(void 0!==b&&void 0!==a)for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};d.getPath=function(){var a=document.getElementsByTagName("script");if(a)for(var b=0;b<a.length;b++){var c=a[b].src;if(-1!==c.search(/\/(amcharts|ammap)\.js/))return c.replace(/\/(amcharts|ammap)\.js.*/,
"/")}};d.normalizeUrl=function(a){return""!==a&&-1===a.search(/\/$/)?a+"/":a};d.isAbsolute=function(a){return 0===a.search(/^http[s]?:|^\//)};d.isInArray=function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1};d.getDecimals=function(a){var b=0;isNaN(a)||(a=String(a),-1!=a.indexOf("e-")?b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b};d.wordwrap=function(a,b,c,e){var h,f,g,k;a+="";if(1>b)return a;h=-1;for(a=(k=a.split(/\r\n|\n|\r/)).length;++h<a;k[h]+=
g){g=k[h];for(k[h]="";g.length>b;k[h]+=d.trim(g.slice(0,f))+((g=g.slice(f)).length?c:""))f=2==e||(f=g.slice(0,b+1).match(/\S*(\s)?$/))[1]?b:f.input.length-f[0].length||1==e&&b||f.input.length+(f=g.slice(b).match(/^\S*/))[0].length;g=d.trim(g)}return k.join(c)};d.trim=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};d.wrappedText=function(a,b,c,e,h,f,g,k){var l=d.text(a,b,c,e,h,f,g);if(l){var m=l.getBBox();if(m.width>k){var n="\n";d.isModern||(n="<br>");k=Math.floor(k/(m.width/
b.length));2<k&&(k-=2);b=d.wordwrap(b,k,n,!0);l.remove();l=d.text(a,b,c,e,h,f,g)}}return l};d.getStyle=function(a,b){var c="";document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};d.removePx=function(a){if(void 0!==a)return Number(a.substring(0,a.length-2))};d.getURL=function(a,b){if(a)if("_self"!=b&&b)if("_top"==b&&window.top)window.top.location.href=
a;else if("_parent"==b&&window.parent)window.parent.location.href=a;else if("_blank"==b)window.open(a);else{var c=document.getElementsByName(b)[0];c?c.src=a:(c=d.windows[b])?c.opener&&!c.opener.closed?c.location.href=a:d.windows[b]=window.open(a):d.windows[b]=window.open(a)}else window.location.href=a};d.ifArray=function(a){return a&&"object"==typeof a&&0<a.length?!0:!1};d.callMethod=function(a,b){var c;for(c=0;c<b.length;c++){var e=b[c];if(e){if(e[a])e[a]();var d=e.length;if(0<d){var f;for(f=0;f<
d;f++){var g=e[f];if(g&&g[a])g[a]()}}}}};d.toNumber=function(a){return"number"==typeof a?a:Number(String(a).replace(/[^0-9\-.]+/g,""))};d.toColor=function(a){if(""!==a&&void 0!==a)if(-1!=a.indexOf(",")){a=a.split(",");var b;for(b=0;b<a.length;b++){var c=a[b].substring(a[b].length-6,a[b].length);a[b]="#"+c}}else a=a.substring(a.length-6,a.length),a="#"+a;return a};d.toCoordinate=function(a,b,c){var e;void 0!==a&&(a=String(a),c&&c<b&&(b=c),e=Number(a),-1!=a.indexOf("!")&&(e=b-Number(a.substr(1))),-1!=
a.indexOf("%")&&(e=b*Number(a.substr(0,a.length-1))/100));return e};d.fitToBounds=function(a,b,c){a<b&&(a=b);a>c&&(a=c);return a};d.isDefined=function(a){return void 0===a?!1:!0};d.stripNumbers=function(a){return a.replace(/[0-9]+/g,"")};d.roundTo=function(a,b){if(0>b)return a;var c=Math.pow(10,b);return Math.round(a*c)/c};d.toFixed=function(a,b){var c=String(Math.round(a*Math.pow(10,b)));if(0<b){var e=c.length;if(e<b){var d;for(d=0;d<b-e;d++)c="0"+c}e=c.substring(0,c.length-b);""===e&&(e=0);return e+
"."+c.substring(c.length-b,c.length)}return String(c)};d.formatDuration=function(a,b,c,e,h,f){var g=d.intervals,k=f.decimalSeparator;if(a>=g[b].contains){var l=a-Math.floor(a/g[b].contains)*g[b].contains;"ss"==b?(l=d.formatNumber(l,f),1==l.split(k)[0].length&&(l="0"+l)):l=d.roundTo(l,f.precision);("mm"==b||"hh"==b)&&10>l&&(l="0"+l);c=l+""+e[b]+""+c;a=Math.floor(a/g[b].contains);b=g[b].nextInterval;return d.formatDuration(a,b,c,e,h,f)}"ss"==b&&(a=d.formatNumber(a,f),1==a.split(k)[0].length&&(a="0"+
a));("mm"==b||"hh"==b)&&10>a&&(a="0"+a);c=a+""+e[b]+""+c;if(g[h].count>g[b].count)for(a=g[b].count;a<g[h].count;a++)b=g[b].nextInterval,"ss"==b||"mm"==b||"hh"==b?c="00"+e[b]+""+c:"DD"==b&&(c="0"+e[b]+""+c);":"==c.charAt(c.length-1)&&(c=c.substring(0,c.length-1));return c};d.formatNumber=function(a,b,c,e,h){a=d.roundTo(a,b.precision);isNaN(c)&&(c=b.precision);var f=b.decimalSeparator;b=b.thousandsSeparator;var g;g=0>a?"-":"";a=Math.abs(a);var k=String(a),l=!1;-1!=k.indexOf("e")&&(l=!0);0<=c&&!l&&(k=
d.toFixed(a,c));var m="";if(l)m=k;else{var k=k.split("."),l=String(k[0]),n;for(n=l.length;0<=n;n-=3)m=n!=l.length?0!==n?l.substring(n-3,n)+b+m:l.substring(n-3,n)+m:l.substring(n-3,n);void 0!==k[1]&&(m=m+f+k[1]);void 0!==c&&0<c&&"0"!=m&&(m=d.addZeroes(m,f,c))}m=g+m;""===g&&!0===e&&0!==a&&(m="+"+m);!0===h&&(m+="%");return m};d.addZeroes=function(a,b,c){a=a.split(b);void 0===a[1]&&0<c&&(a[1]="0");return a[1].length<c?(a[1]+="0",d.addZeroes(a[0]+b+a[1],b,c)):void 0!==a[1]?a[0]+b+a[1]:a[0]};d.scientificToNormal=
function(a){var b;a=String(a).split("e");var c;if("-"==a[1].substr(0,1)){b="0.";for(c=0;c<Math.abs(Number(a[1]))-1;c++)b+="0";b+=a[0].split(".").join("")}else{var e=0;b=a[0].split(".");b[1]&&(e=b[1].length);b=a[0].split(".").join("");for(c=0;c<Math.abs(Number(a[1]))-e;c++)b+="0"}return b};d.toScientific=function(a,b){if(0===a)return"0";var c=Math.floor(Math.log(Math.abs(a))*Math.LOG10E),e=String(e).split(".").join(b);return String(e)+"e"+c};d.randomColor=function(){return"#"+("00000"+(16777216*Math.random()<<
0).toString(16)).substr(-6)};d.hitTest=function(a,b,c){var e=!1,h=a.x,f=a.x+a.width,g=a.y,k=a.y+a.height,l=d.isInRectangle;e||(e=l(h,g,b));e||(e=l(h,k,b));e||(e=l(f,g,b));e||(e=l(f,k,b));e||!0===c||(e=d.hitTest(b,a,!0));return e};d.isInRectangle=function(a,b,c){return a>=c.x-5&&a<=c.x+c.width+5&&b>=c.y-5&&b<=c.y+c.height+5?!0:!1};d.isPercents=function(a){if(-1!=String(a).indexOf("%"))return!0};d.formatValue=function(a,b,c,e,h,f,g,k){if(b){void 0===h&&(h="");var l;for(l=0;l<c.length;l++){var m=c[l],
n=b[m];void 0!==n&&(n=f?d.addPrefix(n,k,g,e):d.formatNumber(n,e),a=a.replace(new RegExp("\\[\\["+h+""+m+"\\]\\]","g"),n))}}return a};d.formatDataContextValue=function(a,b){if(a){var c=a.match(/\[\[.*?\]\]/g),e;for(e=0;e<c.length;e++){var d=c[e],d=d.substr(2,d.length-4);void 0!==b[d]&&(a=a.replace(new RegExp("\\[\\["+d+"\\]\\]","g"),b[d]))}}return a};d.massReplace=function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var e=b[c];void 0===e&&(e="");a=a.replace(c,e)}return a};d.cleanFromEmpty=function(a){return a.replace(/\[\[[^\]]*\]\]/g,
"")};d.addPrefix=function(a,b,c,e,h){var f=d.formatNumber(a,e),g="",k,l,m;if(0===a)return"0";0>a&&(g="-");a=Math.abs(a);if(1<a)for(k=b.length-1;-1<k;k--){if(a>=b[k].number&&(l=a/b[k].number,m=Number(e.precision),1>m&&(m=1),c=d.roundTo(l,m),m=d.formatNumber(c,{precision:-1,decimalSeparator:e.decimalSeparator,thousandsSeparator:e.thousandsSeparator}),!h||l==c)){f=g+""+m+""+b[k].prefix;break}}else for(k=0;k<c.length;k++)if(a<=c[k].number){l=a/c[k].number;m=Math.abs(Math.floor(Math.log(l)*Math.LOG10E));
l=d.roundTo(l,m);f=g+""+l+""+c[k].prefix;break}return f};d.remove=function(a){a&&a.remove()};d.getEffect=function(a){">"==a&&(a="easeOutSine");"<"==a&&(a="easeInSine");"elastic"==a&&(a="easeOutElastic");return a};d.getObjById=function(a,b){var c,e;for(e=0;e<a.length;e++){var d=a[e];if(d.id==b){c=d;break}}return c};d.applyTheme=function(a,b,c){b||(b=d.theme);b&&b[c]&&d.extend(a,b[c])};d.isString=function(a){return"string"==typeof a?!0:!1};d.extend=function(a,b,c){var e;a||(a={});for(e in b)c?a.hasOwnProperty(e)||
(a[e]=b[e]):a[e]=b[e];return a};d.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&"cname"!=c&&(b[c]=a[c])};d.processObject=function(a,b,c,e){if(!1===a instanceof b&&(a=e?d.extend(new b(c),a):d.extend(a,new b(c),!0),a.listeners))for(var h in a.listeners)b=a.listeners[h],a.addListener(b.event,b.method);return a};d.fixNewLines=function(a){var b=RegExp("\\n","g");a&&(a=a.replace(b,"<br />"));return a};d.fixBrakes=function(a){if(d.isModern){var b=
RegExp("<br>","g");a&&(a=a.replace(b,"\n"))}else a=d.fixNewLines(a);return a};d.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)d.deleteObject(a[c],b-1),a[c]=null;else if(a&&!a.tagName)try{for(c in a)a[c]&&("object"==typeof a[c]&&d.deleteObject(a[c],b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(e){}}};d.bounce=function(a,b,c,e,d){return(b/=d)<1/2.75?7.5625*e*b*b+c:b<2/2.75?e*(7.5625*(b-=1.5/
2.75)*b+.75)+c:b<2.5/2.75?e*(7.5625*(b-=2.25/2.75)*b+.9375)+c:e*(7.5625*(b-=2.625/2.75)*b+.984375)+c};d.easeInOutQuad=function(a,b,c,e,d){b/=d/2;if(1>b)return e/2*b*b+c;b--;return-e/2*(b*(b-2)-1)+c};d.easeInSine=function(a,b,c,e,d){return-e*Math.cos(b/d*(Math.PI/2))+e+c};d.easeOutSine=function(a,b,c,e,d){return e*Math.sin(b/d*(Math.PI/2))+c};d.easeOutElastic=function(a,b,c,e,d){a=1.70158;var f=0,g=e;if(0===b)return c;if(1==(b/=d))return c+e;f||(f=.3*d);g<Math.abs(e)?(g=e,a=f/4):a=f/(2*Math.PI)*Math.asin(e/
g);return g*Math.pow(2,-10*b)*Math.sin(2*(b*d-a)*Math.PI/f)+e+c};d.fixStepE=function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return d.generateNumber(1,b)};d.generateNumber=function(a,b){var c="",e;e=0>b?Math.abs(b)-1:Math.abs(b);var d;for(d=0;d<e;d++)c+="0";return 0>b?Number("0."+c+String(a)):Number(String(a)+c)};d.setCN=function(a,b,c,e){if(a.addClassNames&&b&&(b=b.node)&&c){var d=b.getAttribute("class");a=a.classNamePrefix+"-";e&&(a="");d?b.setAttribute("class",
d+" "+a+c):b.setAttribute("class",a+c)}};d.parseDefs=function(a,b){for(var c in a){var e=typeof a[c];if(0<a[c].length&&"object"==e)for(var h=0;h<a[c].length;h++)e=document.createElementNS(d.SVG_NS,c),b.appendChild(e),d.parseDefs(a[c][h],e);else"object"==e?(e=document.createElementNS(d.SVG_NS,c),b.appendChild(e),d.parseDefs(a[c],e)):b.setAttribute(c,a[c])}}})();
(function(){var d=window.AmCharts;d.AxisBase=d.Class({construct:function(a){this.createEvents("clickItem","rollOverItem","rollOutItem");this.titleDY=this.y=this.x=this.dy=this.dx=0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridCount=this.tickLength=5;this.gridAlpha=.15;this.gridThickness=1;this.gridColor="#000000";this.dashLength=0;this.labelFrequency=1;this.showLastLabel=this.showFirstLabel=!0;this.fillColor="#FFFFFF";this.fillAlpha=0;this.labelsEnabled=!0;this.labelRotation=
0;this.autoGridCount=!0;this.offset=0;this.guides=[];this.visible=!0;this.counter=0;this.guides=[];this.ignoreAxisWidth=this.inside=!1;this.minHorizontalGap=75;this.minVerticalGap=35;this.titleBold=!0;this.minorGridEnabled=!1;this.minorGridAlpha=.07;this.autoWrap=!1;this.titleAlign="middle";this.labelOffset=0;this.bcn="axis-";this.centerLabels=!1;this.firstDayOfWeek=1;this.centerLabelOnFullPeriod=this.markPeriodChange=this.boldPeriodBeginning=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},
{period:"ss",count:10},{period:"ss",count:30},{period:"mm",count:1},{period:"mm",count:5},{period:"mm",count:10},{period:"mm",count:30},{period:"hh",count:1},{period:"hh",count:3},{period:"hh",count:6},{period:"hh",count:12},{period:"DD",count:1},{period:"DD",count:2},{period:"DD",count:3},{period:"DD",count:4},{period:"DD",count:5},{period:"WW",count:1},{period:"MM",count:1},{period:"MM",count:2},{period:"MM",count:3},{period:"MM",count:6},{period:"YYYY",count:1},{period:"YYYY",count:2},{period:"YYYY",
count:5},{period:"YYYY",count:10},{period:"YYYY",count:50},{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={fff:"ss",ss:"mm",mm:"hh",hh:"DD",DD:"MM",MM:"YYYY"};d.applyTheme(this,a,"AxisBase")},zoom:function(a,b){this.start=a;this.end=b;this.dataChanged=
!0;this.draw()},fixAxisPosition:function(){var a=this.position;"H"==this.orientation?("left"==a&&(a="bottom"),"right"==a&&(a="top")):("bottom"==a&&(a="left"),"top"==a&&(a="right"));this.position=a},init:function(){this.createBalloon()},draw:function(){var a=this.chart;this.prevBY=this.prevBX=NaN;this.allLabels=[];this.counter=0;this.destroy();this.fixAxisPosition();this.setBalloonBounds();this.labels=[];var b=a.container,c=b.set();a.gridSet.push(c);this.set=c;b=b.set();a.axesLabelsSet.push(b);this.labelsSet=
b;this.axisLine=new this.axisRenderer(this);this.autoGridCount?("V"==this.orientation?(a=this.height/this.minVerticalGap,3>a&&(a=3)):a=this.width/this.minHorizontalGap,this.gridCountR=Math.max(a,1)):this.gridCountR=this.gridCount;this.axisWidth=this.axisLine.axisWidth;this.addTitle()},setOrientation:function(a){this.orientation=a?"H":"V"},addTitle:function(){var a=this.title;this.titleLabel=null;if(a){var b=this.chart,c=this.titleColor;void 0===c&&(c=b.color);var e=this.titleFontSize;isNaN(e)&&(e=
b.fontSize+1);a=d.text(b.container,a,c,b.fontFamily,e,this.titleAlign,this.titleBold);d.setCN(b,a,this.bcn+"title");this.titleLabel=a}},positionTitle:function(){var a=this.titleLabel;if(a){var b,c,e=this.labelsSet,h={};0<e.length()?h=e.getBBox():(h.x=0,h.y=0,h.width=this.width,h.height=this.height,d.VML&&(h.y+=this.y,h.x+=this.x));e.push(a);var e=h.x,f=h.y;d.VML&&(this.rotate?e-=this.x:f-=this.y);var g=h.width,h=h.height,k=this.width,l=this.height,m=0,n=a.getBBox().height/2,q=this.inside,p=this.titleAlign;
switch(this.position){case "top":b="left"==p?-1:"right"==p?k:k/2;c=f-10-n;break;case "bottom":b="left"==p?-1:"right"==p?k:k/2;c=f+h+10+n;break;case "left":b=e-10-n;q&&(b-=5);m=-90;c=("left"==p?l+1:"right"==p?-1:l/2)+this.titleDY;break;case "right":b=e+g+10+n,q&&(b+=7),c=("left"==p?l+2:"right"==p?-2:l/2)+this.titleDY,m=-90}this.marginsChanged?(a.translate(b,c),this.tx=b,this.ty=c):a.translate(this.tx,this.ty);this.marginsChanged=!1;isNaN(this.titleRotation)||(m=this.titleRotation);0!==m&&a.rotate(m)}},
pushAxisItem:function(a,b){var c=this,e=a.graphics();0<e.length()&&(b?c.labelsSet.push(e):c.set.push(e));if(e=a.getLabel())this.labelsSet.push(e),e.click(function(b){c.handleMouse(b,a,"clickItem")}).mouseover(function(b){c.handleMouse(b,a,"rollOverItem")}).mouseout(function(b){c.handleMouse(b,a,"rollOutItem")})},handleMouse:function(a,b,c){this.fire({type:c,value:b.value,serialDataItem:b.serialDataItem,axis:this,target:b.label,chart:this.chart,event:a})},addGuide:function(a){for(var b=this.guides,
c=!1,e=b.length,h=0;h<b.length;h++)b[h]==a&&(c=!0,e=h);a=d.processObject(a,d.Guide,this.theme);a.id||(a.id="guideAuto"+e+"_"+(new Date).getTime());c||b.push(a)},removeGuide:function(a){var b=this.guides,c;for(c=0;c<b.length;c++)b[c]==a&&b.splice(c,1)},handleGuideOver:function(a){clearTimeout(this.chart.hoverInt);var b=a.graphics.getBBox(),c=this.x+b.x+b.width/2,b=this.y+b.y+b.height/2,e=a.fillColor;void 0===e&&(e=a.lineColor);this.chart.showBalloon(a.balloonText,e,!0,c,b)},handleGuideOut:function(){this.chart.hideBalloon()},
addEventListeners:function(a,b){var c=this;a.mouseover(function(){c.handleGuideOver(b)});a.touchstart(function(){c.handleGuideOver(b)});a.mouseout(function(){c.handleGuideOut(b)})},getBBox:function(){var a;this.labelsSet&&(a=this.labelsSet.getBBox());a?d.VML||(a={x:a.x+this.x,y:a.y+this.y,width:a.width,height:a.height}):a={x:0,y:0,width:0,height:0};return a},destroy:function(){d.remove(this.set);d.remove(this.labelsSet);var a=this.axisLine;a&&d.remove(a.axisSet);d.remove(this.grid0)},chooseMinorFrequency:function(a){for(var b=
10;0<b;b--)if(a/b==Math.round(a/b))return a/b},parseDatesDraw:function(){var a,b=this.chart,c=this.showFirstLabel,e=this.showLastLabel,h,f="",g=d.extractPeriod(this.minPeriod),k=d.getPeriodDuration(g.period,g.count),l,m,n,q,p,t=this.firstDayOfWeek,r=this.boldPeriodBeginning;a=this.minorGridEnabled;var u,y=this.gridAlpha,x,w=this.choosePeriod(0),B=w.period,w=w.count,z=d.getPeriodDuration(B,w);z<k&&(B=g.period,w=g.count,z=k);g=B;"WW"==g&&(g="DD");this.stepWidth=this.getStepWidth(this.timeDifference);
var A=Math.ceil(this.timeDifference/z)+5,C=l=d.resetDateToMin(new Date(this.startTime-z),B,w,t).getTime();if(g==B&&1==w&&this.centerLabelOnFullPeriod||this.autoWrap||this.centerLabels)n=z*this.stepWidth,this.autoWrap&&!this.centerLabels&&(n=-n);this.cellWidth=k*this.stepWidth;q=Math.round(l/z);k=-1;q/2==Math.round(q/2)&&(k=-2,l-=z);q=this.firstTime;var D=0,J=0;a&&1<w&&(u=this.chooseMinorFrequency(w),x=d.getPeriodDuration(B,u),"DD"==B&&(x+=d.getPeriodDuration("hh")));if(0<this.gridCountR)for(A-5-k>
this.autoRotateCount&&!isNaN(this.autoRotateAngle)&&(this.labelRotationR=this.autoRotateAngle),a=k;a<=A;a++){p=q+z*(a+Math.floor((C-q)/z))-D;"DD"==B&&(p+=36E5);p=d.resetDateToMin(new Date(p),B,w,t).getTime();"MM"==B&&(h=(p-l)/z,1.5<=(p-l)/z&&(p=p-(h-1)*z+d.getPeriodDuration("DD",3),p=d.resetDateToMin(new Date(p),B,1).getTime(),D+=z));h=(p-this.startTime)*this.stepWidth;if("radar"==b.type){if(h=this.axisWidth-h,0>h||h>this.axisWidth)continue}else this.rotate?"date"==this.type&&"middle"==this.gridPosition&&
(J=-z*this.stepWidth/2):"date"==this.type&&(h=this.axisWidth-h);f=!1;this.nextPeriod[g]&&(f=this.checkPeriodChange(this.nextPeriod[g],1,p,l,g));l=!1;f&&this.markPeriodChange?(f=this.dateFormatsObject[this.nextPeriod[g]],this.twoLineMode&&(f=this.dateFormatsObject[g]+"\n"+f,f=d.fixBrakes(f)),l=!0):f=this.dateFormatsObject[g];r||(l=!1);this.currentDateFormat=f;f=d.formatDate(new Date(p),f,b);if(a==k&&!c||a==A&&!e)f=" ";this.labelFunction&&(f=this.labelFunction(f,new Date(p),this,B,w,m).toString());
this.boldLabels&&(l=!0);m=new this.axisItemRenderer(this,h,f,!1,n,J,!1,l);this.pushAxisItem(m);m=l=p;if(!isNaN(u))for(h=1;h<w;h+=u)this.gridAlpha=this.minorGridAlpha,f=p+x*h,f=d.resetDateToMin(new Date(f),B,u,t).getTime(),f=new this.axisItemRenderer(this,(f-this.startTime)*this.stepWidth,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0),this.pushAxisItem(f);this.gridAlpha=y}},choosePeriod:function(a){var b=d.getPeriodDuration(this.periods[a].period,this.periods[a].count),c=this.periods;return this.timeDifference<
b&&0<a?c[a-1]:Math.ceil(this.timeDifference/b)<=this.gridCountR?c[a]:a+1<c.length?this.choosePeriod(a+1):c[a]},getStepWidth:function(a){var b;this.startOnAxis?(b=this.axisWidth/(a-1),1==a&&(b=this.axisWidth)):b=this.axisWidth/a;return b},timeZoom:function(a,b){this.startTime=a;this.endTime=b},minDuration:function(){var a=d.extractPeriod(this.minPeriod);return d.getPeriodDuration(a.period,a.count)},checkPeriodChange:function(a,b,c,e,h){c=new Date(c);var f=new Date(e),g=this.firstDayOfWeek;e=b;"DD"==
a&&(b=1);c=d.resetDateToMin(c,a,b,g).getTime();b=d.resetDateToMin(f,a,b,g).getTime();return"DD"==a&&"hh"!=h&&c-b<d.getPeriodDuration(a,e)?!1:c!=b?!0:!1},generateDFObject:function(){this.dateFormatsObject={};var a;for(a=0;a<this.dateFormats.length;a++){var b=this.dateFormats[a];this.dateFormatsObject[b.period]=b.format}},hideBalloon:function(){this.balloon&&this.balloon.hide&&this.balloon.hide();this.prevBY=this.prevBX=NaN},formatBalloonText:function(a){return a},showBalloon:function(a,b,c,e){var d=
this.offset;switch(this.position){case "bottom":b=this.height+d;break;case "top":b=-d;break;case "left":a=-d;break;case "right":a=this.width+d}c||(c=this.currentDateFormat);if("V"==this.orientation){if(0>b||b>this.height)return;if(isNaN(b)){this.hideBalloon();return}b=this.adjustBalloonCoordinate(b,e);e=this.coordinateToValue(b)}else{if(0>a||a>this.width)return;if(isNaN(a)){this.hideBalloon();return}a=this.adjustBalloonCoordinate(a,e);e=this.coordinateToValue(a)}var f;if(d=this.chart.chartCursor)f=
d.index;this.balloon&&void 0!==e&&this.balloon.enabled&&(this.balloonTextFunction?e=this.balloonTextFunction(e):this.balloonText?e=this.formatBalloonText(this.balloonText,f,c):isNaN(e)||(e=this.formatValue(e,c)),a!=this.prevBX||b!=this.prevBY)&&(this.balloon.setPosition(a,b),this.prevBX=a,this.prevBY=b,e&&this.balloon.showBalloon(e))},adjustBalloonCoordinate:function(a){return a},createBalloon:function(){var a=this.chart,b=a.chartCursor;b&&(b=b.cursorPosition,"mouse"!=b&&(this.stickBalloonToCategory=
!0),"start"==b&&(this.stickBalloonToStart=!0),"ValueAxis"==this.cname&&(this.stickBalloonToCategory=!1));this.balloon&&(this.balloon.destroy&&this.balloon.destroy(),d.extend(this.balloon,a.balloon,!0))},setBalloonBounds:function(){var a=this.balloon;if(a){var b=this.chart;a.cornerRadius=0;a.shadowAlpha=0;a.borderThickness=1;a.borderAlpha=1;a.adjustBorderColor=!1;a.showBullet=!1;this.balloon=a;a.chart=b;a.mainSet=b.plotBalloonsSet;a.pointerWidth=this.tickLength;if(this.parseDates||"date"==this.type)a.pointerWidth=
0;b="V";"V"==this.orientation&&(b="H");this.stickBalloonToCategory||(a.animationDuration=0);var c,e,d,f,g=this.inside,k=this.width,l=this.height;switch(this.position){case "bottom":c=0;e=k;g?(d=0,f=l):(d=l,f=l+1E3);break;case "top":c=0;e=k;g?(d=0,f=l):(d=-1E3,f=0);break;case "left":d=0;f=l;g?(c=0,e=k):(c=-1E3,e=0);break;case "right":d=0,f=l,g?(c=0,e=k):(c=k,e=k+1E3)}a.drop||(a.pointerOrientation=b);a.setBounds(c,d,e,f)}}})})();
(function(){var d=window.AmCharts;d.ValueAxis=d.Class({inherits:d.AxisBase,construct:function(a){this.cname="ValueAxis";this.createEvents("axisChanged","logarithmicAxisFailed","axisZoomed");d.ValueAxis.base.construct.call(this,a);this.dataChanged=!0;this.stackType="none";this.position="left";this.unitPosition="right";this.includeAllValues=this.recalculateToPercents=this.includeHidden=this.includeGuidesInMinMax=this.integersOnly=!1;this.durationUnits={DD:"d. ",hh:":",mm:":",ss:""};this.scrollbar=!1;
this.baseValue=0;this.radarCategoriesEnabled=!0;this.gridType="polygons";this.useScientificNotation=!1;this.axisTitleOffset=10;this.pointPosition="axis";this.minMaxMultiplier=1;this.logGridLimit=2;this.totalTextOffset=this.treatZeroAs=0;this.minPeriod="ss";this.relativeStart=0;this.relativeEnd=1;d.applyTheme(this,a,this.cname)},updateData:function(){0>=this.gridCountR&&(this.gridCountR=1);this.totals=[];this.data=this.chart.chartData;var a=this.chart;"xy"!=a.type&&(this.stackGraphs("smoothedLine"),
this.stackGraphs("line"),this.stackGraphs("column"),this.stackGraphs("step"));this.recalculateToPercents&&this.recalculate();this.synchronizationMultiplier&&this.synchronizeWith?(d.isString(this.synchronizeWith)&&(this.synchronizeWith=a.getValueAxisById(this.synchronizeWith)),this.synchronizeWith&&(this.synchronizeWithAxis(this.synchronizeWith),this.foundGraphs=!0)):(this.foundGraphs=!1,this.getMinMax(),0===this.start&&this.end==this.data.length-1&&isNaN(this.minZoom)&&isNaN(this.maxZoom)&&(this.fullMin=
this.min,this.fullMax=this.max,"date"!=this.type&&(isNaN(this.minimum)||(this.fullMin=this.minimum),isNaN(this.maximum)||(this.fullMax=this.maximum)),this.logarithmic&&(this.fullMin=this.logMin,0===this.fullMin&&(this.fullMin=this.treatZeroAs)),"date"==this.type&&(this.minimumDate||(this.fullMin=this.minRR),this.maximumDate||(this.fullMax=this.maxRR))))},draw:function(){d.ValueAxis.base.draw.call(this);var a=this.chart,b=this.set;this.labelRotationR=this.labelRotation;d.setCN(a,this.set,"value-axis value-axis-"+
this.id);d.setCN(a,this.labelsSet,"value-axis value-axis-"+this.id);d.setCN(a,this.axisLine.axisSet,"value-axis value-axis-"+this.id);var c=this.type;"duration"==c&&(this.duration="ss");!0===this.dataChanged&&(this.updateData(),this.dataChanged=!1);"date"==c&&(this.logarithmic=!1,this.min=this.minRR,this.max=this.maxRR,this.reversed=!1,this.getDateMinMax());if(this.logarithmic){var e=this.treatZeroAs,h=this.getExtremes(0,this.data.length-1).min;this.logMin=h;this.minReal<h&&(this.minReal=h);isNaN(this.minReal)&&
(this.minReal=h);0<e&&0===h&&(this.minReal=h=e);if(0>=h||0>=this.minimum){this.fire({type:"logarithmicAxisFailed",chart:a});return}}this.grid0=null;var f,g,k=a.dx,l=a.dy,e=!1,h=this.logarithmic;if(isNaN(this.min)||isNaN(this.max)||!this.foundGraphs||Infinity==this.min||-Infinity==this.max)e=!0;else{var m=this.labelFrequency,n=this.showFirstLabel,q=this.showLastLabel,p=1;f=0;this.minCalc=this.min;this.maxCalc=this.max;this.strictMinMax&&(isNaN(this.minimum)||(this.min=this.minimum),isNaN(this.maximum)||
(this.max=this.maximum));isNaN(this.minZoom)||(this.minReal=this.min=this.minZoom);isNaN(this.maxZoom)||(this.max=this.maxZoom);if(this.logarithmic){var t=Math.log(this.fullMax)*Math.LOG10E-Math.log(this.fullMin)*Math.LOG10E,r=Math.log(this.max)/Math.LN10-Math.log(this.fullMin)*Math.LOG10E;this.relativeStart=(Math.log(this.minReal)/Math.LN10-Math.log(this.fullMin)*Math.LOG10E)/t;this.relativeEnd=r/t}else this.relativeStart=d.fitToBounds((this.min-this.fullMin)/(this.fullMax-this.fullMin),0,1),this.relativeEnd=
d.fitToBounds((this.max-this.fullMin)/(this.fullMax-this.fullMin),0,1);var t=Math.round((this.maxCalc-this.minCalc)/this.step)+1,u;!0===h?(u=Math.log(this.max)*Math.LOG10E-Math.log(this.minReal)*Math.LOG10E,this.stepWidth=this.axisWidth/u,u>this.logGridLimit&&(t=Math.ceil(Math.log(this.max)*Math.LOG10E)+1,f=Math.round(Math.log(this.minReal)*Math.LOG10E),t>this.gridCountR&&(p=Math.ceil(t/this.gridCountR)))):this.stepWidth=this.axisWidth/(this.max-this.min);var y=0;1>this.step&&-1<this.step&&(y=d.getDecimals(this.step));
this.integersOnly&&(y=0);y>this.maxDecCount&&(y=this.maxDecCount);r=this.precision;isNaN(r)||(y=r);isNaN(this.maxZoom)&&(this.max=d.roundTo(this.max,this.maxDecCount),this.min=d.roundTo(this.min,this.maxDecCount));g={};g.precision=y;g.decimalSeparator=a.nf.decimalSeparator;g.thousandsSeparator=a.nf.thousandsSeparator;this.numberFormatter=g;var x,w=this.guides,B=w.length;if(0<B){var z=this.fillAlpha;for(g=this.fillAlpha=0;g<B;g++){var A=w[g],C=NaN,D=A.above;isNaN(A.toValue)||(C=this.getCoordinate(A.toValue),
x=new this.axisItemRenderer(this,C,"",!0,NaN,NaN,A),this.pushAxisItem(x,D));var J=NaN;isNaN(A.value)||(J=this.getCoordinate(A.value),x=new this.axisItemRenderer(this,J,A.label,!0,NaN,(C-J)/2,A),this.pushAxisItem(x,D));isNaN(C)&&(J-=3,C=J+3);isNaN(C-J)||(x=new this.guideFillRenderer(this,J,C,A),this.pushAxisItem(x,D),x=x.graphics(),A.graphics=x,A.balloonText&&this.addEventListeners(x,A))}this.fillAlpha=z}this.exponential=!1;for(g=f;g<t;g+=p)w=d.roundTo(this.step*g+this.min,y),-1!=String(w).indexOf("e")&&
(this.exponential=!0);this.duration&&(this.maxInterval=d.getMaxInterval(this.max,this.duration));var y=this.step,H,w=this.minorGridAlpha;this.minorGridEnabled&&(H=this.getMinorGridStep(y,this.stepWidth*y));if(this.autoGridCount||0!==this.gridCount)if("date"==c)this.generateDFObject(),this.timeDifference=this.max-this.min,this.maxTime=this.lastTime=this.max,this.startTime=this.firstTime=this.min,this.parseDatesDraw();else for(t>=this.autoRotateCount&&!isNaN(this.autoRotateAngle)&&(this.labelRotationR=
this.autoRotateAngle),h&&t++,g=f;g<t;g+=p)if(c=y*g+this.minCalc,c=d.roundTo(c,this.maxDecCount+1),!this.integersOnly||Math.round(c)==c)if(isNaN(r)||Number(d.toFixed(c,r))==c){!0===h&&(0===c&&(c=this.minReal),u>this.logGridLimit&&(c=Math.pow(10,g)));x=this.formatValue(c,!1,g);Math.round(g/m)!=g/m&&(x=void 0);if(0===g&&!n||g==t-1&&!q)x=" ";f=this.getCoordinate(c);var R;this.rotate&&this.autoWrap&&(R=this.stepWidth*y-10);x=new this.axisItemRenderer(this,f,x,void 0,R,void 0,void 0,this.boldLabels);this.pushAxisItem(x);
if(c==this.baseValue&&"radar"!=a.type){var L,P;x=this.width;B=this.height;"H"==this.orientation?0<=f&&f<=x+1&&(L=[f,f,f+k],P=[B,0,l]):0<=f&&f<=B+1&&(L=[0,x,x+k],P=[f,f,f+l]);L&&(f=d.fitToBounds(2*this.gridAlpha,0,1),isNaN(this.zeroGridAlpha)||(f=this.zeroGridAlpha),f=d.line(a.container,L,P,this.gridColor,f,1,this.dashLength),f.translate(this.x,this.y),this.grid0=f,a.axesSet.push(f),f.toBack(),d.setCN(a,f,this.bcn+"zero-grid-"+this.id),d.setCN(a,f,this.bcn+"zero-grid"))}if(!isNaN(H)&&0<w&&g<t-1){f=
y/H;h&&(H=y*(g+p)+this.minCalc,H=d.roundTo(H,this.maxDecCount+1),u>this.logGridLimit&&(H=Math.pow(10,g+p)),f=10,H=(H-c)/f);x=this.gridAlpha;this.gridAlpha=this.minorGridAlpha;for(B=1;B<f;B++)z=this.getCoordinate(c+H*B),z=new this.axisItemRenderer(this,z,"",!1,0,0,!1,!1,0,!0),this.pushAxisItem(z);this.gridAlpha=x}}u=this.baseValue;this.min>this.baseValue&&this.max>this.baseValue&&(u=this.min);this.min<this.baseValue&&this.max<this.baseValue&&(u=this.max);h&&u<this.minReal&&(u=this.minReal);this.baseCoord=
this.getCoordinate(u,!0);u={type:"axisChanged",target:this,chart:a};u.min=h?this.minReal:this.min;u.max=this.max;this.fire(u);this.axisCreated=!0}h=this.axisLine.set;u=this.labelsSet;b.translate(this.x,this.y);u.translate(this.x,this.y);this.positionTitle();"radar"!=a.type&&h.toFront();!this.visible||e?(b.hide(),h.hide(),u.hide()):(b.show(),h.show(),u.show());this.axisY=this.y;this.axisX=this.x},getDateMinMax:function(){this.minimumDate&&(this.minimumDate instanceof Date||(this.minimumDate=d.getDate(this.minimumDate,
this.chart.dataDateFormat,"fff")),this.min=this.minimumDate.getTime());this.maximumDate&&(this.maximumDate instanceof Date||(this.maximumDate=d.getDate(this.maximumDate,this.chart.dataDateFormat,"fff")),this.max=this.maximumDate.getTime())},formatValue:function(a,b,c){var e=this.exponential,h=this.logarithmic,f=this.numberFormatter,g=this.chart;if(f)return!0===this.logarithmic&&(e=-1!=String(a).indexOf("e")?!0:!1),this.useScientificNotation&&(e=!0),this.usePrefixes&&(e=!1),e?(c=-1==String(a).indexOf("e")?
a.toExponential(15):String(a),e=c.split("e"),c=Number(e[0]),e=Number(e[1]),c=d.roundTo(c,14),10==c&&(c=1,e+=1),c=c+"e"+e,0===a&&(c="0"),1==a&&(c="1")):(h&&(e=String(a).split("."),e[1]?(f.precision=e[1].length,0>c&&(f.precision=Math.abs(c)),b&&1<a&&(f.precision=0)):f.precision=-1),c=this.usePrefixes?d.addPrefix(a,g.prefixesOfBigNumbers,g.prefixesOfSmallNumbers,f,!b):d.formatNumber(a,f,f.precision)),this.duration&&(b&&(f.precision=0),c=d.formatDuration(a,this.duration,"",this.durationUnits,this.maxInterval,
f)),"date"==this.type&&(c=d.formatDate(new Date(a),this.currentDateFormat,g)),this.recalculateToPercents?c+="%":(b=this.unit)&&(c="left"==this.unitPosition?b+c:c+b),this.labelFunction&&(c="date"==this.type?this.labelFunction(c,new Date(a),this).toString():this.labelFunction(a,c,this).toString()),c},getMinorGridStep:function(a,b){var c=[5,4,2];60>b&&c.shift();for(var e=Math.floor(Math.log(Math.abs(a))*Math.LOG10E),d=0;d<c.length;d++){var f=a/c[d],g=Math.floor(Math.log(Math.abs(f))*Math.LOG10E);if(!(1<
Math.abs(e-g)))if(1>a){if(g=Math.pow(10,-g)*f,g==Math.round(g))return f}else if(f==Math.round(f))return f}},stackGraphs:function(a){var b=this.stackType;"stacked"==b&&(b="regular");"line"==b&&(b="none");"100% stacked"==b&&(b="100%");this.stackType=b;var c=[],e=[],h=[],f=[],g,k=this.chart.graphs,l,m,n,q,p,t=this.baseValue,r=!1;if("line"==a||"step"==a||"smoothedLine"==a)r=!0;if(r&&("regular"==b||"100%"==b))for(q=0;q<k.length;q++)n=k[q],n.stackGraph=null,n.hidden||(m=n.type,n.chart==this.chart&&n.valueAxis==
this&&a==m&&n.stackable&&(l&&(n.stackGraph=l),l=n));n=this.start-10;l=this.end+10;q=this.data.length-1;n=d.fitToBounds(n,0,q);l=d.fitToBounds(l,0,q);for(p=n;p<=l;p++){var u=0;for(q=0;q<k.length;q++)if(n=k[q],n.hidden)n.newStack&&(h[p]=NaN,e[p]=NaN);else if(m=n.type,n.chart==this.chart&&n.valueAxis==this&&a==m&&n.stackable)if(m=this.data[p].axes[this.id].graphs[n.id],g=m.values.value,isNaN(g))n.newStack&&(h[p]=NaN,e[p]=NaN);else{var y=d.getDecimals(g);u<y&&(u=y);isNaN(f[p])?f[p]=Math.abs(g):f[p]+=
Math.abs(g);f[p]=d.roundTo(f[p],u);y=n.fillToGraph;r&&y&&(y=this.data[p].axes[this.id].graphs[y.id])&&(m.values.open=y.values.value);"regular"==b&&(r&&(isNaN(c[p])?(c[p]=g,m.values.close=g,m.values.open=this.baseValue):(isNaN(g)?m.values.close=c[p]:m.values.close=g+c[p],m.values.open=c[p],c[p]=m.values.close)),"column"==a&&(n.newStack&&(h[p]=NaN,e[p]=NaN),m.values.close=g,0>g?(m.values.close=g,isNaN(e[p])?m.values.open=t:(m.values.close+=e[p],m.values.open=e[p]),e[p]=m.values.close):(m.values.close=
g,isNaN(h[p])?m.values.open=t:(m.values.close+=h[p],m.values.open=h[p]),h[p]=m.values.close)))}}for(p=this.start;p<=this.end;p++)for(q=0;q<k.length;q++)(n=k[q],n.hidden)?n.newStack&&(h[p]=NaN,e[p]=NaN):(m=n.type,n.chart==this.chart&&n.valueAxis==this&&a==m&&n.stackable&&(m=this.data[p].axes[this.id].graphs[n.id],g=m.values.value,isNaN(g)||(c=g/f[p]*100,m.values.percents=c,m.values.total=f[p],n.newStack&&(h[p]=NaN,e[p]=NaN),"100%"==b&&(isNaN(e[p])&&(e[p]=0),isNaN(h[p])&&(h[p]=0),0>c?(m.values.close=
d.fitToBounds(c+e[p],-100,100),m.values.open=e[p],e[p]=m.values.close):(m.values.close=d.fitToBounds(c+h[p],-100,100),m.values.open=h[p],h[p]=m.values.close)))))},recalculate:function(){var a=this.chart,b=a.graphs,c;for(c=0;c<b.length;c++){var e=b[c];if(e.valueAxis==this){var h="value";if("candlestick"==e.type||"ohlc"==e.type)h="open";var f,g,k=this.end+2,k=d.fitToBounds(this.end+1,0,this.data.length-1),l=this.start;0<l&&l--;var m;g=this.start;e.compareFromStart&&(g=0);if(!isNaN(a.startTime)&&(m=
a.categoryAxis)){var n=m.minDuration(),n=new Date(a.startTime+n/2),q=d.resetDateToMin(new Date(a.startTime),m.minPeriod).getTime();d.resetDateToMin(new Date(n),m.minPeriod).getTime()>q&&g++}if(m=a.recalculateFromDate)m=d.getDate(m,a.dataDateFormat,"fff"),g=a.getClosestIndex(a.chartData,"time",m.getTime(),!0,0,a.chartData.length),k=a.chartData.length-1;for(m=g;m<=k&&(g=this.data[m].axes[this.id].graphs[e.id],f=g.values[h],e.recalculateValue&&(f=g.dataContext[e.valueField+e.recalculateValue]),isNaN(f));m++);
this.recBaseValue=f;for(h=l;h<=k;h++){g=this.data[h].axes[this.id].graphs[e.id];g.percents={};var l=g.values,p;for(p in l)g.percents[p]="percents"!=p?l[p]/f*100-100:l[p]}}}},getMinMax:function(){var a=!1,b=this.chart,c=b.graphs,e;for(e=0;e<c.length;e++){var h=c[e].type;("line"==h||"step"==h||"smoothedLine"==h)&&this.expandMinMax&&(a=!0)}a&&(0<this.start&&this.start--,this.end<this.data.length-1&&this.end++);"serial"==b.type&&(!0!==b.categoryAxis.parseDates||a||this.end<this.data.length-1&&this.end++);
this.includeAllValues&&(this.start=0,this.end=this.data.length-1);a=this.minMaxMultiplier;b=this.getExtremes(this.start,this.end);this.min=b.min;this.max=b.max;this.minRR=this.min;this.maxRR=this.max;a=(this.max-this.min)*(a-1);this.min-=a;this.max+=a;a=this.guides.length;if(this.includeGuidesInMinMax&&0<a)for(b=0;b<a;b++)c=this.guides[b],c.toValue<this.min&&(this.min=c.toValue),c.value<this.min&&(this.min=c.value),c.toValue>this.max&&(this.max=c.toValue),c.value>this.max&&(this.max=c.value);isNaN(this.minimum)||
(this.min=this.minimum);isNaN(this.maximum)||(this.max=this.maximum);"date"==this.type&&this.getDateMinMax();this.min>this.max&&(a=this.max,this.max=this.min,this.min=a);isNaN(this.minZoom)||(this.min=this.minZoom);isNaN(this.maxZoom)||(this.max=this.maxZoom);this.minCalc=this.min;this.maxCalc=this.max;this.minReal=this.min;this.maxReal=this.max;0===this.min&&0===this.max&&(this.max=9);this.min>this.max&&(this.min=this.max-1);a=this.min;b=this.max;c=this.max-this.min;e=0===c?Math.pow(10,Math.floor(Math.log(Math.abs(this.max))*
Math.LOG10E))/10:Math.pow(10,Math.floor(Math.log(Math.abs(c))*Math.LOG10E))/10;isNaN(this.maximum)&&(this.max=Math.ceil(this.max/e)*e+e);isNaN(this.minimum)&&(this.min=Math.floor(this.min/e)*e-e);0>this.min&&0<=a&&(this.min=0);0<this.max&&0>=b&&(this.max=0);"100%"==this.stackType&&(this.min=0>this.min?-100:0,this.max=0>this.max?0:100);c=this.max-this.min;e=Math.pow(10,Math.floor(Math.log(Math.abs(c))*Math.LOG10E))/10;this.step=Math.ceil(c/this.gridCountR/e)*e;c=Math.pow(10,Math.floor(Math.log(Math.abs(this.step))*
Math.LOG10E));c=d.fixStepE(c);e=Math.ceil(this.step/c);5<e&&(e=10);5>=e&&2<e&&(e=5);this.step=Math.ceil(this.step/(c*e))*c*e;1>c?(this.maxDecCount=Math.abs(Math.log(Math.abs(c))*Math.LOG10E),this.maxDecCount=Math.round(this.maxDecCount),this.step=d.roundTo(this.step,this.maxDecCount+1)):this.maxDecCount=0;this.min=this.step*Math.floor(this.min/this.step);this.max=this.step*Math.ceil(this.max/this.step);0>this.min&&0<=a&&(this.min=0);0<this.max&&0>=b&&(this.max=0);1<this.minReal&&1<this.max-this.minReal&&
(this.minReal=Math.floor(this.minReal));c=Math.pow(10,Math.floor(Math.log(Math.abs(this.minReal))*Math.LOG10E));0===this.min&&(this.minReal=c);0===this.min&&1<this.minReal&&(this.minReal=1);0<this.min&&0<this.minReal-this.step&&(this.minReal=this.min+this.step<this.minReal?this.min+this.step:this.min);this.logarithmic&&(2<Math.log(b)*Math.LOG10E-Math.log(a)*Math.LOG10E?(this.minReal=this.min=Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E)),this.max=Math.pow(10,Math.ceil(Math.log(Math.abs(b))*
Math.LOG10E))):(a=Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E))/10,Math.pow(10,Math.floor(Math.log(Math.abs(this.min))*Math.LOG10E))/10<a&&(this.minReal=this.min=10*a)))},getExtremes:function(a,b){var c,e,d;for(d=a;d<=b;d++){var f=this.data[d].axes[this.id].graphs,g;for(g in f)if(f.hasOwnProperty(g)){var k=this.chart.graphsById[g];if(k.includeInMinMax&&(!k.hidden||this.includeHidden)){isNaN(c)&&(c=Infinity);isNaN(e)&&(e=-Infinity);this.foundGraphs=!0;k=f[g].values;this.recalculateToPercents&&
(k=f[g].percents);var l;if(this.minMaxField)l=k[this.minMaxField],l<c&&(c=l),l>e&&(e=l);else for(var m in k)k.hasOwnProperty(m)&&"percents"!=m&&"total"!=m&&(l=k[m],l<c&&(c=l),l>e&&(e=l))}}}return{min:c,max:e}},zoomOut:function(){this.zoomToRelativeValues(0,1);this.maxZoom=this.minZoom=NaN},zoomToRelativeValues:function(a,b,c){if(this.reversed){var e=a;a=1-b;b=1-e}var d=this.fullMax,e=this.fullMin,f=e+(d-e)*a,g=e+(d-e)*b;this.logarithmic&&(d=Math.log(d)*Math.LOG10E-Math.log(e)*Math.LOG10E,f=Math.pow(10,
d*a+Math.log(e)*Math.LOG10E),g=Math.pow(10,d*b+Math.log(e)*Math.LOG10E));return this.zoomToValues(f,g,c)},zoomToValues:function(a,b,c){if(b<a){var e=b;b=a;a=e}var d=this.fullMax,e=this.fullMin;this.relativeStart=(a-e)/(d-e);this.relativeEnd=(b-e)/(d-e);if(this.logarithmic){var d=Math.log(d)*Math.LOG10E-Math.log(e)*Math.LOG10E,f=Math.log(b)/Math.LN10-Math.log(e)*Math.LOG10E;this.relativeStart=(Math.log(a)/Math.LN10-Math.log(e)*Math.LOG10E)/d;this.relativeEnd=f/d}if(this.minZoom!=a||this.maxZoom!=b)return this.minZoom=
a,this.maxZoom=b,c||(c={type:"axisZoomed"},c.chart=this.chart,c.valueAxis=this,c.startValue=a,c.endValue=b,c.relativeStart=this.relativeStart,c.relativeEnd=this.relativeEnd,this.fire(c)),!0},coordinateToValue:function(a){if(isNaN(a))return NaN;var b=this.axisWidth,c=this.stepWidth,e=this.reversed,d=this.rotate,f=this.min,g=this.minReal;return!0===this.logarithmic?Math.pow(10,(d?!0===e?(b-a)/c:a/c:!0===e?a/c:(b-a)/c)+Math.log(g)*Math.LOG10E):!0===e?d?f-(a-b)/c:a/c+f:d?a/c+f:f-(a-b)/c},getCoordinate:function(a,
b){if(isNaN(a))return NaN;var c=this.rotate,e=this.reversed,d=this.axisWidth,f=this.stepWidth,g=this.min,k=this.minReal;!0===this.logarithmic?(0===a&&(a=this.treatZeroAs),g=Math.log(a)*Math.LOG10E-Math.log(k)*Math.LOG10E,c=c?!0===e?d-f*g:f*g:!0===e?f*g:d-f*g):c=!0===e?c?d-f*(a-g):f*(a-g):c?f*(a-g):d-f*(a-g);1E7<Math.abs(c)&&(c=c/Math.abs(c)*1E7);b||(c=Math.round(c));return c},synchronizeWithAxis:function(a){this.synchronizeWith=a;this.listenTo(this.synchronizeWith,"axisChanged",this.handleSynchronization)},
handleSynchronization:function(){if(this.synchronizeWith){d.isString(this.synchronizeWith)&&(this.synchronizeWith=this.chart.getValueAxisById(this.synchronizeWith));var a=this.synchronizeWith,b=a.min,c=a.max,a=a.step,e=this.synchronizationMultiplier;e&&(this.min=b*e,this.max=c*e,this.step=a*e,b=Math.abs(Math.log(Math.abs(Math.pow(10,Math.floor(Math.log(Math.abs(this.step))*Math.LOG10E))))*Math.LOG10E),this.maxDecCount=b=Math.round(b),this.draw())}}})})();
(function(){var d=window.AmCharts;d.RecAxis=d.Class({construct:function(a){var b=a.chart,c=a.axisThickness,e=a.axisColor,h=a.axisAlpha,f=a.offset,g=a.dx,k=a.dy,l=a.x,m=a.y,n=a.height,q=a.width,p=b.container;"H"==a.orientation?(e=d.line(p,[0,q],[0,0],e,h,c),this.axisWidth=a.width,"bottom"==a.position?(k=c/2+f+n+m-1,c=l):(k=-c/2-f+m+k,c=g+l)):(this.axisWidth=a.height,"right"==a.position?(e=d.line(p,[0,0,-g],[0,n,n-k],e,h,c),k=m+k,c=c/2+f+g+q+l-1):(e=d.line(p,[0,0],[0,n],e,h,c),k=m,c=-c/2-f+l));e.translate(c,
k);c=b.container.set();c.push(e);b.axesSet.push(c);d.setCN(b,e,a.bcn+"line");this.axisSet=c;this.set=e}})})();
(function(){var d=window.AmCharts;d.RecItem=d.Class({construct:function(a,b,c,e,h,f,g,k,l,m,n,q){b=Math.round(b);var p=a.chart;this.value=c;void 0==c&&(c="");l||(l=0);void 0==e&&(e=!0);var t=p.fontFamily,r=a.fontSize;void 0==r&&(r=p.fontSize);var u=a.color;void 0==u&&(u=p.color);void 0!==n&&(u=n);var y=a.chart.container,x=y.set();this.set=x;var w=a.axisThickness,B=a.axisColor,z=a.axisAlpha,A=a.tickLength,C=a.gridAlpha,D=a.gridThickness,J=a.gridColor,H=a.dashLength,R=a.fillColor,L=a.fillAlpha,P=a.labelsEnabled;
n=a.labelRotationR;var ia=a.counter,I=a.inside,Z=a.labelOffset,va=a.dx,la=a.dy,Oa=a.orientation,ea=a.position,ca=a.previousCoord,X=a.height,ya=a.width,da=a.offset,fa,za;g?(void 0!==g.id&&(q=p.classNamePrefix+"-guide-"+g.id),P=!0,isNaN(g.tickLength)||(A=g.tickLength),void 0!=g.lineColor&&(J=g.lineColor),void 0!=g.color&&(u=g.color),isNaN(g.lineAlpha)||(C=g.lineAlpha),isNaN(g.dashLength)||(H=g.dashLength),isNaN(g.lineThickness)||(D=g.lineThickness),!0===g.inside&&(I=!0,0<da&&(da=0)),isNaN(g.labelRotation)||
(n=g.labelRotation),isNaN(g.fontSize)||(r=g.fontSize),g.position&&(ea=g.position),void 0!==g.boldLabel&&(k=g.boldLabel),isNaN(g.labelOffset)||(Z=g.labelOffset)):""===c&&(A=0);m&&!isNaN(a.minorTickLength)&&(A=a.minorTickLength);var ga="start";0<h&&(ga="middle");a.centerLabels&&(ga="middle");var T=n*Math.PI/180,Y,Ca,G=0,v=0,ma=0,ha=Y=0,Pa=0;"V"==Oa&&(n=0);var ba;P&&""!==c&&(ba=a.autoWrap&&0===n?d.wrappedText(y,c,u,t,r,ga,k,Math.abs(h),0):d.text(y,c,u,t,r,ga,k),ga=ba.getBBox(),ha=ga.width,Pa=ga.height);
if("H"==Oa){if(0<=b&&b<=ya+1&&(0<A&&0<z&&b+l<=ya+1&&(fa=d.line(y,[b+l,b+l],[0,A],B,z,D),x.push(fa)),0<C&&(za=d.line(y,[b,b+va,b+va],[X,X+la,la],J,C,D,H),x.push(za))),v=0,G=b,g&&90==n&&I&&(G-=r),!1===e?(ga="start",v="bottom"==ea?I?v+A:v-A:I?v-A:v+A,G+=3,0<h&&(G+=h/2-3,ga="middle"),0<n&&(ga="middle")):ga="middle",1==ia&&0<L&&!g&&!m&&ca<ya&&(e=d.fitToBounds(b,0,ya),ca=d.fitToBounds(ca,0,ya),Y=e-ca,0<Y&&(Ca=d.rect(y,Y,a.height,R,L),Ca.translate(e-Y+va,la),x.push(Ca))),"bottom"==ea?(v+=X+r/2+da,I?(0<n?
(v=X-ha/2*Math.sin(T)-A-3,G+=ha/2*Math.cos(T)-4+2):0>n?(v=X+ha*Math.sin(T)-A-3+2,G+=-ha*Math.cos(T)-Pa*Math.sin(T)-4):v-=A+r+3+3,v-=Z):(0<n?(v=X+ha/2*Math.sin(T)+A+3,G-=ha/2*Math.cos(T)):0>n?(v=X+A+3-ha/2*Math.sin(T)+2,G+=ha/2*Math.cos(T)):v+=A+w+3+3,v+=Z)):(v+=la+r/2-da,G+=va,I?(0<n?(v=ha/2*Math.sin(T)+A+3,G-=ha/2*Math.cos(T)):v+=A+3,v+=Z):(0<n?(v=-(ha/2)*Math.sin(T)-A-6,G+=ha/2*Math.cos(T)):v-=A+r+3+w+3,v-=Z)),"bottom"==ea?Y=(I?X-A-1:X+w-1)+da:(ma=va,Y=(I?la:la-A-w+1)-da),f&&(G+=f),f=G,0<n&&(f+=
ha/2*Math.cos(T)),ba&&(r=0,I&&(r=ha/2*Math.cos(T)),f+r>ya+2||0>f))ba.remove(),ba=null}else{0<=b&&b<=X+1&&(0<A&&0<z&&b+l<=X+1&&(fa=d.line(y,[0,A+1],[b+l,b+l],B,z,D),x.push(fa)),0<C&&(za=d.line(y,[0,va,ya+va],[b,b+la,b+la],J,C,D,H),x.push(za)));ga="end";if(!0===I&&"left"==ea||!1===I&&"right"==ea)ga="start";v=b-Pa/2+2;1==ia&&0<L&&!g&&!m&&(e=d.fitToBounds(b,0,X),ca=d.fitToBounds(ca,0,X),T=e-ca,Ca=d.polygon(y,[0,a.width,a.width,0],[0,0,T,T],R,L),Ca.translate(va,e-T+la),x.push(Ca));v+=r/2;"right"==ea?(G+=
va+ya+da,v+=la,I?(f||(v-=r/2+3),G=G-(A+4)-Z):(G+=A+4+w,v-=2,G+=Z)):I?(G+=A+4-da,f||(v-=r/2+3),g&&(G+=va,v+=la),G+=Z):(G+=-A-w-4-2-da,v-=2,G-=Z);fa&&("right"==ea?(ma+=va+da+ya-1,Y+=la,ma=I?ma-w:ma+w):(ma-=da,I||(ma-=A+w)));f&&(v+=f);I=-3;"right"==ea&&(I+=la);ba&&(v>X+1||v<I)&&(ba.remove(),ba=null)}fa&&(fa.translate(ma,Y),d.setCN(p,fa,a.bcn+"tick"),d.setCN(p,fa,q,!0),g&&d.setCN(p,fa,"guide"));!1===a.visible&&(fa&&fa.remove(),ba&&(ba.remove(),ba=null));ba&&(ba.attr({"text-anchor":ga}),ba.translate(G,
v,NaN,!0),0!==n&&ba.rotate(-n,a.chart.backgroundColor),a.allLabels.push(ba),this.label=ba,d.setCN(p,ba,a.bcn+"label"),d.setCN(p,ba,q,!0),g&&d.setCN(p,ba,"guide"));za&&(d.setCN(p,za,a.bcn+"grid"),d.setCN(p,za,q,!0),g&&d.setCN(p,za,"guide"));Ca&&(d.setCN(p,Ca,a.bcn+"fill"),d.setCN(p,Ca,q,!0));m?za&&d.setCN(p,za,a.bcn+"grid-minor"):(a.counter=0===ia?1:0,a.previousCoord=b);0===this.set.node.childNodes.length&&this.set.remove()},graphics:function(){return this.set},getLabel:function(){return this.label}})})();
(function(){var d=window.AmCharts;d.RecFill=d.Class({construct:function(a,b,c,e){var h=a.dx,f=a.dy,g=a.orientation,k=0;if(c<b){var l=b;b=c;c=l}var m=e.fillAlpha;isNaN(m)&&(m=0);var l=a.chart.container,n=e.fillColor;"V"==g?(b=d.fitToBounds(b,0,a.height),c=d.fitToBounds(c,0,a.height)):(b=d.fitToBounds(b,0,a.width),c=d.fitToBounds(c,0,a.width));c-=b;isNaN(c)&&(c=4,k=2,m=0);0>c&&"object"==typeof n&&(n=n.join(",").split(",").reverse());"V"==g?(g=d.rect(l,a.width,c,n,m),g.translate(h,b-k+f)):(g=d.rect(l,
c,a.height,n,m),g.translate(b-k+h,f));d.setCN(a.chart,g,"guide-fill");e.id&&d.setCN(a.chart,g,"guide-fill-"+e.id);this.set=l.set([g])},graphics:function(){return this.set},getLabel:function(){}})})();
(function(){var d=window.AmCharts;d.AmChart=d.Class({construct:function(a){this.svgIcons=this.tapToActivate=!0;this.theme=a;this.classNamePrefix="amcharts";this.addClassNames=!1;this.version="3.18.6";d.addChart(this);this.createEvents("buildStarted","dataUpdated","init","rendered","drawn","failed","resized","animationFinished");this.height=this.width="100%";this.dataChanged=!0;this.chartCreated=!1;this.previousWidth=this.previousHeight=0;this.backgroundColor="#FFFFFF";this.borderAlpha=this.backgroundAlpha=
0;this.color=this.borderColor="#000000";this.fontFamily="Verdana";this.fontSize=11;this.usePrefixes=!1;this.autoResize=!0;this.autoDisplay=!1;this.addCodeCredits=!0;this.precision=-1;this.percentPrecision=2;this.decimalSeparator=".";this.thousandsSeparator=",";this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];this.creditsPosition="top-left";var b=document.createElement("div"),c=b.style;c.overflow="hidden";c.position="relative";
c.textAlign="left";this.chartDiv=b;b=document.createElement("div");c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.legendDiv=b;this.titleHeight=0;this.hideBalloonTime=150;this.handDrawScatter=2;this.handDrawThickness=1;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,
prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},{number:1E-6,prefix:"\u03bc"},{number:.001,prefix:"m"}];this.panEventsEnabled=!0;this.product="amcharts";this.animations=[];this.balloon=new d.AmBalloon(this.theme);this.balloon.chart=this;this.processTimeout=0;this.processCount=1E3;this.animatable=[];d.applyTheme(this,a,"AmChart")},drawChart:function(){0<this.realWidth&&0<this.realHeight&&(this.drawBackground(),
this.redrawLabels(),this.drawTitles(),this.brr(),this.renderFix(),this.chartDiv&&(this.boundingRect=this.chartDiv.getBoundingClientRect()))},drawBackground:function(){d.remove(this.background);var a=this.container,b=this.backgroundColor,c=this.backgroundAlpha,e=this.set;d.isModern||0!==c||(c=.001);var h=this.updateWidth();this.realWidth=h;var f=this.updateHeight();this.realHeight=f;b=d.polygon(a,[0,h-1,h-1,0],[0,0,f-1,f-1],b,c,1,this.borderColor,this.borderAlpha);d.setCN(this,b,"bg");this.background=
b;e.push(b);if(b=this.backgroundImage)a=a.image(b,0,0,h,f),d.setCN(this,b,"bg-image"),this.bgImg=a,e.push(a)},drawTitles:function(a){var b=this.titles;this.titleHeight=0;if(d.ifArray(b)){var c=20,e;for(e=0;e<b.length;e++){var h=b[e],h=d.processObject(h,d.Title,this.theme);if(!1!==h.enabled){var f=h.color;void 0===f&&(f=this.color);var g=h.size;isNaN(g)&&(g=this.fontSize+2);isNaN(h.alpha);var k=this.marginLeft,l=!0;void 0!==h.bold&&(l=h.bold);f=d.wrappedText(this.container,h.text,f,this.fontFamily,
g,"middle",l,this.realWidth-35);f.translate(k+(this.realWidth-this.marginRight-k)/2,c);f.node.style.pointerEvents="none";h.sprite=f;d.setCN(this,f,"title");h.id&&d.setCN(this,f,"title-"+h.id);f.attr({opacity:h.alpha});c+=f.getBBox().height+5;a?f.remove():this.freeLabelsSet.push(f)}}this.titleHeight=c-10}},write:function(a){var b=this;if(b.listeners)for(var c=0;c<b.listeners.length;c++){var e=b.listeners[c];b.addListener(e.event,e.method)}b.fire({type:"buildStarted",chart:b});b.afterWriteTO&&clearTimeout(b.afterWriteTO);
0<b.processTimeout?b.afterWriteTO=setTimeout(function(){b.afterWrite.call(b,a)},b.processTimeout):b.afterWrite(a)},afterWrite:function(a){if(a="object"!=typeof a?document.getElementById(a):a){for(;a.firstChild;)a.removeChild(a.firstChild);this.div=a;a.style.overflow="hidden";a.style.textAlign="left";var b=this.chartDiv,c=this.legendDiv,e=this.legend,h=c.style,f=b.style;this.measure();this.previousHeight=this.divRealHeight;this.previousWidth=this.divRealWidth;var g,k=document.createElement("div");
g=k.style;g.position="relative";this.containerDiv=k;k.className=this.classNamePrefix+"-main-div";b.className=this.classNamePrefix+"-chart-div";a.appendChild(k);var l=this.exportConfig;l&&d.AmExport&&!this.AmExport&&(this.AmExport=new d.AmExport(this,l));this.amExport&&d.AmExport&&(this.AmExport=d.extend(this.amExport,new d.AmExport(this),!0));this.AmExport&&this.AmExport.init&&this.AmExport.init();if(e)if(e=this.addLegend(e,e.divId),e.enabled)switch(e.position){case "bottom":k.appendChild(b);k.appendChild(c);
break;case "top":k.appendChild(c);k.appendChild(b);break;case "absolute":g.width=a.style.width;g.height=a.style.height;h.position="absolute";f.position="absolute";void 0!==e.left&&(h.left=e.left+"px");void 0!==e.right&&(h.right=e.right+"px");void 0!==e.top&&(h.top=e.top+"px");void 0!==e.bottom&&(h.bottom=e.bottom+"px");e.marginLeft=0;e.marginRight=0;k.appendChild(b);k.appendChild(c);break;case "right":g.width=a.style.width;g.height=a.style.height;h.position="relative";f.position="absolute";k.appendChild(b);
k.appendChild(c);break;case "left":g.width=a.style.width;g.height=a.style.height;h.position="absolute";f.position="relative";k.appendChild(b);k.appendChild(c);break;case "outside":k.appendChild(b)}else k.appendChild(b);else k.appendChild(b);this.listenersAdded||(this.addListeners(),this.listenersAdded=!0);this.initChart()}},createLabelsSet:function(){d.remove(this.labelsSet);this.labelsSet=this.container.set();this.freeLabelsSet.push(this.labelsSet)},initChart:function(){this.balloon=d.processObject(this.balloon,
d.AmBalloon,this.theme);window.AmCharts_path&&(this.path=window.AmCharts_path);void 0===this.path&&(this.path=d.getPath());void 0===this.path&&(this.path="amcharts/");this.path=d.normalizeUrl(this.path);void 0===this.pathToImages&&(this.pathToImages=this.path+"images/");this.initHC||(d.callInitHandler(this),this.initHC=!0);d.applyLang(this.language,this);var a=this.numberFormatter;a&&(isNaN(a.precision)||(this.precision=a.precision),void 0!==a.thousandsSeparator&&(this.thousandsSeparator=a.thousandsSeparator),
void 0!==a.decimalSeparator&&(this.decimalSeparator=a.decimalSeparator));(a=this.percentFormatter)&&!isNaN(a.precision)&&(this.percentPrecision=a.precision);this.nf={precision:this.precision,thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.pf={precision:this.percentPrecision,thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.destroy();(a=this.container)?(a.container.innerHTML="",a.width=this.realWidth,a.height=this.realHeight,
a.addDefs(this),this.chartDiv.appendChild(a.container)):a=new d.AmDraw(this.chartDiv,this.realWidth,this.realHeight,this);this.container=a;this.extension=".png";this.svgIcons&&d.SVG&&(this.extension=".svg");this.checkDisplay();a.chart=this;d.VML||d.SVG?(a.handDrawn=this.handDrawn,a.handDrawScatter=this.handDrawScatter,a.handDrawThickness=this.handDrawThickness,d.remove(this.set),this.set=a.set(),d.remove(this.gridSet),this.gridSet=a.set(),d.remove(this.cursorLineSet),this.cursorLineSet=a.set(),d.remove(this.graphsBehindSet),
this.graphsBehindSet=a.set(),d.remove(this.bulletBehindSet),this.bulletBehindSet=a.set(),d.remove(this.columnSet),this.columnSet=a.set(),d.remove(this.graphsSet),this.graphsSet=a.set(),d.remove(this.trendLinesSet),this.trendLinesSet=a.set(),d.remove(this.axesSet),this.axesSet=a.set(),d.remove(this.cursorSet),this.cursorSet=a.set(),d.remove(this.scrollbarsSet),this.scrollbarsSet=a.set(),d.remove(this.bulletSet),this.bulletSet=a.set(),d.remove(this.freeLabelsSet),this.freeLabelsSet=a.set(),d.remove(this.axesLabelsSet),
this.axesLabelsSet=a.set(),d.remove(this.balloonsSet),this.balloonsSet=a.set(),d.remove(this.plotBalloonsSet),this.plotBalloonsSet=a.set(),d.remove(this.zoomButtonSet),this.zoomButtonSet=a.set(),d.remove(this.zbSet),this.zbSet=null,d.remove(this.linkSet),this.linkSet=a.set()):this.fire({type:"failed",chart:this})},premeasure:function(){var a=this.div;if(a){this.boundingRect=this.chartDiv.getBoundingClientRect();var b=a.offsetWidth,c=a.offsetHeight;a.clientHeight&&(b=a.clientWidth,c=a.clientHeight);
if(b!=this.mw||c!=this.mh)this.mw=b,this.mh=c,this.measure()}},measure:function(){var a=this.div;if(a){var b=this.chartDiv,c=a.offsetWidth,e=a.offsetHeight,h=this.container;a.clientHeight&&(c=a.clientWidth,e=a.clientHeight);var f=d.removePx(d.getStyle(a,"padding-left")),g=d.removePx(d.getStyle(a,"padding-right")),k=d.removePx(d.getStyle(a,"padding-top")),l=d.removePx(d.getStyle(a,"padding-bottom"));isNaN(f)||(c-=f);isNaN(g)||(c-=g);isNaN(k)||(e-=k);isNaN(l)||(e-=l);f=a.style;a=f.width;f=f.height;
-1!=a.indexOf("px")&&(c=d.removePx(a));-1!=f.indexOf("px")&&(e=d.removePx(f));e=Math.round(e);c=Math.round(c);a=Math.round(d.toCoordinate(this.width,c));f=Math.round(d.toCoordinate(this.height,e));(c!=this.previousWidth||e!=this.previousHeight)&&0<a&&0<f&&(b.style.width=a+"px",b.style.height=f+"px",b.style.padding=0,h&&h.setSize(a,f),this.balloon=d.processObject(this.balloon,d.AmBalloon,this.theme),this.balloon.setBounds(2,2,a-2,f));this.balloon.chart=this;this.realWidth=a;this.realHeight=f;this.divRealWidth=
c;this.divRealHeight=e}},checkDisplay:function(){if(this.autoDisplay&&this.container){var a=d.rect(this.container,10,10),b=a.getBBox();0===b.width&&0===b.height&&(this.divRealHeight=this.divRealWidth=this.realHeight=this.realWidth=0,this.previousWidth=this.previousHeight=NaN);a.remove()}},destroy:function(){this.chartDiv.innerHTML="";this.clearTimeOuts();this.legend&&this.legend.destroy()},clearTimeOuts:function(){var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=
[]},clear:function(a){d.callMethod("clear",[this.chartScrollbar,this.scrollbarV,this.scrollbarH,this.chartCursor]);this.chartCursor=this.scrollbarH=this.scrollbarV=this.chartScrollbar=null;this.clearTimeOuts();this.container&&(this.container.remove(this.chartDiv),this.container.remove(this.legendDiv));a||d.removeChart(this);if(a=this.div)for(;a.firstChild;)a.removeChild(a.firstChild);this.legend&&this.legend.destroy()},setMouseCursor:function(a){"auto"==a&&d.isNN&&(a="default");this.chartDiv.style.cursor=
a;this.legendDiv.style.cursor=a},redrawLabels:function(){this.labels=[];var a=this.allLabels;this.createLabelsSet();var b;for(b=0;b<a.length;b++)this.drawLabel(a[b])},drawLabel:function(a){if(this.container&&!1!==a.enabled){a=d.processObject(a,d.Label,this.theme);var b=a.y,c=a.text,e=a.align,h=a.size,f=a.color,g=a.rotation,k=a.alpha,l=a.bold,m=d.toCoordinate(a.x,this.realWidth),b=d.toCoordinate(b,this.realHeight);m||(m=0);b||(b=0);void 0===f&&(f=this.color);isNaN(h)&&(h=this.fontSize);e||(e="start");
"left"==e&&(e="start");"right"==e&&(e="end");"center"==e&&(e="middle",g?b=this.realHeight-b+b/2:m=this.realWidth/2-m);void 0===k&&(k=1);void 0===g&&(g=0);b+=h/2;c=d.text(this.container,c,f,this.fontFamily,h,e,l,k);c.translate(m,b);d.setCN(this,c,"label");a.id&&d.setCN(this,c,"label-"+a.id);0!==g&&c.rotate(g);a.url?(c.setAttr("cursor","pointer"),c.click(function(){d.getURL(a.url)})):c.node.style.pointerEvents="none";this.labelsSet.push(c);this.labels.push(c)}},addLabel:function(a,b,c,e,d,f,g,k,l,m){a=
{x:a,y:b,text:c,align:e,size:d,color:f,alpha:k,rotation:g,bold:l,url:m,enabled:!0};this.container&&this.drawLabel(a);this.allLabels.push(a)},clearLabels:function(){var a=this.labels,b;for(b=a.length-1;0<=b;b--)a[b].remove();this.labels=[];this.allLabels=[]},updateHeight:function(){var a=this.divRealHeight,b=this.legend;if(b){var c=this.legendDiv.offsetHeight,b=b.position;if("top"==b||"bottom"==b){a-=c;if(0>a||isNaN(a))a=0;this.chartDiv.style.height=a+"px"}}return a},updateWidth:function(){var a=this.divRealWidth,
b=this.divRealHeight,c=this.legend;if(c){var e=this.legendDiv,d=e.offsetWidth;isNaN(c.width)||(d=c.width);c.ieW&&(d=c.ieW);var f=e.offsetHeight,e=e.style,g=this.chartDiv.style,c=c.position;if("right"==c||"left"==c){a-=d;if(0>a||isNaN(a))a=0;g.width=a+"px";this.balloon.setBounds(2,2,a-2,this.realHeight);"left"==c?(g.left=d+"px",e.left="0px"):(g.left="0px",e.left=a+"px");b>f&&(e.top=(b-f)/2+"px")}}return a},getTitleHeight:function(){this.drawTitles(!0);return this.titleHeight},addTitle:function(a,b,
c,e,d){isNaN(b)&&(b=this.fontSize+2);a={text:a,size:b,color:c,alpha:e,bold:d,enabled:!0};this.titles.push(a);return a},handleWheel:function(a){var b=0;a||(a=window.event);a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3);b&&this.handleWheelReal(b,a.shiftKey);a.preventDefault&&a.preventDefault()},handleWheelReal:function(){},handleDocTouchStart:function(){this.hideBalloonReal();this.handleMouseMove();this.tmx=this.mouseX;this.tmy=this.mouseY},handleDocTouchEnd:function(){-.5<this.tmx&&this.tmx<
this.divRealWidth+1&&0<this.tmy&&this.tmy<this.divRealHeight?(this.handleMouseMove(),4>Math.abs(this.mouseX-this.tmx)&&4>Math.abs(this.mouseY-this.tmy)&&(this.tapped=!0)):this.tapped=!1},addListeners:function(){var a=this,b=a.chartDiv;document.addEventListener?(a.panEventsEnabled&&(b.style.msTouchAction="none",b.style.touchAction="none"),"ontouchstart"in document.documentElement&&(b.addEventListener("touchstart",function(b){a.handleTouchStart.call(a,b)},!0),b.addEventListener("touchmove",function(b){a.handleMouseMove.call(a,
b)},!0),b.addEventListener("touchend",function(b){a.handleTouchEnd.call(a,b)},!0),document.addEventListener("touchstart",function(b){a.handleDocTouchStart.call(a,b)}),document.addEventListener("touchend",function(b){a.handleDocTouchEnd.call(a,b)})),b.addEventListener("mousedown",function(b){a.mouseIsOver=!0;a.handleMouseMove.call(a,b);a.handleMouseDown.call(a,b)},!0),b.addEventListener("mouseover",function(b){a.handleMouseOver.call(a,b)},!0),b.addEventListener("mouseout",function(b){a.handleMouseOut.call(a,
b)},!0)):(b.attachEvent("onmousedown",function(b){a.handleMouseDown.call(a,b)}),b.attachEvent("onmouseover",function(b){a.handleMouseOver.call(a,b)}),b.attachEvent("onmouseout",function(b){a.handleMouseOut.call(a,b)}))},dispDUpd:function(){this.skipEvents||(this.dispatchDataUpdated&&(this.dispatchDataUpdated=!1,this.fire({type:"dataUpdated",chart:this})),this.chartCreated||(this.chartCreated=!0,this.fire({type:"init",chart:this})),this.chartRendered||(this.fire({type:"rendered",chart:this}),this.chartRendered=
!0),this.fire({type:"drawn",chart:this}));this.skipEvents=!1},validateSize:function(){var a=this;a.premeasure();a.checkDisplay();if(a.divRealWidth!=a.previousWidth||a.divRealHeight!=a.previousHeight){var b=a.legend;if(0<a.realWidth&&0<a.realHeight){a.sizeChanged=!0;if(b){a.legendInitTO&&clearTimeout(a.legendInitTO);var c=setTimeout(function(){b.invalidateSize()},10);a.timeOuts.push(c);a.legendInitTO=c}a.marginsUpdated="xy"!=a.type?!1:!0;clearTimeout(a.initTO);c=setTimeout(function(){a.initChart()},
10);a.timeOuts.push(c);a.initTO=c}a.renderFix();b&&b.renderFix&&b.renderFix();clearTimeout(a.resizedTO);a.resizedTO=setTimeout(function(){a.fire({type:"resized",chart:a})},10);a.previousHeight=a.divRealHeight;a.previousWidth=a.divRealWidth}},invalidateSize:function(){this.previousHeight=this.previousWidth=NaN;this.invalidateSizeReal()},invalidateSizeReal:function(){var a=this;a.marginsUpdated=!1;clearTimeout(a.validateTO);var b=setTimeout(function(){a.validateSize()},5);a.timeOuts.push(b);a.validateTO=
b},validateData:function(a){this.chartCreated&&(this.dataChanged=!0,this.marginsUpdated=!1,this.initChart(a))},validateNow:function(a,b){this.initTO&&clearTimeout(this.initTO);a&&(this.dataChanged=!0,this.marginsUpdated=!1);this.skipEvents=b;this.chartRendered=!1;this.write(this.div)},showItem:function(a){a.hidden=!1;this.initChart()},hideItem:function(a){a.hidden=!0;this.initChart()},hideBalloon:function(){var a=this;clearTimeout(a.hoverInt);clearTimeout(a.balloonTO);a.hoverInt=setTimeout(function(){a.hideBalloonReal.call(a)},
a.hideBalloonTime)},cleanChart:function(){},hideBalloonReal:function(){var a=this.balloon;a&&a.hide()},showBalloon:function(a,b,c,e,d){var f=this;clearTimeout(f.balloonTO);clearTimeout(f.hoverInt);f.balloonTO=setTimeout(function(){f.showBalloonReal.call(f,a,b,c,e,d)},1)},showBalloonReal:function(a,b,c,e,d){this.handleMouseMove();var f=this.balloon;f.enabled&&(f.followCursor(!1),f.changeColor(b),!c||f.fixedPosition?(f.setPosition(e,d),isNaN(e)||isNaN(d)?f.followCursor(!0):f.followCursor(!1)):f.followCursor(!0),
a&&f.showBalloon(a))},handleMouseOver:function(){this.outTO&&clearTimeout(this.outTO);d.resetMouseOver();this.mouseIsOver=!0},handleMouseOut:function(){var a=this;d.resetMouseOver();a.outTO&&clearTimeout(a.outTO);a.outTO=setTimeout(function(){a.handleMouseOutReal()},10)},handleMouseOutReal:function(){this.mouseIsOver=!1},handleMouseMove:function(a){a||(a=window.event);this.mouse2Y=this.mouse2X=NaN;var b,c,e,d;if(a){if(a.touches){var f=a.touches.item(1);f&&this.panEventsEnabled&&this.boundingRect&&
(e=f.clientX-this.boundingRect.left,d=f.clientY-this.boundingRect.top);a=a.touches.item(0);if(!a)return}else this.wasTouched=!1;this.boundingRect&&a.clientX&&(b=a.clientX-this.boundingRect.left,c=a.clientY-this.boundingRect.top);isNaN(e)?this.mouseX=b:(this.mouseX=Math.min(b,e),this.mouse2X=Math.max(b,e));isNaN(d)?this.mouseY=c:(this.mouseY=Math.min(c,d),this.mouse2Y=Math.max(c,d))}},handleTouchStart:function(a){this.hideBalloonReal();a&&(a.touches&&this.tapToActivate&&!this.tapped||!this.panRequired)||
(this.handleMouseMove(a),this.handleMouseDown(a))},handleTouchEnd:function(a){this.wasTouched=!0;this.handleMouseMove(a);d.resetMouseOver();this.handleReleaseOutside(a)},handleReleaseOutside:function(){},handleMouseDown:function(a){d.resetMouseOver();this.mouseIsOver=!0;a&&a.preventDefault&&(this.panEventsEnabled?a.preventDefault():a.touches||a.preventDefault())},addLegend:function(a,b){a=d.processObject(a,d.AmLegend,this.theme);a.divId=b;a.ieW=0;var c;c="object"!=typeof b&&b?document.getElementById(b):
b;this.legend=a;a.chart=this;c?(a.div=c,a.position="outside",a.autoMargins=!1):a.div=this.legendDiv;return a},removeLegend:function(){this.legend=void 0;this.legendDiv.innerHTML=""},handleResize:function(){(d.isPercents(this.width)||d.isPercents(this.height))&&this.invalidateSizeReal();this.renderFix()},renderFix:function(){if(!d.VML){var a=this.container;a&&a.renderFix()}},getSVG:function(){if(d.hasSVG)return this.container},animate:function(a,b,c,e,h,f,g){a["an_"+b]&&d.removeFromArray(this.animations,
a["an_"+b]);c={obj:a,frame:0,attribute:b,from:c,to:e,time:h,effect:f,suffix:g};a["an_"+b]=c;this.animations.push(c);return c},setLegendData:function(a){var b=this.legend;b&&b.setData(a)},stopAnim:function(a){d.removeFromArray(this.animations,a)},updateAnimations:function(){var a;this.container&&this.container.update();if(this.animations)for(a=this.animations.length-1;0<=a;a--){var b=this.animations[a],c=d.updateRate*b.time,e=b.frame+1,h=b.obj,f=b.attribute;if(e<=c){b.frame++;var g=Number(b.from),
k=Number(b.to)-g,c=d[b.effect](0,e,g,k,c);0===k?(this.animations.splice(a,1),h.node.style[f]=Number(b.to)+b.suffix):h.node.style[f]=c+b.suffix}else h.node.style[f]=Number(b.to)+b.suffix,h.animationFinished=!0,this.animations.splice(a,1)}},update:function(){this.updateAnimations();var a=this.animatable;if(0<a.length){for(var b=!0,c=a.length-1;0<=c;c--){var e=a[c];e&&(e.animationFinished?a.splice(c,1):b=!1)}b&&(this.fire({type:"animationFinished",chart:this}),this.animatable=[])}},inIframe:function(){try{return window.self!==
window.top}catch(a){return!0}},brr:function(){if(!this.hideCredits){var a="amcharts.com",b=window.location.hostname.split("."),c;2<=b.length&&(c=b[b.length-2]+"."+b[b.length-1]);this.amLink&&(b=this.amLink.parentNode)&&b.removeChild(this.amLink);b=this.creditsPosition;if(c!=a||!0===this.inIframe()){var a="http://www."+a,e=c=0,d=this.realWidth,f=this.realHeight,g=this.type;if("serial"==g||"xy"==g||"gantt"==g)c=this.marginLeftReal,e=this.marginTopReal,d=c+this.plotAreaWidth,f=e+this.plotAreaHeight;
var g=a+"/javascript-charts/",k="JavaScript charts",l="JS chart by amCharts";"ammap"==this.product&&(g=a+"/javascript-maps/",k="Interactive JavaScript maps",l="JS map by amCharts");a=document.createElement("a");l=document.createTextNode(l);a.setAttribute("href",g);a.setAttribute("title",k);a.appendChild(l);this.chartDiv.appendChild(a);this.amLink=a;g=a.style;g.position="absolute";g.textDecoration="none";g.color=this.color;g.fontFamily=this.fontFamily;g.fontSize=this.fontSize+"px";g.opacity=.7;g.display=
"block";var k=a.offsetWidth,a=a.offsetHeight,l=5+c,m=e+5;"bottom-left"==b&&(l=5+c,m=f-a-3);"bottom-right"==b&&(l=d-k-5,m=f-a-3);"top-right"==b&&(l=d-k-5,m=e+5);g.left=l+"px";g.top=m+"px"}}}});d.Slice=d.Class({construct:function(){}});d.SerialDataItem=d.Class({construct:function(){}});d.GraphDataItem=d.Class({construct:function(){}});d.Guide=d.Class({construct:function(a){this.cname="Guide";d.applyTheme(this,a,this.cname)}});d.Title=d.Class({construct:function(a){this.cname="Title";d.applyTheme(this,
a,this.cname)}});d.Label=d.Class({construct:function(a){this.cname="Label";d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.AmGraph=d.Class({construct:function(a){this.cname="AmGraph";this.createEvents("rollOverGraphItem","rollOutGraphItem","clickGraphItem","doubleClickGraphItem","rightClickGraphItem","clickGraph","rollOverGraph","rollOutGraph");this.type="line";this.stackable=!0;this.columnCount=1;this.columnIndex=0;this.centerCustomBullets=this.showBalloon=!0;this.maxBulletSize=50;this.minBulletSize=4;this.balloonText="[[value]]";this.hidden=this.scrollbar=this.animationPlayed=!1;
this.pointPosition="middle";this.depthCount=1;this.includeInMinMax=!0;this.negativeBase=0;this.visibleInLegend=!0;this.showAllValueLabels=!1;this.showBulletsAt=this.showBalloonAt="close";this.lineThickness=1;this.dashLength=0;this.connect=!0;this.lineAlpha=1;this.bullet="none";this.bulletBorderThickness=2;this.bulletBorderAlpha=0;this.bulletAlpha=1;this.bulletSize=8;this.cornerRadiusTop=this.hideBulletsCount=this.bulletOffset=0;this.cursorBulletAlpha=1;this.gradientOrientation="vertical";this.dy=
this.dx=0;this.periodValue="";this.clustered=!0;this.periodSpan=1;this.y=this.x=0;this.switchable=!0;this.tcc=this.minDistance=1;this.labelRotation=0;this.labelAnchor="auto";this.labelOffset=3;this.bcn="graph-";this.dateFormat="MMM DD, YYYY";this.noRounding=!0;d.applyTheme(this,a,this.cname)},init:function(){this.createBalloon()},draw:function(){var a=this.chart,b=a.type;if(a.drawGraphs){isNaN(this.precision)||(this.numberFormatter?this.numberFormatter.precision=this.precision:this.numberFormatter=
{precision:this.precision,decimalSeparator:a.decimalSeparator,thousandsSeparator:a.thousandsSeparator});var c=a.container;this.container=c;this.destroy();var e=c.set();this.set=e;e.translate(this.x,this.y);var h=c.set();this.bulletSet=h;h.translate(this.x,this.y);this.behindColumns?(a.graphsBehindSet.push(e),a.bulletBehindSet.push(h)):(a.graphsSet.push(e),a.bulletSet.push(h));var f=this.bulletAxis;d.isString(f)&&(this.bulletAxis=a.getValueAxisById(f));c=c.set();d.remove(this.columnsSet);this.columnsSet=
c;d.setCN(a,e,"graph-"+this.type);d.setCN(a,e,"graph-"+this.id);d.setCN(a,h,"graph-"+this.type);d.setCN(a,h,"graph-"+this.id);this.columnsArray=[];this.ownColumns=[];this.allBullets=[];this.animationArray=[];h=this.labelPosition;h||(f=this.valueAxis.stackType,h="top","column"==this.type&&(a.rotate&&(h="right"),"100%"==f||"regular"==f)&&(h="middle"),this.labelPosition=h);d.ifArray(this.data)&&(a=!1,"xy"==b?this.xAxis.axisCreated&&this.yAxis.axisCreated&&(a=!0):this.valueAxis.axisCreated&&(a=!0),!this.hidden&&
a&&this.createGraph());e.push(c)}},createGraph:function(){var a=this,b=a.chart;a.startAlpha=b.startAlpha;a.seqAn=b.sequencedAnimation;a.baseCoord=a.valueAxis.baseCoord;void 0===a.fillAlphas&&(a.fillAlphas=0);a.bulletColorR=a.bulletColor;void 0===a.bulletColorR&&(a.bulletColorR=a.lineColorR,a.bulletColorNegative=a.negativeLineColor);void 0===a.bulletAlpha&&(a.bulletAlpha=a.lineAlpha);if("step"==c||d.VML)a.noRounding=!1;var c=b.type;"gantt"==c&&(c="serial");clearTimeout(a.playedTO);if(!isNaN(a.valueAxis.min)&&
!isNaN(a.valueAxis.max)){switch(c){case "serial":a.categoryAxis&&(a.createSerialGraph(),"candlestick"==a.type&&1>a.valueAxis.minMaxMultiplier&&a.positiveClip(a.set));break;case "radar":a.createRadarGraph();break;case "xy":a.createXYGraph(),a.positiveClip(a.set)}a.playedTO=setTimeout(function(){a.setAnimationPlayed.call(a)},500*a.chart.startDuration)}},setAnimationPlayed:function(){this.animationPlayed=!0},createXYGraph:function(){var a=[],b=[],c=this.xAxis,e=this.yAxis;this.pmh=e.height;this.pmw=
c.width;this.pmy=this.pmx=0;var d;for(d=this.start;d<=this.end;d++){var f=this.data[d].axes[c.id].graphs[this.id],g=f.values,k=g.x,l=g.y,g=c.getCoordinate(k,this.noRounding),m=e.getCoordinate(l,this.noRounding);if(!isNaN(k)&&!isNaN(l)&&(a.push(g),b.push(m),f.x=g,f.y=m,k=this.createBullet(f,g,m,d),l=this.labelText)){var l=this.createLabel(f,l),n=0;k&&(n=k.size);this.positionLabel(f,g,m,l,n)}}this.drawLineGraph(a,b);this.launchAnimation()},createRadarGraph:function(){var a=this.valueAxis.stackType,
b=[],c=[],e=[],d=[],f,g,k,l,m;for(m=this.start;m<=this.end;m++){var n=this.data[m].axes[this.valueAxis.id].graphs[this.id],q,p;"none"==a||"3d"==a?q=n.values.value:(q=n.values.close,p=n.values.open);if(isNaN(q))this.connect||(this.drawLineGraph(b,c,e,d),b=[],c=[],e=[],d=[]);else{var t=this.valueAxis.getCoordinate(q,this.noRounding)-this.height,t=t*this.valueAxis.rMultiplier,r=-360/(this.end-this.start+1)*m;"middle"==this.valueAxis.pointPosition&&(r-=180/(this.end-this.start+1));q=t*Math.sin(r/180*
Math.PI);t*=Math.cos(r/180*Math.PI);b.push(q);c.push(t);if(!isNaN(p)){var u=this.valueAxis.getCoordinate(p,this.noRounding)-this.height,u=u*this.valueAxis.rMultiplier,y=u*Math.sin(r/180*Math.PI),r=u*Math.cos(r/180*Math.PI);e.push(y);d.push(r);isNaN(k)&&(k=y);isNaN(l)&&(l=r)}r=this.createBullet(n,q,t,m);n.x=q;n.y=t;if(y=this.labelText)y=this.createLabel(n,y),u=0,r&&(u=r.size),this.positionLabel(n,q,t,y,u);isNaN(f)&&(f=q);isNaN(g)&&(g=t)}}b.push(f);c.push(g);isNaN(k)||(e.push(k),d.push(l));this.drawLineGraph(b,
c,e,d);this.launchAnimation()},positionLabel:function(a,b,c,e,d){if(e){var f=this.chart,g=this.valueAxis,k="middle",l=!1,m=this.labelPosition,n=e.getBBox(),q=this.chart.rotate,p=a.isNegative;c-=n.height/4/2;void 0!==a.labelIsNegative&&(p=a.labelIsNegative);switch(m){case "right":m=q?p?"left":"right":"right";break;case "top":m=q?"top":p?"bottom":"top";break;case "bottom":m=q?"bottom":p?"top":"bottom";break;case "left":m=q?p?"right":"left":"left"}var t=a.columnGraphics,r=0,u=0;t&&(r=t.x,u=t.y);var y=
this.labelOffset;switch(m){case "right":k="start";b+=d/2+y;break;case "top":c=g.reversed?c+(d/2+n.height/2+y):c-(d/2+n.height/2+y);break;case "bottom":c=g.reversed?c-(d/2+n.height/2+y):c+(d/2+n.height/2+y);break;case "left":k="end";b-=d/2+y;break;case "inside":"column"==this.type&&(l=!0,q?p?(k="end",b=r-3-y):(k="start",b=r+3+y):c=p?u+7+y:u-10-y);break;case "middle":"column"==this.type&&(l=!0,q?b-=(b-r)/2+y-3:c-=(c-u)/2+y-3)}"auto"!=this.labelAnchor&&(k=this.labelAnchor);e.attr({"text-anchor":k});
this.labelRotation&&e.rotate(this.labelRotation);e.translate(b,c);!this.showAllValueLabels&&t&&l&&(n=e.getBBox(),n.height>a.columnHeight||n.width>a.columnWidth)&&(e.remove(),e=null);e&&(0>b||b>this.width||0>c||c>this.height)&&(e.remove(),e=null);if(e&&("serial"==f.type||"gantt"==f.type))if(q){if(0>c||c>this.height)e.remove(),e=null}else if(0>b||b>this.width)e.remove(),e=null;e&&this.allBullets.push(e);return e}},getGradRotation:function(){var a=270;"horizontal"==this.gradientOrientation&&(a=0);return this.gradientRotation=
a},createSerialGraph:function(){this.dashLengthSwitched=this.fillColorsSwitched=this.lineColorSwitched=void 0;var a=this.chart,b=this.id,c=this.index,e=this.data,h=this.chart.container,f=this.valueAxis,g=this.type,k=this.columnWidthReal,l=this.showBulletsAt;isNaN(this.columnWidth)||(k=this.columnWidth);isNaN(k)&&(k=.8);var m=this.useNegativeColorIfDown,n=this.width,q=this.height,p=this.y,t=this.rotate,r=this.columnCount,u=d.toCoordinate(this.cornerRadiusTop,k/2),y=this.connect,x=[],w=[],B,z,A,C,D=
this.chart.graphs.length,J,H=this.dx/this.tcc,R=this.dy/this.tcc,L=f.stackType,P=this.start,ia=this.end,I=this.scrollbar,Z="graph-column-";I&&(Z="scrollbar-graph-column-");var va=this.categoryAxis,la=this.baseCoord,Oa=this.negativeBase,ea=this.columnIndex,ca=this.lineThickness,X=this.lineAlpha,ya=this.lineColorR,da=this.dashLength,fa=this.set,za,ga=this.getGradRotation(),T=this.chart.columnSpacing,Y=va.cellWidth,Ca=(Y*k-r)/r;T>Ca&&(T=Ca);var G,v,ma,ha=q,Pa=n,ba=0,tb=0,ub,vb,gb,hb,wb=this.fillColorsR,
Qa=this.negativeFillColors,Ja=this.negativeLineColor,Ya=this.fillAlphas,Za=this.negativeFillAlphas;"object"==typeof Ya&&(Ya=Ya[0]);"object"==typeof Za&&(Za=Za[0]);var xb=this.noRounding;"step"==g&&(xb=!1);var ib=f.getCoordinate(f.min);f.logarithmic&&(ib=f.getCoordinate(f.minReal));this.minCoord=ib;this.resetBullet&&(this.bullet="none");if(!(I||"line"!=g&&"smoothedLine"!=g&&"step"!=g||(1==e.length&&"step"!=g&&"none"==this.bullet&&(this.bullet="round",this.resetBullet=!0),!Qa&&void 0==Ja||m))){var Ua=
Oa;Ua>f.max&&(Ua=f.max);Ua<f.min&&(Ua=f.min);f.logarithmic&&(Ua=f.minReal);var Ka=f.getCoordinate(Ua),Nb=f.getCoordinate(f.max);t?(ha=q,Pa=Math.abs(Nb-Ka),ub=q,vb=Math.abs(ib-Ka),hb=tb=0,f.reversed?(ba=0,gb=Ka):(ba=Ka,gb=0)):(Pa=n,ha=Math.abs(Nb-Ka),vb=n,ub=Math.abs(ib-Ka),gb=ba=0,f.reversed?(hb=p,tb=Ka):hb=Ka)}var La=Math.round;this.pmx=La(ba);this.pmy=La(tb);this.pmh=La(ha);this.pmw=La(Pa);this.nmx=La(gb);this.nmy=La(hb);this.nmh=La(ub);this.nmw=La(vb);d.isModern||(this.nmy=this.nmx=0,this.nmh=
this.height);this.clustered||(r=1);k="column"==g?(Y*k-T*(r-1))/r:Y*k;1>k&&(k=1);var Ob=this.fixedColumnWidth;isNaN(Ob)||(k=Ob);var M;if("line"==g||"step"==g||"smoothedLine"==g){if(0<P){for(M=P-1;-1<M;M--)if(G=e[M],v=G.axes[f.id].graphs[b],ma=v.values.value,!isNaN(ma)){P=M;break}if(this.lineColorField)for(M=P;-1<M;M--)if(G=e[M],v=G.axes[f.id].graphs[b],v.lineColor){this.bulletColorSwitched=this.lineColorSwitched=v.lineColor;break}if(this.fillColorsField)for(M=P;-1<M;M--)if(G=e[M],v=G.axes[f.id].graphs[b],
v.fillColors){this.fillColorsSwitched=v.fillColors;break}if(this.dashLengthField)for(M=P;-1<M;M--)if(G=e[M],v=G.axes[f.id].graphs[b],!isNaN(v.dashLength)){this.dashLengthSwitched=v.dashLength;break}}if(ia<e.length-1)for(M=ia+1;M<e.length;M++)if(G=e[M],v=G.axes[f.id].graphs[b],ma=v.values.value,!isNaN(ma)){ia=M;break}}ia<e.length-1&&ia++;var U=[],V=[],Ra=!1;if("line"==g||"step"==g||"smoothedLine"==g)if(this.stackable&&"regular"==L||"100%"==L||this.fillToGraph)Ra=!0;var Pb=this.noStepRisers,jb=-1E3,
kb=-1E3,lb=this.minDistance,Sa=!0,$a=!1,yb=0,zb=0;for(M=P;M<=ia;M++){G=e[M];v=G.axes[f.id].graphs[b];v.index=M;var ab,Ta=NaN;if(m&&void 0==this.openField)for(var Ab=M+1;Ab<e.length&&(!e[Ab]||!(ab=e[M+1].axes[f.id].graphs[b])||!ab.values||(Ta=ab.values.value,isNaN(Ta)));Ab++);var S,Q,K,aa,na=NaN,E=NaN,F=NaN,O=NaN,N=NaN,pa=NaN,qa=NaN,ra=NaN,sa=NaN,wa=NaN,Da=NaN,ja=NaN,ka=NaN,W=NaN,Bb=NaN,Cb=NaN,ta=NaN,ua=void 0,Ma=wb,Va=Ya,Ha=ya,Aa,Ea,Db=this.proCandlesticks,mb=this.topRadius,Fa=q-1,oa=n-1,bb=this.pattern;
void 0!=v.pattern&&(bb=v.pattern);isNaN(v.alpha)||(Va=v.alpha);isNaN(v.dashLength)||(da=v.dashLength);var Ia=v.values;f.recalculateToPercents&&(Ia=v.percents);if(Ia){W=this.stackable&&"none"!=L&&"3d"!=L?Ia.close:Ia.value;if("candlestick"==g||"ohlc"==g)W=Ia.close,Cb=Ia.low,qa=f.getCoordinate(Cb),Bb=Ia.high,sa=f.getCoordinate(Bb);ta=Ia.open;F=f.getCoordinate(W,xb);isNaN(ta)||(N=f.getCoordinate(ta,xb),m&&"regular"!=L&&"100%"!=L&&(Ta=ta,ta=N=NaN));m&&(void 0==this.openField?ab&&(ab.isNegative=Ta<W?!0:
!1,isNaN(Ta)&&(v.isNegative=!Sa)):v.isNegative=Ta>W?!0:!1);if(!I)switch(this.showBalloonAt){case "close":v.y=F;break;case "open":v.y=N;break;case "high":v.y=sa;break;case "low":v.y=qa}var na=G.x[va.id],Wa=this.periodSpan-1;"step"!=g||isNaN(G.cellWidth)||(Y=G.cellWidth);var xa=Math.floor(Y/2)+Math.floor(Wa*Y/2),Ga=xa,nb=0;"left"==this.stepDirection&&(nb=(2*Y+Wa*Y)/2,na-=nb);"center"==this.stepDirection&&(nb=Y/2,na-=nb);"start"==this.pointPosition&&(na-=Y/2+Math.floor(Wa*Y/2),xa=0,Ga=Math.floor(Y)+
Math.floor(Wa*Y));"end"==this.pointPosition&&(na+=Y/2+Math.floor(Wa*Y/2),xa=Math.floor(Y)+Math.floor(Wa*Y),Ga=0);if(Pb){var Eb=this.columnWidth;isNaN(Eb)||(xa*=Eb,Ga*=Eb)}I||(v.x=na);-1E5>na&&(na=-1E5);na>n+1E5&&(na=n+1E5);t?(E=F,O=N,N=F=na,isNaN(ta)&&!this.fillToGraph&&(O=la),pa=qa,ra=sa):(O=E=na,isNaN(ta)&&!this.fillToGraph&&(N=la));if(!Db&&W<ta||Db&&W<za)v.isNegative=!0,Qa&&(Ma=Qa),Za&&(Va=Za),void 0!=Ja&&(Ha=Ja);$a=!1;isNaN(W)||(m?W>Ta?(Sa&&($a=!0),Sa=!1):(Sa||($a=!0),Sa=!0):v.isNegative=W<Oa?
!0:!1,za=W);var Qb=!1;I&&a.chartScrollbar.ignoreCustomColors&&(Qb=!0);Qb||(void 0!=v.color&&(Ma=v.color),v.fillColors&&(Ma=v.fillColors));switch(g){case "line":if(isNaN(W))y||(this.drawLineGraph(x,w,U,V),x=[],w=[],U=[],V=[]);else{if(Math.abs(E-jb)>=lb||Math.abs(F-kb)>=lb)x.push(E),w.push(F),jb=E,kb=F;wa=E;Da=F;ja=E;ka=F;!Ra||isNaN(N)||isNaN(O)||(U.push(O),V.push(N));if($a||void 0!=v.lineColor&&v.lineColor!=this.lineColorSwitched||void 0!=v.fillColors&&v.fillColors!=this.fillColorsSwitched||!isNaN(v.dashLength))this.drawLineGraph(x,
w,U,V),x=[E],w=[F],U=[],V=[],!Ra||isNaN(N)||isNaN(O)||(U.push(O),V.push(N)),m?Sa?(this.lineColorSwitched=ya,this.fillColorsSwitched=wb):(this.lineColorSwitched=Ja,this.fillColorsSwitched=Qa):(this.lineColorSwitched=v.lineColor,this.fillColorsSwitched=v.fillColors),this.dashLengthSwitched=v.dashLength;v.gap&&(this.drawLineGraph(x,w,U,V),x=[],w=[],U=[],V=[])}break;case "smoothedLine":if(isNaN(W))y||(this.drawSmoothedGraph(x,w,U,V),x=[],w=[],U=[],V=[]);else{if(Math.abs(E-jb)>=lb||Math.abs(F-kb)>=lb)x.push(E),
w.push(F),jb=E,kb=F;wa=E;Da=F;ja=E;ka=F;!Ra||isNaN(N)||isNaN(O)||(U.push(O),V.push(N));void 0==v.lineColor&&void 0==v.fillColors&&isNaN(v.dashLength)||(this.drawSmoothedGraph(x,w,U,V),x=[E],w=[F],U=[],V=[],!Ra||isNaN(N)||isNaN(O)||(U.push(O),V.push(N)),this.lineColorSwitched=v.lineColor,this.fillColorsSwitched=v.fillColors,this.dashLengthSwitched=v.dashLength);v.gap&&(this.drawSmoothedGraph(x,w,U,V),x=[],w=[],U=[],V=[])}break;case "step":if(!isNaN(W)){t?(isNaN(B)||(x.push(B),w.push(F-xa)),w.push(F-
xa),x.push(E),w.push(F+Ga),x.push(E),!Ra||isNaN(N)||isNaN(O)||(isNaN(A)||(U.push(A),V.push(N-xa)),U.push(O),V.push(N-xa),U.push(O),V.push(N+Ga))):(isNaN(z)||(w.push(z),x.push(E-xa)),x.push(E-xa),w.push(F),x.push(E+Ga),w.push(F),!Ra||isNaN(N)||isNaN(O)||(isNaN(C)||(U.push(O-xa),V.push(C)),U.push(O-xa),V.push(N),U.push(O+Ga),V.push(N)));B=E;z=F;A=O;C=N;wa=E;Da=F;ja=E;ka=F;if($a||void 0!=v.lineColor||void 0!=v.fillColors||!isNaN(v.dashLength)){var ec=x[x.length-2],fc=w[w.length-2];x.pop();w.pop();this.drawLineGraph(x,
w,U,V);x=[ec];w=[fc];t?(w.push(F+Ga),x.push(E)):(x.push(E+Ga),w.push(F));U=[];V=[];this.lineColorSwitched=v.lineColor;this.fillColorsSwitched=v.fillColors;this.dashLengthSwitched=v.dashLength;m&&(Sa?(this.lineColorSwitched=ya,this.fillColorsSwitched=wb):(this.lineColorSwitched=Ja,this.fillColorsSwitched=Qa))}if(Pb||v.gap)B=z=NaN,this.drawLineGraph(x,w,U,V),x=[],w=[],U=[],V=[]}else if(!y){if(1>=this.periodSpan||1<this.periodSpan&&E-B>xa+Ga)B=z=NaN;this.drawLineGraph(x,w,U,V);x=[];w=[];U=[];V=[]}break;
case "column":Aa=Ha;void 0!=v.lineColor&&(Aa=v.lineColor);if(!isNaN(W)){m||(v.isNegative=W<Oa?!0:!1);v.isNegative&&(Qa&&(Ma=Qa),void 0!=Ja&&(Aa=Ja));var Rb=f.min,Sb=f.max,ob=ta;isNaN(ob)&&(ob=Oa);if(!(W<Rb&&ob<Rb||W>Sb&&ob>Sb)){var Ba;if(t){"3d"==L?(Q=F-(r/2-this.depthCount+1)*(k+T)+T/2+R*ea,S=O+H*ea,Ba=ea):(Q=Math.floor(F-(r/2-ea)*(k+T)+T/2),S=O,Ba=0);K=k;wa=E;Da=Q+k/2;ja=E;ka=Q+k/2;Q+K>q+Ba*R&&(K=q-Q+Ba*R);Q<Ba*R&&(K+=Q,Q=Ba*R);aa=E-O;var gc=S;S=d.fitToBounds(S,0,n);aa+=gc-S;aa=d.fitToBounds(aa,
-S,n-S+H*ea);v.labelIsNegative=0>aa?!0:!1;0===aa&&1/W===1/-0&&(v.labelIsNegative=!0);isNaN(G.percentWidthValue)||(K=this.height*G.percentWidthValue/100,Q=zb,zb+=K,Da=Q+K/2);K=d.roundTo(K,2);aa=d.roundTo(aa,2);Q<q&&0<K&&(ua=new d.Cuboid(h,aa,K,H-a.d3x,R-a.d3y,Ma,Va,ca,Aa,X,ga,u,t,da,bb,mb,Z),v.columnWidth=Math.abs(aa),v.columnHeight=Math.abs(K))}else{"3d"==L?(S=E-(r/2-this.depthCount+1)*(k+T)+T/2+H*ea,Q=N+R*ea,Ba=ea):(S=E-(r/2-ea)*(k+T)+T/2,Q=N,Ba=0);K=k;wa=S+k/2;Da=F;ja=S+k/2;ka=F;S+K>n+Ba*H&&(K=
n-S+Ba*H);S<Ba*H&&(K+=S-Ba*H,S=Ba*H);aa=F-N;v.labelIsNegative=0<aa?!0:!1;0===aa&&-0===W&&(v.labelIsNegative=!0);var hc=Q;Q=d.fitToBounds(Q,this.dy,q);aa+=hc-Q;aa=d.fitToBounds(aa,-Q+R*ea,q-Q);isNaN(G.percentWidthValue)||(K=this.width*G.percentWidthValue/100,S=yb,yb+=K,wa=S+K/2);K=d.roundTo(K,2);aa=d.roundTo(aa,2);S<n+ea*H&&0<K&&(this.showOnAxis&&(Q-=R/2),ua=new d.Cuboid(h,K,aa,H-a.d3x,R-a.d3y,Ma,Va,ca,Aa,this.lineAlpha,ga,u,t,da,bb,mb,Z),v.columnHeight=Math.abs(aa),v.columnWidth=Math.abs(K))}}if(ua){Ea=
ua.set;d.setCN(a,ua.set,"graph-"+this.type);d.setCN(a,ua.set,"graph-"+this.id);v.className&&d.setCN(a,ua.set,v.className,!0);v.columnGraphics=Ea;S=d.roundTo(S,2);Q=d.roundTo(Q,2);Ea.translate(S,Q);(v.url||this.showHandOnHover)&&Ea.setAttr("cursor","pointer");if(!I){"none"==L&&(J=t?(this.end+1-M)*D-c:D*M+c);"3d"==L&&(t?(J=(this.end+1-M)*D-c-1E3*this.depthCount,wa+=H*this.columnIndex,ja+=H*this.columnIndex,v.y+=H*this.columnIndex):(J=(D-c)*(M+1)+1E3*this.depthCount,Da+=R*this.columnIndex,ka+=R*this.columnIndex,
v.y+=R*this.columnIndex));if("regular"==L||"100%"==L)J=t?0<Ia.value?(this.end+1-M)*D+c:(this.end+1-M)*D-c:0<Ia.value?D*M+c:D*M-c;this.columnsArray.push({column:ua,depth:J});v.x=t?Q+K/2:S+K/2;this.ownColumns.push(ua);this.animateColumns(ua,M,E,O,F,N);this.addListeners(Ea,v)}this.columnsSet.push(Ea)}}break;case "candlestick":if(!isNaN(ta)&&!isNaN(W)){var Xa,cb;Aa=Ha;void 0!=v.lineColor&&(Aa=v.lineColor);wa=E;ka=Da=F;ja=E;if(t){"open"==l&&(ja=O);"high"==l&&(ja=ra);"low"==l&&(ja=pa);E=d.fitToBounds(E,
0,oa);O=d.fitToBounds(O,0,oa);pa=d.fitToBounds(pa,0,oa);ra=d.fitToBounds(ra,0,oa);if(0===E&&0===O&&0===pa&&0===ra)continue;if(E==oa&&O==oa&&pa==oa&&ra==oa)continue;Q=F-k/2;S=O;K=k;Q+K>q&&(K=q-Q);0>Q&&(K+=Q,Q=0);if(Q<q&&0<K){var Fb,Gb;W>ta?(Fb=[E,ra],Gb=[O,pa]):(Fb=[O,ra],Gb=[E,pa]);!isNaN(ra)&&!isNaN(pa)&&F<q&&0<F&&(Xa=d.line(h,Fb,[F,F],Aa,X,ca),cb=d.line(h,Gb,[F,F],Aa,X,ca));aa=E-O;ua=new d.Cuboid(h,aa,K,H,R,Ma,Ya,ca,Aa,X,ga,u,t,da,bb,mb,Z)}}else{"open"==l&&(ka=N);"high"==l&&(ka=sa);"low"==l&&(ka=
qa);F=d.fitToBounds(F,0,Fa);N=d.fitToBounds(N,0,Fa);qa=d.fitToBounds(qa,0,Fa);sa=d.fitToBounds(sa,0,Fa);if(0===F&&0===N&&0===qa&&0===sa)continue;if(F==Fa&&N==Fa&&qa==Fa&&sa==Fa)continue;S=E-k/2;Q=N+ca/2;K=k;S+K>n&&(K=n-S);0>S&&(K+=S,S=0);aa=F-N;if(S<n&&0<K){Db&&W>=ta&&(Va=0);var ua=new d.Cuboid(h,K,aa,H,R,Ma,Va,ca,Aa,X,ga,u,t,da,bb,mb,Z),Hb,Ib;W>ta?(Hb=[F,sa],Ib=[N,qa]):(Hb=[N,sa],Ib=[F,qa]);!isNaN(sa)&&!isNaN(qa)&&E<n&&0<E&&(Xa=d.line(h,[E,E],Hb,Aa,X,ca),cb=d.line(h,[E,E],Ib,Aa,X,ca),d.setCN(a,Xa,
this.bcn+"line-high"),v.className&&d.setCN(a,Xa,v.className,!0),d.setCN(a,cb,this.bcn+"line-low"),v.className&&d.setCN(a,cb,v.className,!0))}}ua&&(Ea=ua.set,v.columnGraphics=Ea,fa.push(Ea),Ea.translate(S,Q-ca/2),(v.url||this.showHandOnHover)&&Ea.setAttr("cursor","pointer"),Xa&&(fa.push(Xa),fa.push(cb)),I||(v.x=t?Q+K/2:S+K/2,this.animateColumns(ua,M,E,O,F,N),this.addListeners(Ea,v)))}break;case "ohlc":if(!(isNaN(ta)||isNaN(Bb)||isNaN(Cb)||isNaN(W))){var Tb=h.set();fa.push(Tb);W<ta&&(v.isNegative=!0,
void 0!=Ja&&(Ha=Ja));var pb,qb,rb;if(t){ka=F;ja=E;"open"==l&&(ja=O);"high"==l&&(ja=ra);"low"==l&&(ja=pa);pa=d.fitToBounds(pa,0,oa);ra=d.fitToBounds(ra,0,oa);if(0===E&&0===O&&0===pa&&0===ra)continue;if(E==oa&&O==oa&&pa==oa&&ra==oa)continue;var Jb=F-k/2,Jb=d.fitToBounds(Jb,0,q),Ub=d.fitToBounds(F,0,q),Kb=F+k/2,Kb=d.fitToBounds(Kb,0,q);0<=O&&O<=oa&&(qb=d.line(h,[O,O],[Jb,Ub],Ha,X,ca,da));0<F&&F<q&&(pb=d.line(h,[pa,ra],[F,F],Ha,X,ca,da));0<=E&&E<=oa&&(rb=d.line(h,[E,E],[Ub,Kb],Ha,X,ca,da))}else{ka=F;
"open"==l&&(ka=N);"high"==l&&(ka=sa);"low"==l&&(ka=qa);var ja=E,qa=d.fitToBounds(qa,0,Fa),sa=d.fitToBounds(sa,0,Fa),Lb=E-k/2,Lb=d.fitToBounds(Lb,0,n),Vb=d.fitToBounds(E,0,n),Mb=E+k/2,Mb=d.fitToBounds(Mb,0,n);0<=N&&N<=Fa&&(qb=d.line(h,[Lb,Vb],[N,N],Ha,X,ca,da));0<E&&E<n&&(pb=d.line(h,[E,E],[qa,sa],Ha,X,ca,da));0<=F&&F<=Fa&&(rb=d.line(h,[Vb,Mb],[F,F],Ha,X,ca,da))}fa.push(qb);fa.push(pb);fa.push(rb);d.setCN(a,qb,this.bcn+"stroke-open");d.setCN(a,rb,this.bcn+"stroke-close");d.setCN(a,pb,this.bcn+"stroke");
v.className&&d.setCN(a,Tb,v.className,!0);wa=E;Da=F}}if(!I&&!isNaN(W)){var Wb=this.hideBulletsCount;if(this.end-this.start<=Wb||0===Wb){var Xb=this.createBullet(v,ja,ka,M),Yb=this.labelText;if(Yb&&!isNaN(wa)&&!isNaN(wa)){var ic=this.createLabel(v,Yb),Zb=0;Xb&&(Zb=Xb.size);this.positionLabel(v,wa,Da,ic,Zb)}if("regular"==L||"100%"==L){var $b=f.totalText;if($b){var Na=this.createLabel(v,$b,f.totalTextColor);d.setCN(a,Na,this.bcn+"label-total");this.allBullets.push(Na);if(Na){var ac=Na.getBBox(),bc=ac.width,
cc=ac.height,db,eb,sb=f.totalTextOffset,dc=f.totals[M];dc&&dc.remove();var fb=0;"column"!=g&&(fb=this.bulletSize);t?(eb=Da,db=0>W?E-bc/2-2-fb-sb:E+bc/2+3+fb+sb):(db=wa,eb=0>W?F+cc/2+fb+sb:F-cc/2-3-fb-sb);Na.translate(db,eb);f.totals[M]=Na;t?(0>eb||eb>q)&&Na.remove():(0>db||db>n)&&Na.remove()}}}}}}}if("line"==g||"step"==g||"smoothedLine"==g)"smoothedLine"==g?this.drawSmoothedGraph(x,w,U,V):this.drawLineGraph(x,w,U,V),I||this.launchAnimation();this.bulletsHidden&&this.hideBullets();this.customBulletsHidden&&
this.hideCustomBullets()},animateColumns:function(a,b){var c=this,e=c.chart.startDuration;0<e&&!c.animationPlayed&&(c.seqAn?(a.set.hide(),c.animationArray.push(a),e=setTimeout(function(){c.animate.call(c)},e/(c.end-c.start+1)*(b-c.start)*1E3),c.timeOuts.push(e)):c.animate(a),c.chart.animatable.push(a))},createLabel:function(a,b,c){var e=this.chart,h=a.labelColor;h||(h=this.color);h||(h=e.color);c&&(h=c);c=this.fontSize;void 0===c&&(this.fontSize=c=e.fontSize);var f=this.labelFunction;b=e.formatString(b,
a);b=d.cleanFromEmpty(b);f&&(b=f(a,b));if(void 0!==b&&""!==b)return a=d.text(this.container,b,h,e.fontFamily,c),a.node.style.pointerEvents="none",d.setCN(e,a,this.bcn+"label"),this.bulletSet.push(a),a},positiveClip:function(a){a.clipRect(this.pmx,this.pmy,this.pmw,this.pmh)},negativeClip:function(a){a.clipRect(this.nmx,this.nmy,this.nmw,this.nmh)},drawLineGraph:function(a,b,c,e){var h=this;if(1<a.length){var f=h.noRounding,g=h.set,k=h.chart,l=h.container,m=l.set(),n=l.set();g.push(n);g.push(m);var q=
h.lineAlpha,p=h.lineThickness,g=h.fillAlphas,t=h.lineColorR,r=h.negativeLineAlpha;isNaN(r)&&(r=q);var u=h.lineColorSwitched;u&&(t=u);var u=h.fillColorsR,y=h.fillColorsSwitched;y&&(u=y);var x=h.dashLength;(y=h.dashLengthSwitched)&&(x=y);var y=h.negativeLineColor,w=h.negativeFillColors,B=h.negativeFillAlphas,z=h.baseCoord;0!==h.negativeBase&&(z=h.valueAxis.getCoordinate(h.negativeBase,f),z>h.height&&(z=h.height),0>z&&(z=0));q=d.line(l,a,b,t,q,p,x,!1,!0,f);d.setCN(k,q,h.bcn+"stroke");m.push(q);m.click(function(a){h.handleGraphEvent(a,
"clickGraph")}).mouseover(function(a){h.handleGraphEvent(a,"rollOverGraph")}).mouseout(function(a){h.handleGraphEvent(a,"rollOutGraph")}).touchmove(function(a){h.chart.handleMouseMove(a)}).touchend(function(a){h.chart.handleTouchEnd(a)});void 0===y||h.useNegativeColorIfDown||(p=d.line(l,a,b,y,r,p,x,!1,!0,f),d.setCN(k,p,h.bcn+"stroke"),d.setCN(k,p,h.bcn+"stroke-negative"),n.push(p));if(0<g||0<B)if(p=a.join(";").split(";"),r=b.join(";").split(";"),q=k.type,"serial"==q||"radar"==q?0<c.length?(c.reverse(),
e.reverse(),p=a.concat(c),r=b.concat(e)):"radar"==q?(r.push(0),p.push(0)):h.rotate?(r.push(r[r.length-1]),p.push(z),r.push(r[0]),p.push(z),r.push(r[0]),p.push(p[0])):(p.push(p[p.length-1]),r.push(z),p.push(p[0]),r.push(z),p.push(a[0]),r.push(r[0])):"xy"==q&&(b=h.fillToAxis)&&(d.isString(b)&&(b=k.getValueAxisById(b)),"H"==b.orientation?(z="top"==b.position?0:b.height,p.push(p[p.length-1]),r.push(z),p.push(p[0]),r.push(z),p.push(a[0]),r.push(r[0])):(z="left"==b.position?0:b.width,r.push(r[r.length-
1]),p.push(z),r.push(r[0]),p.push(z),r.push(r[0]),p.push(p[0]))),a=h.gradientRotation,0<g&&(b=d.polygon(l,p,r,u,g,1,"#000",0,a,f),b.pattern(h.pattern,NaN,k.path),d.setCN(k,b,h.bcn+"fill"),m.push(b)),w||void 0!==y)isNaN(B)&&(B=g),w||(w=y),f=d.polygon(l,p,r,w,B,1,"#000",0,a,f),d.setCN(k,f,h.bcn+"fill"),d.setCN(k,f,h.bcn+"fill-negative"),f.pattern(h.pattern,NaN,k.path),n.push(f),n.click(function(a){h.handleGraphEvent(a,"clickGraph")}).mouseover(function(a){h.handleGraphEvent(a,"rollOverGraph")}).mouseout(function(a){h.handleGraphEvent(a,
"rollOutGraph")}).touchmove(function(a){h.chart.handleMouseMove(a)}).touchend(function(a){h.chart.handleTouchEnd(a)});h.applyMask(n,m)}},applyMask:function(a,b){var c=a.length();"serial"!=this.chart.type||this.scrollbar||(this.positiveClip(b),0<c&&this.negativeClip(a))},drawSmoothedGraph:function(a,b,c,e){if(1<a.length){var h=this.set,f=this.chart,g=this.container,k=g.set(),l=g.set();h.push(l);h.push(k);var m=this.lineAlpha,n=this.lineThickness,h=this.dashLength,q=this.fillAlphas,p=this.lineColorR,
t=this.fillColorsR,r=this.negativeLineColor,u=this.negativeFillColors,y=this.negativeFillAlphas,x=this.baseCoord,w=this.lineColorSwitched;w&&(p=w);(w=this.fillColorsSwitched)&&(t=w);w=this.negativeLineAlpha;isNaN(w)&&(w=m);m=new d.Bezier(g,a,b,p,m,n,t,0,h);d.setCN(f,m,this.bcn+"stroke");k.push(m.path);void 0!==r&&(n=new d.Bezier(g,a,b,r,w,n,t,0,h),d.setCN(f,n,this.bcn+"stroke"),d.setCN(f,n,this.bcn+"stroke-negative"),l.push(n.path));0<q&&(m=a.join(";").split(";"),p=b.join(";").split(";"),n="",0<c.length?
(c.push("M"),e.push("M"),c.reverse(),e.reverse(),m=a.concat(c),p=b.concat(e)):(this.rotate?(n+=" L"+x+","+b[b.length-1],n+=" L"+x+","+b[0]):(n+=" L"+a[a.length-1]+","+x,n+=" L"+a[0]+","+x),n+=" L"+a[0]+","+b[0]),c=new d.Bezier(g,m,p,NaN,0,0,t,q,h,n),d.setCN(f,c,this.bcn+"fill"),c.path.pattern(this.pattern,NaN,f.path),k.push(c.path),u||void 0!==r)&&(y||(y=q),u||(u=r),a=new d.Bezier(g,a,b,NaN,0,0,u,y,h,n),a.path.pattern(this.pattern,NaN,f.path),d.setCN(f,a,this.bcn+"fill"),d.setCN(f,a,this.bcn+"fill-negative"),
l.push(a.path));this.applyMask(l,k)}},launchAnimation:function(){var a=this,b=a.chart.startDuration;if(0<b&&!a.animationPlayed){var c=a.set,e=a.bulletSet;d.VML||(c.attr({opacity:a.startAlpha}),e.attr({opacity:a.startAlpha}));c.hide();e.hide();a.seqAn?(b=setTimeout(function(){a.animateGraphs.call(a)},a.index*b*1E3),a.timeOuts.push(b)):a.animateGraphs()}},animateGraphs:function(){var a=this.chart,b=this.set,c=this.bulletSet,e=this.x,d=this.y;b.show();c.show();var f=a.startDuration,g=a.startEffect;b&&
(this.rotate?(b.translate(-1E3,d),c.translate(-1E3,d)):(b.translate(e,-1E3),c.translate(e,-1E3)),b.animate({opacity:1,translate:e+","+d},f,g),c.animate({opacity:1,translate:e+","+d},f,g),a.animatable.push(b))},animate:function(a){var b=this.chart,c=this.animationArray;!a&&0<c.length&&(a=c[0],c.shift());c=d[d.getEffect(b.startEffect)];b=b.startDuration;a&&(this.rotate?a.animateWidth(b,c):a.animateHeight(b,c),a.set.show())},legendKeyColor:function(){var a=this.legendColor,b=this.lineAlpha;void 0===
a&&(a=this.lineColorR,0===b&&(b=this.fillColorsR)&&(a="object"==typeof b?b[0]:b));return a},legendKeyAlpha:function(){var a=this.legendAlpha;void 0===a&&(a=this.lineAlpha,this.fillAlphas>a&&(a=this.fillAlphas),0===a&&(a=this.bulletAlpha),0===a&&(a=1));return a},createBullet:function(a,b,c){if(!isNaN(b)&&!isNaN(c)&&("none"!=this.bullet||this.customBullet||a.bullet||a.customBullet)){var e=this.chart,h=this.container,f=this.bulletOffset,g=this.bulletSize;isNaN(a.bulletSize)||(g=a.bulletSize);var k=a.values.value,
l=this.maxValue,m=this.minValue,n=this.maxBulletSize,q=this.minBulletSize;isNaN(l)||(isNaN(k)||(g=(k-m)/(l-m)*(n-q)+q),m==l&&(g=n));l=g;this.bulletAxis&&(g=a.values.error,isNaN(g)||(k=g),g=this.bulletAxis.stepWidth*k);g<this.minBulletSize&&(g=this.minBulletSize);this.rotate?b=a.isNegative?b-f:b+f:c=a.isNegative?c+f:c-f;q=this.bulletColorR;a.lineColor&&(this.bulletColorSwitched=a.lineColor);this.bulletColorSwitched&&(q=this.bulletColorSwitched);a.isNegative&&void 0!==this.bulletColorNegative&&(q=this.bulletColorNegative);
void 0!==a.color&&(q=a.color);var p;"xy"==e.type&&this.valueField&&(p=this.pattern,a.pattern&&(p=a.pattern));f=this.bullet;a.bullet&&(f=a.bullet);var k=this.bulletBorderThickness,m=this.bulletBorderColorR,n=this.bulletBorderAlpha,t=this.bulletAlpha;m||(m=q);this.useLineColorForBulletBorder&&(m=this.lineColorR,this.lineColorSwitched&&(m=this.lineColorSwitched));var r=a.alpha;isNaN(r)||(t=r);p=d.bullet(h,f,g,q,t,k,m,n,l,0,p,e.path);l=this.customBullet;a.customBullet&&(l=a.customBullet);l&&(p&&p.remove(),
"function"==typeof l?(l=new l,l.chart=e,a.bulletConfig&&(l.availableSpace=c,l.graph=this,l.graphDataItem=a,l.bulletY=c,a.bulletConfig.minCoord=this.minCoord-c,l.bulletConfig=a.bulletConfig),l.write(h),p&&l.showBullet&&l.set.push(p),a.customBulletGraphics=l.cset,p=l.set):(p=h.set(),h=h.image(l,0,0,g,g),p.push(h),this.centerCustomBullets&&h.translate(-g/2,-g/2)));if(p){(a.url||this.showHandOnHover)&&p.setAttr("cursor","pointer");if("serial"==e.type||"gantt"==e.type)if(-.5>b||b>this.width||c<-g/2||c>
this.height)p.remove(),p=null;p&&(this.bulletSet.push(p),p.translate(b,c),this.addListeners(p,a),this.allBullets.push(p));a.bx=b;a.by=c;d.setCN(e,p,this.bcn+"bullet");a.className&&d.setCN(e,p,a.className,!0)}p?(p.size=g||0,a.bulletGraphics=p):p={size:0};p.graphDataItem=a;return p}},showBullets:function(){var a=this.allBullets,b;this.bulletsHidden=!1;for(b=0;b<a.length;b++)a[b].show()},hideBullets:function(){var a=this.allBullets,b;this.bulletsHidden=!0;for(b=0;b<a.length;b++)a[b].hide()},showCustomBullets:function(){var a=
this.allBullets,b;this.customBulletsHidden=!1;for(b=0;b<a.length;b++){var c=a[b].graphDataItem;c.customBulletGraphics&&c.customBulletGraphics.show()}},hideCustomBullets:function(){var a=this.allBullets,b;this.customBulletsHidden=!0;for(b=0;b<a.length;b++){var c=a[b].graphDataItem;c.customBulletGraphics&&c.customBulletGraphics.hide()}},addListeners:function(a,b){var c=this;a.mouseover(function(a){c.handleRollOver(b,a)}).mouseout(function(a){c.handleRollOut(b,a)}).touchend(function(a){c.handleRollOver(b,
a);c.chart.panEventsEnabled&&c.handleClick(b,a)}).touchstart(function(a){c.handleRollOver(b,a)}).click(function(a){c.handleClick(b,a)}).dblclick(function(a){c.handleDoubleClick(b,a)}).contextmenu(function(a){c.handleRightClick(b,a)})},handleRollOver:function(a,b){this.handleGraphEvent(b,"rollOverGraph");if(a){var c=this.chart,e={type:"rollOverGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire(e);c.fire(e);clearTimeout(c.hoverInt);(c=c.chartCursor)&&c.valueBalloonsEnabled||
this.showGraphBalloon(a,"V",!0)}},handleRollOut:function(a,b){if(a){var c={type:"rollOutGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire(c);this.chart.fire(c)}this.handleGraphEvent(b,"rollOutGraph");(c=this.chart.chartCursor)&&c.valueBalloonsEnabled||this.hideBalloon()},handleClick:function(a,b){if(a){var c={type:"clickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire(c);this.chart.fire(c);d.getURL(a.url,this.urlTarget)}this.handleGraphEvent(b,
"clickGraph")},handleGraphEvent:function(a,b){var c={type:b,graph:this,target:this,chart:this.chart,event:a};this.fire(c);this.chart.fire(c)},handleRightClick:function(a,b){if(a){var c={type:"rightClickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire(c);this.chart.fire(c)}},handleDoubleClick:function(a,b){if(a){var c={type:"doubleClickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire(c);this.chart.fire(c)}},zoom:function(a,
b){this.start=a;this.end=b;this.draw()},changeOpacity:function(a){var b=this.set;b&&b.setAttr("opacity",a);if(b=this.ownColumns){var c;for(c=0;c<b.length;c++){var e=b[c].set;e&&e.setAttr("opacity",a)}}(b=this.bulletSet)&&b.setAttr("opacity",a)},destroy:function(){d.remove(this.set);d.remove(this.bulletSet);var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]},createBalloon:function(){var a=this.chart;this.balloon?this.balloon.destroy&&this.balloon.destroy():this.balloon=
{};var b=this.balloon;d.extend(b,a.balloon,!0);b.chart=a;b.mainSet=a.plotBalloonsSet},hideBalloon:function(){var a=this,b=a.chart;b.chartCursor?b.chartCursor.valueBalloonsEnabled||b.hideBalloon():b.hideBalloon();clearTimeout(a.hoverInt);a.hoverInt=setTimeout(function(){a.hideBalloonReal.call(a)},b.hideBalloonTime)},hideBalloonReal:function(){this.balloon&&this.balloon.hide();this.fixBulletSize()},fixBulletSize:function(){if(d.isModern){var a=this.resizedDItem;if(a){var b=a.bulletGraphics;b&&!b.doNotScale&&
(b.translate(a.bx,a.by,1),b.setAttr("fill-opacity",this.bulletAlpha),b.setAttr("stroke-opacity",this.bulletBorderAlpha))}this.resizedDItem=null}},showGraphBalloon:function(a,b,c,e,h){var f=this.chart,g=this.balloon,k=0,l=0,m=f.chartCursor,n=!0;m?m.valueBalloonsEnabled||(g=f.balloon,k=this.x,l=this.y,n=!1):(g=f.balloon,k=this.x,l=this.y,n=!1);clearTimeout(this.hoverInt);f.chartCursor&&(this.currentDataItem=a);this.resizeBullet(a,e,h);if(g&&g.enabled&&this.showBalloon&&!this.hidden){var m=f.formatString(this.balloonText,
a,!0),q=this.balloonFunction;q&&(m=q(a,a.graph));m&&(m=d.cleanFromEmpty(m));m&&""!==m?(e=f.getBalloonColor(this,a),g.drop||(g.pointerOrientation=b),b=a.x,h=a.y,f.rotate&&(b=a.y,h=a.x),b+=k,h+=l,isNaN(b)||isNaN(h)?this.hideBalloonReal():(a=this.width,q=this.height,n&&g.setBounds(k,l,a+k,q+l),g.changeColor(e),g.setPosition(b,h),g.fixPrevious(),g.fixedPosition&&(c=!1),!c&&"radar"!=f.type&&(b<k||b>a+k||h<l||h>q+l)?(g.showBalloon(m),g.hide(0)):(g.followCursor(c),g.showBalloon(m)))):(this.hideBalloonReal(),
this.resizeBullet(a,e,h))}else this.hideBalloonReal()},resizeBullet:function(a,b,c){this.fixBulletSize();if(a&&d.isModern&&(1!=b||!isNaN(c))){var e=a.bulletGraphics;e&&!e.doNotScale&&(e.translate(a.bx,a.by,b),isNaN(c)||(e.setAttr("fill-opacity",c),e.setAttr("stroke-opacity",c)),this.resizedDItem=a)}}})})();
(function(){var d=window.AmCharts;d.ChartCursor=d.Class({construct:function(a){this.cname="ChartCursor";this.createEvents("changed","zoomed","onHideCursor","onShowCursor","draw","selected","moved","panning","zoomStarted");this.enabled=!0;this.cursorAlpha=1;this.selectionAlpha=.2;this.cursorColor="#CC0000";this.categoryBalloonAlpha=1;this.color="#FFFFFF";this.type="cursor";this.zoomed=!1;this.zoomable=!0;this.pan=!1;this.categoryBalloonDateFormat="MMM DD, YYYY";this.categoryBalloonText="[[category]]";
this.categoryBalloonEnabled=this.valueBalloonsEnabled=!0;this.rolledOver=!1;this.cursorPosition="middle";this.bulletsEnabled=this.skipZoomDispatch=!1;this.bulletSize=8;this.selectWithoutZooming=this.oneBalloonOnly=!1;this.graphBulletSize=1.7;this.animationDuration=.3;this.zooming=!1;this.adjustment=0;this.avoidBalloonOverlapping=!0;this.leaveCursor=!1;this.leaveAfterTouch=!0;this.valueZoomable=!1;this.balloonPointerOrientation="horizontal";this.hLineEnabled=this.vLineEnabled=!0;this.vZoomEnabled=
this.hZoomEnabled=!1;d.applyTheme(this,a,this.cname)},draw:function(){this.destroy();var a=this.chart;a.panRequired=!0;var b=a.container;this.rotate=a.rotate;this.container=b;this.prevLineHeight=this.prevLineWidth=NaN;b=b.set();b.translate(this.x,this.y);this.set=b;a.cursorSet.push(b);this.createElements();d.isString(this.limitToGraph)&&(this.limitToGraph=d.getObjById(a.graphs,this.limitToGraph),this.fullWidth=!1,this.cursorPosition="middle");this.pointer=this.balloonPointerOrientation.substr(0,1).toUpperCase();
this.isHidden=!1;this.hideLines();this.valueLineAxis||(this.valueLineAxis=a.valueAxes[0])},createElements:function(){var a=this.chart,b=a.dx,c=a.dy,e=this.width,h=this.height,f,g,k=this.cursorAlpha;f=this.valueLineAlpha;this.rotate?g=k:(g=f,f=k);"xy"==a.type&&(f=g=k);this.vvLine=d.line(this.container,[b,0,0],[c,0,h],this.cursorColor,f,1);d.setCN(a,this.vvLine,"cursor-line");d.setCN(a,this.vvLine,"cursor-line-vertical");this.hhLine=d.line(this.container,[0,e,e+b],[0,0,c],this.cursorColor,g,1);d.setCN(a,
this.hhLine,"cursor-line");d.setCN(a,this.hhLine,"cursor-line-horizontal");this.vLine=this.rotate?this.vvLine:this.hhLine;this.set.push(this.vvLine);this.set.push(this.hhLine);this.set.node.style.pointerEvents="none";this.fullLines=this.container.set();a=a.cursorLineSet;a.push(this.fullLines);a.translate(this.x,this.y);a.clipRect(0,0,e,h);this.set.clipRect(0,0,e,h)},update:function(){var a=this.chart,b=a.mouseX-this.x,c=a.mouseY-this.y;this.mouseX=b;this.mouseY=c;this.mouse2X=a.mouse2X-this.x;this.mouse2Y=
a.mouse2Y-this.y;var e;if(a.chartData&&0<a.chartData.length){this.mouseIsOver()?(this.hideGraphBalloons=!1,this.rolledOver=e=!0,this.updateDrawing(),this.vvLine&&isNaN(this.fx)&&(a.rotate||!this.limitToGraph)&&this.vvLine.translate(b,0),!this.hhLine||!isNaN(this.fy)||a.rotate&&this.limitToGraph||this.hhLine.translate(0,c),isNaN(this.mouse2X)?this.dispatchMovedEvent(b,c):e=!1):this.forceShow||this.hideCursor();if(this.zooming){if(!isNaN(this.mouse2X)){isNaN(this.mouse2X0)||this.dispatchPanEvent();
return}if(this.pan){this.dispatchPanEvent();return}(this.hZoomEnabled||this.vZoomEnabled)&&this.zooming&&this.updateSelection()}e&&this.showCursor()}},updateDrawing:function(){this.drawing&&this.chart.setMouseCursor("crosshair");this.drawingNow&&(d.remove(this.drawingLine),this.drawingLine=d.line(this.container,[this.drawStartX,this.mouseX],[this.drawStartY,this.mouseY],this.cursorColor,1,1))},fixWidth:function(a){if(this.fullWidth&&this.prevLineWidth!=a){var b=this.vvLine,c=0;b&&(b.remove(),c=b.x);
b=this.container.set();b.translate(c,0);c=d.rect(this.container,a,this.height,this.cursorColor,this.cursorAlpha,0);d.setCN(this.chart,c,"cursor-fill");c.translate(-a/2,0);b.push(c);this.vvLine=b;this.fullLines.push(b);this.prevLineWidth=a}},fixHeight:function(a){if(this.fullWidth&&this.prevLineHeight!=a){var b=this.hhLine,c=0;b&&(b.remove(),c=b.y);b=this.container.set();b.translate(0,c);c=d.rect(this.container,this.width,a,this.cursorColor,this.cursorAlpha);c.translate(0,-a/2);b.push(c);this.fullLines.push(b);
this.hhLine=b;this.prevLineHeight=a}},fixVLine:function(a,b){if(!isNaN(a)){if(isNaN(this.prevLineX)){var c=0,e=this.mouseX;if(this.limitToGraph){var d=this.chart.categoryAxis;d&&(this.chart.rotate||(c="bottom"==d.position?this.height:-this.height),e=a)}this.vvLine.translate(e,c)}else this.prevLineX!=a&&this.vvLine.translate(this.prevLineX,this.prevLineY);this.fx=a;this.prevLineX!=a&&(c=this.animationDuration,this.zooming&&(c=0),this.vvLine.stop(),this.vvLine.animate({translate:a+","+b},c,"easeOutSine"),
this.prevLineX=a,this.prevLineY=b)}},fixHLine:function(a,b){if(!isNaN(a)){if(isNaN(this.prevLineY)){var c=0,e=this.mouseY;if(this.limitToGraph){var d=this.chart.categoryAxis;d&&(this.chart.rotate&&(c="right"==d.position?this.width:-this.width),e=a)}this.hhLine.translate(c,e)}else this.prevLineY!=a&&this.hhLine.translate(this.prevLineX,this.prevLineY);this.fy=a;this.prevLineY!=a&&(c=this.animationDuration,this.zooming&&(c=0),this.hhLine.stop(),this.hhLine.animate({translate:b+","+a},c,"easeOutSine"),
this.prevLineY=a,this.prevLineX=b)}},hideCursor:function(a){this.forceShow=!1;this.chart.wasTouched&&this.leaveAfterTouch||this.isHidden||this.leaveCursor||(this.hideLines(),this.isHidden=!0,this.index=this.prevLineY=this.prevLineX=this.mouseY0=this.mouseX0=this.fy=this.fx=NaN,a?this.chart.handleCursorHide():this.fire({target:this,chart:this.chart,type:"onHideCursor"}),this.chart.setMouseCursor("auto"))},hideLines:function(){this.vvLine&&this.vvLine.hide();this.hhLine&&this.hhLine.hide();this.fullLines&&
this.fullLines.hide();this.isHidden=!0;this.chart.handleCursorHide()},showCursor:function(a){this.drawing||(this.vLineEnabled&&this.vvLine&&this.vvLine.show(),this.hLineEnabled&&this.hhLine&&this.hhLine.show(),this.isHidden=!1,this.updateFullLine(),a||this.fire({target:this,chart:this.chart,type:"onShowCursor"}),this.pan&&this.chart.setMouseCursor("move"))},updateFullLine:function(){this.zooming&&this.fullWidth&&this.selection&&(this.rotate?0<this.selection.height&&this.hhLine.hide():0<this.selection.width&&
this.vvLine.hide())},updateSelection:function(){if(!this.pan){var a=this.mouseX,b=this.mouseY;isNaN(this.fx)||(a=this.fx);isNaN(this.fy)||(b=this.fy);this.clearSelection();var c=this.mouseX0,e=this.mouseY0,h=this.width,f=this.height,a=d.fitToBounds(a,0,h),b=d.fitToBounds(b,0,f),g;a<c&&(g=a,a=c,c=g);b<e&&(g=b,b=e,e=g);this.hZoomEnabled?h=a-c:c=0;this.vZoomEnabled?f=b-e:e=0;isNaN(this.mouse2X)&&0<Math.abs(h)&&0<Math.abs(f)&&(a=this.chart,b=d.rect(this.container,h,f,this.cursorColor,this.selectionAlpha),
d.setCN(a,b,"cursor-selection"),b.width=h,b.height=f,b.translate(c,e),this.set.push(b),this.selection=b);this.updateFullLine()}},mouseIsOver:function(){var a=this.mouseX,b=this.mouseY;if(this.justReleased)return this.justReleased=!1,!0;if(this.mouseIsDown)return!0;if(!this.chart.mouseIsOver)return this.handleMouseOut(),!1;if(0<a&&a<this.width&&0<b&&b<this.height)return!0;this.handleMouseOut()},fixPosition:function(){this.prevY=this.prevX=NaN},handleMouseDown:function(){this.update();if(this.mouseIsOver())if(this.mouseIsDown=
!0,this.mouseX0=this.mouseX,this.mouseY0=this.mouseY,this.mouse2X0=this.mouse2X,this.mouse2Y0=this.mouse2Y,this.drawing)this.drawStartY=this.mouseY,this.drawStartX=this.mouseX,this.drawingNow=!0;else if(this.dispatchMovedEvent(this.mouseX,this.mouseY),!this.pan&&isNaN(this.mouse2X0)&&(isNaN(this.fx)||(this.mouseX0=this.fx),isNaN(this.fy)||(this.mouseY0=this.fy)),this.hZoomEnabled||this.vZoomEnabled){this.zooming=!0;var a={chart:this.chart,target:this,type:"zoomStarted"};a.x=this.mouseX/this.width;
a.y=this.mouseY/this.height;this.index0=a.index=this.index;this.timestamp0=this.timestamp;this.fire(a)}},registerInitialMouse:function(){},handleReleaseOutside:function(){this.mouseIsDown=!1;if(this.drawingNow){this.drawingNow=!1;d.remove(this.drawingLine);var a=this.drawStartX,b=this.drawStartY,c=this.mouseX,e=this.mouseY,h=this.chart;(2<Math.abs(a-c)||2<Math.abs(b-e))&&this.fire({type:"draw",target:this,chart:h,initialX:a,initialY:b,finalX:c,finalY:e})}this.zooming&&(this.zooming=!1,this.selectWithoutZooming?
this.dispatchZoomEvent("selected"):(this.hZoomEnabled||this.vZoomEnabled)&&this.dispatchZoomEvent("zoomed"),this.rolledOver&&this.dispatchMovedEvent(this.mouseX,this.mouseY));this.mouse2Y0=this.mouse2X0=this.mouseY0=this.mouseX0=NaN},dispatchZoomEvent:function(a){if(!this.pan){var b=this.selection;if(b&&3<Math.abs(b.width)&&3<Math.abs(b.height)){var c=Math.min(this.index,this.index0),e=Math.max(this.index,this.index0),d=c,f=e,g=this.chart,k=g.chartData,l=g.categoryAxis;l&&l.parseDates&&!l.equalSpacing&&
(d=k[c]?k[c].time:Math.min(this.timestamp0,this.timestamp),f=k[e]?g.getEndTime(k[e].time):Math.max(this.timestamp0,this.timestamp));var b={type:a,chart:this.chart,target:this,end:f,start:d,startIndex:c,endIndex:e,selectionHeight:b.height,selectionWidth:b.width,selectionY:b.y,selectionX:b.x},m;this.hZoomEnabled&&4<Math.abs(this.mouseX0-this.mouseX)&&(b.startX=this.mouseX0/this.width,b.endX=this.mouseX/this.width,m=!0);this.vZoomEnabled&&4<Math.abs(this.mouseY0-this.mouseY)&&(b.startY=1-this.mouseY0/
this.height,b.endY=1-this.mouseY/this.height,m=!0);m&&(this.prevY=this.prevX=NaN,this.fire(b),"selected"!=a&&this.clearSelection());this.hideCursor()}}},dispatchMovedEvent:function(a,b,c,e){a=Math.round(a);b=Math.round(b);if(!this.isHidden&&(a!=this.prevX||b!=this.prevY||"changed"==c)){c||(c="moved");var d=this.fx,f=this.fy;isNaN(d)&&(d=a);isNaN(f)&&(f=b);var g=!1;this.zooming&&this.pan&&(g=!0);g={hidden:this.isHidden,type:c,chart:this.chart,target:this,x:a,y:b,finalX:d,finalY:f,zooming:this.zooming,
panning:g,mostCloseGraph:this.mostCloseGraph,index:this.index,skip:e,hideBalloons:this.hideGraphBalloons};this.rotate?(g.position=b,g.finalPosition=f):(g.position=a,g.finalPosition=d);this.prevX=a;this.prevY=b;e?this.chart.handleCursorMove(g):(this.fire(g),"changed"==c&&this.chart.fire(g))}},dispatchPanEvent:function(){if(this.mouseIsDown){var a=d.roundTo((this.mouseX-this.mouseX0)/this.width,3),b=d.roundTo((this.mouseY-this.mouseY0)/this.height,3),c=d.roundTo((this.mouse2X-this.mouse2X0)/this.width,
3),e=d.roundTo((this.mouse2Y-this.mouse2Y0)/this.height,2),h=!1;0!==Math.abs(a)&&0!==Math.abs(b)&&(h=!0);if(this.prevDeltaX==a||this.prevDeltaY==b)h=!1;isNaN(c)||isNaN(e)||(0!==Math.abs(c)&&0!==Math.abs(e)&&(h=!0),this.prevDelta2X!=c&&this.prevDelta2Y!=e)||(h=!1);h&&(this.hideLines(),this.fire({type:"panning",chart:this.chart,target:this,deltaX:a,deltaY:b,delta2X:c,delta2Y:e,index:this.index}),this.prevDeltaX=a,this.prevDeltaY=b,this.prevDelta2X=c,this.prevDelta2Y=e)}},clearSelection:function(){var a=
this.selection;a&&(a.width=0,a.height=0,a.remove())},destroy:function(){this.clear();d.remove(this.selection);this.selection=null;clearTimeout(this.syncTO);d.remove(this.set)},clear:function(){},setTimestamp:function(a){this.timestamp=a},setIndex:function(a,b){a!=this.index&&(this.index=a,b||this.isHidden||this.dispatchMovedEvent(this.mouseX,this.mouseY,"changed"))},handleMouseOut:function(){this.enabled&&this.rolledOver&&(this.leaveCursor||this.setIndex(void 0),this.forceShow=!1,this.hideCursor(),
this.rolledOver=!1)},showCursorAt:function(a){var b=this.chart.categoryAxis;b&&this.setPosition(b.categoryToCoordinate(a))},setPosition:function(a){var b=this.chart,c=b.categoryAxis;if(c){var e,d,f=c.coordinateToValue(a);c.showBalloonAt(f);this.forceShow=!0;c.stickBalloonToCategory?b.rotate?this.fixHLine(a,0):this.fixVLine(a,0):(this.showCursor(),b.rotate?this.hhLine.translate(0,a):this.vvLine.translate(a,0));b.rotate?e=a:d=a;this.dispatchMovedEvent(d,e);b.rotate?(this.vvLine&&this.vvLine.hide(),
this.hhLine&&this.hhLine.show()):(this.hhLine&&this.hhLine.hide(),this.vvLine&&this.vvLine.show());this.updateFullLine();this.isHidden=!1;this.dispatchMovedEvent(d,e,"moved",!0)}},enableDrawing:function(a){this.enabled=!a;this.hideCursor();this.drawing=a},syncWithCursor:function(a,b){clearTimeout(this.syncTO);a&&(a.isHidden?this.hideCursor(!0):this.syncWithCursorReal(a,b))},isZooming:function(a){this.zooming=a},syncWithCursorReal:function(a,b){var c=a.vvLine,e=a.hhLine;this.index=a.index;this.forceShow=
!0;this.zooming&&this.pan||this.showCursor(!0);this.hideGraphBalloons=b;this.justReleased=a.justReleased;this.zooming=a.zooming;this.index0=a.index0;this.mouseX0=a.mouseX0;this.mouseY0=a.mouseY0;this.mouse2X0=a.mouse2X0;this.mouse2Y0=a.mouse2Y0;this.timestamp0=a.timestamp0;this.prevDeltaX=a.prevDeltaX;this.prevDeltaY=a.prevDeltaY;this.prevDelta2X=a.prevDelta2X;this.prevDelta2Y=a.prevDelta2Y;this.fx=a.fx;this.fy=a.fy;this.index=a.index;a.zooming&&this.updateSelection();var d=a.mouseX,f=a.mouseY;this.rotate?
(d=NaN,this.vvLine&&this.vvLine.hide(),this.hhLine&&e&&(isNaN(a.fy)?this.hhLine.translate(0,a.mouseY):this.fixHLine(a.fy,0))):(f=NaN,this.hhLine&&this.hhLine.hide(),this.vvLine&&c&&(isNaN(a.fx)?this.vvLine.translate(a.mouseX,0):this.fixVLine(a.fx,0)));this.dispatchMovedEvent(d,f,"moved",!0)}})})();
(function(){var d=window.AmCharts;d.SimpleChartScrollbar=d.Class({construct:function(a){this.createEvents("zoomed","zoomStarted","zoomEnded");this.backgroundColor="#D4D4D4";this.backgroundAlpha=1;this.selectedBackgroundColor="#EFEFEF";this.scrollDuration=this.selectedBackgroundAlpha=1;this.resizeEnabled=!0;this.hideResizeGrips=!1;this.scrollbarHeight=20;this.updateOnReleaseOnly=!1;9>document.documentMode&&(this.updateOnReleaseOnly=!0);this.dragIconHeight=this.dragIconWidth=35;this.dragIcon="dragIconRoundBig";
this.enabled=!0;this.percentStart=this.offset=0;this.percentEnd=1;d.applyTheme(this,a,"SimpleChartScrollbar")},draw:function(){var a=this;a.destroy();if(a.enabled){var b=a.chart.container,c=a.rotate,e=a.chart;e.panRequired=!0;var h=b.set();a.set=h;e.scrollbarsSet.push(h);var f,g;c?(f=a.scrollbarHeight,g=e.plotAreaHeight):(g=a.scrollbarHeight,f=e.plotAreaWidth);a.width=f;if((a.height=g)&&f){var k=d.rect(b,f,g,a.backgroundColor,a.backgroundAlpha,1,a.backgroundColor,a.backgroundAlpha);d.setCN(e,k,"scrollbar-bg");
a.bg=k;h.push(k);k=d.rect(b,f,g,"#000",.005);h.push(k);a.invisibleBg=k;k.click(function(){a.handleBgClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()}).touchend(function(){a.handleBgClick()});k=d.rect(b,f,g,a.selectedBackgroundColor,a.selectedBackgroundAlpha);d.setCN(e,k,"scrollbar-bg-selected");a.selectedBG=k;h.push(k);f=d.rect(b,f,g,"#000",.005);a.dragger=f;h.push(f);f.mousedown(function(b){a.handleDragStart(b)}).mouseup(function(){a.handleDragStop()}).mouseover(function(){a.handleDraggerOver()}).mouseout(function(){a.handleMouseOut()}).touchstart(function(b){a.handleDragStart(b)}).touchend(function(){a.handleDragStop()});
f=e.pathToImages;g=a.dragIcon.replace(/\.[a-z]*$/i,"");c?(k=f+g+"H"+e.extension,f=a.dragIconWidth,c=a.dragIconHeight):(k=f+g+e.extension,c=a.dragIconWidth,f=a.dragIconHeight);g=b.image(k,0,0,c,f);d.setCN(e,g,"scrollbar-grip-left");k=b.image(k,0,0,c,f);d.setCN(e,k,"scrollbar-grip-right");var l=10,m=20;e.panEventsEnabled&&(l=25,m=a.scrollbarHeight);var n=d.rect(b,l,m,"#000",.005),q=d.rect(b,l,m,"#000",.005);q.translate(-(l-c)/2,-(m-f)/2);n.translate(-(l-c)/2,-(m-f)/2);c=b.set([g,q]);b=b.set([k,n]);
a.iconLeft=c;h.push(a.iconLeft);a.iconRight=b;h.push(b);c.mousedown(function(){a.leftDragStart()}).mouseup(function(){a.leftDragStop()}).mouseover(function(){a.iconRollOver()}).mouseout(function(){a.iconRollOut()}).touchstart(function(){a.leftDragStart()}).touchend(function(){a.leftDragStop()});b.mousedown(function(){a.rightDragStart()}).mouseup(function(){a.rightDragStop()}).mouseover(function(){a.iconRollOver()}).mouseout(function(){a.iconRollOut()}).touchstart(function(){a.rightDragStart()}).touchend(function(){a.rightDragStop()});
d.ifArray(e.chartData)?h.show():h.hide();a.hideDragIcons();a.clipDragger(!1)}h.translate(a.x,a.y);h.node.style.msTouchAction="none";h.node.style.touchAction="none"}},updateScrollbarSize:function(a,b){if(!isNaN(a)&&!isNaN(b)){a=Math.round(a);b=Math.round(b);var c=this.dragger,e,d,f,g,k;this.rotate?(e=0,d=a,f=this.width+1,g=b-a,c.setAttr("height",b-a),c.setAttr("y",d)):(e=a,d=0,f=b-a,g=this.height+1,k=b-a,c.setAttr("x",e),c.setAttr("width",k));this.clipAndUpdate(e,d,f,g)}},update:function(){var a,b=
!1,c,e,d=this.x,f=this.y,g=this.dragger,k=this.getDBox();if(k){c=k.x+d;e=k.y+f;var l=k.width,k=k.height,m=this.rotate,n=this.chart,q=this.width,p=this.height,t=n.mouseX,r=n.mouseY;a=this.initialMouse;this.forceClip&&this.clipDragger(!0);n.mouseIsOver&&(this.dragging&&(n=this.initialCoord,m?(a=n+(r-a),0>a&&(a=0),n=p-k,a>n&&(a=n),g.setAttr("y",a)):(a=n+(t-a),0>a&&(a=0),n=q-l,a>n&&(a=n),g.setAttr("x",a)),this.clipDragger(!0)),this.resizingRight&&(m?(a=r-e,a+e>p+f&&(a=p-e+f),0>a?(this.resizingRight=!1,
b=this.resizingLeft=!0):(0===a&&(a=.1),g.setAttr("height",a))):(a=t-c,a+c>q+d&&(a=q-c+d),0>a?(this.resizingRight=!1,b=this.resizingLeft=!0):(0===a&&(a=.1),g.setAttr("width",a))),this.clipDragger(!0)),this.resizingLeft&&(m?(c=e,e=r,e<f&&(e=f),e>p+f&&(e=p+f),a=!0===b?c-e:k+c-e,0>a?(this.resizingRight=!0,this.resizingLeft=!1,g.setAttr("y",c+k-f)):(0===a&&(a=.1),g.setAttr("y",e-f),g.setAttr("height",a))):(e=t,e<d&&(e=d),e>q+d&&(e=q+d),a=!0===b?c-e:l+c-e,0>a?(this.resizingRight=!0,this.resizingLeft=!1,
g.setAttr("x",c+l-d)):(0===a&&(a=.1),g.setAttr("x",e-d),g.setAttr("width",a))),this.clipDragger(!0)))}},stopForceClip:function(){this.animating=this.forceClip=!1},clipDragger:function(a){var b=this.getDBox();if(b){var c=b.x,d=b.y,h=b.width,b=b.height,f=!1;if(this.rotate){if(c=0,h=this.width+1,this.clipY!=d||this.clipH!=b)f=!0}else if(d=0,b=this.height+1,this.clipX!=c||this.clipW!=h)f=!0;f&&(this.clipAndUpdate(c,d,h,b),a&&(this.updateOnReleaseOnly||this.dispatchScrollbarEvent()))}},maskGraphs:function(){},
clipAndUpdate:function(a,b,c,d){this.clipX=a;this.clipY=b;this.clipW=c;this.clipH=d;this.selectedBG.setAttr("width",c);this.selectedBG.setAttr("height",d);this.selectedBG.translate(a,b);this.updateDragIconPositions();this.maskGraphs(a,b,c,d)},dispatchScrollbarEvent:function(){if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart;a.hideBalloon();var b=this.getDBox(),c=b.x,d=b.y,h=b.width,f=b.height,g,k;this.rotate?(b=d,g=this.height/f,k=1-d/this.height,c=1-(d+f)/this.height):(b=c,g=this.width/
h,k=c/this.width,c=(c+h)/this.width);this.fire({type:"zoomed",position:b,chart:a,target:this,multiplier:g,relativeStart:c,relativeEnd:k})}},updateDragIconPositions:function(){var a=this.getDBox(),b=a.x,c=a.y,d=this.iconLeft,h=this.iconRight,f,g,k=this.scrollbarHeight;this.rotate?(f=this.dragIconWidth,g=this.dragIconHeight,d.translate((k-g)/2,c-f/2),h.translate((k-g)/2,c+a.height-f/2)):(f=this.dragIconHeight,g=this.dragIconWidth,d.translate(b-g/2,(k-f)/2),h.translate(b-g/2+a.width,(k-f)/2))},showDragIcons:function(){this.resizeEnabled&&
(this.iconLeft.show(),this.iconRight.show())},hideDragIcons:function(){if(!this.resizingLeft&&!this.resizingRight&&!this.dragging){if(this.hideResizeGrips||!this.resizeEnabled)this.iconLeft.hide(),this.iconRight.hide();this.removeCursors()}},removeCursors:function(){this.chart.setMouseCursor("auto")},fireZoomEvent:function(a){this.fire({type:a,chart:this.chart,target:this})},percentZoom:function(a,b){if(this.dragger&&this.enabled){this.dragger.stop();isNaN(a)&&(a=0);isNaN(b)&&(b=1);var c,d,h;this.rotate?
(c=this.height,d=c-c*b,h=c-c*a):(c=this.width,h=c*b,d=c*a);this.updateScrollbarSize(d,h);this.clipDragger(!1);this.percentStart=a;this.percentEnd=b}},destroy:function(){this.clear();d.remove(this.set);d.remove(this.iconRight);d.remove(this.iconLeft)},clear:function(){},handleDragStart:function(){if(this.enabled){this.fireZoomEvent("zoomStarted");var a=this.chart;this.dragger.stop();this.removeCursors();this.dragging=!0;var b=this.getDBox();this.rotate?(this.initialCoord=b.y,this.initialMouse=a.mouseY):
(this.initialCoord=b.x,this.initialMouse=a.mouseX)}},handleDragStop:function(){this.updateOnReleaseOnly&&(this.update(),this.skipEvent=!1,this.dispatchScrollbarEvent());this.dragging=!1;this.mouseIsOver&&this.removeCursors();this.update();this.fireZoomEvent("zoomEnded")},handleDraggerOver:function(){this.handleMouseOver()},leftDragStart:function(){this.fireZoomEvent("zoomStarted");this.dragger.stop();this.resizingLeft=!0},leftDragStop:function(){this.resizingLeft=!1;this.mouseIsOver||this.removeCursors();
this.updateOnRelease();this.fireZoomEvent("zoomEnded")},rightDragStart:function(){this.fireZoomEvent("zoomStarted");this.dragger.stop();this.resizingRight=!0},rightDragStop:function(){this.resizingRight=!1;this.mouseIsOver||this.removeCursors();this.updateOnRelease();this.fireZoomEvent("zoomEnded")},iconRollOut:function(){this.removeCursors()},iconRollOver:function(){this.rotate?this.chart.setMouseCursor("ns-resize"):this.chart.setMouseCursor("ew-resize");this.handleMouseOver()},getDBox:function(){if(this.dragger)return this.dragger.getBBox()},
handleBgClick:function(){var a=this;if(!a.resizingRight&&!a.resizingLeft){a.zooming=!0;var b,c,e=a.scrollDuration,h=a.dragger;b=a.getDBox();var f=b.height,g=b.width;c=a.chart;var k=a.y,l=a.x,m=a.rotate;m?(b="y",c=c.mouseY-f/2-k,c=d.fitToBounds(c,0,a.height-f)):(b="x",c=c.mouseX-g/2-l,c=d.fitToBounds(c,0,a.width-g));a.updateOnReleaseOnly?(a.skipEvent=!1,h.setAttr(b,c),a.dispatchScrollbarEvent(),a.clipDragger()):(a.animating=!0,c=Math.round(c),m?h.animate({y:c},e,">"):h.animate({x:c},e,">"),a.forceClip=
!0,clearTimeout(a.forceTO),a.forceTO=setTimeout(function(){a.stopForceClip.call(a)},5E3*e))}},updateOnRelease:function(){this.updateOnReleaseOnly&&(this.update(),this.skipEvent=!1,this.dispatchScrollbarEvent())},handleReleaseOutside:function(){if(this.set){if(this.resizingLeft||this.resizingRight||this.dragging)this.updateOnRelease(),this.removeCursors();this.animating=this.mouseIsOver=this.dragging=this.resizingRight=this.resizingLeft=!1;this.hideDragIcons();this.update()}},handleMouseOver:function(){this.mouseIsOver=
!0;this.showDragIcons()},handleMouseOut:function(){this.mouseIsOver=!1;this.hideDragIcons()}})})();
(function(){var d=window.AmCharts;d.ChartScrollbar=d.Class({inherits:d.SimpleChartScrollbar,construct:function(a){this.cname="ChartScrollbar";d.ChartScrollbar.base.construct.call(this,a);this.graphLineColor="#BBBBBB";this.graphLineAlpha=0;this.graphFillColor="#BBBBBB";this.graphFillAlpha=1;this.selectedGraphLineColor="#888888";this.selectedGraphLineAlpha=0;this.selectedGraphFillColor="#888888";this.selectedGraphFillAlpha=1;this.gridCount=0;this.gridColor="#FFFFFF";this.gridAlpha=.7;this.skipEvent=
this.autoGridCount=!1;this.color="#FFFFFF";this.scrollbarCreated=!1;this.oppositeAxis=!0;d.applyTheme(this,a,this.cname)},init:function(){var a=this.categoryAxis,b=this.chart,c=this.gridAxis;a||("CategoryAxis"==this.gridAxis.cname?(this.catScrollbar=!0,a=new d.CategoryAxis,a.id="scrollbar"):(a=new d.ValueAxis,a.data=b.chartData,a.id=c.id,a.type=c.type,a.maximumDate=c.maximumDate,a.minimumDate=c.minimumDate,a.minPeriod=c.minPeriod),this.categoryAxis=a);a.chart=b;a.dateFormats=c.dateFormats;a.markPeriodChange=
c.markPeriodChange;a.boldPeriodBeginning=c.boldPeriodBeginning;a.labelFunction=c.labelFunction;a.axisItemRenderer=d.RecItem;a.axisRenderer=d.RecAxis;a.guideFillRenderer=d.RecFill;a.inside=!0;a.fontSize=this.fontSize;a.tickLength=0;a.axisAlpha=0;d.isString(this.graph)&&(this.graph=d.getObjById(b.graphs,this.graph));(a=this.graph)&&this.catScrollbar&&(c=this.valueAxis,c||(this.valueAxis=c=new d.ValueAxis,c.visible=!1,c.scrollbar=!0,c.axisItemRenderer=d.RecItem,c.axisRenderer=d.RecAxis,c.guideFillRenderer=
d.RecFill,c.labelsEnabled=!1,c.chart=b),b=this.unselectedGraph,b||(b=new d.AmGraph,b.scrollbar=!0,this.unselectedGraph=b,b.negativeBase=a.negativeBase,b.noStepRisers=a.noStepRisers),b=this.selectedGraph,b||(b=new d.AmGraph,b.scrollbar=!0,this.selectedGraph=b,b.negativeBase=a.negativeBase,b.noStepRisers=a.noStepRisers));this.scrollbarCreated=!0},draw:function(){var a=this;d.ChartScrollbar.base.draw.call(a);if(a.enabled){a.scrollbarCreated||a.init();var b=a.chart,c=b.chartData,e=a.categoryAxis,h=a.rotate,
f=a.x,g=a.y,k=a.width,l=a.height,m=a.gridAxis,n=a.set;e.setOrientation(!h);e.parseDates=m.parseDates;"ValueAxis"==a.categoryAxis.cname&&(e.rotate=!h);e.equalSpacing=m.equalSpacing;e.minPeriod=m.minPeriod;e.startOnAxis=m.startOnAxis;e.width=k-1;e.height=l;e.gridCount=a.gridCount;e.gridColor=a.gridColor;e.gridAlpha=a.gridAlpha;e.color=a.color;e.tickLength=0;e.axisAlpha=0;e.autoGridCount=a.autoGridCount;e.parseDates&&!e.equalSpacing&&e.timeZoom(b.firstTime,b.lastTime);e.minimum=a.gridAxis.fullMin;e.maximum=
a.gridAxis.fullMax;e.strictMinMax=!0;e.zoom(0,c.length-1);if((m=a.graph)&&a.catScrollbar){var q=a.valueAxis,p=m.valueAxis;q.id=p.id;q.rotate=h;q.setOrientation(h);q.width=k;q.height=l;q.dataProvider=c;q.reversed=p.reversed;q.logarithmic=p.logarithmic;q.gridAlpha=0;q.axisAlpha=0;n.push(q.set);h?(q.y=g,q.x=0):(q.x=f,q.y=0);var f=Infinity,g=-Infinity,t;for(t=0;t<c.length;t++){var r=c[t].axes[p.id].graphs[m.id].values,u;for(u in r)if(r.hasOwnProperty(u)&&"percents"!=u&&"total"!=u){var y=r[u];y<f&&(f=
y);y>g&&(g=y)}}Infinity!=f&&(q.minimum=f);-Infinity!=g&&(q.maximum=g+.1*(g-f));f==g&&(--q.minimum,q.maximum+=1);void 0!==a.minimum&&(q.minimum=a.minimum);void 0!==a.maximum&&(q.maximum=a.maximum);q.zoom(0,c.length-1);u=a.unselectedGraph;u.id=m.id;u.bcn="scrollbar-graph-";u.rotate=h;u.chart=b;u.data=c;u.valueAxis=q;u.chart=m.chart;u.categoryAxis=a.categoryAxis;u.periodSpan=m.periodSpan;u.valueField=m.valueField;u.openField=m.openField;u.closeField=m.closeField;u.highField=m.highField;u.lowField=m.lowField;
u.lineAlpha=a.graphLineAlpha;u.lineColorR=a.graphLineColor;u.fillAlphas=a.graphFillAlpha;u.fillColorsR=a.graphFillColor;u.connect=m.connect;u.hidden=m.hidden;u.width=k;u.height=l;u.pointPosition=m.pointPosition;u.stepDirection=m.stepDirection;u.periodSpan=m.periodSpan;p=a.selectedGraph;p.id=m.id;p.bcn=u.bcn+"selected-";p.rotate=h;p.chart=b;p.data=c;p.valueAxis=q;p.chart=m.chart;p.categoryAxis=e;p.periodSpan=m.periodSpan;p.valueField=m.valueField;p.openField=m.openField;p.closeField=m.closeField;p.highField=
m.highField;p.lowField=m.lowField;p.lineAlpha=a.selectedGraphLineAlpha;p.lineColorR=a.selectedGraphLineColor;p.fillAlphas=a.selectedGraphFillAlpha;p.fillColorsR=a.selectedGraphFillColor;p.connect=m.connect;p.hidden=m.hidden;p.width=k;p.height=l;p.pointPosition=m.pointPosition;p.stepDirection=m.stepDirection;p.periodSpan=m.periodSpan;b=a.graphType;b||(b=m.type);u.type=b;p.type=b;c=c.length-1;u.zoom(0,c);p.zoom(0,c);p.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});
u.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});n.push(u.set);n.push(p.set)}n.push(e.set);n.push(e.labelsSet);a.bg.toBack();a.invisibleBg.toFront();a.dragger.toFront();a.iconLeft.toFront();a.iconRight.toFront()}},timeZoom:function(a,b,c){this.startTime=a;this.endTime=b;this.timeDifference=b-a;this.skipEvent=!d.toBoolean(c);this.zoomScrollbar();this.skipEvent||this.dispatchScrollbarEvent()},zoom:function(a,b){this.start=
a;this.end=b;this.skipEvent=!0;this.zoomScrollbar()},dispatchScrollbarEvent:function(){if("ValueAxis"==this.categoryAxis.cname)d.ChartScrollbar.base.dispatchScrollbarEvent.call(this);else if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart.chartData,b,c,e=this.dragger.getBBox();b=e.x;var h=e.y,f=e.width,e=e.height,g=this.chart;this.rotate?(b=h,c=e):c=f;f={type:"zoomed",target:this};f.chart=g;var k=this.categoryAxis,l=this.stepWidth,h=g.minSelectedTime,e=!1;if(k.parseDates&&!k.equalSpacing){if(a=
g.lastTime,g=g.firstTime,k=Math.round(b/l)+g,b=this.dragging?k+this.timeDifference:Math.round((b+c)/l)+g,k>b&&(k=b),0<h&&b-k<h&&(b=Math.round(k+(b-k)/2),e=Math.round(h/2),k=b-e,b+=e,e=!0),b>a&&(b=a),b-h<k&&(k=b-h),k<g&&(k=g),k+h>b&&(b=k+h),k!=this.startTime||b!=this.endTime)this.startTime=k,this.endTime=b,f.start=k,f.end=b,f.startDate=new Date(k),f.endDate=new Date(b),this.fire(f)}else if(k.startOnAxis||(b+=l/2),c-=this.stepWidth/2,h=k.xToIndex(b),b=k.xToIndex(b+c),h!=this.start||this.end!=b)k.startOnAxis&&
(this.resizingRight&&h==b&&b++,this.resizingLeft&&h==b&&(0<h?h--:b=1)),this.start=h,this.end=this.dragging?this.start+this.difference:b,f.start=this.start,f.end=this.end,k.parseDates&&(a[this.start]&&(f.startDate=new Date(a[this.start].time)),a[this.end]&&(f.endDate=new Date(a[this.end].time))),this.fire(f);e&&this.zoomScrollbar()}},zoomScrollbar:function(){if(!(this.dragging||this.resizingLeft||this.resizingRight||this.animating)&&this.dragger&&this.enabled){var a,b;a=this.chart;var c=a.chartData,
d=this.categoryAxis;d.parseDates&&!d.equalSpacing?(c=d.stepWidth,d=a.firstTime,a=c*(this.startTime-d),b=c*(this.endTime-d)):(a=c[this.start].x[d.id],b=c[this.end].x[d.id],c=d.stepWidth,d.startOnAxis||(d=c/2,a-=d,b+=d));this.stepWidth=c;this.updateScrollbarSize(a,b)}},maskGraphs:function(a,b,c,d){var h=this.selectedGraph;h&&h.set.clipRect(a,b,c,d)},handleDragStart:function(){d.ChartScrollbar.base.handleDragStart.call(this);this.difference=this.end-this.start;this.timeDifference=this.endTime-this.startTime;
0>this.timeDifference&&(this.timeDifference=0)},handleBackgroundClick:function(){d.ChartScrollbar.base.handleBackgroundClick.call(this);this.dragging||(this.difference=this.end-this.start,this.timeDifference=this.endTime-this.startTime,0>this.timeDifference&&(this.timeDifference=0))}})})();
(function(){var d=window.AmCharts;d.AmBalloon=d.Class({construct:function(a){this.cname="AmBalloon";this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maxWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=.4;this.shadowColor=
"#000000";this.fadeOutDuration=this.animationDuration=.3;this.fixedPosition=!0;this.offsetY=6;this.offsetX=1;this.textAlign="center";this.disableMouseEvents=!0;this.deltaSignX=this.deltaSignY=1;d.isModern||(this.offsetY*=1.5);this.sdy=this.sdx=0;d.applyTheme(this,a,this.cname)},draw:function(){var a=this.pointToX,b=this.pointToY;d.isModern||(this.drop=!1);var c=this.chart;d.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);this.sdy=this.sdx=0;if(!isNaN(a)){var e=
this.follow,h=c.container,f=this.set;d.remove(f);this.removeDiv();f=h.set();f.node.style.pointerEvents="none";this.set=f;this.mainSet?(this.mainSet.push(this.set),this.sdx=this.mainSet.x,this.sdy=this.mainSet.y):c.balloonsSet.push(f);if(this.show){var g=this.l,k=this.t,l=this.r,m=this.b,n=this.balloonColor,q=this.fillColor,p=this.borderColor,t=q;void 0!=n&&(this.adjustBorderColor?t=p=n:q=n);var r=this.horizontalPadding,u=this.verticalPadding,y=this.pointerWidth,x=this.pointerOrientation,w=this.cornerRadius,
B=c.fontFamily,z=this.fontSize;void 0==z&&(z=c.fontSize);var n=document.createElement("div"),A=c.classNamePrefix;n.className=A+"-balloon-div";this.className&&(n.className=n.className+" "+A+"-balloon-div-"+this.className);A=n.style;this.disableMouseEvents&&(A.pointerEvents="none");A.position="absolute";var C=this.minWidth,D="";isNaN(C)||(D="min-width:"+(C-2*r)+"px; ");n.innerHTML='<div style="text-align:'+this.textAlign+"; "+D+"max-width:"+this.maxWidth+"px; font-size:"+z+"px; color:"+this.color+"; font-family:"+
B+'">'+this.text+"</div>";c.chartDiv.appendChild(n);this.textDiv=n;var J=n.offsetWidth,H=n.offsetHeight;n.clientHeight&&(J=n.clientWidth,H=n.clientHeight);B=H+2*u;D=J+2*r;!isNaN(C)&&D<C&&(D=C);window.opera&&(B+=2);var R=!1,z=this.offsetY;c.handDrawn&&(z+=c.handDrawScatter+2);"H"!=x?(C=a-D/2,b<k+B+10&&"down"!=x?(R=!0,e&&(b+=z),z=b+y,this.deltaSignY=-1):(e&&(b-=z),z=b-B-y,this.deltaSignY=1)):(2*y>B&&(y=B/2),z=b-B/2,a<g+(l-g)/2?(C=a+y,this.deltaSignX=-1):(C=a-D-y,this.deltaSignX=1));z+B>=m&&(z=m-B);
z<k&&(z=k);C<g&&(C=g);C+D>l&&(C=l-D);var k=z+u,m=C+r,L=this.shadowAlpha,P=this.shadowColor,r=this.borderThickness,ia=this.bulletSize,I,u=this.fillAlpha,Z=this.borderAlpha;this.showBullet&&(I=d.circle(h,ia,t,u),f.push(I));this.drop?(g=D/1.6,l=0,"V"==x&&(x="down"),"H"==x&&(x="left"),"down"==x&&(C=a+1,z=b-g-g/3),"up"==x&&(l=180,C=a+1,z=b+g+g/3),"left"==x&&(l=270,C=a+g+g/3+2,z=b),"right"==x&&(l=90,C=a-g-g/3+2,z=b),k=z-H/2+1,m=C-J/2-1,q=d.drop(h,g,l,q,u,r,p,Z)):0<w||0===y?(0<L&&(a=d.rect(h,D,B,q,0,r+1,
P,L,w),d.isModern?a.translate(1,1):a.translate(4,4),f.push(a)),q=d.rect(h,D,B,q,u,r,p,Z,w)):(t=[],w=[],"H"!=x?(g=a-C,g>D-y&&(g=D-y),g<y&&(g=y),t=[0,g-y,a-C,g+y,D,D,0,0],w=R?[0,0,b-z,0,0,B,B,0]:[B,B,b-z,B,B,0,0,B]):(x=b-z,x>B-y&&(x=B-y),x<y&&(x=y),w=[0,x-y,b-z,x+y,B,B,0,0],t=a<g+(l-g)/2?[0,0,C<a?0:a-C,0,0,D,D,0]:[D,D,C+D>a?D:a-C,D,D,0,0,D]),0<L&&(a=d.polygon(h,t,w,q,0,r,P,L),a.translate(1,1),f.push(a)),q=d.polygon(h,t,w,q,u,r,p,Z));this.bg=q;f.push(q);q.toFront();d.setCN(c,q,"balloon-bg");this.className&&
d.setCN(c,q,"balloon-bg-"+this.className);h=1*this.deltaSignX;m+=this.sdx;k+=this.sdy;A.left=m+"px";A.top=k+"px";f.translate(C-h,z,1,!0);q=q.getBBox();this.bottom=z+B+1;this.yPos=q.y+z;I&&I.translate(this.pointToX-C+h,b-z);b=this.animationDuration;0<this.animationDuration&&!e&&!isNaN(this.prevX)&&(f.translate(this.prevX,this.prevY,NaN,!0),f.animate({translate:C-h+","+z},b,"easeOutSine"),n&&(A.left=this.prevTX+"px",A.top=this.prevTY+"px",this.xAnim=c.animate({node:n},"left",this.prevTX,m,b,"easeOutSine",
"px"),this.yAnim=c.animate({node:n},"top",this.prevTY,k,b,"easeOutSine","px")));this.prevX=C-h;this.prevY=z;this.prevTX=m;this.prevTY=k}}},fixPrevious:function(){this.rPrevX=this.prevX;this.rPrevY=this.prevY;this.rPrevTX=this.prevTX;this.rPrevTY=this.prevTY},restorePrevious:function(){this.prevX=this.rPrevX;this.prevY=this.rPrevY;this.prevTX=this.rPrevTX;this.prevTY=this.rPrevTY},followMouse:function(){if(this.follow&&this.show){var a=this.chart.mouseX-this.offsetX*this.deltaSignX-this.sdx,b=this.chart.mouseY-
this.sdy;this.pointToX=a;this.pointToY=b;if(a!=this.previousX||b!=this.previousY)if(this.previousX=a,this.previousY=b,0===this.cornerRadius)this.draw();else{var c=this.set;if(c){var d=c.getBBox(),a=a-d.width/2,h=b-d.height-10;a<this.l&&(a=this.l);a>this.r-d.width&&(a=this.r-d.width);h<this.t&&(h=b+10);c.translate(a,h);b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=h+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,d){this.l=a;this.t=
b;this.r=c;this.b=d;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){if(this.text!=a||this.positionChanged)this.text=a,this.isHiding=!1,this.show=!0,this.destroyTO&&clearTimeout(this.destroyTO),a=this.chart,this.fadeAnim1&&a.stopAnim(this.fadeAnim1),this.fadeAnim2&&a.stopAnim(this.fadeAnim2),this.draw(),this.positionChanged=!1},hide:function(a){var b=this;b.text=void 0;isNaN(a)&&(a=b.fadeOutDuration);var c=b.chart;if(0<a&&!b.isHiding){b.isHiding=!0;b.destroyTO&&clearTimeout(b.destroyTO);
b.destroyTO=setTimeout(function(){b.destroy.call(b)},1E3*a);b.follow=!1;b.show=!1;var d=b.set;d&&(d.setAttr("opacity",b.fillAlpha),b.fadeAnim1=d.animate({opacity:0},a,"easeInSine"));b.textDiv&&(b.fadeAnim2=c.animate({node:b.textDiv},"opacity",1,0,a,"easeInSine",""))}else b.show=!1,b.follow=!1,b.destroy()},setPosition:function(a,b){if(a!=this.pointToX||b!=this.pointToY)this.previousX=this.pointToX,this.previousY=this.pointToY,this.pointToX=a,this.pointToY=b,this.positionChanged=!0},followCursor:function(a){var b=
this;b.follow=a;clearInterval(b.interval);var c=b.chart.mouseX-b.sdx,d=b.chart.mouseY-b.sdy;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=d,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},40))},removeDiv:function(){if(this.textDiv){var a=this.textDiv.parentNode;a&&a.removeChild(this.textDiv)}},destroy:function(){clearInterval(this.interval);d.remove(this.set);this.removeDiv();this.set=null}})})();
(function(){var d=window.AmCharts;d.AmCoordinateChart=d.Class({inherits:d.AmChart,construct:function(a){d.AmCoordinateChart.base.construct.call(this,a);this.theme=a;this.createEvents("rollOverGraphItem","rollOutGraphItem","clickGraphItem","doubleClickGraphItem","rightClickGraphItem","clickGraph","rollOverGraph","rollOutGraph");this.startAlpha=1;this.startDuration=0;this.startEffect="elastic";this.sequencedAnimation=!0;this.colors="#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");
this.balloonDateFormat="MMM DD, YYYY";this.valueAxes=[];this.graphs=[];this.guides=[];this.gridAboveGraphs=!1;d.applyTheme(this,a,"AmCoordinateChart")},initChart:function(){d.AmCoordinateChart.base.initChart.call(this);this.drawGraphs=!0;var a=this.categoryAxis;a&&(this.categoryAxis=d.processObject(a,d.CategoryAxis,this.theme));this.processValueAxes();this.createValueAxes();this.processGraphs();this.processGuides();d.VML&&(this.startAlpha=1);this.setLegendData(this.graphs);this.gridAboveGraphs&&this.gridSet.toFront()},
createValueAxes:function(){if(0===this.valueAxes.length){var a=new d.ValueAxis;this.addValueAxis(a)}},parseData:function(){this.processValueAxes();this.processGraphs()},parseSerialData:function(a){this.chartData=[];if(a)if(0<this.processTimeout){var b=a.length/this.processCount;this.parseCount=Math.ceil(b)-1;for(var c=0;c<b;c++)this.delayParseSerialData(a,c)}else this.parseCount=0,this.parsePartSerialData(a,0,a.length,0);else this.onDataUpdated()},delayParseSerialData:function(a,b){var c=this,d=c.processCount;
setTimeout(function(){c.parsePartSerialData.call(c,a,b*d,(b+1)*d,b)},c.processTimeout)},parsePartSerialData:function(a,b,c,e){c>a.length&&(c=a.length);var h=this.graphs,f={},g=this.seriesIdField;g||(g=this.categoryField);var k=!1,l,m=this.categoryAxis,n,q,p;m&&(k=m.parseDates,n=m.forceShowField,p=m.classNameField,q=m.labelColorField,l=m.categoryFunction);var t,r,u={},y;k&&(t=d.extractPeriod(m.minPeriod),r=t.period,t=t.count,y=d.getPeriodDuration(r,t));var x={};this.lookupTable=x;var w,B=this.dataDateFormat,
z={};for(w=b;w<c;w++){var A={},C=a[w];b=C[this.categoryField];A.dataContext=C;A.category=l?l(b,C,m):String(b);n&&(A.forceShow=C[n]);p&&(A.className=C[p]);q&&(A.labelColor=C[q]);x[C[g]]=A;if(k&&(m.categoryFunction?b=m.categoryFunction(b,C,m):(!B||b instanceof Date||(b=b.toString()+" |"),b=d.getDate(b,B,m.minPeriod)),b=d.resetDateToMin(b,r,t,m.firstDayOfWeek),A.category=b,A.time=b.getTime(),isNaN(A.time)))continue;var D=this.valueAxes;A.axes={};A.x={};var J;for(J=0;J<D.length;J++){var H=D[J].id;A.axes[H]=
{};A.axes[H].graphs={};var R;for(R=0;R<h.length;R++){b=h[R];var L=b.id,P=1.1;isNaN(b.gapPeriod)||(P=b.gapPeriod);var ia=b.periodValue;if(b.valueAxis.id==H){A.axes[H].graphs[L]={};var I={};I.index=w;var Z=C;b.dataProvider&&(Z=f);I.values=this.processValues(Z,b,ia);!b.connect&&z&&z[L]&&0<P&&A.time-u[L]>=y*P&&(z[L].gap=!0);this.processFields(b,I,Z);I.category=A.category;I.serialDataItem=A;I.graph=b;A.axes[H].graphs[L]=I;u[L]=A.time;z[L]=I}}}this.chartData[w]=A}if(this.parseCount==e){for(a=0;a<h.length;a++)b=
h[a],b.dataProvider&&this.parseGraphData(b);this.dataChanged=!1;this.dispatchDataUpdated=!0;this.onDataUpdated()}},processValues:function(a,b,c){var e={},h,f=!1;"candlestick"!=b.type&&"ohlc"!=b.type||""===c||(f=!0);for(var g="value error open close low high".split(" "),k=0;k<g.length;k++){var l=g[k];"value"!=l&&"error"!=l&&f&&(c=l.charAt(0).toUpperCase()+l.slice(1));var m=a[b[l+"Field"]+c];null!==m&&(h=Number(m),isNaN(h)||(e[l]=h),"date"==b.valueAxis.type&&void 0!==m&&(h=d.getDate(m,b.chart.dataDateFormat),
e[l]=h.getTime()))}return e},parseGraphData:function(a){var b=a.dataProvider,c=a.seriesIdField;c||(c=this.seriesIdField);c||(c=this.categoryField);var d;for(d=0;d<b.length;d++){var h=b[d],f=this.lookupTable[String(h[c])],g=a.valueAxis.id;f&&(g=f.axes[g].graphs[a.id],g.serialDataItem=f,g.values=this.processValues(h,a,a.periodValue),this.processFields(a,g,h))}},addValueAxis:function(a){a.chart=this;this.valueAxes.push(a);this.validateData()},removeValueAxesAndGraphs:function(){var a=this.valueAxes,
b;for(b=a.length-1;-1<b;b--)this.removeValueAxis(a[b])},removeValueAxis:function(a){var b=this.graphs,c;for(c=b.length-1;0<=c;c--){var d=b[c];d&&d.valueAxis==a&&this.removeGraph(d)}b=this.valueAxes;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);this.validateData()},addGraph:function(a){this.graphs.push(a);this.chooseGraphColor(a,this.graphs.length-1);this.validateData()},removeGraph:function(a){var b=this.graphs,c;for(c=b.length-1;0<=c;c--)b[c]==a&&(b.splice(c,1),a.destroy());this.validateData()},
handleValueAxisZoom:function(){},processValueAxes:function(){var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b],c=d.processObject(c,d.ValueAxis,this.theme);a[b]=c;c.chart=this;c.init();this.listenTo(c,"axisZoomed",this.handleValueAxisZoom);c.id||(c.id="valueAxisAuto"+b+"_"+(new Date).getTime());void 0===c.usePrefixes&&(c.usePrefixes=this.usePrefixes)}},processGuides:function(){var a=this.guides,b=this.categoryAxis;if(a)for(var c=0;c<a.length;c++){var e=a[c];(void 0!==e.category||void 0!==e.date)&&
b&&b.addGuide(e);e.id||(e.id="guideAuto"+c+"_"+(new Date).getTime());var h=e.valueAxis;h?(d.isString(h)&&(h=this.getValueAxisById(h)),h?h.addGuide(e):this.valueAxes[0].addGuide(e)):isNaN(e.value)||this.valueAxes[0].addGuide(e)}},processGraphs:function(){var a=this.graphs,b;this.graphsById={};for(b=0;b<a.length;b++){var c=a[b],c=d.processObject(c,d.AmGraph,this.theme);a[b]=c;this.chooseGraphColor(c,b);c.chart=this;c.init();d.isString(c.valueAxis)&&(c.valueAxis=this.getValueAxisById(c.valueAxis));c.valueAxis||
(c.valueAxis=this.valueAxes[0]);c.id||(c.id="graphAuto"+b+"_"+(new Date).getTime());this.graphsById[c.id]=c}},formatString:function(a,b,c){var e=b.graph,h=e.valueAxis;h.duration&&b.values.value&&(h=d.formatDuration(b.values.value,h.duration,"",h.durationUnits,h.maxInterval,h.numberFormatter),a=a.split("[[value]]").join(h));a=d.massReplace(a,{"[[title]]":e.title,"[[description]]":b.description});a=c?d.fixNewLines(a):d.fixBrakes(a);return a=d.cleanFromEmpty(a)},getBalloonColor:function(a,b,c){var e=
a.lineColor,h=a.balloonColor;c&&(h=e);c=a.fillColorsR;"object"==typeof c?e=c[0]:void 0!==c&&(e=c);b.isNegative&&(c=a.negativeLineColor,a=a.negativeFillColors,"object"==typeof a?c=a[0]:void 0!==a&&(c=a),void 0!==c&&(e=c));void 0!==b.color&&(e=b.color);void 0!==b.lineColor&&(e=b.lineColor);b=b.fillColors;void 0!==b&&(e=b,d.ifArray(b)&&(e=b[0]));void 0===h&&(h=e);return h},getGraphById:function(a){return d.getObjById(this.graphs,a)},getValueAxisById:function(a){return d.getObjById(this.valueAxes,a)},
processFields:function(a,b,c){if(a.itemColors){var e=a.itemColors,h=b.index;b.color=h<e.length?e[h]:d.randomColor()}e="lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern gap className".split(" ");for(h=0;h<e.length;h++){var f=e[h],g=a[f+"Field"];g&&(g=c[g],d.isDefined(g)&&(b[f]=g))}b.dataContext=c},chooseGraphColor:function(a,b){if(a.lineColor)a.lineColorR=a.lineColor;else{var c;c=this.colors.length>b?this.colors[b]:a.lineColorR?
a.lineColorR:d.randomColor();a.lineColorR=c}a.fillColorsR=a.fillColors?a.fillColors:a.lineColorR;a.bulletBorderColorR=a.bulletBorderColor?a.bulletBorderColor:a.useLineColorForBulletBorder?a.lineColorR:a.bulletColor;a.bulletColorR=a.bulletColor?a.bulletColor:a.lineColorR;if(c=this.patterns)a.pattern=c[b]},handleLegendEvent:function(a){var b=a.type;a=a.dataItem;if(!this.legend.data&&a){var c=a.hidden,d=a.showBalloon;switch(b){case "clickMarker":this.textClickEnabled&&(d?this.hideGraphsBalloon(a):this.showGraphsBalloon(a));
break;case "clickLabel":d?this.hideGraphsBalloon(a):this.showGraphsBalloon(a);break;case "rollOverItem":c||this.highlightGraph(a);break;case "rollOutItem":c||this.unhighlightGraph();break;case "hideItem":this.hideGraph(a);break;case "showItem":this.showGraph(a)}}},highlightGraph:function(a){var b=this.graphs,c,d=.2;this.legend&&(d=this.legend.rollOverGraphAlpha);if(1!=d)for(c=0;c<b.length;c++){var h=b[c];h!=a&&h.changeOpacity(d)}},unhighlightGraph:function(){var a;this.legend&&(a=this.legend.rollOverGraphAlpha);
if(1!=a){a=this.graphs;var b;for(b=0;b<a.length;b++)a[b].changeOpacity(1)}},showGraph:function(a){a.switchable&&(a.hidden=!1,this.dataChanged=!0,"xy"!=this.type&&(this.marginsUpdated=!1),this.chartCreated&&this.initChart())},hideGraph:function(a){a.switchable&&(this.dataChanged=!0,"xy"!=this.type&&(this.marginsUpdated=!1),a.hidden=!0,this.chartCreated&&this.initChart())},hideGraphsBalloon:function(a){a.showBalloon=!1;this.updateLegend()},showGraphsBalloon:function(a){a.showBalloon=!0;this.updateLegend()},
updateLegend:function(){this.legend&&this.legend.invalidateSize()},resetAnimation:function(){var a=this.graphs;if(a){var b;for(b=0;b<a.length;b++)a[b].animationPlayed=!1}},animateAgain:function(){this.resetAnimation();this.validateNow()}})})();
(function(){var d=window.AmCharts;d.TrendLine=d.Class({construct:function(a){this.cname="TrendLine";this.createEvents("click");this.isProtected=!1;this.dashLength=0;this.lineColor="#00CC00";this.lineThickness=this.lineAlpha=1;d.applyTheme(this,a,this.cname)},draw:function(){var a=this;a.destroy();var b=a.chart,c=b.container,e,h,f,g,k=a.categoryAxis,l=a.initialDate,m=a.initialCategory,n=a.finalDate,q=a.finalCategory,p=a.valueAxis,t=a.valueAxisX,r=a.initialXValue,u=a.finalXValue,y=a.initialValue,x=
a.finalValue,w=p.recalculateToPercents,B=b.dataDateFormat;k&&(l&&(l=d.getDate(l,B,"fff"),a.initialDate=l,e=k.dateToCoordinate(l)),m&&(e=k.categoryToCoordinate(m)),n&&(n=d.getDate(n,B,"fff"),a.finalDate=n,h=k.dateToCoordinate(n)),q&&(h=k.categoryToCoordinate(q)));t&&!w&&(isNaN(r)||(e=t.getCoordinate(r)),isNaN(u)||(h=t.getCoordinate(u)));p&&!w&&(isNaN(y)||(f=p.getCoordinate(y)),isNaN(x)||(g=p.getCoordinate(x)));if(!(isNaN(e)||isNaN(h)||isNaN(f)||isNaN(f))){b.rotate?(k=[f,g],g=[e,h]):(k=[e,h],g=[f,g]);
l=a.lineColor;f=d.line(c,k,g,l,a.lineAlpha,a.lineThickness,a.dashLength);e=k;h=g;q=k[1]-k[0];p=g[1]-g[0];0===q&&(q=.01);0===p&&(p=.01);m=q/Math.abs(q);n=p/Math.abs(p);p=90*Math.PI/180-Math.asin(q/(q*p/Math.abs(q*p)*Math.sqrt(Math.pow(q,2)+Math.pow(p,2))));q=Math.abs(5*Math.cos(p));p=Math.abs(5*Math.sin(p));e.push(k[1]-m*p,k[0]-m*p);h.push(g[1]+n*q,g[0]+n*q);g=d.polygon(c,e,h,l,.005,0);c=c.set([g,f]);c.translate(b.marginLeftReal,b.marginTopReal);b.trendLinesSet.push(c);d.setCN(b,f,"trend-line");d.setCN(b,
f,"trend-line-"+a.id);a.line=f;a.set=c;if(f=a.initialImage)f=d.processObject(f,d.Image,a.theme),f.chart=b,f.draw(),f.translate(e[0]+f.offsetX,h[0]+f.offsetY),c.push(f.set);if(f=a.finalImage)f=d.processObject(f,d.Image,a.theme),f.chart=b,f.draw(),f.translate(e[1]+f.offsetX,h[1]+f.offsetY),c.push(f.set);g.mouseup(function(){a.handleLineClick()}).mouseover(function(){a.handleLineOver()}).mouseout(function(){a.handleLineOut()});g.touchend&&g.touchend(function(){a.handleLineClick()});c.clipRect(0,0,b.plotAreaWidth,
b.plotAreaHeight)}},handleLineClick:function(){this.fire({type:"click",trendLine:this,chart:this.chart})},handleLineOver:function(){var a=this.rollOverColor;void 0!==a&&this.line.attr({stroke:a});this.balloonText&&(clearTimeout(this.chart.hoverInt),a=this.line.getBBox(),this.chart.showBalloon(this.balloonText,this.lineColor,!0,this.x+a.x+a.width/2,this.y+a.y+a.height/2))},handleLineOut:function(){this.line.attr({stroke:this.lineColor});this.balloonText&&this.chart.hideBalloon()},destroy:function(){d.remove(this.set)}})})();
(function(){var d=window.AmCharts;d.Image=d.Class({construct:function(a){this.cname="Image";this.height=this.width=20;this.rotation=this.offsetY=this.offsetX=0;this.balloonColor=this.color="#000000";this.opacity=1;d.applyTheme(this,a,this.cname)},draw:function(){var a=this;a.set&&a.set.remove();var b=a.chart.container;a.set=b.set();var c,d;a.url?(c=b.image(a.url,0,0,a.width,a.height),d=1):a.svgPath&&(c=b.path(a.svgPath),c.setAttr("fill",a.color),c.setAttr("stroke",a.outlineColor),b=c.getBBox(),d=
Math.min(a.width/b.width,a.height/b.height));c&&(c.setAttr("opacity",a.opacity),a.set.rotate(a.rotation),c.translate(-a.width/2,-a.height/2,d),a.balloonText&&c.mouseover(function(){a.chart.showBalloon(a.balloonText,a.balloonColor,!0)}).mouseout(function(){a.chart.hideBalloon()}).touchend(function(){a.chart.hideBalloon()}).touchstart(function(){a.chart.showBalloon(a.balloonText,a.balloonColor,!0)}),a.set.push(c))},translate:function(a,b){this.set&&this.set.translate(a,b)}})})();
(function(){var d=window.AmCharts;d.circle=function(a,b,c,e,h,f,g,k,l){0>=b&&(b=.001);if(void 0==h||0===h)h=.01;void 0===f&&(f="#000000");void 0===g&&(g=0);e={fill:c,stroke:f,"fill-opacity":e,"stroke-width":h,"stroke-opacity":g};a=isNaN(l)?a.circle(0,0,b).attr(e):a.ellipse(0,0,b,l).attr(e);k&&a.gradient("radialGradient",[c,d.adjustLuminosity(c,-.6)]);return a};d.text=function(a,b,c,e,h,f,g,k){f||(f="middle");"right"==f&&(f="end");"left"==f&&(f="start");isNaN(k)&&(k=1);void 0!==b&&(b=String(b),d.isIE&&
!d.isModern&&(b=b.replace("&amp;","&"),b=b.replace("&","&amp;")));c={fill:c,"font-family":e,"font-size":h+"px",opacity:k};!0===g&&(c["font-weight"]="bold");c["text-anchor"]=f;return a.text(b,c)};d.polygon=function(a,b,c,e,h,f,g,k,l,m,n){isNaN(f)&&(f=.01);isNaN(k)&&(k=h);var q=e,p=!1;"object"==typeof q&&1<q.length&&(p=!0,q=q[0]);void 0===g&&(g=q);h={fill:q,stroke:g,"fill-opacity":h,"stroke-width":f,"stroke-opacity":k};void 0!==n&&0<n&&(h["stroke-dasharray"]=n);n=d.dx;f=d.dy;a.handDrawn&&(c=d.makeHD(b,
c,a.handDrawScatter),b=c[0],c=c[1]);g=Math.round;m&&(b[t]=d.roundTo(b[t],5),c[t]=d.roundTo(c[t],5),g=Number);k="M"+(g(b[0])+n)+","+(g(c[0])+f);for(var t=1;t<b.length;t++)m&&(b[t]=d.roundTo(b[t],5),c[t]=d.roundTo(c[t],5)),k+=" L"+(g(b[t])+n)+","+(g(c[t])+f);a=a.path(k+" Z").attr(h);p&&a.gradient("linearGradient",e,l);return a};d.rect=function(a,b,c,e,h,f,g,k,l,m,n){if(isNaN(b)||isNaN(c))return a.set();isNaN(f)&&(f=0);void 0===l&&(l=0);void 0===m&&(m=270);isNaN(h)&&(h=0);var q=e,p=!1;"object"==typeof q&&
(q=q[0],p=!0);void 0===g&&(g=q);void 0===k&&(k=h);b=Math.round(b);c=Math.round(c);var t=0,r=0;0>b&&(b=Math.abs(b),t=-b);0>c&&(c=Math.abs(c),r=-c);t+=d.dx;r+=d.dy;h={fill:q,stroke:g,"fill-opacity":h,"stroke-opacity":k};void 0!==n&&0<n&&(h["stroke-dasharray"]=n);a=a.rect(t,r,b,c,l,f).attr(h);p&&a.gradient("linearGradient",e,m);return a};d.bullet=function(a,b,c,e,h,f,g,k,l,m,n,q,p){var t;"circle"==b&&(b="round");switch(b){case "round":t=d.circle(a,c/2,e,h,f,g,k);break;case "square":t=d.polygon(a,[-c/
2,c/2,c/2,-c/2],[c/2,c/2,-c/2,-c/2],e,h,f,g,k,m-180,void 0,p);break;case "rectangle":t=d.polygon(a,[-c,c,c,-c],[c/2,c/2,-c/2,-c/2],e,h,f,g,k,m-180,void 0,p);break;case "diamond":t=d.polygon(a,[-c/2,0,c/2,0],[0,-c/2,0,c/2],e,h,f,g,k);break;case "triangleUp":t=d.triangle(a,c,0,e,h,f,g,k);break;case "triangleDown":t=d.triangle(a,c,180,e,h,f,g,k);break;case "triangleLeft":t=d.triangle(a,c,270,e,h,f,g,k);break;case "triangleRight":t=d.triangle(a,c,90,e,h,f,g,k);break;case "bubble":t=d.circle(a,c/2,e,h,
f,g,k,!0);break;case "line":t=d.line(a,[-c/2,c/2],[0,0],e,h,f,g,k);break;case "yError":t=a.set();t.push(d.line(a,[0,0],[-c/2,c/2],e,h,f));t.push(d.line(a,[-l,l],[-c/2,-c/2],e,h,f));t.push(d.line(a,[-l,l],[c/2,c/2],e,h,f));break;case "xError":t=a.set(),t.push(d.line(a,[-c/2,c/2],[0,0],e,h,f)),t.push(d.line(a,[-c/2,-c/2],[-l,l],e,h,f)),t.push(d.line(a,[c/2,c/2],[-l,l],e,h,f))}t&&t.pattern(n,NaN,q);return t};d.triangle=function(a,b,c,d,h,f,g,k){if(void 0===f||0===f)f=1;void 0===g&&(g="#000");void 0===
k&&(k=0);d={fill:d,stroke:g,"fill-opacity":h,"stroke-width":f,"stroke-opacity":k};b/=2;var l;0===c&&(l=" M"+-b+","+b+" L0,"+-b+" L"+b+","+b+" Z");180==c&&(l=" M"+-b+","+-b+" L0,"+b+" L"+b+","+-b+" Z");90==c&&(l=" M"+-b+","+-b+" L"+b+",0 L"+-b+","+b+" Z");270==c&&(l=" M"+-b+",0 L"+b+","+b+" L"+b+","+-b+" Z");return a.path(l).attr(d)};d.line=function(a,b,c,e,h,f,g,k,l,m,n){if(a.handDrawn&&!n)return d.handDrawnLine(a,b,c,e,h,f,g,k,l,m,n);f={fill:"none","stroke-width":f};void 0!==g&&0<g&&(f["stroke-dasharray"]=
g);isNaN(h)||(f["stroke-opacity"]=h);e&&(f.stroke=e);e=Math.round;m&&(e=Number,b[0]=d.roundTo(b[0],5),c[0]=d.roundTo(c[0],5));m=d.dx;h=d.dy;g="M"+(e(b[0])+m)+","+(e(c[0])+h);for(k=1;k<b.length;k++)b[k]=d.roundTo(b[k],5),c[k]=d.roundTo(c[k],5),g+=" L"+(e(b[k])+m)+","+(e(c[k])+h);if(d.VML)return a.path(g,void 0,!0).attr(f);l&&(g+=" M0,0 L0,0");return a.path(g).attr(f)};d.makeHD=function(a,b,c){for(var d=[],h=[],f=1;f<a.length;f++)for(var g=Number(a[f-1]),k=Number(b[f-1]),l=Number(a[f]),m=Number(b[f]),
n=Math.round(Math.sqrt(Math.pow(l-g,2)+Math.pow(m-k,2))/50)+1,l=(l-g)/n,m=(m-k)/n,q=0;q<=n;q++){var p=k+q*m+Math.random()*c;d.push(g+q*l+Math.random()*c);h.push(p)}return[d,h]};d.handDrawnLine=function(a,b,c,e,h,f,g,k,l,m){var n,q=a.set();for(n=1;n<b.length;n++)for(var p=[b[n-1],b[n]],t=[c[n-1],c[n]],t=d.makeHD(p,t,a.handDrawScatter),p=t[0],t=t[1],r=1;r<p.length;r++)q.push(d.line(a,[p[r-1],p[r]],[t[r-1],t[r]],e,h,f+Math.random()*a.handDrawThickness-a.handDrawThickness/2,g,k,l,m,!0));return q};d.doNothing=
function(a){return a};d.drop=function(a,b,c,d,h,f,g,k){var l=1/180*Math.PI,m=c-20,n=Math.sin(m*l)*b,q=Math.cos(m*l)*b,p=Math.sin((m+40)*l)*b,t=Math.cos((m+40)*l)*b,r=.8*b,u=-b/3,y=b/3;0===c&&(u=-u,y=0);180==c&&(y=0);90==c&&(u=0);270==c&&(u=0,y=-y);c={fill:d,stroke:g,"stroke-width":f,"stroke-opacity":k,"fill-opacity":h};b="M"+n+","+q+" A"+b+","+b+",0,1,1,"+p+","+t+(" A"+r+","+r+",0,0,0,"+(Math.sin((m+20)*l)*b+y)+","+(Math.cos((m+20)*l)*b+u));b+=" A"+r+","+r+",0,0,0,"+n+","+q;return a.path(b,void 0,
void 0,"1000,1000").attr(c)};d.wedge=function(a,b,c,e,h,f,g,k,l,m,n,q,p,t){var r=Math.round;f=r(f);g=r(g);k=r(k);var u=r(g/f*k),y=d.VML,x=359.5+f/100;359.94<x&&(x=359.94);h>=x&&(h=x);var w=1/180*Math.PI,x=b+Math.sin(e*w)*k,B=c-Math.cos(e*w)*u,z=b+Math.sin(e*w)*f,A=c-Math.cos(e*w)*g,C=b+Math.sin((e+h)*w)*f,D=c-Math.cos((e+h)*w)*g,J=b+Math.sin((e+h)*w)*k,w=c-Math.cos((e+h)*w)*u,H={fill:d.adjustLuminosity(m.fill,-.2),"stroke-opacity":0,"fill-opacity":m["fill-opacity"]},R=0;180<Math.abs(h)&&(R=1);e=a.set();
var L;y&&(x=r(10*x),z=r(10*z),C=r(10*C),J=r(10*J),B=r(10*B),A=r(10*A),D=r(10*D),w=r(10*w),b=r(10*b),l=r(10*l),c=r(10*c),f*=10,g*=10,k*=10,u*=10,1>Math.abs(h)&&1>=Math.abs(C-z)&&1>=Math.abs(D-A)&&(L=!0));h="";var P;q&&(H["fill-opacity"]=0,H["stroke-opacity"]=m["stroke-opacity"]/2,H.stroke=m.stroke);if(0<l){P=" M"+x+","+(B+l)+" L"+z+","+(A+l);y?(L||(P+=" A"+(b-f)+","+(l+c-g)+","+(b+f)+","+(l+c+g)+","+z+","+(A+l)+","+C+","+(D+l)),P+=" L"+J+","+(w+l),0<k&&(L||(P+=" B"+(b-k)+","+(l+c-u)+","+(b+k)+","+
(l+c+u)+","+J+","+(l+w)+","+x+","+(l+B)))):(P+=" A"+f+","+g+",0,"+R+",1,"+C+","+(D+l)+" L"+J+","+(w+l),0<k&&(P+=" A"+k+","+u+",0,"+R+",0,"+x+","+(B+l)));P+=" Z";var ia=l;y&&(ia/=10);for(var I=0;I<ia;I+=10){var Z=a.path(P,void 0,void 0,"1000,1000").attr(H);e.push(Z);Z.translate(0,-I)}P=a.path(" M"+x+","+B+" L"+x+","+(B+l)+" L"+z+","+(A+l)+" L"+z+","+A+" L"+x+","+B+" Z",void 0,void 0,"1000,1000").attr(H);l=a.path(" M"+C+","+D+" L"+C+","+(D+l)+" L"+J+","+(w+l)+" L"+J+","+w+" L"+C+","+D+" Z",void 0,void 0,
"1000,1000").attr(H);e.push(P);e.push(l)}y?(L||(h=" A"+r(b-f)+","+r(c-g)+","+r(b+f)+","+r(c+g)+","+r(z)+","+r(A)+","+r(C)+","+r(D)),g=" M"+r(x)+","+r(B)+" L"+r(z)+","+r(A)+h+" L"+r(J)+","+r(w)):g=" M"+x+","+B+" L"+z+","+A+(" A"+f+","+g+",0,"+R+",1,"+C+","+D)+" L"+J+","+w;0<k&&(y?L||(g+=" B"+(b-k)+","+(c-u)+","+(b+k)+","+(c+u)+","+J+","+w+","+x+","+B):g+=" A"+k+","+u+",0,"+R+",0,"+x+","+B);a.handDrawn&&(k=d.line(a,[x,z],[B,A],m.stroke,m.thickness*Math.random()*a.handDrawThickness,m["stroke-opacity"]),
e.push(k));k=a.path(g+" Z",void 0,void 0,"1000,1000").attr(m);if(n){u=[];for(y=0;y<n.length;y++)u.push(d.adjustLuminosity(m.fill,n[y]));"radial"!=t||d.isModern||(u=[]);0<u.length&&k.gradient(t+"Gradient",u)}d.isModern&&"radial"==t&&k.grad&&(k.grad.setAttribute("gradientUnits","userSpaceOnUse"),k.grad.setAttribute("r",f),k.grad.setAttribute("gradientTransform","translate("+(b-a.width/2)+","+(c-a.height/2)+")"));k.pattern(q,NaN,p);e.wedge=k;e.push(k);return e};d.rgb2hex=function(a){return(a=a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&
4===a.length?"#"+("0"+parseInt(a[1],10).toString(16)).slice(-2)+("0"+parseInt(a[2],10).toString(16)).slice(-2)+("0"+parseInt(a[3],10).toString(16)).slice(-2):""};d.adjustLuminosity=function(a,b){a&&-1!=a.indexOf("rgb")&&(a=d.rgb2hex(a));a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",e,h;for(h=0;3>h;h++)e=parseInt(a.substr(2*h,2),16),e=Math.round(Math.min(Math.max(0,e+e*b),255)).toString(16),c+=("00"+
e).substr(e.length);return c}})();
(function(){var d=window.AmCharts;d.Bezier=d.Class({construct:function(a,b,c,e,h,f,g,k,l,m){"object"==typeof g&&(g=g[0]);"object"==typeof k&&(k=k[0]);0===k&&(g="none");f={fill:g,"fill-opacity":k,"stroke-width":f};void 0!==l&&0<l&&(f["stroke-dasharray"]=l);isNaN(h)||(f["stroke-opacity"]=h);e&&(f.stroke=e);e="M"+Math.round(b[0])+","+Math.round(c[0]);h=[];for(l=0;l<b.length;l++)h.push({x:Number(b[l]),y:Number(c[l])});1<h.length&&(b=this.interpolate(h),e+=this.drawBeziers(b));m?e+=m:d.VML||(e+="M0,0 L0,0");
this.path=a.path(e).attr(f);this.node=this.path.node},interpolate:function(a){var b=[];b.push({x:a[0].x,y:a[0].y});var c=a[1].x-a[0].x,e=a[1].y-a[0].y,h=d.bezierX,f=d.bezierY;b.push({x:a[0].x+c/h,y:a[0].y+e/f});var g;for(g=1;g<a.length-1;g++){var k=a[g-1],l=a[g],e=a[g+1];isNaN(e.x)&&(e=l);isNaN(l.x)&&(l=k);isNaN(k.x)&&(k=l);c=e.x-l.x;e=e.y-k.y;k=l.x-k.x;k>c&&(k=c);b.push({x:l.x-k/h,y:l.y-e/f});b.push({x:l.x,y:l.y});b.push({x:l.x+k/h,y:l.y+e/f})}e=a[a.length-1].y-a[a.length-2].y;c=a[a.length-1].x-
a[a.length-2].x;b.push({x:a[a.length-1].x-c/h,y:a[a.length-1].y-e/f});b.push({x:a[a.length-1].x,y:a[a.length-1].y});return b},drawBeziers:function(a){var b="",c;for(c=0;c<(a.length-1)/3;c++)b+=this.drawBezierMidpoint(a[3*c],a[3*c+1],a[3*c+2],a[3*c+3]);return b},drawBezierMidpoint:function(a,b,c,d){var h=Math.round,f=this.getPointOnSegment(a,b,.75),g=this.getPointOnSegment(d,c,.75),k=(d.x-a.x)/16,l=(d.y-a.y)/16,m=this.getPointOnSegment(a,b,.375);a=this.getPointOnSegment(f,g,.375);a.x-=k;a.y-=l;b=this.getPointOnSegment(g,
f,.375);b.x+=k;b.y+=l;c=this.getPointOnSegment(d,c,.375);k=this.getMiddle(m,a);f=this.getMiddle(f,g);g=this.getMiddle(b,c);m=" Q"+h(m.x)+","+h(m.y)+","+h(k.x)+","+h(k.y);m+=" Q"+h(a.x)+","+h(a.y)+","+h(f.x)+","+h(f.y);m+=" Q"+h(b.x)+","+h(b.y)+","+h(g.x)+","+h(g.y);return m+=" Q"+h(c.x)+","+h(c.y)+","+h(d.x)+","+h(d.y)},getMiddle:function(a,b){return{x:(a.x+b.x)/2,y:(a.y+b.y)/2}},getPointOnSegment:function(a,b,c){return{x:a.x+(b.x-a.x)*c,y:a.y+(b.y-a.y)*c}}})})();
(function(){var d=window.AmCharts;d.AmDraw=d.Class({construct:function(a,b,c,e){d.SVG_NS="http://www.w3.org/2000/svg";d.SVG_XLINK="http://www.w3.org/1999/xlink";d.hasSVG=!!document.createElementNS&&!!document.createElementNS(d.SVG_NS,"svg").createSVGRect;1>b&&(b=10);1>c&&(c=10);this.div=a;this.width=b;this.height=c;this.rBin=document.createElement("div");d.hasSVG?(d.SVG=!0,b=this.createSvgElement("svg"),a.appendChild(b),this.container=b,this.addDefs(e),this.R=new d.SVGRenderer(this)):d.isIE&&d.VMLRenderer&&
(d.VML=!0,d.vmlStyleSheet||(document.namespaces.add("amvml","urn:schemas-microsoft-com:vml"),31>document.styleSheets.length?(b=document.createStyleSheet(),b.addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true"),d.vmlStyleSheet=b):document.styleSheets[0].addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true")),this.container=a,this.R=new d.VMLRenderer(this,e),this.R.disableSelection(a))},createSvgElement:function(a){return document.createElementNS(d.SVG_NS,
a)},circle:function(a,b,c,e){var h=new d.AmDObject("circle",this);h.attr({r:c,cx:a,cy:b});this.addToContainer(h.node,e);return h},ellipse:function(a,b,c,e,h){var f=new d.AmDObject("ellipse",this);f.attr({rx:c,ry:e,cx:a,cy:b});this.addToContainer(f.node,h);return f},setSize:function(a,b){0<a&&0<b&&(this.container.style.width=a+"px",this.container.style.height=b+"px")},rect:function(a,b,c,e,h,f,g){var k=new d.AmDObject("rect",this);d.VML&&(h=Math.round(100*h/Math.min(c,e)),c+=2*f,e+=2*f,k.bw=f,k.node.style.marginLeft=
-f,k.node.style.marginTop=-f);1>c&&(c=1);1>e&&(e=1);k.attr({x:a,y:b,width:c,height:e,rx:h,ry:h,"stroke-width":f});this.addToContainer(k.node,g);return k},image:function(a,b,c,e,h,f){var g=new d.AmDObject("image",this);g.attr({x:b,y:c,width:e,height:h});this.R.path(g,a);this.addToContainer(g.node,f);return g},addToContainer:function(a,b){b||(b=this.container);b.appendChild(a)},text:function(a,b,c){return this.R.text(a,b,c)},path:function(a,b,c,e){var h=new d.AmDObject("path",this);e||(e="100,100");
h.attr({cs:e});c?h.attr({dd:a}):h.attr({d:a});this.addToContainer(h.node,b);return h},set:function(a){return this.R.set(a)},remove:function(a){if(a){var b=this.rBin;b.appendChild(a);b.innerHTML=""}},renderFix:function(){var a=this.container,b=a.style;b.top="0px";b.left="0px";try{var c=a.getBoundingClientRect(),d=c.left-Math.round(c.left),h=c.top-Math.round(c.top);d&&(b.left=d+"px");h&&(b.top=h+"px")}catch(f){}},update:function(){this.R.update()},addDefs:function(a){if(d.hasSVG){var b=this.createSvgElement("desc"),
c=this.container;c.setAttribute("version","1.1");c.style.position="absolute";this.setSize(this.width,this.height);d.rtl&&(c.setAttribute("direction","rtl"),c.style.left="auto",c.style.right="0px");a&&(a.addCodeCredits&&b.appendChild(document.createTextNode("JavaScript chart by amCharts "+a.version)),c.appendChild(b),a.defs&&(b=this.createSvgElement("defs"),c.appendChild(b),d.parseDefs(a.defs,b),this.defs=b))}}})})();
(function(){var d=window.AmCharts;d.AmDObject=d.Class({construct:function(a,b){this.D=b;this.R=b.R;this.node=this.R.create(this,a);this.y=this.x=0;this.scale=1},attr:function(a){this.R.attr(this,a);return this},getAttr:function(a){return this.node.getAttribute(a)},setAttr:function(a,b){this.R.setAttr(this,a,b);return this},clipRect:function(a,b,c,d){this.R.clipRect(this,a,b,c,d)},translate:function(a,b,c,d){d||(a=Math.round(a),b=Math.round(b));this.R.move(this,a,b,c);this.x=a;this.y=b;this.scale=
c;this.angle&&this.rotate(this.angle)},rotate:function(a,b){this.R.rotate(this,a,b);this.angle=a},animate:function(a,b,c){for(var e in a)if(a.hasOwnProperty(e)){var h=e,f=a[e];c=d.getEffect(c);this.R.animate(this,h,f,b,c)}},push:function(a){if(a){var b=this.node;b.appendChild(a.node);var c=a.clipPath;c&&b.appendChild(c);(a=a.grad)&&b.appendChild(a)}},text:function(a){this.R.setText(this,a)},remove:function(){this.stop();this.R.remove(this)},clear:function(){var a=this.node;if(a.hasChildNodes())for(;1<=
a.childNodes.length;)a.removeChild(a.firstChild)},hide:function(){this.setAttr("visibility","hidden")},show:function(){this.setAttr("visibility","visible")},getBBox:function(){return this.R.getBBox(this)},toFront:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;var b=a.parentNode;b&&b.appendChild(a)}},toPrevious:function(){var a=this.node;a&&this.prevNextNode&&(a=a.parentNode)&&a.insertBefore(this.prevNextNode,null)},toBack:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;
var b=a.parentNode;if(b){var c=b.firstChild;c&&b.insertBefore(a,c)}}},mouseover:function(a){this.R.addListener(this,"mouseover",a);return this},mouseout:function(a){this.R.addListener(this,"mouseout",a);return this},click:function(a){this.R.addListener(this,"click",a);return this},dblclick:function(a){this.R.addListener(this,"dblclick",a);return this},mousedown:function(a){this.R.addListener(this,"mousedown",a);return this},mouseup:function(a){this.R.addListener(this,"mouseup",a);return this},touchmove:function(a){this.R.addListener(this,
"touchmove",a);return this},touchstart:function(a){this.R.addListener(this,"touchstart",a);return this},touchend:function(a){this.R.addListener(this,"touchend",a);return this},contextmenu:function(a){this.node.addEventListener?this.node.addEventListener("contextmenu",a,!0):this.R.addListener(this,"contextmenu",a);return this},stop:function(){d.removeFromArray(this.R.animations,this.an_translate);d.removeFromArray(this.R.animations,this.an_y);d.removeFromArray(this.R.animations,this.an_x)},length:function(){return this.node.childNodes.length},
gradient:function(a,b,c){this.R.gradient(this,a,b,c)},pattern:function(a,b,c){a&&this.R.pattern(this,a,b,c)}})})();
(function(){var d=window.AmCharts;d.VMLRenderer=d.Class({construct:function(a,b){this.chart=b;this.D=a;this.cNames={circle:"oval",ellipse:"oval",rect:"roundrect",path:"shape"};this.styleMap={x:"left",y:"top",width:"width",height:"height","font-family":"fontFamily","font-size":"fontSize",visibility:"visibility"}},create:function(a,b){var c;if("group"==b)c=document.createElement("div"),a.type="div";else if("text"==b)c=document.createElement("div"),a.type="text";else if("image"==b)c=document.createElement("img"),
a.type="image";else{a.type="shape";a.shapeType=this.cNames[b];c=document.createElement("amvml:"+this.cNames[b]);var d=document.createElement("amvml:stroke");c.appendChild(d);a.stroke=d;var h=document.createElement("amvml:fill");c.appendChild(h);a.fill=h;h.className="amvml";d.className="amvml";c.className="amvml"}c.style.position="absolute";c.style.top=0;c.style.left=0;return c},path:function(a,b){a.node.setAttribute("src",b)},setAttr:function(a,b,c){if(void 0!==c){var e;8===document.documentMode&&
(e=!0);var h=a.node,f=a.type,g=h.style;"r"==b&&(g.width=2*c,g.height=2*c);"oval"==a.shapeType&&("rx"==b&&(g.width=2*c),"ry"==b&&(g.height=2*c));"roundrect"==a.shapeType&&("width"!=b&&"height"!=b||--c);"cursor"==b&&(g.cursor=c);"cx"==b&&(g.left=c-d.removePx(g.width)/2);"cy"==b&&(g.top=c-d.removePx(g.height)/2);var k=this.styleMap[b];"width"==k&&0>c&&(c=0);void 0!==k&&(g[k]=c);"text"==f&&("text-anchor"==b&&(a.anchor=c,k=h.clientWidth,"end"==c&&(g.marginLeft=-k+"px"),"middle"==c&&(g.marginLeft=-(k/2)+
"px",g.textAlign="center"),"start"==c&&(g.marginLeft="0px")),"fill"==b&&(g.color=c),"font-weight"==b&&(g.fontWeight=c));if(g=a.children)for(k=0;k<g.length;k++)g[k].setAttr(b,c);if("shape"==f){"cs"==b&&(h.style.width="100px",h.style.height="100px",h.setAttribute("coordsize",c));"d"==b&&h.setAttribute("path",this.svgPathToVml(c));"dd"==b&&h.setAttribute("path",c);f=a.stroke;a=a.fill;"stroke"==b&&(e?f.color=c:f.setAttribute("color",c));"stroke-width"==b&&(e?f.weight=c:f.setAttribute("weight",c));"stroke-opacity"==
b&&(e?f.opacity=c:f.setAttribute("opacity",c));"stroke-dasharray"==b&&(g="solid",0<c&&3>c&&(g="dot"),3<=c&&6>=c&&(g="dash"),6<c&&(g="longdash"),e?f.dashstyle=g:f.setAttribute("dashstyle",g));if("fill-opacity"==b||"opacity"==b)0===c?e?a.on=!1:a.setAttribute("on",!1):e?a.opacity=c:a.setAttribute("opacity",c);"fill"==b&&(e?a.color=c:a.setAttribute("color",c));"rx"==b&&(e?h.arcSize=c+"%":h.setAttribute("arcsize",c+"%"))}}},attr:function(a,b){for(var c in b)b.hasOwnProperty(c)&&this.setAttr(a,c,b[c])},
text:function(a,b,c){var e=new d.AmDObject("text",this.D),h=e.node;h.style.whiteSpace="pre";h.innerHTML=a;this.D.addToContainer(h,c);this.attr(e,b);return e},getBBox:function(a){return this.getBox(a.node)},getBox:function(a){var b=a.offsetLeft,c=a.offsetTop,d=a.offsetWidth,h=a.offsetHeight,f;if(a.hasChildNodes()){var g,k,l;for(l=0;l<a.childNodes.length;l++){f=this.getBox(a.childNodes[l]);var m=f.x;isNaN(m)||(isNaN(g)?g=m:m<g&&(g=m));var n=f.y;isNaN(n)||(isNaN(k)?k=n:n<k&&(k=n));m=f.width+m;isNaN(m)||
(d=Math.max(d,m));f=f.height+n;isNaN(f)||(h=Math.max(h,f))}0>g&&(b+=g);0>k&&(c+=k)}return{x:b,y:c,width:d,height:h}},setText:function(a,b){var c=a.node;c&&(c.innerHTML=b);this.setAttr(a,"text-anchor",a.anchor)},addListener:function(a,b,c){a.node["on"+b]=c},move:function(a,b,c){var e=a.node,h=e.style;"text"==a.type&&(c-=d.removePx(h.fontSize)/2-1);"oval"==a.shapeType&&(b-=d.removePx(h.width)/2,c-=d.removePx(h.height)/2);a=a.bw;isNaN(a)||(b-=a,c-=a);isNaN(b)||isNaN(c)||(e.style.left=b+"px",e.style.top=
c+"px")},svgPathToVml:function(a){var b=a.split(" ");a="";var c,d=Math.round,h;for(h=0;h<b.length;h++){var f=b[h],g=f.substring(0,1),f=f.substring(1),k=f.split(","),l=d(k[0])+","+d(k[1]);"M"==g&&(a+=" m "+l);"L"==g&&(a+=" l "+l);"Z"==g&&(a+=" x e");if("Q"==g){var m=c.length,n=c[m-1],q=k[0],p=k[1],l=k[2],t=k[3];c=d(c[m-2]/3+2/3*q);n=d(n/3+2/3*p);q=d(2/3*q+l/3);p=d(2/3*p+t/3);a+=" c "+c+","+n+","+q+","+p+","+l+","+t}"A"==g&&(a+=" wa "+f);"B"==g&&(a+=" at "+f);c=k}return a},animate:function(a,b,c,d,
h){var f=a.node,g=this.chart;a.animationFinished=!1;if("translate"==b){b=c.split(",");c=b[1];var k=f.offsetTop;g.animate(a,"left",f.offsetLeft,b[0],d,h,"px");g.animate(a,"top",k,c,d,h,"px")}},clipRect:function(a,b,c,d,h){a=a.node;0===b&&0===c?(a.style.width=d+"px",a.style.height=h+"px",a.style.overflow="hidden"):a.style.clip="rect("+c+"px "+(b+d)+"px "+(c+h)+"px "+b+"px)"},rotate:function(a,b,c){if(0!==Number(b)){var e=a.node;a=e.style;c||(c=this.getBGColor(e.parentNode));a.backgroundColor=c;a.paddingLeft=
1;c=b*Math.PI/180;var h=Math.cos(c),f=Math.sin(c),g=d.removePx(a.left),k=d.removePx(a.top),l=e.offsetWidth,e=e.offsetHeight;b/=Math.abs(b);a.left=g+l/2-l/2*Math.cos(c)-b*e/2*Math.sin(c)+3;a.top=k-b*l/2*Math.sin(c)+b*e/2*Math.sin(c);a.cssText=a.cssText+"; filter:progid:DXImageTransform.Microsoft.Matrix(M11='"+h+"', M12='"+-f+"', M21='"+f+"', M22='"+h+"', sizingmethod='auto expand');"}},getBGColor:function(a){var b="#FFFFFF";if(a.style){var c=a.style.backgroundColor;""!==c?b=c:a.parentNode&&(b=this.getBGColor(a.parentNode))}return b},
set:function(a){var b=new d.AmDObject("group",this.D);this.D.container.appendChild(b.node);if(a){var c;for(c=0;c<a.length;c++)b.push(a[c])}return b},gradient:function(a,b,c,d){var h="";"radialGradient"==b&&(b="gradientradial",c.reverse());"linearGradient"==b&&(b="gradient");var f;for(f=0;f<c.length;f++)h+=Math.round(100*f/(c.length-1))+"% "+c[f],f<c.length-1&&(h+=",");a=a.fill;90==d?d=0:270==d?d=180:180==d?d=90:0===d&&(d=270);8===document.documentMode?(a.type=b,a.angle=d):(a.setAttribute("type",b),
a.setAttribute("angle",d));h&&(a.colors.value=h)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);this.D.remove(a.node)},disableSelection:function(a){void 0!==typeof a.onselectstart&&(a.onselectstart=function(){return!1});a.style.cursor="default"},pattern:function(a,b,c,e){c=a.node;a=a.fill;var h="none";b.color&&(h=b.color);c.fillColor=h;b=b.url;d.isAbsolute(b)||(b=e+b);8===document.documentMode?(a.type="tile",a.src=b):(a.setAttribute("type","tile"),a.setAttribute("src",b))},update:function(){}})})();
(function(){var d=window.AmCharts;d.SVGRenderer=d.Class({construct:function(a){this.D=a;this.animations=[]},create:function(a,b){return document.createElementNS(d.SVG_NS,b)},attr:function(a,b){for(var c in b)b.hasOwnProperty(c)&&this.setAttr(a,c,b[c])},setAttr:function(a,b,c){void 0!==c&&a.node.setAttribute(b,c)},animate:function(a,b,c,e,h){a.animationFinished=!1;var f=a.node;a["an_"+b]&&d.removeFromArray(this.animations,a["an_"+b]);"translate"==b?(f=(f=f.getAttribute("transform"))?String(f).substring(10,
f.length-1):"0,0",f=f.split(", ").join(" "),f=f.split(" ").join(","),0===f&&(f="0,0")):f=Number(f.getAttribute(b));c={obj:a,frame:0,attribute:b,from:f,to:c,time:e,effect:h};this.animations.push(c);a["an_"+b]=c},update:function(){var a,b=this.animations;for(a=b.length-1;0<=a;a--){var c=b[a],e=c.time*d.updateRate,h=c.frame+1,f=c.obj,g=c.attribute,k,l,m;h<=e?(c.frame++,"translate"==g?(k=c.from.split(","),g=Number(k[0]),k=Number(k[1]),isNaN(k)&&(k=0),l=c.to.split(","),m=Number(l[0]),l=Number(l[1]),m=
0===m-g?m:Math.round(d[c.effect](0,h,g,m-g,e)),c=0===l-k?l:Math.round(d[c.effect](0,h,k,l-k,e)),g="transform",c="translate("+m+","+c+")"):(l=Number(c.from),k=Number(c.to),m=k-l,c=d[c.effect](0,h,l,m,e),isNaN(c)&&(c=k),0===m&&this.animations.splice(a,1)),this.setAttr(f,g,c)):("translate"==g?(l=c.to.split(","),m=Number(l[0]),l=Number(l[1]),f.translate(m,l)):(k=Number(c.to),this.setAttr(f,g,k)),f.animationFinished=!0,this.animations.splice(a,1))}},getBBox:function(a){if(a=a.node)try{return a.getBBox()}catch(b){}return{width:0,
height:0,x:0,y:0}},path:function(a,b){a.node.setAttributeNS(d.SVG_XLINK,"xlink:href",b)},clipRect:function(a,b,c,e,h){var f=a.node,g=a.clipPath;g&&this.D.remove(g);var k=f.parentNode;k&&(f=document.createElementNS(d.SVG_NS,"clipPath"),g=d.getUniqueId(),f.setAttribute("id",g),this.D.rect(b,c,e,h,0,0,f),k.appendChild(f),b="#",d.baseHref&&!d.isIE&&(b=this.removeTarget(window.location.href)+b),this.setAttr(a,"clip-path","url("+b+g+")"),this.clipPathC++,a.clipPath=f)},text:function(a,b,c){var e=new d.AmDObject("text",
this.D);a=String(a).split("\n");var h=d.removePx(b["font-size"]),f;for(f=0;f<a.length;f++){var g=this.create(null,"tspan");g.appendChild(document.createTextNode(a[f]));g.setAttribute("y",(h+2)*f+Math.round(h/2));g.setAttribute("x",0);e.node.appendChild(g)}e.node.setAttribute("y",Math.round(h/2));this.attr(e,b);this.D.addToContainer(e.node,c);return e},setText:function(a,b){var c=a.node;c&&(c.removeChild(c.firstChild),c.appendChild(document.createTextNode(b)))},move:function(a,b,c,d){isNaN(b)&&(b=
0);isNaN(c)&&(c=0);b="translate("+b+","+c+")";d&&(b=b+" scale("+d+")");this.setAttr(a,"transform",b)},rotate:function(a,b){var c=a.node.getAttribute("transform"),d="rotate("+b+")";c&&(d=c+" "+d);this.setAttr(a,"transform",d)},set:function(a){var b=new d.AmDObject("g",this.D);this.D.container.appendChild(b.node);if(a){var c;for(c=0;c<a.length;c++)b.push(a[c])}return b},addListener:function(a,b,c){a.node["on"+b]=c},gradient:function(a,b,c,e){var h=a.node,f=a.grad;f&&this.D.remove(f);b=document.createElementNS(d.SVG_NS,
b);f=d.getUniqueId();b.setAttribute("id",f);if(!isNaN(e)){var g=0,k=0,l=0,m=0;90==e?l=100:270==e?m=100:180==e?g=100:0===e&&(k=100);b.setAttribute("x1",g+"%");b.setAttribute("x2",k+"%");b.setAttribute("y1",l+"%");b.setAttribute("y2",m+"%")}for(e=0;e<c.length;e++)g=document.createElementNS(d.SVG_NS,"stop"),k=100*e/(c.length-1),0===e&&(k=0),g.setAttribute("offset",k+"%"),g.setAttribute("stop-color",c[e]),b.appendChild(g);h.parentNode.appendChild(b);c="#";d.baseHref&&!d.isIE&&(c=this.removeTarget(window.location.href)+
c);h.setAttribute("fill","url("+c+f+")");a.grad=b},removeTarget:function(a){return a.split("#")[0]},pattern:function(a,b,c,e){var h=a.node;isNaN(c)&&(c=1);var f=a.patternNode;f&&this.D.remove(f);var f=document.createElementNS(d.SVG_NS,"pattern"),g=d.getUniqueId(),k=b;b.url&&(k=b.url);d.isAbsolute(k)||(k=e+k);e=Number(b.width);isNaN(e)&&(e=4);var l=Number(b.height);isNaN(l)&&(l=4);e/=c;l/=c;c=b.x;isNaN(c)&&(c=0);var m=-Math.random()*Number(b.randomX);isNaN(m)||(c=m);m=b.y;isNaN(m)&&(m=0);var n=-Math.random()*
Number(b.randomY);isNaN(n)||(m=n);f.setAttribute("id",g);f.setAttribute("width",e);f.setAttribute("height",l);f.setAttribute("patternUnits","userSpaceOnUse");f.setAttribute("xlink:href",k);b.color&&(n=document.createElementNS(d.SVG_NS,"rect"),n.setAttributeNS(null,"height",e),n.setAttributeNS(null,"width",l),n.setAttributeNS(null,"fill",b.color),f.appendChild(n));this.D.image(k,0,0,e,l,f).translate(c,m);k="#";d.baseHref&&!d.isIE&&(k=this.removeTarget(window.location.href)+k);h.setAttribute("fill",
"url("+k+g+")");a.patternNode=f;h.parentNode.appendChild(f)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}})})();
(function(){var d=window.AmCharts;d.AmLegend=d.Class({construct:function(a){this.enabled=!0;this.cname="AmLegend";this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","rollOverItem","rollOutItem","clickLabel");this.position="bottom";this.borderColor=this.color="#000000";this.borderAlpha=0;this.markerLabelGap=5;this.verticalGap=10;this.align="left";this.horizontalGap=0;this.spacing=10;this.markerDisabledColor="#AAB3B3";this.markerType=
"square";this.markerSize=16;this.markerBorderThickness=this.markerBorderAlpha=1;this.marginBottom=this.marginTop=0;this.marginLeft=this.marginRight=20;this.autoMargins=!0;this.valueWidth=50;this.switchable=!0;this.switchType="x";this.switchColor="#FFFFFF";this.rollOverColor="#CC0000";this.reversedOrder=!1;this.labelText="[[title]]";this.valueText="[[value]]";this.useMarkerColorForLabels=!1;this.rollOverGraphAlpha=1;this.textClickEnabled=!1;this.equalWidths=!0;this.backgroundColor="#FFFFFF";this.backgroundAlpha=
0;this.useGraphSettings=!1;this.showEntries=!0;d.applyTheme(this,a,this.cname)},setData:function(a){this.legendData=a;this.invalidateSize()},invalidateSize:function(){this.destroy();this.entries=[];this.valueLabels=[];var a=this.legendData;this.enabled&&(d.ifArray(a)||d.ifArray(this.data))&&this.drawLegend()},drawLegend:function(){var a=this.chart,b=this.position,c=this.width,e=a.divRealWidth,h=a.divRealHeight,f=this.div,g=this.legendData;this.data&&(g=this.data);isNaN(this.fontSize)&&(this.fontSize=
a.fontSize);if("right"==b||"left"==b)this.maxColumns=1,this.autoMargins&&(this.marginLeft=this.marginRight=10);else if(this.autoMargins){this.marginRight=a.marginRight;this.marginLeft=a.marginLeft;var k=a.autoMarginOffset;"bottom"==b?(this.marginBottom=k,this.marginTop=0):(this.marginTop=k,this.marginBottom=0)}c=void 0!==c?d.toCoordinate(c,e):"right"!=b&&"left"!=b?a.realWidth:0<this.ieW?this.ieW:a.realWidth;"outside"==b?(c=f.offsetWidth,h=f.offsetHeight,f.clientHeight&&(c=f.clientWidth,h=f.clientHeight)):
(isNaN(c)||(f.style.width=c+"px"),f.className="amChartsLegend "+a.classNamePrefix+"-legend-div");this.divWidth=c;(b=this.container)?(b.container.innerHTML="",f.appendChild(b.container),b.width=c,b.height=h,b.setSize(c,h),b.addDefs(a)):b=new d.AmDraw(f,c,h,a);this.container=b;this.lx=0;this.ly=8;h=this.markerSize;h>this.fontSize&&(this.ly=h/2-1);0<h&&(this.lx+=h+this.markerLabelGap);this.titleWidth=0;if(h=this.title)h=d.text(this.container,h,this.color,a.fontFamily,this.fontSize,"start",!0),d.setCN(a,
h,"legend-title"),h.translate(this.marginLeft,this.marginTop+this.verticalGap+this.ly+1),a=h.getBBox(),this.titleWidth=a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<g.length;a++)this.createEntry(g[a]);for(a=this.index=0;a<g.length;a++)this.createValue(g[a])}this.arrangeEntries();this.updateValues()},arrangeEntries:function(){var a=this.position,b=this.marginLeft+this.titleWidth,c=this.marginRight,e=this.marginTop,h=this.marginBottom,f=this.horizontalGap,
g=this.div,k=this.divWidth,l=this.maxColumns,m=this.verticalGap,n=this.spacing,q=k-c-b,p=0,t=0,r=this.container;this.set&&this.set.remove();var u=r.set();this.set=u;var y=r.set();u.push(y);var x=this.entries,w,B;for(B=0;B<x.length;B++){w=x[B].getBBox();var z=w.width;z>p&&(p=z);w=w.height;w>t&&(t=w)}var z=t=0,A=f,C=0,D=0;for(B=0;B<x.length;B++){var J=x[B];this.reversedOrder&&(J=x[x.length-B-1]);w=J.getBBox();var H;this.equalWidths?H=z*(p+n+this.markerLabelGap):(H=A,A=A+w.width+f+n);w.height>D&&(D=
w.height);H+w.width>q&&0<B&&0!==z&&(t++,H=z=0,A=H+w.width+f+n,C=C+D+m,D=0);J.translate(H,C);z++;!isNaN(l)&&z>=l&&(z=0,t++,C=C+D+m,A=f,D=0);y.push(J)}w=y.getBBox();l=w.height+2*m-1;"left"==a||"right"==a?(n=w.width+2*f,k=n+b+c,g.style.width=k+"px",this.ieW=k):n=k-b-c-1;c=d.polygon(this.container,[0,n,n,0],[0,0,l,l],this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);d.setCN(this.chart,c,"legend-bg");u.push(c);u.translate(b,e);c.toBack();b=f;if("top"==a||"bottom"==a||"absolute"==
a||"outside"==a)"center"==this.align?b=f+(n-w.width)/2:"right"==this.align&&(b=f+n-w.width);y.translate(b,m+1);this.titleHeight>l&&(l=this.titleHeight);a=l+e+h+1;0>a&&(a=0);a>this.chart.divRealHeight&&(g.style.top="0px");g.style.height=Math.round(a)+"px";r.setSize(this.divWidth,a)},createEntry:function(a){if(!1!==a.visibleInLegend&&!a.hideFromLegend){var b=this.chart,c=a.markerType;a.legendEntryWidth=this.markerSize;c||(c=this.markerType);var e=a.color,h=a.alpha;a.legendKeyColor&&(e=a.legendKeyColor());
a.legendKeyAlpha&&(h=a.legendKeyAlpha());var f;!0===a.hidden&&(f=e=this.markerDisabledColor);var g=a.pattern,k=a.customMarker;k||(k=this.customMarker);var l=this.container,m=this.markerSize,n=0,q=0,p=m/2;if(this.useGraphSettings){c=a.type;this.switchType=void 0;if("line"==c||"step"==c||"smoothedLine"==c||"ohlc"==c)g=l.set(),a.hidden||(e=a.lineColorR,f=a.bulletBorderColorR),n=d.line(l,[0,2*m],[m/2,m/2],e,a.lineAlpha,a.lineThickness,a.dashLength),d.setCN(b,n,"graph-stroke"),g.push(n),a.bullet&&(a.hidden||
(e=a.bulletColorR),n=d.bullet(l,a.bullet,a.bulletSize,e,a.bulletAlpha,a.bulletBorderThickness,f,a.bulletBorderAlpha))&&(d.setCN(b,n,"graph-bullet"),n.translate(m+1,m/2),g.push(n)),p=0,n=m,q=m/3;else{var t;a.getGradRotation&&(t=a.getGradRotation(),0===t&&(t=180));n=a.fillColorsR;!0===a.hidden&&(n=e);if(g=this.createMarker("rectangle",n,a.fillAlphas,a.lineThickness,e,a.lineAlpha,t,g,a.dashLength))p=m,g.translate(p,m/2);n=m}d.setCN(b,g,"graph-"+c);d.setCN(b,g,"graph-"+a.id)}else if(k)g=l.image(k,0,0,
m,m);else{var r;isNaN(this.gradientRotation)||(r=180+this.gradientRotation);(g=this.createMarker(c,e,h,void 0,void 0,void 0,r,g))&&g.translate(m/2,m/2)}d.setCN(b,g,"legend-marker");this.addListeners(g,a);l=l.set([g]);this.switchable&&a.switchable&&l.setAttr("cursor","pointer");void 0!==a.id&&d.setCN(b,l,"legend-item-"+a.id);d.setCN(b,l,a.className,!0);(f=this.switchType)&&"none"!=f&&0<m&&("x"==f?(t=this.createX(),t.translate(m/2,m/2)):t=this.createV(),t.dItem=a,!0!==a.hidden?"x"==f?t.hide():t.show():
"x"!=f&&t.hide(),this.switchable||t.hide(),this.addListeners(t,a),a.legendSwitch=t,l.push(t),d.setCN(b,t,"legend-switch"));f=this.color;a.showBalloon&&this.textClickEnabled&&void 0!==this.selectedColor&&(f=this.selectedColor);this.useMarkerColorForLabels&&(f=e);!0===a.hidden&&(f=this.markerDisabledColor);e=d.massReplace(this.labelText,{"[[title]]":a.title});t=this.fontSize;g&&(m<=t&&g.translate(p,m/2+this.ly-t/2+(t+2-m)/2-q),a.legendEntryWidth=g.getBBox().width);var u;e&&(e=d.fixBrakes(e),a.legendTextReal=
e,u=this.labelWidth,u=isNaN(u)?d.text(this.container,e,f,b.fontFamily,t,"start"):d.wrappedText(this.container,e,f,b.fontFamily,t,"start",!1,u,0),d.setCN(b,u,"legend-label"),u.translate(this.lx+n,this.ly),l.push(u),b=u.getBBox().width,this.maxLabelWidth<b&&(this.maxLabelWidth=b));this.entries[this.index]=l;a.legendEntry=this.entries[this.index];a.legendLabel=u;this.index++}},addListeners:function(a,b){var c=this;a&&a.mouseover(function(a){c.rollOverMarker(b,a)}).mouseout(function(a){c.rollOutMarker(b,
a)}).click(function(a){c.clickMarker(b,a)})},rollOverMarker:function(a,b){this.switchable&&this.dispatch("rollOverMarker",a,b);this.dispatch("rollOverItem",a,b)},rollOutMarker:function(a,b){this.switchable&&this.dispatch("rollOutMarker",a,b);this.dispatch("rollOutItem",a,b)},clickMarker:function(a,b){this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b));this.dispatch("clickMarker",a,b)},rollOverLabel:function(a,b){a.hidden||(this.textClickEnabled&&a.legendLabel&&
a.legendLabel.attr({fill:this.rollOverColor}),this.dispatch("rollOverItem",a,b))},rollOutLabel:function(a,b){if(!a.hidden){if(this.textClickEnabled&&a.legendLabel){var c=this.color;void 0!==this.selectedColor&&a.showBalloon&&(c=this.selectedColor);this.useMarkerColorForLabels&&(c=a.lineColor,void 0===c&&(c=a.color));a.legendLabel.attr({fill:c})}this.dispatch("rollOutItem",a,b)}},clickLabel:function(a,b){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a,b):this.switchable&&(!0===a.hidden?
this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b))},dispatch:function(a,b,c){a={type:a,dataItem:b,target:this,event:c,chart:this.chart};this.chart&&this.chart.handleLegendEvent(a);this.fire(a)},createValue:function(a){var b=this,c=b.fontSize,e=b.chart;if(!1!==a.visibleInLegend&&!a.hideFromLegend){var h=b.maxLabelWidth;b.forceWidth&&(h=b.labelWidth);b.equalWidths||(b.valueAlign="left");"left"==b.valueAlign&&(h=a.legendEntry.getBBox().width);var f=h;if(b.valueText&&0<b.valueWidth){var g=b.color;
b.useMarkerColorForValues&&(g=a.color,a.legendKeyColor&&(g=a.legendKeyColor()));!0===a.hidden&&(g=b.markerDisabledColor);var k=b.valueText,h=h+b.lx+b.markerLabelGap+b.valueWidth,l="end";"left"==b.valueAlign&&(h-=b.valueWidth,l="start");g=d.text(b.container,k,g,b.chart.fontFamily,c,l);d.setCN(e,g,"legend-value");g.translate(h,b.ly);b.entries[b.index].push(g);f+=b.valueWidth+2*b.markerLabelGap;g.dItem=a;b.valueLabels.push(g)}b.index++;e=b.markerSize;e<c+7&&(e=c+7,d.VML&&(e+=3));c=b.container.rect(a.legendEntryWidth,
0,f,e,0,0).attr({stroke:"none",fill:"#fff","fill-opacity":.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(c){b.rollOverLabel(a,c)}).mouseout(function(c){b.rollOutLabel(a,c)}).click(function(c){b.clickLabel(a,c)})}},createV:function(){var a=this.markerSize;return d.polygon(this.container,[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=(this.markerSize-4)/2,b={stroke:this.switchColor,"stroke-width":3},c=this.container,e=d.line(c,[-a,a],[-a,a]).attr(b),
a=d.line(c,[-a,a],[a,-a]).attr(b);return this.container.set([e,a])},createMarker:function(a,b,c,e,h,f,g,k,l){var m=this.markerSize,n=this.container;h||(h=this.markerBorderColor);h||(h=b);isNaN(e)&&(e=this.markerBorderThickness);isNaN(f)&&(f=this.markerBorderAlpha);return d.bullet(n,a,m,b,c,e,h,f,m,g,k,this.chart.path,l)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,e=this.data;if(a)for(c=0;c<a.length;c++){var h=a[c],f=h.dItem,g=" ";if(e)f.value?
h.text(f.value):h.text("");else{var k;if(void 0!==f.type){k=f.currentDataItem;var l=this.periodValueText;f.legendPeriodValueText&&(l=f.legendPeriodValueText);k?(g=this.valueText,f.legendValueText&&(g=f.legendValueText),g=b.formatString(g,k)):l&&b.formatPeriodString&&(l=d.massReplace(l,{"[[title]]":f.title}),g=b.formatPeriodString(l,f))}else g=b.formatString(this.valueText,f);if(l=this.valueFunction)k&&(f=k),g=l(f,g);h.text(g)}}},renderFix:function(){if(!d.VML&&this.enabled){var a=this.container;a&&
a.renderFix()}},destroy:function(){this.div.innerHTML="";d.remove(this.set)}})})();
(function(){var d=window.AmCharts;d.formatMilliseconds=function(a,b){if(-1!=a.indexOf("fff")){var c=b.getMilliseconds(),d=String(c);10>c&&(d="00"+c);10<=c&&100>c&&(d="0"+c);a=a.replace(/fff/g,d)}return a};d.extractPeriod=function(a){var b=d.stripNumbers(a),c=1;b!=a&&(c=Number(a.slice(0,a.indexOf(b))));return{period:b,count:c}};d.getDate=function(a,b,c){return a instanceof Date?d.newDate(a,c):b&&isNaN(a)?d.stringToDate(a,b):new Date(a)};d.daysInMonth=function(a){return(new Date(a.getYear(),a.getMonth()+
1,0)).getDate()};d.newDate=function(a,b){return b&&-1==b.indexOf("fff")?new Date(a):new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds())};d.resetDateToMin=function(a,b,c,e){void 0===e&&(e=1);var h,f,g,k,l,m,n;d.useUTC?(h=a.getUTCFullYear(),f=a.getUTCMonth(),g=a.getUTCDate(),k=a.getUTCHours(),l=a.getUTCMinutes(),m=a.getUTCSeconds(),n=a.getUTCMilliseconds(),a=a.getUTCDay()):(h=a.getFullYear(),f=a.getMonth(),g=a.getDate(),k=a.getHours(),l=
a.getMinutes(),m=a.getSeconds(),n=a.getMilliseconds(),a=a.getDay());switch(b){case "YYYY":h=Math.floor(h/c)*c;f=0;g=1;n=m=l=k=0;break;case "MM":f=Math.floor(f/c)*c;g=1;n=m=l=k=0;break;case "WW":g=a>=e?g-a+e:g-(7+a)+e;n=m=l=k=0;break;case "DD":n=m=l=k=0;break;case "hh":k=Math.floor(k/c)*c;n=m=l=0;break;case "mm":l=Math.floor(l/c)*c;n=m=0;break;case "ss":m=Math.floor(m/c)*c;n=0;break;case "fff":n=Math.floor(n/c)*c}d.useUTC?(a=new Date,a.setUTCFullYear(h,f,g),a.setUTCHours(k,l,m,n)):a=new Date(h,f,g,
k,l,m,n);return a};d.getPeriodDuration=function(a,b){void 0===b&&(b=1);var c;switch(a){case "YYYY":c=316224E5;break;case "MM":c=26784E5;break;case "WW":c=6048E5;break;case "DD":c=864E5;break;case "hh":c=36E5;break;case "mm":c=6E4;break;case "ss":c=1E3;break;case "fff":c=1}return c*b};d.intervals={s:{nextInterval:"ss",contains:1E3},ss:{nextInterval:"mm",contains:60,count:0},mm:{nextInterval:"hh",contains:60,count:1},hh:{nextInterval:"DD",contains:24,count:2},DD:{nextInterval:"",contains:Infinity,count:3}};
d.getMaxInterval=function(a,b){var c=d.intervals;return a>=c[b].contains?(a=Math.round(a/c[b].contains),b=c[b].nextInterval,d.getMaxInterval(a,b)):"ss"==b?c[b].nextInterval:b};d.dayNames="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ");d.shortDayNames="Sun Mon Tue Wed Thu Fri Sat".split(" ");d.monthNames="January February March April May June July August September October November December".split(" ");d.shortMonthNames="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
d.getWeekNumber=function(a){a=new Date(a);a.setHours(0,0,0);a.setDate(a.getDate()+4-(a.getDay()||7));var b=new Date(a.getFullYear(),0,1);return Math.ceil(((a-b)/864E5+1)/7)};d.stringToDate=function(a,b){var c={},e=[{pattern:"YYYY",period:"year"},{pattern:"YY",period:"year"},{pattern:"MM",period:"month"},{pattern:"M",period:"month"},{pattern:"DD",period:"date"},{pattern:"D",period:"date"},{pattern:"JJ",period:"hours"},{pattern:"J",period:"hours"},{pattern:"HH",period:"hours"},{pattern:"H",period:"hours"},
{pattern:"KK",period:"hours"},{pattern:"K",period:"hours"},{pattern:"LL",period:"hours"},{pattern:"L",period:"hours"},{pattern:"NN",period:"minutes"},{pattern:"N",period:"minutes"},{pattern:"SS",period:"seconds"},{pattern:"S",period:"seconds"},{pattern:"QQQ",period:"milliseconds"},{pattern:"QQ",period:"milliseconds"},{pattern:"Q",period:"milliseconds"}],h=!0,f=b.indexOf("AA");-1!=f&&(a.substr(f,2),"pm"==a.toLowerCase&&(h=!1));var f=b,g,k,l;for(l=0;l<e.length;l++)k=e[l].period,c[k]=0,"date"==k&&(c[k]=
1);for(l=0;l<e.length;l++)if(g=e[l].pattern,k=e[l].period,-1!=b.indexOf(g)){var m=d.getFromDateString(g,a,f);b=b.replace(g,"");if("KK"==g||"K"==g||"LL"==g||"L"==g)h||(m+=12);c[k]=m}d.useUTC?(e=new Date,e.setUTCFullYear(c.year,c.month,c.date),e.setUTCHours(c.hours,c.minutes,c.seconds,c.milliseconds)):e=new Date(c.year,c.month,c.date,c.hours,c.minutes,c.seconds,c.milliseconds);return e};d.getFromDateString=function(a,b,c){if(void 0!==b)return c=c.indexOf(a),b=String(b),b=b.substr(c,a.length),"0"==b.charAt(0)&&
(b=b.substr(1,b.length-1)),b=Number(b),isNaN(b)&&(b=0),-1!=a.indexOf("M")&&b--,b};d.formatDate=function(a,b,c){c||(c=d);var e,h,f,g,k,l,m,n,q=d.getWeekNumber(a);d.useUTC?(e=a.getUTCFullYear(),h=a.getUTCMonth(),f=a.getUTCDate(),g=a.getUTCDay(),k=a.getUTCHours(),l=a.getUTCMinutes(),m=a.getUTCSeconds(),n=a.getUTCMilliseconds()):(e=a.getFullYear(),h=a.getMonth(),f=a.getDate(),g=a.getDay(),k=a.getHours(),l=a.getMinutes(),m=a.getSeconds(),n=a.getMilliseconds());var p=String(e).substr(2,2),t="0"+g;b=b.replace(/W/g,
q);q=k;24==q&&(q=0);var r=q;10>r&&(r="0"+r);b=b.replace(/JJ/g,r);b=b.replace(/J/g,q);r=k;0===r&&(r=24,-1!=b.indexOf("H")&&(f--,0===f&&(e=new Date(a),e.setDate(e.getDate()-1),h=e.getMonth(),f=e.getDate(),e=e.getFullYear())));a=h+1;9>h&&(a="0"+a);q=f;10>f&&(q="0"+f);var u=r;10>u&&(u="0"+u);b=b.replace(/HH/g,u);b=b.replace(/H/g,r);r=k;11<r&&(r-=12);u=r;10>u&&(u="0"+u);b=b.replace(/KK/g,u);b=b.replace(/K/g,r);r=k;0===r&&(r=12);12<r&&(r-=12);u=r;10>u&&(u="0"+u);b=b.replace(/LL/g,u);b=b.replace(/L/g,r);
r=l;10>r&&(r="0"+r);b=b.replace(/NN/g,r);b=b.replace(/N/g,l);l=m;10>l&&(l="0"+l);b=b.replace(/SS/g,l);b=b.replace(/S/g,m);m=n;10>m&&(m="00"+m);100>m&&(m="0"+m);l=n;10>l&&(l="00"+l);b=b.replace(/QQQ/g,m);b=b.replace(/QQ/g,l);b=b.replace(/Q/g,n);b=12>k?b.replace(/A/g,c.amString):b.replace(/A/g,c.pmString);b=b.replace(/YYYY/g,"@IIII@");b=b.replace(/YY/g,"@II@");b=b.replace(/MMMM/g,"@XXXX@");b=b.replace(/MMM/g,"@XXX@");b=b.replace(/MM/g,"@XX@");b=b.replace(/M/g,"@X@");b=b.replace(/DD/g,"@RR@");b=b.replace(/D/g,
"@R@");b=b.replace(/EEEE/g,"@PPPP@");b=b.replace(/EEE/g,"@PPP@");b=b.replace(/EE/g,"@PP@");b=b.replace(/E/g,"@P@");b=b.replace(/@IIII@/g,e);b=b.replace(/@II@/g,p);b=b.replace(/@XXXX@/g,c.monthNames[h]);b=b.replace(/@XXX@/g,c.shortMonthNames[h]);b=b.replace(/@XX@/g,a);b=b.replace(/@X@/g,h+1);b=b.replace(/@RR@/g,q);b=b.replace(/@R@/g,f);b=b.replace(/@PPPP@/g,c.dayNames[g]);b=b.replace(/@PPP@/g,c.shortDayNames[g]);b=b.replace(/@PP@/g,t);return b=b.replace(/@P@/g,g)};d.changeDate=function(a,b,c,e,h){if(d.useUTC)return d.changeUTCDate(a,
b,c,e,h);var f=-1;void 0===e&&(e=!0);void 0===h&&(h=!1);!0===e&&(f=1);switch(b){case "YYYY":a.setFullYear(a.getFullYear()+c*f);e||h||a.setDate(a.getDate()+1);break;case "MM":b=a.getMonth();a.setMonth(a.getMonth()+c*f);a.getMonth()>b+c*f&&a.setDate(a.getDate()-1);e||h||a.setDate(a.getDate()+1);break;case "DD":a.setDate(a.getDate()+c*f);break;case "WW":a.setDate(a.getDate()+c*f*7);break;case "hh":a.setHours(a.getHours()+c*f);break;case "mm":a.setMinutes(a.getMinutes()+c*f);break;case "ss":a.setSeconds(a.getSeconds()+
c*f);break;case "fff":a.setMilliseconds(a.getMilliseconds()+c*f)}return a};d.changeUTCDate=function(a,b,c,d,h){var f=-1;void 0===d&&(d=!0);void 0===h&&(h=!1);!0===d&&(f=1);switch(b){case "YYYY":a.setUTCFullYear(a.getUTCFullYear()+c*f);d||h||a.setUTCDate(a.getUTCDate()+1);break;case "MM":b=a.getUTCMonth();a.setUTCMonth(a.getUTCMonth()+c*f);a.getUTCMonth()>b+c*f&&a.setUTCDate(a.getUTCDate()-1);d||h||a.setUTCDate(a.getUTCDate()+1);break;case "DD":a.setUTCDate(a.getUTCDate()+c*f);break;case "WW":a.setUTCDate(a.getUTCDate()+
c*f*7);break;case "hh":a.setUTCHours(a.getUTCHours()+c*f);break;case "mm":a.setUTCMinutes(a.getUTCMinutes()+c*f);break;case "ss":a.setUTCSeconds(a.getUTCSeconds()+c*f);break;case "fff":a.setUTCMilliseconds(a.getUTCMilliseconds()+c*f)}return a}})();(function(){var k=window.AmCharts;k.AmSlicedChart=k.Class({inherits:k.AmChart,construct:function(a){this.createEvents("rollOverSlice","rollOutSlice","clickSlice","pullOutSlice","pullInSlice","rightClickSlice");k.AmSlicedChart.base.construct.call(this,a);this.colors="#FF0F00 #FF6600 #FF9E01 #FCD202 #F8FF01 #B0DE09 #04D215 #0D8ECF #0D52D1 #2A0CD0 #8A0CCF #CD0D74 #754DEB #DDDDDD #999999 #333333 #000000 #57032A #CA9726 #990000 #4B0C25".split(" ");this.alpha=1;this.groupPercent=0;this.groupedTitle="Other";
this.groupedPulled=!1;this.groupedAlpha=1;this.marginLeft=0;this.marginBottom=this.marginTop=10;this.marginRight=0;this.hoverAlpha=1;this.outlineColor="#FFFFFF";this.outlineAlpha=0;this.outlineThickness=1;this.startAlpha=0;this.startDuration=1;this.startEffect="bounce";this.sequencedAnimation=!0;this.pullOutDuration=1;this.pullOutEffect="bounce";this.pullOnHover=this.pullOutOnlyOne=!1;this.labelsEnabled=!0;this.labelTickColor="#000000";this.labelTickAlpha=.2;this.hideLabelsPercent=0;this.urlTarget=
"_self";this.autoMarginOffset=10;this.gradientRatio=[];this.maxLabelWidth=200;k.applyTheme(this,a,"AmSlicedChart")},initChart:function(){k.AmSlicedChart.base.initChart.call(this);this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,this.setLegendData(this.chartData));this.drawChart()},handleLegendEvent:function(a){var b=a.type,c=a.dataItem,d=this.legend;if(!d.data&&c){var g=c.hidden;a=a.event;switch(b){case "clickMarker":g||d.switchable||this.clickSlice(c,a);break;case "clickLabel":g||
this.clickSlice(c,a,!1);break;case "rollOverItem":g||this.rollOverSlice(c,!1,a);break;case "rollOutItem":g||this.rollOutSlice(c,a);break;case "hideItem":this.hideSlice(c,a);break;case "showItem":this.showSlice(c,a)}}},invalidateVisibility:function(){this.recalculatePercents();this.initChart();var a=this.legend;a&&a.invalidateSize()},addEventListeners:function(a,b){var c=this;a.mouseover(function(a){c.rollOverSlice(b,!0,a)}).mouseout(function(a){c.rollOutSlice(b,a)}).touchend(function(a){c.rollOverSlice(b,
a)}).touchstart(function(a){}).mouseup(function(a){c.clickSlice(b,a)}).contextmenu(function(a){c.handleRightClick(b,a)})},formatString:function(a,b,c){a=k.formatValue(a,b,["value"],this.nf,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);var d=this.pf.precision;isNaN(this.tempPrec)||(this.pf.precision=this.tempPrec);a=k.formatValue(a,b,["percents"],this.pf);a=k.massReplace(a,{"[[title]]":b.title,"[[description]]":b.description});this.pf.precision=d;-1!=a.indexOf("[[")&&(a=
k.formatDataContextValue(a,b.dataContext));a=c?k.fixNewLines(a):k.fixBrakes(a);return a=k.cleanFromEmpty(a)},startSlices:function(){var a;for(a=0;a<this.chartData.length;a++)0<this.startDuration&&this.sequencedAnimation?this.setStartTO(a):this.startSlice(this.chartData[a])},setStartTO:function(a){var b=this;a=setTimeout(function(){b.startSequenced.call(b)},b.startDuration/b.chartData.length*500*a);b.timeOuts.push(a)},pullSlices:function(a){var b=this.chartData,c;for(c=0;c<b.length;c++){var d=b[c];
d.pulled&&this.pullSlice(d,1,a)}},startSequenced:function(){var a=this.chartData,b;for(b=0;b<a.length;b++)if(!a[b].started){this.startSlice(this.chartData[b]);break}},startSlice:function(a){a.started=!0;var b=a.wedge,c=this.startDuration,d=a.labelSet;b&&0<c&&(0<a.alpha&&b.show(),b.translate(a.startX,a.startY),this.animatable.push(b),b.animate({opacity:1,translate:"0,0"},c,this.startEffect));d&&0<c&&(0<a.alpha&&d.show(),d.translate(a.startX,a.startY),d.animate({opacity:1,translate:"0,0"},c,this.startEffect))},
showLabels:function(){var a=this.chartData,b;for(b=0;b<a.length;b++){var c=a[b];if(0<c.alpha){var d=c.label;d&&d.show();(c=c.tick)&&c.show()}}},showSlice:function(a){isNaN(a)?a.hidden=!1:this.chartData[a].hidden=!1;this.invalidateVisibility()},hideSlice:function(a){isNaN(a)?a.hidden=!0:this.chartData[a].hidden=!0;this.hideBalloon();this.invalidateVisibility()},rollOverSlice:function(a,b,c){isNaN(a)||(a=this.chartData[a]);clearTimeout(this.hoverInt);if(!a.hidden){this.pullOnHover&&this.pullSlice(a,
1);1>this.hoverAlpha&&a.wedge&&a.wedge.attr({opacity:this.hoverAlpha});var d=a.balloonX,g=a.balloonY;a.pulled&&(d+=a.pullX,g+=a.pullY);var f=this.formatString(this.balloonText,a,!0),h=this.balloonFunction;h&&(f=h(a,f));h=k.adjustLuminosity(a.color,-.15);f?this.showBalloon(f,h,b,d,g):this.hideBalloon();0===a.value&&this.hideBalloon();this.fire({type:"rollOverSlice",dataItem:a,chart:this,event:c})}},rollOutSlice:function(a,b){isNaN(a)||(a=this.chartData[a]);a.wedge&&a.wedge.attr({opacity:1});this.hideBalloon();
this.fire({type:"rollOutSlice",dataItem:a,chart:this,event:b})},clickSlice:function(a,b,c){isNaN(a)||(a=this.chartData[a]);a.pulled?this.pullSlice(a,0):this.pullSlice(a,1);k.getURL(a.url,this.urlTarget);c||this.fire({type:"clickSlice",dataItem:a,chart:this,event:b})},handleRightClick:function(a,b){isNaN(a)||(a=this.chartData[a]);this.fire({type:"rightClickSlice",dataItem:a,chart:this,event:b})},drawTicks:function(){var a=this.chartData,b;for(b=0;b<a.length;b++){var c=a[b];if(c.label&&!c.skipTick){var d=
c.ty,d=k.line(this.container,[c.tx0,c.tx,c.tx2],[c.ty0,d,d],this.labelTickColor,this.labelTickAlpha);k.setCN(this,d,this.type+"-tick");k.setCN(this,d,c.className,!0);c.tick=d;c.wedge.push(d)}}},initialStart:function(){var a=this,b=a.startDuration,c=setTimeout(function(){a.showLabels.call(a)},1E3*b);a.timeOuts.push(c);a.chartCreated?a.pullSlices(!0):(a.startSlices(),0<b?(b=setTimeout(function(){a.pullSlices.call(a)},1200*b),a.timeOuts.push(b)):a.pullSlices(!0))},pullSlice:function(a,b,c){var d=this.pullOutDuration;
!0===c&&(d=0);if(c=a.wedge)0<d?(c.animate({translate:b*a.pullX+","+b*a.pullY},d,this.pullOutEffect),a.labelSet&&a.labelSet.animate({translate:b*a.pullX+","+b*a.pullY},d,this.pullOutEffect)):(a.labelSet&&a.labelSet.translate(b*a.pullX,b*a.pullY),c.translate(b*a.pullX,b*a.pullY));1==b?(a.pulled=!0,this.pullOutOnlyOne&&this.pullInAll(a.index),a={type:"pullOutSlice",dataItem:a,chart:this}):(a.pulled=!1,a={type:"pullInSlice",dataItem:a,chart:this});this.fire(a)},pullInAll:function(a){var b=this.chartData,
c;for(c=0;c<this.chartData.length;c++)c!=a&&b[c].pulled&&this.pullSlice(b[c],0)},pullOutAll:function(){var a=this.chartData,b;for(b=0;b<a.length;b++)a[b].pulled||this.pullSlice(a[b],1)},parseData:function(){var a=[];this.chartData=a;var b=this.dataProvider;isNaN(this.pieAlpha)||(this.alpha=this.pieAlpha);if(void 0!==b){var c=b.length,d=0,g,f,h;for(g=0;g<c;g++){f={};var e=b[g];f.dataContext=e;null!==e[this.valueField]&&(f.value=Number(e[this.valueField]));(h=e[this.titleField])||(h="");f.title=h;f.pulled=
k.toBoolean(e[this.pulledField],!1);(h=e[this.descriptionField])||(h="");f.description=h;f.labelRadius=Number(e[this.labelRadiusField]);f.switchable=!0;f.className=e[this.classNameField];f.url=e[this.urlField];h=e[this.patternField];!h&&this.patterns&&(h=this.patterns[g]);f.pattern=h;f.visibleInLegend=k.toBoolean(e[this.visibleInLegendField],!0);h=e[this.alphaField];f.alpha=void 0!==h?Number(h):this.alpha;h=e[this.colorField];void 0!==h&&(f.color=h);f.labelColor=k.toColor(e[this.labelColorField]);
d+=f.value;f.hidden=!1;a[g]=f}for(g=b=0;g<c;g++)f=a[g],f.percents=f.value/d*100,f.percents<this.groupPercent&&b++;1<b&&(this.groupValue=0,this.removeSmallSlices(),a.push({title:this.groupedTitle,value:this.groupValue,percents:this.groupValue/d*100,pulled:this.groupedPulled,color:this.groupedColor,url:this.groupedUrl,description:this.groupedDescription,alpha:this.groupedAlpha,pattern:this.groupedPattern,className:this.groupedClassName,dataContext:{}}));c=this.baseColor;c||(c=this.pieBaseColor);d=this.brightnessStep;
d||(d=this.pieBrightnessStep);for(g=0;g<a.length;g++)c?h=k.adjustLuminosity(c,g*d/100):(h=this.colors[g],void 0===h&&(h=k.randomColor())),void 0===a[g].color&&(a[g].color=h);this.recalculatePercents()}},recalculatePercents:function(){var a=this.chartData,b=0,c,d;for(c=0;c<a.length;c++)d=a[c],!d.hidden&&0<d.value&&(b+=d.value);for(c=0;c<a.length;c++)d=this.chartData[c],d.percents=!d.hidden&&0<d.value?100*d.value/b:0},removeSmallSlices:function(){var a=this.chartData,b;for(b=a.length-1;0<=b;b--)a[b].percents<
this.groupPercent&&(this.groupValue+=a[b].value,a.splice(b,1))},animateAgain:function(){var a=this;a.startSlices();for(var b=0;b<a.chartData.length;b++){var c=a.chartData[b];c.started=!1;var d=c.wedge;d&&(d.setAttr("opacity",a.startAlpha),d.translate(c.startX,c.startY));if(d=c.labelSet)d.setAttr("opacity",a.startAlpha),d.translate(c.startX,c.startY)}b=a.startDuration;0<b?(b=setTimeout(function(){a.pullSlices.call(a)},1200*b),a.timeOuts.push(b)):a.pullSlices()},measureMaxLabel:function(){var a=this.chartData,
b=0,c;for(c=0;c<a.length;c++){var d=a[c],g=this.formatString(this.labelText,d),f=this.labelFunction;f&&(g=f(d,g));d=k.text(this.container,g,this.color,this.fontFamily,this.fontSize);g=d.getBBox().width;g>b&&(b=g);d.remove()}return b}})})();
(function(){var k=window.AmCharts;k.AmPieChart=k.Class({inherits:k.AmSlicedChart,construct:function(a){this.type="pie";k.AmPieChart.base.construct.call(this,a);this.cname="AmPieChart";this.pieBrightnessStep=30;this.minRadius=10;this.depth3D=0;this.startAngle=90;this.angle=this.innerRadius=0;this.startRadius="500%";this.pullOutRadius="20%";this.labelRadius=20;this.labelText="[[title]]: [[percents]]%";this.balloonText="[[title]]: [[percents]]% ([[value]])\n[[description]]";this.previousScale=1;this.adjustPrecision=
!1;this.gradientType="radial";k.applyTheme(this,a,this.cname)},drawChart:function(){k.AmPieChart.base.drawChart.call(this);var a=this.chartData;if(k.ifArray(a)){if(0<this.realWidth&&0<this.realHeight){k.VML&&(this.startAlpha=1);var b=this.startDuration,c=this.container,d=this.updateWidth();this.realWidth=d;var g=this.updateHeight();this.realHeight=g;var f=k.toCoordinate,h=f(this.marginLeft,d),e=f(this.marginRight,d),z=f(this.marginTop,g)+this.getTitleHeight(),n=f(this.marginBottom,g),A,B,l,x=k.toNumber(this.labelRadius),
p=this.measureMaxLabel();p>this.maxLabelWidth&&(p=this.maxLabelWidth);this.labelText&&this.labelsEnabled||(x=p=0);A=void 0===this.pieX?(d-h-e)/2+h:f(this.pieX,this.realWidth);B=void 0===this.pieY?(g-z-n)/2+z:f(this.pieY,g);l=f(this.radius,d,g);l||(d=0<=x?d-h-e-2*p:d-h-e,g=g-z-n,l=Math.min(d,g),g<d&&(l/=1-this.angle/90,l>d&&(l=d)),g=k.toCoordinate(this.pullOutRadius,l),l=(0<=x?l-1.8*(x+g):l-1.8*g)/2);l<this.minRadius&&(l=this.minRadius);g=f(this.pullOutRadius,l);z=k.toCoordinate(this.startRadius,l);
f=f(this.innerRadius,l);f>=l&&(f=l-1);n=k.fitToBounds(this.startAngle,0,360);0<this.depth3D&&(n=270<=n?270:90);n-=90;360<n&&(n-=360);d=l-l*this.angle/90;for(h=p=0;h<a.length;h++)e=a[h],!0!==e.hidden&&(p+=k.roundTo(e.percents,this.pf.precision));p=k.roundTo(p,this.pf.precision);this.tempPrec=NaN;this.adjustPrecision&&100!=p&&(this.tempPrec=this.pf.precision+1);for(var D,h=0;h<a.length;h++)if(e=a[h],!0!==e.hidden&&(this.showZeroSlices||0!==e.percents)){var r=360*e.percents/100,p=Math.sin((n+r/2)/180*
Math.PI),C=d/l*-Math.cos((n+r/2)/180*Math.PI),q=this.outlineColor;q||(q=e.color);var v=this.alpha;isNaN(e.alpha)||(v=e.alpha);q={fill:e.color,stroke:q,"stroke-width":this.outlineThickness,"stroke-opacity":this.outlineAlpha,"fill-opacity":v};e.url&&(q.cursor="pointer");q=k.wedge(c,A,B,n,r,l,d,f,this.depth3D,q,this.gradientRatio,e.pattern,this.path,this.gradientType);k.setCN(this,q,"pie-item");k.setCN(this,q.wedge,"pie-slice");k.setCN(this,q,e.className,!0);this.addEventListeners(q,e);e.startAngle=
n;a[h].wedge=q;0<b&&(this.chartCreated||q.setAttr("opacity",this.startAlpha));e.ix=p;e.iy=C;e.wedge=q;e.index=h;e.label=null;v=c.set();if(this.labelsEnabled&&this.labelText&&e.percents>=this.hideLabelsPercent){var m=n+r/2;0>m&&(m+=360);360<m&&(m-=360);var t=x;isNaN(e.labelRadius)||(t=e.labelRadius,0>t&&(e.skipTick=!0));var r=A+p*(l+t),E=B+C*(l+t),w,u=0;isNaN(D)&&350<m&&1<a.length-h&&(D=h-1+Math.floor((a.length-h)/2));if(0<=t){var y;90>=m&&0<=m?(y=0,w="start",u=8):90<=m&&180>m?(y=1,w="start",u=8):
180<=m&&270>m?(y=2,w="end",u=-8):270<=m&&354>=m?(y=3,w="end",u=-8):354<=m&&(h>D?(y=0,w="start",u=8):(y=3,w="end",u=-8));e.labelQuarter=y}else w="middle";m=this.formatString(this.labelText,e);(t=this.labelFunction)&&(m=t(e,m));t=e.labelColor;t||(t=this.color);""!==m&&(m=k.wrappedText(c,m,t,this.fontFamily,this.fontSize,w,!1,this.maxLabelWidth),k.setCN(this,m,"pie-label"),k.setCN(this,m,e.className,!0),m.translate(r+1.5*u,E),m.node.style.pointerEvents="none",e.ty=E,e.textX=r+1.5*u,v.push(m),this.axesSet.push(v),
e.labelSet=v,e.label=m);e.tx=r;e.tx2=r+u;e.tx0=A+p*l;e.ty0=B+C*l}r=f+(l-f)/2;e.pulled&&(r+=this.pullOutRadiusReal);e.balloonX=p*r+A;e.balloonY=C*r+B;e.startX=Math.round(p*z);e.startY=Math.round(C*z);e.pullX=Math.round(p*g);e.pullY=Math.round(C*g);this.graphsSet.push(q);if(0===e.alpha||0<b&&!this.chartCreated)q.hide(),v&&v.hide();n+=360*e.percents/100;360<n&&(n-=360)}0<x&&this.arrangeLabels();this.pieXReal=A;this.pieYReal=B;this.radiusReal=l;this.innerRadiusReal=f;0<x&&this.drawTicks();this.initialStart();
this.setDepths()}(a=this.legend)&&a.invalidateSize()}else this.cleanChart();this.dispDUpd()},setDepths:function(){var a=this.chartData,b;for(b=0;b<a.length;b++){var c=a[b],d=c.wedge,c=c.startAngle;0<=c&&180>c?d.toFront():180<=c&&d.toBack()}},arrangeLabels:function(){var a=this.chartData,b=a.length,c,d;for(d=b-1;0<=d;d--)c=a[d],0!==c.labelQuarter||c.hidden||this.checkOverlapping(d,c,0,!0,0);for(d=0;d<b;d++)c=a[d],1!=c.labelQuarter||c.hidden||this.checkOverlapping(d,c,1,!1,0);for(d=b-1;0<=d;d--)c=a[d],
2!=c.labelQuarter||c.hidden||this.checkOverlapping(d,c,2,!0,0);for(d=0;d<b;d++)c=a[d],3!=c.labelQuarter||c.hidden||this.checkOverlapping(d,c,3,!1,0)},checkOverlapping:function(a,b,c,d,g){var f,h,e=this.chartData,k=e.length,n=b.label;if(n){if(!0===d)for(h=a+1;h<k;h++)e[h].labelQuarter==c&&(f=this.checkOverlappingReal(b,e[h],c))&&(h=k);else for(h=a-1;0<=h;h--)e[h].labelQuarter==c&&(f=this.checkOverlappingReal(b,e[h],c))&&(h=0);!0===f&&100>g&&isNaN(b.labelRadius)&&(f=b.ty+3*b.iy,b.ty=f,n.translate(b.textX,
f),this.checkOverlapping(a,b,c,d,g+1))}},checkOverlappingReal:function(a,b,c){var d=!1,g=a.label,f=b.label;a.labelQuarter!=c||a.hidden||b.hidden||!f||(g=g.getBBox(),c={},c.width=g.width,c.height=g.height,c.y=a.ty,c.x=a.tx,a=f.getBBox(),f={},f.width=a.width,f.height=a.height,f.y=b.ty,f.x=b.tx,k.hitTest(c,f)&&(d=!0));return d}})})();(function(){var e=window.AmCharts;e.AmRectangularChart=e.Class({inherits:e.AmCoordinateChart,construct:function(a){e.AmRectangularChart.base.construct.call(this,a);this.theme=a;this.createEvents("zoomed","changed");this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=20;this.depth3D=this.angle=0;this.plotAreaFillColors="#FFFFFF";this.plotAreaFillAlphas=0;this.plotAreaBorderColor="#000000";this.plotAreaBorderAlpha=0;this.maxZoomFactor=20;this.zoomOutButtonImageSize=19;this.zoomOutButtonImage=
"lens";this.zoomOutText="Show all";this.zoomOutButtonColor="#e5e5e5";this.zoomOutButtonAlpha=0;this.zoomOutButtonRollOverAlpha=1;this.zoomOutButtonPadding=8;this.trendLines=[];this.autoMargins=!0;this.marginsUpdated=!1;this.autoMarginOffset=10;e.applyTheme(this,a,"AmRectangularChart")},initChart:function(){e.AmRectangularChart.base.initChart.call(this);this.updateDxy();!this.marginsUpdated&&this.autoMargins&&(this.resetMargins(),this.drawGraphs=!1);this.processScrollbars();this.updateMargins();this.updatePlotArea();
this.updateScrollbars();this.updateTrendLines();this.updateChartCursor();this.updateValueAxes();this.scrollbarOnly||this.updateGraphs()},drawChart:function(){e.AmRectangularChart.base.drawChart.call(this);this.drawPlotArea();if(e.ifArray(this.chartData)){var a=this.chartCursor;a&&a.draw()}},resetMargins:function(){var a={},b;if("xy"==this.type){var c=this.xAxes,d=this.yAxes;for(b=0;b<c.length;b++){var g=c[b];g.ignoreAxisWidth||(g.setOrientation(!0),g.fixAxisPosition(),a[g.position]=!0)}for(b=0;b<
d.length;b++)c=d[b],c.ignoreAxisWidth||(c.setOrientation(!1),c.fixAxisPosition(),a[c.position]=!0)}else{d=this.valueAxes;for(b=0;b<d.length;b++)c=d[b],c.ignoreAxisWidth||(c.setOrientation(this.rotate),c.fixAxisPosition(),a[c.position]=!0);(b=this.categoryAxis)&&!b.ignoreAxisWidth&&(b.setOrientation(!this.rotate),b.fixAxisPosition(),b.fixAxisPosition(),a[b.position]=!0)}a.left&&(this.marginLeft=0);a.right&&(this.marginRight=0);a.top&&(this.marginTop=0);a.bottom&&(this.marginBottom=0);this.fixMargins=
a},measureMargins:function(){var a=this.valueAxes,b,c=this.autoMarginOffset,d=this.fixMargins,g=this.realWidth,h=this.realHeight,f=c,e=c,l=g;b=h;var m;for(m=0;m<a.length;m++)a[m].handleSynchronization(),b=this.getAxisBounds(a[m],f,l,e,b),f=Math.round(b.l),l=Math.round(b.r),e=Math.round(b.t),b=Math.round(b.b);if(a=this.categoryAxis)b=this.getAxisBounds(a,f,l,e,b),f=Math.round(b.l),l=Math.round(b.r),e=Math.round(b.t),b=Math.round(b.b);d.left&&f<c&&(this.marginLeft=Math.round(-f+c));d.right&&l>=g-c&&
(this.marginRight=Math.round(l-g+c));d.top&&e<c+this.titleHeight&&(this.marginTop=Math.round(this.marginTop-e+c+this.titleHeight));d.bottom&&b>h-c&&(this.marginBottom=Math.round(this.marginBottom+b-h+c));this.initChart()},getAxisBounds:function(a,b,c,d,g){if(!a.ignoreAxisWidth){var e=a.labelsSet,f=a.tickLength;a.inside&&(f=0);if(e)switch(e=a.getBBox(),a.position){case "top":a=e.y;d>a&&(d=a);break;case "bottom":a=e.y+e.height;g<a&&(g=a);break;case "right":a=e.x+e.width+f+3;c<a&&(c=a);break;case "left":a=
e.x-f,b>a&&(b=a)}}return{l:b,t:d,r:c,b:g}},drawZoomOutButton:function(){var a=this;if(!a.zbSet){var b=a.container.set();a.zoomButtonSet.push(b);var c=a.color,d=a.fontSize,g=a.zoomOutButtonImageSize,h=a.zoomOutButtonImage.replace(/\.[a-z]*$/i,""),f=e.lang.zoomOutText||a.zoomOutText,k=a.zoomOutButtonColor,l=a.zoomOutButtonAlpha,m=a.zoomOutButtonFontSize,q=a.zoomOutButtonPadding;isNaN(m)||(d=m);(m=a.zoomOutButtonFontColor)&&(c=m);var m=a.zoomOutButton,n;m&&(m.fontSize&&(d=m.fontSize),m.color&&(c=m.color),
m.backgroundColor&&(k=m.backgroundColor),isNaN(m.backgroundAlpha)||(a.zoomOutButtonRollOverAlpha=m.backgroundAlpha));var p=m=0;void 0!==a.pathToImages&&h&&(n=a.container.image(a.pathToImages+h+a.extension,0,0,g,g),e.setCN(a,n,"zoom-out-image"),b.push(n),n=n.getBBox(),m=n.width+5);void 0!==f&&(c=e.text(a.container,f,c,a.fontFamily,d,"start"),e.setCN(a,c,"zoom-out-label"),d=c.getBBox(),p=n?n.height/2-3:d.height/2,c.translate(m,p),b.push(c));n=b.getBBox();c=1;e.isModern||(c=0);k=e.rect(a.container,n.width+
2*q+5,n.height+2*q-2,k,1,1,k,c);k.setAttr("opacity",l);k.translate(-q,-q);e.setCN(a,k,"zoom-out-bg");b.push(k);k.toBack();a.zbBG=k;n=k.getBBox();b.translate(a.marginLeftReal+a.plotAreaWidth-n.width+q,a.marginTopReal+q);b.hide();b.mouseover(function(){a.rollOverZB()}).mouseout(function(){a.rollOutZB()}).click(function(){a.clickZB()}).touchstart(function(){a.rollOverZB()}).touchend(function(){a.rollOutZB();a.clickZB()});for(l=0;l<b.length;l++)b[l].attr({cursor:"pointer"});a.zbSet=b}},rollOverZB:function(){this.rolledOverZB=
!0;this.zbBG.setAttr("opacity",this.zoomOutButtonRollOverAlpha)},rollOutZB:function(){this.rolledOverZB=!1;this.zbBG.setAttr("opacity",this.zoomOutButtonAlpha)},clickZB:function(){this.rolledOverZB=!1;this.zoomOut()},zoomOut:function(){this.zoomOutValueAxes()},drawPlotArea:function(){var a=this.dx,b=this.dy,c=this.marginLeftReal,d=this.marginTopReal,g=this.plotAreaWidth-1,h=this.plotAreaHeight-1,f=this.plotAreaFillColors,k=this.plotAreaFillAlphas,l=this.plotAreaBorderColor,m=this.plotAreaBorderAlpha;
"object"==typeof k&&(k=k[0]);f=e.polygon(this.container,[0,g,g,0,0],[0,0,h,h,0],f,k,1,l,m,this.plotAreaGradientAngle);e.setCN(this,f,"plot-area");f.translate(c+a,d+b);this.set.push(f);0!==a&&0!==b&&(f=this.plotAreaFillColors,"object"==typeof f&&(f=f[0]),f=e.adjustLuminosity(f,-.15),g=e.polygon(this.container,[0,a,g+a,g,0],[0,b,b,0,0],f,k,1,l,m),e.setCN(this,g,"plot-area-bottom"),g.translate(c,d+h),this.set.push(g),a=e.polygon(this.container,[0,0,a,a,0],[0,h,h+b,b,0],f,k,1,l,m),e.setCN(this,a,"plot-area-left"),
a.translate(c,d),this.set.push(a));(c=this.bbset)&&this.scrollbarOnly&&c.remove()},updatePlotArea:function(){var a=this.updateWidth(),b=this.updateHeight(),c=this.container;this.realWidth=a;this.realWidth=b;c&&this.container.setSize(a,b);var c=this.marginLeftReal,d=this.marginTopReal,a=a-c-this.marginRightReal-this.dx,b=b-d-this.marginBottomReal;1>a&&(a=1);1>b&&(b=1);this.plotAreaWidth=Math.round(a);this.plotAreaHeight=Math.round(b);this.plotBalloonsSet.translate(c,d)},updateDxy:function(){this.dx=
Math.round(this.depth3D*Math.cos(this.angle*Math.PI/180));this.dy=Math.round(-this.depth3D*Math.sin(this.angle*Math.PI/180));this.d3x=Math.round(this.columnSpacing3D*Math.cos(this.angle*Math.PI/180));this.d3y=Math.round(-this.columnSpacing3D*Math.sin(this.angle*Math.PI/180))},updateMargins:function(){var a=this.getTitleHeight();this.titleHeight=a;this.marginTopReal=this.marginTop-this.dy;this.fixMargins&&!this.fixMargins.top&&(this.marginTopReal+=a);this.marginBottomReal=this.marginBottom;this.marginLeftReal=
this.marginLeft;this.marginRightReal=this.marginRight},updateValueAxes:function(){var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b];this.setAxisRenderers(c);this.updateObjectSize(c)}},setAxisRenderers:function(a){a.axisRenderer=e.RecAxis;a.guideFillRenderer=e.RecFill;a.axisItemRenderer=e.RecItem;a.marginsChanged=!0},updateGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.index=b;c.rotate=this.rotate;this.updateObjectSize(c)}},updateObjectSize:function(a){a.width=this.plotAreaWidth-
1;a.height=this.plotAreaHeight-1;a.x=this.marginLeftReal;a.y=this.marginTopReal;a.dx=this.dx;a.dy=this.dy},updateChartCursor:function(){var a=this.chartCursor;a&&(a=e.processObject(a,e.ChartCursor,this.theme),this.updateObjectSize(a),this.addChartCursor(a),a.chart=this)},processScrollbars:function(){var a=this.chartScrollbar;a&&(a=e.processObject(a,e.ChartScrollbar,this.theme),this.addChartScrollbar(a))},updateScrollbars:function(){},removeChartCursor:function(){e.callMethod("destroy",[this.chartCursor]);
this.chartCursor=null},zoomTrendLines:function(){var a=this.trendLines,b;for(b=0;b<a.length;b++){var c=a[b];c.valueAxis.recalculateToPercents?c.set&&c.set.hide():(c.x=this.marginLeftReal,c.y=this.marginTopReal,c.draw())}},handleCursorValueZoom:function(){},addTrendLine:function(a){this.trendLines.push(a)},zoomOutValueAxes:function(){for(var a=this.valueAxes,b=0;b<a.length;b++)a[b].zoomOut()},removeTrendLine:function(a){var b=this.trendLines,c;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)},adjustMargins:function(a,
b){var c=a.position,d=a.scrollbarHeight+a.offset;a.enabled&&("top"==c?b?this.marginLeftReal+=d:this.marginTopReal+=d:b?this.marginRightReal+=d:this.marginBottomReal+=d)},getScrollbarPosition:function(a,b,c){var d="bottom",g="top";a.oppositeAxis||(g=d,d="top");a.position=b?"bottom"==c||"left"==c?d:g:"top"==c||"right"==c?d:g},updateChartScrollbar:function(a,b){if(a){a.rotate=b;var c=this.marginTopReal,d=this.marginLeftReal,g=a.scrollbarHeight,e=this.dx,f=this.dy,k=a.offset;"top"==a.position?b?(a.y=
c,a.x=d-g-k):(a.y=c-g+f-k,a.x=d+e):b?(a.y=c+f,a.x=d+this.plotAreaWidth+e+k):(a.y=c+this.plotAreaHeight+k,a.x=this.marginLeftReal)}},showZB:function(a){var b=this.zbSet;a&&(b=this.zoomOutText,""!==b&&b&&this.drawZoomOutButton());if(b=this.zbSet)this.zoomButtonSet.push(b),a?b.show():b.hide(),this.rollOutZB()},handleReleaseOutside:function(a){e.AmRectangularChart.base.handleReleaseOutside.call(this,a);(a=this.chartCursor)&&a.handleReleaseOutside&&a.handleReleaseOutside()},handleMouseDown:function(a){e.AmRectangularChart.base.handleMouseDown.call(this,
a);var b=this.chartCursor;b&&b.handleMouseDown&&!this.rolledOverZB&&b.handleMouseDown(a)},update:function(){e.AmRectangularChart.base.update.call(this);this.chartCursor&&this.chartCursor.update&&this.chartCursor.update()},handleScrollbarValueZoom:function(a){this.relativeZoomValueAxes(a.target.valueAxes,a.relativeStart,a.relativeEnd);this.zoomAxesAndGraphs()},zoomValueScrollbar:function(a){if(a&&a.enabled){var b=a.valueAxes[0],c=b.relativeStart,d=b.relativeEnd;b.reversed&&(d=1-c,c=1-b.relativeEnd);
a.percentZoom(c,d)}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var a=this.valueAxes,b;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);a=this.graphs;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);(b=this.chartCursor)&&b.clearSelection();this.zoomTrendLines()}},handleValueAxisZoomReal:function(a,b){var c=a.relativeStart,d=a.relativeEnd;if(c>d)var g=c,c=d,d=g;this.relativeZoomValueAxes(b,c,d);this.updateAfterValueZoom()},updateAfterValueZoom:function(){this.zoomAxesAndGraphs();
this.zoomScrollbar()},relativeZoomValueAxes:function(a,b,c){b=e.fitToBounds(b,0,1);c=e.fitToBounds(c,0,1);if(b>c){var d=b;b=c;c=d}var d=1/this.maxZoomFactor,g=e.getDecimals(d)+4;c-b<d&&(c=b+(c-b)/2,b=c-d/2,c+=d/2);b=e.roundTo(b,g);c=e.roundTo(c,g);d=!1;if(a){for(g=0;g<a.length;g++){var h=a[g].zoomToRelativeValues(b,c,!0);h&&(d=h)}this.showZB()}return d},addChartCursor:function(a){e.callMethod("destroy",[this.chartCursor]);a&&(this.listenTo(a,"moved",this.handleCursorMove),this.listenTo(a,"zoomed",
this.handleCursorZoom),this.listenTo(a,"zoomStarted",this.handleCursorZoomStarted),this.listenTo(a,"panning",this.handleCursorPanning),this.listenTo(a,"onHideCursor",this.handleCursorHide));this.chartCursor=a},handleCursorChange:function(){},handleCursorMove:function(a){var b,c=this.valueAxes;for(b=0;b<c.length;b++)a.panning||c[b].showBalloon(a.x,a.y)},handleCursorZoom:function(a){if(this.skipZoomed)this.skipZoomed=!1;else{var b=this.startX0,c=this.endX0,d=this.endY0,g=this.startY0,e=a.startX,f=a.endX,
k=a.startY,l=a.endY;this.startX0=this.endX0=this.startY0=this.endY0=NaN;this.handleCursorZoomReal(b+e*(c-b),b+f*(c-b),g+k*(d-g),g+l*(d-g),a)}},handleCursorHide:function(){var a,b=this.valueAxes;for(a=0;a<b.length;a++)b[a].hideBalloon();b=this.graphs;for(a=0;a<b.length;a++)b[a].hideBalloonReal()}})})();
(function(){var e=window.AmCharts;e.AmSerialChart=e.Class({inherits:e.AmRectangularChart,construct:function(a){this.type="serial";e.AmSerialChart.base.construct.call(this,a);this.cname="AmSerialChart";this.theme=a;this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=.8;var b=new e.CategoryAxis(a);b.chart=this;this.categoryAxis=b;this.zoomOutOnDataUpdate=!0;this.mouseWheelZoomEnabled=this.mouseWheelScrollEnabled=this.rotate=this.skipZoom=!1;this.minSelectedTime=0;e.applyTheme(this,a,this.cname)},
initChart:function(){e.AmSerialChart.base.initChart.call(this);this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");if(this.dataChanged)this.parseData();else this.onDataUpdated();this.drawGraphs=!0},onDataUpdated:function(){var a=this.countColumns(),b=this.chartData,c=this.graphs,d;for(d=0;d<c.length;d++){var g=c[d];g.data=b;g.columnCount=a}0<b.length&&(this.firstTime=this.getStartTime(b[0].time),this.lastTime=this.getEndTime(b[b.length-1].time));this.drawChart();this.autoMargins&&
!this.marginsUpdated?(this.marginsUpdated=!0,this.measureMargins()):this.dispDUpd()},handleWheelReal:function(a,b){if(!this.wheelBusy){var c=this.categoryAxis,d=c.parseDates,g=c.minDuration(),e=c=1;this.mouseWheelZoomEnabled?b||(c=-1):b&&(c=-1);var f=this.chartData.length,k=this.lastTime,l=this.firstTime;0>a?d?(f=this.endTime-this.startTime,d=this.startTime+c*g,g=this.endTime+e*g,0<e&&0<c&&g>=k&&(g=k,d=k-f),this.zoomToDates(new Date(d),new Date(g))):(0<e&&0<c&&this.end>=f-1&&(c=e=0),d=this.start+
c,g=this.end+e,this.zoomToIndexes(d,g)):d?(f=this.endTime-this.startTime,d=this.startTime-c*g,g=this.endTime-e*g,0<e&&0<c&&d<=l&&(d=l,g=l+f),this.zoomToDates(new Date(d),new Date(g))):(0<e&&0<c&&1>this.start&&(c=e=0),d=this.start-c,g=this.end-e,this.zoomToIndexes(d,g))}},validateData:function(a){this.marginsUpdated=!1;this.zoomOutOnDataUpdate&&!a&&(this.endTime=this.end=this.startTime=this.start=NaN);e.AmSerialChart.base.validateData.call(this)},drawChart:function(){if(0<this.realWidth&&0<this.realHeight){e.AmSerialChart.base.drawChart.call(this);
var a=this.chartData;if(e.ifArray(a)){var b=this.chartScrollbar;!b||!this.marginsUpdated&&this.autoMargins||b.draw();(b=this.valueScrollbar)&&b.draw();var a=a.length-1,c,b=this.categoryAxis;if(b.parseDates&&!b.equalSpacing){if(b=this.startTime,c=this.endTime,isNaN(b)||isNaN(c))b=this.firstTime,c=this.lastTime}else if(b=this.start,c=this.end,isNaN(b)||isNaN(c))b=0,c=a;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(b,c)}}else this.cleanChart()},cleanChart:function(){e.callMethod("destroy",
[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor,this.valueScrollbar])},updateCategoryAxis:function(a,b,c){a.chart=this;a.id=c;a.rotate=b;a.setOrientation(!this.rotate);a.init();this.setAxisRenderers(a);this.updateObjectSize(a)},updateValueAxes:function(){e.AmSerialChart.base.updateValueAxes.call(this);var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b],d=this.rotate;c.rotate=d;c.setOrientation(d);d=this.categoryAxis;if(!d.startOnAxis||d.parseDates)c.expandMinMax=
!0}},getStartTime:function(a){var b=this.categoryAxis;return e.resetDateToMin(new Date(a),b.minPeriod,1,b.firstDayOfWeek).getTime()},getEndTime:function(a){var b=e.extractPeriod(this.categoryAxis.minPeriod);return e.changeDate(new Date(a),b.period,b.count,!0).getTime()-1},updateMargins:function(){e.AmSerialChart.base.updateMargins.call(this);var a=this.chartScrollbar;a&&(this.getScrollbarPosition(a,this.rotate,this.categoryAxis.position),this.adjustMargins(a,this.rotate));if(a=this.valueScrollbar)this.getScrollbarPosition(a,
!this.rotate,this.valueAxes[0].position),this.adjustMargins(a,!this.rotate)},updateScrollbars:function(){e.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate);this.updateChartScrollbar(this.valueScrollbar,!this.rotate)},zoom:function(a,b){var c=this.categoryAxis;c.parseDates&&!c.equalSpacing?this.timeZoom(a,b):this.indexZoom(a,b);isNaN(a)&&this.zoomOutValueAxes();this.updateLegendValues()},timeZoom:function(a,b){var c=this.maxSelectedTime;isNaN(c)||
(b!=this.endTime&&b-a>c&&(a=b-c),a!=this.startTime&&b-a>c&&(b=a+c));var d=this.minSelectedTime;if(0<d&&b-a<d){var g=Math.round(a+(b-a)/2),d=Math.round(d/2);a=g-d;b=g+d}d=this.chartData;g=this.categoryAxis;if(e.ifArray(d)&&(a!=this.startTime||b!=this.endTime)){var h=g.minDuration(),f=this.firstTime,k=this.lastTime;a||(a=f,isNaN(c)||(a=k-c));b||(b=k);a>k&&(a=k);b<f&&(b=f);a<f&&(a=f);b>k&&(b=k);b<a&&(b=a+h);b-a<h/5&&(b<k?b=a+h/5:a=b-h/5);this.startTime=a;this.endTime=b;c=d.length-1;h=this.getClosestIndex(d,
"time",a,!0,0,c);d=this.getClosestIndex(d,"time",b,!1,h,c);g.timeZoom(a,b);g.zoom(h,d);this.start=e.fitToBounds(h,0,c);this.end=e.fitToBounds(d,0,c);this.zoomAxesAndGraphs();this.zoomScrollbar();this.fixCursor();this.showZB();this.updateColumnsDepth();this.dispatchTimeZoomEvent()}},showZB:function(){var a,b=this.categoryAxis;b&&b.parseDates&&!b.equalSpacing&&(this.startTime>this.firstTime&&(a=!0),this.endTime<this.lastTime&&(a=!0));0<this.start&&(a=!0);this.end<this.chartData.length-1&&(a=!0);if(b=
this.valueAxes)b=b[0],0!==b.relativeStart&&(a=!0),1!=b.relativeEnd&&(a=!0);e.AmSerialChart.base.showZB.call(this,a)},updateAfterValueZoom:function(){e.AmSerialChart.base.updateAfterValueZoom.call(this);this.updateColumnsDepth()},indexZoom:function(a,b){var c=this.maxSelectedSeries;isNaN(c)||(b!=this.end&&b-a>c&&(a=b-c),a!=this.start&&b-a>c&&(b=a+c));if(a!=this.start||b!=this.end){var d=this.chartData.length-1;isNaN(a)&&(a=0,isNaN(c)||(a=d-c));isNaN(b)&&(b=d);b<a&&(b=a);b>d&&(b=d);a>d&&(a=d-1);0>a&&
(a=0);this.start=a;this.end=b;this.categoryAxis.zoom(a,b);this.zoomAxesAndGraphs();this.zoomScrollbar();this.fixCursor();0!==a||b!=this.chartData.length-1?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();this.dispatchIndexZoomEvent()}},updateGraphs:function(){e.AmSerialChart.base.updateGraphs.call(this);var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.columnWidthReal=this.columnWidth;c.categoryAxis=this.categoryAxis;e.isString(c.fillToGraph)&&(c.fillToGraph=this.graphsById[c.fillToGraph])}},
zoomAxesAndGraphs:function(){e.AmSerialChart.base.zoomAxesAndGraphs.call(this);this.updateColumnsDepth()},updateColumnsDepth:function(){if(0!==this.depth3D||0!==this.angle){var a,b=this.graphs,c;this.columnsArray=[];for(a=0;a<b.length;a++){c=b[a];var d=c.columnsArray;if(d){var g;for(g=0;g<d.length;g++)this.columnsArray.push(d[g])}}this.columnsArray.sort(this.compareDepth);if(0<this.columnsArray.length){b=this.columnsSet;d=this.container.set();this.columnSet.push(d);for(a=0;a<this.columnsArray.length;a++)d.push(this.columnsArray[a].column.set);
c&&d.translate(c.x,c.y);this.columnsSet=d;e.remove(b)}}},compareDepth:function(a,b){return a.depth>b.depth?1:-1},zoomScrollbar:function(){var a=this.chartScrollbar,b=this.categoryAxis;if(a){if(!this.zoomedByScrollbar){var c=a.dragger;c&&c.stop()}this.zoomedByScrollbar=!1;b.parseDates&&!b.equalSpacing?a.timeZoom(this.startTime,this.endTime):a.zoom(this.start,this.end)}this.zoomValueScrollbar(this.valueScrollbar)},updateTrendLines:function(){var a=this.trendLines,b;for(b=0;b<a.length;b++){var c=a[b],
c=e.processObject(c,e.TrendLine,this.theme);a[b]=c;c.chart=this;c.id||(c.id="trendLineAuto"+b+"_"+(new Date).getTime());e.isString(c.valueAxis)&&(c.valueAxis=this.getValueAxisById(c.valueAxis));c.valueAxis||(c.valueAxis=this.valueAxes[0]);c.categoryAxis=this.categoryAxis}},countColumns:function(){var a=0,b=this.valueAxes.length,c=this.graphs.length,d,g,e=!1,f,k;for(k=0;k<b;k++){g=this.valueAxes[k];var l=g.stackType;if("100%"==l||"regular"==l)for(e=!1,f=0;f<c;f++)d=this.graphs[f],d.tcc=1,d.valueAxis==
g&&"column"==d.type&&(!e&&d.stackable&&(a++,e=!0),(!d.stackable&&d.clustered||d.newStack)&&a++,d.columnIndex=a-1,d.clustered||(d.columnIndex=0));if("none"==l||"3d"==l){e=!1;for(f=0;f<c;f++)d=this.graphs[f],d.valueAxis==g&&"column"==d.type&&(d.clustered?(d.tcc=1,d.newStack&&(a=0),d.hidden||(d.columnIndex=a,a++)):d.hidden||(e=!0,d.tcc=1,d.columnIndex=0));e&&0===a&&(a=1)}if("3d"==l){g=1;for(k=0;k<c;k++)d=this.graphs[k],d.newStack&&g++,d.depthCount=g,d.tcc=a;a=g}}return a},parseData:function(){e.AmSerialChart.base.parseData.call(this);
this.parseSerialData(this.dataProvider)},getCategoryIndexByValue:function(a){var b=this.chartData,c;for(c=0;c<b.length;c++)if(b[c].category==a)return c},handleScrollbarZoom:function(a){this.zoomedByScrollbar=!0;this.zoom(a.start,a.end)},dispatchTimeZoomEvent:function(){if(this.drawGraphs&&(this.prevStartTime!=this.startTime||this.prevEndTime!=this.endTime)){var a={type:"zoomed"};a.startDate=new Date(this.startTime);a.endDate=new Date(this.endTime);a.startIndex=this.start;a.endIndex=this.end;this.startIndex=
this.start;this.endIndex=this.end;this.startDate=a.startDate;this.endDate=a.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var b=this.categoryAxis,c=e.extractPeriod(b.minPeriod).period,b=b.dateFormatsObject[c];a.startValue=e.formatDate(a.startDate,b,this);a.endValue=e.formatDate(a.endDate,b,this);a.chart=this;a.target=this;this.fire(a)}},dispatchIndexZoomEvent:function(){if(this.drawGraphs&&(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end)){this.startIndex=this.start;
this.endIndex=this.end;var a=this.chartData;if(e.ifArray(a)&&!isNaN(this.start)&&!isNaN(this.end)){var b={chart:this,target:this,type:"zoomed"};b.startIndex=this.start;b.endIndex=this.end;b.startValue=a[this.start].category;b.endValue=a[this.end].category;this.categoryAxis.parseDates&&(this.startTime=a[this.start].time,this.endTime=a[this.end].time,b.startDate=new Date(this.startTime),b.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(b)}}},updateLegendValues:function(){this.legend&&
this.legend.updateValues()},getClosestIndex:function(a,b,c,d,e,h){0>e&&(e=0);h>a.length-1&&(h=a.length-1);var f=e+Math.round((h-e)/2),k=a[f][b];return c==k?f:1>=h-e?d?e:Math.abs(a[e][b]-c)<Math.abs(a[h][b]-c)?e:h:c==k?f:c<k?this.getClosestIndex(a,b,c,d,e,f):this.getClosestIndex(a,b,c,d,f,h)},zoomToIndexes:function(a,b){var c=this.chartData;if(c){var d=c.length;0<d&&(0>a&&(a=0),b>d-1&&(b=d-1),d=this.categoryAxis,d.parseDates&&!d.equalSpacing?this.zoom(c[a].time,this.getEndTime(c[b].time)):this.zoom(a,
b))}},zoomToDates:function(a,b){var c=this.chartData;if(c)if(this.categoryAxis.equalSpacing){var d=this.getClosestIndex(c,"time",a.getTime(),!0,0,c.length);b=e.resetDateToMin(b,this.categoryAxis.minPeriod,1);c=this.getClosestIndex(c,"time",b.getTime(),!1,0,c.length);this.zoom(d,c)}else this.zoom(a.getTime(),b.getTime())},zoomToCategoryValues:function(a,b){this.chartData&&this.zoom(this.getCategoryIndexByValue(a),this.getCategoryIndexByValue(b))},formatPeriodString:function(a,b){if(b){var c=["value",
"open","low","high","close"],d="value open low high close average sum count".split(" "),g=b.valueAxis,h=this.chartData,f=b.numberFormatter;f||(f=this.nf);for(var k=0;k<c.length;k++){for(var l=c[k],m=0,q=0,n,p,x,u,B,r=0,t=0,C,v,w,A,z,G=this.start;G<=this.end;G++){var y=h[G];if(y&&(y=y.axes[g.id].graphs[b.id])){if(y.values){var D=y.values[l];if(this.rotate){if(0>y.x||y.x>y.graph.height)D=NaN}else if(0>y.x||y.x>y.graph.width)D=NaN;if(!isNaN(D)){isNaN(n)&&(n=D);p=D;if(isNaN(x)||x>D)x=D;if(isNaN(u)||u<
D)u=D;B=e.getDecimals(m);var F=e.getDecimals(D),m=m+D,m=e.roundTo(m,Math.max(B,F));q++;B=m/q}}if(y.percents&&(y=y.percents[l],!isNaN(y))){isNaN(C)&&(C=y);v=y;if(isNaN(w)||w>y)w=y;if(isNaN(A)||A<y)A=y;z=e.getDecimals(r);D=e.getDecimals(y);r+=y;r=e.roundTo(r,Math.max(z,D));t++;z=r/t}}}r={open:C,close:v,high:A,low:w,average:z,sum:r,count:t};a=e.formatValue(a,{open:n,close:p,high:u,low:x,average:B,sum:m,count:q},d,f,l+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=e.formatValue(a,
r,d,this.pf,"percents\\."+l+"\\.")}}return a=e.cleanFromEmpty(a)},formatString:function(a,b,c){if(b){var d=b.graph;if(void 0!==a){if(-1!=a.indexOf("[[category]]")){var g=b.serialDataItem.category;if(this.categoryAxis.parseDates){var h=this.balloonDateFormat,f=this.chartCursor;f&&f.categoryBalloonDateFormat&&(h=f.categoryBalloonDateFormat);h=e.formatDate(g,h,this);-1!=h.indexOf("fff")&&(h=e.formatMilliseconds(h,g));g=h}a=a.replace(/\[\[category\]\]/g,String(g))}g=d.numberFormatter;g||(g=this.nf);h=
b.graph.valueAxis;(f=h.duration)&&!isNaN(b.values.value)&&(f=e.formatDuration(b.values.value,f,"",h.durationUnits,h.maxInterval,g),a=a.replace(RegExp("\\[\\[value\\]\\]","g"),f));"date"==h.type&&(h=e.formatDate(new Date(b.values.value),d.dateFormat,this),f=RegExp("\\[\\[value\\]\\]","g"),a=a.replace(f,h),h=e.formatDate(new Date(b.values.open),d.dateFormat,this),f=RegExp("\\[\\[open\\]\\]","g"),a=a.replace(f,h));d="value open low high close total".split(" ");h=this.pf;a=e.formatValue(a,b.percents,
d,h,"percents\\.");a=e.formatValue(a,b.values,d,g,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=e.formatValue(a,b.values,["percents"],h);-1!=a.indexOf("[[")&&(a=e.formatDataContextValue(a,b.dataContext));-1!=a.indexOf("[[")&&b.graph.customData&&(a=e.formatDataContextValue(a,b.graph.customData));a=e.AmSerialChart.base.formatString.call(this,a,b,c)}return a}},updateChartCursor:function(){e.AmSerialChart.base.updateChartCursor.call(this);var a=this.chartCursor,b=this.categoryAxis;
if(a){var c=a.categoryBalloonAlpha,d=a.categoryBalloonColor,g=a.color;void 0===d&&(d=a.cursorColor);var h=a.valueZoomable,f=a.zoomable,k=a.valueLineEnabled;this.rotate?(a.vLineEnabled=k,a.hZoomEnabled=h,a.vZoomEnabled=f):(a.hLineEnabled=k,a.vZoomEnabled=h,a.hZoomEnabled=f);if(a.valueLineBalloonEnabled)for(k=0;k<this.valueAxes.length;k++)h=this.valueAxes[k],(f=h.balloon)||(f={}),f=e.extend(f,this.balloon,!0),f.fillColor=d,f.balloonColor=d,f.fillAlpha=c,f.borderColor=d,f.color=g,h.balloon=f;else for(f=
0;f<this.valueAxes.length;f++)h=this.valueAxes[f],h.balloon&&(h.balloon=null);b&&(b.balloonTextFunction=a.categoryBalloonFunction,a.categoryLineAxis=b,b.balloonText=a.categoryBalloonText,a.categoryBalloonEnabled&&((f=b.balloon)||(f={}),f=e.extend(f,this.balloon,!0),f.fillColor=d,f.balloonColor=d,f.fillAlpha=c,f.borderColor=d,f.color=g,b.balloon=f),b.balloon&&(b.balloon.enabled=a.categoryBalloonEnabled))}},addChartScrollbar:function(a){e.callMethod("destroy",[this.chartScrollbar]);a&&(a.chart=this,
this.listenTo(a,"zoomed",this.handleScrollbarZoom));this.rotate?void 0===a.width&&(a.width=a.scrollbarHeight):void 0===a.height&&(a.height=a.scrollbarHeight);a.gridAxis=this.categoryAxis;this.chartScrollbar=a},addValueScrollbar:function(a){e.callMethod("destroy",[this.valueScrollbar]);a&&(a.chart=this,this.listenTo(a,"zoomed",this.handleScrollbarValueZoom),this.listenTo(a,"zoomStarted",this.handleCursorZoomStarted));var b=a.scrollbarHeight;this.rotate?void 0===a.height&&(a.height=b):void 0===a.width&&
(a.width=b);a.gridAxis||(a.gridAxis=this.valueAxes[0]);a.valueAxes=this.valueAxes;this.valueScrollbar=a},removeChartScrollbar:function(){e.callMethod("destroy",[this.chartScrollbar]);this.chartScrollbar=null},removeValueScrollbar:function(){e.callMethod("destroy",[this.valueScrollbar]);this.valueScrollbar=null},handleReleaseOutside:function(a){e.AmSerialChart.base.handleReleaseOutside.call(this,a);e.callMethod("handleReleaseOutside",[this.chartScrollbar,this.valueScrollbar])},update:function(){e.AmSerialChart.base.update.call(this);
this.chartScrollbar&&this.chartScrollbar.update&&this.chartScrollbar.update();this.valueScrollbar&&this.valueScrollbar.update&&this.valueScrollbar.update()},processScrollbars:function(){e.AmSerialChart.base.processScrollbars.call(this);var a=this.valueScrollbar;a&&(a=e.processObject(a,e.ChartScrollbar,this.theme),a.id="valueScrollbar",this.addValueScrollbar(a))},handleValueAxisZoom:function(a){this.handleValueAxisZoomReal(a,this.valueAxes)},zoomOut:function(){e.AmSerialChart.base.zoomOut.call(this);
this.zoom()},getNextItem:function(a){var b=a.index,c=this.chartData,d=a.graph;if(b+1<c.length)for(b+=1;b<c.length;b++)if(a=c[b])if(a=a.axes[d.valueAxis.id].graphs[d.id],!isNaN(a.y))return a},handleCursorZoomReal:function(a,b,c,d,e){var h=e.target,f,k;this.rotate?(isNaN(a)||isNaN(b)||this.relativeZoomValueAxes(this.valueAxes,a,b)&&this.updateAfterValueZoom(),h.vZoomEnabled&&(f=e.start,k=e.end)):(isNaN(c)||isNaN(d)||this.relativeZoomValueAxes(this.valueAxes,c,d)&&this.updateAfterValueZoom(),h.hZoomEnabled&&
(f=e.start,k=e.end));isNaN(f)||isNaN(k)||(a=this.categoryAxis,a.parseDates&&!a.equalSpacing?this.zoomToDates(new Date(f),new Date(k)):this.zoomToIndexes(f,k))},handleCursorZoomStarted:function(){var a=this.valueAxes;if(a){var a=a[0],b=a.relativeStart,c=a.relativeEnd;a.reversed&&(b=1-a.relativeEnd,c=1-a.relativeStart);this.rotate?(this.startX0=b,this.endX0=c):(this.startY0=b,this.endY0=c)}this.categoryAxis&&(this.start0=this.start,this.end0=this.end,this.startTime0=this.startTime,this.endTime0=this.endTime)},
fixCursor:function(){this.chartCursor&&this.chartCursor.fixPosition();this.prevCursorItem=null},handleCursorMove:function(a){e.AmSerialChart.base.handleCursorMove.call(this,a);var b=a.target,c=this.categoryAxis;if(a.panning)this.handleCursorHide(a);else if(this.chartData&&!b.isHidden){var d=this.graphs;if(d){var g;g=c.xToIndex(this.rotate?a.y:a.x);if(g=this.chartData[g]){var h,f,k,l;if(b.oneBalloonOnly){var m=Infinity;for(h=0;h<d.length;h++)if(f=d[h],f.balloon.enabled&&f.showBalloon&&!f.hidden){k=
f.valueAxis.id;k=g.axes[k].graphs[f.id];k=k.y;"top"==f.showBalloonAt&&(k=0);"bottom"==f.showBalloonAt&&(k=this.height);var q=b.mouseX,n=b.mouseY;k=this.rotate?Math.abs(q-k):Math.abs(n-k);k<m&&(m=k,l=f)}b.mostCloseGraph=l}if(this.prevCursorItem!=g||l!=this.prevMostCloseGraph){m=[];for(h=0;h<d.length;h++)f=d[h],k=f.valueAxis.id,k=g.axes[k].graphs[f.id],b.showNextAvailable&&isNaN(k.y)&&(k=this.getNextItem(k)),l&&f!=l?(f.showGraphBalloon(k,b.pointer,!1,b.graphBulletSize,b.graphBulletAlpha),f.balloon.hide(0)):
b.valueBalloonsEnabled?(f.balloon.showBullet=b.bulletsEnabled,f.balloon.bulletSize=b.bulletSize/2,a.hideBalloons||(f.showGraphBalloon(k,b.pointer,!1,b.graphBulletSize,b.graphBulletAlpha),f.balloon.set&&m.push({balloon:f.balloon,y:f.balloon.pointToY}))):(f.currentDataItem=k,f.resizeBullet(k,b.graphBulletSize,b.graphBulletAlpha));b.avoidBalloonOverlapping&&this.arrangeBalloons(m);this.prevCursorItem=g}this.prevMostCloseGraph=l}}c.showBalloon(a.x,a.y,b.categoryBalloonDateFormat,a.skip);this.updateLegendValues()}},
handleCursorHide:function(a){e.AmSerialChart.base.handleCursorHide.call(this,a);a=this.categoryAxis;this.prevCursorItem=null;this.updateLegendValues();a&&a.hideBalloon();a=this.graphs;var b;for(b=0;b<a.length;b++)a[b].currentDataItem=null},handleCursorPanning:function(a){var b=a.target,c,d=a.deltaX,g=a.deltaY,h=a.delta2X,f=a.delta2Y;a=!1;if(this.rotate){isNaN(h)&&(h=d,a=!0);var k=this.endX0;c=this.startX0;var l=k-c,k=k-l*h,m=l;a||(m=0);a=e.fitToBounds(c-l*d,0,1-m)}else isNaN(f)&&(f=g,a=!0),k=this.endY0,
c=this.startY0,l=k-c,k+=l*g,m=l,a||(m=0),a=e.fitToBounds(c+l*f,0,1-m);c=e.fitToBounds(k,m,1);var q;b.valueZoomable&&(q=this.relativeZoomValueAxes(this.valueAxes,a,c));var n;c=this.categoryAxis;this.rotate&&(d=g,h=f);a=!1;isNaN(h)&&(h=d,a=!0);if(b.zoomable&&(0<Math.abs(d)||0<Math.abs(h)))if(c.parseDates&&!c.equalSpacing){if(f=this.startTime0,g=this.endTime0,c=g-f,h*=c,l=this.firstTime,k=this.lastTime,m=c,a||(m=0),a=Math.round(e.fitToBounds(f-c*d,l,k-m)),h=Math.round(e.fitToBounds(g-h,l+m,k)),this.startTime!=
a||this.endTime!=h)n={chart:this,target:b,type:"zoomed",start:a,end:h},this.skipZoomed=!0,b.fire(n),this.zoom(a,h),n=!0}else if(f=this.start0,g=this.end0,c=g-f,d=Math.round(c*d),h=Math.round(c*h),l=this.chartData.length-1,a||(c=0),a=e.fitToBounds(f-d,0,l-c),c=e.fitToBounds(g-h,c,l),this.start!=a||this.end!=c)this.skipZoomed=!0,b.fire({chart:this,target:b,type:"zoomed",start:a,end:c}),this.zoom(a,c),n=!0;!n&&q&&this.updateAfterValueZoom()},arrangeBalloons:function(a){var b=this.plotAreaHeight;a.sort(this.compareY);
var c,d,e,h=this.plotAreaWidth,f=a.length;for(c=0;c<f;c++)d=a[c].balloon,d.setBounds(0,0,h,b),d.restorePrevious(),d.draw(),b=d.yPos-3;a.reverse();for(c=0;c<f;c++){d=a[c].balloon;var b=d.bottom,k=d.bottom-d.yPos;0<c&&b-k<e+3&&(d.setBounds(0,e+3,h,e+k+3),d.restorePrevious(),d.draw());d.set&&d.set.show();e=d.bottom}},compareY:function(a,b){return a.y<b.y?1:-1}})})();
(function(){var e=window.AmCharts;e.Cuboid=e.Class({construct:function(a,b,c,d,e,h,f,k,l,m,q,n,p,x,u,B,r){this.set=a.set();this.container=a;this.h=Math.round(c);this.w=Math.round(b);this.dx=d;this.dy=e;this.colors=h;this.alpha=f;this.bwidth=k;this.bcolor=l;this.balpha=m;this.dashLength=x;this.topRadius=B;this.pattern=u;this.rotate=p;this.bcn=r;p?0>b&&0===q&&(q=180):0>c&&270==q&&(q=90);this.gradientRotation=q;0===d&&0===e&&(this.cornerRadius=n);this.draw()},draw:function(){var a=this.set;a.clear();
var b=this.container,c=b.chart,d=this.w,g=this.h,h=this.dx,f=this.dy,k=this.colors,l=this.alpha,m=this.bwidth,q=this.bcolor,n=this.balpha,p=this.gradientRotation,x=this.cornerRadius,u=this.dashLength,B=this.pattern,r=this.topRadius,t=this.bcn,C=k,v=k;"object"==typeof k&&(C=k[0],v=k[k.length-1]);var w,A,z,G,y,D,F,L,M,Q=l;B&&(l=0);var E,H,I,J,K=this.rotate;if(0<Math.abs(h)||0<Math.abs(f))if(isNaN(r))F=v,v=e.adjustLuminosity(C,-.2),v=e.adjustLuminosity(C,-.2),w=e.polygon(b,[0,h,d+h,d,0],[0,f,f,0,0],
v,l,1,q,0,p),0<n&&(M=e.line(b,[0,h,d+h],[0,f,f],q,n,m,u)),A=e.polygon(b,[0,0,d,d,0],[0,g,g,0,0],v,l,1,q,0,p),A.translate(h,f),0<n&&(z=e.line(b,[h,h],[f,f+g],q,n,m,u)),G=e.polygon(b,[0,0,h,h,0],[0,g,g+f,f,0],v,l,1,q,0,p),y=e.polygon(b,[d,d,d+h,d+h,d],[0,g,g+f,f,0],v,l,1,q,0,p),0<n&&(D=e.line(b,[d,d+h,d+h,d],[0,f,g+f,g],q,n,m,u)),v=e.adjustLuminosity(F,.2),F=e.polygon(b,[0,h,d+h,d,0],[g,g+f,g+f,g,g],v,l,1,q,0,p),0<n&&(L=e.line(b,[0,h,d+h],[g,g+f,g+f],q,n,m,u));else{var N,O,P;K?(N=g/2,v=h/2,P=g/2,O=
d+h/2,H=Math.abs(g/2),E=Math.abs(h/2)):(v=d/2,N=f/2,O=d/2,P=g+f/2+1,E=Math.abs(d/2),H=Math.abs(f/2));I=E*r;J=H*r;.1<E&&.1<E&&(w=e.circle(b,E,C,l,m,q,n,!1,H),w.translate(v,N));.1<I&&.1<I&&(F=e.circle(b,I,e.adjustLuminosity(C,.5),l,m,q,n,!1,J),F.translate(O,P))}l=Q;1>Math.abs(g)&&(g=0);1>Math.abs(d)&&(d=0);!isNaN(r)&&(0<Math.abs(h)||0<Math.abs(f))?(k=[C],k={fill:k,stroke:q,"stroke-width":m,"stroke-opacity":n,"fill-opacity":l},K?(l="M0,0 L"+d+","+(g/2-g/2*r),m=" B",0<d&&(m=" A"),e.VML?(l+=m+Math.round(d-
I)+","+Math.round(g/2-J)+","+Math.round(d+I)+","+Math.round(g/2+J)+","+d+",0,"+d+","+g,l=l+(" L0,"+g)+(m+Math.round(-E)+","+Math.round(g/2-H)+","+Math.round(E)+","+Math.round(g/2+H)+",0,"+g+",0,0")):(l+="A"+I+","+J+",0,0,0,"+d+","+(g-g/2*(1-r))+"L0,"+g,l+="A"+E+","+H+",0,0,1,0,0"),E=90):(m=d/2-d/2*r,l="M0,0 L"+m+","+g,e.VML?(l="M0,0 L"+m+","+g,m=" B",0>g&&(m=" A"),l+=m+Math.round(d/2-I)+","+Math.round(g-J)+","+Math.round(d/2+I)+","+Math.round(g+J)+",0,"+g+","+d+","+g,l+=" L"+d+",0",l+=m+Math.round(d/
2+E)+","+Math.round(H)+","+Math.round(d/2-E)+","+Math.round(-H)+","+d+",0,0,0"):(l+="A"+I+","+J+",0,0,0,"+(d-d/2*(1-r))+","+g+"L"+d+",0",l+="A"+E+","+H+",0,0,1,0,0"),E=180),b=b.path(l).attr(k),b.gradient("linearGradient",[C,e.adjustLuminosity(C,-.3),e.adjustLuminosity(C,-.3),C],E),K?b.translate(h/2,0):b.translate(0,f/2)):b=0===g?e.line(b,[0,d],[0,0],q,n,m,u):0===d?e.line(b,[0,0],[0,g],q,n,m,u):0<x?e.rect(b,d,g,k,l,m,q,n,x,p,u):e.polygon(b,[0,0,d,d,0],[0,g,g,0,0],k,l,m,q,n,p,!1,u);d=isNaN(r)?0>g?[w,
M,A,z,G,y,D,F,L,b]:[F,L,A,z,G,y,w,M,D,b]:K?0<d?[w,b,F]:[F,b,w]:0>g?[w,b,F]:[F,b,w];e.setCN(c,b,t+"front");e.setCN(c,A,t+"back");e.setCN(c,F,t+"top");e.setCN(c,w,t+"bottom");e.setCN(c,G,t+"left");e.setCN(c,y,t+"right");for(w=0;w<d.length;w++)if(A=d[w])a.push(A),e.setCN(c,A,t+"element");B&&b.pattern(B,NaN,c.path)},width:function(a){isNaN(a)&&(a=0);this.w=Math.round(a);this.draw()},height:function(a){isNaN(a)&&(a=0);this.h=Math.round(a);this.draw()},animateHeight:function(a,b){var c=this;c.animationFinished=
!1;c.easing=b;c.totalFrames=a*e.updateRate;c.rh=c.h;c.frame=0;c.height(1);setTimeout(function(){c.updateHeight.call(c)},1E3/e.updateRate)},updateHeight:function(){var a=this;a.frame++;var b=a.totalFrames;a.frame<=b?(b=a.easing(0,a.frame,1,a.rh-1,b),a.height(b),window.requestAnimationFrame?window.requestAnimationFrame(function(){a.updateHeight.call(a)}):setTimeout(function(){a.updateHeight.call(a)},1E3/e.updateRate)):(a.height(a.rh),a.animationFinished=!0)},animateWidth:function(a,b){var c=this;c.animationFinished=
!1;c.easing=b;c.totalFrames=a*e.updateRate;c.rw=c.w;c.frame=0;c.width(1);setTimeout(function(){c.updateWidth.call(c)},1E3/e.updateRate)},updateWidth:function(){var a=this;a.frame++;var b=a.totalFrames;a.frame<=b?(b=a.easing(0,a.frame,1,a.rw-1,b),a.width(b),window.requestAnimationFrame?window.requestAnimationFrame(function(){a.updateWidth.call(a)}):setTimeout(function(){a.updateWidth.call(a)},1E3/e.updateRate)):(a.width(a.rw),a.animationFinished=!0)}})})();
(function(){var e=window.AmCharts;e.CategoryAxis=e.Class({inherits:e.AxisBase,construct:function(a){this.cname="CategoryAxis";e.CategoryAxis.base.construct.call(this,a);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.gridPosition="middle";this.safeDistance=30;this.stickBalloonToCategory=!1;e.applyTheme(this,a,this.cname)},draw:function(){e.CategoryAxis.base.draw.call(this);this.generateDFObject();var a=this.chart.chartData;this.data=a;this.labelRotationR=
this.labelRotation;this.type=null;if(e.ifArray(a)){var b,c=this.chart;"scrollbar"!=this.id?(e.setCN(c,this.set,"category-axis"),e.setCN(c,this.labelsSet,"category-axis"),e.setCN(c,this.axisLine.axisSet,"category-axis")):this.bcn=this.id+"-";var d=this.start,g=this.labelFrequency,h=0,f=this.end-d+1,k=this.gridCountR,l=this.showFirstLabel,m=this.showLastLabel,q,n,p="",p=e.extractPeriod(this.minPeriod),x=e.getPeriodDuration(p.period,p.count),u,B,r,t,C=this.rotate;q=this.firstDayOfWeek;n=this.boldPeriodBeginning;
b=e.resetDateToMin(new Date(a[a.length-1].time+1.05*x),this.minPeriod,1,q).getTime();this.firstTime=c.firstTime;this.endTime>b&&(this.endTime=b);t=this.minorGridEnabled;B=this.gridAlpha;var v,w=0,A=0;if(this.widthField)for(b=this.start;b<=this.end;b++)if(v=this.data[b]){var z=Number(this.data[b].dataContext[this.widthField]);isNaN(z)||(w+=z,v.widthValue=z)}if(this.parseDates&&!this.equalSpacing)this.lastTime=a[a.length-1].time,this.maxTime=e.resetDateToMin(new Date(this.lastTime+1.05*x),this.minPeriod,
1,q).getTime(),this.timeDifference=this.endTime-this.startTime,this.parseDatesDraw();else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(f),f<k&&(k=f),h+=this.start,this.stepWidth=this.getStepWidth(f),0<k)for(k=Math.floor(f/k),f=this.chooseMinorFrequency(k),p=h,p/2==Math.round(p/2)&&p--,0>p&&(p=0),v=0,this.widthField&&(p=this.start),this.end-p+1>=this.autoRotateCount&&(this.labelRotationR=this.autoRotateAngle),b=p;b<=this.end+2;b++){n=!1;0<=b&&b<this.data.length?(u=this.data[b],p=u.category,
n=u.forceShow):p="";if(t&&!isNaN(f))if(b/f==Math.round(b/f)||n)b/k==Math.round(b/k)||n||(this.gridAlpha=this.minorGridAlpha,p=void 0);else continue;else if(b/k!=Math.round(b/k)&&!n)continue;q=this.getCoordinate(b-h);r=0;"start"==this.gridPosition&&(q-=this.cellWidth/2,r=this.cellWidth/2);n=!0;a=r;"start"==this.tickPosition&&(a=0,n=!1,r=0);if(b==d&&!l||b==this.end&&!m)p=void 0;Math.round(v/g)!=v/g&&(p=void 0);v++;z=this.cellWidth;C&&(z=NaN,this.ignoreAxisWidth||!c.autoMargins)&&(z="right"==this.position?
c.marginRight:c.marginLeft,z-=this.tickLength+10);this.labelFunction&&u&&(p=this.labelFunction(p,u,this));p=e.fixBrakes(p);x=!1;this.boldLabels&&(x=!0);b>this.end&&"start"==this.tickPosition&&(p=" ");this.rotate&&this.inside&&(r-=2);isNaN(u.widthValue)||(u.percentWidthValue=u.widthValue/w*100,z=this.rotate?this.height*u.widthValue/w:this.width*u.widthValue/w,q=A,A+=z,r=z/2);r=new this.axisItemRenderer(this,q,p,n,z,r,void 0,x,a,!1,u.labelColor,u.className);r.serialDataItem=u;this.pushAxisItem(r);this.gridAlpha=
B}}else if(this.parseDates&&this.equalSpacing){h=this.start;this.startTime=this.data[this.start].time;this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;b=this.choosePeriod(0);g=b.period;u=b.count;b=e.getPeriodDuration(g,u);b<x&&(g=p.period,u=p.count,b=x);B=g;"WW"==B&&(B="DD");this.currentDateFormat=this.dateFormatsObject[B];this.stepWidth=this.getStepWidth(f);k=Math.ceil(this.timeDifference/b)+1;x=e.resetDateToMin(new Date(this.startTime-b),g,u,q).getTime();this.cellWidth=
this.getStepWidth(f);p=Math.round(x/b);d=-1;p/2==Math.round(p/2)&&(d=-2,x-=b);p=this.start;p/2==Math.round(p/2)&&p--;0>p&&(p=0);A=this.end+2;A>=this.data.length&&(A=this.data.length);v=!1;v=!l;this.previousPos=-1E3;20<this.labelRotationR&&(this.safeDistance=5);a=p;if(this.data[p].time!=e.resetDateToMin(new Date(this.data[p].time),g,u,q).getTime())for(q=0,z=x,b=p;b<A;b++)f=this.data[b].time,this.checkPeriodChange(g,u,f,z)&&(q++,2<=q&&(a=b,b=A),z=f);t&&1<u&&(f=this.chooseMinorFrequency(u),e.getPeriodDuration(g,
f));if(0<this.gridCountR)for(b=p;b<A;b++)if(f=this.data[b].time,this.checkPeriodChange(g,u,f,x)&&b>=a){q=this.getCoordinate(b-this.start);t=!1;this.nextPeriod[B]&&(t=this.checkPeriodChange(this.nextPeriod[B],1,f,x,B));x=!1;t&&this.markPeriodChange?(t=this.dateFormatsObject[this.nextPeriod[B]],x=!0):t=this.dateFormatsObject[B];p=e.formatDate(new Date(f),t,c);if(b==d&&!l||b==k&&!m)p=" ";v?v=!1:(n||(x=!1),q-this.previousPos>this.safeDistance*Math.cos(this.labelRotationR*Math.PI/180)&&(this.labelFunction&&
(p=this.labelFunction(p,new Date(f),this,g,u,r)),this.boldLabels&&(x=!0),r=new this.axisItemRenderer(this,q,p,void 0,void 0,void 0,void 0,x),t=r.graphics(),this.pushAxisItem(r),t=t.getBBox().width,e.isModern||(t-=q),this.previousPos=q+t));r=x=f}}for(b=l=0;b<this.data.length;b++)if(v=this.data[b])this.parseDates&&!this.equalSpacing?(m=v.time,d=this.cellWidth,"MM"==this.minPeriod&&(d=864E5*e.daysInMonth(new Date(m))*this.stepWidth,v.cellWidth=d),m=Math.round((m-this.startTime)*this.stepWidth+d/2)):
m=this.getCoordinate(b-h),v.x[this.id]=m;if(this.widthField)for(b=this.start;b<=this.end;b++)v=this.data[b],d=v.widthValue,v.percentWidthValue=d/w*100,this.rotate?(m=this.height*d/w/2+l,l=this.height*d/w+l):(m=this.width*d/w/2+l,l=this.width*d/w+l),v.x[this.id]=m;w=this.guides.length;for(b=0;b<w;b++)l=this.guides[b],n=k=k=t=d=NaN,m=l.above,l.toCategory&&(k=c.getCategoryIndexByValue(l.toCategory),isNaN(k)||(d=this.getCoordinate(k-h),l.expand&&(d+=this.cellWidth/2),r=new this.axisItemRenderer(this,
d,"",!0,NaN,NaN,l),this.pushAxisItem(r,m))),l.category&&(n=c.getCategoryIndexByValue(l.category),isNaN(n)||(t=this.getCoordinate(n-h),l.expand&&(t-=this.cellWidth/2),k=(d-t)/2,r=new this.axisItemRenderer(this,t,l.label,!0,NaN,k,l),this.pushAxisItem(r,m))),n=c.dataDateFormat,l.toDate&&(!n||l.toDate instanceof Date||(l.toDate=l.toDate.toString()+" |"),l.toDate=e.getDate(l.toDate,n),this.equalSpacing?(k=c.getClosestIndex(this.data,"time",l.toDate.getTime(),!1,0,this.data.length-1),isNaN(k)||(d=this.getCoordinate(k-
h))):d=(l.toDate.getTime()-this.startTime)*this.stepWidth,r=new this.axisItemRenderer(this,d,"",!0,NaN,NaN,l),this.pushAxisItem(r,m)),l.date&&(!n||l.date instanceof Date||(l.date=l.date.toString()+" |"),l.date=e.getDate(l.date,n),this.equalSpacing?(n=c.getClosestIndex(this.data,"time",l.date.getTime(),!1,0,this.data.length-1),isNaN(n)||(t=this.getCoordinate(n-h))):t=(l.date.getTime()-this.startTime)*this.stepWidth,k=(d-t)/2,n=!0,l.toDate&&(n=!1),r="H"==this.orientation?new this.axisItemRenderer(this,
t,l.label,n,2*k,NaN,l):new this.axisItemRenderer(this,t,l.label,!1,NaN,k,l),this.pushAxisItem(r,m)),(0<d||0<t)&&(d<this.width||t<this.width)&&(d=new this.guideFillRenderer(this,t,d,l),t=d.graphics(),this.pushAxisItem(d,m),l.graphics=t,t.index=b,l.balloonText&&this.addEventListeners(t,l));if(c=c.chartCursor)C?c.fixHeight(this.cellWidth):(c.fixWidth(this.cellWidth),c.fullWidth&&this.balloon&&(this.balloon.minWidth=this.cellWidth));this.previousHeight=G}this.axisCreated=!0;this.set.translate(this.x,
this.y);this.labelsSet.translate(this.x,this.y);this.labelsSet.show();this.positionTitle();(C=this.axisLine.set)&&C.toFront();var G=this.getBBox().height;2<G-this.previousHeight&&this.autoWrap&&!this.parseDates&&(this.axisCreated=this.chart.marginsUpdated=!1)},xToIndex:function(a){var b=this.data,c=this.chart,d=c.rotate,g=this.stepWidth,h;if(this.parseDates&&!this.equalSpacing)a=this.startTime+Math.round(a/g)-this.minDuration()/2,h=c.getClosestIndex(b,"time",a,!1,this.start,this.end+1);else if(this.widthField)for(c=
Infinity,g=this.start;g<=this.end;g++){var f=this.data[g];f&&(f=Math.abs(f.x[this.id]-a),f<c&&(c=f,h=g))}else this.startOnAxis||(a-=g/2),h=this.start+Math.round(a/g);h=e.fitToBounds(h,0,b.length-1);var k;b[h]&&(k=b[h].x[this.id]);d?k>this.height+1&&h--:k>this.width+1&&h--;0>k&&h++;return h=e.fitToBounds(h,0,b.length-1)},dateToCoordinate:function(a){return this.parseDates&&!this.equalSpacing?(a.getTime()-this.startTime)*this.stepWidth:this.parseDates&&this.equalSpacing?(a=this.chart.getClosestIndex(this.data,
"time",a.getTime(),!1,0,this.data.length-1),this.getCoordinate(a-this.start)):NaN},categoryToCoordinate:function(a){if(this.chart){var b=this.chart.getCategoryIndexByValue(a);if(!isNaN(b))return this.getCoordinate(b-this.start);if(this.parseDates)return this.dateToCoordinate(new Date(a))}else return NaN},coordinateToDate:function(a){return this.equalSpacing?(a=this.xToIndex(a),new Date(this.data[a].time)):new Date(this.startTime+a/this.stepWidth)},coordinateToValue:function(a){a=this.xToIndex(a);
if(a=this.data[a])return this.parseDates?a.time:a.category},getCoordinate:function(a){a*=this.stepWidth;this.startOnAxis||(a+=this.stepWidth/2);return Math.round(a)},formatValue:function(a,b){b||(b=this.currentDateFormat);this.parseDates&&(a=e.formatDate(new Date(a),b,this.chart));return a},showBalloonAt:function(a){a=this.parseDates?this.dateToCoordinate(new Date(a)):this.categoryToCoordinate(a);return this.adjustBalloonCoordinate(a)},formatBalloonText:function(a,b,c){var d="",g="",h=this.chart,
f=this.data[b];if(f)if(this.parseDates)d=e.formatDate(f.category,c,h),b=e.changeDate(new Date(f.category),this.minPeriod,1),g=e.formatDate(b,c,h),-1!=d.indexOf("fff")&&(d=e.formatMilliseconds(d,f.category),g=e.formatMilliseconds(g,b));else{var k;this.data[b+1]&&(k=this.data[b+1]);d=e.fixNewLines(f.category);k&&(g=e.fixNewLines(k.category))}a=a.replace(/\[\[category\]\]/g,String(d));return a=a.replace(/\[\[toCategory\]\]/g,String(g))},adjustBalloonCoordinate:function(a,b){var c=this.xToIndex(a),d=
this.chart.chartCursor;if(this.stickBalloonToCategory){var e=this.data[c];e&&(a=e.x[this.id]);this.stickBalloonToStart&&(a-=this.cellWidth/2);var h=0;if(d){var f=d.limitToGraph;f&&(h=e.axes[f.valueAxis.id].graphs[f.id].y);this.rotate?("left"==this.position?(f&&(h-=d.width),0<h&&(h=0)):0>h&&(h=0),d.fixHLine(a,h)):("top"==this.position?(f&&(h-=d.height),0<h&&(h=0)):0>h&&(h=0),d.fixVLine(a,h))}}d&&!b&&(d.setIndex(c),this.parseDates&&d.setTimestamp(this.coordinateToDate(a).getTime()));return a}})})();(function(){var d=window.AmCharts;d.AmStockChart=d.Class({construct:function(a){this.type="stock";this.cname="AmStockChart";d.addChart(this);this.version="3.18.6";this.theme=a;this.createEvents("buildStarted","zoomed","rollOverStockEvent","rollOutStockEvent","clickStockEvent","panelRemoved","dataUpdated","init","rendered","drawn","resized");this.colors="#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");this.firstDayOfWeek=1;this.glueToTheEnd=
!1;this.dataSetCounter=-1;this.zoomOutOnDataSetChange=!1;this.panels=[];this.dataSets=[];this.chartCursors=[];this.comparedDataSets=[];this.classNamePrefix="amcharts";this.categoryAxesSettings=new d.CategoryAxesSettings(a);this.valueAxesSettings=new d.ValueAxesSettings(a);this.panelsSettings=new d.PanelsSettings(a);this.chartScrollbarSettings=new d.ChartScrollbarSettings(a);this.chartCursorSettings=new d.ChartCursorSettings(a);this.stockEventsSettings=new d.StockEventsSettings(a);this.legendSettings=
new d.LegendSettings(a);this.balloon=new d.AmBalloon(a);this.previousEndDate=new Date(0);this.previousStartDate=new Date(0);this.dataSetCount=this.graphCount=0;this.chartCreated=!1;this.processTimeout=0;this.autoResize=this.extendToFullPeriod=!0;d.applyTheme(this,a,this.cname)},write:function(a){var b=this;if(b.listeners)for(var c in b.listeners){var e=b.listeners[c];b.addListener(e.event,e.method)}b.fire({type:"buildStarted",chart:b});b.afterWriteTO&&clearTimeout(b.afterWriteTO);0<b.processTimeout?
b.afterWriteTO=setTimeout(function(){b.afterWrite.call(b,a)},b.processTimeout):b.afterWrite(a)},afterWrite:function(a){var b=this.theme;window.AmCharts_path&&(this.path=window.AmCharts_path);void 0===this.path&&(this.path=d.getPath());void 0===this.path&&(this.path="amcharts/");this.path=d.normalizeUrl(this.path);void 0===this.pathToImages&&(this.pathToImages=this.path+"images/");this.initHC||(d.callInitHandler(this),this.initHC=!0);d.applyLang(this.language,this);this.chartCursors=[];var c=this.exportConfig;
c&&d.AmExport&&!this.AmExport&&(this.AmExport=new d.AmExport(this,c));this.amExport&&d.AmExport&&(this.AmExport=d.extend(this.amExport,new d.AmExport(this),!0));this.AmExport&&this.AmExport.init();this.chartRendered=!1;a="object"!=typeof a?document.getElementById(a):a;this.zoomOutOnDataSetChange&&(this.endDate=this.startDate=void 0);this.categoryAxesSettings=d.processObject(this.categoryAxesSettings,d.CategoryAxesSettings,b);this.valueAxesSettings=d.processObject(this.valueAxesSettings,d.ValueAxesSettings,
b);this.chartCursorSettings=d.processObject(this.chartCursorSettings,d.ChartCursorSettings,b);this.chartScrollbarSettings=d.processObject(this.chartScrollbarSettings,d.ChartScrollbarSettings,b);this.legendSettings=d.processObject(this.legendSettings,d.LegendSettings,b);this.panelsSettings=d.processObject(this.panelsSettings,d.PanelsSettings,b);this.stockEventsSettings=d.processObject(this.stockEventsSettings,d.StockEventsSettings,b);this.dataSetSelector&&(this.dataSetSelector=d.processObject(this.dataSetSelector,
d.DataSetSelector,b));this.periodSelector&&(this.periodSelector=d.processObject(this.periodSelector,d.PeriodSelector,b));a.innerHTML="";this.div=a;this.measure();this.createLayout();this.updateDataSets();this.addDataSetSelector();this.addPeriodSelector();this.addPanels();this.updatePanels();this.addChartScrollbar();this.updateData();this.skipDefault||this.setDefaultPeriod();this.skipEvents=!1},setDefaultPeriod:function(){var a=this.periodSelector;a&&(this.animationPlayed=!1,a.setDefaultPeriod())},
validateSize:function(){this.measurePanels()},updateDataSets:function(){var a=this.mainDataSet,b=this.dataSets,c;for(c=0;c<b.length;c++){var e=b[c],e=d.processObject(e,d.DataSet);b[c]=e;e.id||(this.dataSetCount++,e.id="ds"+this.dataSetCount);void 0===e.color&&(e.color=this.colors.length-1>c?this.colors[c]:d.randomColor())}!a&&d.ifArray(b)&&(this.mainDataSet=this.dataSets[0]);this.getSelections()},getLastDate:function(a){var b=d.getDate(a,this.dataDateFormat,"fff");a=this.categoryAxesSettings.minPeriod;
b=d.changeDate(b,this.categoryAxesSettings.minPeriod,1,!0).getTime();-1==a.indexOf("fff")&&--b;return new Date(b)},getFirstDate:function(a){a=d.getDate(a,this.dataDateFormat,"fff");return new Date(d.resetDateToMin(a,this.categoryAxesSettings.minPeriod,1,this.firstDayOfWeek))},updateData:function(){var a=this,b=a.mainDataSet;if(b){a.parsingData=!1;var c=a.categoryAxesSettings;-1==d.getItemIndex(c.minPeriod,c.groupToPeriods)&&c.groupToPeriods.unshift(c.minPeriod);var e=b.dataProvider;if(d.ifArray(e)){var h=
b.categoryField;a.firstDate=a.getFirstDate(e[0][h]);a.lastDate=a.getLastDate(e[e.length-1][h]);a.periodSelector&&a.periodSelector.setRanges(a.firstDate,a.lastDate);b.dataParsed||(a.parsingData=!0,0<a.processTimeout?setTimeout(function(){a.parseStockData.call(a,b,c.minPeriod,c.groupToPeriods,a.firstDayOfWeek,a.dataDateFormat)},a.processTimeout):a.parseStockData(b,c.minPeriod,c.groupToPeriods,a.firstDayOfWeek,a.dataDateFormat));this.updateComparingData()}else a.firstDate=void 0,a.lastDate=void 0;a.fixGlue();
if(!a.parsingData)a.onDataUpdated()}},fixGlue:function(){if(this.glueToTheEnd&&this.startDate&&this.endDate&&this.lastDate){this.startDate=new Date(this.startDate.getTime()+(this.lastDate.getTime()-this.endDate.getTime())+1);var a=d.extractPeriod(this.categoryAxesSettings.minPeriod);this.startDate=d.resetDateToMin(this.startDate,a.period,a.count,this.firstDayOfWeek);this.endDate=this.lastDate;this.updateScrollbar=!0}},isDataParsed:function(){if(this.mainDataSet){for(var a=!0,b=0;b<this.comparedDataSets.length;b++)this.comparedDataSets[b].dataParsed||
(a=!1);if(this.mainDataSet.dataParsed&&a)return!0}return!1},onDataUpdated:function(){this.isDataParsed()&&(this.updatePanelsWithNewData(),this.skipEvents||this.fire({type:"dataUpdated",chart:this}))},updateComparingData:function(){var a=this.comparedDataSets,b=this.categoryAxesSettings,c;for(c=0;c<a.length;c++){var e=a[c];e.dataParsed||(this.parsingData=!0,0<this.processTimeout?this.delayedParseStockData(c,e):this.parseStockData(e,b.minPeriod,b.groupToPeriods,this.firstDayOfWeek,this.dataDateFormat))}},
delayedParseStockData:function(a,b){var c=this,e=c.categoryAxesSettings;setTimeout(function(){c.parseStockData.call(c,b,e.minPeriod,e.groupToPeriods,c.firstDayOfWeek,c.dataDateFormat)},c.processTimeout*a)},parseStockData:function(a,b,c,e,h){var k=this,m={},g=a.dataProvider,p=a.categoryField;if(p){var f=d.getItemIndex(b,c),n=c.length,l,w=g.length,t,y={};for(l=f;l<n;l++)t=c[l],m[t]=[];var r={},z=a.fieldMappings,A=z.length;for(l=0;l<w;l++){var B=g[l],E=d.getDate(B[p],h,b),D=E.getTime(),q={};for(t=0;t<
A;t++)q[z[t].toField]=B[z[t].fromField];var C;for(C=f;C<n;C++){t=c[C];var u=d.extractPeriod(t),F=u.period,H=u.count,v,x;if(C==f||D>=y[t]||!y[t]){r[t]={};r[t].amCategoryIdField=String(d.resetDateToMin(E,F,H,e).getTime());var G;for(G=0;G<A;G++)u=z[G].toField,v=r[t],x=Number(q[u]),v[u+"Count"]=0,isNaN(x)||(v[u+"Open"]=x,v[u+"Sum"]=x,v[u+"High"]=x,v[u+"AbsHigh"]=x,v[u+"Low"]=x,v[u+"Close"]=x,v[u+"Count"]=1,v[u+"Average"]=x);v.dataContext=B;m[t].push(r[t]);C>f&&(u=d.newDate(E,b),u=d.changeDate(u,F,H,!0),
u=d.resetDateToMin(u,F,H,e),y[t]=u.getTime());if(C==f)for(var I in B)B.hasOwnProperty(I)&&(r[t][I]=B[I]);r[t][p]=d.newDate(E,b)}else for(F=0;F<A;F++)u=z[F].toField,v=r[t],l==w-1&&(v[p]=d.newDate(E,b)),x=Number(q[u]),isNaN(x)||(isNaN(v[u+"Low"])&&(v[u+"Low"]=x),x<v[u+"Low"]&&(v[u+"Low"]=x),isNaN(v[u+"High"])&&(v[u+"High"]=x),x>v[u+"High"]&&(v[u+"High"]=x),isNaN(v[u+"AbsHigh"])&&(v[u+"AbsHigh"]=x),Math.abs(x)>v[u+"AbsHigh"]&&(v[u+"AbsHigh"]=x),v[u+"Close"]=x,H=d.getDecimals(v[u+"Sum"]),G=d.getDecimals(x),
isNaN(v[u+"Sum"])&&(v[u+"Sum"]=0),v[u+"Sum"]+=x,v[u+"Sum"]=d.roundTo(v[u+"Sum"],Math.max(H,G)),v[u+"Count"]++,v[u+"Average"]=v[u+"Sum"]/v[u+"Count"])}}}a.agregatedDataProviders=m;d.ifArray(a.stockEvents)?0<k.processTimeout?setTimeout(function(){k.parseEvents.call(k,a,k.panels,k.stockEventsSettings,k.firstDayOfWeek,k,k.dataDateFormat)},k.processTimeout):k.parseEvents(a,k.panels,k.stockEventsSettings,k.firstDayOfWeek,k,k.dataDateFormat):(a.dataParsed=!0,k.onDataUpdated())},parseEvents:function(a,b,
c,e,h,k){e=a.stockEvents;var m=a.agregatedDataProviders,g=b.length,p,f,n,l,w,t;for(p=0;p<g;p++){t=b[p];w=t.graphs;n=w.length;for(f=0;f<n;f++)l=w[f],l.customBulletField="amCustomBullet"+l.id+"_"+t.id,l.bulletConfigField="amCustomBulletConfig"+l.id+"_"+t.id,l.chart=t;for(f=0;f<e.length;f++)n=e[f],l=n.graph,d.isString(l)&&(l=d.getObjById(w,l))&&(n.graph=l),n.panel=l.chart}for(var y in m)if(m.hasOwnProperty(y))for(b=m[y],g=d.extractPeriod(y),p=b.length,f=0;f<e.length;f++){n=e[f];l=n.date instanceof Date;
k&&!l&&(n.date=d.stringToDate(n.date,k));l=n.date.getTime();var r=this.getEventDataItem(l,b,a,0,p,g);r&&(l=n.graph,t=n.panel,w="amCustomBullet"+l.id+"_"+t.id,t="amCustomBulletConfig"+l.id+"_"+t.id,l&&(r[t]?l=r[t]:(l={},l.eventDispatcher=h,l.eventObjects=[],l.letters=[],l.descriptions=[],l.shapes=[],l.backgroundColors=[],l.backgroundAlphas=[],l.borderColors=[],l.borderAlphas=[],l.colors=[],l.rollOverColors=[],l.showOnAxis=[],l.values=[],l.showAts=[],l.fontSizes=[],l.showBullets=[],r[w]=d.StackedBullet,
r[t]=l),l.eventObjects.push(n),l.letters.push(n.text),l.descriptions.push(n.description),n.type?l.shapes.push(n.type):l.shapes.push(c.type),void 0!==n.backgroundColor?l.backgroundColors.push(n.backgroundColor):l.backgroundColors.push(c.backgroundColor),isNaN(n.backgroundAlpha)?l.backgroundAlphas.push(c.backgroundAlpha):l.backgroundAlphas.push(n.backgroundAlpha),isNaN(n.borderAlpha)?l.borderAlphas.push(c.borderAlpha):l.borderAlphas.push(n.borderAlpha),void 0!==n.borderColor?l.borderColors.push(n.borderColor):
l.borderColors.push(c.borderColor),void 0!==n.rollOverColor?l.rollOverColors.push(n.rollOverColor):l.rollOverColors.push(c.rollOverColor),void 0!==n.showAt?l.showAts.push(n.showAt):l.showAts.push(c.showAt),void 0!==n.fontSize&&l.fontSizes.push(n.fontSize),l.colors.push(n.color),l.values.push(n.value),l.showOnAxis.push(n.showOnAxis),l.showBullets.push(n.showBullet),l.date=new Date(n.date)))}a.dataParsed=!0;this.onDataUpdated()},getEventDataItem:function(a,b,c,e,h,k){var m=k.period,g=k.count,p=Math.floor(e+
(h-e)/2),f=b[p],n=f[c.categoryField],l=this.dataDateFormat,w=n instanceof Date;l&&!w&&(n=d.stringToDate(n,l));l=n.getTime();"YYYY"==m&&(l=d.resetDateToMin(new Date(n),m,g,this.firstDayOfWeek).getTime());m="fff"==m?n.getTime()+1:d.resetDateToMin(d.changeDate(new Date(n),k.period,k.count),m,g,this.firstDayOfWeek).getTime();if(a>=l&&a<m)return f;if(!(1>=h-e))return a<l?this.getEventDataItem(a,b,c,e,p,k):this.getEventDataItem(a,b,c,p,h,k)},createLayout:function(){var a=this.div,b,c,e=this.classNamePrefix,
d=document.createElement("div");d.style.position="relative";this.containerDiv=d;d.className=e+"-stock-div";a.appendChild(d);if(a=this.periodSelector)b=a.position;if(a=this.dataSetSelector)c=a.position;if("left"==b||"left"==c)a=document.createElement("div"),a.className=e+"-left-div",a.style.cssFloat="left",a.style.styleFloat="left",a.style.width="0px",a.style.position="absolute",d.appendChild(a),this.leftContainer=a;if("right"==b||"right"==c)b=document.createElement("div"),b.className=e+"-right-div",
b.style.cssFloat="right",b.style.styleFloat="right",b.style.width="0px",d.appendChild(b),this.rightContainer=b;b=document.createElement("div");b.className=e+"-center-div";d.appendChild(b);this.centerContainer=b;d=document.createElement("div");d.className=e+"-panels-div";b.appendChild(d);this.panelsContainer=d},addPanels:function(){this.measurePanels(!0);for(var a=this.panels,b=0;b<a.length;b++){var c=a[b],c=d.processObject(c,d.StockPanel,this.theme,!0);a[b]=c;this.addStockPanel(c,b)}this.panelsAdded=
!0},measurePanels:function(a){this.measure();var b=this.chartScrollbarSettings,c=this.divRealHeight,e=this.divRealWidth;if(this.div){var d=this.panelsSettings.panelSpacing;b.enabled&&(c-=b.height);(b=this.periodSelector)&&!b.vertical&&(b=b.offsetHeight,c-=b+d);(b=this.dataSetSelector)&&!b.vertical&&(b=b.offsetHeight,c-=b+d);a||c==this.prevPH&&this.prevPW==e||this.fire({type:"resized",chart:this});this.prevPW!=e&&(this.prevPW=e);if(c!=this.prevPH){a=this.panels;0<c&&(this.panelsContainer.style.height=
c+"px");for(var e=0,k,b=0;b<a.length;b++)if(k=a[b]){var m=k.percentHeight;isNaN(m)&&(m=100/a.length,k.percentHeight=m);e+=m}this.panelsHeight=Math.max(c-d*(a.length-1),0);for(b=0;b<a.length;b++)if(k=a[b])k.percentHeight=k.percentHeight/e*100,k.panelBox&&(k.panelBox.style.height=Math.round(k.percentHeight*this.panelsHeight/100)+"px");this.prevPH=c}}},addStockPanel:function(a,b){var c=this.panelsSettings,e=document.createElement("div");0<b&&!this.panels[b-1].showCategoryAxis&&(e.style.marginTop=c.panelSpacing+
"px");a.hideBalloonReal();a.panelBox=e;a.stockChart=this;a.id||(a.id="stockPanel"+b);e.className="amChartsPanel "+this.classNamePrefix+"-stock-panel-div "+this.classNamePrefix+"-stock-panel-div-"+a.id;a.pathToImages=this.pathToImages;a.path=this.path;e.style.height=Math.round(a.percentHeight*this.panelsHeight/100)+"px";e.style.width="100%";this.panelsContainer.appendChild(e);0<c.backgroundAlpha&&(e.style.backgroundColor=c.backgroundColor);if(e=a.stockLegend)e=d.processObject(e,d.StockLegend,this.theme),
e.container=void 0,e.title=a.title,e.marginLeft=c.marginLeft,e.marginRight=c.marginRight,e.verticalGap=3,e.position="top",d.copyProperties(this.legendSettings,e),a.addLegend(e,e.divId);a.zoomOutText="";this.addCursor(a)},enableCursors:function(a){var b=this.chartCursors,c;for(c=0;c<b.length;c++)b[c].enabled=a},updatePanels:function(){var a=this.panels,b;for(b=0;b<a.length;b++)this.updatePanel(a[b]);this.mainDataSet&&this.updateGraphs();this.currentPeriod=void 0},updatePanel:function(a){a.seriesIdField=
"amCategoryIdField";a.dataProvider=[];a.chartData=[];a.graphs=[];var b=a.categoryAxis,c=this.categoryAxesSettings;d.copyProperties(this.panelsSettings,a);d.copyProperties(c,b);b.parseDates=!0;a.addClassNames=this.addClassNames;a.classNamePrefix=this.classNamePrefix;a.zoomOutOnDataUpdate=!1;a.mouseWheelScrollEnabled=this.mouseWheelScrollEnabled;a.dataDateFormat=this.dataDateFormat;a.language=this.language;a.showCategoryAxis?"top"==b.position?a.marginTop=c.axisHeight:a.marginBottom=c.axisHeight:(a.categoryAxis.labelsEnabled=
!1,a.chartCursor&&(a.chartCursor.categoryBalloonEnabled=!1));var c=a.valueAxes,e=c.length,h;0===e&&(h=new d.ValueAxis(this.theme),a.addValueAxis(h));b=new d.AmBalloon(this.theme);d.copyProperties(this.balloon,b);a.balloon=b;c=a.valueAxes;e=c.length;for(b=0;b<e;b++)h=c[b],d.copyProperties(this.valueAxesSettings,h);a.listenersAdded=!1;a.write(a.panelBox)},zoom:function(a,b){this.zoomChart(a,b)},zoomOut:function(){this.zoomChart(this.firstDate,this.lastDate)},updatePanelsWithNewData:function(){var a=
this.mainDataSet,b=this.scrollbarChart;this.updateGraphs();if(a){var c=this.panels;this.currentPeriod=void 0;var e;for(e=0;e<c.length;e++){var d=c[e];d.categoryField=a.categoryField;0===a.dataProvider.length&&(d.dataProvider=[]);d.scrollbarChart=b}if(b){c=this.categoryAxesSettings;e=c.minPeriod;b.categoryField=a.categoryField;d=b.dataProvider;if(0<a.dataProvider.length){var k=this.chartScrollbarSettings.usePeriod;b.dataProvider=k?a.agregatedDataProviders[k]:a.agregatedDataProviders[e]}else b.dataProvider=
[];k=b.categoryAxis;k.minPeriod=e;k.firstDayOfWeek=this.firstDayOfWeek;k.equalSpacing=c.equalSpacing;k.axisAlpha=0;k.markPeriodChange=c.markPeriodChange;b.bbsetr=!0;d!=b.dataProvider&&b.validateData();c=this.panelsSettings;b.maxSelectedTime=c.maxSelectedTime;b.minSelectedTime=c.minSelectedTime}0<a.dataProvider.length&&(this.fixGlue(),this.zoomChart(this.startDate,this.endDate))}this.panelDataInvalidated=!1},addChartScrollbar:function(){var a=this.chartScrollbarSettings,b=this.scrollbarChart;b&&(b.clear(),
b.destroy());if(a.enabled){var c=this.panelsSettings,e=this.categoryAxesSettings,b=new d.AmSerialChart(this.theme);b.language=this.language;b.pathToImages=this.pathToImages;b.autoMargins=!1;this.scrollbarChart=b;b.id="scrollbarChart";b.scrollbarOnly=!0;b.zoomOutText="";c.fontFamily&&(b.fontFamily=c.fontFamily);isNaN(c.fontSize)||(b.fontSize=c.fontSize);b.marginLeft=c.marginLeft;b.marginRight=c.marginRight;b.marginTop=0;b.marginBottom=0;var c=e.dateFormats,h=b.categoryAxis;h.boldPeriodBeginning=e.boldPeriodBeginning;
c&&(h.dateFormats=e.dateFormats);h.labelsEnabled=!1;h.parseDates=!0;e=a.graph;if(d.isString(e)){c=this.panels;for(h=0;h<c.length;h++){var k=d.getObjById(c[h].stockGraphs,a.graph);k&&(e=k)}a.graph=e}var m;e&&(m=new d.AmGraph(this.theme),m.valueField=e.valueField,m.periodValue=e.periodValue,m.type=e.type,m.connect=e.connect,m.minDistance=a.minDistance,b.addGraph(m));e=new d.ChartScrollbar(this.theme);b.addChartScrollbar(e);d.copyProperties(a,e);e.scrollbarHeight=a.height;e.graph=m;this.listenTo(e,"zoomed",
this.handleScrollbarZoom);m=document.createElement("div");m.className=this.classNamePrefix+"-scrollbar-chart-div";m.style.height=a.height+"px";e=this.periodSelectorContainer;c=this.periodSelector;h=this.centerContainer;"bottom"==a.position?c?"bottom"==c.position?h.insertBefore(m,e):h.appendChild(m):h.appendChild(m):c?"top"==c.position?h.insertBefore(m,e.nextSibling):h.insertBefore(m,h.firstChild):h.insertBefore(m,h.firstChild);b.write(m)}},handleScrollbarZoom:function(a){if(this.skipScrollbarEvent)this.skipScrollbarEvent=
!1;else{var b=a.endDate,c={};c.startDate=a.startDate;c.endDate=b;this.updateScrollbar=!1;this.handleZoom(c)}},addPeriodSelector:function(){var a=this.periodSelector;if(a){var b=this.categoryAxesSettings.minPeriod;a.minDuration=d.getPeriodDuration(b);a.minPeriod=b;a.chart=this;var c=this.dataSetSelector,e,b=this.dssContainer;c&&(e=c.position);var c=this.panelsSettings.panelSpacing,h=document.createElement("div");this.periodSelectorContainer=h;var k=this.leftContainer,m=this.rightContainer,g=this.centerContainer,
p=this.panelsContainer,f=a.width+2*c+"px";switch(a.position){case "left":k.style.width=a.width+"px";k.appendChild(h);g.style.paddingLeft=f;break;case "right":g.style.marginRight=f;m.appendChild(h);m.style.width=a.width+"px";break;case "top":p.style.clear="both";g.insertBefore(h,p);h.style.paddingBottom=c+"px";h.style.overflow="hidden";break;case "bottom":h.style.marginTop=c+"px","bottom"==e?g.insertBefore(h,b):g.appendChild(h)}this.listenTo(a,"changed",this.handlePeriodSelectorZoom);a.write(h)}},
addDataSetSelector:function(){var a=this.dataSetSelector;if(a){a.chart=this;a.dataProvider=this.dataSets;var b=a.position,c=this.panelsSettings.panelSpacing,e=document.createElement("div");this.dssContainer=e;var d=this.leftContainer,k=this.rightContainer,m=this.centerContainer,g=this.panelsContainer,c=a.width+2*c+"px";switch(b){case "left":d.style.width=a.width+"px";d.appendChild(e);m.style.paddingLeft=c;break;case "right":m.style.marginRight=c;k.appendChild(e);k.style.width=a.width+"px";break;case "top":g.style.clear=
"both";m.insertBefore(e,g);e.style.overflow="hidden";break;case "bottom":m.appendChild(e)}a.write(e)}},handlePeriodSelectorZoom:function(a){var b=this.scrollbarChart;b&&(b.updateScrollbar=!0);a.predefinedPeriod?(this.predefinedStart=a.startDate,this.predefinedEnd=a.endDate):this.predefinedEnd=this.predefinedStart=null;this.zoomOutValueAxes();this.zoomChart(a.startDate,a.endDate)},zoomOutValueAxes:function(){var a=this.panels;if(this.panelsSettings.zoomOutAxes)for(var b=0;b<a.length;b++){var c=a[b].valueAxes;
if(c)for(var e=0;e<c.length;e++){var d=c[e];d.minZoom=NaN;d.maxZoom=NaN}}},addCursor:function(a){var b=this.chartCursorSettings;if(b.enabled){var c=new d.ChartCursor(this.theme);d.copyProperties(b,c);var e=b.categoryBalloonFunction;a.chartCursor&&(d.copyProperties(a.chartCursor,c),a.chartCursor.categoryBalloonFunction&&(e=a.chartCursor.categoryBalloonFunction));c.categoryBalloonFunction=e;a.removeChartCursor();a.addChartCursor(c);"mouse"==b.cursorPosition?this.listenTo(c,"moved",this.handleCursorChange):
this.listenTo(c,"changed",this.handleCursorChange);this.listenTo(c,"onHideCursor",this.handleCursorChange);this.listenTo(c,"zoomStarted",this.handleCursorChange);this.listenTo(c,"zoomed",this.handleCursorZoom);this.chartCursors.push(c)}},handleCursorChange:function(a){a=a.target;var b=this.chartCursors,c;for(c=0;c<b.length;c++){var e=b[c];e!=a&&e.syncWithCursor(a,this.chartCursorSettings.onePanelOnly)}},handleCursorZoom:function(a){var b=this.scrollbarChart;b&&(b.updateScrollbar=!0);var b={},c,e;
if(this.categoryAxesSettings.equalSpacing){e=this.mainDataSet.categoryField;var d=this.mainDataSet.agregatedDataProviders[this.currentPeriod];c=new Date(d[a.start][e]);e=new Date(d[a.end][e])}else c=new Date(a.start),e=new Date(a.end);b.startDate=c;b.endDate=e;this.handleZoom(b);this.handleCursorChange(a)},handleZoom:function(a){this.zoomChart(a.startDate,a.endDate)},zoomChart:function(a,b){var c=this;a||(a=c.firstDate);var e=d.newDate(a),h=c.firstDate,k=c.lastDate,m=c.currentPeriod,g=c.categoryAxesSettings,
p=g.minPeriod,f=c.panelsSettings,n=c.periodSelector,l=c.panels,w=c.comparedGraphs,t=c.scrollbarChart,y=c.firstDayOfWeek;if(h&&k){a||(a=h);b||(b=k);if(m){var r=d.extractPeriod(m);a.getTime()==b.getTime()&&r!=p&&(b=d.changeDate(b,r.period,r.count),b.setTime(b.getTime()-1))}a.getTime()<h.getTime()&&(a=h);a.getTime()>k.getTime()&&(a=k);b.getTime()<h.getTime()&&(b=h);b.getTime()>k.getTime()&&(b=k);r=d.getItemIndex(p,g.groupToPeriods);p=m;m=c.choosePeriod(r,a,b);c.currentPeriod=m;var r=d.extractPeriod(m),
z=d.getPeriodDuration(r.period,r.count);1>b.getTime()-a.getTime()&&(a=new Date(b.getTime()-1));var A=d.newDate(a);c.extendToFullPeriod&&(A.getTime()-h.getTime()<.1*z&&(A=d.resetDateToMin(a,r.period,r.count,y)),k.getTime()-b.getTime()<.1*z&&(b=d.resetDateToMin(k,r.period,r.count,y),b=d.changeDate(b,r.period,r.count,!0)));for(h=0;h<l.length;h++)k=l[h],k.chartCursor&&k.chartCursor.panning&&(A=e);for(h=0;h<l.length;h++){k=l[h];e=!1;if(m!=p){for(z=0;z<w.length;z++){var B=w[z].graph;B.dataProvider=B.dataSet.agregatedDataProviders[m]}z=
k.categoryAxis;z.firstDayOfWeek=y;z.minPeriod=m;k.dataProvider=c.mainDataSet.agregatedDataProviders[m];if(z=k.chartCursor)z.categoryBalloonDateFormat=c.chartCursorSettings.categoryBalloonDateFormat(r.period),k.showCategoryAxis||(z.categoryBalloonEnabled=!1);k.startTime=A.getTime();k.endTime=b.getTime();k.start=NaN;k.validateData(!0);g.equalSpacing||(e=!0)}k.chartCursor&&k.chartCursor.panning&&(e=!0);e||(k.startTime=void 0,k.endTime=void 0,k.zoomToDates(A,b));0<f.startDuration&&c.animationPlayed&&
!e?(k.startDuration=0,k.animateAgain()):0<f.startDuration&&!e&&k.animateAgain()}c.animationPlayed=!0;g=d.newDate(b);t&&c.updateScrollbar&&(t.zoomToDates(a,g),c.skipScrollbarEvent=!0,setTimeout(function(){c.resetSkip.call(c)},100));c.updateScrollbar=!0;c.startDate=a;c.endDate=b;n&&n.zoom(a,b);c.skipEvents||a.getTime()==c.previousStartDate.getTime()&&b.getTime()==c.previousEndDate.getTime()||(n={type:"zoomed"},n.startDate=a,n.endDate=b,n.chart=c,n.period=m,c.fire(n),c.previousStartDate=d.newDate(a),
c.previousEndDate=d.newDate(b))}c.eventsHidden&&c.showHideEvents(!1);c.dispDUpd()},dispDUpd:function(){this.skipEvents||(this.chartCreated||this.fire({type:"init",chart:this}),this.chartRendered||(this.fire({type:"rendered",chart:this}),this.chartRendered=!0),this.fire({type:"drawn",chart:this}));this.animationPlayed=this.chartCreated=!0},resetSkip:function(){this.skipScrollbarEvent=!1},updateGraphs:function(){this.getSelections();if(0<this.dataSets.length){var a=this.panels;this.comparedGraphs=[];
var b;for(b=0;b<a.length;b++){var c=a[b],e=c.valueAxes,h;for(h=0;h<e.length;h++){var k=e[h];k.prevLog&&(k.logarithmic=k.prevLog);k.recalculateToPercents="always"==c.recalculateToPercents?!0:!1}e=this.mainDataSet;h=this.comparedDataSets;k=c.stockGraphs;c.graphs=[];var m,g,p;for(m=0;m<k.length;m++){var f=k[m],f=d.processObject(f,d.StockGraph,this.theme);k[m]=f;if(!f.title||f.resetTitleOnDataSetChange)f.title=e.title,f.resetTitleOnDataSetChange=!0;f.useDataSetColors&&(f.lineColor=e.color,f.fillColors=
void 0,f.bulletColor=void 0);var n=!1,l=e.fieldMappings;for(g=0;g<l.length;g++){p=l[g];var w=f.valueField;w&&p.toField==w&&(n=!0);(w=f.openField)&&p.toField==w&&(n=!0);(w=f.closeField)&&p.toField==w&&(n=!0);(w=f.lowField)&&p.toField==w&&(n=!0)}c.graphs.push(f);c.processGraphs();f.hideFromLegend=n?!1:!0;w=!1;"always"==c.recalculateToPercents&&(w=!0);var t=c.stockLegend,y,r,z,A;t&&(t=d.processObject(t,d.StockLegend,this.theme),c.stockLegend=t,y=t.valueTextComparing,r=t.valueTextRegular,z=t.periodValueTextComparing,
A=t.periodValueTextRegular);if(f.comparable){var B=h.length;if(f.valueAxis){0<B&&f.valueAxis.logarithmic&&"never"!=c.recalculateToPercents&&(f.valueAxis.logarithmic=!1,f.valueAxis.prevLog=!0);0<B&&"whenComparing"==c.recalculateToPercents&&(f.valueAxis.recalculateToPercents=!0);t&&f.valueAxis&&!0===f.valueAxis.recalculateToPercents&&(w=!0);var E;for(E=0;E<B;E++){var D=h[E],q=f.comparedGraphs[D.id];q||(q=new d.AmGraph(this.theme),q.id="comparedGraph_"+f.id+"_"+D.id);f.compareGraph&&d.copyProperties(f.compareGraph,
q);q.periodValue=f.periodValue;q.recalculateValue=f.recalculateValue;q.dataSet=D;q.behindColumns=f.behindColumns;f.comparedGraphs[D.id]=q;q.seriesIdField="amCategoryIdField";q.connect=f.connect;q.clustered=f.clustered;q.showBalloon=f.showBalloon;this.passFields(f,q);var C=f.compareField;C||(C=f.valueField);q.customBulletsHidden=!f.showEventsOnComparedGraphs;n=!1;l=D.fieldMappings;for(g=0;g<l.length;g++)p=l[g],p.toField==C&&(n=!0);if(n){q.valueField=C;q.title=D.title?D.title:f.title;q.lineColor=D.color;
f.compareGraphLineColor&&(q.lineColor=f.compareGraphLineColor);f.compareGraphType&&(q.type=f.compareGraphType);g=f.compareGraphLineThickness;isNaN(g)||(q.lineThickness=g);g=f.compareGraphDashLength;isNaN(g)||(q.dashLength=g);g=f.compareGraphLineAlpha;isNaN(g)||(q.lineAlpha=g);g=f.compareGraphCornerRadiusTop;isNaN(g)||(q.cornerRadiusTop=g);g=f.compareGraphCornerRadiusBottom;isNaN(g)||(q.cornerRadiusBottom=g);g=f.compareGraphBalloonColor;isNaN(g)||(q.balloonColor=g);g=f.compareGraphBulletColor;isNaN(g)||
(q.bulletColor=g);if(g=f.compareGraphFillColors)q.fillColors=g;if(g=f.compareGraphNegativeFillColors)q.negativeFillColors=g;if(g=f.compareGraphFillAlphas)q.fillAlphas=g;if(g=f.compareGraphNegativeFillAlphas)q.negativeFillAlphas=g;if(g=f.compareGraphBullet)q.bullet=g;if(g=f.compareGraphNumberFormatter)q.numberFormatter=g;g=f.compareGraphPrecision;isNaN(g)||(q.precision=g);if(g=f.compareGraphBalloonText)q.balloonText=g;g=f.compareGraphBulletSize;isNaN(g)||(q.bulletSize=g);g=f.compareGraphBulletAlpha;
isNaN(g)||(q.bulletAlpha=g);g=f.compareGraphBulletBorderAlpha;isNaN(g)||(q.bulletBorderAlpha=g);if(g=f.compareGraphBulletBorderColor)q.bulletBorderColor=g;g=f.compareGraphBulletBorderThickness;isNaN(g)||(q.bulletBorderThickness=g);q.visibleInLegend=f.compareGraphVisibleInLegend;q.balloonFunction=f.compareGraphBalloonFunction;q.hideBulletsCount=f.hideBulletsCount;q.valueAxis=f.valueAxis;t&&(w&&y?(q.legendValueText=y,q.legendPeriodValueText=z):(r&&(q.legendValueText=r),q.legendPeriodValueText=A));c.showComparedOnTop?
c.graphs.push(q):c.graphs.unshift(q);this.comparedGraphs.push({graph:q,dataSet:D})}}}}t&&(w&&y?(f.legendValueText=y,f.legendPeriodValueText=z):(r&&(f.legendValueText=r),f.legendPeriodValueText=A))}}}},passFields:function(a,b){for(var c="lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern gap className".split(" "),e=0;e<c.length;e++){var d=c[e];b[d+"Field"]=a[d+"Field"]}},choosePeriod:function(a,b,c){var e=this.categoryAxesSettings,
h=e.groupToPeriods,k=h[a],m=h[a+1],g=d.extractPeriod(k),g=d.getPeriodDuration(g.period,g.count),p=b.getTime(),f=c.getTime(),n=e.maxSeries;e.alwaysGroup&&k==e.minPeriod&&(k=1<h.length?h[1]:h[0]);return(f-p)/g>n&&0<n&&m?this.choosePeriod(a+1,b,c):k},getSelections:function(){var a=[],b=this.dataSets,c;for(c=0;c<b.length;c++){var e=b[c];e.compared&&a.push(e)}this.comparedDataSets=a;b=this.panels;for(c=0;c<b.length;c++)e=b[c],e.hideDrawingIcons&&("never"!=e.recalculateToPercents&&0<a.length?e.hideDrawingIcons(!0):
e.drawingIconsEnabled&&e.hideDrawingIcons(!1))},addPanel:function(a){this.panels.push(a);this.prevPH=void 0;d.removeChart(a);d.addChart(a)},addPanelAt:function(a,b){this.panels.splice(b,0,a);this.prevPH=void 0;d.removeChart(a);d.addChart(a)},removePanel:function(a){var b=this.panels;this.prevPH=void 0;var c;for(c=b.length-1;0<=c;c--)b[c]==a&&(this.fire({type:"panelRemoved",panel:a,chart:this}),b.splice(c,1),a.destroy(),a.clear())},validateData:function(a){var b=this;b.validateDataTO&&clearTimeout(b.validateDataTO);
b.validateDataTO=setTimeout(function(){b.validateDataReal.call(b,a)},100)},validateDataReal:function(a){a||this.resetDataParsed();this.updateDataSets();this.mainDataSet.compared=!1;this.updateData();(a=this.dataSetSelector)&&a.write(a.div)},resetDataParsed:function(){var a=this.dataSets,b;for(b=0;b<a.length;b++)a[b].dataParsed=!1},validateNow:function(a,b){this.skipDefault=!0;this.chartRendered=!1;this.prevPH=void 0;this.skipEvents=b;this.clear(!0);this.initTO&&clearTimeout(this.initTO);a&&this.resetDataParsed();
this.write(this.div)},hideStockEvents:function(){this.showHideEvents(!1);this.eventsHidden=!0},showStockEvents:function(){this.showHideEvents(!0);this.eventsHidden=!1},showHideEvents:function(a){var b=this.panels,c;for(c=0;c<b.length;c++){var e=b[c].graphs,d;for(d=0;d<e.length;d++){var k=e[d];!0===a?k.showCustomBullets(!0):k.hideCustomBullets(!0)}}},invalidateSize:function(){var a=this;clearTimeout(a.validateTO);var b=setTimeout(function(){a.validateNow()},5);a.validateTO=b},measure:function(){var a=
this.div;if(a){var b=a.offsetWidth,c=a.offsetHeight;a.clientHeight&&(b=a.clientWidth,c=a.clientHeight);this.divRealWidth=b;this.divRealHeight=c}},handleResize:function(){var a=this,b=setTimeout(function(){a.validateSizeReal()},150);a.initTO=b},validateSizeReal:function(){this.previousWidth=this.divRealWidth;this.previousHeight=this.divRealHeight;this.measure();if(this.divRealWidth!=this.previousWidth||this.divRealHeight!=this.previousHeight)0<this.divRealWidth&&0<this.divRealHeight&&this.fire({type:"resized",
chart:this}),this.divRealHeight!=this.previousHeight&&this.validateNow()},clear:function(a){var b=this.panels,c;if(b)for(c=0;c<b.length;c++){var e=b[c];a||(e.cleanChart(),e.destroy());e.clear(a)}(b=this.scrollbarChart)&&b.clear();if(b=this.div)b.innerHTML="";a||(this.div=null,d.deleteObject(this))}});d.StockEvent=d.Class({construct:function(){}})})();
(function(){var d=window.AmCharts;d.DataSet=d.Class({construct:function(){this.cname="DataSet";this.fieldMappings=[];this.dataProvider=[];this.agregatedDataProviders=[];this.stockEvents=[];this.compared=!1;this.showInCompare=this.showInSelect=!0}})})();
(function(){var d=window.AmCharts;d.PeriodSelector=d.Class({construct:function(a){this.cname="PeriodSelector";this.theme=a;this.createEvents("changed");this.inputFieldsEnabled=!0;this.position="bottom";this.width=180;this.fromText="From: ";this.toText="to: ";this.periodsText="Zoom: ";this.periods=[];this.inputFieldWidth=100;this.dateFormat="DD-MM-YYYY";this.hideOutOfScopePeriods=!0;d.applyTheme(this,a,this.cname)},zoom:function(a,b){var c=this.chart;this.inputFieldsEnabled&&(this.startDateField.value=
d.formatDate(a,this.dateFormat,c),this.endDateField.value=d.formatDate(b,this.dateFormat,c));this.markButtonAsSelected()},write:function(a){var b=this,c=b.chart.classNamePrefix;a.className="amChartsPeriodSelector "+c+"-period-selector-div";var e=b.width,h=b.position;b.width=void 0;b.position=void 0;d.applyStyles(a.style,b);b.width=e;b.position=h;b.div=a;a.innerHTML="";e=b.theme;h=b.position;h="top"==h||"bottom"==h?!1:!0;b.vertical=h;var k=0,m=0;if(b.inputFieldsEnabled){var g=document.createElement("div");
a.appendChild(g);var p=document.createTextNode(d.lang.fromText||b.fromText);g.appendChild(p);h?d.addBr(g):(g.style.styleFloat="left",g.style.display="inline");var f=document.createElement("input");f.className="amChartsInputField "+c+"-start-date-input";e&&d.applyStyles(f.style,e.PeriodInputField);f.style.textAlign="center";f.onblur=function(a){b.handleCalChange(a)};d.isNN&&f.addEventListener("keypress",function(a){b.handleCalendarChange.call(b,a)},!0);d.isIE&&f.attachEvent("onkeypress",function(a){b.handleCalendarChange.call(b,
a)});g.appendChild(f);b.startDateField=f;if(h)p=b.width-6+"px",d.addBr(g);else{var p=b.inputFieldWidth+"px",n=document.createTextNode(" ");g.appendChild(n)}f.style.width=p;f=document.createTextNode(d.lang.toText||b.toText);g.appendChild(f);h&&d.addBr(g);f=document.createElement("input");f.className="amChartsInputField "+c+"-end-date-input";e&&d.applyStyles(f.style,e.PeriodInputField);f.style.textAlign="center";f.onblur=function(){b.handleCalChange()};d.isNN&&f.addEventListener("keypress",function(a){b.handleCalendarChange.call(b,
a)},!0);d.isIE&&f.attachEvent("onkeypress",function(a){b.handleCalendarChange.call(b,a)});g.appendChild(f);b.endDateField=f;h?d.addBr(g):k=f.offsetHeight+2;p&&(f.style.width=p)}g=b.periods;if(d.ifArray(g)){p=document.createElement("div");h||(p.style.cssFloat="right",p.style.styleFloat="right",p.style.display="inline");a.appendChild(p);h&&d.addBr(p);a=document.createTextNode(d.lang.periodsText||b.periodsText);p.appendChild(a);b.periodContainer=p;var l;for(a=0;a<g.length;a++)f=g[a],l=document.createElement("input"),
l.type="button",l.value=f.label,l.period=f.period,l.count=f.count,l.periodObj=f,l.className="amChartsButton "+c+"-period-input",e&&d.applyStyles(l.style,e.PeriodButton),h&&(l.style.width=b.width-1+"px"),l.style.boxSizing="border-box",p.appendChild(l),b.addEventListeners(l),f.button=l;!h&&l&&(m=l.offsetHeight)}b.offsetHeight=Math.max(k,m)},addEventListeners:function(a){var b=this;d.isNN&&a.addEventListener("click",function(a){b.handlePeriodChange.call(b,a)},!0);d.isIE&&a.attachEvent("onclick",function(a){b.handlePeriodChange.call(b,
a)})},getPeriodDates:function(){var a=this.periods,b;for(b=0;b<a.length;b++)this.selectPeriodButton(a[b],!0)},handleCalendarChange:function(a){13==a.keyCode&&this.handleCalChange(a)},handleCalChange:function(a){var b=this.dateFormat,c=d.stringToDate(this.startDateField.value,b),b=this.chart.getLastDate(d.stringToDate(this.endDateField.value,b));try{this.startDateField.blur(),this.endDateField.blur()}catch(h){}if(c&&b){var e={type:"changed"};e.startDate=c;e.endDate=b;e.chart=this.chart;e.event=a;this.fire(e)}},
handlePeriodChange:function(a){this.selectPeriodButton((a.srcElement?a.srcElement:a.target).periodObj,!1,a)},setRanges:function(a,b){this.firstDate=a;this.lastDate=b;this.getPeriodDates()},selectPeriodButton:function(a,b,c){var e=a.button,h=e.count,k=e.period,m=this.chart,g,p,f=this.firstDate,n=this.lastDate,l,w=this.theme;g=this.selectFromStart;f&&n&&("MAX"==k?(g=f,p=n):"YTD"==k?(g=new Date,g.setMonth(0,1),g.setHours(0,0,0,0),0===h&&g.setDate(g.getDate()-1),p=this.lastDate):"YYYY"==k||"MM"==k?g?
(g=f,p=new Date(f),"YYYY"==k&&(h*=12),p.setMonth(p.getMonth()+h)):(g=new Date(n),d.changeDate(g,k,h,!1),p=n):"fff"==k?(d.getPeriodDuration(k,h),l=d.getPeriodDuration(k,h),g?(g=f,p.setMilliseconds(f.getMilliseconds()-l+1)):(g=new Date(n.getTime()),g.setMilliseconds(g.getMilliseconds()-l+1),p=this.lastDate)):(l=d.getPeriodDuration(k,h),g?(g=f,p=new Date(f.getTime()+l-1)):(g=new Date(n.getTime()-l+1),p=n)),a.startTime=g.getTime(),this.hideOutOfScopePeriods&&(b&&a.startTime<f.getTime()?e.style.display=
"none":e.style.display="inline"),g.getTime()>n.getTime()&&(l=d.getPeriodDuration("DD",1),g=new Date(n.getTime()-l)),g.getTime()<f.getTime()&&(g=f),"YTD"==k&&(a.startTime=g.getTime()),a.endTime=p.getTime(),b||(this.skipMark=!0,this.unselectButtons(),e.className="amChartsButtonSelected "+m.classNamePrefix+"-period-input-selected",w&&d.applyStyles(e.style,w.PeriodButtonSelected),a={type:"changed"},a.startDate=g,a.endDate=p,a.predefinedPeriod=k,a.chart=this.chart,a.count=h,a.event=c,this.fire(a)))},markButtonAsSelected:function(){if(!this.skipMark){var a=
this.chart,b=this.periods,c=a.startDate.getTime(),e=a.endDate.getTime(),h=this.lastDate.getTime();e>h&&(e=h);h=this.theme;this.unselectButtons();var k;for(k=b.length-1;0<=k;k--){var m=b[k],g=m.button;m.startTime&&m.endTime&&c==m.startTime&&e==m.endTime&&(this.unselectButtons(),g.className="amChartsButtonSelected "+a.classNamePrefix+"-period-input-selected",h&&d.applyStyles(g.style,h.PeriodButtonSelected))}}this.skipMark=!1},unselectButtons:function(){var a=this.chart,b=this.periods,c,e=this.theme;
for(c=b.length-1;0<=c;c--){var h=b[c].button;h.className="amChartsButton "+a.classNamePrefix+"-period-input";e&&d.applyStyles(h.style,e.PeriodButton)}},setDefaultPeriod:function(){var a=this.periods,b;if(this.chart.chartCreated)for(b=0;b<a.length;b++){var c=a[b];c.selected&&this.selectPeriodButton(c)}}})})();
(function(){var d=window.AmCharts;d.StockGraph=d.Class({inherits:d.AmGraph,construct:function(a){d.StockGraph.base.construct.call(this,a);this.cname="StockGraph";this.useDataSetColors=!0;this.periodValue="Close";this.compareGraphType="line";this.compareGraphVisibleInLegend=!0;this.comparable=this.resetTitleOnDataSetChange=!1;this.comparedGraphs={};this.showEventsOnComparedGraphs=!1;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.StockPanel=d.Class({inherits:d.AmSerialChart,construct:function(a){d.StockPanel.base.construct.call(this,a);this.cname="StockPanel";this.theme=a;this.showCategoryAxis=this.showComparedOnTop=!0;this.recalculateToPercents="whenComparing";this.panelHeaderPaddingBottom=this.panelHeaderPaddingLeft=this.panelHeaderPaddingRight=this.panelHeaderPaddingTop=0;this.trendLineAlpha=1;this.trendLineColor="#00CC00";this.trendLineColorHover="#CC0000";this.trendLineThickness=2;
this.trendLineDashLength=0;this.stockGraphs=[];this.drawingIconsEnabled=!1;this.iconSize=38;this.autoMargins=this.allowTurningOff=this.eraseAll=this.erasingEnabled=this.drawingEnabled=!1;d.applyTheme(this,a,this.cname)},initChart:function(a){d.StockPanel.base.initChart.call(this,a);this.drawingIconsEnabled&&this.createDrawIcons();(a=this.chartCursor)&&this.listenTo(a,"draw",this.handleDraw)},addStockGraph:function(a){this.stockGraphs.push(a);return a},handleCursorZoom:function(a){a.start=NaN;a.end=
NaN;d.StockPanel.base.handleCursorZoom.call(this,a)},removeStockGraph:function(a){var b=this.stockGraphs,c;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)},createDrawIcons:function(){var a=this,b=a.iconSize,c=a.container,e=a.pathToImages,h=a.realWidth-2*b-1-a.marginRight,k=d.rect(c,b,b,"#000",.005),m=d.rect(c,b,b,"#000",.005);m.translate(b+1,0);var g=c.image(e+"pencilIcon"+a.extension,0,0,b,b);d.setCN(a,g,"pencil");a.pencilButton=g;m.setAttr("cursor","pointer");k.setAttr("cursor","pointer");k.mouseup(function(){a.handlePencilClick()});
var p=c.image(e+"pencilIconH"+a.extension,0,0,b,b);d.setCN(a,p,"pencil-pushed");a.pencilButtonPushed=p;a.drawingEnabled||p.hide();var f=c.image(e+"eraserIcon"+a.extension,b+1,0,b,b);d.setCN(a,f,"eraser");a.eraserButton=f;m.mouseup(function(){a.handleEraserClick()});k.touchend&&(k.touchend(function(){a.handlePencilClick()}),m.touchend(function(){a.handleEraserClick()}));b=c.image(e+"eraserIconH"+a.extension,b+1,0,b,b);d.setCN(a,b,"eraser-pushed");a.eraserButtonPushed=b;a.erasingEnabled||b.hide();c=
c.set([g,p,f,b,k,m]);d.setCN(a,c,"drawing-tools");c.translate(h,1);this.hideIcons&&c.hide()},handlePencilClick:function(){var a=!this.drawingEnabled;this.disableDrawing(!a);this.erasingEnabled=!1;var b=this.eraserButtonPushed;b&&b.hide();b=this.pencilButtonPushed;a?b&&b.show():(b&&b.hide(),this.setMouseCursor("auto"))},disableDrawing:function(a){this.drawingEnabled=!a;var b=this.chartCursor;this.stockChart&&(this.stockChart.enableCursors(a),b&&b.enableDrawing(!a))},handleEraserClick:function(){this.disableDrawing(!0);
var a=this.pencilButtonPushed;a&&a.hide();a=this.eraserButtonPushed;if(this.eraseAll){var a=this.trendLines,b;for(b=a.length-1;0<=b;b--){var c=a[b];c.isProtected||this.removeTrendLine(c)}this.validateNow()}else(this.erasingEnabled=b=!this.erasingEnabled)?(a&&a.show(),this.setTrendColorHover(this.trendLineColorHover),this.setMouseCursor("auto")):(a&&a.hide(),this.setTrendColorHover())},setTrendColorHover:function(a){var b=this.trendLines,c;for(c=b.length-1;0<=c;c--){var e=b[c];e.isProtected||(e.rollOverColor=
a);this.listenTo(e,"click",this.handleTrendClick)}},handleDraw:function(a){var b=this.drawOnAxis;d.isString(b)&&(b=this.getValueAxisById(b));b||(b=this.valueAxes[0]);this.drawOnAxis=b;var c=this.categoryAxis,e=a.initialX,h=a.finalX,k=a.initialY;a=a.finalY;var m=new d.TrendLine(this.theme);m.initialDate=c.coordinateToDate(e);m.finalDate=c.coordinateToDate(h);m.initialValue=b.coordinateToValue(k);m.finalValue=b.coordinateToValue(a);m.lineAlpha=this.trendLineAlpha;m.lineColor=this.trendLineColor;m.lineThickness=
this.trendLineThickness;m.dashLength=this.trendLineDashLength;m.valueAxis=b;m.categoryAxis=c;this.addTrendLine(m);this.listenTo(m,"click",this.handleTrendClick);this.validateNow()},hideDrawingIcons:function(a){(this.hideIcons=a)&&this.disableDrawing(a)},handleTrendClick:function(a){this.erasingEnabled&&(a=a.trendLine,this.eraseAll||a.isProtected||this.removeTrendLine(a),this.validateNow())},handleWheelReal:function(a,b){var c=this.scrollbarChart;if(!this.wheelBusy&&c){var e=1;b&&(e=-1);var c=c.chartScrollbar,
d=this.categoryAxis.minDuration();0>a?(e=this.startTime+e*d,d=this.endTime+1*d):(e=this.startTime-e*d,d=this.endTime-1*d);e<this.firstTime&&(e=this.firstTime);d>this.lastTime&&(d=this.lastTime);e<d&&c.timeZoom(e,d,!0)}}})})();
(function(){var d=window.AmCharts;d.CategoryAxesSettings=d.Class({construct:function(a){this.cname="CategoryAxesSettings";this.minPeriod="DD";this.equalSpacing=!1;this.axisHeight=28;this.tickLength=this.axisAlpha=0;this.gridCount=10;this.maxSeries=150;this.groupToPeriods="ss 10ss 30ss mm 10mm 30mm hh DD WW MM YYYY".split(" ");this.markPeriodChange=this.autoGridCount=!0;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.ChartCursorSettings=d.Class({construct:function(a){this.cname="ChartCursorSettings";this.enabled=!0;this.bulletsEnabled=this.valueBalloonsEnabled=!1;this.graphBulletSize=1;this.onePanelOnly=!1;this.categoryBalloonDateFormats=[{period:"YYYY",format:"YYYY"},{period:"MM",format:"MMM, YYYY"},{period:"WW",format:"MMM DD, YYYY"},{period:"DD",format:"MMM DD, YYYY"},{period:"hh",format:"JJ:NN"},{period:"mm",format:"JJ:NN"},{period:"ss",format:"JJ:NN:SS"},{period:"fff",
format:"JJ:NN:SS"}];d.applyTheme(this,a,this.cname)},categoryBalloonDateFormat:function(a){var b=this.categoryBalloonDateFormats,c,e;for(e=0;e<b.length;e++)b[e].period==a&&(c=b[e].format);return c}})})();
(function(){var d=window.AmCharts;d.ChartScrollbarSettings=d.Class({construct:function(a){this.cname="ChartScrollbarSettings";this.height=40;this.enabled=!0;this.color="#FFFFFF";this.updateOnReleaseOnly=this.autoGridCount=!0;this.hideResizeGrips=!1;this.position="bottom";this.minDistance=1;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.LegendSettings=d.Class({construct:function(a){this.cname="LegendSettings";this.marginBottom=this.marginTop=0;this.usePositiveNegativeOnPercentsOnly=!0;this.positiveValueColor="#00CC00";this.negativeValueColor="#CC0000";this.autoMargins=this.equalWidths=this.textClickEnabled=!1;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.PanelsSettings=d.Class({construct:function(a){this.cname="PanelsSettings";this.marginBottom=this.marginTop=this.marginRight=this.marginLeft=0;this.backgroundColor="#FFFFFF";this.backgroundAlpha=0;this.panelSpacing=8;this.panEventsEnabled=!0;this.creditsPosition="top-right";this.zoomOutAxes=!0;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.StockEventsSettings=d.Class({construct:function(a){this.cname="StockEventsSettings";this.type="sign";this.backgroundAlpha=1;this.backgroundColor="#DADADA";this.borderAlpha=1;this.borderColor="#888888";this.balloonColor=this.rollOverColor="#CC0000";d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.ValueAxesSettings=d.Class({construct:function(a){this.cname="ValueAxesSettings";this.tickLength=0;this.showFirstLabel=this.autoGridCount=this.inside=!0;this.showLastLabel=!1;this.axisAlpha=0;d.applyTheme(this,a,this.cname)}})})();
(function(){var d=window.AmCharts;d.getItemIndex=function(a,b){var c=-1,e;for(e=0;e<b.length;e++)a==b[e]&&(c=e);return c};d.addBr=function(a){a.appendChild(document.createElement("br"))};d.applyStyles=function(a,b){if(b&&a)for(var c in a){var e=c,d=b[e];if(void 0!==d)try{a[e]=d}catch(k){}}}})();
(function(){var d=window.AmCharts;d.StockLegend=d.Class({inherits:d.AmLegend,construct:function(a){d.StockLegend.base.construct.call(this,a);this.cname="StockLegend";this.valueTextComparing="[[percents.value]]%";this.valueTextRegular="[[value]]";d.applyTheme(this,a,this.cname)},drawLegend:function(){var a=this;d.StockLegend.base.drawLegend.call(a);var b=a.chart;if(b.allowTurningOff){var c=a.container,e=c.image(b.pathToImages+"xIcon"+b.extension,b.realWidth-19,3,19,19),b=c.image(b.pathToImages+"xIconH"+
b.extension,b.realWidth-19,3,19,19);b.hide();a.xButtonHover=b;e.mouseup(function(){a.handleXClick()}).mouseover(function(){a.handleXOver()});b.mouseup(function(){a.handleXClick()}).mouseout(function(){a.handleXOut()})}},handleXOver:function(){this.xButtonHover.show()},handleXOut:function(){this.xButtonHover.hide()},handleXClick:function(){var a=this.chart,b=a.stockChart;b.removePanel(a);b.validateNow()}})})();
(function(){var d=window.AmCharts;d.DataSetSelector=d.Class({construct:function(a){this.cname="DataSetSelector";this.theme=a;this.createEvents("dataSetSelected","dataSetCompared","dataSetUncompared");this.position="left";this.selectText="Select:";this.comboBoxSelectText="Select...";this.compareText="Compare to:";this.width=180;this.dataProvider=[];this.listHeight=150;this.listCheckBoxSize=14;this.rollOverBackgroundColor="#b2e1ff";this.selectedBackgroundColor="#7fceff";d.applyTheme(this,a,this.cname)},
write:function(a){var b=this,c,e=b.theme,h=b.chart;a.className="amChartsDataSetSelector "+h.classNamePrefix+"-data-set-selector-div";var k=b.width;c=b.position;b.width=void 0;b.position=void 0;d.applyStyles(a.style,b);b.div=a;b.width=k;b.position=c;a.innerHTML="";var k=b.position,m;m="top"==k||"bottom"==k?!1:!0;b.vertical=m;var g;m&&(g=b.width+"px");var k=b.dataProvider,p,f;if(1<b.countDataSets("showInSelect")){c=document.createTextNode(d.lang.selectText||b.selectText);a.appendChild(c);m&&d.addBr(a);
var n=document.createElement("select");g&&(n.style.width=g);b.selectCB=n;e&&d.applyStyles(n.style,e.DataSetSelect);n.className=h.classNamePrefix+"-data-set-select";a.appendChild(n);d.isNN&&n.addEventListener("change",function(a){b.handleDataSetChange.call(b,a)},!0);d.isIE&&n.attachEvent("onchange",function(a){b.handleDataSetChange.call(b,a)});for(c=0;c<k.length;c++)if(p=k[c],!0===p.showInSelect){f=document.createElement("option");f.className=h.classNamePrefix+"-data-set-select-option";f.text=p.title;
f.value=c;p==b.chart.mainDataSet&&(f.selected=!0);try{n.add(f,null)}catch(l){n.add(f)}}b.offsetHeight=n.offsetHeight}if(0<b.countDataSets("showInCompare")&&1<k.length)if(m?(d.addBr(a),d.addBr(a)):(c=document.createTextNode(" "),a.appendChild(c)),c=document.createTextNode(d.lang.compareText||b.compareText),a.appendChild(c),f=b.listCheckBoxSize,m){d.addBr(a);g=document.createElement("div");a.appendChild(g);g.className="amChartsCompareList "+h.classNamePrefix+"-compare-div";e&&d.applyStyles(g.style,
e.DataSetCompareList);g.style.overflow="auto";g.style.overflowX="hidden";g.style.width=b.width-2+"px";g.style.maxHeight=b.listHeight+"px";for(c=0;c<k.length;c++)p=k[c],!0===p.showInCompare&&p!=b.chart.mainDataSet&&(e=document.createElement("div"),e.style.padding="4px",e.style.position="relative",e.name="amCBContainer",e.className=h.classNamePrefix+"-compare-item-div",e.dataSet=p,e.style.height=f+"px",p.compared&&(e.style.backgroundColor=b.selectedBackgroundColor),g.appendChild(e),m=document.createElement("div"),
m.style.width=f+"px",m.style.height=f+"px",m.style.position="absolute",m.style.backgroundColor=p.color,e.appendChild(m),m=document.createElement("div"),m.style.width="100%",m.style.position="absolute",m.style.left=f+10+"px",e.appendChild(m),p=document.createTextNode(p.title),m.style.whiteSpace="nowrap",m.style.cursor="default",m.appendChild(p),b.addEventListeners(e));d.addBr(a);d.addBr(a)}else{h=document.createElement("select");b.compareCB=h;g&&(h.style.width=g);a.appendChild(h);d.isNN&&h.addEventListener("change",
function(a){b.handleCBSelect.call(b,a)},!0);d.isIE&&h.attachEvent("onchange",function(a){b.handleCBSelect.call(b,a)});f=document.createElement("option");f.text=d.lang.comboBoxSelectText||b.comboBoxSelectText;try{h.add(f,null)}catch(l){h.add(f)}for(c=0;c<k.length;c++)if(p=k[c],!0===p.showInCompare&&p!=b.chart.mainDataSet){f=document.createElement("option");f.text=p.title;f.value=c;p.compared&&(f.selected=!0);try{h.add(f,null)}catch(l){h.add(f)}}b.offsetHeight=h.offsetHeight}},addEventListeners:function(a){var b=
this;d.isNN&&(a.addEventListener("mouseover",function(a){b.handleRollOver.call(b,a)},!0),a.addEventListener("mouseout",function(a){b.handleRollOut.call(b,a)},!0),a.addEventListener("click",function(a){b.handleClick.call(b,a)},!0));d.isIE&&(a.attachEvent("onmouseout",function(a){b.handleRollOut.call(b,a)}),a.attachEvent("onmouseover",function(a){b.handleRollOver.call(b,a)}),a.attachEvent("onclick",function(a){b.handleClick.call(b,a)}))},handleDataSetChange:function(){var a=this.selectCB,a=this.dataProvider[a.options[a.selectedIndex].value],
b=this.chart;b.mainDataSet=a;b.zoomOutOnDataSetChange&&(b.startDate=void 0,b.endDate=void 0);b.validateData(!0);this.fire({type:"dataSetSelected",dataSet:a,chart:this.chart})},handleRollOver:function(a){a=this.getRealDiv(a);a.dataSet.compared||(a.style.backgroundColor=this.rollOverBackgroundColor)},handleRollOut:function(a){a=this.getRealDiv(a);a.dataSet.compared||(a.style.removeProperty&&a.style.removeProperty("background-color"),a.style.removeAttribute&&a.style.removeAttribute("backgroundColor"))},
handleCBSelect:function(a){var b=this.compareCB,c=this.dataProvider,e,d;for(e=0;e<c.length;e++)d=c[e],d.compared&&(a={type:"dataSetUncompared",dataSet:d}),d.compared=!1;c=b.selectedIndex;0<c&&(d=this.dataProvider[b.options[c].value],d.compared||(a={type:"dataSetCompared",dataSet:d}),d.compared=!0);b=this.chart;b.validateData(!0);a.chart=b;this.fire(a)},handleClick:function(a){a=this.getRealDiv(a).dataSet;!0===a.compared?(a.compared=!1,a={type:"dataSetUncompared",dataSet:a}):(a.compared=!0,a={type:"dataSetCompared",
dataSet:a});var b=this.chart;b.validateData(!0);a.chart=b;this.fire(a)},getRealDiv:function(a){a||(a=window.event);a=a.currentTarget?a.currentTarget:a.srcElement;"amCBContainer"==a.parentNode.name&&(a=a.parentNode);return a},countDataSets:function(a){var b=this.dataProvider,c=0,d;for(d=0;d<b.length;d++)!0===b[d][a]&&c++;return c}})})();
(function(){var d=window.AmCharts;d.StackedBullet=d.Class({construct:function(){this.stackDown=!1;this.mastHeight=8;this.shapes=[];this.backgroundColors=[];this.backgroundAlphas=[];this.borderAlphas=[];this.borderColors=[];this.colors=[];this.rollOverColors=[];this.showOnAxiss=[];this.values=[];this.showAts=[];this.textColor="#000000";this.nextY=0;this.size=16},parseConfig:function(){var a=this.bulletConfig;this.eventObjects=a.eventObjects;this.letters=a.letters;this.shapes=a.shapes;this.backgroundColors=
a.backgroundColors;this.backgroundAlphas=a.backgroundAlphas;this.borderColors=a.borderColors;this.borderAlphas=a.borderAlphas;this.colors=a.colors;this.rollOverColors=a.rollOverColors;this.date=a.date;this.showOnAxiss=a.showOnAxis;this.axisCoordinate=a.minCoord;this.showAts=a.showAts;this.values=a.values;this.fontSizes=a.fontSizes;this.showBullets=a.showBullets},write:function(a){this.parseConfig();this.container=a;this.bullets=[];this.fontSize=this.chart.fontSize;if(this.graph){var b=this.graph.fontSize;
b&&(this.fontSize=b)}b=this.letters.length;(this.mastHeight+2*(this.fontSize/2+2))*b>this.availableSpace&&(this.stackDown=!0);this.set=a.set();this.cset=a.set();this.set.push(this.cset);this.set.doNotScale=!0;a=0;var c;for(c=0;c<b;c++){this.shape=this.shapes[c];this.backgroundColor=this.backgroundColors[c];this.backgroundAlpha=this.backgroundAlphas[c];this.borderAlpha=this.borderAlphas[c];this.borderColor=this.borderColors[c];this.rollOverColor=this.rollOverColors[c];this.showOnAxis=this.showOnAxiss[c];
this.showBullet=this.showBullets[c];this.color=this.colors[c];this.value=this.values[c];this.showAt=this.showAts[c];var d=this.fontSizes[c];isNaN(d)||(this.fontSize=d);this.addLetter(this.letters[c],a,c);this.showOnAxis||a++}},addLetter:function(a,b,c){var e=this.container;b=e.set();var h=-1,k=this.stackDown,m=this.graph.valueAxis;this.showOnAxis&&(this.stackDown=m.reversed?!0:!1);this.stackDown&&(h=1);var g=0,p=0,f=0,n,l=this.fontSize,w=this.mastHeight,t=this.shape,y=this.textColor;void 0!==this.color&&
(y=this.color);void 0===a&&(a="");a=d.fixBrakes(a);a=d.text(e,a,y,this.chart.fontFamily,this.fontSize);a.node.style.pointerEvents="none";e=a.getBBox();this.labelWidth=y=e.width;this.labelHeight=e.height;var r,e=0;switch(t){case "sign":r=this.drawSign(b);g=w+4+l/2;e=w+l+4;1==h&&(g-=4);break;case "flag":r=this.drawFlag(b);p=y/2+3;g=w+4+l/2;e=w+l+4;1==h&&(g-=4);break;case "pin":r=this.drawPin(b);g=6+l/2;e=l+8;break;case "triangleUp":r=this.drawTriangleUp(b);g=-l-1;e=l+4;h=-1;break;case "triangleDown":r=
this.drawTriangleDown(b);g=l+1;e=l+4;h=-1;break;case "triangleLeft":r=this.drawTriangleLeft(b);p=l;e=l+4;h=-1;break;case "triangleRight":r=this.drawTriangleRight(b);p=-l;h=-1;e=l+4;break;case "arrowUp":r=this.drawArrowUp(b);a.hide();break;case "arrowDown":r=this.drawArrowDown(b);a.hide();e=l+4;break;case "text":h=-1;r=this.drawTextBackground(b,a);g=this.labelHeight+3;e=l+10;break;case "round":r=this.drawCircle(b)}this.bullets[c]=r;this.showOnAxis?(n=isNaN(this.nextAxisY)?this.axisCoordinate:this.nextY,
f=g*h,this.nextAxisY=n+h*e):this.value?(n=this.value,m.recalculateToPercents&&(n=n/m.recBaseValue*100-100),n=m.getCoordinate(n)-this.bulletY,f=g*h):this.showAt?(r=this.graphDataItem.values,m.recalculateToPercents&&(r=this.graphDataItem.percents),r&&(n=m.getCoordinate(r[this.showAt])-this.bulletY,f=g*h)):(n=this.nextY,f=g*h);a.translate(p,f);b.push(a);b.translate(0,n);this.addEventListeners(b,c);this.nextY=n+h*e;this.stackDown=k},addEventListeners:function(a,b){var c=this;a.click(function(){c.handleClick(b)}).mouseover(function(){c.handleMouseOver(b)}).touchend(function(){c.handleMouseOver(b,
!0);c.handleClick(b)}).mouseout(function(){c.handleMouseOut(b)})},drawPin:function(a){var b=-1;this.stackDown&&(b=1);var c=this.fontSize+4;return this.drawRealPolygon(a,[0,c/2,c/2,-c/2,-c/2,0],[0,b*c/4,b*(c+c/4),b*(c+c/4),b*c/4,0])},drawSign:function(a){var b=-1;this.stackDown&&(b=1);var c=this.mastHeight*b,e=this.fontSize/2+2,h=d.line(this.container,[0,0],[0,c],this.borderColor,this.borderAlpha,1),k=d.circle(this.container,e,this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);
k.translate(0,c+e*b);a.push(h);a.push(k);this.cset.push(a);return k},drawFlag:function(a){var b=-1;this.stackDown&&(b=1);var c=this.fontSize+4,e=this.labelWidth+6,h=this.mastHeight,b=1==b?b*h:b*h-c,h=d.line(this.container,[0,0],[0,b],this.borderColor,this.borderAlpha,1),c=d.polygon(this.container,[0,e,e,0],[0,0,c,c],this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);c.translate(0,b);a.push(h);a.push(c);this.cset.push(a);return c},drawTriangleUp:function(a){var b=this.fontSize+
7;return this.drawRealPolygon(a,[0,b/2,-b/2,0],[0,b,b,0])},drawArrowUp:function(a){var b=this.size,c=b/2,d=b/4;return this.drawRealPolygon(a,[0,c,d,d,-d,-d,-c,0],[0,c,c,b,b,c,c,0])},drawArrowDown:function(a){var b=this.size,c=b/2,d=b/4;return this.drawRealPolygon(a,[0,c,d,d,-d,-d,-c,0],[0,-c,-c,-b,-b,-c,-c,0])},drawTriangleDown:function(a){var b=this.fontSize+7;return this.drawRealPolygon(a,[0,b/2,-b/2,0],[0,-b,-b,0])},drawTriangleLeft:function(a){var b=this.fontSize+7;return this.drawRealPolygon(a,
[0,b,b,0],[0,-b/2,b/2,0])},drawTriangleRight:function(a){var b=this.fontSize+7;return this.drawRealPolygon(a,[0,-b,-b,0],[0,-b/2,b/2,0])},drawRealPolygon:function(a,b,c){b=d.polygon(this.container,b,c,this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);a.push(b);this.cset.push(a);return b},drawCircle:function(a){var b=d.circle(this.container,this.fontSize/2,this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);a.push(b);this.cset.push(a);return b},
drawTextBackground:function(a,b){var c=b.getBBox(),d=-c.width/2-5,h=c.width/2+5,c=-c.height-12;return this.drawRealPolygon(a,[d,-5,0,5,h,h,d,d],[-5,-5,0,-5,-5,c,c,-5])},handleMouseOver:function(a,b){b||this.bullets[a].attr({fill:this.rollOverColors[a]});var c=this.eventObjects[a],e={type:"rollOverStockEvent",eventObject:c,graph:this.graph,date:this.date},h=this.bulletConfig.eventDispatcher;e.chart=h;h.fire(e);c.url&&this.bullets[a].setAttr("cursor","pointer");e=this.chart;e.showBalloon(d.fixNewLines(c.description),
h.stockEventsSettings.balloonColor,!0);c=e.graphs;for(h=0;h<c.length;h++)c[h].hideBalloon()},handleClick:function(a){a=this.eventObjects[a];var b={type:"clickStockEvent",eventObject:a,graph:this.graph,date:this.date},c=this.bulletConfig.eventDispatcher;b.chart=c;c.fire(b);b=a.urlTarget;b||(b=c.stockEventsSettings.urlTarget);d.getURL(a.url,b)},handleMouseOut:function(a){this.bullets[a].attr({fill:this.backgroundColors[a]});a={type:"rollOutStockEvent",eventObject:this.eventObjects[a],graph:this.graph,
date:this.date};var b=this.bulletConfig.eventDispatcher;a.chart=b;this.chart.hideBalloon();b.fire(a)}})})();!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:this,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||
(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();(function(){function s(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function y(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&typeof c==="object"&&Object.prototype.toString.call(c)!=="[object Array]"&&d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a<c;a++)d=e(d,b[a]);return d}function H(a,b){return parseInt(a,b||
10)}function Sa(a){return typeof a==="string"}function ha(a){return a&&typeof a==="object"}function Ja(a){return Object.prototype.toString.call(a)==="[object Array]"}function pa(a){return typeof a==="number"}function Ka(a){return X.log(a)/X.LN10}function sa(a){return X.pow(10,a)}function ta(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function u(a){return a!==r&&a!==null}function Y(a,b,c){var d,e;if(Sa(b))u(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(u(b)&&
ha(b))for(d in b)a.setAttribute(d,b[d]);return e}function qa(a){return Ja(a)?a:[a]}function q(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],c!==r&&c!==null)return c}function K(a,b){if(La&&!ea&&b&&b.opacity!==r)b.filter="alpha(opacity="+b.opacity*100+")";s(a.style,b)}function aa(a,b,c,d,e){a=E.createElement(a);b&&s(a,b);e&&K(a,{padding:0,border:$,margin:0});c&&K(a,c);d&&d.appendChild(a);return a}function ia(a,b){var c=function(){return r};c.prototype=new a;s(c.prototype,b);return c}function Da(a,
b,c,d){var e=N.numberFormat,f=F.lang,g=+a||0,h=b===-1?(g.toString().split(".")[1]||"").length:isNaN(b=P(b))?2:b,i=c===void 0?f.decimalPoint:c,f=d===void 0?f.thousandsSep:d,j=g<0?"-":"",k=String(H(g=P(g).toFixed(h))),l=k.length>3?k.length%3:0;return e!==Da?e(a,b,c,d):j+(l?k.substr(0,l)+f:"")+k.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+f)+(h?i+P(g-k).toFixed(h).slice(2):"")}function Ta(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function Q(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);
a.unshift(d);return c.apply(this,a)}}function Ma(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e=e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=F.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e!==null&&(e=Da(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=xa(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function vb(a){return X.pow(10,V(X.log(a)/
X.LN10))}function wb(a,b,c,d){var e,c=q(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d===!1&&(c===1?b=[1,2,5,10]:c<=.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2)break;a*=c;return a}function xb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return d===0?a.ss_i-c.ss_i:d});for(e=0;e<c;e++)delete a[e].ss_i}function Ua(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ea(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}
function Na(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Va(a){kb||(kb=aa(Wa));a&&kb.appendChild(a);kb.innerHTML=""}function ja(a){return parseFloat(a.toPrecision(14))}function ab(a,b){Fa=q(a,b.animation)}function Mb(){var a=F.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";ca=F.global.Date||window.Date;Oa=(a&&F.global.timezoneOffset||0)*6E4;lb=a?ca.UTC:function(a,b,c,g,h,i){return(new ca(a,b,q(c,1),q(g,0),q(h,0),q(i,0))).getTime()};yb=b+"Minutes";zb=b+
"Hours";Ab=b+"Day";Xa=b+"Date";mb=b+"Month";nb=b+"FullYear";Nb=c+"Minutes";Ob=c+"Hours";Bb=c+"Date";Pb=c+"Month";Qb=c+"FullYear"}function Z(){}function bb(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function D(){this.init.apply(this,arguments)}function ya(){this.init.apply(this,arguments)}function Rb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.alignOptions={align:b.align||
(f?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:q(b.y,f?4:c?14:-6),x:q(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}function Cb(a){var b=a.options,c=b.navigator,d=c.enabled,b=b.scrollbar,e=b.enabled,f=d?c.height:0,g=e?b.height:0;this.handles=[];this.scrollbarButtons=[];this.elementsToDestroy=[];this.chart=a;this.setBaseSeries();this.height=f;this.scrollbarHeight=g;this.scrollbarEnabled=e;this.navigatorEnabled=d;this.navigatorOptions=
c;this.scrollbarOptions=b;this.outlineHeight=f+g;this.init()}function Db(a){this.init(a)}var r,E=document,S=window,X=Math,t=X.round,V=X.floor,Ya=X.ceil,v=X.max,A=X.min,P=X.abs,fa=X.cos,ka=X.sin,ua=X.PI,Pa=ua*2/360,Ga=navigator.userAgent,Sb=S.opera,La=/msie/i.test(Ga)&&!Sb,ob=E.documentMode===8,Eb=/AppleWebKit/.test(Ga),cb=/Firefox/.test(Ga),fb=/(Mobile|Android|Windows Phone)/.test(Ga),Ha="http://www.w3.org/2000/svg",ea=!!E.createElementNS&&!!E.createElementNS(Ha,"svg").createSVGRect,Yb=cb&&parseInt(Ga.split("Firefox/")[1],
10)<4,la=!ea&&!La&&!!E.createElement("canvas").getContext,Za,db,Tb={},Fb=0,kb,F,xa,Fa,Gb,G,ma,ra=function(){return r},ba=[],gb=0,Wa="div",$="none",Zb=/^[0-9]+$/,$b="stroke-width",ca,lb,Oa,yb,zb,Ab,Xa,mb,nb,Nb,Ob,Bb,Pb,Qb,B={},N;S.Highcharts?ma(16,!0):N=S.Highcharts={};xa=function(a,b,c){if(!u(b)||isNaN(b))return"Invalid date";var a=q(a,"%Y-%m-%d %H:%M:%S"),d=new ca(b-Oa),e,f=d[zb](),g=d[Ab](),h=d[Xa](),i=d[mb](),j=d[nb](),k=F.lang,l=k.weekdays,d=s({a:l[g].substr(0,3),A:l[g],d:Ta(h),e:h,b:k.shortMonths[i],
B:k.months[i],m:Ta(i+1),y:j.toString().substr(2,2),Y:j,H:Ta(f),I:Ta(f%12||12),l:f%12||12,M:Ta(d[yb]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Ta(d.getSeconds()),L:Ta(t(b%1E3),3)},N.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]==="function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};ma=function(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;S.console&&console.log(c)};G={millisecond:1,second:1E3,minute:6E4,hour:36E5,
day:864E5,week:6048E5,month:26784E5,year:31556952E3};Gb={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h,i,j=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(j(b),j(c));a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),
e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(i));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}};(function(a){S.HighchartsAdapter=S.HighchartsAdapter||a&&{init:function(b){var c=a.fx;a.extend(a.easing,{easeOutQuad:function(a,b,c,g,h){return-g*(b/=h)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(b,e){var f=
c.step,g;e==="cur"?f=c.prototype:e==="_default"&&a.Tween&&(f=a.Tween.propHooks[e],e="set");(g=f[e])&&(f[e]=function(a){var c,a=b?a:this;if(a.prop!=="align")return c=a.elem,c.attr?c.attr(a.prop,e==="cur"?r:a.now):g.apply(this,arguments)})});Q(a.cssHooks.opacity,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)});this.addAnimSetter("d",function(a){var c=a.elem,f;if(!a.started)f=b.init(c,c.d,c.toD),a.start=f[0],a.end=f[1],a.started=!0;c.attr("d",b.step(a.start,a.end,a.pos,c.toD))});this.each=
Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){var c,g=a.length;for(c=0;c<g;c++)if(b.call(a[c],a[c],c,a)===!1)return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,g;if(this[0]){Sa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1));c=b[0];if(c!==r)c.chart=c.chart||{},c.chart.renderTo=this[0],new N[a](c,b[1]),g=this;c===r&&(g=ba[Y(this[0],"data-highcharts-chart")])}return g}},addAnimSetter:function(b,c){a.Tween?a.Tween.propHooks[b]={set:c}:a.fx.step[b]=
c},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=E.removeEventListener?"removeEventListener":"detachEvent";E[e]&&b&&!b[e]&&(b[e]=function(){});a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!La&&d&&(delete d.layerX,
delete d.layerY,delete d.returnValue);s(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){b==="preventDefault"&&(h=!0)}}});a(b).trigger(f);b[g]&&(b[c]=b[g],b[g]=null);e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;if(c.pageX===r)c.pageX=a.pageX,c.pageY=a.pageY;return c},animate:function(b,c,d){var e=a(b);if(!b.style)b.style={};if(c.d)b.toD=c.d,c.d=1;e.stop();c.opacity!==
r&&b.attr&&(c.opacity+="px");b.hasAnim=1;e.animate(c,d)},stop:function(b){b.hasAnim&&a(b).stop()}}})(S.jQuery);var L=S.HighchartsAdapter,T=L||{};L&&L.init.call(L,Gb);var pb=T.adapterRun,ac=T.getScript,Qa=T.inArray,p=T.each,qb=T.grep,bc=T.offset,za=T.map,z=T.addEvent,U=T.removeEvent,J=T.fireEvent,cc=T.washMouseEvent,rb=T.animate,hb=T.stop,T={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};F={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),
symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,
canvasToolsURL:"http://code.highcharts.com/stock/2.0.4/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/stock/2.0.4/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},
subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:y(T,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":Da(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,
states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},
itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:ea,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",
hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:fb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",
y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var W=F.plotOptions,L=W.line;Mb();var dc=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,ec=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,fc=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,Ia=function(a){var b=[],c,d;(function(a){a&&a.stops?d=za(a.stops,function(a){return Ia(a[1])}):(c=dc.exec(a))?b=[H(c[1]),H(c[2]),H(c[3]),parseFloat(c[4],10)]:(c=ec.exec(a))?b=[H(c[1],
16),H(c[2],16),H(c[3],16),1]:(c=fc.exec(a))&&(b=[H(c[1]),H(c[2]),H(c[3]),1])})(a);return{get:function(c){var f;d?(f=y(a),f.stops=[].concat(f.stops),p(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)p(d,function(b){b.brighten(a)});else if(pa(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=H(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=
a;return this}}};Z.prototype={opacity:1,textProps:"fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow,HcTextStroke".split(","),init:function(a,b){this.element=b==="span"?aa(b):E.createElementNS(Ha,b);this.renderer=a},animate:function(a,b,c){b=q(b,Fa,!0);hb(this);if(b){b=y(b,{});if(c)b.complete=c;rb(this,a,b)}else this.attr(a),c&&c();return this},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,j,k,l,m,n,o=[];a.linearGradient?f="linearGradient":a.radialGradient&&
(f="radialGradient");if(f){g=a[f];h=d.gradients;j=a.stops;m=c.radialReference;Ja(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});f==="radialGradient"&&m&&!u(g.gradientUnits)&&(g=y(g,{cx:m[0]-m[2]/2+g.cx*m[2],cy:m[1]-m[2]/2+g.cy*m[2],r:g.r*m[2],gradientUnits:"userSpaceOnUse"}));for(n in g)n!=="id"&&o.push(n,g[n]);for(n in j)o.push(j[n]);o=o.join(",");h[o]?a=h[o].attr("id"):(g.id=a="highcharts-"+Fb++,h[o]=i=d.createElement(f).attr(g).add(d.defs),i.stops=[],p(j,function(a){a[1].indexOf("rgba")===
0?(e=Ia(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i);i.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,e=this.element,f,g=this,h;typeof a==="string"&&b!==r&&(c=a,a={},a[c]=b);if(typeof a==="string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a){d=a[c];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(f||(this.symbolAttr(a),
f=!0),h=!0);if(this.rotation&&(c==="x"||c==="y"))this.doTransform=!0;h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,a==="height"?v(b-(c[d].cutHeight||0),0):a==="d"?this.d:b)},addClass:function(a){var b=this.element,c=Y(b,"class")||
"";c.indexOf(a)===-1&&Y(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;p("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=q(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x,b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":$)},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||0;d=t(e)%2/2;a.x=V(a.x||this.x||0)+d;a.y=V(a.y||this.y||0)+d;a.width=V((a.width||this.width||
0)-2*d);a.height=V((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()==="text"&&H(a.width);b&&(a=s(b,c));this.styles=a;e&&(la||!ea&&this.renderer.forExport)&&delete a.width;if(La&&!ea)K(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};
for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";Y(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;db&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=ca.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(Ga.indexOf("Android")===-1||ca.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this},translate:function(a,b){return this.attr({translateX:a,
translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(u(c)||u(d))&&a.push("scale("+q(c,1)+" "+q(d,1)+")");a.length&&g.setAttribute("transform",
a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||Sa(c))this.alignTo=d=c||"renderer",ta(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=q(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];
h[b?"translateX":"x"]=t(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=t(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,b=this.renderer,c,d,e=this.rotation;c=this.element;var f=this.styles,g=e*Pa;d=this.textStr;var h;if(d===""||Zb.test(d))h="num."+d.toString().length+(f?"|"+f.fontSize+"|"+f.fontFamily:"");h&&(a=b.cache[h]);if(!a){if(c.namespaceURI===Ha||b.forExport){try{a=
c.getBBox?s({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(i){}if(!a||a.width<0)a={width:0,height:0}}else a=this.htmlGetBBox();if(b.isSVG){c=a.width;d=a.height;if(La&&f&&f.fontSize==="11px"&&d.toPrecision(3)==="16.9")a.height=d=14;if(e)a.width=P(d*ka(g))+P(c*fa(g)),a.height=P(d*fa(g))+P(c*ka(g))}this.bBox=a;h&&(b.cache[h]=a)}return a},show:function(a){a&&this.element.namespaceURI===Ha?this.element.removeAttribute("visibility"):this.attr({visibility:a?"inherit":"visible"});return this},
hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.attr({y:-9999})}})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex,g,h;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);if(f)c.handleZ=!0,f=H(f);if(c.handleZ){a=d.childNodes;for(g=0;g<a.length;g++)if(b=a[g],c=Y(b,"zIndex"),b!==e&&(H(c)>f||!u(f)&&u(c))){d.insertBefore(e,
b);h=!0;break}}h||d.appendChild(e);this.added=!0;if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;hb(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}a.safeRemoveChild(b);for(c&&
p(c,function(b){a.safeRemoveChild(b)});d&&d.div&&d.div.childNodes.length===0;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&ta(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,i,j,k;if(a){i=q(a.width,3);j=(a.opacity||.15)/i;k=this.parentInverted?"(-1,-1)":"("+q(a.offsetX,1)+", "+q(a.offsetY,1)+")";for(e=1;e<=i;e++){f=g.cloneNode(0);h=i*2+1-2*e;Y(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":j*
e,"stroke-width":h,transform:"translate"+k,fill:$});if(c)Y(f,"height",v(Y(f,"height")-h,0)),f.cutHeight=h;b?b.element.appendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this},xGetter:function(a){this.element.nodeName==="circle"&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=q(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));
/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");c.setAttribute(b,a);this[b]=a},dashstyleSetter:function(a){var b;if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(b=a.length;b--;)a[b]=H(a[b])*this["stroke-width"];a=a.join(",").replace("NaN","none");this.element.setAttribute("stroke-dasharray",a)}},
alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a;c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=E.createElementNS(Ha,"title"),this.element.appendChild(b));b.textContent=q(a,"").replace(/<[^>]*>/g,"")},textSetter:function(a){if(a!==this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,b,
c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,b,c){c.setAttribute(b,a);this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};Z.prototype.yGetter=Z.prototype.xGetter;Z.prototype.translateXSetter=Z.prototype.translateYSetter=Z.prototype.rotationSetter=Z.prototype.verticalAlignSetter=Z.prototype.scaleXSetter=Z.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};Z.prototype["stroke-widthSetter"]=Z.prototype.strokeSetter=function(a,
b,c){this[b]=a;if(this.stroke&&this["stroke-width"])this.strokeWidth=this["stroke-width"],Z.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(b==="stroke-width"&&a===0&&this.hasStroke)c.removeAttribute("stroke"),this.hasStroke=!1};var na=function(){this.init.apply(this,arguments)};na.prototype={Element:Z,init:function(a,b,c,d,e){var f=location,g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));
g=d.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&Y(g,"xmlns",Ha);this.isSVG=!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=(cb||Eb)&&E.getElementsByTagName("base").length?f.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(E.createTextNode("Created with Highstock 2.0.4"));this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;
if(cb&&a.getBoundingClientRect)this.subPixelFix=b=function(){K(a,{left:0,top:0});h=a.getBoundingClientRect();K(a,{left:Ya(h.left)-h.left+"px",top:Ya(h.top)-h.top+"px"})},b(),z(S,"resize",b)},getStyle:function(a){return this.style=s({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Na(this.gradients||
{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&U(S,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=q(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,j=Y(b,"x"),k=a.styles,l=a.textWidth,m=k&&k.lineHeight,n=k&&k.HcTextStroke,o=g.length,x=function(a){return m?H(m):c.fontMetrics(/(px|em)$/.test(a&&
a.style.fontSize)?a.style.fontSize:k&&k.fontSize||c.style.fontSize||12,a).h};o--;)b.removeChild(g[o]);!f&&!n&&e.indexOf(" ")===-1?b.appendChild(E.createTextNode(e)):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,l&&!a.added&&this.box.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e],e[e.length-1]===""&&e.pop(),p(e,function(e,
f){var g,m=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");g=e.split("|||");p(g,function(e){if(e!==""||g.length===1){var n={},o=E.createElementNS(Ha,"tspan"),I;h.test(e)&&(I=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),Y(o,"style",I));i.test(e)&&!d&&(Y(o,"onclick",'location.href="'+e.match(i)[1]+'"'),K(o,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(e!==" "){o.appendChild(E.createTextNode(e));if(m)n.dx=0;else if(f&&
j!==null)n.x=j;Y(o,n);b.appendChild(o);!m&&f&&(!ea&&d&&K(o,{display:"block"}),Y(o,"dy",x(o)));if(l)for(var e=e.replace(/([^\^])-/g,"$1- ").split(" "),n=g.length>1||e.length>1&&k.whiteSpace!=="nowrap",q,p,r=k.HcHeight,t=[],u=x(o),Ub=1;n&&(e.length||t.length);)delete a.bBox,q=a.getBBox(),p=q.width,!ea&&c.forExport&&(p=c.measureSpanWidth(o.firstChild.data,a.styles)),q=p>l,!q||e.length===1?(e=t,t=[],e.length&&(Ub++,r&&Ub*u>r?(e=["..."],a.attr("title",a.textStr)):(o=E.createElementNS(Ha,"tspan"),Y(o,{dy:u,
x:j}),I&&Y(o,"style",I),b.appendChild(o))),p>l&&(l=p)):(o.removeChild(o.firstChild),t.unshift(e.pop())),e.length&&o.appendChild(E.createTextNode(e.join(" ").replace(/- /g,"-")));m++}}})}))},button:function(a,b,c,d,e,f,g,h,i){var j=this.label(a,b,c,i,null,null,null,null,"button"),k=0,l,m,n,o,x,I,a={x1:0,y1:0,x2:0,y2:1},e=y({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);n=e.style;delete e.style;f=y(e,{stroke:"#68A",
fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);o=f.style;delete f.style;g=y(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);x=g.style;delete g.style;h=y(e,{style:{color:"#CCC"}},h);I=h.style;delete h.style;z(j.element,La?"mouseover":"mouseenter",function(){k!==3&&j.attr(f).css(o)});z(j.element,La?"mouseout":"mouseleave",function(){k!==3&&(l=[e,f,g][k],m=[n,o,x][k],j.attr(l).css(m))});j.setState=function(a){(j.state=k=a)?a===2?j.attr(g).css(x):a===3&&j.attr(h).css(I):
j.attr(e).css(n)};return j.on("click",function(){k!==3&&d.call(j)}).attr(e).css(s({cursor:"default"},n))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=t(a[1])-b%2/2);a[2]===a[5]&&(a[2]=a[5]=t(a[2])+b%2/2);return a},path:function(a){var b={fill:$};Ja(a)?b.d=a:ha(a)&&s(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=ha(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",a)};b.ySetter=function(a){this.element.setAttribute("cy",
a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(ha(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){var e=ha(a)?a.r:e,g=this.createElement("rect"),a=ha(a)?a:a===r?{}:{x:a,y:b,width:v(c,0),height:v(d,0)};if(f!==r)a.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a){Y(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;
this.width=a;this.height=b;for(this.boxWrapper[q(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return u(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:$};arguments.length>1&&s(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,
b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(t(b),t(c),d,e,f),i=/^url\((.*?)\)$/,j,k;if(h)g=this.path(h),s(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&s(g,f);else if(i.test(a))k=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(t((d-b[0])/2),t((e-b[1])/2)))},j=a.match(i)[1],a=Tb[j]||f&&f.width&&f.height&&[f.width,f.height],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),aa("img",{onload:function(){k(g,Tb[j]=[this.width,this.height])},
src:j}));return g},symbols:{circle:function(a,b,c,d){var e=.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-
.001,d=e.innerR,h=e.open,i=fa(f),j=ka(f),k=fa(g),g=ka(g),e=e.end-f<ua?0:1;return["M",a+c*i,b+c*j,"A",c,c,0,e,1,a+c*k,b+c*g,h?"M":"L",a+d*k,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*j,h?"":"Z"]},callout:function(a,b,c,d,e){var f=A(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,i=e&&e.anchorY,e=t(e.strokeWidth||0)%2/2;a+=e;b+=e;e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b];h&&h>c&&i>b+g&&i<b+d-g?e.splice(13,3,"L",
a+c,i-6,a+c+6,i,a+c,i+6,a+c,b+d-f):h&&h<0&&i>b+g&&i<b+d-g?e.splice(33,3,"L",a,i+6,a-6,i,a,i-6,a,b+f):i&&i>d&&h>a+g&&h<a+c-g?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):i&&i<0&&h>a+g&&h<a+c-g&&e.splice(3,3,"L",h-6,b,h,b-6,h+6,b,c-f,b);return e}},clipRect:function(a,b,c,d){var e="highcharts-"+Fb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},text:function(a,b,c,d){var e=la||!ea&&this.forExport,f={};if(d&&!this.forExport)return this.html(a,
b,c);f.x=Math.round(b||0);if(c)f.y=Math.round(c);if(a||a===0)f.text=a;a=this.createElement("text").attr(f);e&&a.css({position:"absolute"});if(!d)a.xSetter=function(a,b,c){var d=c.getElementsByTagName("tspan"),e,f=c.getAttribute(b),m;for(m=0;m<d.length;m++)e=d[m],e.getAttribute(b)===f&&e.setAttribute(b,a);c.setAttribute(b,a)};return a},fontMetrics:function(a,b){a=a||this.style.fontSize;if(b&&S.getComputedStyle)b=b.element||b,a=S.getComputedStyle(b,"").fontSize;var a=/px/.test(a)?H(a):/em/.test(a)?
parseFloat(a)*12:12,c=a<24?a+4:t(a*1.2),d=t(c*.8);return{h:c,b:d,f:a}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=o.element.style;I=(v===void 0||Hb===void 0||n.styles.textAlign)&&o.textStr&&o.getBBox();n.width=(v||I.width||0)+2*w+eb;n.height=(Hb||I.height||0)+2*w;R=w+m.fontMetrics(a&&a.fontSize,o).b;if(z){if(!x)a=t(-q*w),b=h?-R:0,n.box=x=d?m.symbol(d,a,b,n.width,n.height,C):m.rect(a,b,n.width,n.height,0,C[$b]),x.attr("fill",$).add(n);x.isImg||x.attr(s({width:t(n.width),height:t(n.height)},
C));C=null}}function k(){var a=n.styles,a=a&&a.textAlign,b=eb+w*(1-q),c;c=h?0:R;if(u(v)&&I&&(a==="center"||a==="right"))b+={center:.5,right:1}[a]*(v-I.width);if(b!==o.x||c!==o.y)o.attr("x",b),c!==r&&o.attr("y",c);o.x=b;o.y=c}function l(a,b){x?x.attr(a,b):C[a]=b}var m=this,n=m.g(i),o=m.text("",0,0,g).attr({zIndex:1}),x,I,q=0,w=3,eb=0,v,Hb,O,Ib,A=0,C={},R,z;n.onAdd=function(){o.add(n);n.attr({text:a||a===0?a:"",x:b,y:c});x&&u(e)&&n.attr({anchorX:e,anchorY:f})};n.widthSetter=function(a){v=a};n.heightSetter=
function(a){Hb=a};n.paddingSetter=function(a){u(a)&&a!==w&&(w=a,k())};n.paddingLeftSetter=function(a){u(a)&&a!==eb&&(eb=a,k())};n.alignSetter=function(a){q={left:0,center:.5,right:1}[a]};n.textSetter=function(a){a!==r&&o.textSetter(a);j();k()};n["stroke-widthSetter"]=function(a,b){a&&(z=!0);A=a%2/2;l(b,a)};n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){b==="fill"&&a&&(z=!0);l(b,a)};n.anchorXSetter=function(a,b){e=a;l(b,a+A-O)};n.anchorYSetter=function(a,b){f=a;l(b,a-Ib)};n.xSetter=function(a){n.x=
a;q&&(a-=q*((v||I.width)+w));O=t(a);n.attr("translateX",O)};n.ySetter=function(a){Ib=n.y=t(a);n.attr("translateY",Ib)};var E=n.css;return s(n,{css:function(a){if(a){var b={},a=y(a);p(n.textProps,function(c){a[c]!==r&&(b[c]=a[c],delete a[c])});o.css(b)}return E.call(n,a)},getBBox:function(){return{width:I.width+2*w,height:I.height+2*w,x:I.x-w,y:I.y-w}},shadow:function(a){x&&x.shadow(a);return n},destroy:function(){U(n.element,"mouseenter");U(n.element,"mouseleave");o&&(o=o.destroy());x&&(x=x.destroy());
Z.prototype.destroy.call(n);n=m=j=k=l=null}})}};Za=na;s(Z.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width)delete a.width,this.textWidth=b,this.updateTransform();this.styles=s(this.styles,a);K(this.element,a);return this},htmlGetBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position="absolute";b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},htmlUpdateTransform:function(){if(this.added){var a=
this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:.5,right:1}[g],i=this.shadows;K(b,{marginLeft:c,marginTop:d});i&&p(i,function(a){K(a,{marginLeft:c+1,marginTop:d+1})});this.inverted&&p(b.childNodes,function(c){a.invertChild(c,b)});if(b.tagName==="SPAN"){var j=this.rotation,k,l=H(this.textWidth),m=[j,g,b.innerHTML,this.textWidth].join(",");if(m!==this.cTT){k=a.fontMetrics(b.style.fontSize).b;u(j)&&this.setSpanRotation(j,
h,k);i=q(this.elemWidth,b.offsetWidth);if(i>l&&/[ \-]/.test(b.textContent||b.innerText))K(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l;this.getSpanCorrection(i,k,h,j,g)}K(b,{left:e+(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(Eb)k=b.offsetHeight;this.cTT=m}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=La?"-ms-transform":Eb?"-webkit-transform":cb?"MozTransform":Sb?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)";d[e+(cb?"Origin":"-origin")]=d.transformOrigin=
b*100+"% "+c+"px";K(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});s(na.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,f=d.renderer;d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a};d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:t(b),y:t(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,
fontSize:this.style.fontSize});d.css=d.htmlCss;if(f.isSVG)d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;p(j.reverse(),function(a){var d;b=a.div=a.div||aa(Wa,{className:Y(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;s(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px";a[c]=b;a.doTransform=!0},
visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});var ib,ga;if(!ea&&!la)ga={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Wa;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element=aa(c);this.renderer=a},
add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:Z.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=fa(a*Pa),c=ka(a*Pa);K(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):
$})},getSpanCorrection:function(a,b,c,d,e){var f=d?fa(d*Pa):1,g=d?ka(d*Pa):0,h=q(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<0;this.xCorr+=g*b*(i?1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=h*c*(g<0?-1:1)),K(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(pa(a[b]))c[b]=t(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+
5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,ta(c,b),c.push(b),b.destroyClip=function(){ta(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:ob?"inherit":"rect(auto)"});return b.css(a)},css:Z.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Va(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Z.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+
a]=function(){var a=S.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=H(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,l,m,n,o;k&&typeof k.value!=="string"&&(k="x");m=k;if(a){n=q(a.width,3);o=(a.opacity||.15)/n;for(e=1;e<=3;e++){l=n*2+1-2*e;c&&(m=this.cutOffPath(k.value,l+.5));j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',
m,'" coordsize="10 10" style="',f.style.cssText,'" />'];h=aa(g.prepVML(j),null,{left:H(i.left)+q(a.offsetX,1),top:H(i.top)+q(a.offsetY,1)});if(c)h.cutOff=l+1;j=['<stroke color="',a.color||"black",'" opacity="',o*e,'"/>'];aa(g.prepVML(j),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:ra,setAttr:function(a,b){ob?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,
b,c){(c.getElementsByTagName("stroke")[0]||aa(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,c){var d=this.shadows,a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!==$,this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},opacitySetter:ra,
rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-t(ka(a*Pa)+1)+"px";c.top=t(fa(a*Pa))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;pa(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&p(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?
"-999em":0,ob||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}},N.VMLElement=ga=ia(Z,ga),ga.prototype.ySetter=ga.prototype.widthSetter=ga.prototype.heightSetter=ga.prototype.xSetter,ga={Element:ga,isIE8:Ga.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects=[];d=this.createElement(Wa).css(s(this.getStyle(d),
{position:"relative"}));e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.cache={};this.setSize(b,c,!1);if(!E.namespaces.hcv){E.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{E.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){E.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},
isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=ha(a);return s(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+t(a?e:d)+"px,"+t(a?f:b)+"px,"+t(a?b:f)+"px,"+t(a?d:e)+"px)"};!a&&ob&&c==="DIV"&&s(d,{width:b+"px",height:f+"px"});return d},updateClipping:function(){p(e.members,
function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j=$;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var k,l,m=a.linearGradient||a.radialGradient,n,o,x,I,q,w="",a=a.stops,r,t=[],v=function(){h=['<fill colors="'+t.join(",")+'" opacity="',x,'" o:opacity2="',o,'" type="',i,'" ',w,'focus="100%" method="any" />'];aa(e.prepVML(h),null,null,b)};n=a[0];r=a[a.length-1];n[0]>0&&a.unshift([0,n[1]]);r[0]<1&&a.push([1,r[1]]);p(a,function(a,
b){g.test(a[1])?(f=Ia(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);t.push(a[0]*100+"% "+k);b?(x=l,I=k):(o=l,q=k)});if(c==="fill")if(i==="gradient")c=m.x1||m[0]||0,a=m.y1||m[1]||0,n=m.x2||m[2]||0,m=m.y2||m[3]||0,w='angle="'+(90-X.atan((m-a)/(n-c))*180/ua)+'"',v();else{var j=m.r,u=j*2,s=j*2,y=m.cx,C=m.cy,R=b.radialReference,A,j=function(){R&&(A=d.getBBox(),y+=(R[0]-A.x)/A.width-.5,C+=(R[1]-A.y)/A.height-.5,u*=R[2]/A.width,s*=R[2]/A.height);w='src="'+F.global.VMLRadialGradientURL+'" size="'+u+","+
s+'" origin="0.5,0.5" position="'+y+","+C+'" color2="'+q+'" ';v()};d.added?j():d.onAdd=j;j=I}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=Ia(a),h=["<",c,' opacity="',f.get("a"),'"/>'],aa(this.prepVML(h),null,null,b),j=f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):
a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");return a},text:na.prototype.html,path:function(a){var b={coordsize:"10 10"};Ja(a)?b.d=a:ha(a)&&s(b,a);return this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");if(ha(a))c=a.r,b=a.y,a=a.x;d.isCircle=!0;d.r=c;return d.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement(Wa).attr(b)},image:function(a,
b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.attr({x:b,y:c,width:d,height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):na.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;K(a,{flip:"x",left:H(d.width)-(e?H(e.top):1),top:H(d.height)-(e?H(e.left):1),rotation:-90});p(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||
d,c=e.innerR,d=fa(f),i=ka(f),j=fa(g),k=ka(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return na.prototype.symbols[!u(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}},N.VMLRenderer=ib=function(){this.init.apply(this,
arguments)},ib.prototype=y(na.prototype,ga),Za=ib;na.prototype.measureSpanWidth=function(a,b){var c=E.createElement("span"),d;d=E.createTextNode(a);c.appendChild(d);K(c,b);this.box.appendChild(c);d=c.offsetWidth;Va(c);return d};var Vb;if(la)N.CanVGRenderer=ga=function(){Ha="http://www.w3.org/1999/xhtml"},ga.prototype.symbols={},Vb=function(){function a(){var a=b.length,d;for(d=0;d<a;d++)b[d]();b=[]}var b=[];return{push:function(c,d){b.length===0&&ac(d,a);b.push(c)}}}(),Za=ga;bb.prototype={addLabel:function(){var a=
this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,i=h.rotation,j=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/j.length||!d&&(c.margin[3]||c.chartWidth*.33),k=g===j[0],l=g===j[j.length-1],m,f=e?q(e[g],f[g],g):g,e=this.label,n=j.info;a.isDatetimeAxis&&n&&(m=b.dateTimeLabelFormats[n.higherRanks[g]||n.unitName]);this.isFirst=k;this.isLast=l;b=a.labelFormatter.call({axis:a,chart:c,isFirst:k,isLast:l,dateTimeLabelFormat:m,value:a.isLog?
ja(sa(f)):f});g=d&&{width:v(1,t(d-2*(h.padding||10)))+"px"};if(u(e))e&&e.attr({text:b}).css(g);else{m={align:a.labelAlign};if(pa(i))m.rotation=i;if(d&&h.ellipsis)g.HcHeight=a.len/j.length;this.label=e=u(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(m).css(s(g,h.style)).add(a.labelGroup):null;a.tickBaseline=c.renderer.fontMetrics(h.style.fontSize,e).b;i&&a.side===2&&(a.tickBaseline*=fa(i*Pa))}this.yOffset=e?q(h.y,a.tickBaseline+(a.side===2?8:-(e.getBBox().height/2))):0},getLabelSize:function(){var a=
this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],l,m,n,o=this.label.line;l=o||0;m=d.labelEdge;n=d.justifyLabels&&(e||f);m[l]===
r||g+k>m[l]?m[l]=g+j:n||(c=!1);if(n){l=(m=d.justifyToPlot)?d.pos:0;m=m?l+d.len:d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||!n.label||n.label.line!==o));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1];e&&!h||f&&h?g+k<l&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>m&&(g=m-j,n&&g+k<d&&(c=!1));b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||
f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+this.yOffset-(f&&!d?f*j*(k?1:-1):0);if(l)c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l);return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,
f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,m=h?h+"Grid":"grid",n=h?h+"Tick":"tick",o=e[m+"LineWidth"],x=e[m+"LineColor"],I=e[m+"LineDashStyle"],p=e[n+"Length"],m=e[n+"Width"]||0,w=e[n+"Color"],eb=e[n+"Position"],n=this.mark,t=k.step,v=!0,u=d.tickmarkOffset,s=this.getPosition(g,j,u,b),y=s.x,s=s.y,C=g&&y===d.pos+d.len||!g&&s===d.pos?-1:1,c=q(c,1);this.isActive=!0;if(o){j=d.getPlotLinePath(j+u,o*C,b,!0);if(l===r){l={stroke:x,"stroke-width":o};if(I)l.dashstyle=
I;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=o?f.path(j).attr(l).add(d.gridGroup):null}if(!b&&l&&j)l[this.isNew?"attr":"animate"]({d:j,opacity:c})}if(m&&p)eb==="inside"&&(p=-p),d.opposite&&(p=-p),h=this.getMarkPath(y,s,p,m*C,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:w,"stroke-width":m,opacity:c}).add(d.axisGroup);if(i&&!isNaN(y))i.xy=s=this.getLabelPosition(y,s,i,g,k,u,a,t),this.isFirst&&!this.isLast&&!q(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!q(e.showLastLabel,
1)?v=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&c!==0&&(v=this.handleOverflow(a,s)),t&&a%t&&(v=!1),v&&!isNaN(s.y)?(s.opacity=c,i[this.isNew?"attr":"animate"](s),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Na(this,this.axis)}};N.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};N.PlotLineOrBand.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=u(j)&&u(i),l=e.value,m=e.dashStyle,
n=a.svgElem,o=[],x,I=e.color,q=e.zIndex,p=e.events,r={},t=b.chart.renderer;b.isLog&&(j=Ka(j),i=Ka(i),l=Ka(l));if(h){if(o=b.getPlotLinePath(l,h),r={stroke:I,"stroke-width":h},m)r.dashstyle=m}else if(k){j=v(j,b.min-d);i=A(i,b.max+d);o=b.getPlotBandPath(j,i,e);if(I)r.fill=I;if(e.borderWidth)r.stroke=e.borderColor,r["stroke-width"]=e.borderWidth}else return;if(u(q))r.zIndex=q;if(n)if(o)n.animate({d:o},null,n.onGetPath);else{if(n.hide(),n.onGetPath=function(){n.show()},g)a.label=g=g.destroy()}else if(o&&
o.length&&(a.svgElem=n=t.path(o).attr(r).add(),p))for(x in d=function(b){n.on(b,function(c){p[b].apply(a,[c])})},p)d(x);if(f&&u(f.text)&&o&&o.length&&b.width>0&&b.height>0){f=y({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f);if(!g){r={align:f.textAlign||f.align,rotation:f.rotation};if(u(q))r.zIndex=q;a.label=g=t.text(f.text,0,0,f.useHTML).attr(r).css(f.style).add()}b=[o[1],o[4],k?o[6]:o[1]];k=[o[2],o[5],k?o[7]:o[2]];o=Ua(b);c=Ua(k);g.align(f,
!1,{x:o,y:c,width:Ea(b)-o,height:Ea(k)-c});g.show()}else g&&g.hide();return a},destroy:function(){ta(this.axis.plotLinesAndBands,this);delete this.axis;Na(this)}};D.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:T,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",
minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Da(this.total,
-1)},style:T.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=
this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.names=[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=u(d.linkedTo);this.tickmarkOffset=this.categories&&d.tickmarkPlacement==="between"&&q(d.tickInterval,1)===1?.5:0;this.ticks={};this.labelEdge=[];this.minorTicks=
{};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=q(d.crosshair,qa(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;Qa(this,a.axes)===-1&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];if(a.inverted&&c&&this.reversed===
r)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)z(this,f,d[f]);if(this.isLog)this.val2lin=Ka,this.lin2val=sa},setOptions:function(a){this.options=y(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],y(F[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,
e=F.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ma(h,this);else if(c)g=b;else if(d)g=xa(d,b);else if(f&&a>=1E3)for(;f--&&g===r;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=Da(b/c,-1)+e[f]);g===r&&(g=P(b)>=1E4?Da(b,0):Da(b,-1,r,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.ignoreMinPadding=a.ignoreMaxPadding=null;a.buildStacks&&a.buildStacks();p(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;
d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=A(q(a.dataMin,d[0]),Ua(d)),a.dataMax=v(q(a.dataMax,d[0]),Ea(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(u(c)&&u(e))a.dataMin=A(q(a.dataMin,c),c),a.dataMax=v(q(a.dataMax,e),e);if(u(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMax<d)a.dataMax=d,a.ignoreMaxPadding=!0}}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:
this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;if(!i)i=this.transA;if(c)g*=-1,h=this.len;this.reversed&&(g*=-1,h-=g*(this.sector||this.len));b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),f==="between"&&(f=.5),a=g*(a-d)*i+h+g*j+(pa(f)?i*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,
!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,h=this.top,i,j,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||f.chartWidth,m;i=this.transB;e=q(e,this.translate(a,null,null,c));a=c=t(e+i);i=j=t(k-e-i);if(isNaN(e))m=!0;else if(this.horiz){if(i=h,j=k-this.bottom,a<g||a>g+this.width)m=!0}else if(a=g,c=l-this.right,i<h||i>h+this.height)m=!0;return m&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=ja(V(b/a)*a),f=ja(Ya(c/
a)*a),g=[];if(b===c&&pa(b))return[b];for(b=e;b<=f;){g.push(b);b=ja(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog){e=b.length;for(a=1;a<e;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0))}else if(this.isDatetimeAxis&&a.minorTickInterval==="auto")d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+
(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=this.options,b=this.min,c=this.max,d,e=this.dataMax-this.dataMin>=this.minRange,f,g,h,i,j;if(this.isXAxis&&this.minRange===r&&!this.isLog)u(a.min)||u(a.max)?this.minRange=null:(p(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===r||h<f)f=h}),this.minRange=A(f*5,this.dataMax-this.dataMin));if(c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2;d=[b-d,q(a.min,b-d)];
if(e)d[2]=this.dataMin;b=Ea(d);c=[b+k,q(a.max,b+k)];if(e)c[2]=this.dataMax;c=Ua(c);c-b<k&&(d[0]=c-k,d[1]=q(a.min,c-k),b=Ea(d))}this.min=b;this.max=c},setAxisTranslation:function(a){var b=this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;if(b.isXAxis||i||d)h?(f=h.minPointOffset,g=h.pointRangePadding):p(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0);d=v(d,h);f=v(f,Sa(j)?
0:h/2);g=v(g,j==="on"?0:h);!a.noSharedTooltip&&u(n)&&(e=u(e)?A(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=g*=h,b.pointRange=A(d,c),b.closestPointRange=e;if(a)b.oldTransA=j;b.translationSlope=b.transA=j=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=j*f},setTickPositions:function(a){var b=this,c=b.chart,d=b.options,e=d.startOnTick,f=d.endOnTick,g=b.isLog,h=b.isDatetimeAxis,i=b.isXAxis,j=b.isLinked,k=b.options.tickPositioner,l=d.maxPadding,
m=d.minPadding,n=d.tickInterval,o=d.minTickInterval,x=d.tickPixelInterval,I,oa=b.categories;j?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=q(c.min,c.dataMin),b.max=q(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ma(11,1)):(b.min=q(b.userMin,d.min,b.dataMin),b.max=q(b.userMax,d.max,b.dataMax));if(g)!a&&A(b.min,q(b.dataMin,b.min))<=0&&ma(10,1),b.min=ja(Ka(b.min)),b.max=ja(Ka(b.max));if(b.range&&u(b.max))b.userMin=b.min=v(b.min,b.max-b.range),b.userMax=b.max,b.range=
null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!oa&&!b.axisPointRange&&!b.usePercentage&&!j&&u(b.min)&&u(b.max)&&(c=b.max-b.min)){if(!u(d.min)&&!u(b.userMin)&&m&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*m;if(!u(d.max)&&!u(b.userMax)&&l&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*l}if(pa(d.floor))b.min=v(b.min,d.floor);if(pa(d.ceiling))b.max=A(b.max,d.ceiling);b.min===b.max||b.min===void 0||b.max===void 0?b.tickInterval=1:j&&!n&&x===b.linkedParent.options.tickPixelInterval?b.tickInterval=
b.linkedParent.tickInterval:(b.tickInterval=q(n,oa?1:(b.max-b.min)*x/v(b.len,x)),!u(n)&&b.len<x&&!this.isRadial&&!this.isLog&&!oa&&e&&f&&(I=!0,b.tickInterval/=4));i&&!a&&p(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=v(b.pointRange,b.tickInterval);if(!n&&b.tickInterval<o)b.tickInterval=
o;if(!h&&!g&&!n)b.tickInterval=wb(b.tickInterval,null,vb(b.tickInterval),q(d.allowDecimals,!(b.tickInterval>1&&b.tickInterval<5&&b.max>1E3&&b.max<9999)));b.minorTickInterval=d.minorTickInterval==="auto"&&b.tickInterval?b.tickInterval/5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):k&&k.apply(b,[b.min,b.max]);if(!a)!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>v(2*b.len,200)&&ma(19,!0),a=h?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,
b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):g?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),I&&a.splice(1,a.length-2),b.tickPositions=a;if(!j)d=a[0],g=a[a.length-1],h=b.minPointOffset||0,e?b.min=d:b.min-h>d&&a.shift(),f?b.max=g:b.max+h<g&&a.pop(),a.length===0&&u(d)&&a.push((g+d)/2),a.length===1&&(e=P(b.max)>1E13?1:.001,b.min-=e,b.max+=e)},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=
[this.coll,this.pos,this.len].join("-");if(!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1)b[d]=c.length;a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==r){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e<a){for(;b.length<a;)b.push(ja(b[b.length-1]+this.tickInterval));this.transA*=
(e-1)/(a-1);this.max=b[b.length-1]}if(u(d)&&a!==d)this.isDirty=!0}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==this.oldAxisLength;p(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=
!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax}else if(!this.isXAxis){if(this.oldStacks)a=this.stacks=this.oldStacks;for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=q(c,!0),e=s(e,{min:a,max:b});J(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;f.isDirtyExtremes=
!0;c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;this.allowZoomOutside||(u(c)&&a<=A(c,q(e.min,c))&&(a=r),u(d)&&b>=v(d,q(e.max,d))&&(b=r));this.displayBtn=a!==r||b!==r;this.setExtremes(a,b,!1,r,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=q(b.width,a.plotWidth-c+(b.offsetRight||0)),f=q(b.height,a.plotHeight),g=q(b.top,a.plotTop),b=q(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/
100*a.plotHeight);c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop);this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=v(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=this.isLog;return{min:a?ja(sa(this.min)):this.min,max:a?ja(sa(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?sa(this.min):this.min,b=b?sa(this.max):
this.max;c>a||a===null?a=c:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(q(a,0)-this.side*90+720)%360;return a>15&&a<165?"right":a>195&&a<345?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k,l=0,m,n=0,o=d.title,x=d.labels,I=0,oa=b.axisOffset,b=b.clipOffset,w=[-1,1,1,-1][h],t,s=1,y=q(x.maxStaggerLines,5),O,A,z,C,R;a.hasData=j=a.hasVisibleSeries||u(a.min)&&u(a.max)&&
!!e;a.showAxis=k=j||q(d.showEmpty,!0);a.staggerLines=a.horiz&&x.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:x.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add();if(j||a.isLinked){a.labelAlign=q(x.align||a.autoLabelAlign(x.rotation));p(e,function(b){f[b]?f[b].addLabel():f[b]=new bb(a,b)});if(a.horiz&&!a.staggerLines&&y&&!x.rotation){for(j=
a.reversed?[].concat(e).reverse():e;s<y;){O=[];A=!1;for(t=0;t<j.length;t++)z=j[t],C=(C=f[z].label&&f[z].label.getBBox())?C.width:0,R=t%s,C&&(z=a.translate(z),O[R]!==r&&z<O[R]&&(A=!0),O[R]=z+C);if(A)s++;else break}if(s>1)a.staggerLines=s}p(e,function(b){if(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)I=v(f[b].getLabelSize(),I)});if(a.staggerLines)I*=a.staggerLines,a.labelOffset=I}else for(t in f)f[t].destroy(),delete f[t];if(o&&o.text&&o.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(o.text,
0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:o.textAlign||{low:"left",middle:"center",high:"right"}[o.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(o.style).add(a.axisGroup),a.axisTitle.isNew=!0;if(k)l=a.axisTitle.getBBox()[g?"height":"width"],m=o.offset,n=u(m)?0:q(o.margin,g?5:10);a.axisTitle[k?"show":"hide"]()}a.offset=w*q(d.offset,oa[h]);c=h===2?a.tickBaseline:0;g=I+n+(I&&w*(g?q(x.y,a.tickBaseline+8):x.x)-c);a.axisTitleMargin=q(m,g);oa[h]=v(oa[h],a.axisTitleMargin+
l+w*a.offset,g);b[i]=v(b[i],V(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=H(e.style.fontSize||
12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,j,k=a.axisTitle,l=a.ticks,m=a.minorTicks,n=a.alternateBands,o=f.stackLabels,x=f.alternateGridColor,q=a.tickmarkOffset,oa=f.lineWidth,w=d.hasRendered&&u(a.oldMin)&&
!isNaN(a.oldMin),t=a.hasData,v=a.showAxis,s,y=f.labels.overflow,A=a.justifyLabels=b&&y!==!1,z;a.labelEdge.length=0;a.justifyToPlot=y==="justify";p([l,m,n],function(a){for(var b in a)a[b].isActive=!1});if(t||h)if(a.minorTickInterval&&!a.categories&&p(a.getMinorTickPositions(),function(b){m[b]||(m[b]=new bb(a,b,"minor"));w&&m[b].isNew&&m[b].render(null,!0);m[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),A&&(j=j.slice(1).concat([j[0]])),p(j,function(b,c){A&&(c=c===j.length-
1?0:c+1);if(!h||b>=a.min&&b<=a.max)l[b]||(l[b]=new bb(a,b)),w&&l[b].isNew&&l[b].render(c,!0,.1),l[b].render(c)}),q&&a.min===0&&(l[-1]||(l[-1]=new bb(a,-1,null,!0)),l[-1].render(-1))),x&&p(i,function(b,c){if(c%2===0&&b<a.max)n[b]||(n[b]=new N.PlotLineOrBand(a)),s=b+q,z=i[c+1]!==r?i[c+1]+q:a.max,n[b].options={from:g?sa(s):s,to:g?sa(z):z,color:x},n[b].render(),n[b].isActive=!0}),!a._addedPlotLB)p((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0;p([l,m,
n],function(a){var b,c,e=[],f=Fa?Fa.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)if(!a[b].isActive)a[b].render(b,!1,0),a[b].isActive=!1,e.push(b);a===n||!d.hasRendered||!f?g():f&&setTimeout(g,f)});if(oa)b=a.getLinePath(oa),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":oa,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"]();if(k&&v)k[k.isNew?"attr":"animate"](a.getTitlePosition()),
k.isNew=!1;o&&o.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.render();p(this.plotLinesAndBands,function(a){a.render()});p(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,c=b.stacks,d,e=b.plotLinesAndBands;a||U(b);for(d in c)Na(c[d]),c[d]=null;p([b.ticks,b.minorTicks,b.alternateBands],function(a){Na(a)});for(a=e.length;a--;)e[a].destroy();p("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())});
this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((u(b)||!q(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;q(d.snap,!0)?u(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos;c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:q(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c);if(c===null)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[e?
"animate":"attr"]({d:c},e);else{e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2};if(d.dashStyle)e.dashstyle=d.dashStyle;this.cross=this.chart.renderer.path(c).attr(e).add()}}},hideCrosshair:function(){this.cross&&this.cross.hide()}};s(D.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);d&&c?d.push(c[4],c[5],c[1],c[2]):d=null;return d},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,
"plotLines")},addPlotBandOrLine:function(a,b){var c=(new N.PlotLineOrBand(this,a)).render(),d=this.userOptions;c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c));return c},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();p([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ta(b,b[e])})}});D.prototype.getTimeTicks=function(a,b,c,
d){var e=[],f={},g=F.global.useUTC,h,i=new ca(b-Oa),j=a.unitRange,k=a.count;if(u(b)){j>=G.second&&(i.setMilliseconds(0),i.setSeconds(j>=G.minute?0:k*V(i.getSeconds()/k)));if(j>=G.minute)i[Nb](j>=G.hour?0:k*V(i[yb]()/k));if(j>=G.hour)i[Ob](j>=G.day?0:k*V(i[zb]()/k));if(j>=G.day)i[Bb](j>=G.month?1:k*V(i[Xa]()/k));j>=G.month&&(i[Pb](j>=G.year?0:k*V(i[mb]()/k)),h=i[nb]());j>=G.year&&(h-=h%k,i[Qb](h));if(j===G.week)i[Bb](i[Xa]()-i[Ab]()+q(d,1));b=1;Oa&&(i=new ca(i.getTime()+Oa));h=i[nb]();for(var d=i.getTime(),
l=i[mb](),m=i[Xa](),n=(G.day+(g?Oa:i.getTimezoneOffset()*6E4))%G.day;d<c;)e.push(d),j===G.year?d=lb(h+b*k,0):j===G.month?d=lb(h,l+b*k):!g&&(j===G.day||j===G.week)?d=lb(h,l,m+b*k*(j===G.day?1:7)):d+=j*k,b++;e.push(d);p(qb(e,function(a){return j<=G.hour&&a%G.day===n}),function(a){f[a]="day"})}e.info=s(a,{higherRanks:f,totalRange:j*k});return e};D.prototype.normalizeTimeTickInterval=function(a,b){var c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,
15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=G[d[0]],f=d[1],g;for(g=0;g<c.length;g++)if(d=c[g],e=G[d[0]],f=d[1],c[g+1]&&a<=(e*f[f.length-1]+G[c[g+1][0]])/2)break;e===G.year&&a<5*e&&(f=[1,2,5]);c=wb(a/e,f,d[0]==="year"?v(vb(a/e),1):1);return{unitRange:e,count:c,unitName:d[0]}};D.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(!d)this._minorAutoInterval=null;if(a>=.5)a=t(a),g=this.getLinearTickPositions(a,
b,c);else if(a>=.08)for(var f=V(b),h,i,j,k,l,e=a>.3?[1,2,4]:a>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];f<c+1&&!l;f++){i=e.length;for(h=0;h<i&&!l;h++)j=Ka(sa(f)*e[h]),j>b&&(!d||k<=c)&&k!==r&&g.push(k),k>c&&(l=!0),k=j}else if(b=sa(b),c=sa(c),a=e[d?"minorTickInterval":"tickInterval"],a=q(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=wb(a,null,vb(a)),g=za(this.getLinearTickPositions(a,b,c),Ka),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=
a;return g};var Jb=N.Tooltip=function(){this.init.apply(this,arguments)};Jb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=H(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999});la||this.label.shadow(b.shadow);this.shared=b.shared},
destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden&&(P(a-f.x)>1||P(b-f.y)>1),h=e.followPointer||e.len>1;s(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?r:g?(2*f.anchorX+c)/3:c,anchorY:h?r:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g)clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(a){var b=
this,c;clearTimeout(this.hideTimer);if(!this.isHidden)c=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){b.label.fadeOut();b.isHidden=!0},q(a,this.options.hideDelay,500)),c&&p(c,function(a){a.setState()}),this.chart.hoverPoints=null},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=qa(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===r&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(p(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=
(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]);return za(c,t)},getPosition:function(a,b,c){var d=this.chart,e=this.distance,f={},g,h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=c<d-e,b=d+e+c<b,c=d-e-c;d+=e;if(j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=
c;else if(b)f[a]=d;else return!1},l=function(a,b,c,d){if(d<e||d>b-e)return!1;else f[a]=d<c/2?1:d>b-c/2?b-c-2:d-c/2},m=function(a){var b=h;h=i;i=b;g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(m(!0),n()):g?f.x=f.y=0:(m(!0),n())};(d.inverted||this.len>1)&&m();n();return f},defaultFormatter:function(a){var b=this.points||qa(this),c=b[0].series,d;d=[a.tooltipHeaderFormatter(b[0])];p(b,function(a){c=a.series;d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});
d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},i,j=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,k,l=this.shared;clearTimeout(this.hideTimer);this.followPointer=qa(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];l&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&p(h,function(a){a.setState()}),p(a,function(a){a.setState("hover");j.push(a.getLabelConfig())}),h={x:a[0].category,
y:a[0].y},h.points=j,this.len=j.length,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;this.distance=q(h.tooltipOptions.distance,16);i===!1?this.hide():(this.isHidden&&(hb(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1);J(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,
c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(t(c.x),t(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var b=a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&f.options.type==="datetime"&&pa(a.key),c=c.headerFormat,f=f&&f.closestPointRange,h;if(g&&!e){if(f)for(h in G){if(G[h]>=f||G[h]<=G.day&&a.key%G[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}g&&e&&(c=c.replace("{point.key}","{point.key:"+
e+"}"));return Ma(c,{point:a,series:b})}};var va;db=E.documentElement.ontouchstart!==r;var $a=N.Pointer=function(a,b){this.init(a,b)};$a.prototype={init:function(a,b){var c=b.chart,d=c.events,e=la?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(N.Tooltip&&b.tooltip.enabled)a.tooltip=new Jb(a,b.tooltip),
this.followTouchMove=b.tooltip.followTouchMove;this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=cc(a);if(!a.target)a.target=a.srcElement;d=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=bc(this.chart.container);d.pageX===r?(c=v(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return s(a,{chartX:t(c),chartY:t(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};p(this.chart.axes,function(c){b[c.isXAxis?"xAxis":
"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f,g=b.hoverPoint,h=b.hoverSeries,i,j,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){f=[];i=c.length;for(j=0;j<i;j++)if(c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&
c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series)e._dist=P(l-e.clientX),k=A(k,e._dist),f.push(e);for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);if(f.length&&f[0].clientX!==this.hoverX)d.refresh(f,a),this.hoverX=f[0].clientX}c=h&&h.tooltipOptions.followPointer;if(h&&h.tracker&&!c){if((e=h.tooltipPoints[l])&&e!==g)e.onMouseOver(a)}else d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]}));if(d&&!this._onDocumentMouseMove)this._onDocumentMouseMove=
function(a){if(ba[va])ba[va].pointer.onDocumentMouseMove(a)},z(E,"mousemove",this._onDocumentMouseMove);p(b.axes,function(b){b.drawCrosshair(a,q(e,g))})},reset:function(a,b){var c=this.chart,d=c.hoverSeries,e=c.hoverPoint,f=c.tooltip,g=f&&f.shared?c.hoverPoints:e;(a=a&&f&&g)&&qa(g)[0].plotX===r&&(a=!1);if(a)f.refresh(g),e&&e.setState(e.state,!0);else{if(e)e.onMouseOut();if(d)d.onMouseOut();f&&f.hide(b);if(this._onDocumentMouseMove)U(E,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=
null;p(c.axes,function(a){a.hideCrosshair()});this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,d;p(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},
drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,l,m=this.mouseDownX,n=this.mouseDownY,o=c.panKey&&a[c.panKey+"Key"];d<h?d=h:d>h+j&&(d=h+j);e<i?e=i:e>i+k&&(e=i+k);this.hasDragged=Math.sqrt(Math.pow(m-d,2)+Math.pow(n-e,2));if(this.hasDragged>10){l=b.isInsidePlot(m-h,n-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!o&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,
f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=m,this.selectionMarker.attr({width:P(d),x:(d>0?0:d)+m}));this.selectionMarker&&g&&(d=e-n,this.selectionMarker.attr({height:P(d),y:(d>0?0:d)+n}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},e=this.selectionMarker,f=e.attr?e.attr("x"):
e.x,g=e.attr?e.attr("y"):e.y,h=e.attr?e.attr("width"):e.width,i=e.attr?e.attr("height"):e.height,j;if(this.hasDragged||c)p(b.axes,function(b){if(b.zoomEnabled){var c=b.horiz,e=a.type==="touchend"?b.minPixelPadding:0,n=b.toValue((c?f:g)+e),c=b.toValue((c?f+h:g+i)-e);!isNaN(n)&&!isNaN(c)&&(d[b.coll].push({axis:b,min:A(n,c),max:v(n,c)}),j=!0)}}),j&&J(b,"selection",d,function(a){b.zoom(s(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}if(b)K(b.container,
{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){ba[va]&&ba[va].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&
this.reset()},onContainerMouseLeave:function(){var a=ba[va];if(a)a.pointer.reset(),a.pointer.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart;va=b.index;a=this.normalize(a);a.returnValue=!1;b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=Y(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==
-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;if(b&&!b.options.stickyTracking&&!this.inClass(a,"highcharts-tooltip")&&c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(J(c.series,"click",s(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",
a)):(s(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&J(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};z(b,"mouseleave",a.onContainerMouseLeave);gb===1&&z(E,"mouseup",a.onDocumentMouseUp);if(db)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},gb===1&&
z(E,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;U(this.chart.container,"mouseleave",this.onContainerMouseLeave);gb||(U(E,"mouseup",this.onDocumentMouseUp),U(E,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};s(N.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,
b,c,d,e,f,g,h){var i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,m=a?"width":"height",n=i["plot"+(a?"Left":"Top")],o,x,q=h||1,p=i.inverted,w=i.bounds[a?"h":"v"],r=b.length===1,t=b[0][l],v=c[0][l],s=!r&&b[1][l],u=!r&&c[1][l],y,c=function(){!r&&P(t-s)>20&&(q=h||P(v-u)/P(t-s));x=(n-v)/q+t;o=i["plot"+(a?"Width":"Height")]/q};c();b=x;b<w.min?(b=w.min,y=!0):b+o>w.max&&(b=w.max-o,y=!0);y?(v-=.8*(v-g[j][0]),r||(u-=.8*(u-g[j][1])),c()):g[j]=[v,u];p||(f[j]=x-n,f[m]=o);f=p?1/q:q;e[m]=o;e[j]=b;d[p?a?"scaleY":
"scaleX":"scale"+k]=q;d["translate"+k]=f*n+(v-f*t)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,k={},l=g===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||b.runChartClick),m={};(i||e)&&!l&&a.preventDefault();za(f,function(a){return b.normalize(a)});if(a.type==="touchstart")p(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,
d[1]&&d[1].chartY],p(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(q(a.options.min,a.dataMin)),f=a.toPixels(q(a.options.max,a.dataMax)),g=A(e,f),e=v(e,f);b.min=A(a.pos,g-d);b.max=v(a.pos+a.len,e+d)}}),b.res=!0;else if(d.length){if(!j)b.selectionMarker=j=s({destroy:ra},c.plotBox);b.pinchTranslate(d,f,k,j,m,h);b.hasPinched=i;b.scaleGroups(k,m);if(!i&&e&&g===1)this.runPointActions(b.normalize(a));else if(b.res)b.res=!1,this.reset(!1,0)}},onContainerTouchStart:function(a){var b=
this.chart;va=b.index;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){ba[va]&&ba[va].pointer.drop(a)}});if(S.PointerEvent||S.MSPointerEvent){var Aa={},Kb=!!S.PointerEvent,gc=function(){var a,b=[];b.item=function(a){return this[a]};for(a in Aa)Aa.hasOwnProperty(a)&&
b.push({pageX:Aa[a].pageX,pageY:Aa[a].pageY,target:Aa[a].target});return b},Lb=function(a,b,c,d){a=a.originalEvent||a;if((a.pointerType==="touch"||a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&ba[va])d(a),d=ba[va].pointer,d[b]({type:c,target:a.currentTarget,preventDefault:ra,touches:gc()})};s($a.prototype,{onContainerPointerDown:function(a){Lb(a,"onContainerTouchStart","touchstart",function(a){Aa[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){Lb(a,
"onContainerTouchMove","touchmove",function(a){Aa[a.pointerId]={pageX:a.pageX,pageY:a.pageY};if(!Aa[a.pointerId].target)Aa[a.pointerId].target=a.currentTarget})},onDocumentPointerUp:function(a){Lb(a,"onContainerTouchEnd","touchend",function(a){delete Aa[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,Kb?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,Kb?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(E,Kb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});
Q($a.prototype,"init",function(a,b,c){a.call(this,b,c);(this.hasZoom||this.followTouchMove)&&K(b.container,{"-ms-touch-action":$,"touch-action":$})});Q($a.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(z)});Q($a.prototype,"destroy",function(a){this.batchMSEvents(U);a.call(this)})}var sb=N.Legend=function(a,b){this.init(a,b)};sb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=q(b.padding,8),f=b.itemMarginTop||0;this.options=b;if(b.enabled)c.itemStyle=
d,c.itemHiddenStyle=y(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=q(b.symbolWidth,16),c.pages=[],c.render(),z(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},
j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g),g)d=g[j],d!==r&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b=a.checkbox;p(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});
b&&Va(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=b.translateY,p(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,K(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&g<c+d-6?"":$}))})},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;if(b.text){if(!this.title)this.title=
this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group);a=this.title.getBBox();c=a.height;this.offsetWidth=a.width;this.contentGroup.attr({translateY:c})}this.titleHeight=c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e=d.layout==="horizontal",f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?q(d.itemDistance,20):0,l=!d.rtl,m=d.width,n=d.itemMarginBottom||0,
o=this.itemMarginTop,x=this.initialItemX,p=a.legendItem,r=a.series&&a.series.drawLegendSymbol?a.series:a,w=r.options,w=this.createCheckboxForItem&&w&&w.showCheckbox,s=d.useHTML;if(!p){a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup);a.legendItem=p=c.text(d.labelFormat?Ma(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline||0,s).css(y(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup);if(!this.baseline)this.baseline=c.fontMetrics(h.fontSize,
p).f+3+o,p.attr("y",this.baseline);r.drawLegendSymbol(this,a);this.setItemEvents&&this.setItemEvents(a,p,s,h,i);this.colorizeItem(a,a.visible);w&&this.createCheckboxForItem(a)}c=p.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+k+(w?20:0);this.itemHeight=g=t(a.legendItemHeight||c.height);if(e&&this.itemX-x+f>(m||b.chartWidth-2*j-x-d.x))this.itemX=x,this.itemY+=o+this.lastLineHeight+n,this.lastLineHeight=0;this.maxItemWidth=v(this.maxItemWidth,f);this.lastItemY=o+this.itemY+
n;this.lastLineHeight=v(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=o+g+n,this.lastLineHeight=g);this.offsetWidth=m||v((e?this.itemX-x-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];p(this.chart.series,function(b){var c=b.options;if(q(c.showInLegend,!u(c.linkedTo)?r:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:b))});return a},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,
l=j.borderWidth,m=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();e=a.getAllItems();xb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;p(e,function(b){a.renderItem(b)});g=j.width||a.offsetWidth;
h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(l||m){g+=k;h+=k;if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||0,fill:m||$}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;p(e,function(b){a.positionItem(b)});f&&d.align(s({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=
this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h,i=this.clipRect,j=e.navigation,k=q(j.animation,!0),l=j.arrowSize||12,m=this.nav,n=this.pages,o,x=this.allItems;e.layout==="horizontal"&&(f/=2);g&&(f=A(f,g));n.length=0;if(a>f&&!e.useHTML){this.clipHeight=h=v(f-20-this.titleHeight-this.padding,0);this.currentPage=q(this.currentPage,1);this.fullHeight=a;p(x,function(a,b){var c=a._legendItemPos[1],d=t(a.legendItem.getBBox().height),
e=n.length;if(!e||c-n[e-1]>h&&(o||c)!==n[e-1])n.push(o||c),e++;b===x.length-1&&c+d-n[e-1]>h&&n.push(c);c!==o&&(o=c)});if(!i)i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i);i.attr({height:h});if(!m)this.nav=m=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(m),this.pager=d.text("",15,10).css(j.style).add(m),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(m);b.scroll(0);
a=f}else if(m)i.attr({height:c.chartHeight}),m.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d);if(e>0)b!==r&&ab(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),
i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};T=N.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=
this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup,a=a.baseline-t(e.fontMetrics(a.options.itemStyle.fontSize,this.legendItem).b*.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=b.dashStyle;this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0}};(/Trident\/7\.0/.test(Ga)||cb)&&Q(sb.prototype,"positionItem",function(a,
b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});ya.prototype={init:function(a,b){var c,d=a.series;a.series=null;c=y(F,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=ba.length;ba.push(f);gb++;d.reflow!==!1&&z(f,
"load",function(){f.initReflow()});if(e)for(g in e)z(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=la?!1:q(d.animation,!0);f.pointCount=f.colorCounter=f.symbolCounter=0;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=B[a.type||b.type||b.defaultSeriesType])||ma(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&p(this.axes,
function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.hasCartesianSeries,j=this.isDirtyBox,k=c.length,l=k,m=this.renderer,n=m.isHidden(),o=[];ab(a,this);n&&this.cloneRenderTo();for(this.layOutTitles();l--;)if(a=c[l],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(l=k;l--;)if(a=c[l],a.options.stacking)a.isDirty=!0;p(c,function(a){a.isDirty&&a.options.legendType==="point"&&(f=!0)});
if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(i){if(!this.isResizing)this.maxTicks=null,p(b,function(a){a.setScale()});this.adjustTickAmounts()}this.getMargins();i&&(p(b,function(a){a.isDirty&&(j=!0)}),p(b,function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=!1,o.push(function(){J(a,"afterSetExtremes",s(a.eventArgs,a.getExtremes()));delete a.eventArgs});(j||g)&&a.redraw()}));j&&this.drawChartBox();p(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});
d&&d.reset(!0);m.draw();J(this,"redraw");n&&this.cloneRenderTo(!0);p(o,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++){e=c[d].points||[];for(b=0;b<e.length;b++)if(e[b].id===a)return e[b]}return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=qa(b.xAxis||{}),b=b.yAxis=qa(b.yAxis||{});p(c,function(a,b){a.index=b;a.isX=!0});
p(b,function(a,b){a.index=b});c=c.concat(b);p(c,function(b){new D(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];p(this.series,function(b){a=a.concat(qb(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return qb(this.series,function(a){return a.selected})},getStacks:function(){var a=this;p(a.yAxis,function(a){if(a.stacks&&a.hasVisibleSeries)a.oldStacks=a.stacks});p(a.series,function(b){if(b.options.stacking&&(b.visible===!0||a.options.chart.ignoreHiddenSeries===
!1))b.stackKey=b.type+q(b.options.stack,"")})},setTitle:function(a,b,c){var g;var d=this,e=d.options,f;f=e.title=y(e.title,a);g=e.subtitle=y(e.subtitle,b),e=g;p([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy());a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,
f=e.title,e=e.subtitle,g=this.renderer,h=this.spacingBox.width-44;if(c&&(c.css({width:(f.width||h)+"px"}).align(s({y:g.fontMetrics(f.style.fontSize,c).b-3},f),!1,"spacingBox"),!f.floating&&!f.verticalAlign))b=c.getBBox().height;d&&(d.css({width:(e.width||h)+"px"}).align(s({y:b+(f.margin-13)+g.fontMetrics(f.style.fontSize,d).b},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ya(b+d.getBBox().height)));c=this.titleOffset!==b;this.titleOffset=b;if(!this.isDirtyBox&&c)this.isDirtyBox=c,this.hasRendered&&
q(a,!0)&&this.isDirtyBox&&this.redraw()},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;if(!u(b))this.containerWidth=pb(c,"width");if(!u(a))this.containerHeight=pb(c,"height");this.chartWidth=v(0,b||this.containerWidth||600);this.chartHeight=v(0,q(a,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Va(b),delete this.renderToClone):(c&&
c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),K(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),E.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+Fb++;if(Sa(a))this.renderTo=a=E.getElementById(a);a||ma(13,!0);c=H(Y(a,"data-highcharts-chart"));!isNaN(c)&&ba[c]&&ba[c].hasRendered&&
ba[c].destroy();Y(a,"data-highcharts-chart",this.index);a.innerHTML="";!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=aa(Wa,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},s({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=
b.forExport?new na(a,c,d,b.style,!0):new Za(a,c,d,b.style);la&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend,f=q(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins();b=this.axisOffset;if(k&&!u(d[0]))this.plotTop=v(this.plotTop,k+this.options.title.margin+a[0]);if(c.display&&!e.floating)if(i==="right"){if(!u(d[1]))this.marginRight=v(this.marginRight,c.legendWidth-g+f+a[1])}else if(i===
"left"){if(!u(d[3]))this.plotLeft=v(this.plotLeft,c.legendWidth+g+f+a[3])}else if(j==="top"){if(!u(d[0]))this.plotTop=v(this.plotTop,c.legendHeight+h+f+a[0])}else if(j==="bottom"&&!u(d[2]))this.marginBottom=v(this.marginBottom,c.legendHeight-h+f+a[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&p(this.axes,function(a){a.getOffset()});u(d[3])||(this.plotLeft+=b[3]);u(d[0])||(this.plotTop+=b[0]);
u(d[2])||(this.marginBottom+=b[2]);u(d[1])||(this.marginRight+=b[1]);this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||pb(d,"width"),f=c.height||pb(d,"height"),c=a?a.target:S,d=function(){if(b.container)b.setSize(e,f,!1),b.hasUserSize=null};if(!b.hasUserSize&&e&&f&&(c===S||c===E)){if(e!==b.containerWidth||f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=e;b.containerHeight=f}},initReflow:function(){var a=
this,b=function(b){a.reflow(b)};z(S,"resize",b);z(a,"destroy",function(){U(S,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&J(d,"endResize",null,function(){d.isResizing-=1})};ab(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(u(a))d.chartWidth=e=v(0,t(a)),d.hasUserSize=!!e;if(u(b))d.chartHeight=f=v(0,t(b));(Fa?rb:K)(d.container,{width:e+"px",height:f+"px"},Fa);d.setChartSize(!0);d.renderer.setSize(e,f,c);d.maxTicks=null;p(d.axes,function(a){a.isDirty=
!0;a.setScale()});p(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;J(d,"resize");Fa===!1?g():setTimeout(g,Fa&&Fa.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,j,k,l;this.plotLeft=i=t(this.plotLeft);this.plotTop=j=t(this.plotTop);this.plotWidth=k=v(0,t(d-i-this.marginRight));this.plotHeight=
l=v(0,t(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:j,width:k,height:l};d=2*V(this.plotBorderWidth/2);b=Ya(v(d,h[3])/2);c=Ya(v(d,h[0])/2);this.clipBox={x:b,y:c,width:V(this.plotSizeX-v(d,h[1])/2-b),height:v(0,V(this.plotSizeY-v(d,h[2])/2-c))};a||p(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=
this.spacing,b=this.margin;this.plotTop=q(b[0],a[0]);this.marginRight=q(b[1],a[1]);this.marginBottom=q(b[2],a[2]);this.plotLeft=q(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,m=a.plotBorderWidth||0,n,o=this.plotLeft,
x=this.plotTop,q=this.plotWidth,p=this.plotHeight,w=this.plotBox,r=this.clipRect,t=this.clipBox;n=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp({width:c-n,height:d-n}));else{e={fill:j||$};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(k)f?f.animate(w):this.plotBackground=b.rect(o,x,q,p,0).attr({fill:k}).add().shadow(a.plotShadow);if(l)h?h.animate(w):this.plotBGImage=
b.image(l,o,x,q,p).add();r?r.animate({width:t.width,height:t.height}):this.clipRect=b.clipRect(t);if(m)g?g.animate(g.crisp({x:o,y:x,width:q,height:p,strokeWidth:-m})):this.plotBorder=b.rect(o,x,q,p,0,-m).attr({stroke:a.plotBorderColor,"stroke-width":m,fill:$,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;p(["inverted","angular","polar"],function(g){c=B[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&
e--;)(c=B[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;p(b,function(a){a.linkedSeries.length=0});p(b,function(b){var d=b.options.linkedTo;if(Sa(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},renderSeries:function(){p(this.series,function(a){a.translate();a.setTooltipPoints&&a.setTooltipPoints();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&p(b.items,function(c){var d=s(b.style,
c.style),e=H(d.left)+a.plotLeft,f=H(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options;this.setTitle();this.legend=new sb(this,c.legend);this.getStacks();p(a,function(a){a.setScale()});this.getMargins();this.maxTicks=null;p(a,function(a){a.setTickPositions(!0);a.setMaxTicks()});this.adjustTickAmounts();this.getMargins();this.drawChartBox();this.hasCartesianSeries&&p(a,function(a){a.render()});
if(!this.seriesGroup)this.seriesGroup=b.g("series-group").attr({zIndex:3}).add();this.renderSeries();this.renderLabels();this.showCredits(c.credits);this.hasRendered=!0},showCredits:function(a){if(a.enabled&&!this.credits)this.credits=this.renderer.text(a.text,0,0).on("click",function(){if(a.href)location.href=a.href}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position)},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;J(a,"destroy");ba[a.index]=
r;gb--;a.renderTo.removeAttribute("data-highcharts-chart");U(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();p("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",U(d),f&&Va(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!ea&&S==S.top&&
E.readyState!=="complete"||la&&!S.canvg?(la?Vb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):E.attachEvent("onreadystatechange",function(){E.detachEvent("onreadystatechange",a.firstRender);E.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender()){a.getContainer();J(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();p(b.series||[],function(b){a.initSeries(b)});a.linkSeries();J(a,
"beforeRender");if(N.Pointer)a.pointer=new $a(a,b);a.render();a.renderer.draw();c&&c.apply(a,[a]);p(a.callbacks,function(b){b.apply(a,[a])});a.cloneRenderTo(!0);J(a,"load")}},splashArray:function(a,b){var c=b[a],c=ha(c)?c:[c,c,c,c];return[q(b[a+"Top"],c[0]),q(b[a+"Right"],c[1]),q(b[a+"Bottom"],c[2]),q(b[a+"Left"],c[3])]}};ya.prototype.callbacks=[];ga=N.CenteredSeriesMixin={getCenter:function(){var a=this.options,b=this.chart,c=2*(a.slicedOffset||0),d,e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,
a=[q(b[0],"50%"),q(b[1],"50%"),a.size||"100%",a.innerSize||0],g=A(e,f),h;return za(a,function(a,b){h=/%$/.test(a);d=b<2||b===2&&h;return(h?[e,f,g,g][b]*H(a)/100:a)+(d?c:0)})}};var Ba=function(){};Ba.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter=0;a.chart.pointCount++;return this},applyOptions:function(a,
b){var c=this.series,d=c.options.pointValKey||c.pointValKey,a=Ba.prototype.optionsToObject.call(this,a);s(this,a);this.options=this.options?s(this.options,a):a;if(d)this.y=this[d];if(this.x===r&&c)this.x=b===r?c.autoIncrement():b;return this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if(typeof a==="number"||a===null)b[d[0]]=a;else if(Ja(a)){if(a.length>e){c=typeof a[0];if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];f++}for(;g<e;)b[d[g++]]=
a[f++]}else if(typeof a==="object"){b=a;if(a.dataLabels)c._hasPointLabels=!0;if(a.marker)c._hasPointMarkers=!0}return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;if(b&&(this.setState(),ta(b,this),!b.length))a.hoverPoints=null;if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)U(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),
b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=q(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";p(b.pointArrayMap||["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return Ma(a,
{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents();a==="click"&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});J(this,a,b,c)}};var M=function(){};M.prototype={isCartesian:!0,type:"line",pointClass:Ba,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis",
"yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var c=this,d,e,f=a.series,g=function(a,b){return q(a.options.index,a._i)-q(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();s(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0});if(la)b.animation=!1;e=b.events;for(d in e)z(c,d,e[d]);if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();
p(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);if(c.isCartesian)a.hasCartesianSeries=!0;f.push(c);c._i=f.length-1;xb(f,g);this.yAxis&&xb(this.yAxis.series,g);p(f,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart,d;p(a.axisTypes||[],function(e){p(c[e],function(c){d=c.options;if(b[e]===d.index||b[e]!==r&&b[e]===d.id||b[e]===r&&d.index===0)c.series.push(a),a[e]=c,c.isDirty=!0});!a[e]&&a.optionalAxis!==e&&ma(18,!0)})},
updateParallelArrays:function(a,b){var c=a.series,d=arguments;p(c.parallelArrays,typeof b==="number"?function(d){var f=d==="y"&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=q(b,a.pointStart,0);this.pointInterval=q(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,
e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)d[c].y===null&&d.splice(c,1);d.length&&(b=[d])}else p(d,function(c,g){c.y===null?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=a;c=y(e,c.series,a);this.tooltipOptions=y(F.tooltip,F.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&
d[this.type].tooltip,a.tooltip);e.marker===null&&delete c.marker;return c},getCyclic:function(a,b,c){var d=this.userOptions,e="_"+a+"Index",f=a+"Counter";b||(u(d[e])?b=d[e]:(d[e]=b=this.chart[f]%c.length,this.chart[f]+=1),b=c[b]);this[a]=b},getColor:function(){this.options.colorByPoint||this.getCyclic("color",this.options.color||W[this.type].color,this.chart.options.colors)},getSymbol:function(){var a=this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);if(/^url/.test(this.symbol))a.radius=
0},drawLegendSymbol:T.drawLineMarker,setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,i=e.options,j=e.chart,k=null,l=e.xAxis,m=l&&!!l.categories,n=e.tooltipPoints,o=i.turboThreshold,x=this.xData,I=this.yData,t=(h=e.pointArrayMap)&&h.length,a=a||[];h=a.length;b=q(b,!0);if(d!==!1&&h&&g===h&&!e.cropped&&!e.hasGroupedData)p(a,function(a,b){f[b].update(a,!1,null,!1)});else{e.xIncrement=null;e.pointRange=m?1:i.pointRange;e.colorCounter=0;p(this.parallelArrays,function(a){e[a+"Data"].length=
0});if(o&&h>o){for(c=0;k===null&&c<h;)k=a[c],c++;if(pa(k)){m=q(i.pointStart,0);i=q(i.pointInterval,1);for(c=0;c<h;c++)x[c]=m,I[c]=a[c],m+=i;e.xIncrement=m}else if(Ja(k))if(t)for(c=0;c<h;c++)i=a[c],x[c]=i[0],I[c]=i.slice(1,t+1);else for(c=0;c<h;c++)i=a[c],x[c]=i[0],I[c]=i[1];else ma(12)}else for(c=0;c<h;c++)if(a[c]!==r&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,c),m&&i.name))l.names[i.x]=i.name;Sa(I[0])&&ma(14,!0);e.data=[];e.options.data=a;for(c=g;c--;)f[c]&&
f[c].destroy&&f[c].destroy();if(n)n.length=0;if(l)l.minRange=l.userMinRange;e.isDirty=e.isDirtyData=j.isDirtyBox=!0;c=!1}b&&j.redraw(c)},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,i,j=this.options;i=j.cropThreshold;var k=0,l=this.isCartesian,m,n;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(h)m=h.getExtremes(),n=m.min,m=m.max;if(l&&this.sorted&&(!i||d>i||this.forceCrop))if(b[d-1]<n||b[0]>m)b=[],c=[];else if(b[0]<n||b[d-1]>m)e=
this.cropData(this.xData,this.yData,n,m),b=e.xData,c=e.yData,e=e.start,f=!0,k=b.length;for(i=b.length-1;i>=0;i--)d=b[i]-b[i-1],!f&&b[i]>n&&b[i]<m&&k++,d>0&&(g===r||d<g)?g=d:d<0&&this.requireSorting&&ma(15);this.cropped=f;this.cropStart=e;this.processedXData=b;this.processedYData=c;this.activePointCount=k;if(j.pointRange===null)this.pointRange=g||1;this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,h=q(this.cropShoulder,1),i;for(i=0;i<e;i++)if(a[i]>=c){f=v(0,i-h);break}for(;i<
e;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],m;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(m=0;m<g;m++)i=h+m,j?l[m]=(new f).init(this,[d[m]].concat(qa(e[m]))):(b[i]?k=b[i]:a[i]!==r&&(b[i]=k=(new f).init(this,a[i],d[m])),l[m]=k),l[m].index=i;if(b&&(g!==(c=b.length)||
j))for(m=0;m<c;m++)if(m===h&&!j&&(m+=g),b[m])b[m].destroyElements(),b[m].plotX=r;this.data=b;this.points=l},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var g=d.min,h=d.max,i,j,k,l,a=a||this.stackedYData||this.processedYData;d=a.length;for(l=0;l<d;l++)if(j=c[l],k=a[l],i=k!==null&&k!==r&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)k[i]!==null&&(e[f++]=k[i]);else e[f++]=
k;this.dataMin=q(void 0,Ua(e));this.dataMax=q(void 0,Ea(e))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||pa(i),k=a.threshold,a=0;a<g;a++){var l=f[a],m=l.x,n=l.y,o=l.low,x=b&&e.stacks[(this.negStacks&&n<k?"-":"")+this.stackKey];if(e.isLog&&n<=0)l.y=n=null,ma(10);l.plotX=c.translate(m,0,0,0,1,i,this.type===
"flags");if(b&&this.visible&&x&&x[m])x=x[m],n=x.points[this.index+","+a],o=n[0],n=n[1],o===0&&(o=q(k,e.min)),e.isLog&&o<=0&&(o=null),l.total=l.stackTotal=x.total,l.percentage=x.total&&l.y/x.total*100,l.stackY=n,x.setOffset(this.pointXOffset||0,this.barW||0);l.yBottom=u(o)?e.translate(o,0,1,0,1):null;h&&(n=this.modifyValue(n,l));l.plotY=typeof n==="number"&&n!==Infinity?e.translate(n,0,1,0,1):r;l.clientX=j?c.translate(m,0,0,0,1):l.plotX;l.negative=l.y<(k||0);l.category=d&&d[l.x]!==r?d[l.x]:l.x}this.getSegments()},
animate:function(a){var b=this.chart,c=b.renderer,d;d=this.options.animation;var e=this.clipBox||b.clipBox,f=b.inverted,g;if(d&&!ha(d))d=W[this.type].animation;g=["_sharedClip",d.duration,d.easing,e.height].join(",");a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(s(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+
99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;if(c&&this.options.clip!==!1){if(!b||!d)c.clip(d?a.renderer.clipRect(d):a.clipRect);this.markerGroup.clip()}J(this,"afterAnimate");setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,b=this.points,c=this.chart,d,e,f,g,h,i,j,k,l=this.options.marker,m=this.pointAttr[""],n,o,x,p=this.markerGroup,oa=q(l.enabled,
!this.requireSorting||this.activePointCount<.5*this.xAxis.len/l.radius);if(l.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=V(g.plotX),e=g.plotY,k=g.graphic,n=g.marker||{},o=!!g.marker,a=oa&&n.enabled===r||n.enabled,x=c.isInsidePlot(t(d),e,c.inverted),a&&e!==r&&!isNaN(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""]||m,h=a.r,i=q(n.symbol,this.symbol),j=i.indexOf("url")===0,k)k[x?"show":"hide"](!0).animate(s({x:d-h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{}));else{if(x&&
(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h,o?n:l).attr(a).add(p)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=q(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=W[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color;f={stroke:g,fill:g};var h=a.points||[],i,j=[],k,l=a.pointAttrToOptions;k=a.hasPointSpecificOptions;var m=b.negativeColor,n=
c.lineColor,o=c.fillColor;i=b.turboThreshold;var q;b.marker?(e.radius=e.radius||c.radius+e.radiusPlus,e.lineWidth=e.lineWidth||c.lineWidth+e.lineWidthPlus):e.color=e.color||Ia(e.color||g).brighten(e.brightness).get();j[""]=a.convertAttribs(c,f);p(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])});a.pointAttr=j;g=h.length;if(!i||g<i||k)for(;g--;){i=h[g];if((c=i.options&&i.options.marker||i.options)&&c.enabled===!1)c.radius=0;if(i.negative&&m)i.color=i.fillColor=m;k=b.colorByPoint||
i.color;if(i.options)for(q in l)u(c[l[q]])&&(k=!0);if(k){c=c||{};k=[];d=c.states||{};f=d.hover=d.hover||{};if(!b.marker)f.color=f.color||!i.options.color&&e.color||Ia(i.color).brighten(f.brightness||e.brightness).get();f={color:i.color};if(!o)f.fillColor=i.color;if(!n)f.lineColor=i.color;k[""]=a.convertAttribs(s(f,c),j[""]);k.hover=a.convertAttribs(d.hover,j.hover,k[""]);k.select=a.convertAttribs(d.select,j.select,k[""])}else k=j;i.pointAttr=k}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(Ga),
d,e,f=a.data||[],g,h,i;J(a,"destroy");U(a);p(a.axisTypes||[],function(b){if(i=a[b])ta(i.series,a),i.isDirty=i.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);p("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&b==="group"?"hide":"destroy",a[b][d]())});if(b.hoverSeries===a)b.hoverSeries=null;ta(b.series,a);for(h in a)delete a[h]},
getSegmentPath:function(a){var b=this,c=[],d=b.options.step;p(a,function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=this,b=[],c,d=[];p(a.segments,function(e){c=a.getSegmentPath(e);e.length>1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=
b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f=b.linecap!=="square",g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]);p(c,function(c,h){var k=c[0],l=a[k];if(l)hb(l),l.animate({d:g});else if(d&&g.length)l={stroke:c[1],"stroke-width":d,fill:$,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&b.shadow)})},clipNeg:function(){var a=
this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=v(e,j),l=this.yAxis;if(d&&(f||g)){d=t(l.toPixels(a.threshold||0,!0));d<0&&(k-=d);a={x:0,y:0,width:k,height:d};k={x:0,y:d,width:k,height:k};if(b.inverted)a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e});l.reversed?(b=k,e=a):(b=a,e=k);h?
(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i)))}},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};p(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)z(c,"resize",a),z(b,"destroy",function(){U(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a],g=!f;g&&(this[a]=
f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&q(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,h=a.hasRendered,i=b.seriesGroup;
c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),a.clipNeg());p(a.points,function(a){a.redraw&&a.redraw()});a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect);e&&a.animate();if(!h)e?a.animationTimeout=
setTimeout(function(){a.afterAnimate()},e):a.afterAnimate();a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:q(d&&d.left,a.plotLeft),translateY:q(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();b&&J(this,"updatedData")}};Rb.prototype={destroy:function(){Na(this,this.axis)},
render:function(a){var b=this.options,c=b.format,c=c?Ma(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=P(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,
f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};if(e=this.label)e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0)}};D.prototype.buildStacks=function(){var a=this.series,b=q(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}};D.prototype.renderStackTotals=function(){var a=
this.chart,b=a.renderer,c=this.stacks,d,e,f=this.stackTotalGroup;if(!f)this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d],a)a[e].render(f)};M.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,
i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,m=k.oldStacks,n,o,q,p,r,w;for(p=0;p<d;p++){r=a[p];w=b[p];q=this.index+","+p;o=(n=j&&w<f)?i:h;l[o]||(l[o]={});if(!l[o][r])m[o]&&m[o][r]?(l[o][r]=m[o][r],l[o][r].total=null):l[o][r]=new Rb(k,k.options.stackLabels,n,r,g);o=l[o][r];o.points[q]=[o.cum||0];e==="percent"?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],o.total=n.total=v(n.total,o.total)+P(w)||0):o.total=ja(o.total+(P(w)||0))):o.total=ja(o.total+(w||0));o.cum=(o.cum||0)+(w||0);o.points[q].push(o.cum);
c[p]=o.cum}if(e==="percent")k.usePercentage=!0;this.stackedYData=c;k.oldStacks={}}};M.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;p([b,"-"+b],function(b){var e;for(var f=d.length,g,h;f--;)if(g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],g=e)h=h.total?100/h.total:0,g[0]=ja(g[0]*h),g[1]=ja(g[1]*h),a.stackedYData[f]=g[1]})};s(ya.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=q(b,!0),J(e,"addSeries",{options:a},function(){d=e.initSeries(a);
e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new D(this,y(a,{index:this[e].length,isX:b}));f[e]=qa(f[e]||{});f[e].push(a);q(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=c.loading,f=function(){d&&K(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};if(!d)b.loadingDiv=d=aa(Wa,{className:"highcharts-loading"},s(e.style,{zIndex:10,display:$}),
b.container),b.loadingSpan=aa("span",null,e.labelStyle,d),z(b,"redraw",f);b.loadingSpan.innerHTML=a||c.lang.loading;if(!b.loadingShown)K(d,{opacity:0,display:""}),rb(d,{opacity:e.style.opacity},{duration:e.showDuration||0}),b.loadingShown=!0;f()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&rb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){K(b,{display:$})}});this.loadingShown=!1}});s(Ba.prototype,{update:function(a,b,c,d){function e(){f.applyOptions(a);
if(ha(a)&&!Ja(a))f.redraw=function(){if(h)a&&a.marker&&a.marker.symbol?f.graphic=h.destroy():h.attr(f.pointAttr[f.state||""]);if(a&&a.dataLabels&&f.dataLabel)f.dataLabel=f.dataLabel.destroy();f.redraw=null};i=f.index;g.updateParallelArrays(f,i);k.data[i]=f.options;g.isDirty=g.isDirtyData=!0;if(!g.fixedBox&&g.hasCartesianSeries)j.isDirtyBox=!0;k.legendType==="point"&&j.legend.destroyItem(f);b&&j.redraw(c)}var f=this,g=f.series,h=f.graphic,i,j=g.chart,k=g.options,b=q(b,!0);d===!1?e():f.firePointEvent("update",
{options:a},e)},remove:function(a,b){var c=this,d=c.series,e=d.points,f=d.chart,g,h=d.data;ab(b,f);a=q(a,!0);c.firePointEvent("remove",null,function(){g=Qa(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.updateParallelArrays(c,"splice",g,1);c.destroy();d.isDirty=!0;d.isDirtyData=!0;a&&f.redraw()})}});s(M.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,
m,n=this.xData;ab(d,i);c&&p([g,h,this.graphNeg,this.areaNeg],function(a){if(a)a.shift=k+1});if(h)h.isArea=!0;b=q(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=n.length;if(this.requireSorting&&g<n[h-1])for(m=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0);this.updateParallelArrays(d,h);if(j&&d.name)j[g]=d.name;l.splice(h,0,a);m&&(this.data.splice(h,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):
(f.shift(),this.updateParallelArrays(d,"shift"),l.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=q(a,!0);if(!c.isRemoving)c.isRemoving=!0,J(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)});c.isRemoving=!1},update:function(a,b){var c=this,d=this.chart,e=this.userOptions,f=this.type,g=B[f].prototype,h=["group","markerGroup","dataLabelsGroup"],i;p(h,function(a){h[a]=c[a];delete c[a]});
a=y(e,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1);for(i in g)g.hasOwnProperty(i)&&(this[i]=r);s(this,B[a.type||f].prototype);p(h,function(a){c[a]=h[a]});this.init(d,a);d.linkSeries();q(b,!0)&&d.redraw(!1)}});s(D.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=y(this.userOptions,a);this.destroy(!0);this._addedPlotLB=r;this.init(c,s(a,{events:r}));c.isDirtyBox=!0;q(b,!0)&&c.redraw()},remove:function(a){for(var b=
this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);ta(b.axes,this);ta(b[c],this);b.options[c].splice(this.options.index,1);p(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;q(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}});var Ca=ia(M);B.line=Ca;W.area=y(L,{threshold:0});var wa=ia(M,{type:"area",getSegments:function(){var a=this,b=[],c=[],d=[],e=this.xAxis,f=this.yAxis,g=
f.stacks[this.stackKey],h={},i,j,k=this.points,l=this.options.connectNulls,m,n;if(this.options.stacking&&!this.cropped){for(m=0;m<k.length;m++)h[k[m].x]=k[m];for(n in g)g[n].total!==null&&d.push(+n);d.sort(function(a,b){return a-b});p(d,function(b){var d=0,k;if(!l||h[b]&&h[b].y!==null)if(h[b])c.push(h[b]);else{for(m=a.index;m<=f.series.length;m++)if(k=g[b].points[m+","+b]){d=k[1];break}i=e.translate(b);j=f.toPixels(d,!0);c.push({y:null,plotX:i,clientX:i,plotY:j,yBottom:j,onMouseOver:ra})}});c.length&&
b.push(c)}else M.prototype.getSegments.call(this),b=this.segments;this.segments=b},getSegmentPath:function(a){var b=M.prototype.getSegmentPath.call(this,a),c=[].concat(b),d,e=this.options;d=b.length;var f=this.yAxis.getThreshold(e.threshold),g;d===3&&c.push("L",b[1],b[2]);if(e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=q(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);this.areaPath=this.areaPath.concat(c);return b},closeSegment:function(a,
b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[];M.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]);p(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:q(d[2],Ia(d[1]).setOpacity(q(c.fillOpacity,.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:T.drawRectangle});B.area=wa;
W.spline=y(L);Ca=ia(M,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,k;if(f&&g){a=f.plotY;j=g.plotX;var g=g.plotY,l;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;k=(1.5*e+g)/2.5;l=(k-i)*(j-d)/(j-h)+e-k;i+=l;k+=l;i>a&&i>e?(i=v(a,e),k=2*e-i):i<a&&i<e&&(i=A(a,e),k=2*e-i);k>g&&k>e?(k=v(g,e),i=2*e-k):k<g&&k<e&&(k=A(g,e),i=2*e-k);b.rightContX=j;b.rightContY=k}c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=
null):b=["M",d,e];return b}});B.spline=Ca;W.areaspline=y(W.area);wa=wa.prototype;Ca=ia(Ca,{type:"areaspline",closedStacks:!0,getSegmentPath:wa.getSegmentPath,closeSegment:wa.closeSegment,drawGraph:wa.drawGraph,drawLegendSymbol:T.drawRectangle});B.areaspline=Ca;W.column=y(L,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},
dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},threshold:0});Ca=ia(M,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){M.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){if(b.type===a.type)b.isDirty=!0})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,
f,g={},h,i=0;b.grouping===!1?i=1:p(a.chart.series,function(b){var c=b.options,e=b.yAxis;if(b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos)c.stacking?(f=b.stackKey,g[f]===r&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h});var c=A(P(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=u(l)?(k-l)/2:k*b.pointPadding,l=q(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):
a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=q(c.borderWidth,a.activePointCount>.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=q(c.minPointLength,5),h=a.getColumnMetrics(),i=h.width,j=a.barW=v(i,1+2*d),k=a.pointXOffset=h.offset,l=-(d%2?.5:0),m=d%2?.5:1;b.renderer.isVML&&b.inverted&&(m+=1);c.pointPadding&&(j=Ya(j));M.prototype.translate.apply(a);p(a.points,function(c){var d=q(c.yBottom,f),h=A(v(-999-
d,c.plotY),e.len+999+d),p=c.plotX+k,r=j,w=A(h,d),s;s=v(h,d)-w;P(s)<g&&g&&(s=g,w=t(P(w-f)>g?d-g:f-(e.translate(c.y,0,1,0,1)<=f?g:0)));c.barX=p;c.pointWidth=i;c.tooltipPos=b.inverted?[e.len-h,a.xAxis.len-p-r/2]:[p+r/2,h+e.pos-b.plotTop];r=t(p+r)+l;p=t(p)+l;r-=p;d=P(w)<.5;s=t(w+s)+m;w=t(w)+m;s-=w;d&&(w-=1,s+=1);c.shapeType="rect";c.shapeArgs={x:p,y:w,width:r,height:s}})},getSymbol:ra,drawLegendSymbol:T.drawRectangle,drawGraph:ra,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,
e=c.animationLimit||250,f,g;p(a.points,function(h){var i=h.plotY,j=h.graphic;if(i!==r&&!isNaN(i)&&h.y!==null)f=h.shapeArgs,i=u(a.borderWidth)?{"stroke-width":a.borderWidth}:{},g=h.pointAttr[h.selected?"select":""]||a.pointAttr[""],j?(hb(j),j.attr(i)[b.pointCount<e?"animate":"attr"](y(f))):h.graphic=d[h.shapeType](f).attr(g).attr(i).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius);else if(j)h.graphic=j.destroy()})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,
e={};if(ea)a?(e.scaleY=.001,a=A(b.pos+b.len,v(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null)},remove:function(){var a=this,b=a.chart;b.hasRendered&&p(b.series,function(b){if(b.type===a.type)b.isDirty=!0});M.prototype.remove.apply(a,arguments)}});B.column=Ca;W.bar=y(W.column);wa=ia(Ca,{type:"bar",inverted:!0});B.bar=wa;W.scatter=y(L,{lineWidth:0,
tooltip:{headerFormat:'<span style="color:{series.color}">\u25cf</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},stickyTracking:!1});wa=ia(M,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&M.prototype.drawGraph.call(this)}});B.scatter=wa;W.pie=y(L,{borderColor:"#FFFFFF",
borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});L={type:"pie",isCartesian:!1,pointClass:ia(Ba,{init:function(){Ba.prototype.init.apply(this,arguments);var a=this,b;if(a.y<0)a.y=null;s(a,{visible:a.visible!==!1,name:q(a.name,"Slice")});
b=function(b){a.slice(b.type==="select")};z(a,"select",b);z(a,"unselect",b);return a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===r?!b.visible:a;c.options.data[Qa(b,c.data)]=b.options;p(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?"show":"hide"](!0)});b.legendItem&&d.legend.colorizeItem(b,a);if(!c.isDirty&&c.options.ignoreHiddenPoint)c.isDirty=!0,d.redraw()},slice:function(a,b,c){var d=this.series;ab(c,d.chart);q(b,!0);this.sliced=
this.options.sliced=a=u(a)?a:!this.sliced;d.options.data[Qa(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group",
"dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:ra,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;if(!a)p(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null},setData:function(a,b,c,d){M.prototype.setData.call(this,a,!1,c,d);this.processData();this.generatePoints();q(b,!0)&&
this.chart.redraw(c)},generatePoints:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;M.prototype.generatePoints.call(this);c=this.points;d=c.length;for(a=0;a<d;a++)e=c[a],b+=f&&!e.visible?0:e.y;this.total=b;for(a=0;a<d;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=ua/180*(i-90),i=(this.endAngleRad=ua/180*(q(c.endAngle,i+360)-90))-j,k=this.points,
l=c.dataLabels.distance,c=c.ignoreHiddenPoint,m,n=k.length,o;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=X.asin(A((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*fa(h)*(a[2]/2+l)};for(m=0;m<n;m++){o=k[m];f=j+b*i;if(!c||o.visible)b+=o.percentage/100;g=j+b*i;o.shapeType="arc";o.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:t(f*1E3)/1E3,end:t(g*1E3)/1E3};h=(g+f)/2;h>1.5*ua?h-=2*ua:h<-ua/2&&(h+=2*ua);o.slicedTranslation={translateX:t(fa(h)*d),translateY:t(ka(h)*d)};f=fa(h)*a[2]/
2;g=ka(h)*a[2]/2;o.tooltipPos=[a[0]+f*.7,a[1]+g*.7];o.half=h<-ua/2||h>ua/2?1:0;o.angle=h;e=A(e,l/2);o.labelPos=[a[0]+f+fa(h)*l,a[1]+g+ka(h)*l,a[0]+f+fa(h)*e,a[1]+g+ka(h)*e,a[0]+f,a[1]+g,l<0?"center":o.half?"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);p(a.points,function(h){d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);
c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(s(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f);h.visible!==void 0&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:T.drawRectangle,getCenter:ga.getCenter,getSymbol:ra};L=ia(M,L);B.pie=L;M.prototype.drawDataLabels=
function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h=a.hasRendered||0,i,j;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),j=a.plotGroup("dataLabelsGroup","data-labels",d.defer?"hidden":"visible",d.zIndex||6),q(d.defer,!0)&&(j.attr({opacity:+h}),h||z(a,"afterAnimate",function(){a.visible&&j.show();j[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,p(e,function(b){var e,h=b.dataLabel,n,o,p=b.connector,t=!0;f=b.options&&b.options.dataLabels;
e=q(f&&f.enabled,g.enabled);if(h&&!e)b.dataLabel=h.destroy();else if(e){d=y(g,f);e=d.rotation;n=b.getLabelConfig();i=d.format?Ma(d.format,n):d.formatter.call(n,d);d.style.color=q(d.color,d.style.color,a.color,"black");if(h)if(u(i))h.attr({text:i}),t=!1;else{if(b.dataLabel=h=h.destroy(),p)b.connector=p.destroy()}else if(u(i)){h={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(o in h)h[o]===r&&delete h[o];h=b.dataLabel=
a.chart.renderer[e?"text":"label"](i,0,-999,null,null,null,d.useHTML).attr(h).css(s(d.style,c&&{cursor:c})).add(j).shadow(d.shadow)}h&&a.alignDataLabel(b,h,d,null,t)}})};M.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=q(a.plotX,-999),i=q(a.plotY,-999),j=b.getBBox();if(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,t(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))d=s({x:g?f.plotWidth-i:h,y:t(g?f.plotHeight-h:i),width:0,height:0},d),s(c,{width:j.width,height:j.height}),
c.rotation?b[e?"attr":"animate"]({x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2}).attr({align:c.align}):(b.align(c,null,d),g=b.alignAttr,q(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,c,g,j,d,e):q(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)));if(!a)b.attr({y:-999}),b.placed=!1};M.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k;j=c.x;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width;if(j>g.plotWidth)h===
"left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height;if(j>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0;if(k)a.placed=!f,a.align(b,null,e)};if(B.pie)B.pie.prototype.drawDataLabels=function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=q(e.connectorPadding,10),g=q(e.connectorWidth,1),h=d.plotWidth,i=d.plotHeight,j,k,l=q(e.softConnector,!0),m=e.distance,n=a.center,o=n[2]/2,x=n[1],r=m>0,s,w,u,y=
[[],[]],z,O,E,G,C,R=[0,0,0,0],H=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){M.prototype.drawDataLabels.apply(a);p(b,function(a){a.dataLabel&&a.visible&&y[a.half].push(a)});for(G=2;G--;){var B=[],K=[],F=y[G],J=F.length,D;if(J){a.sortByAngle(F,G-.5);for(C=b=0;!b&&F[C];)b=F[C]&&F[C].dataLabel&&(F[C].dataLabel.getBBox().height||21),C++;if(m>0){w=A(x+o+m,d.plotHeight);for(C=v(0,x-o-m);C<=w;C+=b)B.push(C);w=B.length;if(J>w){c=[].concat(F);c.sort(H);for(C=J;C--;)c[C].rank=
C;for(C=J;C--;)F[C].rank>=w&&F.splice(C,1);J=F.length}for(C=0;C<J;C++){c=F[C];u=c.labelPos;c=9999;var N,L;for(L=0;L<w;L++)N=P(B[L]-u[1]),N<c&&(c=N,D=L);if(D<C&&B[C]!==null)D=C;else for(w<J-C+D&&B[C]!==null&&(D=w-J+C);B[D]===null;)D++;K.push({i:D,y:B[D]});B[D]=null}K.sort(H)}for(C=0;C<J;C++){c=F[C];u=c.labelPos;s=c.dataLabel;E=c.visible===!1?"hidden":"visible";c=u[1];if(m>0){if(w=K.pop(),D=w.i,O=w.y,c>O&&B[D+1]!==null||c<O&&B[D-1]!==null)O=A(v(0,c),d.plotHeight)}else O=c;z=e.justify?n[0]+(G?-1:1)*
(o+m):a.getX(O===x-o-m||O===x+o+m?c:O,G);s._attr={visibility:E,align:u[6]};s._pos={x:z+e.x+({left:f,right:-f}[u[6]]||0),y:O+e.y-10};s.connX=z;s.connY=O;if(this.options.size===null)w=s.width,z-w<f?R[3]=v(t(w-z+f),R[3]):z+w>h-f&&(R[1]=v(t(z+w-h+f),R[1])),O-b/2<0?R[0]=v(t(-O+b/2),R[0]):O+b/2>i&&(R[2]=v(t(O+b/2-i),R[2]))}}}if(Ea(R)===0||this.verifyDataLabelOverflow(R))this.placeDataLabels(),r&&g&&p(this.points,function(b){j=b.connector;u=b.labelPos;if((s=b.dataLabel)&&s._pos)E=s._attr.visibility,z=s.connX,
O=s.connY,k=l?["M",z+(u[6]==="left"?5:-5),O,"C",z,O,2*u[2]-u[4],2*u[3]-u[5],u[2],u[3],"L",u[4],u[5]]:["M",z+(u[6]==="left"?5:-5),O,"L",u[2],u[3],"L",u[4],u[5]],j?(j.animate({d:k}),j.attr("visibility",E)):b.connector=j=a.chart.renderer.path(k).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:E}).add(a.dataLabelsGroup);else if(j)b.connector=j.destroy()})}},B.pie.prototype.placeDataLabels=function(){p(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),
a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},B.pie.prototype.alignDataLabel=ra,B.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize||80,f;d[0]!==null?e=v(b[2]-v(a[1],a[3]),c):(e=v(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);d[1]!==null?e=v(A(e,b[2]-v(a[0],a[2])),c):(e=v(A(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);e<b[2]?(b[2]=e,this.translate(b),p(this.points,function(a){if(a.dataLabel)a.dataLabel._pos=null}),this.drawDataLabels&&
this.drawDataLabels()):f=!0;return f};if(B.column)B.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>q(this.translatedThreshold,f.plotSizeY),j=q(c.inside,!!this.options.stacking);if(h&&(d=y(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j))g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0);c.align=q(c.align,!g||j?"center":i?"right":"left");c.verticalAlign=q(c.verticalAlign,
g||j?"middle":i?"top":"bottom");M.prototype.alignDataLabel.call(this,a,b,c,d,e)};var jb=N.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();for(;d&&!e;)e=d.point,d=d.parentNode;if(e!==r&&e!==b.hoverPoint)e.onMouseOver(c)};p(a.points,function(a){if(a.graphic)a.graphic.element.point=a;if(a.dataLabel)a.dataLabel.element.point=a});if(!a._hasTracking)p(a.trackerGroups,function(b){if(a[b]&&
(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),db))a[b].on("touchstart",f)}),a._hasTracking=!0},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,m,n=function(){if(f.hoverSeries!==a)a.onMouseOver()},o="rgba(192,192,192,"+(ea?1E-4:.002)+")";if(e&&!c)for(m=
e+1;m--;)d[m]==="M"&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&d[m]==="M"||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:o,fill:c?o:$,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),p([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l);
if(db)a.on("touchstart",n)}))}};if(B.column)Ca.prototype.drawTracker=jb.drawTrackerPoint;if(B.pie)B.pie.prototype.drawTracker=jb.drawTrackerPoint;if(B.scatter)wa.prototype.drawTracker=jb.drawTrackerPoint;s(sb.prototype,{setItemEvents:function(a,b,c,d,e){var f=this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e);a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};
a.firePointEvent?a.firePointEvent("legendItemClick",b,c):J(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=aa("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);z(a.checkbox,"click",function(b){J(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}});F.legend.itemStyle.cursor="pointer";s(ya.prototype,{showResetZoom:function(){var a=this,b=F.lang,c=a.options.chart.resetZoomButton,d=
c.theme,e=d.states,f=c.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;J(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?p(this.axes,function(a){b=a.zoom()}):p(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?
"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;if(d&&!e)this.showResetZoom();else if(!d&&ha(e))this.resetZoomButton=e.destroy();b&&this.redraw(q(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&p(d,function(a){a.setState()});p(b==="xy"?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),
l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>A(k.dataMin,k.min)&&i<v(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);K(c.container,{cursor:"move"})}});s(Ba.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=q(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[Qa(c,d.data)]=c.options;c.setState(a&&
"select");b||p(e.getSelectedPoints(),function(a){if(a.selected&&a!==c)a.selected=a.options.selected=!1,d.options.data[Qa(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect")})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a);this.setState("hover");c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");
if(!b||Qa(this,b)===-1)this.setState(),a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=y(this.series.options.point,this.options).events,b;this.events=a;for(b in a)z(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=W[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,o,a=a||"";o=this.pointAttr[a]||
e.pointAttr[a];if(!(a===this.state&&!b||this.selected&&a!=="select"||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1)){if(this.graphic)g=g&&this.graphic.symbolName&&o.r,this.graphic.attr(y(o,g?{x:c-g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide();else{if(a&&i)if(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k)k[b?"animate":"attr"]({x:c-g,y:d-g});else if(l)e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(o).add(e.markerGroup),
k.currentSymbol=l;if(k)k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()}if((c=f[a]&&f[a].halo)&&c.size){if(!n)e.halo=n=m.renderer.path().add(e.seriesGroup);n.attr(s({fill:Ia(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?"animate":"attr"]({d:this.haloPath(c.size)})}else n&&n.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+
(e?b.xAxis.len-this.plotX:this.plotY)-a,a*2,a*2)}});s(M.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&J(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&a.events.mouseOut&&J(this,"mouseOut");c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide();this.setState();b.hoverSeries=null},setState:function(a){var b=
this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";if(this.state!==a)this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+(e[a].lineWidthPlus||0)),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),d&&d.attr(a)))},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===r?!h:a)?"show":"hide";p(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});
if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&p(d.series,function(a){if(a.options.stacking&&a.visible)a.isDirty=!0});p(c.linkedSeries,function(b){b.setVisible(a,!1)});if(g)d.isDirtyBox=!0;b!==!1&&d.redraw();J(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,h,i,j=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){if(a)this.tooltipPoints=null;p(this.segments||
this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(i=0;i<a;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max){h=b[i+1];c=d===r?0:d+1;for(d=b[i+1]?A(v(0,V((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===r?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;
J(this,a?"select":"unselect")},drawTracker:jb.drawTrackerGraph});Q(M.prototype,"init",function(a){var b;a.apply(this,Array.prototype.slice.call(arguments,1));(b=this.xAxis)&&b.options.ordinal&&z(this,"updatedData",function(){delete b.ordinalIndex})});Q(D.prototype,"getTimeTicks",function(a,b,c,d,e,f,g,h){var i=0,j=0,k,l={},m,n,o,p=[],q=-Number.MAX_VALUE,t=this.options.tickPixelInterval;if(!this.options.ordinal||!f||f.length<3||c===r)return a.call(this,b,c,d,e);for(n=f.length;j<n;j++){o=j&&f[j-1]>
d;f[j]<c&&(i=j);if(j===n-1||f[j+1]-f[j]>g*5||o){if(f[j]>q){for(k=a.call(this,b,f[i],f[j],e);k.length&&k[0]<=q;)k.shift();k.length&&(q=k[k.length-1]);p=p.concat(k)}i=j+1}if(o)break}a=k.info;if(h&&a.unitRange<=G.hour){j=p.length-1;for(i=1;i<j;i++)(new ca(p[i]-Oa))[Xa]()!==(new ca(p[i-1]-Oa))[Xa]()&&(l[p[i]]="day",m=!0);m&&(l[p[0]]="day");a.higherRanks=l}p.info=a;if(h&&u(t)){var h=a=p.length,j=[],w;for(m=[];h--;)i=this.translate(p[h]),w&&(m[h]=w-i),j[h]=w=i;m.sort();m=m[V(m.length/2)];m<t*.6&&(m=null);
h=p[a-1]>d?a-1:a;for(w=void 0;h--;)i=j[h],d=w-i,w&&d<t*.8&&(m===null||d<m*.8)?(l[p[h]]&&!l[p[h+1]]?(d=h+1,w=i):d=h,p.splice(d,1)):w=i}return p});s(D.prototype,{beforeSetTickPositions:function(){var a,b=[],c=!1,d,e=this.getExtremes(),f=e.min,e=e.max,g;if(this.options.ordinal){p(this.series,function(c,d){if(c.visible!==!1&&c.takeOrdinalPosition!==!1&&(b=b.concat(c.processedXData),a=b.length,b.sort(function(a,b){return a-b}),a))for(d=a-1;d--;)b[d]===b[d+1]&&b.splice(d,1)});a=b.length;if(a>2){d=b[1]-
b[0];for(g=a-1;g--&&!c;)b[g+1]-b[g]!==d&&(c=!0);if(!this.options.keepOrdinalPadding&&(b[0]-f>d||e-b[b.length-1]>d))c=!0}c?(this.ordinalPositions=b,c=this.val2lin(v(f,b[0]),!0),d=v(this.val2lin(A(e,b[b.length-1]),!0),1),this.ordinalSlope=e=(e-f)/(d-c),this.ordinalOffset=f-c*e):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=r}this.groupIntervalFactor=null},val2lin:function(a,b){var c=this.ordinalPositions;if(c){var d=c.length,e,f;for(e=d;e--;)if(c[e]===a){f=e;break}for(e=d-1;e--;)if(a>c[e]||
e===0){c=(a-c[e])/(c[e+1]-c[e]);f=e+c;break}return b?f:this.ordinalSlope*(f||0)+this.ordinalOffset}else return a},lin2val:function(a,b){var c=this.ordinalPositions;if(c){var d=this.ordinalSlope,e=this.ordinalOffset,f=c.length-1,g,h;if(b)a<0?a=c[0]:a>f?a=c[f]:(f=V(a),h=a-f);else for(;f--;)if(g=d*f+e,a>=g){d=d*(f+1)+e;h=(a-g)/(d-g);break}return h!==r&&c[f]!==r?c[f]+(h?h*(c[f+1]-c[f]):0):a}else return a},getExtendedPositions:function(){var a=this.chart,b=this.series[0].currentDataGrouping,c=this.ordinalIndex,
d=b?b.count+b.unitName:"raw",e=this.getExtremes(),f,g;if(!c)c=this.ordinalIndex={};if(!c[d])f={series:[],getExtremes:function(){return{min:e.dataMin,max:e.dataMax}},options:{ordinal:!0},val2lin:D.prototype.val2lin},p(this.series,function(c){g={xAxis:f,xData:c.xData,chart:a,destroyGroupedData:ra};g.options={dataGrouping:b?{enabled:!0,forced:!0,approximation:"open",units:[[b.unitName,[b.count]]]}:{enabled:!1}};c.processData.apply(g);f.series.push(g)}),this.beforeSetTickPositions.apply(f),c[d]=f.ordinalPositions;
return c[d]},getGroupIntervalFactor:function(a,b,c){var d=0,c=c.processedXData,e=c.length,f=[],g=this.groupIntervalFactor;if(!g){for(;d<e-1;d++)f[d]=c[d+1]-c[d];f.sort(function(a,b){return a-b});d=f[V(e/2)];a=v(a,c[0]);b=A(b,c[e-1]);this.groupIntervalFactor=g=e*d/(b-a)}return g},postProcessTickInterval:function(a){var b=this.ordinalSlope;return b?a/(b/this.closestPointRange):a}});Q(ya.prototype,"pan",function(a,b){var c=this.xAxis[0],d=b.chartX,e=!1;if(c.options.ordinal&&c.series.length){var f=this.mouseDownX,
g=c.getExtremes(),h=g.dataMax,i=g.min,j=g.max,k=this.hoverPoints,l=c.closestPointRange,f=(f-d)/(c.translationSlope*(c.ordinalSlope||l)),m={ordinalPositions:c.getExtendedPositions()},l=c.lin2val,n=c.val2lin,o;if(m.ordinalPositions){if(P(f)>1)k&&p(k,function(a){a.setState()}),f<0?(k=m,o=c.ordinalPositions?c:m):(k=c.ordinalPositions?c:m,o=m),m=o.ordinalPositions,h>m[m.length-1]&&m.push(h),this.fixedRange=j-i,f=c.toFixedRange(null,null,l.apply(k,[n.apply(k,[i,!0])+f,!0]),l.apply(o,[n.apply(o,[j,!0])+
f,!0])),f.min>=A(g.dataMin,i)&&f.max<=v(h,j)&&c.setExtremes(f.min,f.max,!0,!1,{trigger:"pan"}),this.mouseDownX=d,K(this.container,{cursor:"move"})}else e=!0}else e=!0;e&&a.apply(this,Array.prototype.slice.call(arguments,1))});Q(M.prototype,"getSegments",function(a){var b,c=this.options.gapSize,d=this.xAxis;a.apply(this,Array.prototype.slice.call(arguments,1));if(c)b=this.segments,p(b,function(a,f){for(var g=a.length-1;g--;)a[g+1].x-a[g].x>d.closestPointRange*c&&b.splice(f+1,0,a.splice(g+1,a.length-
g))})});var da=M.prototype,L=Jb.prototype,hc=da.processData,ic=da.generatePoints,jc=da.destroy,kc=L.tooltipHeaderFormatter,lc={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y",
"%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},Wb={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},Xb=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,
5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],Ra={sum:function(a){var b=a.length,c;if(!b&&a.hasNulls)c=null;else if(b)for(c=0;b--;)c+=a[b];return c},average:function(a){var b=a.length,a=Ra.sum(a);typeof a==="number"&&b&&(a/=b);return a},open:function(a){return a.length?a[0]:a.hasNulls?null:r},high:function(a){return a.length?Ea(a):a.hasNulls?null:r},low:function(a){return a.length?Ua(a):a.hasNulls?null:r},close:function(a){return a.length?a[a.length-
1]:a.hasNulls?null:r},ohlc:function(a,b,c,d){a=Ra.open(a);b=Ra.high(b);c=Ra.low(c);d=Ra.close(d);if(typeof a==="number"||typeof b==="number"||typeof c==="number"||typeof d==="number")return[a,b,c,d]},range:function(a,b){a=Ra.low(a);b=Ra.high(b);if(typeof a==="number"||typeof b==="number")return[a,b]}};da.groupData=function(a,b,c,d){var e=this.data,f=this.options.data,g=[],h=[],i=a.length,j,k,l=!!b,m=[[],[],[],[]],d=typeof d==="function"?d:Ra[d],n=this.pointArrayMap,o=n&&n.length,p;for(p=0;p<=i;p++)if(a[p]>=
c[0])break;for(;p<=i;p++){for(;c[1]!==r&&a[p]>=c[1]||p===i;)if(j=c.shift(),k=d.apply(0,m),k!==r&&(g.push(j),h.push(k)),m[0]=[],m[1]=[],m[2]=[],m[3]=[],p===i)break;if(p===i)break;if(n){j=this.cropStart+p;j=e&&e[j]||this.pointClass.prototype.applyOptions.apply({series:this},[f[j]]);var q;for(k=0;k<o;k++)if(q=j[n[k]],typeof q==="number")m[k].push(q);else if(q===null)m[k].hasNulls=!0}else if(j=l?b[p]:null,typeof j==="number")m[0].push(j);else if(j===null)m[0].hasNulls=!0}return[g,h]};da.processData=function(){var a=
this.chart,b=this.options,c=b.dataGrouping,d=this.allowDG!==!1&&c&&q(c.enabled,a.options._stock),e;this.forceCrop=d;this.groupPixelWidth=null;this.hasProcessed=!0;if(hc.apply(this,arguments)!==!1&&d){this.destroyGroupedData();var f=this.processedXData,g=this.processedYData,h=a.plotSizeX,a=this.xAxis,i=a.options.ordinal,j=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth(),d=this.pointRange;if(j){e=!0;this.points=null;var k=a.getExtremes(),d=k.min,k=k.max,i=i&&a.getGroupIntervalFactor(d,
k,this)||1,h=j*(k-d)/h*i,j=a.getTimeTicks(a.normalizeTimeTickInterval(h,c.units||Xb),d,k,a.options.startOfWeek,f,this.closestPointRange),g=da.groupData.apply(this,[f,g,j,c.approximation]),f=g[0],g=g[1];if(c.smoothed){c=f.length-1;for(f[c]=k;c--&&c>0;)f[c]+=h/2;f[0]=d}this.currentDataGrouping=j.info;if(b.pointRange===null)this.pointRange=j.info.totalRange;this.closestPointRange=j.info.totalRange;if(u(f[0])&&f[0]<a.dataMin)a.dataMin=f[0];this.processedXData=f;this.processedYData=g}else this.currentDataGrouping=
null,this.pointRange=d;this.hasGroupedData=e}};da.destroyGroupedData=function(){var a=this.groupedData;p(a||[],function(b,c){b&&(a[c]=b.destroy?b.destroy():null)});this.groupedData=null};da.generatePoints=function(){ic.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};L.tooltipHeaderFormatter=function(a){var b=a.series,c=b.tooltipOptions,d=b.options.dataGrouping,e=c.xDateFormat,f,g=b.xAxis,h;if(g&&g.options.type==="datetime"&&d&&pa(a.key)){b=b.currentDataGrouping;
d=d.dateTimeLabelFormats;if(b)g=d[b.unitName],b.count===1?e=g[0]:(e=g[1],f=g[2]);else if(!e&&d)for(h in G)if(G[h]>=g.closestPointRange||G[h]<=G.day&&a.key%G[h]>0){e=d[h][0];break}e=xa(e,a.key);f&&(e+=xa(f,a.key+b.totalRange-1));a=c.headerFormat.replace("{point.key}",e)}else a=kc.call(this,a);return a};da.destroy=function(){for(var a=this.groupedData||[],b=a.length;b--;)a[b]&&a[b].destroy();jc.apply(this)};Q(da,"setOptions",function(a,b){var c=a.call(this,b),d=this.type,e=this.chart.options.plotOptions,
f=W[d].dataGrouping;if(Wb[d])f||(f=y(lc,Wb[d])),c.dataGrouping=y(f,e.series&&e.series.dataGrouping,e[d].dataGrouping,b.dataGrouping);if(this.chart.options._stock)this.requireSorting=!0;return c});Q(D.prototype,"setScale",function(a){a.call(this);p(this.series,function(a){a.hasProcessed=!1})});D.prototype.getGroupPixelWidth=function(){var a=this.series,b=a.length,c,d=0,e=!1,f;for(c=b;c--;)(f=a[c].options.dataGrouping)&&(d=v(d,f.groupPixelWidth));for(c=b;c--;)if((f=a[c].options.dataGrouping)&&a[c].hasProcessed)if(b=
(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||b>this.chart.plotSizeX/d||b&&f.forced)e=!0;return e?d:0};W.ohlc=y(W.column,{lineWidth:1,tooltip:{pointFormat:'<span style="color:{series.color}">\u25cf</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},states:{hover:{lineWidth:3}},threshold:null});L=ia(B.column,{type:"ohlc",pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,
a.close]},pointValKey:"high",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},upColorProp:"stroke",getAttribs:function(){B.column.prototype.getAttribs.apply(this,arguments);var a=this.options,b=a.states,a=a.upColor||this.color,c=y(this.pointAttr),d=this.upColorProp;c[""][d]=a;c.hover[d]=b.hover.upColor||a;c.select[d]=b.select.upColor||a;p(this.points,function(a){if(a.open<a.close)a.pointAttr=c})},translate:function(){var a=this.yAxis;B.column.prototype.translate.apply(this);p(this.points,
function(b){if(b.open!==null)b.plotOpen=a.translate(b.open,0,1,0,1);if(b.close!==null)b.plotClose=a.translate(b.close,0,1,0,1)})},drawPoints:function(){var a=this,b=a.chart,c,d,e,f,g,h,i,j;p(a.points,function(k){if(k.plotY!==r)i=k.graphic,c=k.pointAttr[k.selected?"selected":""]||a.pointAttr[""],f=c["stroke-width"]%2/2,j=t(k.plotX)-f,g=t(k.shapeArgs.width/2),h=["M",j,t(k.yBottom),"L",j,t(k.plotY)],k.open!==null&&(d=t(k.plotOpen)+f,h.push("M",j,d,"L",j-g,d)),k.close!==null&&(e=t(k.plotClose)+f,h.push("M",
j,e,"L",j+g,e)),i?i.animate({d:h}):k.graphic=b.renderer.path(h).attr(c).add(a.group)})},animate:null});B.ohlc=L;W.candlestick=y(W.column,{lineColor:"black",lineWidth:1,states:{hover:{lineWidth:2}},tooltip:W.ohlc.tooltip,threshold:null,upColor:"white"});L=ia(L,{type:"candlestick",pointAttrToOptions:{fill:"color",stroke:"lineColor","stroke-width":"lineWidth"},upColorProp:"fill",getAttribs:function(){B.ohlc.prototype.getAttribs.apply(this,arguments);var a=this.options,b=a.states,c=a.upLineColor||a.lineColor,
d=b.hover.upLineColor||c,e=b.select.upLineColor||c;p(this.points,function(a){if(a.open<a.close)a.pointAttr[""].stroke=c,a.pointAttr.hover.stroke=d,a.pointAttr.select.stroke=e})},drawPoints:function(){var a=this,b=a.chart,c,d=a.pointAttr[""],e,f,g,h,i,j,k,l,m,n,o;p(a.points,function(p){m=p.graphic;if(p.plotY!==r)c=p.pointAttr[p.selected?"selected":""]||d,k=c["stroke-width"]%2/2,l=t(p.plotX)-k,e=p.plotOpen,f=p.plotClose,g=X.min(e,f),h=X.max(e,f),o=t(p.shapeArgs.width/2),i=t(g)!==t(p.plotY),j=h!==p.yBottom,
g=t(g)+k,h=t(h)+k,n=["M",l-o,h,"L",l-o,g,"L",l+o,g,"L",l+o,h,"Z","M",l,g,"L",l,i?t(p.plotY):g,"M",l,h,"L",l,j?t(p.yBottom):h],m?m.animate({d:n}):p.graphic=b.renderer.path(n).attr(c).add(a.group).shadow(a.options.shadow)})}});B.candlestick=L;var tb=na.prototype.symbols;W.flags=y(W.column,{fillColor:"white",lineWidth:1,pointRange:0,shape:"flag",stackDistance:12,states:{hover:{lineColor:"black",fillColor:"#FCFFC5"}},style:{fontSize:"11px",fontWeight:"bold",textAlign:"center"},tooltip:{pointFormat:"{point.text}<br/>"},
threshold:null,y:-30});B.flags=ia(B.column,{type:"flags",sorted:!1,noSharedTooltip:!0,allowDG:!1,takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:M.prototype.init,pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth",r:"radius"},translate:function(){B.column.prototype.translate.apply(this);var a=this.chart,b=this.points,c=b.length-1,d,e,f=this.options.onSeries,f=(d=f&&a.get(f))&&d.options.step,g=d&&d.points,h=g&&g.length,i=this.xAxis,j=i.getExtremes(),
k,l,m;if(d&&d.visible&&h){d=d.currentDataGrouping;l=g[h-1].x+(d?d.totalRange:0);for(b.sort(function(a,b){return a.x-b.x});h--&&b[c];)if(d=b[c],k=g[h],k.x<=d.x&&k.plotY!==r){if(d.x<=l)d.plotY=k.plotY,k.x<d.x&&!f&&(m=g[h+1])&&m.plotY!==r&&(d.plotY+=(d.x-k.x)/(m.x-k.x)*(m.plotY-k.plotY));c--;h++;if(c<0)break}}p(b,function(c,d){if(c.plotY===r)c.x>=j.min&&c.x<=j.max?c.plotY=a.chartHeight-i.bottom-(i.opposite?i.height:0)+i.offset-a.plotTop:c.shapeArgs={};if((e=b[d-1])&&e.plotX===c.plotX){if(e.stackIndex===
r)e.stackIndex=0;c.stackIndex=e.stackIndex+1}})},drawPoints:function(){var a,b=this.pointAttr[""],c=this.points,d=this.chart.renderer,e,f,g=this.options,h=g.y,i,j,k,l,m=g.lineWidth%2/2,n,o;for(j=c.length;j--;)if(k=c[j],a=k.plotX>this.xAxis.len,e=k.plotX+(a?m:-m),l=k.stackIndex,i=k.options.shape||g.shape,f=k.plotY,f!==r&&(f=k.plotY+h+m-(l!==r&&l*g.stackDistance)),n=l?r:k.plotX+m,o=l?r:k.plotY,l=k.graphic,f!==r&&e>=0&&!a)a=k.pointAttr[k.selected?"select":""]||b,l?l.attr({x:e,y:f,r:a.r,anchorX:n,anchorY:o}):
k.graphic=d.label(k.options.title||g.title||"A",e,f,i,n,o,g.useHTML).css(y(g.style,k.style)).attr(a).attr({align:i==="flag"?"left":"center",width:g.width,height:g.height}).add(this.markerGroup).shadow(g.shadow),k.tooltipPos=[e,f];else if(l)k.graphic=l.destroy()},drawTracker:function(){var a=this.points;jb.drawTrackerPoint.apply(this);p(a,function(b){var c=b.graphic;c&&z(c.element,"mouseover",function(){if(b.stackIndex>0&&!b.raised)b._y=c.y,c.attr({y:b._y-8}),b.raised=!0;p(a,function(a){if(a!==b&&
a.raised&&a.graphic)a.graphic.attr({y:a._y}),a.raised=!1})})})},animate:ra});tb.flag=function(a,b,c,d,e){var f=e&&e.anchorX||a,e=e&&e.anchorY||b;return["M",f,e,"L",a,b+d,a,b,a+c,b,a+c,b+d,a,b+d,"M",f,e,"Z"]};p(["circle","square"],function(a){tb[a+"pin"]=function(b,c,d,e,f){var g=f&&f.anchorX,f=f&&f.anchorY,b=tb[a](b,c,d,e);g&&f&&b.push("M",g,c>f?c:c+e,"L",g,f);return b}});Za===N.VMLRenderer&&p(["flag","circlepin","squarepin"],function(a){ib.prototype.symbols[a]=tb[a]});var L=[].concat(Xb),ub=function(a){return Math[a].apply(0,
qb(arguments,function(a){return typeof a==="number"}))};L[4]=["day",[1,2,3,4]];L[5]=["week",[1,2,3]];s(F,{navigator:{handles:{backgroundColor:"#ebe7e8",borderColor:"#b2b1b6"},height:40,margin:25,maskFill:"rgba(128,179,236,0.3)",maskInside:!0,outlineColor:"#b2b1b6",outlineWidth:1,series:{type:B.areaspline===r?"line":"areaspline",color:"#4572A7",compare:null,fillOpacity:.05,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:L},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",
lineColor:"#4572A7",lineWidth:1,marker:{enabled:!1},pointRange:0,shadow:!1,threshold:null},xAxis:{tickWidth:0,lineWidth:0,gridLineColor:"#EEE",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#888"},x:3,y:-4},crosshair:!1},yAxis:{gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickWidth:0}},scrollbar:{height:fb?20:14,barBackgroundColor:"#bfc8d1",barBorderRadius:0,barBorderWidth:1,barBorderColor:"#bfc8d1",
buttonArrowColor:"#666",buttonBackgroundColor:"#ebe7e8",buttonBorderColor:"#bbb",buttonBorderRadius:0,buttonBorderWidth:1,minWidth:6,rifleColor:"#666",trackBackgroundColor:"#eeeeee",trackBorderColor:"#eeeeee",trackBorderWidth:1,liveRedraw:ea&&!fb}});Cb.prototype={drawHandle:function(a,b){var c=this.chart,d=c.renderer,e=this.elementsToDestroy,f=this.handles,g=this.navigatorOptions.handles,g={fill:g.backgroundColor,stroke:g.borderColor,"stroke-width":1},h;this.rendered||(f[b]=d.g("navigator-handle-"+
["left","right"][b]).css({cursor:"e-resize"}).attr({zIndex:4-b}).add(),h=d.rect(-4.5,0,9,16,0,1).attr(g).add(f[b]),e.push(h),h=d.path(["M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12]).attr(g).add(f[b]),e.push(h));f[b][c.isResizing?"animate":"attr"]({translateX:this.scrollerLeft+this.scrollbarHeight+parseInt(a,10),translateY:this.top+this.height/2-8})},drawScrollbarButton:function(a){var b=this.chart.renderer,c=this.elementsToDestroy,d=this.scrollbarButtons,e=this.scrollbarHeight,f=this.scrollbarOptions,
g;this.rendered||(d[a]=b.g().add(this.scrollbarGroup),g=b.rect(-.5,-.5,e+1,e+1,f.buttonBorderRadius,f.buttonBorderWidth).attr({stroke:f.buttonBorderColor,"stroke-width":f.buttonBorderWidth,fill:f.buttonBackgroundColor}).add(d[a]),c.push(g),g=b.path(["M",e/2+(a?-1:1),e/2-3,"L",e/2+(a?-1:1),e/2+3,e/2+(a?2:-2),e/2]).attr({fill:f.buttonArrowColor}).add(d[a]),c.push(g));a&&d[a].attr({translateX:this.scrollerWidth-e})},render:function(a,b,c,d){var e=this.chart,f=e.renderer,g,h,i,j,k=this.scrollbarGroup,
l=this.navigatorGroup,m=this.scrollbar,l=this.xAxis,n=this.scrollbarTrack,o=this.scrollbarHeight,p=this.scrollbarEnabled,r=this.navigatorOptions,s=this.scrollbarOptions,w=s.minWidth,u=this.height,y=this.top,z=this.navigatorEnabled,O=r.outlineWidth,B=O/2,E=0,C=this.outlineHeight,G=s.barBorderRadius,F=s.barBorderWidth,D=y+B,H;if(!isNaN(a)){this.navigatorLeft=g=q(l.left,e.plotLeft+o);this.navigatorWidth=h=q(l.len,e.plotWidth-2*o);this.scrollerLeft=i=g-o;this.scrollerWidth=j=j=h+2*o;l.getExtremes&&(H=
this.getUnionExtremes(!0))&&(H.dataMin!==l.min||H.dataMax!==l.max)&&l.setExtremes(H.dataMin,H.dataMax,!0,!1);c=q(c,l.translate(a));d=q(d,l.translate(b));if(isNaN(c)||P(c)===Infinity)c=0,d=j;if(!(l.translate(d,!0)-l.translate(c,!0)<e.xAxis[0].minRange)){this.zoomedMax=A(v(c,d),h);this.zoomedMin=v(this.fixedWidth?this.zoomedMax-this.fixedWidth:A(c,d),0);this.range=this.zoomedMax-this.zoomedMin;c=t(this.zoomedMax);b=t(this.zoomedMin);a=c-b;if(!this.rendered){if(z){this.navigatorGroup=l=f.g("navigator").attr({zIndex:3}).add();
this.leftShade=f.rect().attr({fill:r.maskFill}).add(l);if(!r.maskInside)this.rightShade=f.rect().attr({fill:r.maskFill}).add(l);this.outline=f.path().attr({"stroke-width":O,stroke:r.outlineColor}).add(l)}if(p)this.scrollbarGroup=k=f.g("scrollbar").add(),m=s.trackBorderWidth,this.scrollbarTrack=n=f.rect().attr({x:0,y:-m%2/2,fill:s.trackBackgroundColor,stroke:s.trackBorderColor,"stroke-width":m,r:s.trackBorderRadius||0,height:o}).add(k),this.scrollbar=m=f.rect().attr({y:-F%2/2,height:o,fill:s.barBackgroundColor,
stroke:s.barBorderColor,"stroke-width":F,r:G}).add(k),this.scrollbarRifles=f.path().attr({stroke:s.rifleColor,"stroke-width":1}).add(k)}e=e.isResizing?"animate":"attr";if(z){this.leftShade[e](r.maskInside?{x:g+b,y:y,width:c-b,height:u}:{x:g,y:y,width:b,height:u});if(this.rightShade)this.rightShade[e]({x:g+c,y:y,width:h-c,height:u});this.outline[e]({d:["M",i,D,"L",g+b+B,D,g+b+B,D+C,"L",g+c-B,D+C,"L",g+c-B,D,i+j,D].concat(r.maskInside?["M",g+b+B,D,"L",g+c-B,D]:[])});this.drawHandle(b+B,0);this.drawHandle(c+
B,1)}if(p&&k)this.drawScrollbarButton(0),this.drawScrollbarButton(1),k[e]({translateX:i,translateY:t(D+u)}),n[e]({width:j}),g=o+b,h=a-F,h<w&&(E=(w-h)/2,h=w,g-=E),this.scrollbarPad=E,m[e]({x:V(g)+F%2/2,width:h}),w=o+b+a/2-.5,this.scrollbarRifles.attr({visibility:a>12?"visible":"hidden"})[e]({d:["M",w-3,o/4,"L",w-3,2*o/3,"M",w,o/4,"L",w,2*o/3,"M",w+3,o/4,"L",w+3,2*o/3]});this.scrollbarPad=E;this.rendered=!0}}},addEvents:function(){var a=this.chart.container,b=this.mouseDownHandler,c=this.mouseMoveHandler,
d=this.mouseUpHandler,e;e=[[a,"mousedown",b],[a,"mousemove",c],[document,"mouseup",d]];db&&e.push([a,"touchstart",b],[a,"touchmove",c],[document,"touchend",d]);p(e,function(a){z.apply(null,a)});this._events=e},removeEvents:function(){p(this._events,function(a){U.apply(null,a)});this._events=r;this.navigatorEnabled&&this.baseSeries&&U(this.baseSeries,"updatedData",this.updatedDataHandler)},init:function(){var a=this,b=a.chart,c,d,e=a.scrollbarHeight,f=a.navigatorOptions,g=a.height,h=a.top,i,j,k=document.body.style,
l,m=a.baseSeries;a.mouseDownHandler=function(d){var d=b.pointer.normalize(d),e=a.zoomedMin,f=a.zoomedMax,h=a.top,j=a.scrollbarHeight,m=a.scrollerLeft,n=a.scrollerWidth,o=a.navigatorLeft,p=a.navigatorWidth,q=a.scrollbarPad,r=a.range,s=d.chartX,t=d.chartY,d=b.xAxis[0],u,v=fb?10:7;if(t>h&&t<h+g+j)if((h=!a.scrollbarEnabled||t<h+g)&&X.abs(s-e-o)<v)a.grabbedLeft=!0,a.otherHandlePos=f,a.fixedExtreme=d.max,b.fixedRange=null;else if(h&&X.abs(s-f-o)<v)a.grabbedRight=!0,a.otherHandlePos=e,a.fixedExtreme=d.min,
b.fixedRange=null;else if(s>o+e-q&&s<o+f+q){a.grabbedCenter=s;a.fixedWidth=r;if(b.renderer.isSVG)l=k.cursor,k.cursor="ew-resize";i=s-e}else if(s>m&&s<m+n){f=h?s-o-r/2:s<o?e-r*.2:s>m+n-j?e+r*.2:s<o+e?e-r:f;if(f<0)f=0;else if(f+r>=p)f=p-r,u=c.dataMax;if(f!==e)a.fixedWidth=r,e=c.toFixedRange(f,f+r,null,u),d.setExtremes(e.min,e.max,!0,!1,{trigger:"navigator"})}};a.mouseMoveHandler=function(c){var d=a.scrollbarHeight,e=a.navigatorLeft,f=a.navigatorWidth,g=a.scrollerLeft,h=a.scrollerWidth,k=a.range,l;if(c.pageX!==
0)c=b.pointer.normalize(c),l=c.chartX,l<e?l=e:l>g+h-d&&(l=g+h-d),a.grabbedLeft?(j=!0,a.render(0,0,l-e,a.otherHandlePos)):a.grabbedRight?(j=!0,a.render(0,0,a.otherHandlePos,l-e)):a.grabbedCenter&&(j=!0,l<i?l=i:l>f+i-k&&(l=f+i-k),a.render(0,0,l-i,l-i+k)),j&&a.scrollbarOptions.liveRedraw&&setTimeout(function(){a.mouseUpHandler(c)},0)};a.mouseUpHandler=function(d){var e,f;if(j){if(a.zoomedMin===a.otherHandlePos)e=a.fixedExtreme;else if(a.zoomedMax===a.otherHandlePos)f=a.fixedExtreme;e=c.toFixedRange(a.zoomedMin,
a.zoomedMax,e,f);b.xAxis[0].setExtremes(e.min,e.max,!0,!1,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:d})}if(d.type!=="mousemove")a.grabbedLeft=a.grabbedRight=a.grabbedCenter=a.fixedWidth=a.fixedExtreme=a.otherHandlePos=j=i=null,k.cursor=l||""};var n=b.xAxis.length,o=b.yAxis.length;b.extraBottomMargin=a.outlineHeight+f.margin;a.navigatorEnabled?(a.xAxis=c=new D(b,y({ordinal:m&&m.xAxis.options.ordinal},f.xAxis,{id:"navigator-x-axis",isX:!0,type:"datetime",index:n,height:g,offset:0,offsetLeft:e,
offsetRight:-e,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1})),a.yAxis=d=new D(b,y(f.yAxis,{id:"navigator-y-axis",alignTicks:!1,height:g,offset:0,index:o,zoomEnabled:!1})),m||f.series.data?a.addBaseSeries():b.series.length===0&&Q(b,"redraw",function(c,d){if(b.series.length>0&&!a.series)a.setBaseSeries(),b.redraw=c;c.call(b,d)})):a.xAxis=c={translate:function(a,c){var d=b.xAxis[0],f=d.getExtremes(),g=b.plotWidth-2*e,h=ub("min",d.options.min,f.dataMin),
d=ub("max",d.options.max,f.dataMax)-h;return c?a*d/g+h:g*(a-h)/d},toFixedRange:D.prototype.toFixedRange};Q(b,"getMargins",function(b){var e=this.legend,f=e.options;b.call(this);a.top=h=a.navigatorOptions.top||this.chartHeight-a.height-a.scrollbarHeight-this.spacing[2]-(f.verticalAlign==="bottom"&&f.enabled&&!f.floating?e.legendHeight+q(f.margin,10):0);if(c&&d)c.options.top=d.options.top=h,c.setAxisSize(),d.setAxisSize()});a.addEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],c=this.xAxis,
d=c.options,e=b.options;if(!a||b.dataMin!==null)return{dataMin:ub("min",d&&d.min,e.min,b.dataMin,c.dataMin),dataMax:ub("max",d&&d.max,e.max,b.dataMax,c.dataMax)}},setBaseSeries:function(a){var b=this.chart,a=a||b.options.navigator.baseSeries;this.series&&this.series.remove();this.baseSeries=b.series[a]||typeof a==="string"&&b.get(a)||b.series[0];this.xAxis&&this.addBaseSeries()},addBaseSeries:function(){var a=this.baseSeries,b=a?a.options:{},c=b.data,d=this.navigatorOptions.series,e;e=d.data;this.hasNavigatorData=
!!e;b=y(b,d,{enableMouseTracking:!1,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",name:"Navigator",showInLegend:!1,isInternal:!0,visible:!0});b.data=e||c;this.series=this.chart.initSeries(b);if(a&&this.navigatorOptions.adaptToUpdatedData!==!1)z(a,"updatedData",this.updatedDataHandler),a.userOptions.events=s(a.userOptions.event,{updatedData:this.updatedDataHandler})},updatedDataHandler:function(){var a=this.chart.scroller,b=a.baseSeries,c=b.xAxis,d=c.getExtremes(),e=d.min,
f=d.max,g=d.dataMin,d=d.dataMax,h=f-e,i,j,k,l,m,n=a.series;i=n.xData;var o=!!c.setExtremes;j=f>=i[i.length-1]-(this.closestPointRange||0);i=e<=g;if(!a.hasNavigatorData)n.options.pointStart=b.xData[0],n.setData(b.options.data,!1),m=!0;i&&(l=g,k=l+h);j&&(k=d,i||(l=v(k-h,n.xData[0])));o&&(i||j)?isNaN(l)||c.setExtremes(l,k,!0,!1,{trigger:"updatedData"}):(m&&this.chart.redraw(!1),a.render(v(e,g),A(f,d)))},destroy:function(){this.removeEvents();p([this.xAxis,this.yAxis,this.leftShade,this.rightShade,this.outline,
this.scrollbarTrack,this.scrollbarRifles,this.scrollbarGroup,this.scrollbar],function(a){a&&a.destroy&&a.destroy()});this.xAxis=this.yAxis=this.leftShade=this.rightShade=this.outline=this.scrollbarTrack=this.scrollbarRifles=this.scrollbarGroup=this.scrollbar=null;p([this.scrollbarButtons,this.handles,this.elementsToDestroy],function(a){Na(a)})}};N.Scroller=Cb;Q(D.prototype,"zoom",function(a,b,c){var d=this.chart,e=d.options,f=e.chart.zoomType,g=e.navigator,e=e.rangeSelector,h;if(this.isXAxis&&(g&&
g.enabled||e&&e.enabled))if(f==="x")d.resetZoomButton="blocked";else if(f==="y")h=!1;else if(f==="xy")d=this.previousZoom,u(b)?this.previousZoom=[this.min,this.max]:d&&(b=d[0],c=d[1],delete this.previousZoom);return h!==r?h:a.call(this,b,c)});Q(ya.prototype,"init",function(a,b,c){z(this,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=new Cb(this)});a.call(this,b,c)});Q(M.prototype,"addPoint",function(a,b,c,d,e){var f=this.options.turboThreshold;
f&&this.xData.length>f&&ha(b)&&!Ja(b)&&this.chart.scroller&&ma(20,!0);a.call(this,b,c,d,e)});s(F,{rangeSelector:{buttonTheme:{width:28,height:18,fill:"#f7f7f7",padding:2,r:0,"stroke-width":0,style:{color:"#444",cursor:"pointer",fontWeight:"normal"},zIndex:7,states:{hover:{fill:"#e7e7e7"},select:{fill:"#e7f0f9",style:{color:"black",fontWeight:"bold"}}}},inputPosition:{align:"right"},labelStyle:{color:"#666"}}});F.lang=y(F.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});
Db.prototype={clickButton:function(a,b){var c=this,d=c.selected,e=c.chart,f=c.buttons,g=c.buttonOptions[a],h=e.xAxis[0],i=e.scroller&&e.scroller.getUnionExtremes()||h||{},j=i.dataMin,k=i.dataMax,l,m=h&&t(A(h.max,q(k,h.max))),n=new ca(m),o=g.type,s=g.count,i=g._range,u;if(!(j===null||k===null||a===c.selected)){if(o==="month"||o==="year")l={month:"Month",year:"FullYear"}[o],n["set"+l](n["get"+l]()-s),l=n.getTime(),j=q(j,Number.MIN_VALUE),isNaN(l)||l<j?(l=j,m=A(l+i,k)):i=m-l;else if(i)l=v(m-i,j),m=A(l+
i,k);else if(o==="ytd")if(h){if(k===r)j=Number.MAX_VALUE,k=Number.MIN_VALUE,p(e.series,function(a){a=a.xData;j=A(a[0],j);k=v(a[a.length-1],k)}),b=!1;m=new ca(k);u=m.getFullYear();l=u=v(j||0,ca.UTC(u,0,1));m=m.getTime();m=A(k||m,m)}else{z(e,"beforeRender",function(){c.clickButton(a)});return}else o==="all"&&h&&(l=j,m=k);f[d]&&f[d].setState(0);f[a]&&f[a].setState(2);e.fixedRange=i;h?h.setExtremes(l,m,q(b,1),0,{trigger:"rangeSelectorButton",rangeSelectorButton:g}):(d=e.options.xAxis,d[0]=y(d[0],{range:i,
min:u}));c.setSelected(a)}},setSelected:function(a){this.selected=this.options.selected=a},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var b=this,c=a.options.rangeSelector,d=c.buttons||[].concat(b.defaultButtons),e=c.selected,f=b.blurInputs=function(){var a=b.minInput,c=b.maxInput;a&&a.blur&&J(a,"blur");c&&c.blur&&J(c,"blur")};b.chart=
a;b.options=c;b.buttons=[];a.extraTopMargin=35;b.buttonOptions=d;z(a.container,"mousedown",f);z(a,"resize",f);p(d,b.computeButtonRange);e!==r&&d[e]&&this.clickButton(e,!1);z(a,"load",function(){z(a.xAxis[0],"afterSetExtremes",function(){b.updateButtonStates(!0)})})},updateButtonStates:function(a){var b=this,c=this.chart,d=c.xAxis[0],e=c.scroller&&c.scroller.getUnionExtremes()||d,f=e.dataMin,g=e.dataMax,h=b.selected,i=b.options.allButtonsEnabled,j=b.buttons;a&&c.fixedRange!==t(d.max-d.min)&&(j[h]&&
j[h].setState(0),b.setSelected(null));p(b.buttonOptions,function(a,c){var e=a._range,n=e>g-f,o=e<d.minRange,p=a.type==="all"&&d.max-d.min>=g-f&&j[c].state!==2,q=a.type==="ytd"&&xa("%Y",f)===xa("%Y",g);e===t(d.max-d.min)&&c!==h?(b.setSelected(c),j[c].setState(2)):!i&&(n||o||p||q)?j[c].setState(3):j[c].state===3&&j[c].setState(0)})},computeButtonRange:function(a){var b=a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if(b==="month"||
b==="year")a._range={month:30,year:365}[b]*864E5*c},setInputValue:function(a,b){var c=this.chart.options.rangeSelector;if(u(b))this[a+"Input"].HCTime=b;this[a+"Input"].value=xa(c.inputEditDateFormat||"%Y-%m-%d",this[a+"Input"].HCTime);this[a+"DateBox"].attr({text:xa(c.inputDateFormat||"%b %e, %Y",this[a+"Input"].HCTime)})},drawInput:function(a){var b=this,c=b.chart,d=c.renderer.style,e=c.renderer,f=c.options.rangeSelector,g=b.div,h=a==="min",i,j,k,l=this.inputGroup;this[a+"Label"]=j=e.label(F.lang[h?
"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).attr({padding:2}).css(y(d,f.labelStyle)).add(l);l.offset+=j.width+5;this[a+"DateBox"]=k=e.label("",l.offset).attr({padding:2,width:f.inputBoxWidth||90,height:f.inputBoxHeight||17,stroke:f.inputBoxBorderColor||"silver","stroke-width":1}).css(y({textAlign:"center",color:"#444"},d,f.inputStyle)).on("click",function(){b[a+"Input"].focus()}).add(l);l.offset+=k.width+(h?10:0);this[a+"Input"]=i=aa("input",{name:a,className:"highcharts-range-selector",
type:"text"},s({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:d.fontSize,fontFamily:d.fontFamily,top:c.plotTop+"px"},f.inputStyle),g);i.onfocus=function(){K(this,{left:l.translateX+k.x+"px",top:l.translateY+"px",width:k.width-2+"px",height:k.height-2+"px",border:"2px solid silver"})};i.onblur=function(){K(this,{border:0,width:"1px",height:"1px"});b.setInputValue(a)};i.onchange=function(){var a=i.value,d=(f.inputDateParser||ca.parse)(a),e=c.xAxis[0],g=
e.dataMin,j=e.dataMax;isNaN(d)&&(d=a.split("-"),d=ca.UTC(H(d[0]),H(d[1])-1,H(d[2])));isNaN(d)||(F.global.useUTC||(d+=(new ca).getTimezoneOffset()*6E4),h?d>b.maxInput.HCTime?d=r:d<g&&(d=g):d<b.minInput.HCTime?d=r:d>j&&(d=j),d!==r&&c.xAxis[0].setExtremes(h?d:e.min,h?e.max:d,r,r,{trigger:"rangeSelectorInput"}))}},render:function(a,b){var c=this,d=c.chart,e=d.renderer,f=d.container,g=d.options,h=g.exporting&&g.navigation&&g.navigation.buttonOptions,i=g.rangeSelector,j=c.buttons,g=F.lang,k=c.div,k=c.inputGroup,
l=i.buttonTheme,m=i.inputEnabled!==!1,n=l&&l.states,o=d.plotLeft,r;if(!c.rendered&&(c.zoomText=e.text(g.rangeSelectorZoom,o,d.plotTop-20).css(i.labelStyle).add(),r=o+c.zoomText.getBBox().width+5,p(c.buttonOptions,function(a,b){j[b]=e.button(a.text,r,d.plotTop-35,function(){c.clickButton(b);c.isActive=!0},l,n&&n.hover,n&&n.select).css({textAlign:"center"}).add();r+=j[b].width+q(i.buttonSpacing,5);c.selected===b&&j[b].setState(2)}),c.updateButtonStates(),m))c.div=k=aa("div",null,{position:"relative",
height:0,zIndex:1}),f.parentNode.insertBefore(k,f),c.inputGroup=k=e.g("input-group").add(),k.offset=0,c.drawInput("min"),c.drawInput("max");m&&(f=d.plotTop-45,k.align(s({y:f,width:k.offset,x:h&&f<(h.y||0)+h.height-d.spacing[0]?-40:0},i.inputPosition),!0,d.spacingBox),c.setInputValue("min",a),c.setInputValue("max",b));c.rendered=!0},destroy:function(){var a=this.minInput,b=this.maxInput,c=this.chart,d=this.blurInputs,e;U(c.container,"mousedown",d);U(c,"resize",d);Na(this.buttons);if(a)a.onfocus=a.onblur=
a.onchange=null;if(b)b.onfocus=b.onblur=b.onchange=null;for(e in this)this[e]&&e!=="chart"&&(this[e].destroy?this[e].destroy():this[e].nodeType&&Va(this[e])),this[e]=null}};D.prototype.toFixedRange=function(a,b,c,d){var e=this.chart&&this.chart.fixedRange,a=q(c,this.translate(a,!0)),b=q(d,this.translate(b,!0)),c=e&&(b-a)/e;c>.7&&c<1.3&&(d?a=b-e:b=a+e);return{min:a,max:b}};Q(ya.prototype,"init",function(a,b,c){z(this,"init",function(){if(this.options.rangeSelector.enabled)this.rangeSelector=new Db(this)});
a.call(this,b,c)});N.RangeSelector=Db;ya.prototype.callbacks.push(function(a){function b(){f=a.xAxis[0].getExtremes();g.render(f.min,f.max)}function c(){f=a.xAxis[0].getExtremes();isNaN(f.min)||h.render(f.min,f.max)}function d(a){a.triggerOp!=="navigator-drag"&&g.render(a.min,a.max)}function e(a){h.render(a.min,a.max)}var f,g=a.scroller,h=a.rangeSelector;g&&(z(a.xAxis[0],"afterSetExtremes",d),Q(a,"drawChartBox",function(a){var c=this.isDirtyBox;a.call(this);c&&b()}),b());h&&(z(a.xAxis[0],"afterSetExtremes",
e),z(a,"resize",c),c());z(a,"destroy",function(){g&&U(a.xAxis[0],"afterSetExtremes",d);h&&(U(a,"resize",c),U(a.xAxis[0],"afterSetExtremes",e))})});N.StockChart=function(a,b){var c=a.series,d,e=q(a.navigator&&a.navigator.enabled,!0)?{startOnTick:!1,endOnTick:!1}:null,f={marker:{enabled:!1,radius:2},states:{hover:{lineWidth:2}}},g={shadow:!1,borderWidth:0};a.xAxis=za(qa(a.xAxis||{}),function(a){return y({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},
a,{type:"datetime",categories:null},e)});a.yAxis=za(qa(a.yAxis||{}),function(a){d=q(a.opposite,!0);return y({labels:{y:-2},opposite:d,showLastLabel:!1,title:{text:null}},a)});a.series=null;a=y({chart:{panning:!0,pinchType:"x"},navigator:{enabled:!0},scrollbar:{enabled:!0},rangeSelector:{enabled:!0},title:{text:null,style:{fontSize:"16px"}},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:f,spline:f,area:f,areaspline:f,arearange:f,areasplinerange:f,column:g,columnrange:g,candlestick:g,
ohlc:g}},a,{_stock:!0,chart:{inverted:!1}});a.series=c;return new ya(a,b)};Q($a.prototype,"init",function(a,b,c){var d=c.chart.pinchType||"";a.call(this,b,c);this.pinchX=this.pinchHor=d.indexOf("x")!==-1;this.pinchY=this.pinchVert=d.indexOf("y")!==-1;this.hasZoom=this.hasZoom||this.pinchHor||this.pinchVert});Q(D.prototype,"autoLabelAlign",function(a){var b=this.chart,c=this.options,b=b._labelPanes=b._labelPanes||{},d=this.options.labels;if(this.chart.options._stock&&this.coll==="yAxis"&&(c=c.top+
","+c.height,!b[c]&&d.enabled)){if(d.x===15)d.x=0;if(d.align===void 0)d.align="right";b[c]=1;return"right"}return a.call(this,[].slice.call(arguments,1))});D.prototype.getPlotLinePath=function(a,b,c,d,e){var f=this,g=this.isLinked&&!this.series?this.linkedParent.series:this.series,h=f.chart,i=h.renderer,j=f.left,k=f.top,l,m,n,o,r=[],s,v;if(f.coll==="xAxis"||f.coll==="yAxis")s=f.isXAxis?u(f.options.yAxis)?[h.yAxis[f.options.yAxis]]:za(g,function(a){return a.yAxis}):u(f.options.xAxis)?[h.xAxis[f.options.xAxis]]:
za(g,function(a){return a.xAxis});p(f.isXAxis?h.yAxis:h.xAxis,function(a){if(u(a.options.id)?a.options.id.indexOf("navigator")===-1:1){var b=a.isXAxis?"yAxis":"xAxis",b=u(a.options[b])?h[b][a.options[b]]:h[b][0];f===b&&s.push(a)}});v=s.length?[]:[f];p(s,function(a){Qa(a,v)===-1&&v.push(a)});e=q(e,f.translate(a,null,null,c));isNaN(e)||(f.horiz?p(v,function(a){m=a.top;o=m+a.len;l=n=t(e+f.transB);(l>=j&&l<=j+f.width||d)&&r.push("M",l,m,"L",n,o)}):p(v,function(a){l=a.left;n=l+a.width;m=o=t(k+f.height-
e);(m>=k&&m<=k+f.height||d)&&r.push("M",l,m,"L",n,o)}));if(r.length>0)return i.crispPolyLine(r,b||1)};D.prototype.getPlotBandPath=function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a),e=[],f;if(d&&c)for(f=0;f<d.length;f+=6)e.push("M",d[f+1],d[f+2],"L",d[f+4],d[f+5],c[f+4],c[f+5],c[f+1],c[f+2]);else e=null;return e};na.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=t(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=t(a[c+2])+b%2/2);
return a};if(Za===N.VMLRenderer)ib.prototype.crispPolyLine=na.prototype.crispPolyLine;Q(D.prototype,"hideCrosshair",function(a,b){a.call(this,b);u(this.crossLabelArray)&&(u(b)?this.crossLabelArray[b]&&this.crossLabelArray[b].hide():p(this.crossLabelArray,function(a){a.hide()}))});Q(D.prototype,"drawCrosshair",function(a,b,c){var d,e;a.call(this,b,c);if(u(this.crosshair.label)&&this.crosshair.label.enabled&&u(c)){var a=this.chart,f=this.options.crosshair.label,g=this.isXAxis?"x":"y",b=this.horiz,h=
this.opposite,i=this.left,j=this.top,k=this.crossLabel,l,m,n=f.format,o="";if(!k)k=this.crossLabel=a.renderer.label().attr({align:f.align||(b?"center":h?this.labelAlign==="right"?"right":"left":this.labelAlign==="left"?"left":"center"),zIndex:12,height:b?16:r,fill:f.backgroundColor||this.series[0]&&this.series[0].color||"gray",padding:q(f.padding,2),stroke:f.borderColor||null,"stroke-width":f.borderWidth||0}).css(s({color:"white",fontWeight:"normal",fontSize:"11px",textAlign:"center"},f.style)).add();
b?(l=c.plotX+i,m=j+(h?0:this.height)):(l=h?this.width+i:0,m=c.plotY+j);if(m<j||m>j+this.height)this.hideCrosshair();else{!n&&!f.formatter&&(this.isDatetimeAxis&&(o="%b %d, %Y"),n="{value"+(o?":"+o:"")+"}");k.attr({text:n?Ma(n,{value:c[g]}):f.formatter.call(this,c[g]),x:l,y:m,visibility:"visible"});c=k.getBBox();if(b){if(this.options.tickPosition==="inside"&&!h||this.options.tickPosition!=="inside"&&h)m=k.y-c.height}else m=k.y-c.height/2;b?(d=i-c.x,e=i+this.width-c.x):(d=this.labelAlign==="left"?i:
0,e=this.labelAlign==="right"?i+this.width:a.chartWidth);k.translateX<d&&(l+=d-k.translateX);k.translateX+c.width>=e&&(l-=k.translateX+c.width-e);k.attr({x:l,y:m,visibility:"visible"})}}});var mc=da.init,nc=da.processData,oc=Ba.prototype.tooltipFormatter;da.init=function(){mc.apply(this,arguments);this.setCompare(this.options.compare)};da.setCompare=function(a){this.modifyValue=a==="value"||a==="percent"?function(b,c){var d=this.compareValue;if(b!==r&&(b=a==="value"?b-d:b=100*(b/d)-100,c))c.change=
b;return b}:null;if(this.chart.hasRendered)this.isDirty=!0};da.processData=function(){var a=0,b,c,d;nc.apply(this,arguments);if(this.xAxis&&this.processedYData){b=this.processedXData;c=this.processedYData;for(d=c.length;a<d;a++)if(typeof c[a]==="number"&&b[a]>=this.xAxis.min){this.compareValue=c[a];break}}};Q(da,"getExtremes",function(a){a.apply(this,[].slice.call(arguments,1));if(this.modifyValue)this.dataMax=this.modifyValue(this.dataMax),this.dataMin=this.modifyValue(this.dataMin)});D.prototype.setCompare=
function(a,b){this.isXAxis||(p(this.series,function(b){b.setCompare(a)}),q(b,!0)&&this.chart.redraw())};Ba.prototype.tooltipFormatter=function(a){a=a.replace("{point.change}",(this.change>0?"+":"")+Da(this.change,q(this.series.tooltipOptions.changeDecimals,2)));return oc.apply(this,[a])};Q(M.prototype,"render",function(a){if(this.chart.options._stock)!this.clipBox&&this.animate&&this.animate.toString().indexOf("sharedClip")!==-1?(this.clipBox=y(this.chart.clipBox),this.clipBox.width=this.xAxis.len,
this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]&&this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len});a.call(this)});s(N,{Axis:D,Chart:ya,Color:Ia,Point:Ba,Tick:bb,Renderer:Za,Series:M,SVGElement:Z,SVGRenderer:na,arrayMin:Ua,arrayMax:Ea,charts:ba,dateFormat:xa,format:Ma,pathAnim:Gb,getOptions:function(){return F},hasBidiBug:Yb,isTouchDevice:fb,numberFormat:Da,seriesTypes:B,setOptions:function(a){F=y(!0,F,a);Mb();return F},addEvent:z,removeEvent:U,createElement:aa,
discardElement:Va,css:K,each:p,extend:s,map:za,merge:y,pick:q,splat:qa,extendClass:ia,pInt:H,wrap:Q,svg:ea,canvas:la,vml:!ea&&!la,product:"Highstock",version:"2.0.4"})})();/*

 Color animation jQuery-plugin
 http://www.bitstorm.org/jquery/color-animation/
 Copyright 2011 Edwin Martin <edwin@bitstorm.org>
 Released under the MIT and GPL licenses.
*/
(function(d){function i(){var b=d("script:first"),a=b.css("color"),c=false;if(/^rgba/.test(a))c=true;else try{c=a!=b.css("color","rgba(0, 0, 0, 0.5)").css("color");b.css("color",a)}catch(e){}return c}function g(b,a,c){var e="rgb"+(d.support.rgba?"a":"")+"("+parseInt(b[0]+c*(a[0]-b[0]),10)+","+parseInt(b[1]+c*(a[1]-b[1]),10)+","+parseInt(b[2]+c*(a[2]-b[2]),10);if(d.support.rgba)e+=","+(b&&a?parseFloat(b[3]+c*(a[3]-b[3])):1);e+=")";return e}function f(b){var a,c;if(a=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(b))c=
[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1];else if(a=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(b))c=[parseInt(a[1],16)*17,parseInt(a[2],16)*17,parseInt(a[3],16)*17,1];else if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),1];else if(a=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(b))c=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];return c}
d.extend(true,d,{support:{rgba:i()}});var h=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","outlineColor"];d.each(h,function(b,a){d.fx.step[a]=function(c){if(!c.init){c.a=f(d(c.elem).css(a));c.end=f(c.end);c.init=true}c.elem.style[a]=g(c.a,c.end,c.pos)}});d.fx.step.borderColor=function(b){if(!b.init)b.end=f(b.end);var a=h.slice(2,6);d.each(a,function(c,e){b.init||(b[e]={a:f(d(b.elem).css(e))});b.elem.style[e]=g(b[e].a,b.end,b.pos)});b.init=true}})(jQuery);/*

 hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
 <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.abs(pX-cX)+Math.abs(pY-cY)<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,
ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t)ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1)ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1)ob.hoverIntent_t=setTimeout(function(){delay(ev,
ob)},cfg.timeout)}};return this.bind("mouseenter",handleHover).bind("mouseleave",handleHover)}})(jQuery);/*

 jcade v0.5
 http://github.com/snesin/jcade

 jQuery create and destroy events

 Copyright 2011-2012, Scott Nesin
 Dual licensed under the MIT or GPL Version 2 licenses.

*/
(function($){var useBehaviors=$.browser.msie&&$.browser.version<9;var bindings=[],attr="jcade.create.tagged_",nextBindId=0;function getEvent(target,currentTarget,data){var event=jQuery.Event("create");event.srcElement=event.target=target;event.delegateTarget=event.currentTarget=currentTarget;event.data=data;return event}function searchAndHandle(selector,context,eventData,handler,bindId){context.each(function(cIndex,cElement){$(selector,cElement).each(function(index,element){if(!element[attr+bindId]){element[attr+
bindId]=true;handler(getEvent(element,cElement,eventData))}})})}function createdElementIE(element){var e=$(element);if(e[0][attr])return false;for(var i=0;i<bindings.length;i++)if(e.is(bindings[i].selector)){var c=bindings[i].context;for(var j=0;j<c.length;j++)if($.contains(c[j],element)&&!element[attr+bindings[i].bindId]){element[attr+bindings[i].bindId]=true;bindings[i].handler(getEvent(element,c[j],bindings[i].data));break}}}function parseUrl(url){if(url.search(/^([a-z]+:)\/\/(.+?)(:(\d*))?(\/.*?)([^\/]*?)(\?.*?)?(#.*)?$/i)===
0)return{protocol:RegExp.$1,hostname:RegExp.$2,_port:RegExp.$3,port:RegExp.$4.length>0?parseInt(RegExp.$4):RegExp.$1==="http:"?80:RegExp.$1==="https:"?443:-1,path:RegExp.$5,file:RegExp.$6,pathname:RegExp.$5+RegExp.$6,search:RegExp.$7,hash:RegExp.$8,toString:new Function("return this.protocol+'//'+this.hostname+':'+this.port+this.path+this.file+this.search+this.hash;")};return null}$.fn.create=function(){if(arguments.length==1&&typeof arguments[0]!=="string")return createdElementIE(arguments[0]);if(useBehaviors&&
!document.getElementById("jcade.create.htc"))$("HEAD").append('<style id="jcade.create.htc">.jcade\\.destroy {behavior:url('+$.fn.create.htcPath+"jcade.destroy.htc)}</style>");if(arguments.length==0)return this;var selector=arguments[0],eventData=null,handler,noExisting=false,bindId=nextBindId++;if(arguments.length>2&&typeof arguments[2]==="function"){eventData=arguments[1];handler=arguments[2];noExisting=arguments.length>3&&arguments[3]}else{handler=arguments[1];noExisting=arguments.length>2&&arguments[2]}bindings.push({selector:selector,
context:this,data:eventData,handler:handler,bindId:bindId});if(useBehaviors){var added=false;if(false){var unescapedSelector=selector.replace(/\\/g,"");for(var i=0;i<document.styleSheets.length&&!added;i++){var rules=document.styleSheets[i].rules;for(var j=0;j<rules.length&&!added;j++){var rule=rules[j];if(rule.selectorText===unescapedSelector){rule.style.behavior="url("+$.fn.create.htcPath+"jcade.create.htc) "+rule.style.behavior;added=true}}}}document.getElementById("jcade.create.htc").styleSheet.addRule(selector,
"behavior:url("+$.fn.create.htcPath+"jcade.create.htc)",0)}else{var delayHandle=null;var self=this;this.bind("DOMNodeInserted.jcade.create",function(event){if(!delayHandle)delayHandle=window.setTimeout(function(){delayHandle=null;searchAndHandle(selector,self,eventData,handler,bindId)},1)})}if(noExisting)$(selector,this).each(function(index,e){e[attr]=true});else if($.isReady)searchAndHandle(selector,this,eventData,handler,bindId);else if(!useBehaviors)$(function(){searchAndHandle(selector,self,eventData,
handler,bindId)});return this};$.fn.create.htcPath=function(){var path="";if(typeof jQuery_fn_create_htcPath==="string")path=jQuery_fn_create_htcPath;else{var scripts=document.getElementsByTagName("SCRIPT");for(var i=0;i<scripts.length;i++)if(typeof scripts[i].src==="string"&&scripts[i].src.search(/^(.*\b)jcade(\.min)?\.js(\?.*)?(#.*)?$/i)==0){path=RegExp.$1;break}}var url=parseUrl(path);if(url&&window.location.hostname.length>0&&url.hostname!==window.location.hostname)path="/";return path}();$.fn.create.tagByClassName=
function(elements,className){return $.fn.create.tag(elements,"."+className.replace(/\./g,"\\."))};$.fn.create.tag=function(elements,selector){elements=$(elements);elements.each(function(index,element){element[attr]=true});for(var i=0;i<bindings.length;i++)if(bindings[i]&&bindings[i].selector===selector){var a=attr+bindings[i].bindId;elements.each(function(index,element){element[a]=true})}}})(jQuery);
(function($){var useBehaviors=$.browser.msie&&$.browser.version<9;var bindings=[],attr="jcade.destroy.tagged_",nextBindId=0;function getEvent(target,data){var event=jQuery.Event("destroy");event.currentTarget=event.target=target;event.data=data;return event}function destroyedElementIE(element){for(var i=0;i<bindings.length;i++)if(bindings[i]&&bindings[i].element===element){element[attr+bindings[i].bindId]=true;bindings[i].handler(getEvent(element,bindings[i].data));bindings[i]=null}}$.fn.destroy=
function(){if(arguments.length==1&&typeof arguments[0]!=="function")return destroyedElementIE(arguments[0]);var eventData=null,handler,namespace=null,bindId=nextBindId++;if(arguments.length>1&&typeof arguments[1]==="function"){eventData=arguments[0];handler=arguments[1];if(arguments.length>2&&typeof arguments[2]==="string"&&arguments[2].length>0)namespace=arguments[2]}else{handler=arguments[0];if(arguments.length>1&&typeof arguments[1]==="string"&&arguments[1].length>0)namespace=arguments[1]}this.addClass("jcade.destroy");
if(useBehaviors){$.fn.create();this.each(function(index,element){bindings.push({element:element,namespace:namespace,data:eventData,handler:handler,bindId:bindId})})}else this.bind("DOMNodeRemoved.jcade"+(namespace?"."+namespace:""),function(event){if(event.target!==event.currentTarget)return;$(".jcade\\.destroy",event.target).triggerHandler("DOMNodeRemoved");var e=$(event.target);if(e.hasClass("jcade.destroy")&&!event.target[attr+bindId]){event.target[attr+bindId]=true;handler(getEvent(event.target,
eventData))}});return this}})(jQuery);
(function($){function makeFactory(classPath,factoryOptions){var factory=$.extend({path:classPath,name:classPath.split(".").pop(),invoker:new Function("arg1","arg2","factory","return new "+classPath+"(arg1,arg2);"),reverseArgs:false,options:null,optionsName:"*:options",optionsParser:new Function("options","element","factory","var b=options.search(/^\\w*{/),c=options.indexOf(':'),p=options.indexOf('(');if (b>=0 || (p>=0 && (c<0 || p<c)))return (new Function('return '+options+';'))();return (new Function('return {'+options+'};'))();"),noExisting:false,
filter:new Function("element","options","return true;"),handler:function(event){var element=$(event.target);var options=element[0].getAttribute(factory.optionsName.replace(/\*/g,factory.name))||element[0].getAttribute(factory.optionsName.replace(/\*/g,factory.path));if(typeof options==="string")options=factory.optionsParser(options,element,factory);if(factory.options)options=$.extend({},factory.options,options);if(factory.filter(element,options))factory.invoker(factory.reverseArgs?element:options,
factory.reverseArgs?options:element,factory)}},factoryOptions);$(document).create("."+classPath.replace(/\./g,"\\."),factory.handler,factory.noExisting);return factory}$.uiFactory=function(){var factoryOptions=arguments.length>1&&typeof arguments[arguments.length-1]!=="string"?arguments[arguments.length-1]:null;for(var i=0;i<arguments.length;i++)if(typeof arguments[i]==="string")makeFactory(arguments[i],factoryOptions);return this};if($.isFunction($.fn.datepicker))$.uiFactory("jQuery.ui.datepicker",
{invoker:new Function("options","element","element.datepicker(options)")});if($.isFunction($.widget)&&$.isFunction($.widget.bridge)){var bridge=$.widget.bridge;$.widget.bridge=function(name,object){bridge.apply(this,arguments);$.uiFactory("jQuery."+object.prototype.namespace+"."+name,{invoker:new Function("options","element","element."+name+"(options)")})};for(var i in $.ui)if($.isFunction($.ui[i])&&$.ui[i].toString().indexOf("this._createWidget")>0)$.uiFactory("jQuery.ui."+i,{invoker:new Function("options",
"element","element."+i+"(options);")})}})(jQuery);/*

 Copyright (c) 2011 Oscar Godson ( http://oscargodson.com ) and Sebastian Nitu ( http://sebnitu.com )

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.

 More infomation on http://oscargodson.com/labs/jkey
 or fork it at https://github.com/OscarGodson/jKey

 Special thanks to Macy Abbey
*/
(function($){$.fn.jkey=function(keyCombo,options,callback){var keyCodes={"a":65,"b":66,"c":67,"d":68,"e":69,"f":70,"g":71,"h":72,"i":73,"j":74,"k":75,"l":76,"m":77,"n":78,"o":79,"p":80,"q":81,"r":82,"s":83,"t":84,"u":85,"v":86,"w":87,"x":88,"y":89,"z":90,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,"f1":112,"f2":113,"f3":114,"f4":115,"f5":116,"f6":117,"f7":118,"f8":119,"f9":120,"f10":121,"f11":122,"f12":123,"shift":16,"ctrl":17,"control":17,"alt":18,"option":18,"opt":18,"cmd":224,"command":224,
"fn":255,"function":255,"backspace":8,"osxdelete":8,"enter":13,"return":13,"space":32,"spacebar":32,"esc":27,"escape":27,"tab":9,"capslock":20,"capslk":20,"super":91,"windows":91,"insert":45,"delete":46,"home":36,"end":35,"pgup":33,"pageup":33,"pgdn":34,"pagedown":34,"left":37,"up":38,"right":39,"down":40,"`":96,"~":96,"-":45,"_":45,"=":187,"+":187,"[":219,"{":219,"]":221,"}":221,"\\":220,"|":220,";":59,":":59,"'":222,'"':222,",":188,"<":188,".":190,">":190,"/":191,"?":191};var x="";var y="";if(typeof options==
"function"&&typeof callback=="undefined"){callback=options;options=false}if(keyCombo.toString().indexOf(",")>-1)var keySplit=keyCombo.match(/[a-zA-Z0-9]+/gi);else var keySplit=[keyCombo];for(x in keySplit){if(!keySplit.hasOwnProperty(x))continue;if(keySplit[x].toString().indexOf("+")>-1){var combo=[];var comboSplit=keySplit[x].split("+");for(y in comboSplit)combo[y]=keyCodes[comboSplit[y]];keySplit[x]=combo}else keySplit[x]=keyCodes[keySplit[x]]}function swapJsonKeyValues(input){var one,output={};
for(one in input)if(input.hasOwnProperty(one))output[input[one]]=one;return output}var keyCodesSwitch=swapJsonKeyValues(keyCodes);return this.each(function(){$this=$(this);var activeKeys=[];$this.bind("keydown",function(e){activeKeys[e.keyCode]=e.keyCode;if($.inArray(e.keyCode,keySplit)>-1){if(typeof callback=="function"){callback.call(this,keyCodesSwitch[e.keyCode]);if(options===false)e.preventDefault()}}else for(x in keySplit)if($.inArray(e.keyCode,keySplit[x])>-1){var active="unchecked";for(y in keySplit[x])if(active!=
false)if($.inArray(keySplit[x][y],activeKeys)>-1)active=true;else active=false;if(active===true)if(typeof callback=="function"){var activeString="";for(var z in activeKeys)if(activeKeys[z]!="")activeString+=keyCodesSwitch[activeKeys[z]]+"+";activeString=activeString.substring(0,activeString.length-1);callback.call(this,activeString);if(options===false)e.preventDefault()}}}).bind("keyup",function(e){activeKeys[e.keyCode]=""})})}})(jQuery);jQuery.jQueryRandom=0;jQuery.extend(jQuery.expr[":"],{random:function(a,i,m,r){if(i==0)jQuery.jQueryRandom=Math.floor(Math.random()*r.length);return i==jQuery.jQueryRandom}});(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:"/.|,/g",onRenderHeader:null,selectorHeaders:"thead th",
debug:false};function benchmark(s,d){log(s+","+((new Date).getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined")console.log(s);else alert(s)}function buildParserCache(table,$headers){if(table.config.debug)var parsersDebug="";if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&
$($headers[i]).metadata().sorter))p=getParserById($($headers[i]).metadata().sorter);else if(table.config.headers[i]&&table.config.headers[i].sorter)p=getParserById(table.config.headers[i].sorter);if(!p)p=detectParserForColumn(table,rows,-1,i);if(table.config.debug)parsersDebug+="column:"+i+" parser:"+p.id+"\n";list.push(p)}}if(table.config.debug)log(parsersDebug);return list}function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;
while(nodeValue==""&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug)log("Checking if value was empty on row:"+rowIndex)}else keepLooking=false}for(var i=1;i<l;i++)if(parsers[i].is(nodeValue,table,node))return parsers[i];return parsers[0]}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex]}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,
node))}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++)if(parsers[i].id.toLowerCase()==name.toLowerCase())return parsers[i];return false}function buildCache(table){if(table.config.debug)var cacheTime=new Date;var totalRows=table.tBodies[0]&&table.tBodies[0].rows.length||0,totalCells=table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];
if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue}cache.row.push(c);for(var j=0;j<totalCells;++j)cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null}if(table.config.debug)benchmark("Building cache for "+totalRows+" rows:",cacheTime);return cache}function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=
node.textContent||false;if(config.textExtraction=="simple")if(config.supportsTextContent)text=node.textContent;else if(node.childNodes[0]&&node.childNodes[0].hasChildNodes())text=node.childNodes[0].innerHTML;else text=node.innerHTML;else if(typeof config.textExtraction=="function")text=config.textExtraction(node);else text=$(node).text();return text}function appendToTable(table,cache){if(table.config.debug)var appendTime=new Date;var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=n[0].length-
1,tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++)tableBody[0].appendChild(r[pos][j])}}if(table.config.appender)table.config.appender(table,rows);rows=null;if(table.config.debug)benchmark("Rebuilt table:",appendTime);applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug)var time=new Date;var meta=$.metadata?
true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=
$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName("THEAD")[0];var trs=thead.getElementsByTagName("TR");for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];
var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1;var firstAvailCol;if(typeof matrix[rowIndex]=="undefined")matrix[rowIndex]=[];for(var k=0;k<matrix[rowIndex].length+1;k++)if(typeof matrix[rowIndex][k]=="undefined"){firstAvailCol=k;break}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof matrix[k]=="undefined")matrix[k]=[];var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++)matrixrow[l]=
"x"}}}return lookup}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1)arr=arr.concat(checkCellColSpan(table,headerArr,row++));else if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1]))arr.push(cell)}return arr}function checkHeaderMetadata(cell){if($.metadata&&$(cell).metadata().sorter===false)return true;return false}function checkHeaderOptions(table,i){if(table.config.headers[i]&&table.config.headers[i].sorter===
false)return true;return false}function checkHeaderOptionsSortingLocked(table,i){if(table.config.headers[i]&&table.config.headers[i].lockedOrder)return table.config.headers[i].lockedOrder;return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++)getWidgetById(c[i]).format(table)}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++)if(widgets[i].id.toLowerCase()==name.toLowerCase())return widgets[i]}function formatSortingOrder(v){if(typeof v!=
"Number")return v.toLowerCase()=="desc"?1:0;else return v==1?1:0}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++)if(a[i][0]==v)return true;return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled)h[this.column]=$(this)});var l=list.length;for(var i=0;i<l;i++)h[list[i][0]].addClass(css[list[i][1]])}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=
$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug)var sortTime=new Date;var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=
sortList[i][0];var order=sortList[i][1];var s=table.config.parsers[c].type=="text"?order==0?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c):order==0?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c);var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++)dynamicExp+="}; ";dynamicExp+=
"return 0; ";dynamicExp+="}; ";if(table.config.debug)benchmark("Evaling expression:"+dynamicExp,new Date);eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug)benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);return cache}function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=="text"&&direction=="asc")return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+
a+" < "+b+") ? -1 : 1 )));";else if(type=="text"&&direction=="desc")return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";else if(type=="numeric"&&direction=="asc")return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";else if(type=="numeric"&&direction=="desc")return"("+a+" === null && "+b+" === null) ? 0 :("+
a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));"}function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));"}function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));"}function makeSortNumeric(i){return"a["+i+"]-b["+i+"];"}function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];"}function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return a<
b?-1:a>b?1:0}function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return b<a?-1:b>a?1:0}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=
$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=$this[0].tBodies[0]&&$this[0].tBodies[0].rows.length||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=
[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++)if(a[j][0]!=i)config.sortList.push(a[j])}config.sortList.push([i,this.order])}else if(isValueInArray(i,config.sortList))for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}else config.sortList.push([i,this.order]);setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],
config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me)},1)}).bind("updateCell",function(e,cell){var config=this.config;var pos=[cell.parentNode.rowIndex-1,cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell)}).bind("sorton",
function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist))config.sortList=$(this).metadata().sortlist;
if(config.sortList.length>0)$this.trigger("sorton",[config.sortList]);applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++)if(parsers[i].id.toLowerCase()==parser.id.toLowerCase())a=false;if(a)parsers.push(parser)};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return isNaN(i)?0:i};this.formatInt=function(s){var i=parseInt(s);return isNaN(i)?0:i};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,
"")))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild)}empty.apply(table.tBodies[0])}else table.tBodies[0].innerHTML=""}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLocaleLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},
type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[\u00a3$\u20ac?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[\u00a3$\u20ac]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2)r+="0"+item;else r+=item}return $.tablesorter.formatFloat(r)},type:"numeric"});
ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat(s!=""?(new Date(s.replace(new RegExp(/-/g),"/"))).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),
""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat((new Date(s)).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us")s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,
"$3/$1/$2");else if(c.dateFormat=="uk")s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy")s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");return $.tablesorter.formatFloat((new Date(s)).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat((new Date("2000/01/01 "+s)).getTime())},
type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=!c.parserMetadataName?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug)var time=new Date;var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=row%2==0;$tr.removeClass(table.config.widgetZebra.css[odd?
0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug)$.tablesorter.benchmark("Applying Zebra widget",time)}})})(jQuery);(function($){$.extend({tablesorterPager:new function(){function updatePageDisplay(c){var s=$(c.cssPageDisplay,c.container).val(c.page+1+c.seperator+c.totalPages)}function setPageSize(table,size){var c=table.config;c.size=size;c.totalPages=Math.ceil(c.totalRows/c.size);c.pagerPositionSet=false;moveToPage(table);fixPosition(table)}function fixPosition(table){var c=table.config;if(!c.pagerPositionSet&&c.positionFixed){var c=table.config,o=$(table);if(o.offset)c.container.css({top:o.offset().top+o.height()+
"px",position:"absolute"});c.pagerPositionSet=true}}function moveToFirstPage(table){var c=table.config;c.page=0;moveToPage(table)}function moveToLastPage(table){var c=table.config;c.page=c.totalPages-1;moveToPage(table)}function moveToNextPage(table){var c=table.config;c.page++;if(c.page>=c.totalPages-1)c.page=c.totalPages-1;moveToPage(table)}function moveToPrevPage(table){var c=table.config;c.page--;if(c.page<=0)c.page=0;moveToPage(table)}function moveToPage(table){var c=table.config;if(c.page<0||
c.page>c.totalPages-1)c.page=0;renderTable(table,c.rowsCopy)}function renderTable(table,rows){var c=table.config;var l=rows.length;var s=c.page*c.size;var e=s+c.size;if(e>rows.length)e=rows.length;var tableBody=$(table.tBodies[0]);for(var i=0;i<rows.length;i++){var o=rows[i];var l=o.length;for(var j=0;j<l;j++)if(i>=s&&i<e){tableBody[0].appendChild(o[j]);$(o[j]).removeClass("hidden")}else $(o[j]).addClass("hidden")}fixPosition(table,tableBody);$(table).trigger("applyWidgets");if(c.page>=c.totalPages)moveToLastPage(table);
updatePageDisplay(c)}this.appender=function(table,rows){var c=table.config;c.rowsCopy=rows;c.totalRows=rows.length;c.totalPages=Math.ceil(c.totalRows/c.size);renderTable(table,rows)};this.defaults={size:10,offset:0,page:0,totalRows:0,totalPages:0,container:null,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",seperator:"/",positionFixed:true,appender:this.appender};this.construct=function(settings){return this.each(function(){config=
$.extend(this.config,$.tablesorterPager.defaults,settings);var table=this,pager=config.container;$(this).trigger("appendCache");config.size=parseInt($(".pagesize",pager).val());$(config.cssFirst,pager).click(function(){moveToFirstPage(table);return false});$(config.cssNext,pager).click(function(){moveToNextPage(table);return false});$(config.cssPrev,pager).click(function(){moveToPrevPage(table);return false});$(config.cssLast,pager).click(function(){moveToLastPage(table);return false});$(config.cssPageSize,
pager).change(function(){setPageSize(table,parseInt($(this).val()));return false})})}}});$.fn.extend({tablesorterPager:$.tablesorterPager.construct})})(jQuery);/*

 jQuery Konami code trigger v. 0.1

 Copyright (c) 2009 Joe Mastey
 Dual licensed under the MIT and GPL licenses:
   http://www.opensource.org/licenses/mit-license.php
   http://www.gnu.org/licenses/gpl.html
*/
(function($){$.fn.konami=function(fn,params){params=$.extend({},$.fn.konami.params,params);this.each(function(){var tgt=$(this);tgt.bind("konami",fn).bind("keyup",function(event){$.fn.konami.checkCode(event,params,tgt)})});return this};$.fn.konami.params={"code":[38,38,40,40,37,39,37,39,66,65],"step":0};$.fn.konami.checkCode=function(event,params,tgt){if(event.keyCode==params.code[params.step])params.step++;else params.step=0;if(params.step==params.code.length){tgt.trigger("konami");params.step=0}}})(jQuery);(function(){var root;if(typeof window==="object"&&window)root=window;else root=global;if(typeof module!=="undefined"&&module.exports)module.exports=root.Promise?root.Promise:Promise;else if(!root.Promise)root.Promise=Promise;var asap=root.setImmediate||function(fn){setTimeout(fn,1)};function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}var isArray=Array.isArray||function(value){return Object.prototype.toString.call(value)==="[object Array]"};function Promise(fn){if(typeof this!==
"object")throw new TypeError("Promises must be constructed via new");if(typeof fn!=="function")throw new TypeError("not a function");this._state=null;this._value=null;this._deferreds=[];doResolve(fn,bind(resolve,this),bind(reject,this))}function handle(deferred){var me=this;if(this._state===null){this._deferreds.push(deferred);return}asap(function(){var cb=me._state?deferred.onFulfilled:deferred.onRejected;if(cb===null){(me._state?deferred.resolve:deferred.reject)(me._value);return}var ret;try{ret=
cb(me._value)}catch(e){deferred.reject(e);return}deferred.resolve(ret)})}function resolve(newValue){try{if(newValue===this)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&(typeof newValue==="object"||typeof newValue==="function")){var then=newValue.then;if(typeof then==="function"){doResolve(bind(then,newValue),bind(resolve,this),bind(reject,this));return}}this._state=true;this._value=newValue;finale.call(this)}catch(e){reject.call(this,e)}}function reject(newValue){this._state=
false;this._value=newValue;finale.call(this)}function finale(){for(var i=0,len=this._deferreds.length;i<len;i++)handle.call(this,this._deferreds[i]);this._deferreds=null}function Handler(onFulfilled,onRejected,resolve,reject){this.onFulfilled=typeof onFulfilled==="function"?onFulfilled:null;this.onRejected=typeof onRejected==="function"?onRejected:null;this.resolve=resolve;this.reject=reject}function doResolve(fn,onFulfilled,onRejected){var done=false;try{fn(function(value){if(done)return;done=true;
onFulfilled(value)},function(reason){if(done)return;done=true;onRejected(reason)})}catch(ex){if(done)return;done=true;onRejected(ex)}}Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)};Promise.prototype.then=function(onFulfilled,onRejected){var me=this;return new Promise(function(resolve,reject){handle.call(me,new Handler(onFulfilled,onRejected,resolve,reject))})};Promise.all=function(){var args=Array.prototype.slice.call(arguments.length===1&&isArray(arguments[0])?
arguments[0]:arguments);return new Promise(function(resolve,reject){if(args.length===0)return resolve([]);var remaining=args.length;function res(i,val){try{if(val&&(typeof val==="object"||typeof val==="function")){var then=val.then;if(typeof then==="function"){then.call(val,function(val){res(i,val)},reject);return}}args[i]=val;if(--remaining===0)resolve(args)}catch(ex){reject(ex)}}for(var i=0;i<args.length;i++)res(i,args[i])})};Promise.resolve=function(value){if(value&&typeof value==="object"&&value.constructor===
Promise)return value;return new Promise(function(resolve){resolve(value)})};Promise.reject=function(value){return new Promise(function(resolve,reject){reject(value)})};Promise.race=function(values){return new Promise(function(resolve,reject){for(var i=0,len=values.length;i<len;i++)values[i].then(resolve,reject)})}})();var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}};
"undefined"!==typeof module&&module.exports&&(module.exports=sjcl);"function"===typeof define&&define([],function(){return sjcl});
sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.j(a.slice(b/32),32-(b&31)).slice(1);return void 0===c?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.j(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===
b?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b&=31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0===
c},j:function(a,b,c,d){var e;e=0;for(void 0===d&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},l:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&65280|(c&65280)<<8|c<<24;return a}};
sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}};
sjcl.codec.base64={g:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,g=sjcl.codec.base64.g,f=0,l=sjcl.bitArray.bitLength(a);c&&(g=g.substr(0,62)+"-_");for(c=0;6*d.length<l;)d+=g.charAt((f^a[c]>>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,g=sjcl.codec.base64.g,f=0,l;b&&(g=g.substr(0,62)+"-_");for(d=0;d<a.length;d++){l=g.indexOf(a.charAt(d));
if(0>l)throw new sjcl.exception.invalid("this isn't base64!");26<e?(e-=26,c.push(f^l>>>e),f=l<<32-e):(e+=6,f^=l<<32-e)}e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.e[0]||t(this);a?(this.d=a.d.slice(0),this.c=a.c.slice(0),this.a=a.a):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()};
sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.d=this.i.slice(0);this.c=[];this.a=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.c=sjcl.bitArray.concat(this.c,a);b=this.a;a=this.a=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)u(this,c.splice(0,16));return this},finalize:function(){var a,b=this.c,c=this.d,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.a/
4294967296));for(b.push(this.a|0);b.length;)u(this,b.splice(0,16));this.reset();return c},i:[],e:[]};
function u(a,b){var c,d,e,g=b.slice(0),f=a.d,l=a.e,r=f[0],h=f[1],m=f[2],p=f[3],k=f[4],q=f[5],n=f[6],s=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+s+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(n^k&(q^n))+l[c],s=n,n=q,q=k,k=p+d|0,p=m,m=h,h=r,r=d+(h&m^p&(h^m))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0;f[0]=f[0]+r|0;f[1]=f[1]+h|0;f[2]=f[2]+m|0;f[3]=f[3]+p|0;f[4]=f[4]+k|0;f[5]=f[5]+q|0;f[6]=
f[6]+n|0;f[7]=f[7]+s|0}function t(a){function b(a){return 4294967296*(a-Math.floor(a))|0}var c=0,d=2,e;a:for(;64>c;d++){for(e=2;e*e<=d;e++)if(0===d%e)continue a;8>c&&(a.i[c]=b(Math.pow(d,.5)));a.e[c]=b(Math.pow(d,1/3));c++}}sjcl.misc.hmac=function(a,b){this.h=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.b=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.b[0].update(c[0]);this.b[1].update(c[1]);this.f=new b(this.b[0])};
sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){if(this.k)throw new sjcl.exception.invalid("encrypt on already updated hmac called!");this.update(a);return this.digest(a)};sjcl.misc.hmac.prototype.reset=function(){this.f=new this.h(this.b[0]);this.k=!1};sjcl.misc.hmac.prototype.update=function(a){this.k=!0;this.f.update(a)};sjcl.misc.hmac.prototype.digest=function(){var a=this.f.finalize(),a=(new this.h(this.b[1])).update(a).finalize();this.reset();return a};
/*

 QR Code Generator for JavaScript

 Copyright (c) 2009 Kazuhiko Arase

 URL: http://www.d-project.com/

 Licensed under the MIT license:
  http://www.opensource.org/licenses/mit-license.php

 The word 'QR Code' is registered trademark of
 DENSO WAVE INCORPORATED
  http://www.denso-wave.com/qrcode/faqpatent-e.html

 qrcodejs - https://github.com/davidshimjs/qrcodejs/
 Copyright (c) 2012 davidshimjs
 Licensed under the MIT license:
  http://www.opensource.org/licenses/mit-license.php
*/
var QRCode;
(function(){function y(a){this.mode=r.MODE_8BIT_BYTE;this.data=a;this.parsedData=[];a=0;for(var d=this.data.length;a<d;a++){var b=[],c=this.data.charCodeAt(a);65536<c?(b[0]=240|(c&1835008)>>>18,b[1]=128|(c&258048)>>>12,b[2]=128|(c&4032)>>>6,b[3]=128|c&63):2048<c?(b[0]=224|(c&61440)>>>12,b[1]=128|(c&4032)>>>6,b[2]=128|c&63):128<c?(b[0]=192|(c&1984)>>>6,b[1]=128|c&63):b[0]=c;this.parsedData.push(b)}this.parsedData=Array.prototype.concat.apply([],this.parsedData);this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),
this.parsedData.unshift(187),this.parsedData.unshift(239))}function q(a,d){this.typeNumber=a;this.errorCorrectLevel=d;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function w(a,d){if(void 0==a.length)throw Error(a.length+"/"+d);for(var b=0;b<a.length&&0==a[b];)b++;this.num=Array(a.length-b+d);for(var c=0;c<a.length-b;c++)this.num[c]=a[c+b]}function t(a,d){this.totalCount=a;this.dataCount=d}function z(){this.buffer=[];this.length=0}function A(){var a=!1,d=navigator.userAgent;
/android/i.test(d)&&(a=!0,(d=d.toString().match(/android ([0-9]\.[0-9])/i))&&d[1]&&(a=parseFloat(d[1])));return a}y.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var d=0,b=this.parsedData.length;d<b;d++)a.put(this.parsedData[d],8)}};q.prototype={addData:function(a){a=new y(a);this.dataList.push(a);this.dataCache=null},isDark:function(a,d){if(0>a||this.moduleCount<=a||0>d||this.moduleCount<=d)throw Error(a+","+d);return this.modules[a][d]},getModuleCount:function(){return this.moduleCount},
make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,d){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++){this.modules[b]=Array(this.moduleCount);for(var c=0;c<this.moduleCount;c++)this.modules[b][c]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,
d);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=q.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,d)},setupPositionProbePattern:function(a,d){for(var b=-1;7>=b;b++)if(!(-1>=a+b||this.moduleCount<=a+b))for(var c=-1;7>=c;c++)-1>=d+c||this.moduleCount<=d+c||(this.modules[a+b][d+c]=0<=b&&6>=b&&(0==c||6==c)||0<=c&&6>=c&&(0==b||6==b)||2<=b&&4>=b&&2<=c&&4>=c?!0:!1)},getBestMaskPattern:function(){for(var a=0,d=0,b=0;8>b;b++){this.makeImpl(!0,
b);var c=k.getLostPoint(this);if(0==b||a>c)a=c,d=b}return d},createMovieClip:function(a,d,b){a=a.createEmptyMovieClip(d,b);this.make();for(d=0;d<this.modules.length;d++){b=1*d;for(var c=0;c<this.modules[d].length;c++){var e=1*c;this.modules[d][c]&&(a.beginFill(0,100),a.moveTo(e,b),a.lineTo(e+1,b),a.lineTo(e+1,b+1),a.lineTo(e,b+1),a.endFill())}}return a},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-
8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=k.getPatternPosition(this.typeNumber),d=0;d<a.length;d++)for(var b=0;b<a.length;b++){var c=a[d],e=a[b];if(null==this.modules[c][e])for(var f=-2;2>=f;f++)for(var h=-2;2>=h;h++)this.modules[c+f][e+h]=-2==f||2==f||-2==h||2==h||0==f&&0==h?!0:!1}},setupTypeNumber:function(a){for(var d=k.getBCHTypeNumber(this.typeNumber),b=0;18>b;b++){var c=!a&&1==(d>>b&1);this.modules[Math.floor(b/3)][b%3+this.moduleCount-
8-3]=c}for(b=0;18>b;b++)c=!a&&1==(d>>b&1),this.modules[b%3+this.moduleCount-8-3][Math.floor(b/3)]=c},setupTypeInfo:function(a,d){for(var b=k.getBCHTypeInfo(this.errorCorrectLevel<<3|d),c=0;15>c;c++){var e=!a&&1==(b>>c&1);6>c?this.modules[c][8]=e:8>c?this.modules[c+1][8]=e:this.modules[this.moduleCount-15+c][8]=e}for(c=0;15>c;c++)e=!a&&1==(b>>c&1),8>c?this.modules[8][this.moduleCount-c-1]=e:9>c?this.modules[8][15-c-1+1]=e:this.modules[8][15-c-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,
d){for(var b=-1,c=this.moduleCount-1,e=7,f=0,h=this.moduleCount-1;0<h;h-=2)for(6==h&&h--;;){for(var g=0;2>g;g++)if(null==this.modules[c][h-g]){var m=!1;f<a.length&&(m=1==(a[f]>>>e&1));k.getMask(d,c,h-g)&&(m=!m);this.modules[c][h-g]=m;e--; -1==e&&(f++,e=7)}c+=b;if(0>c||this.moduleCount<=c){c-=b;b=-b;break}}}};q.PAD0=236;q.PAD1=17;q.createData=function(a,d,b){d=t.getRSBlocks(a,d);for(var c=new z,e=0;e<b.length;e++){var f=b[e];c.put(f.mode,4);c.put(f.getLength(),k.getLengthInBits(f.mode,a));f.write(c)}for(e=
a=0;e<d.length;e++)a+=d[e].dataCount;if(c.getLengthInBits()>8*a)throw Error("code length overflow. ("+c.getLengthInBits()+">"+8*a+")");for(c.getLengthInBits()+4<=8*a&&c.put(0,4);0!=c.getLengthInBits()%8;)c.putBit(!1);for(;!(c.getLengthInBits()>=8*a);){c.put(q.PAD0,8);if(c.getLengthInBits()>=8*a)break;c.put(q.PAD1,8)}return q.createBytes(c,d)};q.createBytes=function(a,d){for(var b=0,c=0,e=0,f=Array(d.length),h=Array(d.length),g=0;g<d.length;g++){var m=d[g].dataCount,v=d[g].totalCount-m,c=Math.max(c,
m),e=Math.max(e,v);f[g]=Array(m);for(var l=0;l<f[g].length;l++)f[g][l]=255&a.buffer[l+b];b+=m;l=k.getErrorCorrectPolynomial(v);m=(new w(f[g],l.getLength()-1)).mod(l);h[g]=Array(l.getLength()-1);for(l=0;l<h[g].length;l++)v=l+m.getLength()-h[g].length,h[g][l]=0<=v?m.get(v):0}for(l=g=0;l<d.length;l++)g+=d[l].totalCount;b=Array(g);for(l=m=0;l<c;l++)for(g=0;g<d.length;g++)l<f[g].length&&(b[m++]=f[g][l]);for(l=0;l<e;l++)for(g=0;g<d.length;g++)l<h[g].length&&(b[m++]=h[g][l]);return b};for(var r={MODE_NUMBER:1,
MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},u={L:1,M:0,Q:3,H:2},k={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,
86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var d=a<<10;0<=k.getBCHDigit(d)-k.getBCHDigit(k.G15);)d^=k.G15<<k.getBCHDigit(d)-k.getBCHDigit(k.G15);return(a<<10|d)^k.G15_MASK},getBCHTypeNumber:function(a){for(var d=a<<12;0<=k.getBCHDigit(d)-k.getBCHDigit(k.G18);)d^=k.G18<<k.getBCHDigit(d)-
k.getBCHDigit(k.G18);return a<<12|d},getBCHDigit:function(a){for(var d=0;0!=a;)d++,a>>>=1;return d},getPatternPosition:function(a){return k.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,d,b){switch(a){case 0:return 0==(d+b)%2;case 1:return 0==d%2;case 2:return 0==b%3;case 3:return 0==(d+b)%3;case 4:return 0==(Math.floor(d/2)+Math.floor(b/3))%2;case 5:return 0==d*b%2+d*b%3;case 6:return 0==(d*b%2+d*b%3)%2;case 7:return 0==(d*b%3+(d+b)%2)%2;default:throw Error("bad maskPattern:"+a);}},getErrorCorrectPolynomial:function(a){for(var d=
new w([1],0),b=0;b<a;b++)d=d.multiply(new w([1,n.gexp(b)],0));return d},getLengthInBits:function(a,d){if(1<=d&&10>d)switch(a){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw Error("mode:"+a);}else if(27>d)switch(a){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw Error("mode:"+a);}else if(41>d)switch(a){case r.MODE_NUMBER:return 14;
case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw Error("mode:"+a);}else throw Error("type:"+d);},getLostPoint:function(a){for(var d=a.getModuleCount(),b=0,c=0;c<d;c++)for(var e=0;e<d;e++){for(var f=0,h=a.isDark(c,e),g=-1;1>=g;g++)if(!(0>c+g||d<=c+g))for(var m=-1;1>=m;m++)0>e+m||d<=e+m||0==g&&0==m||h!=a.isDark(c+g,e+m)||f++;5<f&&(b+=3+f-5)}for(c=0;c<d-1;c++)for(e=0;e<d-1;e++)if(f=0,a.isDark(c,e)&&f++,a.isDark(c+1,e)&&f++,a.isDark(c,e+1)&&f++,
a.isDark(c+1,e+1)&&f++,0==f||4==f)b+=3;for(c=0;c<d;c++)for(e=0;e<d-6;e++)a.isDark(c,e)&&!a.isDark(c,e+1)&&a.isDark(c,e+2)&&a.isDark(c,e+3)&&a.isDark(c,e+4)&&!a.isDark(c,e+5)&&a.isDark(c,e+6)&&(b+=40);for(e=0;e<d;e++)for(c=0;c<d-6;c++)a.isDark(c,e)&&!a.isDark(c+1,e)&&a.isDark(c+2,e)&&a.isDark(c+3,e)&&a.isDark(c+4,e)&&!a.isDark(c+5,e)&&a.isDark(c+6,e)&&(b+=40);for(e=f=0;e<d;e++)for(c=0;c<d;c++)a.isDark(c,e)&&f++;a=Math.abs(100*f/d/d-50)/5;return b+10*a}},n={glog:function(a){if(1>a)throw Error("glog("+
a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},p=0;8>p;p++)n.EXP_TABLE[p]=1<<p;for(p=8;256>p;p++)n.EXP_TABLE[p]=n.EXP_TABLE[p-4]^n.EXP_TABLE[p-5]^n.EXP_TABLE[p-6]^n.EXP_TABLE[p-8];for(p=0;255>p;p++)n.LOG_TABLE[n.EXP_TABLE[p]]=p;w.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var d=Array(this.getLength()+a.getLength()-1),b=0;b<
this.getLength();b++)for(var c=0;c<a.getLength();c++)d[b+c]^=n.gexp(n.glog(this.get(b))+n.glog(a.get(c)));return new w(d,0)},mod:function(a){if(0>this.getLength()-a.getLength())return this;for(var d=n.glog(this.get(0))-n.glog(a.get(0)),b=Array(this.getLength()),c=0;c<this.getLength();c++)b[c]=this.get(c);for(c=0;c<a.getLength();c++)b[c]^=n.gexp(n.glog(a.get(c))+d);return(new w(b,0)).mod(a)}};t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],
[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,
2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,
43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],
[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],
[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],
[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];t.getRSBlocks=function(a,d){var b=t.getRsBlockTable(a,d);if(void 0==b)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+d);for(var c=b.length/3,e=[],f=0;f<c;f++)for(var h=b[3*f+0],g=b[3*f+1],m=b[3*f+2],v=0;v<h;v++)e.push(new t(g,m));return e};
t.getRsBlockTable=function(a,d){switch(d){case u.L:return t.RS_BLOCK_TABLE[4*(a-1)+0];case u.M:return t.RS_BLOCK_TABLE[4*(a-1)+1];case u.Q:return t.RS_BLOCK_TABLE[4*(a-1)+2];case u.H:return t.RS_BLOCK_TABLE[4*(a-1)+3]}};z.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,d){for(var b=0;b<d;b++)this.putBit(1==(a>>>d-b-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var d=Math.floor(this.length/8);this.buffer.length<=d&&this.buffer.push(0);
a&&(this.buffer[d]|=128>>>this.length%8);this.length++}};var x=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,
751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],B=function(){var a=function(a,b){this._el=a;this._htOption=b};a.prototype.draw=function(a){function b(a,c){var b=document.createElementNS("http://www.w3.org/2000/svg",a),d;for(d in c)c.hasOwnProperty(d)&&
b.setAttribute(d,c[d]);return b}var c=this._htOption,e=this._el,f=a.getModuleCount();this.clear();var h=b("svg",{viewBox:"0 0 "+String(f)+" "+String(f),width:"100%",height:"100%",fill:c.colorLight});h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");e.appendChild(h);h.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"}));h.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(c=0;c<f;c++)for(e=0;e<f;e++)if(a.isDark(c,
e)){var g=b("use",{x:String(c),y:String(e)});g.setAttributeNS("http://www.w3.org/1999/xlink","href","#template");h.appendChild(g)}};a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)};return a}(),C="svg"===document.documentElement.tagName.toLowerCase()?B:"undefined"==typeof CanvasRenderingContext2D?function(){var a=function(a,b){this._el=a;this._htOption=b};a.prototype.draw=function(a){for(var b=this._htOption,c=this._el,e=a.getModuleCount(),f=Math.floor(b.width/
e),h=Math.floor(b.height/e),g=['<table style="border:0;border-collapse:collapse;">'],m=0;m<e;m++){g.push("<tr>");for(var k=0;k<e;k++)g.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+f+"px;height:"+h+"px;background-color:"+(a.isDark(m,k)?b.colorDark:b.colorLight)+';"></td>');g.push("</tr>")}g.push("</table>");c.innerHTML=g.join("");a=c.childNodes[0];c=(b.width-a.offsetWidth)/2;b=(b.height-a.offsetHeight)/2;0<c&&0<b&&(a.style.margin=b+"px "+c+"px")};a.prototype.clear=
function(){this._el.innerHTML=""};return a}():function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png");this._elImage.style.display="block";this._elCanvas.style.display="none"}function d(a,c){var b=this;b._fFail=c;b._fSuccess=a;if(null===b._bSupportDataURI){var d=document.createElement("img"),e=function(){b._bSupportDataURI=!1;b._fFail&&b._fFail.call(b)};d.onabort=e;d.onerror=e;d.onload=function(){b._bSupportDataURI=!0;b._fSuccess&&b._fSuccess.call(b)};d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="}else!0===
b._bSupportDataURI&&b._fSuccess?b._fSuccess.call(b):!1===b._bSupportDataURI&&b._fFail&&b._fFail.call(b)}if(this._android&&2.1>=this._android){var b=1/window.devicePixelRatio,c=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,d,e,m,k,l,n,p,r){if("nodeName"in a&&/img/i.test(a.nodeName))for(var q=arguments.length-1;1<=q;q--)arguments[q]*=b;else"undefined"==typeof p&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);c.apply(this,arguments)}}var e=
function(a,b){this._bIsPainted=!1;this._android=A();this._htOption=b;this._elCanvas=document.createElement("canvas");this._elCanvas.width=b.width;this._elCanvas.height=b.height;a.appendChild(this._elCanvas);this._el=a;this._oContext=this._elCanvas.getContext("2d");this._bIsPainted=!1;this._elImage=document.createElement("img");this._elImage.alt="Scan me!";this._elImage.style.display="none";this._el.appendChild(this._elImage);this._bSupportDataURI=null};e.prototype.draw=function(a){var b=this._elImage,
c=this._oContext,d=this._htOption,e=a.getModuleCount(),l=d.width/e,k=d.height/e,n=Math.round(l),p=Math.round(k);b.style.display="none";this.clear();for(b=0;b<e;b++)for(var q=0;q<e;q++){var r=a.isDark(b,q),t=q*l,u=b*k;c.strokeStyle=r?d.colorDark:d.colorLight;c.lineWidth=1;c.fillStyle=r?d.colorDark:d.colorLight;c.fillRect(t,u,l,k);c.strokeRect(Math.floor(t)+.5,Math.floor(u)+.5,n,p);c.strokeRect(Math.ceil(t)-.5,Math.ceil(u)-.5,n,p)}this._bIsPainted=!0};e.prototype.makeImage=function(){this._bIsPainted&&
d.call(this,a)};e.prototype.isPainted=function(){return this._bIsPainted};e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height);this._bIsPainted=!1};e.prototype.round=function(a){return a?Math.floor(1E3*a)/1E3:a};return e}();QRCode=function(a,d){this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:u.H};"string"===typeof d&&(d={text:d});if(d)for(var b in d)this._htOption[b]=d[b];"string"==typeof a&&(a=
document.getElementById(a));this._htOption.useSVG&&(C=B);this._android=A();this._el=a;this._oQRCode=null;this._oDrawing=new C(this._el,this._htOption);this._htOption.text&&this.makeCode(this._htOption.text)};QRCode.prototype.makeCode=function(a){var d=this._htOption.correctLevel,b=1,c;c=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");c=c.length+(c.length!=a?3:0);for(var e=0,f=x.length;e<=f;e++){var h=0;switch(d){case u.L:h=x[e][0];break;case u.M:h=x[e][1];break;case u.Q:h=x[e][2];break;case u.H:h=
x[e][3]}if(c<=h)break;else b++}if(b>x.length)throw Error("Too long data");this._oQRCode=new q(b,this._htOption.correctLevel);this._oQRCode.addData(a);this._oQRCode.make();this._el.title=a;this._oDrawing.draw(this._oQRCode);this.makeImage()};QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||3<=this._android)&&this._oDrawing.makeImage()};QRCode.prototype.clear=function(){this._oDrawing.clear()};QRCode.CorrectLevel=u})();
'use strict';function Vec2(a,b){this.x=a;this.y=b;"freeze"in Object&&Object.freeze(this)}Vec2.Add=function(a,b){return new Vec2(a.x+b.x,a.y+b.y)};Vec2.Subtract=function(a,b){return new Vec2(a.x-b.x,a.y-b.y)};Vec2.Multiply=function(a,b){return"Vec2"===typeof b?new Vec2(a.x*b.x,a.y*b.y):new Vec2(a.x*b,a.y*b)};Vec2.Int=function(a){return new Vec2(Math.round(a.x),Math.round(a.y))};Vec2.prototype.Normalise=function(a){a=this.Length();return new Vec2(this.x/a,this.y/a)};
Vec2.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};Vec2.prototype.clone=function(){return new Vec2(this.x,this.y)};function ProjectPointToLine(a,b,c){b=(b.y-a.y)/(b.x-a.x);a=a.y-b*a.x;return new Vec2(Math.floor((b*c.y+c.x-b*a)/(b*b+1)),Math.floor((b*b*c.y+b*c.x+a)/(b*b+1)))};var banners=[{colour:"rgb(164, 110, 60)",url:"//static.fimfiction.net/images/custom_banners/zecora.jpg?2",source:"http://aeronjvl.deviantart.com/art/Hanging-by-the-Edge-327757722",id:"zecora"},{colour:"rgb(164, 122, 60)",url:"//static.fimfiction.net/images/custom_banners/aeron_fluttershy.jpg?2",source:"http://aeronjvl.deviantart.com/art/Nature-326303180",id:"aeron_fluttershy"},{colour:"rgb(76, 112, 126)",url:"//static.fimfiction.net/images/custom_banners/aeron_philomena.jpg?2",source:"http://ajvl.deviantart.com/art/Philomena-Equestria-s-Finest-Phoenix-310217164",
id:"aeron_philomena"},{colour:"rgb(76, 126, 110)",url:"//static.fimfiction.net/images/custom_banners/aeron_celestia.jpg?2",source:"http://aeronjvl.deviantart.com/art/Path-to-Canterlot-340639474",id:"aeron_celestia"},{colour:"rgb(87, 102, 111)",url:"//static.fimfiction.net/images/custom_banners/derpy_dash.jpg?2",source:"http://ponykillerx.deviantart.com/art/Full-Armour-D-vs-D-288729315",id:"derpy_dash"},{colour:"rgb(83, 76, 121)",url:"//static.fimfiction.net/images/custom_banners/ponykiller_trixie.jpg?2",
source:"http://ponykillerx.deviantart.com/art/No-Title-Wallpaper-Version-287646346",id:"ponykiller_trixie"},{colour:"rgb(140, 151, 83)",url:"//static.fimfiction.net/images/custom_banners/yamio_fluttershy.jpg?2",source:"http://yamio.deviantart.com/art/Fluttershy-285372865",id:"yamio_fluttershy"},{colour:"rgb(146, 164, 60)",url:"//static.fimfiction.net/images/custom_banners/ratofdrawn_1.jpg?2",source:"http://ratofdrawn.deviantart.com/art/Wet-Fun-317158001",id:"ratofdrawn_1"},{colour:"rgb(100, 133, 190)",
url:"//static.fimfiction.net/images/custom_banners/ratofdrawn_rarijack.jpg?2",source:"http://ratofdrawn.deviantart.com/art/Differences-343226962",id:"ratofdrawn_rarijack"},{colour:"rgb(72, 60, 164)",url:"//static.fimfiction.net/images/custom_banners/solar_luna.jpg?2",source:"http://soapie-solar.deviantart.com/art/Chibi-Luna-Star-Fishing-340002341",id:"solar_luna"},{colour:"rgb(131, 164, 60)",url:"//static.fimfiction.net/images/custom_banners/solar_group.jpg?2",source:"http://soapie-solar.deviantart.com/art/Forest-Foundation-283012970",
id:"solar_group"},{colour:"rgb(164, 135, 60)",url:"//static.fimfiction.net/images/custom_banners/uc77_1.jpg?2",source:"http://uc77.deviantart.com/art/Ponies-Dig-Giant-Robots-281071953",id:"uc77_1"},{colour:"rgb(77, 60, 164)",url:"//static.fimfiction.net/images/custom_banners/cmaggot_fluttershy.jpg?2",source:"http://cmaggot.deviantart.com/art/Dangerous-Mission-342068171",id:"cmaggot_fluttershy"},{colour:"rgb(164, 114, 60)",url:"//static.fimfiction.net/images/custom_banners/rainbow_ss.jpg?2",source:"http://derpiboo.ru/41558",
id:"rainbow_ss"},{colour:"rgb(69, 100, 96)",url:"//static.fimfiction.net/images/custom_banners/rainbow_markerpone.jpg?2",source:"http://derpiboo.ru/131068",id:"rainbow_markerpone"},{colour:"rgb(164, 60, 152)",url:"//static.fimfiction.net/images/custom_banners/rainbow_roseluck.jpg?2",source:"http://derpiboo.ru/50361",id:"rainbow_roseluck"},{colour:"rgb(60, 114, 164)",url:"//static.fimfiction.net/images/custom_banners/jj_trixie.jpg?2",source:"http://johnjoseco.deviantart.com/art/Trixie-s-Life-is-so-Hard-340685374",
id:"jj_trixie"},{colour:"rgb(60, 118, 164)",url:"//static.fimfiction.net/images/custom_banners/anima_1.jpg?2",source:"http://spiritto.deviantart.com/art/C-mon-lift-your-Spirit-324914801",id:"anima_1"},{colour:"rgb(60, 147, 164)",url:"//static.fimfiction.net/images/custom_banners/mew_pinkie.jpg?2",source:"http://mewball.deviantart.com/art/Reflect-338427890",id:"mew_pinkie"},{colour:"rgb(60, 89, 164)",url:"//static.fimfiction.net/images/custom_banners/tsitra_dash.jpg?2",source:"http://tsitra360.deviantart.com/art/Morning-Flight-331710988",
id:"tsitra_dash"},{colour:"rgb(164, 127, 60)",url:"//static.fimfiction.net/images/custom_banners/knifeh_scoots.jpg?2",source:"http://knifeh.deviantart.com/art/Scootaloo-326771443",id:"knifeh_scoots"},{colour:"rgb(164, 89, 60)",url:"//static.fimfiction.net/images/custom_banners/noben_celestia.jpg?2",source:"http://noben.deviantart.com/art/Sunrise-in-Equestria-280309698",id:"noben_celestia"},{colour:"rgb(77, 60, 164)",url:"//static.fimfiction.net/images/custom_banners/ep_shady_trough.jpg?2",source:"http://equestria-prevails.deviantart.com/art/The-Shady-Trough-319986368",
id:"ep_shady_trough"},{colour:"rgb(60, 85, 164)",url:"//static.fimfiction.net/images/custom_banners/spittfire_1.jpg?2",source:"http://spittfireart.deviantart.com/art/The-Report-Commission-340421670",id:"spittfire_1"},{colour:"rgb(75, 77, 85)",url:"//static.fimfiction.net/images/custom_banners/blitzpony_luna.jpg?2",source:"http://blitzpony.deviantart.com/art/S-hard-to-say-359899432",id:"blitzpony_luna"},{colour:"rgb(71, 127, 179)",url:"//static.fimfiction.net/images/custom_banners/gsphere_scoots.jpg?2",
source:"http://lionel23.deviantart.com/art/The-Newbie-set-an-Academy-Record-356826950",id:"gsphere_scoots"},{colour:"rgb(112, 108, 167)",url:"//static.fimfiction.net/images/custom_banners/stoic_celestia.jpg?2",source:"http://thestoicmachine.deviantart.com/art/Radiant-Malevolence-213959523",id:"stoic_celestia"},{colour:"rgb(134, 125, 88)",url:"//static.fimfiction.net/images/custom_banners/moe_canterlot.jpg?2",source:"http://derpibooru.org/25",id:"moe_canterlot"},{colour:"rgb(119, 88, 134)",url:"//static.fimfiction.net/images/custom_banners/alasou_costumes.jpg?2",
source:"http://alasou.deviantart.com/art/Costume-Swap-party-381670764",id:"alasou_costumes"},{colour:"rgb(82, 90, 143)",url:"//static.fimfiction.net/images/custom_banners/pridark_luna.jpg?2",source:"http://pridark.deviantart.com/art/A-Wonderful-Night-381504014",id:"pridark_luna"},{colour:"rgb(165, 87, 68)",url:"//static.fimfiction.net/images/custom_banners/gign_flutterdash.jpg?2",source:"http://gign-3208.deviantart.com/art/In-the-attic-377732207",id:"gign_flutterdash"},{colour:"rgb(85, 107, 128)",
url:"//static.fimfiction.net/images/custom_banners/goben_forest.jpg?2",source:"http://noben.deviantart.com/art/Giggling-at-the-Ghosties-356451219",id:"goben_forest"},{colour:"rgb(104, 136, 90)",url:"//static.fimfiction.net/images/custom_banners/devinian_lyra_bonbon.jpg?2",source:"http://devinian.deviantart.com/art/Story-of-the-bench-373750983",id:"devinian_lyra_bonbon"},{colour:"rgb(116, 145, 66)",url:"//static.fimfiction.net/images/custom_banners/devinian_fluttershy.jpg?2",source:"http://devinian.deviantart.com/art/Picnic-with-Kindness-351639714",
id:"devinian_fluttershy"},{colour:"rgb(69, 132, 182)",url:"//static.fimfiction.net/images/custom_banners/jackalynn_pinkiedash.jpg?2",source:"http://jack-a-lynn.deviantart.com/art/Following-the-Rainbow-288432950",id:"jackalynn_pinkiedash"},{colour:"#5e7520",url:"//static.fimfiction.net/images/custom_banners/yakovlev_fluttershy.jpg?2",source:"http://yakovlev-vad.deviantart.com/art/Simple-curiosity-468468925",id:"yakovlev_fluttershy"},{colour:"#9e75a9",url:"//static.fimfiction.net/images/custom_banners/yakovlev_twilight.jpg?2",
source:"http://yakovlev-vad.deviantart.com/art/Time-to-wash-3-490390076",id:"yakovlev_twilight"},{colour:"#77599a",url:"//static.fimfiction.net/images/custom_banners/mymagicdream_twilight.jpg?2",source:"http://my-magic-dream.deviantart.com/art/Twilight-453477065",id:"mymagicdream_twilight"}];function setCookie(a,b,c){var d=new Date;d.setTime(d.getTime()+864E5*c);b=escape(b);document.cookie=a+"="+b+(c?";expires="+d.toUTCString():"")+";path=/"}function delCookie(a){document.cookie=a+"=null;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"}function getCookie(a){for(var b=document.cookie.split(";"),c=0;c<b.length;c++){var d=b[c].indexOf("=");if(a==b[c].substr(0,d).replace(/^\s+|\s+$/g,""))return unescape(b[c].substr(d+1))}return null}
try{(function(){for(var a=document.cookie.split(";"),b=0;b<a.length;b++){var c;if(c=/^\s*(__utm\w*)\s*=/.exec(a[b]))try{document.cookie=c[1]+"=null;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/",document.cookie=c[1]+"=null;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=.fimfiction.net"}catch(d){}}})()}catch(ex){};xyzcrypto={};xyzcrypto.supported=function(){try{return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&"subarray"in Uint8Array.prototype?!0:!1}catch(a){return!1}}();xyzcrypto.resultToBytes=function(a){for(var b=new Uint8Array(32),c=0;32>c;c++)b[c]=a[c/4|0]>>>24-c%4*8;return b};xyzcrypto.fromString=function(a,b){b||(a=unescape(encodeURIComponent(a)));for(var c=new Uint8Array(a.length),d=0;d<a.length;d++)c[d]=a.charCodeAt(d);return c};
xyzcrypto.toString=function(a,b){for(var c=Array(a.length),d=0;d<a.length;d++)c[d]=String.fromCharCode(a[d]);return b?c.join(""):decodeURIComponent(escape(c.join("")))};xyzcrypto.fromB64=function(a){return xyzcrypto.fromString(atob(a),!0)};xyzcrypto.toB64=function(a){return btoa(xyzcrypto.toString(a,!0))};xyzcrypto.fromHex=function(a){for(var b=new Uint8Array(a.length/2),c=0;c<b.length;c++)b[c]=parseInt(a.substr(2*c,2),16);return b};
xyzcrypto.toHex=function(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=(a[c]+256).toString(16).substr(1);return b.join("")};xyzcrypto.hmac=function(a,b){b.length>a.blocksize&&(b=a.hash(b));if(b.length<a.blocksize){var c=new Uint8Array(a.blocksize);c.set(b);b=c}this.o_key=new Uint8Array(64);this.i_key=new Uint8Array(64);for(c=0;64>c;c++)this.o_key[c]=b[c]^92,this.i_key[c]=b[c]^54;this.hash=new a;this.hash.updateBlock(this.i_key)};xyzcrypto.hmac.prototype.reset=function(){this.hash.reset();this.hash.updateBlock(this.i_key)};
xyzcrypto.hmac.prototype.update=function(a){this.hash.update(a)};xyzcrypto.hmac.prototype.finish=function(){var a=this.hash.finish();this.hash.reset();this.hash.updateBlock(this.o_key);this.hash.update(a);return this.hash.finish()};xyzcrypto.hmac.prototype.generate=function(a){this.reset();this.update(a);return this.finish()};xyzcrypto.hmac.generate=function(a,b,c){return(new xyzcrypto.hmac(a,b)).generate(c)};xyzcrypto.sha256={};
xyzcrypto.sha256.asm=function(){var a=new ArrayBuffer(65536);this.state=new Uint32Array(a,0,8);this.block=new Uint8Array(a,32,64);this.data=null;var b=this;this.asm=xyzcrypto.sha256.asm.module(window,{copyBlock:function(a,d,e){b.block.set(b.data.subarray(d,e),a)}},a);this.asm.reset()};xyzcrypto.sha256.asm.prototype.reset=function(){this.asm.reset()};xyzcrypto.sha256.asm.prototype.update=function(a){this.data=a;this.asm.update(a.length)};
xyzcrypto.sha256.asm.prototype.updateBlock=function(a){this.block.set(a);this.asm.updateBlock()};xyzcrypto.sha256.asm.prototype.finish=function(){this.asm.finish();return xyzcrypto.resultToBytes(this.state)};xyzcrypto.sha256.asm.prototype.hash=function(a){this.reset();this.update(a);return this.finish()};xyzcrypto.sha256.asm.hash=function(a){return(new xyzcrypto.sha256.asm).hash(a)};xyzcrypto.sha256.asm.blocksize=64;function ComputeNonce(){var a=window.crypto||window.msCrypto||null;if(null!=a&&"getRandomValues"in a){var b=new Uint8Array(24);a.getRandomValues(b);try{return btoa(String.fromCharCode.apply(null,b))}catch(c){for(var a="",d=0;d<b.length;d++)a+=String.fromCharCode(b[d]);return btoa(a)}}else{a="";for(d=0;24>d;d++)a+=String.fromCharCode(Math.floor(255*Math.random()));return btoa(a)}}function SigningKeyNotFoundException(){}var signing_hmac=null;
function SignString(a,b){if(null==signing_hmac){var c=LocalStorageGet("signing_key");if(null==c||"string"!=typeof c||0==c.length)throw new SigningKeyNotFoundException;signing_hmac=xyzcrypto.supported?new xyzcrypto.hmac(xyzcrypto.sha256.asm,xyzcrypto.fromB64(c)):new sjcl.misc.hmac(sjcl.codec.base64.toBits(c))}var c=ComputeNonce(),d=Math.floor((new Date-server_time_offset)/1E3),e=c+"|"+d+"|"+btoa(b)+"|"+a;return{signature:xyzcrypto.supported?xyzcrypto.toB64(signing_hmac.generate(xyzcrypto.fromString(e))):
sjcl.codec.base64.fromBits(signing_hmac.encrypt(e)),nonce:c,timestamp:d}}
function DataToURLEncodedString(a){function b(a){return encodeURIComponent(a).replace(/[^A-Za-z0-9\-_.~%]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a.sort(function(a,b){if(a.name==b.name){if(a.value==b.value)return 0;if(a.value<b.value)return-1;if(a.value>b.value)return 1}else{if(a.name<b.name)return-1;if(a.name>b.name)return 1}});return $.map(a,function(a){return b(a.name)+"="+b(a.value)}).join("&")}
function SignObject(a,b){var c=$.map(a,function(a,b){return{name:b,value:a}});return SignArray(c,b)}function SignArray(a,b){var c=DataToURLEncodedString(a),d=SignString(c,b);return c+"&signature="+encodeURIComponent(d.signature)+"&signature_nonce="+encodeURIComponent(d.nonce)+"&signature_timestamp="+d.timestamp}function UpdateOrInsertHiddenField(a,b,c){var d=a.children("item[name="+b+"]");0==d.length&&(d=$(document.createElement("input")),d.attr({type:"hidden",name:b}),a.append(d));d.val(c)}
function SignForm(a,b){var c=a.serializeArray();null==b&&(b=a.attr("action"));c=$.grep(c,function(a){return!/^signature(?:_nonce|_timestamp)?$/.test(a.name)});c=DataToURLEncodedString(c);c=SignString(c,b);UpdateOrInsertHiddenField(a,"signature",c.signature);UpdateOrInsertHiddenField(a,"signature_nonce",c.nonce);UpdateOrInsertHiddenField(a,"signature_timestamp",c.timestamp)};function getXMLHttpRequest(){if(window.XMLHttpRequest)return new window.XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(a){return null}}
function AjaxRequest(a){var b=this;this.options=a;var c="POST";"method"in a&&(c=a.method);var d=a.url,e={};"data"in a&&(e=a.data);if("GET"==c&&null!=e){var f=[],g;for(g in e)f.push(encodeURIComponent(g)+"="+encodeURIComponent(e[g]));d+=(-1<d.indexOf("?")?"&":"?")+f.join("&")}if("spinner"in this.options){var k=this.options.spinner.attr("class");this.options.spinner.attr("class","fa fa-spin fa-spinner")}"button"in this.options&&this.options.button.prop("disabled",!0);this.success="success"in a?a.success:
function(){};this.fail="fail"in a?a.fail:function(a){ShowErrorWindow(a.error)};"format"in this.options||(this.options.format="json");try{var m=(new Promise(function(a,f){var g=getXMLHttpRequest();if("signed"in b.options&&b.options.signed)try{e="string"==typeof e?SignString(e,d):e instanceof Array?SignArray(e,d):SignObject(e,d)}catch(k){k instanceof SigningKeyNotFoundException?ShowErrorWindow("Signing Key not found, please log in again"):ShowErrorWindow("Error signing string: "+k);f(g);return}else"string"!=
typeof e&&(e=AjaxRequest.serialize(e));g.open(c,d);g.onreadystatechange=function(){4==this.readyState&&(200==g.status?a(g):f(g))};g.onerror=function(){f(g)};g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(e)})).then(function(a){b.status=a.status;if("json"==b.options.format)try{b.data=$.parseJSON(a.response),"error"in b.data?b.fail(b.data,b):b.success(b.data,b)}catch(c){c instanceof SyntaxError?b.fail({error:"Invalid response format: "+c+". Please send this whole message to knighty: '"+
a.response+"'"},b):console.log(c.message)}else b.data=a.responseText,b.success(b.data,b)},function(a){var c="";switch(a.status){case 400:c="Bad Request";break;case 401:c="Request Unauthorized";break;case 403:c="Request Forbidden";break;case 404:c="Request destination not found";break;case 408:c="Request timed out. Please try again";break;case 500:c="Server Error";break;case 502:c="Bad Gateway. Please try again";break;case 503:c="Service Unavailable. Please try again later";break;default:c="Request Failed ("+
a.status+")"}b.fail({error:c},b)}).then(function(){"spinner"in b.options&&b.options.spinner.attr("class",k);"button"in b.options&&b.options.button.prop("disabled",!1)})}catch(q){ShowErrorWindow("Error creating request. Please PM <a href='/user/knighty'>knighty</a> with your operating system and browser")}return m}AjaxRequest.serialize=function(a){var b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};
AjaxRequest.BindForm=function(a,b){$(document).on("submit",a,function(a){a.preventDefault();var d=$(this),e={};e.method=d.attr("method");e.url=d.attr("action");e.signed=1==d.data("signed");e.button=d.find("button[type=submit]");0==e.button.length&&(e.button=d.find(".button-submit"));e.spinner=e.button.find("i");e.data=e.signed?d.serializeArray():d.serialize();e.success=function(a,c){b(a,c,d)};"undefined"!==typeof d.data("confirm")?StyledConfirm(d.data("confirm"),function(){new AjaxRequest(e)}):new AjaxRequest(e);
return!1})};$(document).ready(function(){$(".orderable").each(function(){var a=$(this),b=null,c=null,d=0,e=0,f=!1;a.on("mousedown",".orderable-item .draggable-handle",function(a){if(null==b&&1!=$(this).data("locked")){b=$(this).closest(".orderable-item");b.css("height",b.outerHeight());c=b.find(".draggable");c.css("width",c.width());var f=b.closest(".orderable");d=f.offset().left+b.position().left+(a.pageX-b.offset().left)-(c.offset().left-b.offset().left);e=f.offset().top+b.position().top+(a.pageY-b.offset().top)-
(c.offset().top-b.offset().top);console.log("x offset: "+d);console.log("y offset: "+e);$("body").addClass("unselectable");$("body").css("overflow-x","hidden");b.addClass("ordering");c.addClass("dragging")}});$(document).on("mouseup","body",function(e){null!=b&&(f&&a.trigger("reordered",b),b.removeClass("ordering"),b=null,c.css("left",0),c.css("top",0),c.css("width","auto"),c.removeClass("dragging"),c=null,$(this).removeClass("unselectable"),f=!1)});$(document).mousemove(function(g){var k=!1;if(null!=
b){k=b;$(".left_column");$(".right_column");k.parents(".left_column");for(var m=g.pageX-d,q=g.pageY-e,k=!1;!k;){var m=b.prev(),n=b.next();0!=n.length&&q>n.outerHeight()/2?(n.after(b),e+=n.outerHeight(),f=!0):0!=m.length&&q<-m.outerHeight()/2?(m.before(b),e-=m.outerHeight(),f=!0):k=!0;m=g.pageX-d;q=g.pageY-e}"vertical"==a.data("direction")?c.css("top",q):c.css("left",m)}})})});function LocalStorageSet(a,b){try{window.localStorage.setItem(a,b)}catch(c){setCookie(a,b,365)}}function LocalStorageGet(a,b){var c=null;try{c=window.localStorage.getItem(a)}catch(d){}if(null!==c)return c;c=getCookie(a);return null!==c?c:b}function LocalStorageRemove(a){try{window.localStorage.removeItem(a)}catch(b){}delCookie(a)}
function InitSiteMessage(){var a=parseInt(LocalStorageGet("site_message_timestamp",0)),b=$(".site-message");b.data("timestamp")>a&&b.removeClass("hidden");b.find(".close-button").click(function(){b.addClass("hidden");LocalStorageSet("site_message_timestamp",b.data("timestamp"))})}$(document).ready(function(){$(".user_page .more_button").each(function(){140>$(this).parent().find(".description").height()&&$(this).remove()});$(window).konami(function(){InitiateInteractivePony()})});
function CloseMessageBox(){$("#message_box").hide();$("#message_box_container").animate({top:"60%",opacity:"0"},300,function(){$("#message_box_container").hide()});$("embed").show()}var _cancel_callback,_accept_callback;
function ShowMessageBox(a,b,c){_cancel_callback=c;_accept_callback=b;$("#message_box").show();$("#message_box_container").show();$("#message_box_container").css("top","60%");$("#message_box_container").css("opacity","0");$("#popup_header").find("span").text(a);$("#message_box_container").animate({top:"50%",opacity:"1"},300);$("#popup_cancel").show();$("#popup_accept").show();$("embed").hide()}function MessageBoxHideAccept(){$("#popup_accept").hide()}
function GetMessageBoxContentDiv(){return $("#message_box_content_div")}$(document).ready(function(){$("#popup_cancel").click(function(){null!=_cancel_callback&&_cancel_callback();CloseMessageBox()});$("#popup_accept").click(function(){null!=_accept_callback?_accept_callback()&&CloseMessageBox():CloseMessageBox()})});$(document).keyup(function(a){27==a.keyCode&&CloseMessageBox()});
$("#hide_welcome_message").live("click",function(a){a.preventDefault();new AjaxRequest({url:"/ajax/users/welcome-message",method:"POST",success:function(a){$("#welcome_message").fadeOut()}})});
function compose_pm(a,b){ShowMessageBox("Compose Private Message",function(){var a=$("#send_pm_form").serializeArray();GetMessageBoxContentDiv().html("Sending...");new AjaxRequest({url:"/ajax/private-messages",method:"POST",signed:!0,data:a,success:function(a){$("#page_container").removeClass("blur");CloseMessageBox()}});return!1},function(){$("#page_container").removeClass("blur")});$("#page_container").addClass("blur");GetMessageBoxContentDiv().html("Loading...");new AjaxRequest({url:"/ajax/private-messages/new?receiver="+
encodeURIComponent(a)+"&subject="+encodeURIComponent(b),method:"GET",success:function(a){GetMessageBoxContentDiv().html(a.content)}})}
function RateStory(a,b){100==b?$(".rating_container_"+a).find("a.like_button").addClass("like_button_selected"):$(".rating_container_"+a).find("a.like_button").removeClass("like_button_selected");0==b?$(".rating_container_"+a).find("a.dislike_button").addClass("dislike_button_selected"):$(".rating_container_"+a).find("a.dislike_button").removeClass("dislike_button_selected");$.post("/rate.php",{story:a,rating:b},function(b){if("error"in b)ShowErrorWindow(b.error);else{var d=b.likes,e=b.dislikes,f=
b.disliked;b.liked?$(".rating_container_"+a).find("a.like_button").addClass("like_button_selected"):$(".rating_container_"+a).find("a.like_button").removeClass("like_button_selected");f?$(".rating_container_"+a).find("a.dislike_button").addClass("dislike_button_selected"):$(".rating_container_"+a).find("a.dislike_button").removeClass("dislike_button_selected");-1!=d&&($(".rating_container_"+a).find("span.likes").text(d),$(".rating_container_"+a).find("span.dislikes").text(e),$(".rating_container_"+
a).find("div.bar_like,div.bar_hidden").css("width",d/(d+e)*100+"%"),$(".rating_container_"+a).find("div.bar_hidden").addClass("bar_like").removeClass("bar_hidden"))}})}function MarkAllFavsRead(a){confirm("Are you sure you want to mark all your unread chapters as read?")&&($("#unread_favs").text("0"),$.post("/ajax/mark_all_favourites_as_read.php",{noonce:a},function(a){}))}var HashCallbacks={};
function fireHashCallback(){var a=window.location.hash.substr(1).split("/",2);if(Object.prototype.hasOwnProperty.call(HashCallbacks,a[0]))HashCallbacks[a[0]](a[1])}$(window).bind("hashchange",fireHashCallback);$(document).ready(fireHashCallback);function AddHashCallback(a,b){HashCallbacks[a]=b}
function UpdateCommentPagination(a){a=$(a);a.find(".page_list li.page").remove();var b=a.find(".page_list .button_previous_comments").parent(),c=a.find(".page_list .button_next_comments").parent(),d=a.data("num-pages"),e=a.data("current-page");if(2>d)a.find(".page_list").addClass("hidden");else{a.find(".page_list").removeClass("hidden");1==e?b.addClass("hidden"):b.removeClass("hidden");e==d?c.addClass("hidden"):c.removeClass("hidden");for(var c=0,f=d;1<=f;f--)if(3>f||f>d-2||f>e-3&&f<e+3){var g=$("<li class='page'><a href='#page/"+
f+"'>"+f+"</a></li>");g.data("page",f);e==f&&g.addClass("selected");0!=c&&c>f+1&&b.after($("<li class='page'><span>&hellip;</span></li>"));b.after(g);c=f}a.find(".page_list").each(function(){$(this).find("li:not(.hidden)").first().addClass("first");$(this).find("li:not(.hidden)").last().addClass("last")})}}
function GoToCommentPage(a,b,c,d,e){$(".comment quote_container").remove();var f=$(a).find(".comment_list").data("item"),g=$(a).find(".comment_list").data("type");b=parseInt(b);void 0===d&&$("html, body").animate({scrollTop:$(a).find(".comment_jumper").offset().top},0);"undefined"==typeof e?e=$(a).find(".comment_list").data("order"):$(a).find(".comment_list").data("order",e);$(a).find(".comment_list").addClass("loading");$("body").addClass("loading");new AjaxRequest({url:"/ajax/comments/"+g,method:"GET",
data:{item_id:f,page:b,order:e},success:function(d){$(a).find("a.comment_order").each(function(){e==$(this).data("order")?$(this).parent().addClass("selected"):$(this).parent().removeClass("selected")});a.data("current-page",b);a.data("num-pages",d.num_pages);UpdateCommentPagination(a);$(a).find(".comment_list").html(d.content);$(a).find(".comment_list").removeClass("loading");LoadVisibleImages();SetupCommentQuotes(a);$(a).find(".start-index").text(d.start_index);$(a).find(".end-index").text(d.end_index);
$(a).find(".num-comments").text(d.num_comments);$("body").removeClass("loading");void 0!==c&&c()}});return!1}var comment_jump_to=0;
function GoToComment(a,b,c){comment_jump_to=b;var d=$(a).find(".comment_list").data("item"),e=$(a).find(".comment_list").data("type");$(a).find("span.story").length&&$(a).find("span.story").text();0!=$(a).find("#comment_"+b).length?($(".comment").removeClass("comment_selected"),$("#comment_"+b).addClass("comment_selected"),$("html, body").stop(),$("html, body").animate({scrollTop:$("#comment_"+b).offset().top},300)):new AjaxRequest({url:"/ajax/comments/page",method:"GET",data:{type:e,item:d,comment:b},
success:function(b){0<b.page&&(void 0!==c&&c(b.page),GoToCommentPage(a,b.page,function(){setTimeout(function(){$(".comment").removeClass("comment_selected");$("#comment_"+comment_jump_to).addClass("comment_selected");$("html, body").animate({scrollTop:$("#comment_"+comment_jump_to).offset().top},300)},500)}))}})}function CloseErrorWindow(a){a.preventDefault();$("#error_popup").fadeOut()}var error_window_title="Error;Can't let you do that, Starfox;That would not be wise;You shall not pass;You have chosen...poorly;Stop right there, criminal scum".split(";");
function ShowErrorWindow(a){var b=new PopUpMenu("","<i class='fa fa-warning'></i> Error");b.SetContent("");b.SetCloseOnHoverOut(!1);b.SetFixed(!0);b.SetContent("<center style='padding:18px;'>"+a+"</center>");b.SetFooter("<center><button id='alert_button' class='styled_button' style='padding: 5px 40px;''>Ok</button></center>");b.SetCloseOnHoverOut(!1);b.SetWidth("350px");b.Show();$("#alert_button").click(function(a){a.preventDefault();a.stopPropagation();b.Close()})}
function StyledConfirm(a,b,c,d){var e=new PopUpMenu("","<i class='fa fa-question-circle'></i> Confirm");e.SetContent("");e.SetCloseOnHoverOut(!1);e.SetFixed(!0);e.SetContent("<div style='padding:18px;'>"+a+"</div>");e.SetFooter("<div style='text-align:right;'><button id='ok_button' class='styled_button'><i class='fa fa-check'></i> Ok</button> <button id='cancel_button' class='styled_button styled_button_red'><i class='fa fa-times'></i>  Cancel</button></div>");e.SetCloseOnHoverOut(!1);e.SetWidth("350px");
e.Show();$("#ok_button").click(function(a){a.preventDefault();a.stopPropagation();e.Close();void 0!==b&&b();void 0!==d&&d()});$("#cancel_button").click(function(a){a.preventDefault();a.stopPropagation();e.Close();void 0!==c&&c();void 0!==d&&d()})}$(document).on("click",".form_submitter",function(a){a.preventDefault();a=$(this).parents("form");"undefined"!==typeof $(this).attr("name")&&a.append("<input type='hidden' name='"+$(this).attr("name")+"' value='1' />");a.submit()});
$(document).on("click",".expand_group_link",function(a){a.preventDefault();$(".group_expand").hide();$("#group_expand_"+$(this).data("group")).show()});$(document).on("keyup","#group_search",function(a){var b=$(this).val().toLowerCase();$("#group_list li").each(function(a){-1!=$(this).find(".group_name").text().toLowerCase().indexOf(b)?$(this).removeClass("hidden"):$(this).addClass("hidden")})});
$(document).on("keyup",".folder_search",function(a){var b=$(this).val().toLowerCase();$("#folder_list_"+$(this).data("group")+" li").each(function(a){-1!=$(this).find(".folder_name").text().toLowerCase().indexOf(b)?$(this).removeClass("hidden"):$(this).addClass("hidden")})});$(document).on("click",".user_image",function(){$(this).toggleClass("user_image_expanded")});
$(document).on("click",".user_image_link",function(a){a.preventDefault();a=$(this).next();a.length&&a.attr("src")==$(this).attr("href")?a.remove():$(this).after("<img src='"+$(this).attr("href")+"' class='user_image' style='display:block;' />")});$(document).on("click",".scroll_to_top",function(a){a.preventDefault();$("html, body").animate({scrollTop:0},300)});
$(document).on("focus","table.properties input",function(){if("undefined"!==typeof $(this).data("tooltip")){var a;$(this).parent().find(".tooltip_popup").length?a=$(this).parent().find(".tooltip_popup"):(a=$('<div class="tooltip_popup hidden"><div class="arrow"><div></div></div><div class="tooltip_popup_tooltip">'+$(this).data("tooltip")+"</div></div>"),$(this).parent().css("position","relative"),$(this).before(a));a.fadeIn()}});$(document).on("blur","table.properties input",function(){$(this).parent().find(".tooltip_popup").fadeOut()});
AjaxRequest.BindForm("#form-mark-all-notifications-read",function(a,b,c){$(".notification").removeClass("notification_unread");$(".notification").removeClass("new");notifications.SetContentNotifications(a.content_notifications);notifications.SetMetaNotifications(a.meta_notifications);notifications.SetSocialNotifications(a.social_notifications)});AjaxRequest.BindForm("#form-mark-all-pms-read",function(a,b,c){$("#drop-down-private-messages li").removeClass("new");$(".mail-link").removeClass("new")});
(function(){function a(){$(".resize_text").each(function(){for(var a=$(this),b=!1,e=1,f=a.html();!b;){for(var g="A",k=1;k<e;k++)g+="<br/>A";a.css("font-size",a.data("start-size")+"em");a.html(g);g=a.height();a.html(f);a.css("font-size",a.data("start-size")+"em");for(k=a.data("start-size");k+.01>=$(this).data("minimum-size");)if(a.css("font-size",k+"em"),k-=.1,a.height()<=g){b=!0;break}e++}})}var b=null;$(window).load(function(){a()});$(document).ready(function(){a()});$(window).resize(function(){null==
b&&(b=setTimeout(function(){a();b=null},500))})})();
$(document).on("click","a.mark_notification_read",function(a){a.preventDefault();var b=$(this).data("identifier");$(".notification").each(function(){$(this).data("identifier")==b&&$(this).removeClass("notification_unread")});new AjaxRequest({url:"/ajax/notifications/mark-all-read",method:"POST",data:{identifier:b},success:function(a){notifications.SetContentNotifications(a.content_notifications);notifications.SetMetaNotifications(a.meta_notifications);notifications.SetSocialNotifications(a.social_notifications)}})});
$(document).on("click",".tablesorter input[type='checkbox'], .tablesorter input[type='radio']",function(a){a.stopPropagation()});$(document).on("click",".tablesorter a",function(a){a.stopPropagation()});$(document).on("click",".tablesorter tr",function(){$(this).find("input[type='checkbox']").trigger("click");$(this).find("input[type='radio']").trigger("click")});
$(document).on("change",".tablesorter input[type='checkbox']",function(a){$(this).prop("checked")?$(this).parents("tr").addClass("selected"):$(this).parents("tr").removeClass("selected");$(this).closest("table").find(".selected_info").html($(this).closest("table").find("input[type='checkbox']:checked").length+" / "+$(this).closest("table").find("input[type='checkbox']").length+" selected")});
$(document).on("click","#notification_popup_close",function(a){a.preventDefault();$("#notification_popup").fadeOut();a.stopPropagation()});$(document).on("click","#notification_popup_settings",function(a){a.stopPropagation()});$(document).on("click","#notification_popup",function(a){a=$(this).data("link");""!=a&&(window.location=a)});
function TimeOffsetToFriendlyName(a){var b=Math.floor(a/604800);a-=604800*b;var c=Math.floor(a/86400);a-=86400*c;var d=Math.floor(a/3600);a-=3600*d;var e=Math.floor(a/60),f=0,g="",k=0,m="",f=a-60*e,g="s";0<e&&(m=g,k=f,f=e,g="m");0<d&&(m=g,k=f,f=d,g="h");0<c&&(m=g,k=f,f=c,g="d");0<b&&(m=g,k=f,f=b,g="w");return f+""+g+""+(""!=m?", "+k+""+m+"":"")}
$(document).ready(function(){if("undefined"!=typeof is_mobile&&!is_mobile){var a=function(){if(!document.hidden&&!document.webkitHidden){var a=Math.floor((new Date-server_time_offset)/1E3);$(".time_offset").each(function(){var c=$(this).data("time"),c=a-c;$(this).text(TimeOffsetToFriendlyName(c))})}};setInterval(a,5E3);$(document).bind("visibilitychange webkitvisibilitychange",a)}"undefined"!=typeof Highcharts&&(Highcharts.wrap(Highcharts.Chart.prototype,"getContainer",function(a){a.call(this);this.container.style.background=
"#fff"}),Highcharts.theme={colors:"rgba(133,116,96,0.5) #8085e9 #8d4654 #7798BF #aaeeee #ff0066 #eeaaee #55BF3B #DF5353 #7798BF #aaeeee".split(" "),chart:{backgroundColor:null,style:{fontFamily:"open sans"}},title:{style:{color:"black",fontSize:"16px",fontWeight:"bold"}},subtitle:{style:{color:"black"}},tooltip:{borderWidth:0},legend:{itemStyle:{fontWeight:"bold",fontSize:"13px"}},xAxis:{labels:{style:{color:"#6e6e70"}}},yAxis:{labels:{style:{color:"#6e6e70"}}},plotOptions:{series:{},candlestick:{lineColor:"#404048"},
map:{shadow:!1}},navigator:{xAxis:{gridLineColor:"#D0D0D8"}},rangeSelector:{buttonTheme:{fill:"white",stroke:"#C0C0C8","stroke-width":1,states:{select:{fill:"#D0D0D8"}}}},scrollbar:{trackBorderColor:"#C0C0C8"},background2:"#E0E0E8"},Highcharts.setOptions(Highcharts.theme))});
$(document).ready(function(){$(".button-sidebar-toggle").click(function(){var a=$(".user_blog_post");a.hasClass("compressed")?(a.removeClass("compressed"),$(this).find("i").attr("class","fa fa-caret-square-o-right"),LocalStorageSet("sidebar_expanded",!0)):(a.addClass("compressed"),$(this).find("i").attr("class","fa fa-caret-square-o-left"),LocalStorageSet("sidebar_expanded",!1))});"true"==LocalStorageGet("sidebar_expanded",!1)&&($(".button-sidebar-toggle").find("i").attr("class","fa fa-caret-square-o-right"),
$(".user_blog_post").removeClass("compressed"));$(document).on("click",".drop-down-expander",function(){var a=$(this).parent(),b=$(this);if(null!=b.data("menu-selector")){var b=b.data("menu-selector"),c=$(b);if(!c.hasClass("show")){c.addClass("show");var d=function(a){a.stopPropagation()};c.on("click",d);var e;e=function(a){$(document).off("click",e);$(document).off("close-dropdowns",e);c.removeClass("show");c.off("click",d)};$(document).on("click",e);$(document).on("close-dropdowns",e)}}else a.hasClass("drop-down-show")||
(a.addClass("drop-down-show"),d=function(a){a.stopPropagation()},a.on("click",".button-group .drop-down",d),e=function(b){$(document).off("click",e);$(document).off("close-dropdowns",e);a.removeClass("drop-down-show");a.off("click",".button-group .drop-down",d)},$(document).on("click",e),$(document).on("close-dropdowns",e))});$("#user_toolbar_toggle a").click(function(a){a.preventDefault();$(this).toggleClass("show");$(".user_toolbar").toggleClass("show")});(function(){var a=null,b=null;$(".user_toolbar").on("click",
"a",function(a){var b=$(this).closest("li");!b.hasClass("hover")&&b.find("ul").length&&(a.preventDefault(),b.addClass("hover"),b.trigger("toolbar-hovered"))});$(".user_toolbar").on("mouseenter","li",function(){var c=$(this);console.log("hovered");c.hasClass("hover")?(clearTimeout(b),b=null):(clearTimeout(a),a=setTimeout(function(){clearTimeout(b);b=null;c.siblings().removeClass("hover");c.addClass("hover");c.trigger("toolbar-hovered")},120))});$(".user_toolbar").on("mouseleave","li",function(){clearTimeout(a);
var c=$(this);c.hasClass("hover")&&(b=setTimeout(function(){c.removeClass("hover")},250))})})();(function(){var a=null,b=null;$(".nav_bar").on("click","a",function(a){var b=$(this).closest("li");b.hasClass("hover")||!b.find("ul").length&&!b.find(".drop-down").length||(a.preventDefault(),b.addClass("hover"),b.trigger("toolbar-hovered"))});$(".nav_bar").on("click",".button-close",function(a){var b=$(this).closest("li");b.hasClass("hover")&&(a.preventDefault(),b.removeClass("hover"))});$(".nav_bar").on("mouseenter",
"li",function(){var c=$(this);c.hasClass("hover")?(clearTimeout(b),b=null):(clearTimeout(a),a=setTimeout(function(){clearTimeout(b);b=null;c.siblings().removeClass("hover");c.addClass("hover");c.trigger("toolbar-hovered")},120))});$(".nav_bar").on("mouseleave","li",function(){clearTimeout(a);var c=$(this);c.hasClass("hover")&&(b=setTimeout(function(){c.removeClass("hover")},250))})})();$(".form-signed button, .form-signed input[type='submit']").click(function(a){a=$(this);""!=a.attr("name")&&UpdateOrInsertHiddenField(a.closest(".form-signed"),
a.attr("name"),a.attr("value"))});$(".form-signed").submit(function(){SignForm($(this));return!0})});
$(window).on("load",function(){$(".ad_container").each(function(){var a=LocalStorageGet("adblock-message",null),b=(new Date).getTime(),c=$(this)[0].getBoundingClientRect();0==c.top&&0==c.left&&0==c.right&&0==c.bottom&&b>a+2592E6&&$(this).after($("<div class='adblock_on'>Hey there, looks like you're using adblock! We know, we know, adverts are incredibly annoying, but they really help to support the site. If you'd consider unblocking the site, we'd be extremely appreciative! <a class='button-hide-ads' style='text-decoration:underline; color:inherit; font-weight:bold;'>Hide This Message</a></span>"))});$(".button-hide-ads").click(function(a){var b=
(new Date).getTime();LocalStorageSet("adblock-message",b);$(".adblock_on").remove();a.preventDefault()})});$(document).on("click",".jump-to",function(a){a.preventDefault();a=null;"bottom"==$(this).data("align")?(a=$($(this).data("jump")),a=a.offset().top-$(window).height()+a.height()):a=$($(this).data("jump")).offset().top;$("html, body").animate({scrollTop:a},500)});
function extractColor(a){var b;b={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",
darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",
gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",
lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",
navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",
silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};a in b&&(a=b[a]);if(b=a.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/))return[b[1],b[2],b[3]];if(b=a.match(/#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i))return[parseInt(b[1],
16),parseInt(b[2],16),parseInt(b[3],16)];if(b=a.match(/#([0-9a-f])([0-9a-f])([0-9a-f])/i))return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}function colorBlend(a,b,c){return[a[0]*c+b[0]*(1-c),a[1]*c+b[1]*(1-c),a[2]*c+b[2]*(1-c)]}function colorMult(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function rgbToCSS(a){return"rgb("+Math.round(a[0])+","+Math.round(a[1])+","+Math.round(a[2])+")"}function selectNextTheme(){theme++;theme>banners.length-1&&(theme=0);selectTheme(theme)}
function selectPreviousTheme(){theme--;0>theme&&(theme=banners.length-1);selectTheme(theme)}function selectTheme(a){setCookie("selected_theme",banners[a].id,365);$("#title a.home_link").css("background-image","url('"+banners[a].url+"')");""==banners[a][2]?$("#source_link").addClass("hidden"):($("#source_link").attr("href",banners[a].source),$("#source_link").removeClass("hidden"));"colour"in banners[a]&&$(".user_toolbar > ul").css("background-color",banners[a].colour)}
function LoadVisibleImages(){for(var a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=.3*-a,a=1.3*a,c=document.querySelectorAll(".lazy-img"),d,e,f,g=0;g<c.length;g++)d=c[g],e=d.getBoundingClientRect(),e=e.top,f=d.offsetHeight,e+f>b&&e<a&&(d.setAttribute("src",d.getAttribute("data-src")),e=d.getAttribute("data-srcset"),null!=e&&d.setAttribute("srcset",e),removeClass(d,"lazy-img"))}
(function(){function a(){null==b&&(LoadVisibleImages(),b=setTimeout(function(){LoadVisibleImages();b=null},250))}var b=null;$(document).on("scroll",a);$(window).on("resize",a);$(document).ready(function(){$("#lazy-img-style").remove();LoadVisibleImages()})})();function removeClass(a,b){if("undefined"!=typeof a.classList)a.classList.remove(b);else{for(var c=a.className.split(" "),d=0;d<c.length;d++)c[d]==b&&(c.splice(d,1),d--);a.className=c.join(" ")}};function InsertBBCodeTag(a,b){InsertBBCodeTags(a,"["+b+"]","[/"+b+"]")}
function InsertBBCodeTags(a,b,c){if(document.selection)a.focus(),sel=document.selection.createRange(),sel.text=b+c;else if(a.selectionStart||"0"==a.selectionStart){var d=a.selectionStart,e=a.selectionEnd,f=a.value.substring(0,d),g=0<e-d?a.value.substring(d,e):"",k=a.value.substring(e,a.value.length),m=a.scrollTop;a.value.substring(d,d+c.length)==c?(a.selectionStart=e+c.length,a.selectionEnd=e+c.length):(a.value=f+b+g+c+k,a.selectionStart=d+b.length,a.selectionEnd=e+b.length);a.scrollTop=m}else a.value+=
b+c}function InsertTextAt(a,b){if(document.selection)a.focus(),sel=document.selection.createRange(),sel.text=b;else if(a.selectionStart||"0"==a.selectionStart){var c=a.selectionStart,d=a.selectionEnd,e=a.value.substring(0,c);0<d-c&&a.value.substring(c,d);d=a.value.substring(d,a.value.length);a.value=e+b+d;a.selectionStart=c+b.length;a.selectionEnd=c+b.length}else a.value+=b}
function BBCodeGetSelection(a){if(document.selection)return a.focus(),sel=document.selection.createRange(),sel.text;if(a.selectionStart||"0"==a.selectionStart){var b=a.selectionStart,c=a.selectionEnd;return 0<c-b?a.value.substring(b,c):""}return""}
(function(){function a(a,b){var c=a.find("div");c.length||(c=$("<div class='drop-down drop-down-emoticons'><div class='arrow'></div><ul></ul></div>"),new AjaxRequest({url:"/ajax/emoticons/list",method:"GET",success:function(a){for(var b in a.emoticons)c.find("ul").append($("<li><a data-function='emoticon' data-emoticon='"+b+"'><img src='//static.fimfiction.net/images/emoticons/"+a.emoticons[b]+"' /></a></li> "))}}),a.append(c))}function b(a){var b=new PopUpMenu("","<i class='fa fa-picture-o'></i> Add Image");
str="<div class='std'><div style='padding:10px;'><div style='border:1px solid #ccc; width:100%; height:200px; box-shadow: 0px 0px 20px rgba(0,0,0,0.2) inset;' class='pattern-checkerboard'><img id='bbcode_image_preview' style='display:block; margin:auto; max-height:100%; max-width:100%;'></div><form id='add_image'><input name='valid' type='hidden' value='0' /><input type='url' name='url' id='bbcode_image' placeholder='Image URL' required='required' /><button class='styled_button'>Add Image</button><div id='add_image_error' class='error-message hidden'>Invalid Image</div></form></div></div>";
b.SetContent(str);b.SetCloseOnHoverOut(!1);b.SetWidth("350px");b.SetFooter("Please remember all images must be safe for work!<br />Try to avoid including enormous images (bigger than 1mb)");b.Show();$("#bbcode_image").change(function(){$("#bbcode_image_preview").attr("src",$(this).val())});$("#bbcode_image").keyup(function(){$(this).change()});$("#bbcode_image_preview").load(function(){$("#add_image input[name='valid']").val(1);$("#add_image_error").addClass("hidden")});$("#bbcode_image_preview").error(function(){$("#add_image input[name='valid']").val(0)});
$("#add_image").submit(function(c){if(0==$(this).find("input[name='valid']").val())return $("#add_image_error").removeClass("hidden"),!1;c.preventDefault();c=$(this).find("input[name='url']").val();InsertTextAt(a,"[img]"+c+"[/img]");b.Close()})}function c(a){var b=new PopUpMenu("","<i class='fa fa-picture-o'></i> Add Youtube Video");str="<div class='std'><div style='padding:10px;'><div style='border:1px solid #ccc; width:100%; height:200px; box-shadow: 0px 0px 20px rgba(0,0,0,0.2) inset;' class='pattern-checkerboard'><iframe id='youtube_preview' style='display:block; margin:auto; height:100%; width:100%;'></iframe></div><form id='add_youtube'><input name='valid' type='hidden' value='0' /><input type='url' name='url' id='youtube_url' placeholder='Youtube URL' required='required' /><button class='styled_button'>Add Video</button><div id='add_youtube_error' class='error-message hidden'>Invalid Youtube URL</div></form></div></div>";
b.SetContent(str);b.SetCloseOnHoverOut(!1);b.SetWidth("350px");b.Show();$("#youtube_url").change(function(){var a=$(this).val();$("#add_youtube_error").removeClass("hidden");a=a.match(/(?:youtube.com\/watch\S*v=|youtu.be\/)([a-z0-9-_]{11})/i);null!=a?($("#add_youtube_error").addClass("hidden"),$("#youtube_preview").attr("src","https://www.youtube.com/embed/"+a[1])):$("#youtube_preview").attr("src","")});$("#youtube_url").keyup(function(){$(this).change()});$("#add_youtube").submit(function(c){if(!$("#add_youtube_error").hasClass("hidden"))return!1;
c.preventDefault();c=$(this).find("input[name='url']").val();InsertTextAt(a,"[youtube="+c+"]");b.Close()})}function d(a){var b=BBCodeGetSelection(a);null==b&&(b="");var c=new PopUpMenu("","<i class='fa fa-link'></i> Add Link");str="<div class='std'><div style='padding:10px;'><form id='add_link'><input type='url' name='link' placeholder='URL' required='required' />";str+="<input type='text' name='text' placeholder='Link Text' id='add_link_title_input' /><button class='styled_button'> Add Link</button></form></div></div>";
c.SetContent(str);c.SetCloseOnHoverOut(!1);c.SetWidth("350px");c.SetFooter("Please do not link not safe for work content!");$("#add_link_title_input").val(b);c.Show();$("#add_link").submit(function(b){b.preventDefault();b=$(this).find("input[name='link']").val();var d=$(this).find("input[name='text']").val();""==d?InsertTextAt(a,"[url]"+b+"[/url]"):InsertTextAt(a,"[url="+b+"]"+d+"[/url]");c.Close()})}$(document).on("keydown",".bbcode-editor textarea",function(a){var b=$(this).get(0);if(a.ctrlKey){if(66==
a.which)return InsertBBCodeTag(b,"b"),a.preventDefault(),!1;if(73==a.which)return InsertBBCodeTag(b,"i"),a.preventDefault(),!1;if(85==a.which)return InsertBBCodeTag(b,"u"),a.preventDefault(),!1;if(83==a.which)return $(this).trigger("save"),a.preventDefault(),!1}if(9==a.which)return InsertTextAt(b,"\t"),a.preventDefault(),!1});$(document).on("save",".bbcode-editor textarea",function(a){$(this).data("submit-on-save")&&$(this).parents("form").submit()});$(document).on("click",".bbcode-editor .format-toolbar button, .bbcode-editor .format-toolbar a",
function(e){var f=$(this);e.preventDefault();e=$(this).parents(".bbcode-editor").find("textarea").get(0);switch($(this).data("function")){case "bold":InsertBBCodeTag(e,"b");break;case "italic":InsertBBCodeTag(e,"i");break;case "underline":InsertBBCodeTag(e,"u");break;case "strikethrough":InsertBBCodeTag(e,"s");break;case "text-size-picker":e=f.parent();f=e.find("div");if(!f.length){var f=$("<div class='drop-down'><div class='arrow'></div><ul></ul></div>"),g=[[.5,"Very Small"],[.75,"Small"],[1.5,"Large"],
[2,"Very Large"]];for(i=0;i<g.length;i++)f.find("ul").append($("<li><a data-function='text-size' data-size='"+g[i][0]+"'>"+g[i][1]+" ( "+g[i][0]+"x )</a></li>"));e.append(f)}break;case "text-size":f=$(this).data("size");InsertBBCodeTags(e,"[size="+f+"em]","[/size]");$(document).trigger("close-dropdowns");break;case "center":InsertBBCodeTag(e,"center");break;case "indent":f=BBCodeGetSelection(e);g=!1;""==f&&(f=e.value,g=!0);f=f.replace(/\n/g,"\n\t");g?e.value=f:InsertTextAt(e,f);break;case "outdent":f=
BBCodeGetSelection(e);g=!1;""==f&&(f=e.value,g=!0);f=f.replace(/\n\t/g,"\n");g?e.value=f:InsertTextAt(e,f);break;case "colour-picker":e=f.parent();f=e.find("div");if(!f.length){f=$("<div class='drop-down drop-down-colours'><div class='arrow'></div><ul></ul></div>");g=[["Light Grey","#cccccc"],["Grey","#aaaaaa"],["Grey","#888888"],["Grey","#666666"],["Dark Grey","#333333"],["Break",""],["Brown","#5f4432"],["Red","#be4343"],["Orange","#be7a43"],["Yellow","#afa426"],["Lime Green","#7aaf26"],["Green",
"#2caf26"],["Turquoise","#26af6d"],["Light Blue","#26a4af"],["Blue","#265daf"],["Purple","#3c26af"],["Violet","#9426af"],["Pink","#af2673"],["Break",""],["Twilight Sparkle","#a66ebe"],["Rarity","#5e51a3"],["Applejack","#e97135"],["Pinkie Pie","#ea80b0"],["Rainbow Dash","#6aaadd"],["Fluttershy","#e6b91f"]];for(i=0;i<g.length;i++)"Break"==g[i][0]?f.find("ul").append($("<li class='divider'></li>")):f.find("ul").append($("<li><a title='"+g[i][0]+" ( "+g[i][1]+" )' data-function='colour' data-colour='"+
g[i][1]+"'><span class='colour-preview' style=\"background-color:"+g[i][1]+';"></span></a></li>'));e.append(f)}break;case "colour":f=$(this).data("colour");InsertBBCodeTags(e,"[color="+f+"]","[/color]");$(document).trigger("close-dropdowns");break;case "horizontal-rule":InsertTextAt(e,"[hr]");break;case "link":d(e);break;case "image":b(e);break;case "youtube":c(e);break;case "quote":InsertBBCodeTag(e,"quote");break;case "spoiler":InsertBBCodeTag(e,"spoiler");break;case "page-break":InsertTextAt(e,
"[page_break]");break;case "emoticons-picker":a(f.parent(),e);break;case "emoticon":f=$(this).data("emoticon");InsertTextAt(e,f);$(document).trigger("close-dropdowns");break;case "save":$(e).trigger("save")}})})();
function ConfirmPrompt(a,b){var c=new PopUpMenu("","<i class='fa fa-question-circle'></i> Comfirm Action"),d=c.SetContent(d);c.SetCloseOnHoverOut(!1);c.SetFixed(!0);c.SetContent("<center style='padding:10px;'>"+a+"</center>");c.SetFooter("<center><form id='confirm_prompt'><button class='styled_button'>Confirm</button><button id='confirm_cancel_button' class='styled_button styled_button_red'>Cancel</button></form></center>");c.SetCloseOnHoverOut(!1);c.SetWidth("350px");c.Show();$("#confirm_prompt").submit(function(a){a.preventDefault();
b();c.Close()});$("#confirm_cancel_button").click(function(a){a.preventDefault();a.stopPropagation();c.Close()})}
function StyledAlert(a){var b=new PopUpMenu("","<i class='fa fa-question-circle'></i>"),c=b.SetContent(c);b.SetCloseOnHoverOut(!1);b.SetFixed(!0);b.SetContent("<center style='padding:18px;'>"+a+"</center>");b.SetFooter("<center><button id='alert_button' class='styled_button' style='padding: 5px 40px;''>Ok</button></center>");b.SetCloseOnHoverOut(!1);b.SetWidth("350px");b.Show();$("#alert_button").click(function(a){a.preventDefault();a.stopPropagation();b.Close()})}
function PopUpMenu(a,b){this.element=$('<div id="'+a+'" class="drop-down-pop-up-container hidden"><div class="drop-down-pop-up"><h1>'+b+'<a class="close_button"></a></h1><div class="drop-down-pop-up-content"></div></div></div>');this.content=this.element.find(".drop-down-pop-up-content");var c=this;this.element.find(".close_button").click(function(){c.Close()});this.element.hover(function(a){},function(a){c.close_on_hover_out&&c.Close()});this.element.find("h1").mousedown(function(){c.Grab()});$("body").mouseup(function(){c.Release()});
$("body").append(this.element);this.close_on_link_pressed=this.dimmer_enabled=!0;this.dimmer=null;this.close_on_hover_out=!0;this.deltay=this.deltax=null;this.element.find("h1").css("cursor","move");this.grabbed=this.fixed=this.soft_close=!1}PopUpMenu.z_index=1E3;PopUpMenu.prototype.SetFixed=function(a){this.fixed=a};PopUpMenu.prototype.SetDimmerEnabled=function(a){this.dimmer_enabled=a};PopUpMenu.prototype.SetSoftClose=function(a){this.soft_close=a};
PopUpMenu.prototype.SetCloseOnLinkPressed=function(a){this.close_on_link_pressed=a};PopUpMenu.prototype.SetCloseOnHoverOut=function(a){this.close_on_hover_out=a};PopUpMenu.prototype.Grab=function(){if(!this.grabbed){var a=this;this.mousemove_handler=function(b){a.MouseMove(b.pageX,b.pageY)};$("body").bind("mousemove",this.mousemove_handler);this.grabbed=!0}};
PopUpMenu.prototype.Release=function(){this.grabbed&&($("body").unbind("mousemove",this.mousemove_handler),this.deltay=this.deltax=null,this.grabbed=!1)};
PopUpMenu.prototype.MouseMove=function(a,b){this.fixed&&(a-=$(window).scrollLeft(),b-=$(window).scrollTop());null==this.deltax&&(this.deltax=a-this.x,this.deltay=b-this.y);this.x=a-this.deltax;this.y=b-this.deltay;var c=this.element.height(),d=this.element.width();if(this.fixed){var e=0;this.x=Math.max(e,Math.min(this.x,$(window).width()-e-d));this.y=Math.max(e,Math.min(this.y,$(window).height()-e-c))}else e=0,this.x=Math.max($(window).scrollLeft()+e,Math.min(this.x,$(window).scrollLeft()+($(window).width()-
e)-d)),this.y=Math.max($(window).scrollTop()+e,Math.min(this.y,$(window).scrollTop()+($(window).height()-e)-c));this.element.css({left:this.x,top:this.y})};PopUpMenu.prototype.Close=function(){this.Release();null!=this.dimmer&&(this.dimmer.fadeOut("fast",function(){$(this).remove()}),this.dimmer=null,PopUpMenu.z_index--);this.soft_close?this.element.addClass("hidden"):(this.element.remove(),$(document).unbind("keyup",this.document_keyup_handler))};
PopUpMenu.prototype.LoadContent=function(a,b){var c=this;c.SetContent("<div style='text-align:center;'><i class='fa fa-spin fa-spinner' style='font-size:50px; margin:20px; color:#777;'></i></div>");var d=new Promise(function(d,f){"undefined"!==typeof b&&b?new AjaxRequest({url:a,method:"GET",success:function(a){c.content.html(a.content);c.SetPosition();d(c)},fail:function(a){ShowErrorWindow(a.error);f(c)}}):this.content.load(a,{},function(){c.SetPosition();d(c)})});this.close_on_link_pressed&&(this.content.find("a").click(function(){c.Close()}),
this.content.find("a").mousedown(function(a){a.stopPropagation()}));return d};PopUpMenu.prototype.SetContent=function(a){var b=this.element.height();this.content.html(a);var c=this;this.SetPosition(this.x,$(window).scrollTop()+this.y-(this.element.height()-b)/2);this.close_on_link_pressed&&(this.content.find("a").click(function(){c.Close()}),this.content.find("a").mousedown(function(a){a.stopPropagation()}))};
PopUpMenu.prototype.SetFooter=function(a){this.content.append($("<div class='drop-down-pop-up-footer'>"+a+"</div>"))};PopUpMenu.prototype.SetWidth=function(a){a>$(window).width()&&(a=$(window).width());this.element.find(".drop-down-pop-up").css("width",a)};
PopUpMenu.prototype.SetPosition=function(a,b){"undefined"==typeof a&&(a=$(window).width()/2-this.element.width()/2+$(window).scrollLeft(),b=$(window).height()/2-this.element.height()/2+$(window).scrollTop());this.element.height();this.element.width();this.fixed&&(a-=$(window).scrollLeft(),b-=$(window).scrollTop());this.element.css({left:a,top:b});this.x=a;this.y=b};
PopUpMenu.prototype.Show=function(a,b){this.dimmer_enabled&&(PopUpMenu.z_index++,this.dimmer=$("<div class='dimmer' style='z-index:"+PopUpMenu.z_index+";'></div>"),$("#dimmers").append(this.dimmer));var c=this;this.document_keyup_handler=function(a){27==a.keyCode&&c.Close()};$(document).bind("keyup",this.document_keyup_handler);this.element.removeClass("hidden");this.element.css({position:this.fixed?"fixed":"absolute","z-index":PopUpMenu.z_index});this.SetPosition(a,b)};
$(document).on("DOMMouseScroll mousewheel",".scrollable",function(a){var b=$(this),c=this.scrollTop,d=this.scrollHeight,e=b.height(),f="DOMMouseScroll"==a.type?-40*a.originalEvent.detail:a.originalEvent.wheelDelta,g=0<f,k=$(this).hasClass("fixed"),m=function(){a.stopPropagation();a.preventDefault();return a.returnValue=!1};if(!g&&-f>d-e-c){if(k||$(window).scrollTop()+$(window).height()>b.offset().top+e)return b.scrollTop(d),m()}else if(g&&f>c&&(k||$(window).scrollTop()<b.offset().top))return b.scrollTop(0),
m()});var dash_sayings="Do you want to come inside?;Are you a SPY?;It needs to be about 20% coo...*vomit*;I'm...an egghead!;Awesome!;Now careful [CENSORED];Excuse me!;Never fear, your friendly neighbourhood Dash is here!;And that's why you would never qualify to be my pet;Dun dun duuuun;My life is ruined!;I lost...;Best day ever!;LOUDER!;Pinkie Pie...you are SO random;Time to take out the adorable trash;Yes, it's all true;10...seconds...flat;I'd rather read Daring Do;'I love you, daddy'. Who'd write such trash?".split(";");
function InteractivePony(){this.base_url="//static.fimfiction.net/images/interactive_pony/dash/";this.sprite="dashing_right.gif";this.dom_element=$("<div class='interactive_pony'><img class='interactive_pony' src='"+this.base_url+this.sprite+"' /><div class='speech_container'><div class='speech'>Do you want to come inside?</div></div></div>");$("body").append(this.dom_element);this.x=0;this.y=175;this.max_speed=300;this.hspeed=0;this.acceleration=17;this.friction=.93;this.facing="right";this.on_ground=
!0;this.sleep_timer=0;this.text="";this.target_y=this.target_x=this.next_text_timer=this.text_counter=0;this.state="default";this.container=$("body .header");var a=this;$(this.dom_element).on("click",function(){a.Clicked()});$(".user_toolbar").mousemove(function(b){b.originalEvent.found_container||(b.originalEvent.found_container=!0,a.UpdateMouse(b.pageX,b.pageY,$(this)))});$("img").mousemove(function(b){!b.originalEvent.found_container&&50<$(this).width()&&!$(this).hasClass("interactive_pony")&&
(b.originalEvent.found_container=!0,a.UpdateMouse(b.pageX,b.pageY,$(this)))});$("*").mousemove(function(b){!b.originalEvent.found_container&&80<$(this).height()&&(b.originalEvent.found_container=!0,a.UpdateMouse(b.pageX,b.pageY,$(this)))});this.Say(dash_sayings[Math.floor(Math.random()*dash_sayings.length)])}InteractivePony.prototype.Say=function(a){this.text=a;this.next_text_timer=this.text_counter=0;this.dom_element.find("div.speech").fadeIn()};
InteractivePony.prototype.Clicked=function(){"sleeping"==this.state&&(this.state="default")};
InteractivePony.prototype.Update=function(a){if("moving_container"==this.state||"default"==this.state)this.target_x>this.x+30&&(this.hspeed+=this.acceleration),this.target_x<this.x-30&&(this.hspeed-=this.acceleration),this.hspeed>this.max_speed&&(this.hspeed=this.max_speed),this.hspeed<-this.max_speed&&(this.hspeed=-this.max_speed),this.hspeed*=this.friction,2<this.hspeed&&(this.facing="right"),-2>this.hspeed&&(this.facing="left"),this.x+=this.hspeed*a;"default"==this.state&&(1>Math.abs(this.hspeed)?
(this.sleep_timer+=a,10<this.sleep_timer&&(this.state="sleeping")):this.sleep_timer=0);if("moving_container"==this.state){var b=3*(this.container.offset().top-this.y);150<b&&(b=150);-150>b&&(b=-150);this.y+=b*a;1>Math.abs(this.container.offset().top-this.y)&&this.x>this.container.offset().left&&this.x<this.container.offset().left+this.container.width()&&(this.y=this.container.offset().top,this.state="default",this.on_ground=!0)}"sleeping"==this.state&&(this.sleep_timer=0);this.text_counter+=30*a;
this.text_counter>this.text.length&&(this.next_text_timer+=a);5<this.next_text_timer&&this.FadeOutText();10<this.next_text_timer&&"sleeping"!=this.state?this.Say(dash_sayings[Math.floor(Math.random()*dash_sayings.length)]):10<this.next_text_timer&&this.Say("zzz...")};InteractivePony.prototype.FadeOutText=function(){this.dom_element.find("div.speech").fadeOut()};
InteractivePony.prototype.UpdateMouse=function(a,b,c){this.target_x=a;"sleeping"==this.state?50<Math.abs(this.target_x-this.x)&&(this.state="default"):this.container!=c&&(this.container=c,this.state="moving_container",this.on_ground=!1)};InteractivePony.prototype.SetSprite=function(a){this.sprite!=a&&(this.sprite=a,this.dom_element.find("img.interactive_pony").attr("src",this.base_url+a))};
InteractivePony.prototype.Render=function(){"sleeping"==this.state?this.SetSprite("cloud_sleep_"+this.facing+".gif"):this.on_ground?200<this.hspeed?this.SetSprite("dashing_right.gif"):15<this.hspeed?this.SetSprite("trotcycle_rainbow_right.gif"):-200>this.hspeed?this.SetSprite("dashing_left.gif"):-15>this.hspeed?this.SetSprite("trotcycle_rainbow_left.gif"):this.SetSprite("stand_rainbow_"+this.facing+".gif"):this.SetSprite("fly_rainbow_"+this.facing+".gif");var a=parseInt(this.x-this.dom_element.width()/
2),b=parseInt(this.y-this.dom_element.height());this.dom_element.css("top")!=b&&this.dom_element.css("top",b);this.dom_element.css("left")!=a&&this.dom_element.css("left",a);this.dom_element.find("div.speech").text(this.text.substr(0,parseInt(this.text_counter)))};function InitiateInteractivePony(){var a=new InteractivePony;setInterval(function(){window_focused&&(a.Update(.016),a.Render())},16)}$(document).ready(function(){1==LocalStorageGet("show_interactive_pony",0)&&InitiateInteractivePony()});function Bookshelf(a){this.id=a;this.template="sidebar"}
Bookshelf.prototype.Edit=function(a){var b=this,c=new PopUpMenu("","<i class='fa fa-pencil'></i> Edit Bookshelf");c.SetWidth("650");c.SetCloseOnHoverOut(!1);c.SetCloseOnLinkPressed(!1);c.SetContent("<div style='text-align:center;'><i class='fa fa-spin fa-spinner' style='font-size:50px; margin:20px; color:#777;'></i></div>");c.SetFixed(!1);c.Show();var d=0==this.id;$.ajax(d?"/ajax/bookshelves/new":"/ajax/bookshelves/"+this.id+"/edit",null).done(function(e){c.SetContent(e.content);c.SetPosition();$("#edit-bookshelf-form button[name='cancel']").click(function(a){a.preventDefault();
c.Close()});$("#edit-bookshelf-form").submit(function(e){e.preventDefault();var g=$(this).find(".save-button");e=g.find("i");(new AjaxRequest({url:"/ajax/bookshelves"+(d?"":"/"+b.id),method:"POST",button:g,spinner:e,signed:!0,data:$(this).serializeArray(),success:function(d){c.Close();switch(b.template){case "sidebar":b.UpdateDOM(d.sidebar);break;case "sidebar-normal":b.UpdateDOM(d.sidebar_normal);break;case "popup-item":b.UpdateDOM(d.popup_item);break;case "card":b.UpdateDOM(d.card)}"undefined"!==
typeof a&&a(d)}})).then(function(){g.find("i").attr("class","fa fa-check");g.prop("disabled",!1)})})}).fail(function(a){StyledAlert("Error loading bookshelf for editing");c.Close()});return!1};Bookshelf.prototype.Delete=function(a){var b=this;StyledConfirm("Are you sure you want to delete this bookshelf?",function(){new AjaxRequest({url:"/ajax/bookshelves/"+b.id,method:"DELETE",signed:!0,success:function(b){"undefined"!==typeof a&&a(b)}})});return!1};
Bookshelf.prototype.UpdateDOM=function(a){a=$(a);$(this.dom).replaceWith(a);this.SetDOM(a)};Bookshelf.prototype.SetDOM=function(a){this.dom=a;var b=this;$(this.dom).find(".bookshelf-edit").click(function(a){a.preventDefault();b.Edit()});$(this.dom).find(".bookshelf-delete").click(function(a){a.preventDefault();b.Delete(function(a){window.location=a.url})})};function BookshelfItem(a,b,c){this.bookshelf=a;this.story=b;this.added=c}
BookshelfItem.prototype.Add=function(){var a=this;if("undefined"!==typeof a.dom){if(a.dom.hasClass("loading"))return;a.dom.addClass("loading")}(new AjaxRequest({url:"/ajax/bookshelves/"+this.bookshelf+"/items",method:"POST",signed:!0,data:{story:this.story},success:function(b){"undefined"!==typeof a.dom&&(a.dom.data("added",b.added),a.dom.removeClass("selected"),a.dom.removeClass("unselected"),a.dom.addClass(b.added?"selected":"unselected"),a.dom.find(".num_stories").text(b.num_stories))}})).then(function(){a.dom.removeClass("loading")})};
BookshelfItem.prototype.Remove=function(){var a=this;if("undefined"!==typeof a.dom){if(a.dom.hasClass("loading"))return;a.dom.addClass("loading")}(new AjaxRequest({url:"/ajax/bookshelves/"+this.bookshelf+"/items/"+this.story,method:"DELETE",signed:!0,success:function(b){"undefined"!==typeof a.dom&&(a.dom.data("added",b.added),a.dom.removeClass("selected"),a.dom.removeClass("unselected"),a.dom.addClass(b.added?"selected":"unselected"),a.dom.find(".num_stories").text(b.num_stories))}})).then(function(){a.dom.removeClass("loading")})};
$(document).on("click",".story-bookshelves-widget .bookshelf",function(){var a=$(this),b=new BookshelfItem(a.data("bookshelf"),a.data("story"),a.data("added"));b.dom=a;b.added?b.Remove():b.Add()});
$(document).on("click",".show-bookshelves-popup",function(){var a=$(this),b=new PopUpMenu("","<i class='fa fa-book'></i> Add To Bookshelves");b.SetWidth("400px");b.SetCloseOnHoverOut(!1);b.SetCloseOnLinkPressed(!1);b.SetContent("<div style='text-align:center;'><i class='fa fa-spin fa-spinner' style='font-size:50px; margin:20px; color:#777;'></i></div>");b.LoadContent("/ajax/bookshelves/add-story-popup?story="+a.data("story"),!0);b.Show()});
$(document).on("click",".bookshelves-popup-list .bookshelf",function(){var a=$(this),b=new BookshelfItem(a.data("bookshelf"),a.data("story"),a.data("added"));b.dom=a;b.added?b.Remove():b.Add()});
$(document).on("click",".button-new-bookshelf",function(){var a=$(this);(new Bookshelf(0)).Edit(function(b){a.closest("ul").hasClass("bookshelves")?a.closest("ul").append($(b.content)):a.closest(".bookshelves").find("ul").append($(b.content));StyledConfirm("Bookshelf created! Would you like to jump to it?",function(){window.location=b.link})})});
$(document).on("click",".button-bookshelf-card-edit",function(){var a=$(this),b=new Bookshelf(a.data("bookshelf"));b.template="card";b.SetDOM(a.parents(".bookshelf-card"));b.Edit()});$(document).on("click",".button-bookshelf-card-delete",function(){var a=$(this),b=new Bookshelf(a.data("bookshelf"));b.template="card";b.SetDOM(a.parents(".bookshelf-card"));b.Delete(function(b){a.parents(".bookshelf-card").remove()})});
$(document).on("reordered",".bookshelves ul",function(){var a=$(this).closest("form"),b=[];$(this).find("li").each(function(){b.push($(this).data("id"))});var c=$(a).find("input[name=bookshelves]");0==c.length&&(c=$("<input name='bookshelves' type='hidden'>"),$(a).append(c));c.val(JSON.stringify(b));console.dir(a.serializeArray());new AjaxRequest({method:"POST",url:"/ajax/bookshelves/order",data:a.serializeArray(),signed:!0})});function OpenChapterDownloadMenu(a){var b=new PopUpMenu("","<i class='fa fa-download'></i> Download Chapter");str="<ul>";str+="<li><a href='"+$(a).data("txt")+"'>Download TXT file</a></li>";str+="<li><a href='"+$(a).data("html")+"'>Download HTML file</a></li>";str+="</ul>";b.SetContent(str);b.SetDimmerEnabled(!1);b.Show($(a).offset().left,$(a).offset().top)}
function SaveChapter(a,b){var c=$(a).find(".format-toolbar button[data-function='save'] i");new AjaxRequest({method:"POST",url:"/ajax/chapters/"+$(a).find("[name=chapter]").val(),data:$(a).serializeArray(),signed:!0,spinner:c,success:function(a,c){$("#chapter_container").html(a.content_marked_up);$("#chapter_title").html(a.title);"undefined"!==typeof b&&b()}})}
function Chapter_Publish(a,b,c){$(a).addClass("chapter_publishing");var d=$(a).hasClass("chapter_published");(new AjaxRequest({method:d?"DELETE":"POST",url:"/ajax/chapters/"+b+"/publish",signed:!0,success:function(b,d){"0"==b.published?($(a).removeClass("chapter_published"),$(a).addClass("chapter_unpublished")):($(a).removeClass("chapter_unpublished"),$(a).addClass("chapter_published"));$(c).html(b.title)}})).then(function(){$(a).removeClass("chapter_publishing")})}
function FontDetector(){this.canvas=document.createElement("canvas");"getContext"in this.canvas&&(this.ctx=this.canvas.getContext("2d"),this.base_metrics=FontDetector.base_fonts.map(FontDetector.prototype.get_metrics.bind(this)))}FontDetector.base_fonts=["serif","sans-serif","monospace"];FontDetector.prototype.measureText=function(a){return this.ctx.measureText(a).width};FontDetector.prototype.get_metrics=function(a){this.ctx.font="normal 50px "+a;return["M","W","I","1","font test"].map(FontDetector.prototype.measureText.bind(this))};
FontDetector.compare_metrics=function(a,b){for(var c=0;c<a.length;++c)if(a[c]!=b[c])return!1;return!0};FontDetector.prototype.test=function(a){return"ctx"in this?a.filter(function(a){for(var c=0;c<FontDetector.base_fonts.length;c++){var d=this.get_metrics('"'+a+'", '+FontDetector.base_fonts[c]);if(!FontDetector.compare_metrics(this.base_metrics[c],d))return!0}return!1},this):a};
function OpenChapterFormatMenu(a){a=$(a).parent();menu_chapter_format.Show($(a).offset().left-250+$(a).width()+4,$(a).offset().top);var b=new FontDetector,c="<optgroup label='Browser Defaults'><option value='serif' style='font-family: serif'>Serif</option><option value='sans-serif' style='font-family: sans-serif'>Sans Serif</option><option value='monospace' style='font-family: monospace'>Monospace</option></optgroup>";a=function(a,e){var f=b.test(a).sort();if(0<f.length){c+="<optgroup label='"+e+
"'>";for(var g=0;g<f.length;g++)c+="<option value='"+f[g]+"' style='font-family: "+f[g]+"'>"+f[g]+"</option>";c+="</optgroup>"}};a("Georgia;Times New Roman;Constantia;Cambria;Book Antiqua;Perpetua;Rockwell;Calisto MT;Palatino;Palatino Linotype;Baskerville;Baskerville Old Face;Didot;Didot LT STD;Garamond;Hoefler Text;Lucida Bright;Bitstream Vera Serif;DejaVu Serif;Liberation Serif;Century Schoolbook L;URW Bookman L;URW Palladio L;Nimbus Roman No9 L;Roboto Slab;Droid Serif;FreeSerif".split(";"),"Serif");
a("Arial;Calibri;Candara;Corbel;Century Gothic;Segoe UI;Verdana;Tahoma;Microsoft Sans Serif;Lucida Sans;Trebuchet MS;Franklin Gothic;Helvetica;Lucida Grande;Optima;Apple Gothic;Futura;Geneva;Gill Sans;Gill Sans MT;Bitstream Vera Sans;Ubuntu;DejaVu Sans;Liberation Sans;Nimbus Sans L;URW Gothic L;Roboto;Roboto Condensed;Droid Sans;Open Sans;FreeSans;Fira Sans".split(";"),"Sans Serif");a("Bitstream Vera Sans Mono;Lucida Console;Consolas;Courier New;Lucida Sans Typewriter;Andale Mono;Ubuntu Monospace;DejaVu Sans Mono;Liberation Mono;Nimbus Mono L;Monaco;Andale Mono;Menlo;Droid Sans Mono;FreeMono;Fira Mono".split(";"),
"Monospace");a("Comic Sans;Comic Sans MS;Segoe Print;Segoe Script;Maiandra GD;Kristen ITC;Pristina;Tempus Sans ITC;Viner Hand ITC;Bradley Hand;Chalkboard;Chalkboard SE;Luminari;Marker Felt;Noteworthy;Savoye LET;SignPainter;Snell Roundhand;Trattatello;Apple Chancery;Purisa".split(";"),"Cursive");a("OpenDyslexic;OpenDyslexicAlta;OpenDyslexicMono;Dyslexie;Sylexiad Sans;Sylexiad Sans Spaced;Sylexiad Serif;Sylexiad Serif Spaced;Read Regular;Lexia Readable".split(";"),"Accessibility");a(["Equestria","Celestia Redux",
"Celestia Redux Alternate"],"Fantasy");$("#format_font").html(c);$("#format_font").val(LocalStorageGet("format_font","Serif"))}
(function(){function a(){var a=$("#chapter_toolbar_container"),d=a.parents(".chapter");a.data("start_y")||a.data("start_y",a.offset().top+50);a=(Math.max(0,a.data("start_y")-$(window).scrollTop())+Math.max(0,$(window).scrollTop()+$(window).height()-(d.offset().top+d.height())))/200;a=1<a?1:0>a?0:a;a!=b&&$(document.body).css("background-color",rgbToCSS(colorBlend(c,e,a)))}var b=null,c=null,d=null,e=null;window.ComputeBackgroundColor=function(){$(document.body).css("background-color","");c=extractColor($(document.body).css("background-color"));
d=extractColor($("#chapter_format").css("background-color"));var f=127>.39*d[0]+.5*d[1]+.11*d[2];e=colorMult(d,f?.85:.95);f=rgbToCSS(colorMult(d,f?1.4:.82));$(".chapter_content_box").css({"border-left-color":f,"border-right-color":f});b=null;a()};window.UpdatePageBackgroundColor=a})();$(document).on("click",".comment .reply_button",function(a){AddQuote($(this).data("comment-id"),a.shiftKey);a.preventDefault();return!1});function AddQuote(a,b){$("#comment_entry textarea").val($("#comment_entry textarea").val()+(0<$("#comment_entry textarea").val().length?"\n":"")+">>"+a+" ");b||$("html, body").animate({scrollTop:$("#new_comment").offset().top},300)}function JumpToComment(a,b){window.location=a}var quote_container=null;
function ExpandComment(a,b,c,d){var e=$("#comment_"+c);null!=quote_container&&quote_container.fadeOut(75,function(a){$(this).remove()});0!=e.length||d?0!=e.length&&(d=$("#comment_expand_"+b+"_"+c),0==d.length?(d=e.clone(!0),e=d.find(".name").text(),d.attr("id","comment_expand_"+b+"_"+c),d.addClass("expanded_comment"),a.text(">> "+e),d.css("margin-bottom","10px"),d.find(".author").css("float","none"),d.find(".author").remove(),d.find(".data").css("margin-left","0px"),d.find(".comment_information div").first().prepend("<b>"+
e+" &#xb7;</b> "),d.find(".comment_data").css("font-size","1.0em"),d.find(".expanded_comment").remove(),a.hasClass("comment_callback")?a.closest(".comment").find(".comment_data").first().prepend(d):a.after(d)):d.remove()):new AjaxRequest({url:"/ajax/comments/"+$(a).closest(".comment").data("type")+"/"+c,method:"GET",success:function(d){0==$("#hidden_comments").length&&$("body").append("<div id='hidden_comments' style='display:none;'>");$("#hidden_comments").append(d.content);ExpandComment(a,b,c,!0)}})}
$(document).on("click",".comment_quote_link",function(a){a.preventDefault();ExpandComment($(this),$(this).closest(".comment").data("comment_id"),$(this).data("comment_id"),!1)});var mouse_x=0,mouse_y=0;
function SetupCommentQuotes(a){$(a).data("type");$(".comment_quote_link").each(function(a){var c=$(this).data("comment_id"),d=$("#comment_"+c);a=$(this).closest(".comment").data("comment_id");var e=$(this).closest(".comment");d.length&&($(this).text(">> "+d.data("author")),$(this).data("comment_id",c),c=$("#comment_callbacks_"+c),e=$("<a class='comment_quote_link comment_callback' style='font-size:0.9em; font-weight:bold;' href='#comment/"+a+"'><img src='"+static_url+"/images/icons/post.png' /> "+
e.data("author")+"</a> "),e.data("comment_id",a),c.append(e))});$(".comment_quote_link").hoverIntent({over:function(a){function c(){null!=quote_container&&quote_container.fadeOut(75,function(a){$(this).remove()});quote_container.addClass("quote_container");quote_container.addClass("comment");quote_container.css("position","absolute");quote_container.css("display","none");quote_container.css("z-index","200000");quote_container.fadeIn(75);quote_container.css("top",d.offset().top+20);quote_container.css("left",
d.parents(".comment").offset().left-20);quote_container.css("width",d.parents(".comment").width()+40);quote_container.find(".toolbar").remove();$(document.body).append(quote_container);LoadVisibleImages()}var d=$(this),e=$(this).data("comment_id"),f=$("#comment_"+e);0==f.length?new AjaxRequest({url:"/ajax/comments/"+$(this).closest(".comment_list").data("type")+"/"+e,method:"GET",success:function(a){0==$("#hidden_comments").length&&$("body").append("<div id='hidden_comments' style='display:none;'>");
$("#hidden_comments").append(a.content);f=$("#comment_"+e);quote_container=f.clone();c()}}):(quote_container=f.clone(),c())},timeout:0,interval:50,out:function(a){null!=quote_container&&quote_container.fadeOut(75,function(a){$(this).remove()})}});$(".comment_quote_link").hover(function(a){mouse_x=a.pageX;mouse_y=a.pageY},function(a){})}
AjaxRequest.BindForm(".form-add-comment",function(a,b,c){c.find("textarea").val("");c.find(".comment_success").show();a=$("<div class='single_comment'>"+a.comment+"</div>");"undefined"==typeof $(".comment_list").data("order")||"ASC"==$(".comment_list").data("order")?$(".comment_list").append(a):$(".comment_list").prepend(a);a.fadeIn();$("html, body").animate({scrollTop:a.offset().top},0);a=$("<div class='success-message'>Comment Posted Successfully</div>");c.find(".button-submit").parent().append(a);
a.fadeOut(5E3)});$(document).on("click","#preview_comment",function(a){$.post("/ajax/comments/preview",{comment:$("#comment_comment").val()},function(a){"error"in a?ShowErrorWindow(a.error):($("#comment_preview").html(a.comment),$("#comment_preview").fadeIn())})});function ToggleEditComment(a){$(a).find(".edit_area").toggle();$(a).find(".comment_data").toggle()}AjaxRequest.BindForm(".form-edit-comment",function(a,b,c){b=c.closest(".comment");b.find(".comment_data").html(a.content);ToggleEditComment(b)});
$(document).on("click",".comment_likable i",function(a){var b=$(this).parent();a=b.hasClass("comment_liked");var c=b.hasClass("comment_disliked"),d="POST";b.data("like")&&a&&(d="DELETE");!b.data("like")&&c&&(d="DELETE");new AjaxRequest({url:"/ajax/comments/"+b.data("type")+"/"+b.data("comment")+(b.data("like")?"/like":"/dislike"),signed:!0,method:d,success:function(a){"error"in a?ShowErrorWindow(a.error):(b.parent().find("span").removeClass("comment_disliked"),b.parent().find("span").removeClass("comment_liked"),
"1"==a.liked?b.parent().find("span").addClass("comment_liked"):"1"==a.disliked&&b.parent().find("span").addClass("comment_disliked"),"0"==a.likes?b.parent().find("span.comment_like_text").text(""):b.parent().find("span.comment_like_text").text(a.likes),"0"==a.dislikes?b.parent().find("span.comment_dislike_text").text(""):b.parent().find("span.comment_dislike_text").text(a.dislikes))}})});
$(document).on("click",".button-delete-comment",function(a){a.preventDefault();var b=$(this),c=b.closest(".comment");ConfirmPrompt("Are you sure you want to delete this comment?",function(){new AjaxRequest({url:"/ajax/comments/"+c.data("type")+"/"+c.data("comment_id"),method:"DELETE",signed:!0,spinner:b,success:function(a){c.remove()}})})});function GroupCreate(a,b){b&&(window.location="/manage_user/groups/new?name="+a);new AjaxRequest({url:"/ajax/groups/list/find-existing?name="+encodeURIComponent(a),method:"GET",success:function(b){b.has_existing?($("#existing_groups div").html(b.content),$("#existing_groups").show()):window.location="/manage_user/groups/new?name="+encodeURIComponent(a)}})}
function DeleteGroupItem(a){StyledConfirm("Are you sure you want to delete this story?",function(){new AjaxRequest({url:"/ajax/group-items/"+a,method:"DELETE",signed:!0,success:function(a){$(".story-card-container-"+a.story).remove()}})})}$(document).on("submit","#form_group_membership_settings",function(a){a.preventDefault();a=$(this);new AjaxRequest({url:"/ajax/groups/"+a.find("[name=group]").val()+"/membership/settings",data:a.serialize(),button:a.find("button"),spinner:a.find("button i"),success:function(a){$("#notification_settings").slideUp()}})});
$(document).on("submit","#form_group_join_leave",function(a){a.preventDefault();a=$(this);new AjaxRequest({url:"/ajax/groups/"+a.find("[name=group]").val()+"/membership",method:"1"==a.find("[name=joined]").val()?"DELETE":"POST",signed:!0,success:function(a){window.location=a.url}})});AjaxRequest.BindForm("#form_group_add_story",function(a){window.location=a.url});
$(document).on("click",".button_add_story_to_group",function(a){a.preventDefault();a=$(this);var b=new PopUpMenu("","<i class='fa fa-book'></i> Add To Groups");b.SetWidth("600px");b.SetCloseOnHoverOut(!1);b.SetCloseOnLinkPressed(!1);b.SetContent("<div style='text-align:center;'><i class='fa fa-spin fa-spinner' style='font-size:50px; margin:20px; color:#777;'></i></div>");b.LoadContent("/ajax/groups/list/add-story?story="+a.data("story"),!0);b.Show()});
$(document).on("click",".button-group-folder-add",function(a){a.preventDefault();var b=$(this);b.addClass("loading");(new AjaxRequest({url:"/ajax/groups/"+b.data("group")+"/folders/"+b.data("folder")+"/items",method:"POST",signed:!0,data:{story:b.data("story")},success:function(a){b.removeClass("unselected");b.addClass("selected")}})).then(function(){b.removeClass("loading")})});
$(document).on("submit","#form_group_modify_thread",function(a){a.preventDefault();a=$(this);new AjaxRequest({url:"/ajax/group-threads/"+a.find("[name=thread]").val(),method:"POST",signed:!0,button:a.find("a[name='save_button']"),spinner:a.find("a[name='save_button'] i"),data:a.serializeArray(),success:function(a){$("#thread_settings").slideUp();$("#thread_title").text(a.title)}})});AjaxRequest.BindForm("#form_group_delete_thread",function(a){window.location=a.url});
AjaxRequest.BindForm(".form-add-thread",function(a){window.location=a.url});$(document).on("click",".group_member_modify_level",function(a){a.preventDefault();var b=$(this);new AjaxRequest({url:"/ajax/groups/"+$(this).data("group")+"/members/"+$(this).data("user")+"/level",method:"POST",data:{level:$(this).data("level")},success:function(a){$("#group_member_modify_level"+b.data("member")+" img").removeClass("group_member_level_selected");$(b).addClass("group_member_level_selected")}})});var window_focused=!0,last_update_interval=60,time_since_update=0,max_interval=600,total_elapsed_time=0,num_notifications=0,flash_title=!1,title_cache="",flash_state=!1,popup_timer=0,beep_enabled=!1,debug=!1,event_source=null,event_source_interval=null,popup_interval=null,worker=null;$(window).blur(function(){window_focused=!1});
function ShowNotification(a,b){"undefined"===typeof b&&(b=(new Date).getTime());if(!a.nsfw||"true"==getCookie("view_mature"))if(console.log("Showing notification: "+b),"granted"==DesktopNotificationStatus()){var c=LocalStorageGet("latest_message_id",-1);if(b!=c){LocalStorageSet("latest_message_id",b);var d=new Notification(a.title,{icon:"undefined"!==typeof a.icon?a.icon:"http://static.fimfiction.net/images/notifications/story.png",body:a.text,tag:b});"show"in d&&d.show();if("link"in a){var e=a.link,
f=window;d.onclick=function(){f&&!f.closed?(f.location=e,f.focus()):window.open(e)}}setTimeout(function(){d.close()},2E4);beep_enabled&&document.getElementById("notification_beep").play()}setTimeout(function(){LocalStorageSet("latest_message_id",-1)},1E3)}else c=LocalStorageGet("latest_message_id",-1),b>c&&(LocalStorageSet("latest_message_id",b),beep_enabled&&document.getElementById("notification_beep").play()),$("#notification_popup .notification_title").text(a.title),$("#notification_popup .notification_title").attr("href",
a.link),$("#notification_popup .notification_body").text(a.text),$("#notification_popup .notification_image").attr("src","http://static.fimfiction.net/images/notifications/story.png"),$("#notification_popup").fadeIn(),popup_timer=10,null==popup_interval&&(popup_interval=setInterval(function(){UpdateNotificationsPopup()},1E3))}
function StartNotificationsWorker(){worker=new SharedWorker("/workers/notifications_worker.js");worker.port.addEventListener("message",function(a){if("ping"===a.data)worker.port.postMessage(logged_in_user.id);else{if("notification"==a.data.message){var b=JSON.parse(a.data.data);ShowNotification(b,b.identifier);console.log("Updating counts: "+a.data.counts);SetNotificationCount(a.data.counts)}"private_message"==a.data.message&&(b=JSON.parse(a.data.data),ShowNotification(b,a.data.event_id));"counts"==
a.data.message&&(console.log("Updating counts: "+a.data.data),SetNotificationCount(a.data.data))}},!1);worker.port.start();worker.port.postMessage(logged_in_user.id)}
function StartNotificationsEventSource(){var a=function(){var a=LocalStorageGet("last_event_source_ping",0);null!=event_source?LocalStorageSet("last_event_source_ping",GetTime()):a<GetTime()-4E3&&(LocalStorageSet("last_event_source_ping",GetTime()),event_source=new EventSource("/notifications/"+logged_in_user.id+"/stream"),event_source.addEventListener("message",function(a){a=JSON.parse(a.data);ShowNotification(a,a.identifier)},!1),event_source.addEventListener("private_message",function(a){a=JSON.parse(a.data);
ShowNotification(a,(new Date).getTime())},!1),event_source.addEventListener("counts",function(a){SetNotificationCount(a.data);LocalStorageSet("num_notifications",a.data)},!1),event_source.addEventListener("logout",function(a){event_source.close();clearInterval(event_source_interval)},!1))};event_source_interval=setInterval(a,2E3);a()}
function StartNotificationsPoll(){var a=!1;LocalStorageGet("last_poll",0)<GetTime()-6E4&&(LocalStorageSet("last_poll",GetTime()),a=!0);poll_interval=setInterval(function(){if(a||LocalStorageGet("last_poll",0)<GetTime()-6E4)LocalStorageSet("last_poll",GetTime()),a=!0,$.get("/notifications/"+logged_in_user.id+"/poll").done(function(a){SetNotificationCount(a);LocalStorageSet("num_notifications",a)}).fail(function(){clearInterval(poll_interval)})},3E4)}
function AttachNotificationsLocalStorage(){var a=function(a){"num_notifications"==a.key?SetNotificationCount(a.newValue):"reset_title"==a.key&&(document.title=title_cache)};window.addEventListener?window.addEventListener("storage",a,!1):window.attachEvent("onstorage",a)}
function StartNotifications(){if("function"===typeof SharedWorker)StartNotificationsWorker();else{try{window.localStorage.setItem("storage_test",!0),window.localStorage.removeItem("storage_test")}catch(a){return}"function"===typeof EventSource?StartNotificationsEventSource():StartNotificationsPoll();AttachNotificationsLocalStorage()}}function GetTime(){return(new Date).getTime()}
function SetNotificationCount(a,b){var c=a.split(" "),d=c[0],e=c[1],c=c[2],f=parseInt(d)+parseInt(e)+parseInt(c),g=f>num_notifications;num_notifications=f;!window_focused&&g&&(flash_title=!0,document.title="("+num_notifications+") "+title_cache);0==e&&0==d?($("#num_notifications").parent().removeClass("new"),document.title=title_cache):$("#num_notifications").parent().addClass("new");$("#num_social_notifications").text(d);0==d?$("#num_social_notifications").parent().removeClass("new"):$("#num_social_notifications").parent().addClass("new");
$("#num_meta_notifications").text(e);0==e?$("#num_meta_notifications").parent().removeClass("new"):$("#num_meta_notifications").parent().addClass("new");$("#num_content_notifications").text(c);0==c?$("#num_content_notifications").parent().removeClass("new"):$("#num_content_notifications").parent().addClass("new");$("#num_notifications").text(parseInt(e)+parseInt(d))}function Notifications(){this.num_meta_notifications=this.num_social_notifications=this.num_content_notifications=0}
Notifications.prototype.SetContentNotifications=function(a){this.num_content_notifications=a;this.UpdateNotificationsDisplay()};Notifications.prototype.SetMetaNotifications=function(a){this.num_social_notifications=a;this.UpdateNotificationsDisplay()};Notifications.prototype.SetSocialNotifications=function(a){this.num_meta_notifications=a;this.UpdateNotificationsDisplay()};
Notifications.prototype.UpdateNotificationsDisplay=function(){$("#num_content_notifications").text(this.num_content_notifications);0==this.num_content_notifications?$("#num_content_notifications").parent().removeClass("new"):$("#num_content_notifications").parent().addClass("new");$("#num_notifications").text(this.num_meta_notifications+this.num_social_notifications);0==this.num_meta_notifications+this.num_social_notifications?$("#num_notifications").parent().removeClass("new"):$("#num_notifications").parent().addClass("new")};
var notifications=new Notifications;$(document).ready(function(){is_logged_in&&(notifications.SetContentNotifications(logged_in_user.num_content_notifications),notifications.SetMetaNotifications(logged_in_user.num_meta_notifications),notifications.SetSocialNotifications(logged_in_user.num_social_notifications))});function InitialiseNotificationUpdater(a,b,c){num_notifications=a;title_cache=b;beep_enabled=c}
function UpdateNotificationsPopup(){flash_state=!flash_state;popup_timer--;0==popup_timer&&($("#notification_popup").fadeOut(),clearInterval(popup_interval))}
function DesktopNotificationStatus(){if("function"!==typeof Notification)return null;if("permission"in Notification)return Notification.permission;if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 0:return"granted";case 1:return"default";case 2:return"denied"}return null};$(document).on("click",".story_container .button-submit-story",function(a){a.preventDefault();a=$(this).data("story");var b=new PopUpMenu("","<i class='fa fa-cloud-upload'></i> Submit Story");b.LoadContent("/ajax/stories/"+a+"/submit-popup",!0);b.SetCloseOnHoverOut(!1);b.SetWidth("800px");b.Show();return!1});AjaxRequest.BindForm(".form-submit-story",function(a){window.setTimeout("location.reload()",0)});
$(document).on("click",".story_container .button-revoke-story",function(a){a.preventDefault();var b=$(this).data("story"),c=$(this),d=$(c).find("i");StyledConfirm("Are you sure you wish to revoke this story? It'll have to be resubmitted again if you change your mind!",function(){new AjaxRequest({url:"/ajax/stories/"+b+"/status",method:"POST",spinner:d,button:c,signed:!0,data:{status:"revoke"},success:function(a){window.setTimeout("location.reload()",0)}})});return!1});
$(document).on("click",".story_container .button-new-chapter",function(){var a=$(this).data("story"),b=new PopUpMenu("","<i class='fa fa-file-text'></i> New Chapter");str="<form id='form-new-chapter'><input type='hidden' name='story' value='"+a+"' /><table class='properties'><tr><td class='label' style='width:140px;'>Chapter Name</td><td><input type='text' name='title' placeholder='Leave blank for auto-named chapter' /><br />Use <b>%i%</b> to insert the chapter number dynamically</td></tr></table></div><div class='drop-down-pop-up-footer'><button class='styled_button'><i class='fa fa-plus'></i> Add New Chapter</button></div></form>";
b.SetContent(str);b.SetCloseOnHoverOut(!1);b.SetWidth("550px");b.Show();$("#form-new-chapter").submit(function(a){a.preventDefault();AddChapter(this);return!1})});function AddChapter(a){new AjaxRequest({url:"/ajax/stories/"+$(a).find("[name=story]").val()+"/chapters",method:"POST",data:$(a).serializeArray(),signed:!0,success:function(a){window.location=a.link}});return!1}
$(document).on("click",".button-set-featured-groups",function(a){a.preventDefault();a=$(this).data("story");var b=new PopUpMenu("","<i class='fa fa-group'></i> Set Featured Groups");b.LoadContent("/ajax/groups/list/featured?story="+a,!0);b.SetCloseOnHoverOut(!1);b.SetWidth("400px");b.Show()});
function UpdateTracking(a){a.parent().hide();a.parent().parent().find(".track_changing").show();$.post("/ajax/track_story.php",$(a).serialize(),function(b){a.parent().show();a.parent().parent().find(".track_changing").hide();a.find(".track").attr("checked",1==$("tracking",b).text());a.find(".email").attr("checked",1==$("email",b).text());1==$("tracking",b).text()?a.parent().find(".email_input").show():a.parent().find(".email_input").hide()})}
function UpdateTrackingComments(a){var b=document.getElementById("track_comments_bool_"+a).checked;$("#track_comments_widget_"+a).html("Updating...");$.post("/ajax/track_comments.php",{story:a,track:b?"1":"0"},function(b){$("#track_comments_widget_"+a).html(b)})}$(".track_comments").live("change",function(a){a=$(this).attr("value");UpdateTrackingComments(a)});
function UpdateReadItLater(a){var b=a.data("id"),c=a.data("selected");$.post("/ajax/add_read_it_later.php",{story:b,selected:1==c?0:1},function(b){a.data("selected",$("selected",b).text());"1"==$("selected",b).text()?a.attr("class","read_it_later_widget read_it_later_selected"):a.attr("class","read_it_later_widget read_it_later_unselected")})}$(".read_it_later_widget").live("click",function(a){UpdateReadItLater($(this))});
function UpdateFavourite(a){var b=a.data("id"),c=a.data("selected"),d=a.data("email");$.post("/ajax/add_favourite.php",{story:b,selected:c,email:d},function(b){""!=$("error",b).text()?ShowErrorWindow($("error",b).text()):(a.data("selected",$("selected",b).text()),a.data("email",$("email",b).text()),"1"==$("selected",b).text()?(a.find("a").attr("class","favourite_button favourite_button_selected"),a.find(".popup_email").show(),a.find(".popup_fav").hide()):(a.find("a").attr("class","favourite_button favourite_button_unselected"),
a.find(".popup_email").hide(),a.find(".popup_fav").show()))})}$(".favourite_widget a").live("click",function(a){a=$(this).parent();a.data("selected",1==a.data("selected")?0:1);UpdateFavourite(a)});$(".favourite_widget input").live("change",function(a){a=$(this).parent().parent().parent().parent();a.data("email",$(this).is(":checked")?1:0);UpdateFavourite(a)});
function ToggleRead(a){var b=$("#chapter_read_"+a),c=b.hasClass("chapter-read");new AjaxRequest({url:"/ajax/chapters/"+a+"/read",method:c?"DELETE":"POST",signed:!0,success:function(a){1==a.read?b.addClass("chapter-read"):b.removeClass("chapter-read")}})}var chapter_dragging=null;
$("ul.chapters div.chapter_container span.dragger").live("mousedown",function(a){null==chapter_dragging&&(chapter_dragging=$(this).parents("div.chapter_container"),chapter_dragging.addClass("dragging"),mouse_offset_x=a.pageX-chapter_dragging.offset().left,mouse_offset_y=a.pageY-chapter_dragging.offset().top,$("body").addClass("unselectable"))});var mouse_offset_x=0,mouse_offset_y=0;
$("body").live("mouseup",function(a){null!=chapter_dragging&&($(this).removeClass("unselectable"),chapter_dragging.removeClass("dragging"),chapter_dragging=null)});
$(document).mousemove(function(a){a=a.pageY-mouse_offset_y;if(null!=chapter_dragging){for(var b=!1,c=0;2>c;c++){var d=chapter_dragging,e=chapter_dragging.find("li");if(null!=d){var f=a-d.offset().top;d.offset();var g=d.next(),k=d.prev();g.length&&g.hasClass("chapter_container")&&f>g.height()/2+10&&(d.remove(),g.after(d),chapter_dragging=d,b=!0);k.length&&f<-k.height()/2-10&&(d.remove(),k.before(d),chapter_dragging=d,b=!0);e.css("top",f)}}b&&(chapter_dragging.parents("ul.chapters").find("li.save_ordering").show(),
chapter_dragging.parents("ul.chapters").addClass("chapters_expanded"))}});$(document).on("mouseenter","div.story .views",function(a){a.preventDefault();""==$(this).find(".view_graph").text()&&($(this).find(".view_graph").html("<img src='http://static.fimfiction.net/images/loading_white.gif' style='margin:10px;' />"),$(this).find(".view_graph").load("/ajax/story_views_graph.php?story="+$(this).data("story")))});
$(document).on("click",".button-story-chapter-list-expand",function(a){a.preventDefault();$("#form-chapter-list-"+$(this).data("story")).show();$(this).parent().remove()});$(document).on("click",".expand_chapters",function(a){a.preventDefault();$("#story_"+$(this).data("story")+" ul.chapters").addClass("chapters_expanded")});$(document).on("click",".card-flip",function(a){a.preventDefault();$(this).parent().parent().toggleClass("flipped")});
(function(){function a(a){$(".story-card-list").each(function(){if($(this).data("last-calc")!=$(this).width()||a){$(this).data("last-calc",$(this).width());var b=0,c=[],g=[],k=Math.max(1,Math.floor($(this).width()/300));if(1!=k||1!=$(this).data("last-columns"))$(this).data("last-columns",k),$(this).find("li").css("width",100/k+"%"),1==k?$(this).find(".story-card .story-card-content").css("padding-bottom",0):$(this).find(".story-card").each(function(){c[b]=$(this);g[b]=$(this).find(".story-card-content");
b++;if(b==k){for(var a=b=0,d=0;d<k;d++){var n=c[d].outerHeight(!1)-parseInt(g[d].css("padding-bottom"));n>a&&(a=n)}for(d=0;d<k;d++)g[d].css("padding-bottom",a-(c[d].outerHeight(!1)-parseInt(g[d].css("padding-bottom"))))}})}})}function b(b){b&&a(b);null==c&&(c=setTimeout(function(){a(b);c=null},1E3))}var c=null;$(window).resize(function(){b()});$(document).ready(function(){b(!0)});$(window).load(function(){b(!0)})})();function EditUser(a){a=$(a);$("#validation_error_message").addClass("hidden");var b=a.find("input[name=user]").val(),c=0==a.find("input[name=user]").val(),d=[];$("#external_account_list .external_account").each(function(){d.push({site:$(this).find(".external_account_site").val(),value:$(this).find(".external_account_value").val()})});var e=$(a).find("input[name=external_accounts]");0==e.length&&(e=$("<input name='external_accounts' type='hidden'>"),$(a).append(e));e.val(JSON.stringify(d));e=null;
e=c?a.serialize():a.serializeArray();new AjaxRequest({method:"POST",url:0==b?"/ajax/users":"/ajax/users/"+b,signed:!c,data:e,spinner:a.find(".button-submit i"),button:a.find(".button-submit"),success:function(a){a.registering?$("#registration_successful_message").fadeIn():window.location.reload()},fail:function(a){if("errors"in a){$("#validation_error_message").removeClass("hidden");window.location="#";for(var b in a.errors)error=a.errors[b],$("#"+b).find(".validation_error").attr("title",error),
$("#"+b).find(".validation_error").fadeIn();Recaptcha.reload()}else ShowErrorWindow("Error updating account")}})}$(document).ready(function(){$("#edit_user_form").submit(function(a){EditUser(this);a.preventDefault();return!1})});
$(document).on("click",".button_user_watch",function(a){a.preventDefault();var b=$(this);b.addClass("button_toggle_processing");a=b.data("watch");new AjaxRequest({url:"/ajax/users/"+b.data("user")+"/follow",method:"1"==a?"DELETE":"POST",signed:!0,success:function(a){b.removeClass("button_toggle_processing");"error"in a?ShowErrorWindow(a.error):(b.data("watch",a.watching?"1":"0"),a.watching?(b.addClass("user_is_watching"),b.removeClass("user_is_not_watching")):(b.addClass("user_is_not_watching"),b.removeClass("user_is_watching")))}})});
$(document).on("click",".button_user_block",function(a){a.preventDefault();var b=$(this);b.addClass("button_toggle_processing");new AjaxRequest({url:"/ajax/users/"+b.data("user")+"/block",signed:!0,method:b.data("block")?"DELETE":"POST",success:function(a){b.removeClass("button_toggle_processing");b.data("block",a.block);a.block?(b.addClass("user_is_blocking"),b.removeClass("user_is_not_blocking")):(b.addClass("user_is_not_blocking"),b.removeClass("user_is_blocking"))}})});
(function(){function a(a){a.addClass("loading");(new AjaxRequest({method:"get",url:"/ajax/notifications/list/drop-down",success:function(c){a.html(c.content);$("#num_notifications").text(c.meta_notifications+c.social_notifications);$("#num_content_notifications").text(c.content_notifications)}})).then(function(){a.removeClass("loading")})}$(document).on("click","#button-refresh-notifications-drop-down",function(b){b.preventDefault();b=$("#drop-down-notifications");a(b)});$(document).on("toolbar-hovered",
"#notifications-drop-down",function(){var b=$("#drop-down-notifications");""==b.html()&&a(b)})})();
(function(){function a(a){a.addClass("loading");(new AjaxRequest({method:"GET",url:"/ajax/private-messages/list/drop-down",success:function(c){a.html(c.content)}})).then(function(){a.removeClass("loading")})}$(document).on("click","#button-refresh-private-messages-drop-down",function(b){b.preventDefault();b=$("#drop-down-private-messages");a(b)});$(document).on("toolbar-hovered","#private-message-drop-down",function(){var b=$("#drop-down-private-messages");""==b.html()&&a(b)})})();
$(document).on("toolbar-hovered","#user_toolbar_story_list_button",function(){var a=$(this).find("ul");""==a.html()&&new AjaxRequest({url:"/ajax/toolbar/stories",method:"GET",success:function(b){a.html(b.content)}})});$(document).on("toolbar-hovered","#user_toolbar_blog_list_button",function(){var a=$(this).find("ul");""==a.html()&&new AjaxRequest({url:"/ajax/toolbar/blog-posts",method:"GET",success:function(b){a.html(b.content)}})});
$(document).on("click","#pin_nav_bar",function(){var a=LocalStorageGet("pin_nav_bar",0);LocalStorageSet("pin_nav_bar",0==a?1:0);InitialiseNavBar()});function InitialiseNavBar(){0==LocalStorageGet("pin_nav_bar",0)?$("body").removeClass("pin_nav_bar"):$("body").addClass("pin_nav_bar")}function ResetBanner(){delCookie("selected_theme")}
function InitialiseLocalSettings(){InitialiseNavBar();1!=LocalStorageGet("show_banner",1)?($("#title").hide(),$(".christmas-decoration").addClass("hidden")):($("#title").show(),$(".christmas-decoration").removeClass("hidden"))}$(document).on("click","#logout_link",function(a){$.post("/ajax/logout",{nonce:$(this).data("nonce")},function(a){window.location="/"})});
(function(){function a(a){this.link=this.dimmer=this.remove_timeout=null;this.BindLink(a)}var b=null,c=[];a.prototype.Load=function(a){var b=this,c=$('<div class="info-card-container"><div class="info-card"></div></div>'),g=c.find(".info-card");new AjaxRequest({url:"/ajax/users/infocard",method:"POST",data:{username:a},success:function(a){g.html(a.content);c.on("mouseleave",function(){b.TriggerRemove()});c.on("mouseenter",function(){b.CancelRemove()});b.infocard_container=c;null!=b.link&&b.Show()}});
return this.infocard_container=c};a.prototype.BindLink=function(a){this.UnbindLink();this.link=a;var b=this;this.link.data("infocard",!0);this.link.bind("mouseenter.infocard",null,function(){b.CancelRemove()});this.link.bind("mouseleave.infocard",null,function(){b.TriggerRemove()})};a.prototype.UnbindLink=function(){null!=this.link&&(this.link.data("infocard",!1),this.link.unbind("mouseleave.infocard"),this.link.unbind("mouseenter.infocard"),this.link=null)};a.prototype.Show=function(){var a=this.infocard_container.find(".user-card");
a.addClass("shrunk");setTimeout(function(){a.removeClass("shrunk");LoadVisibleImages()},50);this.dimmer=$("<div class='dimmer' style='z-index:9; display:none; pointer-events:none;'></div>");this.dimmer.fadeIn("fast");this.infocard_container.fadeIn(0);this.infocard_container.css("left",this.link.offset().left+this.link.width()-5);this.infocard_container.css("top",this.link.offset().top-60)};a.prototype.TriggerRemove=function(){clearTimeout(this.remove_timeout);var a=this;this.remove_timeout=setTimeout(function(){null!=
a.dimmer&&(a.dimmer.fadeOut("fast",function(){$(this).remove()}),a.dimmer=null);a.infocard_container.fadeOut("fast",function(){a.UnbindLink()})},300)};a.prototype.CancelRemove=function(){clearTimeout(this.remove_timeout)};$(document).on("mouseenter","div.content a",function(){clearTimeout(b);b=null;var d=$(this),e=$(this).attr("href");if(e&&1!=d.data("infocard")&&!d.data("no-user-popup")&&(e=/^\/user\/([^\/]*)$/.exec(e))&&"undefined"!==typeof e[1]){var f=e[1].replace(/ /g,"%20");b=setTimeout(function(){if(f in
c)c[f].BindLink(d),c[f].Show();else{var b=new a(d);$("#info-cards").append(b.Load(f));c[f]=b}},300)}});$(document).on("mouseleave","div.content a",function(){1!=$(this).data("infocard")&&(clearTimeout(b),b=null)})})();function SetupLoginPage(a){function b(b){var c="http:"+a;try{0<document.referrer.length&&!/\/index\.php\?view=login/i.test(document.referrer)&&(c=document.referrer)}catch(d){}try{b&&(c=c.replace(/^http:/,"https:"))}catch(e){}window.location=c}function c(c){if(c.origin=="http:"+a||c.origin=="https:"+a){var e=JSON.parse(c.data);switch(e.type){case "ready":d?alert("Login form initalize request while already initalized, this is probably a bug, you should report it."):($("#login_loading_message").addClass("hidden"),
c.source.postMessage(JSON.stringify({type:"confirm"}),c.origin),d=!0);break;case "login_complete":if(!e.force_secure)if(getCookie("ssl_check")){try{document.cookie="ssl_check=null;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=.fimfiction.net"}catch(f){}LocalStorageSet("signing_key",e.signing_key);setCookie("signing_key",e.signing_key)}else setCookie("secure_session",!0,365),e.force_secure=!0;b(e.force_secure);break;case "height":$("#login_frame").css("height")!=e.height+"px"&&$("#login_frame").css("height",
e.height+"px")}}}var d=!1,e="https:"==document.location.protocol;if(!e){$("#disable_security_button").on("click",function(){$("#login_loading_message").addClass("hidden");$("#login_frame").addClass("hidden");try{$("#login_frame").remove()}catch(a){}$("#login_form").removeClass("hidden")});try{"https"!=window.location.href.substr(0,5)&&setTimeout(function(){$("#disable_security").removeClass("hidden")},2500)}catch(f){}}$("#login_submit_inline").on("submit",function(a){a.preventDefault();"object"==
typeof event&&(event.returnValue=!1);try{$("#login_submit_inline .error-message").addClass("hidden"),document.querySelector("#login_button i").className="fa fa-spinner fa-spin",$("#login_button").disabled=!0,$.post("/ajax/login",$(this).serialize()+"&secure="+e).always(function(){document.querySelector("#login_button i").className="fa fa-sign-in";$("#login_button").disabled=!1}).done(function(a){"error"in a?"otp_needed"==a.error||"otp_wrong"==a.error?($("#otp_entry").removeClass("hidden"),$("#username,#password").attr("readonly",
!0),$("#otp").val("").focus(),"otp_wrong"==a.error&&removeClass($id("login_error_otp_wrong"),"hidden")):$("#login_error_"+a.error).removeClass("hidden"):(LocalStorageSet("signing_key",a.signing_key),b(e))}).fail(function(){$("#login_error_other").removeClass("hidden")})}catch(c){alert("Javascript error on login:"+c)}return!1});window.addEventListener?window.addEventListener("message",c,!1):window.attachEvent&&window.attachEvent("onmessage",c)};AjaxRequest.BindForm(".form-send-pm",function(a,b,c){var d=$("<div>"+a.content+"</div>");$("#private_messages").append(d);setTimeout(function(){$("html, body").animate({scrollTop:d.offset().top-100},500)},100)});$(document).ready(function(){"FileReader"in window&&$(".cropped-image-upload").each(function(){function a(){v=l.find("img").get(0);null!=v.src&&URL.revokeObjectURL(v.src);v.src=URL.createObjectURL(n.get(0).files[0]);l.removeClass("hidden");var a=l.prev();a.is("img")&&a.remove();b(.9);setTimeout(function(){b(.9)},100)}function b(a){var b=l.width()/l.height();-1==B?(h=l.height()*a,w=l.width()*a):b/B<1/b/(1/B)?(w=l.width()*a,h=w/B):(h=l.height()*a,w=h*B);z=new Vec2(w,h);r=new Vec2(l.width()/2-w/2,l.height()/
2-h/2);g()}function c(a){C=new Vec2(parseInt(a.data("anchor-x")),parseInt(a.data("anchor-y")));x=r.clone();y=z.clone();k="resize";d(A)}function d(a){p="all"==a?new Vec2(x.x+.5*y.x,x.y+.5*y.y):new Vec2(x.x+y.x*(1-C.x),x.y+y.y*(1-C.y));var b=new Vec2(x.x+y.x*C.x,x.y+y.y*C.y),c=new Vec2(x.x+y.x*(1-C.x),x.y+y.y*(1-C.y));H=Vec2.Subtract(b,p);t=Vec2.Subtract(b,p);u=Vec2.Subtract(c,p);A=a;null!=q&&e(q)}function e(a){q=a;var b=ProjectPointToLine(p,Vec2.Add(p,H),a),c=Vec2.Subtract(b,p),b=Math.min(0==t.x?1E5:
0<t.x?(l.width()-p.x)/t.x:-p.x/t.x,0==t.y?1E5:0<t.y?(l.height()-p.y)/t.y:-p.y/t.y),d=Math.min(0==u.x?1E5:0<u.x?(l.width()-p.x)/u.x:-p.x/u.x,0==u.y?1E5:0<u.y?(l.height()-p.y)/u.y:-p.y/u.y),c=c.Length()/t.Length(),c=Math.min(c,b,d),b=Vec2.Add(p,Vec2.Multiply(u,c)),d=Vec2.Add(p,Vec2.Multiply(t,c));-1==B&&(d=new Vec2(a.x,a.y));b=new Vec2(Math.min(l.width(),Math.max(0,b.x)),Math.min(l.height(),Math.max(0,b.y)));d=new Vec2(Math.min(l.width(),Math.max(0,d.x)),Math.min(l.height(),Math.max(0,d.y)));a=new Vec2(Math.min(b.x,
d.x),Math.min(b.y,d.y));b=new Vec2(Math.max(b.x,d.x),Math.max(b.y,d.y));r=a.clone();z=Vec2.Subtract(b,a);g()}function f(a){null===D&&(D=Vec2.Subtract(a,r));var b=new Vec2(0,0),c=new Vec2(l.width()-z.x,l.height()-z.y);r=Vec2.Subtract(a,D);r=new Vec2(Math.min(c.x,Math.max(b.x,r.x)),Math.min(c.y,Math.max(b.y,r.y)));g()}function g(){var a=Vec2.Int(r),b=Vec2.Int(z);m.css("left",a.x-1+"px");m.css("top",a.y-1+"px");m.css("width",b.x+"px");m.css("height",b.y+"px");if(null!=v){a=Vec2.Int(new Vec2(z.x/l.width()*
v.naturalWidth,z.y/l.height()*v.naturalHeight));b=Vec2.Int(new Vec2(r.x/l.width()*v.naturalWidth,r.y/l.height()*v.naturalHeight));$(l).find(".size").text(a.x+"px x "+a.y+"px");var c=$(l).closest("form");c.find("input[name="+n.attr("name")+"_x]").val(b.x);c.find("input[name="+n.attr("name")+"_y]").val(b.y);c.find("input[name="+n.attr("name")+"_w]").val(a.x);c.find("input[name="+n.attr("name")+"_h]").val(a.y)}}var k="resize",m=null,q=null,n=$(this),l=null,B=n.data("aspect-ratio"),G=0,r=new Vec2(50,
50),z=new Vec2(150,1/B*150),x=null,y=null,p=null,H=null,t=null,u=null,C=null,A="single",D=null,v=null;(function(){l=$('\t\t\t\t<div class="image-upload-preview image-cropper hidden">\t\t\t\t\t<img />\t\t\t\t\t<div class="mover">\t\t\t\t\t\t<div class="centre">+</div>\t\t\t\t\t\t<div class="size"></div>\t\t\t\t\t\t<div class="anchors">\t\t\t\t\t\t\t<a data-anchor-x="0" data-anchor-y="0"></a>\t\t\t\t\t\t\t<a data-anchor-x="1" data-anchor-y="0"></a>\t\t\t\t\t\t\t<a data-anchor-x="0" data-anchor-y="1"></a>\t\t\t\t\t\t\t<a data-anchor-x="1" data-anchor-y="1"></a>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t</div>');
var b=$('\t\t\t\t\x3c!--<div class="message">Drag anchors to resize, hold shift to resize in all directions. Drag viewfinder to move.</div>--\x3e\t\t\t\t<input name="'+n.attr("name")+'_x" type="hidden" />\t\t\t\t<input name="'+n.attr("name")+'_y" type="hidden" />\t\t\t\t<input name="'+n.attr("name")+'_w" type="hidden" />\t\t\t\t<input name="'+n.attr("name")+'_h" type="hidden" />\t\t\t\t');n.before(l);n.before(b);n.on("change",function(){a()});m=l.find(".mover")})();var E=function(a){"resize"==k&&
e(new Vec2(a.pageX-l.offset().left,a.pageY-l.offset().top));"move"==k&&f(new Vec2(a.pageX-l.offset().left,a.pageY-l.offset().top))},F=function(a){a=a.originalEvent;a=a.changedTouches[0];"resize"==k&&e(new Vec2(a.pageX-l.offset().left,a.pageY-l.offset().top));"move"==k&&f(new Vec2(a.pageX-l.offset().left,a.pageY-l.offset().top))};l.find(".anchors a").mousedown(function(a){c($(this));$(document).bind("mousemove",E);a.preventDefault();return!1});l.find(".anchors a").on("touchstart",function(a){c($(this));
$(document).bind("touchmove",F);a.preventDefault();return!1});$(document).keydown(function(a){a.shiftKey&&"single"==A&&(A="all","resize"==k&&d(A))});$(document).keyup(function(a){a.shiftKey||"all"!=A||(A="single","resize"==k&&d(A))});$(m).mousedown(function(a){$(this);k="move";$(document).bind("mousemove",E);a.preventDefault();return!1});$(m).click(function(a){a=(new Date).getTime();300>a-G&&b(1);G=a});$(m).on("touchstart",function(a){$(this);k="move";$(document).bind("touchmove",F);a.preventDefault();
return!1});$(document).mouseup(function(a){"resize"==k&&(k="",q=null);"move"==k&&(k="",D=null);$(document).unbind("mousemove",E)});$(document).on("touchend",function(a){"resize"==k&&(k="",q=null);"move"==k&&(k="",D=null);$(document).unbind("touchmove",F)});g()})});function hsltorgb(a,b,c){if(0==b)return rgbtohex(255*c,255*c,255*c);b*=1-Math.abs(2*c-1);a/=60;var d=b*(1-Math.abs(a%2-1)),e,f,g;0<=a&&1>a?(e=b,f=d,g=0):1<=a&&2>a?(e=d,f=b,g=0):2<=a&&3>a?(e=0,f=b,g=d):3<=a&&4>a?(e=0,f=d,g=b):4<=a&&5>a?(e=d,f=0,g=b):5<=a&&6>a&&(e=b,f=0,g=d);c-=b/2;e+=c;f+=c;g+=c;return rgbtohex(255*(0>e?0:1<e?1:e),255*(0>f?0:1<f?1:f),255*(0>g?0:1<g?1:g))}
function rgbtohex(a,b,c){a=Math.floor(a).toString(16);b=Math.floor(b).toString(16);c=Math.floor(c).toString(16);1==a.length&&(a="0"+a);1==b.length&&(b="0"+b);1==c.length&&(c="0"+c);return"#"+a+b+c};var fimf_chart_theme={AmChart:{fontFamily:"Open Sans"},AmSlicedChart:{colors:[],outlineAlpha:1,outlineThickness:.25,outlineColor:"#000",groupedColor:"#888"},AmPieChart:{innerRadius:"50%"},AmGraph:{columnWidth:.7},AmBalloon:{fillAlpha:1,shadowAlpha:0,borderThickness:1,cornerRadius:3,animationDuration:0,fontSize:14},ValueAxesSettings:{usePrefixes:!0},CategoryAxesSettings:{gridAlpha:0,groupToPeriods:"DD 2DD WW 2WW MM 3MM 6MM YYYY".split(" "),axisAlpha:1,tickLength:5},ChartScrollbarSettings:{autoGridCount:!1,
gridCount:0,dragIcon:"dragIconRectBig",dragIconWidth:24,dragIconHight:32,height:32,updateOnReleaseOnly:!1,backgroundColor:"#eee",selectedBackgroundColor:"#777",selectedGraphFillColor:"#ccc",color:"#444",fontSize:0,usePeriod:"WW"},ChartScrollbar:{},ChartCursorSettings:{valueBalloonsEnabled:!0,cursorColor:"#888888"},StockPanel:{fontFamily:"Open Sans",showCategoryAxis:!0},StockEventsSettings:{backgroundColor:"#fff",borderColor:"#68a7e5",type:"text"}};
(function(){for(var a=0;360>a;a+=40)fimf_chart_theme.AmSlicedChart.colors.push(hsltorgb(a,1,.47));for(a=20;360>a;a+=40)fimf_chart_theme.AmSlicedChart.colors.push(hsltorgb(a,1,.47))})();var fimf_dual_axis_chart_theme=JSON.parse(JSON.stringify(fimf_chart_theme));fimf_dual_axis_chart_theme.ValueAxesSettings.inside=!0;fimf_dual_axis_chart_theme.ValueAxesSettings.integersOnly=!0;fimf_dual_axis_chart_theme.PanelsSettings={};fimf_dual_axis_chart_theme.PanelsSettings.marginLeft=0;
fimf_dual_axis_chart_theme.PanelsSettings.marginRight=0;
xyzcrypto.sha256.asm.module=function(stdlib,foreign,heap){"use asm";var u32=new stdlib.Uint32Array(heap);var u8=new stdlib.Uint8Array(heap);var copyBlock=foreign.copyBlock;var used=0;var totalLen=0;function reset(){used=0;totalLen=0;u32[0]=1779033703;u32[1]=3144134277;u32[2]=1013904242;u32[3]=2773480762;u32[4]=1359893119;u32[5]=2600822924;u32[6]=528734635;u32[7]=1541459225}function update(len){len=len|0;var i=0;totalLen=~~(totalLen+len);if(~~used!=0)if(~~len>~~(64-used)){copyBlock(used|0,used|0,64-
used|0);block();used=0}else{copyBlock(used|0,used|0,used+len|0);used=~~(~~used+~~len);return}for(;~~(len-i)>=64;i=~~(i+64)){copyBlock(0,i|0,i+64|0);block()}if(~~len!=~~i){used=~~(len-i);copyBlock(0,i|0,i+used|0)}else used=0}function updateBlock(){totalLen=~~(totalLen+64);block()}function finish(){var i=0;var lengths=0;u8[~~(32+used)]=128;used=~~(used+1);if(~~(64-used)<8){for(i=used;~~i<64;i=~~(i+1))u8[~~(32+i)]=0;block();used=0}for(i=used;~~i<59;i=~~(i+1))u8[~~(32+i)]=0;lengths=totalLen<<3;u8[91]=
totalLen>>>29;u8[92]=lengths>>>24;u8[93]=lengths>>>16;u8[94]=lengths>>>8;u8[95]=lengths;block()}function block(){var a=0;var b=0;var c=0;var d=0;var e=0;var f=0;var g=0;var h=0;a=~~u32[0];b=~~u32[1];c=~~u32[2];d=~~u32[3];e=~~u32[4];f=~~u32[5];g=~~u32[6];h=~~u32[7];u32[24]=u8[32]<<24|u8[33]<<16|u8[34]<<8|u8[35];u32[25]=u8[36]<<24|u8[37]<<16|u8[38]<<8|u8[39];u32[26]=u8[40]<<24|u8[41]<<16|u8[42]<<8|u8[43];u32[27]=u8[44]<<24|u8[45]<<16|u8[46]<<8|u8[47];u32[28]=u8[48]<<24|u8[49]<<16|u8[50]<<8|u8[51];u32[29]=
u8[52]<<24|u8[53]<<16|u8[54]<<8|u8[55];u32[30]=u8[56]<<24|u8[57]<<16|u8[58]<<8|u8[59];u32[31]=u8[60]<<24|u8[61]<<16|u8[62]<<8|u8[63];u32[32]=u8[64]<<24|u8[65]<<16|u8[66]<<8|u8[67];u32[33]=u8[68]<<24|u8[69]<<16|u8[70]<<8|u8[71];u32[34]=u8[72]<<24|u8[73]<<16|u8[74]<<8|u8[75];u32[35]=u8[76]<<24|u8[77]<<16|u8[78]<<8|u8[79];u32[36]=u8[80]<<24|u8[81]<<16|u8[82]<<8|u8[83];u32[37]=u8[84]<<24|u8[85]<<16|u8[86]<<8|u8[87];u32[38]=u8[88]<<24|u8[89]<<16|u8[90]<<8|u8[91];u32[39]=u8[92]<<24|u8[93]<<16|u8[94]<<8|
u8[95];u32[40]=~~u32[24]+~~u32[33]+~~((u32[25]<<25|u32[25]>>>7)^(u32[25]<<14|u32[25]>>>18)^u32[25]>>>3)+~~((u32[38]<<15|u32[38]>>>17)^(u32[38]<<13|u32[38]>>>19)^u32[38]>>>10);u32[41]=~~u32[25]+~~u32[34]+~~((u32[26]<<25|u32[26]>>>7)^(u32[26]<<14|u32[26]>>>18)^u32[26]>>>3)+~~((u32[39]<<15|u32[39]>>>17)^(u32[39]<<13|u32[39]>>>19)^u32[39]>>>10);u32[42]=~~u32[26]+~~u32[35]+~~((u32[27]<<25|u32[27]>>>7)^(u32[27]<<14|u32[27]>>>18)^u32[27]>>>3)+~~((u32[40]<<15|u32[40]>>>17)^(u32[40]<<13|u32[40]>>>19)^u32[40]>>>
10);u32[43]=~~u32[27]+~~u32[36]+~~((u32[28]<<25|u32[28]>>>7)^(u32[28]<<14|u32[28]>>>18)^u32[28]>>>3)+~~((u32[41]<<15|u32[41]>>>17)^(u32[41]<<13|u32[41]>>>19)^u32[41]>>>10);u32[44]=~~u32[28]+~~u32[37]+~~((u32[29]<<25|u32[29]>>>7)^(u32[29]<<14|u32[29]>>>18)^u32[29]>>>3)+~~((u32[42]<<15|u32[42]>>>17)^(u32[42]<<13|u32[42]>>>19)^u32[42]>>>10);u32[45]=~~u32[29]+~~u32[38]+~~((u32[30]<<25|u32[30]>>>7)^(u32[30]<<14|u32[30]>>>18)^u32[30]>>>3)+~~((u32[43]<<15|u32[43]>>>17)^(u32[43]<<13|u32[43]>>>19)^u32[43]>>>
10);u32[46]=~~u32[30]+~~u32[39]+~~((u32[31]<<25|u32[31]>>>7)^(u32[31]<<14|u32[31]>>>18)^u32[31]>>>3)+~~((u32[44]<<15|u32[44]>>>17)^(u32[44]<<13|u32[44]>>>19)^u32[44]>>>10);u32[47]=~~u32[31]+~~u32[40]+~~((u32[32]<<25|u32[32]>>>7)^(u32[32]<<14|u32[32]>>>18)^u32[32]>>>3)+~~((u32[45]<<15|u32[45]>>>17)^(u32[45]<<13|u32[45]>>>19)^u32[45]>>>10);u32[48]=~~u32[32]+~~u32[41]+~~((u32[33]<<25|u32[33]>>>7)^(u32[33]<<14|u32[33]>>>18)^u32[33]>>>3)+~~((u32[46]<<15|u32[46]>>>17)^(u32[46]<<13|u32[46]>>>19)^u32[46]>>>
10);u32[49]=~~u32[33]+~~u32[42]+~~((u32[34]<<25|u32[34]>>>7)^(u32[34]<<14|u32[34]>>>18)^u32[34]>>>3)+~~((u32[47]<<15|u32[47]>>>17)^(u32[47]<<13|u32[47]>>>19)^u32[47]>>>10);u32[50]=~~u32[34]+~~u32[43]+~~((u32[35]<<25|u32[35]>>>7)^(u32[35]<<14|u32[35]>>>18)^u32[35]>>>3)+~~((u32[48]<<15|u32[48]>>>17)^(u32[48]<<13|u32[48]>>>19)^u32[48]>>>10);u32[51]=~~u32[35]+~~u32[44]+~~((u32[36]<<25|u32[36]>>>7)^(u32[36]<<14|u32[36]>>>18)^u32[36]>>>3)+~~((u32[49]<<15|u32[49]>>>17)^(u32[49]<<13|u32[49]>>>19)^u32[49]>>>
10);u32[52]=~~u32[36]+~~u32[45]+~~((u32[37]<<25|u32[37]>>>7)^(u32[37]<<14|u32[37]>>>18)^u32[37]>>>3)+~~((u32[50]<<15|u32[50]>>>17)^(u32[50]<<13|u32[50]>>>19)^u32[50]>>>10);u32[53]=~~u32[37]+~~u32[46]+~~((u32[38]<<25|u32[38]>>>7)^(u32[38]<<14|u32[38]>>>18)^u32[38]>>>3)+~~((u32[51]<<15|u32[51]>>>17)^(u32[51]<<13|u32[51]>>>19)^u32[51]>>>10);u32[54]=~~u32[38]+~~u32[47]+~~((u32[39]<<25|u32[39]>>>7)^(u32[39]<<14|u32[39]>>>18)^u32[39]>>>3)+~~((u32[52]<<15|u32[52]>>>17)^(u32[52]<<13|u32[52]>>>19)^u32[52]>>>
10);u32[55]=~~u32[39]+~~u32[48]+~~((u32[40]<<25|u32[40]>>>7)^(u32[40]<<14|u32[40]>>>18)^u32[40]>>>3)+~~((u32[53]<<15|u32[53]>>>17)^(u32[53]<<13|u32[53]>>>19)^u32[53]>>>10);u32[56]=~~u32[40]+~~u32[49]+~~((u32[41]<<25|u32[41]>>>7)^(u32[41]<<14|u32[41]>>>18)^u32[41]>>>3)+~~((u32[54]<<15|u32[54]>>>17)^(u32[54]<<13|u32[54]>>>19)^u32[54]>>>10);u32[57]=~~u32[41]+~~u32[50]+~~((u32[42]<<25|u32[42]>>>7)^(u32[42]<<14|u32[42]>>>18)^u32[42]>>>3)+~~((u32[55]<<15|u32[55]>>>17)^(u32[55]<<13|u32[55]>>>19)^u32[55]>>>
10);u32[58]=~~u32[42]+~~u32[51]+~~((u32[43]<<25|u32[43]>>>7)^(u32[43]<<14|u32[43]>>>18)^u32[43]>>>3)+~~((u32[56]<<15|u32[56]>>>17)^(u32[56]<<13|u32[56]>>>19)^u32[56]>>>10);u32[59]=~~u32[43]+~~u32[52]+~~((u32[44]<<25|u32[44]>>>7)^(u32[44]<<14|u32[44]>>>18)^u32[44]>>>3)+~~((u32[57]<<15|u32[57]>>>17)^(u32[57]<<13|u32[57]>>>19)^u32[57]>>>10);u32[60]=~~u32[44]+~~u32[53]+~~((u32[45]<<25|u32[45]>>>7)^(u32[45]<<14|u32[45]>>>18)^u32[45]>>>3)+~~((u32[58]<<15|u32[58]>>>17)^(u32[58]<<13|u32[58]>>>19)^u32[58]>>>
10);u32[61]=~~u32[45]+~~u32[54]+~~((u32[46]<<25|u32[46]>>>7)^(u32[46]<<14|u32[46]>>>18)^u32[46]>>>3)+~~((u32[59]<<15|u32[59]>>>17)^(u32[59]<<13|u32[59]>>>19)^u32[59]>>>10);u32[62]=~~u32[46]+~~u32[55]+~~((u32[47]<<25|u32[47]>>>7)^(u32[47]<<14|u32[47]>>>18)^u32[47]>>>3)+~~((u32[60]<<15|u32[60]>>>17)^(u32[60]<<13|u32[60]>>>19)^u32[60]>>>10);u32[63]=~~u32[47]+~~u32[56]+~~((u32[48]<<25|u32[48]>>>7)^(u32[48]<<14|u32[48]>>>18)^u32[48]>>>3)+~~((u32[61]<<15|u32[61]>>>17)^(u32[61]<<13|u32[61]>>>19)^u32[61]>>>
10);u32[64]=~~u32[48]+~~u32[57]+~~((u32[49]<<25|u32[49]>>>7)^(u32[49]<<14|u32[49]>>>18)^u32[49]>>>3)+~~((u32[62]<<15|u32[62]>>>17)^(u32[62]<<13|u32[62]>>>19)^u32[62]>>>10);u32[65]=~~u32[49]+~~u32[58]+~~((u32[50]<<25|u32[50]>>>7)^(u32[50]<<14|u32[50]>>>18)^u32[50]>>>3)+~~((u32[63]<<15|u32[63]>>>17)^(u32[63]<<13|u32[63]>>>19)^u32[63]>>>10);u32[66]=~~u32[50]+~~u32[59]+~~((u32[51]<<25|u32[51]>>>7)^(u32[51]<<14|u32[51]>>>18)^u32[51]>>>3)+~~((u32[64]<<15|u32[64]>>>17)^(u32[64]<<13|u32[64]>>>19)^u32[64]>>>
10);u32[67]=~~u32[51]+~~u32[60]+~~((u32[52]<<25|u32[52]>>>7)^(u32[52]<<14|u32[52]>>>18)^u32[52]>>>3)+~~((u32[65]<<15|u32[65]>>>17)^(u32[65]<<13|u32[65]>>>19)^u32[65]>>>10);u32[68]=~~u32[52]+~~u32[61]+~~((u32[53]<<25|u32[53]>>>7)^(u32[53]<<14|u32[53]>>>18)^u32[53]>>>3)+~~((u32[66]<<15|u32[66]>>>17)^(u32[66]<<13|u32[66]>>>19)^u32[66]>>>10);u32[69]=~~u32[53]+~~u32[62]+~~((u32[54]<<25|u32[54]>>>7)^(u32[54]<<14|u32[54]>>>18)^u32[54]>>>3)+~~((u32[67]<<15|u32[67]>>>17)^(u32[67]<<13|u32[67]>>>19)^u32[67]>>>
10);u32[70]=~~u32[54]+~~u32[63]+~~((u32[55]<<25|u32[55]>>>7)^(u32[55]<<14|u32[55]>>>18)^u32[55]>>>3)+~~((u32[68]<<15|u32[68]>>>17)^(u32[68]<<13|u32[68]>>>19)^u32[68]>>>10);u32[71]=~~u32[55]+~~u32[64]+~~((u32[56]<<25|u32[56]>>>7)^(u32[56]<<14|u32[56]>>>18)^u32[56]>>>3)+~~((u32[69]<<15|u32[69]>>>17)^(u32[69]<<13|u32[69]>>>19)^u32[69]>>>10);u32[72]=~~u32[56]+~~u32[65]+~~((u32[57]<<25|u32[57]>>>7)^(u32[57]<<14|u32[57]>>>18)^u32[57]>>>3)+~~((u32[70]<<15|u32[70]>>>17)^(u32[70]<<13|u32[70]>>>19)^u32[70]>>>
10);u32[73]=~~u32[57]+~~u32[66]+~~((u32[58]<<25|u32[58]>>>7)^(u32[58]<<14|u32[58]>>>18)^u32[58]>>>3)+~~((u32[71]<<15|u32[71]>>>17)^(u32[71]<<13|u32[71]>>>19)^u32[71]>>>10);u32[74]=~~u32[58]+~~u32[67]+~~((u32[59]<<25|u32[59]>>>7)^(u32[59]<<14|u32[59]>>>18)^u32[59]>>>3)+~~((u32[72]<<15|u32[72]>>>17)^(u32[72]<<13|u32[72]>>>19)^u32[72]>>>10);u32[75]=~~u32[59]+~~u32[68]+~~((u32[60]<<25|u32[60]>>>7)^(u32[60]<<14|u32[60]>>>18)^u32[60]>>>3)+~~((u32[73]<<15|u32[73]>>>17)^(u32[73]<<13|u32[73]>>>19)^u32[73]>>>
10);u32[76]=~~u32[60]+~~u32[69]+~~((u32[61]<<25|u32[61]>>>7)^(u32[61]<<14|u32[61]>>>18)^u32[61]>>>3)+~~((u32[74]<<15|u32[74]>>>17)^(u32[74]<<13|u32[74]>>>19)^u32[74]>>>10);u32[77]=~~u32[61]+~~u32[70]+~~((u32[62]<<25|u32[62]>>>7)^(u32[62]<<14|u32[62]>>>18)^u32[62]>>>3)+~~((u32[75]<<15|u32[75]>>>17)^(u32[75]<<13|u32[75]>>>19)^u32[75]>>>10);u32[78]=~~u32[62]+~~u32[71]+~~((u32[63]<<25|u32[63]>>>7)^(u32[63]<<14|u32[63]>>>18)^u32[63]>>>3)+~~((u32[76]<<15|u32[76]>>>17)^(u32[76]<<13|u32[76]>>>19)^u32[76]>>>
10);u32[79]=~~u32[63]+~~u32[72]+~~((u32[64]<<25|u32[64]>>>7)^(u32[64]<<14|u32[64]>>>18)^u32[64]>>>3)+~~((u32[77]<<15|u32[77]>>>17)^(u32[77]<<13|u32[77]>>>19)^u32[77]>>>10);u32[80]=~~u32[64]+~~u32[73]+~~((u32[65]<<25|u32[65]>>>7)^(u32[65]<<14|u32[65]>>>18)^u32[65]>>>3)+~~((u32[78]<<15|u32[78]>>>17)^(u32[78]<<13|u32[78]>>>19)^u32[78]>>>10);u32[81]=~~u32[65]+~~u32[74]+~~((u32[66]<<25|u32[66]>>>7)^(u32[66]<<14|u32[66]>>>18)^u32[66]>>>3)+~~((u32[79]<<15|u32[79]>>>17)^(u32[79]<<13|u32[79]>>>19)^u32[79]>>>
10);u32[82]=~~u32[66]+~~u32[75]+~~((u32[67]<<25|u32[67]>>>7)^(u32[67]<<14|u32[67]>>>18)^u32[67]>>>3)+~~((u32[80]<<15|u32[80]>>>17)^(u32[80]<<13|u32[80]>>>19)^u32[80]>>>10);u32[83]=~~u32[67]+~~u32[76]+~~((u32[68]<<25|u32[68]>>>7)^(u32[68]<<14|u32[68]>>>18)^u32[68]>>>3)+~~((u32[81]<<15|u32[81]>>>17)^(u32[81]<<13|u32[81]>>>19)^u32[81]>>>10);u32[84]=~~u32[68]+~~u32[77]+~~((u32[69]<<25|u32[69]>>>7)^(u32[69]<<14|u32[69]>>>18)^u32[69]>>>3)+~~((u32[82]<<15|u32[82]>>>17)^(u32[82]<<13|u32[82]>>>19)^u32[82]>>>
10);u32[85]=~~u32[69]+~~u32[78]+~~((u32[70]<<25|u32[70]>>>7)^(u32[70]<<14|u32[70]>>>18)^u32[70]>>>3)+~~((u32[83]<<15|u32[83]>>>17)^(u32[83]<<13|u32[83]>>>19)^u32[83]>>>10);u32[86]=~~u32[70]+~~u32[79]+~~((u32[71]<<25|u32[71]>>>7)^(u32[71]<<14|u32[71]>>>18)^u32[71]>>>3)+~~((u32[84]<<15|u32[84]>>>17)^(u32[84]<<13|u32[84]>>>19)^u32[84]>>>10);u32[87]=~~u32[71]+~~u32[80]+~~((u32[72]<<25|u32[72]>>>7)^(u32[72]<<14|u32[72]>>>18)^u32[72]>>>3)+~~((u32[85]<<15|u32[85]>>>17)^(u32[85]<<13|u32[85]>>>19)^u32[85]>>>
10);h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+1116352408+~~u32[24]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+1899447441+~~u32[25]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+3049323471+~~u32[26]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>
13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+3921009573+~~u32[27]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+961987163+~~u32[28]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+1508970993+~~u32[29]);g=~~(~~g+c);c=~~(~~c+
~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+2453635748+~~u32[30]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+2870763221+~~u32[31]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+3624381080+
~~u32[32]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+310598401+~~u32[33]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+607225278+~~u32[34]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>
25))+~~(d^b&(c^d))+1426881987+~~u32[35]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+1925078388+~~u32[36]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+2162078206+~~u32[37]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|
g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+2614888103+~~u32[38]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+3248222580+~~u32[39]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+3835390401+~~u32[40]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&
(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+4022224774+~~u32[41]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+264347078+~~u32[42]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+604807628+~~u32[43]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|
f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+770255983+~~u32[44]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+1249150122+~~u32[45]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+1555081692+~~u32[46]);f=~~(~~f+b);b=
~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+1996064986+~~u32[47]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+2554220882+~~u32[48]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+2821834349+
~~u32[49]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+2952996808+~~u32[50]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+3210313671+~~u32[51]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>
25))+~~(c^a&(b^c))+3336571891+~~u32[52]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+3584528711+~~u32[53]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+113926993+~~u32[54]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|
f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+338241895+~~u32[55]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+666307205+~~u32[56]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+773529912+~~u32[57]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|
b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+1294757372+~~u32[58]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+1396182291+~~u32[59]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+1695183700+~~u32[60]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|
e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+1986661051+~~u32[61]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+2177026350+~~u32[62]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+2456956037+~~u32[63]);e=~~(~~e+a);
a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+2730485921+~~u32[64]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+2820302411+~~u32[65]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+3259730800+
~~u32[66]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+3345764771+~~u32[67]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+3516065817+~~u32[68]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>
25))+~~(b^h&(a^b))+3600352804+~~u32[69]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+4094571909+~~u32[70]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+275423344+~~u32[71]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|
e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+430227734+~~u32[72]);d=~~(~~d+h);h=~~(~~h+~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+506948616+~~u32[73]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+659060556+~~u32[74]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|
a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+883997877+~~u32[75]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+958139571+~~u32[76]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+1322822218+~~u32[77]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>
13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25))+~~(a^g&(h^a))+1537002063+~~u32[78]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+1747873779+~~u32[79]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));h=~~(~~h+~~((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+~~(g^e&(f^g))+1955562222+~~u32[80]);d=~~(~~d+h);h=~~(~~h+
~~((a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22))+~~(a&(b|c)|b&c));g=~~(~~g+~~((d<<26|d>>>6)^(d<<21|d>>>11)^(d<<7|d>>>25))+~~(f^d&(e^f))+2024104815+~~u32[81]);c=~~(~~c+g);g=~~(~~g+~~((h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22))+~~(h&(a|b)|a&b));f=~~(~~f+~~((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+~~(e^c&(d^e))+2227730452+~~u32[82]);b=~~(~~b+f);f=~~(~~f+~~((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+~~(g&(h|a)|h&a));e=~~(~~e+~~((b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25))+~~(d^b&(c^d))+2361852424+
~~u32[83]);a=~~(~~a+e);e=~~(~~e+~~((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+~~(f&(g|h)|g&h));d=~~(~~d+~~((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+~~(c^a&(b^c))+2428436474+~~u32[84]);h=~~(~~h+d);d=~~(~~d+~~((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+~~(e&(f|g)|f&g));c=~~(~~c+~~((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+~~(b^h&(a^b))+2756734187+~~u32[85]);g=~~(~~g+c);c=~~(~~c+~~((d<<30|d>>>2)^(d<<19|d>>>13)^(d<<10|d>>>22))+~~(d&(e|f)|e&f));b=~~(~~b+~~((g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>
25))+~~(a^g&(h^a))+3204031479+~~u32[86]);f=~~(~~f+b);b=~~(~~b+~~((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+~~(c&(d|e)|d&e));a=~~(~~a+~~((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+~~(h^f&(g^h))+3329325298+~~u32[87]);e=~~(~~e+a);a=~~(~~a+~~((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+~~(b&(c|d)|c&d));u32[0]=~~(~~u32[0]+~~a);u32[1]=~~(~~u32[1]+~~b);u32[2]=~~(~~u32[2]+~~c);u32[3]=~~(~~u32[3]+~~d);u32[4]=~~(~~u32[4]+~~e);u32[5]=~~(~~u32[5]+~~f);u32[6]=~~(~~u32[6]+~~g);u32[7]=~~(~~u32[7]+~~h)}return{reset:reset,
update:update,updateBlock:updateBlock,finish:finish}};
