text: !function(t){t.color={},t.color.make=function(e,n,i,r){var a={};return a.r=e||0,a.g=n||0,a.b=i||0,a.a=null!=r?r:1,a.add=function(t,e){for(var n=0;n<t.length;++n)a[t.charAt(n)]+=e;return a.normalize()},a.scale=function(t,e){for(var n=0;n<t.length;++n)a[t.charAt(n)]*=e;return a.normalize()},a.toString=function(){return a.a>=1?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function t(t,e,n){return t>e?t:e>n?n:e}return a.r=t(0,parseInt(a.r),255),a.g=t(0,parseInt(a.g),255),a.b=t(0,parseInt(a.b),255),a.a=t(0,a.a,1),a},a.clone=function(){return t.color.make(a.r,a.b,a.g,a.a)},a.normalize()},t.color.extract=function(e,n){var i;do{if(i=e.css(n).toLowerCase(),""!=i&&"transparent"!=i)break;e=e.parent()}while(e.length&&!t.nodeName(e.get(0),"body"));return"rgba(0, 0, 0, 0)"==i&&(i="transparent"),t.color.parse(i)},t.color.parse=function(n){var i,r=t.color.make;if(i=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return r(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10));if(i=/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*\)/.exec(n))return r(parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4]));if(i=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return r(2.55*parseFloat(i[1]),2.55*parseFloat(i[2]),2.55*parseFloat(i[3]));if(i=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return r(2.55*parseFloat(i[1]),2.55*parseFloat(i[2]),2.55*parseFloat(i[3]),parseFloat(i[4]));if(i=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return r(parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16));if(i=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return r(parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16));var a=t.trim(n).toLowerCase();return"transparent"==a?r(255,255,255,0):(i=e[a]||[0,0,0],r(i[0],i[1],i[2]))};var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(t){function e(e,n){var i=n.children("."+e)[0];if(null==i&&(i=document.createElement("canvas"),i.className=e,t(i).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(n),!i.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");i=window.G_vmlCanvasManager.initElement(i)}this.element=i;var r=this.context=i.getContext("2d"),a=window.devicePixelRatio||1,s=r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;this.pixelRatio=a/s,this.resize(n.width(),n.height()),this.textContainer=null,this.text={},this._textCache={}}function n(n,r,a,s){function o(t,e){e=[me].concat(e);for(var n=0;n<t.length;++n)t[n].apply(this,e)}function l(){for(var n={Canvas:e},i=0;i<s.length;++i){var r=s[i];r.init(me,n),r.options&&t.extend(!0,re,r.options)}}function h(e){t.extend(!0,re,e),e&&e.colors&&(re.colors=e.colors),null==re.xaxis.color&&(re.xaxis.color=t.color.parse(re.grid.color).scale("a",.22).toString()),null==re.yaxis.color&&(re.yaxis.color=t.color.parse(re.grid.color).scale("a",.22).toString()),null==re.xaxis.tickColor&&(re.xaxis.tickColor=re.grid.tickColor||re.xaxis.color),null==re.yaxis.tickColor&&(re.yaxis.tickColor=re.grid.tickColor||re.yaxis.color),null==re.grid.borderColor&&(re.grid.borderColor=re.grid.color),null==re.grid.tickColor&&(re.grid.tickColor=t.color.parse(re.grid.color).scale("a",.22).toString());var i,r,a,s=n.css("font-size"),l=s?+s.replace("px",""):13,h={style:n.css("font-style"),size:Math.round(.8*l),variant:n.css("font-variant"),weight:n.css("font-weight"),family:n.css("font-family")};for(a=re.xaxes.length||1,i=0;a>i;++i)r=re.xaxes[i],r&&!r.tickColor&&(r.tickColor=r.color),r=t.extend(!0,{},re.xaxis,r),re.xaxes[i]=r,r.font&&(r.font=t.extend({},h,r.font),r.font.color||(r.font.color=r.color),r.font.lineHeight||(r.font.lineHeight=Math.round(1.15*r.font.size)));for(a=re.yaxes.length||1,i=0;a>i;++i)r=re.yaxes[i],r&&!r.tickColor&&(r.tickColor=r.color),r=t.extend(!0,{},re.yaxis,r),re.yaxes[i]=r,r.font&&(r.font=t.extend({},h,r.font),r.font.color||(r.font.color=r.color),r.font.lineHeight||(r.font.lineHeight=Math.round(1.15*r.font.size)));for(re.xaxis.noTicks&&null==re.xaxis.ticks&&(re.xaxis.ticks=re.xaxis.noTicks),re.yaxis.noTicks&&null==re.yaxis.ticks&&(re.yaxis.ticks=re.yaxis.noTicks),re.x2axis&&(re.xaxes[1]=t.extend(!0,{},re.xaxis,re.x2axis),re.xaxes[1].position="top",null==re.x2axis.min&&(re.xaxes[1].min=null),null==re.x2axis.max&&(re.xaxes[1].max=null)),re.y2axis&&(re.yaxes[1]=t.extend(!0,{},re.yaxis,re.y2axis),re.yaxes[1].position="right",null==re.y2axis.min&&(re.yaxes[1].min=null),null==re.y2axis.max&&(re.yaxes[1].max=null)),re.grid.coloredAreas&&(re.grid.markings=re.grid.coloredAreas),re.grid.coloredAreasColor&&(re.grid.markingsColor=re.grid.coloredAreasColor),re.lines&&t.extend(!0,re.series.lines,re.lines),re.points&&t.extend(!0,re.series.points,re.points),re.bars&&t.extend(!0,re.series.bars,re.bars),null!=re.shadowSize&&(re.series.shadowSize=re.shadowSize),null!=re.highlightColor&&(re.series.highlightColor=re.highlightColor),i=0;i<re.xaxes.length;++i)m(ue,i+1).options=re.xaxes[i];for(i=0;i<re.yaxes.length;++i)m(ce,i+1).options=re.yaxes[i];for(var u in ge)re.hooks[u]&&re.hooks[u].length&&(ge[u]=ge[u].concat(re.hooks[u]));o(ge.processOptions,[re])}function u(t){ie=c(t),v(),y()}function c(e){for(var n=[],i=0;i<e.length;++i){var r=t.extend(!0,{},re.series);null!=e[i].data?(r.data=e[i].data,delete e[i].data,t.extend(!0,r,e[i]),e[i].data=r.data):r.data=e[i],n.push(r)}return n}function f(t,e){var n=t[e+"axis"];return"object"==typeof n&&(n=n.n),"number"!=typeof n&&(n=1),n}function p(){return t.grep(ue.concat(ce),function(t){return t})}function d(t){var e,n,i={};for(e=0;e<ue.length;++e)n=ue[e],n&&n.used&&(i["x"+n.n]=n.c2p(t.left));for(e=0;e<ce.length;++e)n=ce[e],n&&n.used&&(i["y"+n.n]=n.c2p(t.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i}function g(t){var e,n,i,r={};for(e=0;e<ue.length;++e)if(n=ue[e],n&&n.used&&(i="x"+n.n,null==t[i]&&1==n.n&&(i="x"),null!=t[i])){r.left=n.p2c(t[i]);break}for(e=0;e<ce.length;++e)if(n=ce[e],n&&n.used&&(i="y"+n.n,null==t[i]&&1==n.n&&(i="y"),null!=t[i])){r.top=n.p2c(t[i]);break}return r}function m(e,n){return e[n-1]||(e[n-1]={n:n,direction:e==ue?"x":"y",options:t.extend(!0,{},e==ue?re.xaxis:re.yaxis)}),e[n-1]}function v(){var e,n=ie.length,i=-1;for(e=0;e<ie.length;++e){var r=ie[e].color;null!=r&&(n--,"number"==typeof r&&r>i&&(i=r))}i>=n&&(n=i+1);var a,s=[],o=re.colors,l=o.length,h=0;for(e=0;n>e;e++)a=t.color.parse(o[e%l]||"#666"),e%l==0&&e&&(h=h>=0?.5>h?-h-.2:0:-h),s[e]=a.scale("rgb",1+h);var u,c=0;for(e=0;e<ie.length;++e){if(u=ie[e],null==u.color?(u.color=s[c].toString(),++c):"number"==typeof u.color&&(u.color=s[u.color].toString()),null==u.lines.show){var p,d=!0;for(p in u)if(u[p]&&u[p].show){d=!1;break}d&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=m(ue,f(u,"x")),u.yaxis=m(ce,f(u,"y"))}}function y(){function e(t,e,n){e<t.datamin&&e!=-y&&(t.datamin=e),n>t.datamax&&n!=y&&(t.datamax=n)}var n,i,r,a,s,l,h,u,c,f,d,g,m=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,y=Number.MAX_VALUE;for(t.each(p(),function(t,e){e.datamin=m,e.datamax=v,e.used=!1}),n=0;n<ie.length;++n)s=ie[n],s.datapoints={points:[]},o(ge.processRawData,[s,s.data,s.datapoints]);for(n=0;n<ie.length;++n){if(s=ie[n],d=s.data,g=s.datapoints.format,!g){if(g=[],g.push({x:!0,number:!0,required:!0}),g.push({y:!0,number:!0,required:!0}),s.bars.show||s.lines.show&&s.lines.fill){var x=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);g.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:x}),s.bars.horizontal&&(delete g[g.length-1].y,g[g.length-1].x=!0)}s.datapoints.format=g}if(null==s.datapoints.pointsize){s.datapoints.pointsize=g.length,h=s.datapoints.pointsize,l=s.datapoints.points;var b=s.lines.show&&s.lines.steps;for(s.xaxis.used=s.yaxis.used=!0,i=r=0;i<d.length;++i,r+=h){f=d[i];var w=null==f;if(!w)for(a=0;h>a;++a)u=f[a],c=g[a],c&&(c.number&&null!=u&&(u=+u,isNaN(u)?u=null:1/0==u?u=y:u==-1/0&&(u=-y)),null==u&&(c.required&&(w=!0),null!=c.defaultValue&&(u=c.defaultValue))),l[r+a]=u;if(w)for(a=0;h>a;++a)u=l[r+a],null!=u&&(c=g[a],c.autoscale!==!1&&(c.x&&e(s.xaxis,u,u),c.y&&e(s.yaxis,u,u))),l[r+a]=null;else if(b&&r>0&&null!=l[r-h]&&l[r-h]!=l[r]&&l[r-h+1]!=l[r+1]){for(a=0;h>a;++a)l[r+h+a]=l[r+a];l[r+1]=l[r-h+1],r+=h}}}}for(n=0;n<ie.length;++n)s=ie[n],o(ge.processDatapoints,[s,s.datapoints]);for(n=0;n<ie.length;++n){s=ie[n],l=s.datapoints.points,h=s.datapoints.pointsize,g=s.datapoints.format;var k=m,M=m,S=v,_=v;for(i=0;i<l.length;i+=h)if(null!=l[i])for(a=0;h>a;++a)u=l[i+a],c=g[a],c&&c.autoscale!==!1&&u!=y&&u!=-y&&(c.x&&(k>u&&(k=u),u>S&&(S=u)),c.y&&(M>u&&(M=u),u>_&&(_=u)));if(s.bars.show){var C;switch(s.bars.align){case"left":C=0;break;case"right":C=-s.bars.barWidth;break;default:C=-s.bars.barWidth/2}s.bars.horizontal?(M+=C,_+=C+s.bars.barWidth):(k+=C,S+=C+s.bars.barWidth)}e(s.xaxis,k,S),e(s.yaxis,M,_)}t.each(p(),function(t,e){e.datamin==m&&(e.datamin=null),e.datamax==v&&(e.datamax=null)})}function x(){n.css("padding",0).children().filter(function(){return!t(this).hasClass("flot-overlay")&&!t(this).hasClass("flot-base")}).remove(),"static"==n.css("position")&&n.css("position","relative"),ae=new e("flot-base",n),se=new e("flot-overlay",n),le=ae.context,he=se.context,oe=t(se.element).unbind();var i=n.data("plot");i&&(i.shutdown(),se.clear()),n.data("plot",me)}function b(){re.grid.hoverable&&(oe.mousemove(G),oe.bind("mouseleave",X)),re.grid.clickable&&oe.click(V),o(ge.bindEvents,[oe])}function w(){ye&&clearTimeout(ye),oe.unbind("mousemove",G),oe.unbind("mouseleave",X),oe.unbind("click",V),o(ge.shutdown,[oe])}function k(t){function e(t){return t}var n,i,r=t.options.transform||e,a=t.options.inverseTransform;"x"==t.direction?(n=t.scale=pe/Math.abs(r(t.max)-r(t.min)),i=Math.min(r(t.max),r(t.min))):(n=t.scale=de/Math.abs(r(t.max)-r(t.min)),n=-n,i=Math.max(r(t.max),r(t.min))),t.p2c=r==e?function(t){return(t-i)*n}:function(t){return(r(t)-i)*n},t.c2p=a?function(t){return a(i+t/n)}:function(t){return i+t/n}}function M(t){for(var e=t.options,n=t.ticks||[],i=e.labelWidth||0,r=e.labelHeight||0,a=i||("x"==t.direction?Math.floor(ae.width/(n.length||1)):null),s=t.direction+"Axis "+t.direction+t.n+"Axis",o="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+s,l=e.font||"flot-tick-label tickLabel",h=0;h<n.length;++h){var u=n[h];if(u.label){var c=ae.getTextInfo(o,u.label,l,null,a);i=Math.max(i,c.width),r=Math.max(r,c.height)}}t.labelWidth=e.labelWidth||i,t.labelHeight=e.labelHeight||r}function S(e){var n=e.labelWidth,i=e.labelHeight,r=e.options.position,a="x"===e.direction,s=e.options.tickLength,o=re.grid.axisMargin,l=re.grid.labelMargin,h=!0,u=!0,c=!0,f=!1;t.each(a?ue:ce,function(t,n){n&&(n.show||n.reserveSpace)&&(n===e?f=!0:n.options.position===r&&(f?u=!1:h=!1),f||(c=!1))}),u&&(o=0),null==s&&(s=c?"full":5),isNaN(+s)||(l+=+s),a?(i+=l,"bottom"==r?(fe.bottom+=i+o,e.box={top:ae.height-fe.bottom,height:i}):(e.box={top:fe.top+o,height:i},fe.top+=i+o)):(n+=l,"left"==r?(e.box={left:fe.left+o,width:n},fe.left+=n+o):(fe.right+=n+o,e.box={left:ae.width-fe.right,width:n})),e.position=r,e.tickLength=s,e.box.padding=l,e.innermost=h}function _(t){"x"==t.direction?(t.box.left=fe.left-t.labelWidth/2,t.box.width=ae.width-fe.left-fe.right+t.labelWidth):(t.box.top=fe.top-t.labelHeight/2,t.box.height=ae.height-fe.bottom-fe.top+t.labelHeight)}function C(){var e,n=re.grid.minBorderMargin;if(null==n)for(n=0,e=0;e<ie.length;++e)n=Math.max(n,2*(ie[e].points.radius+ie[e].points.lineWidth/2));var i={left:n,right:n,top:n,bottom:n};t.each(p(),function(t,e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(i.left=Math.max(i.left,e.labelWidth/2),i.right=Math.max(i.right,e.labelWidth/2)):(i.bottom=Math.max(i.bottom,e.labelHeight/2),i.top=Math.max(i.top,e.labelHeight/2)))}),fe.left=Math.ceil(Math.max(i.left,fe.left)),fe.right=Math.ceil(Math.max(i.right,fe.right)),fe.top=Math.ceil(Math.max(i.top,fe.top)),fe.bottom=Math.ceil(Math.max(i.bottom,fe.bottom))}function T(){var e,n=p(),i=re.grid.show;for(var r in fe){var a=re.grid.margin||0;fe[r]="number"==typeof a?a:a[r]||0}o(ge.processOffset,[fe]);for(var r in fe)fe[r]+="object"==typeof re.grid.borderWidth?i?re.grid.borderWidth[r]:0:i?re.grid.borderWidth:0;if(t.each(n,function(t,e){var n=e.options;e.show=null==n.show?e.used:n.show,e.reserveSpace=null==n.reserveSpace?e.show:n.reserveSpace,A(e)}),i){var s=t.grep(n,function(t){return t.show||t.reserveSpace});for(t.each(s,function(t,e){F(e),R(e),L(e,e.ticks),M(e)}),e=s.length-1;e>=0;--e)S(s[e]);C(),t.each(s,function(t,e){_(e)})}pe=ae.width-fe.left-fe.right,de=ae.height-fe.bottom-fe.top,t.each(n,function(t,e){k(e)}),i&&D(),j()}function A(t){var e=t.options,n=+(null!=e.min?e.min:t.datamin),i=+(null!=e.max?e.max:t.datamax),r=i-n;if(0==r){var a=0==i?1:.01;null==e.min&&(n-=a),(null==e.max||null!=e.min)&&(i+=a)}else{var s=e.autoscaleMargin;null!=s&&(null==e.min&&(n-=r*s,0>n&&null!=t.datamin&&t.datamin>=0&&(n=0)),null==e.max&&(i+=r*s,i>0&&null!=t.datamax&&t.datamax<=0&&(i=0)))}t.min=n,t.max=i}function F(e){var n,r=e.options;n="number"==typeof r.ticks&&r.ticks>0?r.ticks:.3*Math.sqrt("x"==e.direction?ae.width:ae.height);var a=(e.max-e.min)/n,s=-Math.floor(Math.log(a)/Math.LN10),o=r.tickDecimals;null!=o&&s>o&&(s=o);var l,h=Math.pow(10,-s),u=a/h;if(1.5>u?l=1:3>u?(l=2,u>2.25&&(null==o||o>=s+1)&&(l=2.5,++s)):l=7.5>u?5:10,l*=h,null!=r.minTickSize&&l<r.minTickSize&&(l=r.minTickSize),e.delta=a,e.tickDecimals=Math.max(0,null!=o?o:s),e.tickSize=r.tickSize||l,"time"==r.mode&&!e.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(e.tickGenerator||(e.tickGenerator=function(t){var e,n=[],r=i(t.min,t.tickSize),a=0,s=Number.NaN;do e=s,s=r+a*t.tickSize,n.push(s),++a;while(s<t.max&&s!=e);return n},e.tickFormatter=function(t,e){var n=e.tickDecimals?Math.pow(10,e.tickDecimals):1,i=""+Math.round(t*n)/n;if(null!=e.tickDecimals){var r=i.indexOf("."),a=-1==r?0:i.length-r-1;if(a<e.tickDecimals)return(a?i:i+".")+(""+n).substr(1,e.tickDecimals-a)}return i}),t.isFunction(r.tickFormatter)&&(e.tickFormatter=function(t,e){return""+r.tickFormatter(t,e)}),null!=r.alignTicksWithAxis){var c=("x"==e.direction?ue:ce)[r.alignTicksWithAxis-1];if(c&&c.used&&c!=e){var f=e.tickGenerator(e);if(f.length>0&&(null==r.min&&(e.min=Math.min(e.min,f[0])),null==r.max&&f.length>1&&(e.max=Math.max(e.max,f[f.length-1]))),e.tickGenerator=function(t){var e,n,i=[];for(n=0;n<c.ticks.length;++n)e=(c.ticks[n].v-c.min)/(c.max-c.min),e=t.min+e*(t.max-t.min),i.push(e);return i},!e.mode&&null==r.tickDecimals){var p=Math.max(0,-Math.floor(Math.log(e.delta)/Math.LN10)+1),d=e.tickGenerator(e);d.length>1&&/\..*0$/.test((d[1]-d[0]).toFixed(p))||(e.tickDecimals=p)}}}}function R(e){var n=e.options.ticks,i=[];null==n||"number"==typeof n&&n>0?i=e.tickGenerator(e):n&&(i=t.isFunction(n)?n(e):n);var r,a;for(e.ticks=[],r=0;r<i.length;++r){var s=null,o=i[r];"object"==typeof o?(a=+o[0],o.length>1&&(s=o[1])):a=+o,null==s&&(s=e.tickFormatter(a,e)),isNaN(a)||e.ticks.push({v:a,label:s})}}function L(t,e){t.options.autoscaleMargin&&e.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,e[0].v)),null==t.options.max&&e.length>1&&(t.max=Math.max(t.max,e[e.length-1].v)))}function P(){ae.clear(),o(ge.drawBackground,[le]);var t=re.grid;t.show&&t.backgroundColor&&z(),t.show&&!t.aboveData&&I();for(var e=0;e<ie.length;++e)o(ge.drawSeries,[le,ie[e]]),B(ie[e]);o(ge.draw,[le]),t.show&&t.aboveData&&I(),ae.render(),$()}function E(t,e){for(var n,i,r,a,s=p(),o=0;o<s.length;++o)if(n=s[o],n.direction==e&&(a=e+n.n+"axis",t[a]||1!=n.n||(a=e+"axis"),t[a])){i=t[a].from,r=t[a].to;break}if(t[a]||(n="x"==e?ue[0]:ce[0],i=t[e+"1"],r=t[e+"2"]),null!=i&&null!=r&&i>r){var l=i;i=r,r=l}return{from:i,to:r,axis:n}}function z(){le.save(),le.translate(fe.left,fe.top),le.fillStyle=ne(re.grid.backgroundColor,de,0,"rgba(255, 255, 255, 0)"),le.fillRect(0,0,pe,de),le.restore()}function I(){var e,n,i,r;le.save(),le.translate(fe.left,fe.top);var a=re.grid.markings;if(a)for(t.isFunction(a)&&(n=me.getAxes(),n.xmin=n.xaxis.min,n.xmax=n.xaxis.max,n.ymin=n.yaxis.min,n.ymax=n.yaxis.max,a=a(n)),e=0;e<a.length;++e){var s=a[e],o=E(s,"x"),l=E(s,"y");if(null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),!(o.to<o.axis.min||o.from>o.axis.max||l.to<l.axis.min||l.from>l.axis.max)){o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max);var h=o.from===o.to,u=l.from===l.to;if(!h||!u)if(o.from=Math.floor(o.axis.p2c(o.from)),o.to=Math.floor(o.axis.p2c(o.to)),l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),h||u){var c=s.lineWidth||re.grid.markingsLineWidth,f=c%2?.5:0;le.beginPath(),le.strokeStyle=s.color||re.grid.markingsColor,le.lineWidth=c,h?(le.moveTo(o.to+f,l.from),le.lineTo(o.to+f,l.to)):(le.moveTo(o.from,l.to+f),le.lineTo(o.to,l.to+f)),le.stroke()}else le.fillStyle=s.color||re.grid.markingsColor,le.fillRect(o.from,l.to,o.to-o.from,l.from-l.to)}}n=p(),i=re.grid.borderWidth;for(var d=0;d<n.length;++d){var g,m,v,y,x=n[d],b=x.box,w=x.tickLength;if(x.show&&0!=x.ticks.length){for(le.lineWidth=1,"x"==x.direction?(g=0,m="full"==w?"top"==x.position?0:de:b.top-fe.top+("top"==x.position?b.height:0)):(m=0,g="full"==w?"left"==x.position?0:pe:b.left-fe.left+("left"==x.position?b.width:0)),x.innermost||(le.strokeStyle=x.options.color,le.beginPath(),v=y=0,"x"==x.direction?v=pe+1:y=de+1,1==le.lineWidth&&("x"==x.direction?m=Math.floor(m)+.5:g=Math.floor(g)+.5),le.moveTo(g,m),le.lineTo(g+v,m+y),le.stroke()),le.strokeStyle=x.options.tickColor,le.beginPath(),e=0;e<x.ticks.length;++e){var k=x.ticks[e].v;v=y=0,isNaN(k)||k<x.min||k>x.max||"full"==w&&("object"==typeof i&&i[x.position]>0||i>0)&&(k==x.min||k==x.max)||("x"==x.direction?(g=x.p2c(k),y="full"==w?-de:w,"top"==x.position&&(y=-y)):(m=x.p2c(k),v="full"==w?-pe:w,"left"==x.position&&(v=-v)),1==le.lineWidth&&("x"==x.direction?g=Math.floor(g)+.5:m=Math.floor(m)+.5),le.moveTo(g,m),le.lineTo(g+v,m+y))}le.stroke()}}i&&(r=re.grid.borderColor,"object"==typeof i||"object"==typeof r?("object"!=typeof i&&(i={top:i,right:i,bottom:i,left:i}),"object"!=typeof r&&(r={top:r,right:r,bottom:r,left:r}),i.top>0&&(le.strokeStyle=r.top,le.lineWidth=i.top,le.beginPath(),le.moveTo(0-i.left,0-i.top/2),le.lineTo(pe,0-i.top/2),le.stroke()),i.right>0&&(le.strokeStyle=r.right,le.lineWidth=i.right,le.beginPath(),le.moveTo(pe+i.right/2,0-i.top),le.lineTo(pe+i.right/2,de),le.stroke()),i.bottom>0&&(le.strokeStyle=r.bottom,le.lineWidth=i.bottom,le.beginPath(),le.moveTo(pe+i.right,de+i.bottom/2),le.lineTo(0,de+i.bottom/2),le.stroke()),i.left>0&&(le.strokeStyle=r.left,le.lineWidth=i.left,le.beginPath(),le.moveTo(0-i.left/2,de+i.bottom),le.lineTo(0-i.left/2,0),le.stroke())):(le.lineWidth=i,le.strokeStyle=re.grid.borderColor,le.strokeRect(-i/2,-i/2,pe+i,de+i))),le.restore()}function D(){t.each(p(),function(t,e){var n,i,r,a,s,o=e.box,l=e.direction+"Axis "+e.direction+e.n+"Axis",h="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+l,u=e.options.font||"flot-tick-label tickLabel";if(ae.removeText(h),e.show&&0!=e.ticks.length)for(var c=0;c<e.ticks.length;++c)n=e.ticks[c],!n.label||n.v<e.min||n.v>e.max||("x"==e.direction?(a="center",i=fe.left+e.p2c(n.v),"bottom"==e.position?r=o.top+o.padding:(r=o.top+o.height-o.padding,s="bottom")):(s="middle",r=fe.top+e.p2c(n.v),"left"==e.position?(i=o.left+o.width-o.padding,a="right"):i=o.left+o.padding),ae.addText(h,i,r,n.label,u,null,null,a,s))})}function B(t){t.lines.show&&H(t),t.bars.show&&O(t),t.points.show&&W(t)}function H(t){function e(t,e,n,i,r){var a=t.points,s=t.pointsize,o=null,l=null;le.beginPath();for(var h=s;h<a.length;h+=s){var u=a[h-s],c=a[h-s+1],f=a[h],p=a[h+1];if(null!=u&&null!=f){if(p>=c&&c<r.min){if(p<r.min)continue;u=(r.min-c)/(p-c)*(f-u)+u,c=r.min}else if(c>=p&&p<r.min){if(c<r.min)continue;f=(r.min-c)/(p-c)*(f-u)+u,p=r.min}if(c>=p&&c>r.max){if(p>r.max)continue;u=(r.max-c)/(p-c)*(f-u)+u,c=r.max}else if(p>=c&&p>r.max){if(c>r.max)continue;f=(r.max-c)/(p-c)*(f-u)+u,p=r.max}if(f>=u&&u<i.min){if(f<i.min)continue;c=(i.min-u)/(f-u)*(p-c)+c,u=i.min}else if(u>=f&&f<i.min){if(u<i.min)continue;p=(i.min-u)/(f-u)*(p-c)+c,f=i.min}if(u>=f&&u>i.max){if(f>i.max)continue;c=(i.max-u)/(f-u)*(p-c)+c,u=i.max}else if(f>=u&&f>i.max){if(u>i.max)continue;p=(i.max-u)/(f-u)*(p-c)+c,f=i.max}(u!=o||c!=l)&&le.moveTo(i.p2c(u)+e,r.p2c(c)+n),o=f,l=p,le.lineTo(i.p2c(f)+e,r.p2c(p)+n)}}le.stroke()}function n(t,e,n){for(var i=t.points,r=t.pointsize,a=Math.min(Math.max(0,n.min),n.max),s=0,o=!1,l=1,h=0,u=0;;){if(r>0&&s>i.length+r)break;s+=r;var c=i[s-r],f=i[s-r+l],p=i[s],d=i[s+l];if(o){if(r>0&&null!=c&&null==p){u=s,r=-r,l=2;continue}if(0>r&&s==h+r){le.fill(),o=!1,r=-r,l=1,s=h=u+r;continue}}if(null!=c&&null!=p){if(p>=c&&c<e.min){if(p<e.min)continue;f=(e.min-c)/(p-c)*(d-f)+f,c=e.min}else if(c>=p&&p<e.min){if(c<e.min)continue;d=(e.min-c)/(p-c)*(d-f)+f,p=e.min}if(c>=p&&c>e.max){if(p>e.max)continue;f=(e.max-c)/(p-c)*(d-f)+f,c=e.max}else if(p>=c&&p>e.max){if(c>e.max)continue;d=(e.max-c)/(p-c)*(d-f)+f,p=e.max}if(o||(le.beginPath(),le.moveTo(e.p2c(c),n.p2c(a)),o=!0),f>=n.max&&d>=n.max)le.lineTo(e.p2c(c),n.p2c(n.max)),le.lineTo(e.p2c(p),n.p2c(n.max));else if(f<=n.min&&d<=n.min)le.lineTo(e.p2c(c),n.p2c(n.min)),le.lineTo(e.p2c(p),n.p2c(n.min));else{var g=c,m=p;d>=f&&f<n.min&&d>=n.min?(c=(n.min-f)/(d-f)*(p-c)+c,f=n.min):f>=d&&d<n.min&&f>=n.min&&(p=(n.min-f)/(d-f)*(p-c)+c,d=n.min),f>=d&&f>n.max&&d<=n.max?(c=(n.max-f)/(d-f)*(p-c)+c,f=n.max):d>=f&&d>n.max&&f<=n.max&&(p=(n.max-f)/(d-f)*(p-c)+c,d=n.max),c!=g&&le.lineTo(e.p2c(g),n.p2c(f)),le.lineTo(e.p2c(c),n.p2c(f)),le.lineTo(e.p2c(p),n.p2c(d)),p!=m&&(le.lineTo(e.p2c(p),n.p2c(d)),le.lineTo(e.p2c(m),n.p2c(d)))}}}}le.save(),le.translate(fe.left,fe.top),le.lineJoin="round";var i=t.lines.lineWidth,r=t.shadowSize;if(i>0&&r>0){le.lineWidth=r,le.strokeStyle="rgba(0,0,0,0.1)";var a=Math.PI/18;e(t.datapoints,Math.sin(a)*(i/2+r/2),Math.cos(a)*(i/2+r/2),t.xaxis,t.yaxis),le.lineWidth=r/2,e(t.datapoints,Math.sin(a)*(i/2+r/4),Math.cos(a)*(i/2+r/4),t.xaxis,t.yaxis)}le.lineWidth=i,le.strokeStyle=t.color;var s=q(t.lines,t.color,0,de);s&&(le.fillStyle=s,n(t.datapoints,t.xaxis,t.yaxis)),i>0&&e(t.datapoints,0,0,t.xaxis,t.yaxis),le.restore()}function W(t){function e(t,e,n,i,r,a,s,o){for(var l=t.points,h=t.pointsize,u=0;u<l.length;u+=h){var c=l[u],f=l[u+1];null==c||c<a.min||c>a.max||f<s.min||f>s.max||(le.beginPath(),c=a.p2c(c),f=s.p2c(f)+i,"circle"==o?le.arc(c,f,e,0,r?Math.PI:2*Math.PI,!1):o(le,c,f,e,r),le.closePath(),n&&(le.fillStyle=n,le.fill()),le.stroke())}}le.save(),le.translate(fe.left,fe.top);var n=t.points.lineWidth,i=t.shadowSize,r=t.points.radius,a=t.points.symbol;if(0==n&&(n=1e-4),n>0&&i>0){var s=i/2;le.lineWidth=s,le.strokeStyle="rgba(0,0,0,0.1)",e(t.datapoints,r,null,s+s/2,!0,t.xaxis,t.yaxis,a),le.strokeStyle="rgba(0,0,0,0.2)",e(t.datapoints,r,null,s/2,!0,t.xaxis,t.yaxis,a)}le.lineWidth=n,le.strokeStyle=t.color,e(t.datapoints,r,q(t.points,t.color),0,!1,t.xaxis,t.yaxis,a),le.restore()}function N(t,e,n,i,r,a,s,o,l,h,u){var c,f,p,d,g,m,v,y,x;h?(y=m=v=!0,g=!1,c=n,f=t,d=e+i,p=e+r,c>f&&(x=f,f=c,c=x,g=!0,m=!1)):(g=m=v=!0,y=!1,c=t+i,f=t+r,p=n,d=e,p>d&&(x=d,d=p,p=x,y=!0,v=!1)),f<s.min||c>s.max||d<o.min||p>o.max||(c<s.min&&(c=s.min,g=!1),f>s.max&&(f=s.max,m=!1),p<o.min&&(p=o.min,y=!1),d>o.max&&(d=o.max,v=!1),c=s.p2c(c),p=o.p2c(p),f=s.p2c(f),d=o.p2c(d),a&&(l.fillStyle=a(p,d),l.fillRect(c,d,f-c,p-d)),u>0&&(g||m||v||y)&&(l.beginPath(),l.moveTo(c,p),g?l.lineTo(c,d):l.moveTo(c,d),v?l.lineTo(f,d):l.moveTo(f,d),m?l.lineTo(f,p):l.moveTo(f,p),y?l.lineTo(c,p):l.moveTo(c,p),l.stroke()))}function O(t){function e(e,n,i,r,a,s){for(var o=e.points,l=e.pointsize,h=0;h<o.length;h+=l)null!=o[h]&&N(o[h],o[h+1],o[h+2],n,i,r,a,s,le,t.bars.horizontal,t.bars.lineWidth)}le.save(),le.translate(fe.left,fe.top),le.lineWidth=t.bars.lineWidth,le.strokeStyle=t.color;var n;switch(t.bars.align){case"left":n=0;break;case"right":n=-t.bars.barWidth;break;default:n=-t.bars.barWidth/2}var i=t.bars.fill?function(e,n){return q(t.bars,t.color,e,n)}:null;e(t.datapoints,n,n+t.bars.barWidth,i,t.xaxis,t.yaxis),le.restore()}function q(e,n,i,r){var a=e.fill;if(!a)return null;if(e.fillColor)return ne(e.fillColor,i,r,n);var s=t.color.parse(n);return s.a="number"==typeof a?a:.4,s.normalize(),s.toString()}function j(){if(null!=re.legend.container?t(re.legend.container).html(""):n.find(".legend").remove(),re.legend.show){for(var e,i,r=[],a=[],s=!1,o=re.legend.labelFormatter,l=0;l<ie.length;++l)e=ie[l],e.label&&(i=o?o(e.label,e):e.label,i&&a.push({label:i,color:e.color}));if(re.legend.sorted)if(t.isFunction(re.legend.sorted))a.sort(re.legend.sorted);else if("reverse"==re.legend.sorted)a.reverse();else{var h="descending"!=re.legend.sorted;a.sort(function(t,e){return t.label==e.label?0:t.label<e.label!=h?1:-1})}for(var l=0;l<a.length;++l){var u=a[l];l%re.legend.noColumns==0&&(s&&r.push("</tr>"),r.push("<tr>"),s=!0),r.push('<td class="legendColorBox"><div style="border:1px solid '+re.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+u.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+u.label+"</td>")}if(s&&r.push("</tr>"),0!=r.length){var c='<table style="font-size:smaller;color:'+re.grid.color+'">'+r.join("")+"</table>";if(null!=re.legend.container)t(re.legend.container).html(c);else{var f="",p=re.legend.position,d=re.legend.margin;null==d[0]&&(d=[d,d]),"n"==p.charAt(0)?f+="top:"+(d[1]+fe.top)+"px;":"s"==p.charAt(0)&&(f+="bottom:"+(d[1]+fe.bottom)+"px;"),"e"==p.charAt(1)?f+="right:"+(d[0]+fe.right)+"px;":"w"==p.charAt(1)&&(f+="left:"+(d[0]+fe.left)+"px;");var g=t('<div class="legend">'+c.replace('style="','style="position:absolute;'+f+";")+"</div>").appendTo(n);if(0!=re.legend.backgroundOpacity){var m=re.legend.backgroundColor;null==m&&(m=re.grid.backgroundColor,m=m&&"string"==typeof m?t.color.parse(m):t.color.extract(g,"background-color"),m.a=1,m=m.toString());var v=g.children();t('<div style="position:absolute;width:'+v.width()+"px;height:"+v.height()+"px;"+f+"background-color:"+m+';"> </div>').prependTo(g).css("opacity",re.legend.backgroundOpacity)}}}}}function Y(t,e,n){var i,r,a,s=re.grid.mouseActiveRadius,o=s*s+1,l=null;for(i=ie.length-1;i>=0;--i)if(n(ie[i])){var h=ie[i],u=h.xaxis,c=h.yaxis,f=h.datapoints.points,p=u.c2p(t),d=c.c2p(e),g=s/u.scale,m=s/c.scale;if(a=h.datapoints.pointsize,u.options.inverseTransform&&(g=Number.MAX_VALUE),c.options.inverseTransform&&(m=Number.MAX_VALUE),h.lines.show||h.points.show)for(r=0;r<f.length;r+=a){var v=f[r],y=f[r+1];if(null!=v&&!(v-p>g||-g>v-p||y-d>m||-m>y-d)){var x=Math.abs(u.p2c(v)-t),b=Math.abs(c.p2c(y)-e),w=x*x+b*b;o>w&&(o=w,l=[i,r/a])}}if(h.bars.show&&!l){var k,M;switch(h.bars.align){case"left":k=0;break;case"right":k=-h.bars.barWidth;break;default:k=-h.bars.barWidth/2}for(M=k+h.bars.barWidth,r=0;r<f.length;r+=a){var v=f[r],y=f[r+1],S=f[r+2];null!=v&&(ie[i].bars.horizontal?p<=Math.max(S,v)&&p>=Math.min(S,v)&&d>=y+k&&y+M>=d:p>=v+k&&v+M>=p&&d>=Math.min(S,y)&&d<=Math.max(S,y))&&(l=[i,r/a])}}}return l?(i=l[0],r=l[1],a=ie[i].datapoints.pointsize,{datapoint:ie[i].datapoints.points.slice(r*a,(r+1)*a),dataIndex:r,series:ie[i],seriesIndex:i}):null}function G(t){re.grid.hoverable&&U("plothover",t,function(t){return 0!=t.hoverable})}function X(t){re.grid.hoverable&&U("plothover",t,function(){return!1})}function V(t){U("plotclick",t,function(t){return 0!=t.clickable})}function U(t,e,i){var r=oe.offset(),a=e.pageX-r.left-fe.left,s=e.pageY-r.top-fe.top,o=d({left:a,top:s});o.pageX=e.pageX,o.pageY=e.pageY;var l=Y(a,s,i);if(l&&(l.pageX=parseInt(l.series.xaxis.p2c(l.datapoint[0])+r.left+fe.left,10),l.pageY=parseInt(l.series.yaxis.p2c(l.datapoint[1])+r.top+fe.top,10)),re.grid.autoHighlight){for(var h=0;h<ve.length;++h){var u=ve[h];u.auto!=t||l&&u.series==l.series&&u.point[0]==l.datapoint[0]&&u.point[1]==l.datapoint[1]||J(u.series,u.point)}l&&Z(l.series,l.datapoint,t)}n.trigger(t,[o,l])}function $(){var t=re.interaction.redrawOverlayInterval;return-1==t?(Q(),void 0):(ye||(ye=setTimeout(Q,t)),void 0)}function Q(){ye=null,he.save(),se.clear(),he.translate(fe.left,fe.top);var t,e;for(t=0;t<ve.length;++t)e=ve[t],e.series.bars.show?ee(e.series,e.point):te(e.series,e.point);he.restore(),o(ge.drawOverlay,[he])}function Z(t,e,n){if("number"==typeof t&&(t=ie[t]),"number"==typeof e){var i=t.datapoints.pointsize;e=t.datapoints.points.slice(i*e,i*(e+1))}var r=K(t,e);-1==r?(ve.push({series:t,point:e,auto:n}),$()):n||(ve[r].auto=!1)}function J(t,e){if(null==t&&null==e)return ve=[],$(),void 0;if("number"==typeof t&&(t=ie[t]),"number"==typeof e){var n=t.datapoints.pointsize;e=t.datapoints.points.slice(n*e,n*(e+1))}var i=K(t,e);-1!=i&&(ve.splice(i,1),$())}function K(t,e){for(var n=0;n<ve.length;++n){var i=ve[n];if(i.series==t&&i.point[0]==e[0]&&i.point[1]==e[1])return n}return-1}function te(e,n){var i=n[0],r=n[1],a=e.xaxis,s=e.yaxis,o="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString();if(!(i<a.min||i>a.max||r<s.min||r>s.max)){var l=e.points.radius+e.points.lineWidth/2;he.lineWidth=l,he.strokeStyle=o;var h=1.5*l;i=a.p2c(i),r=s.p2c(r),he.beginPath(),"circle"==e.points.symbol?he.arc(i,r,h,0,2*Math.PI,!1):e.points.symbol(he,i,r,h,!1),he.closePath(),he.stroke()}}function ee(e,n){var i,r="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString(),a=r;switch(e.bars.align){case"left":i=0;break;case"right":i=-e.bars.barWidth;break;default:i=-e.bars.barWidth/2}he.lineWidth=e.bars.lineWidth,he.strokeStyle=r,N(n[0],n[1],n[2]||0,i,i+e.bars.barWidth,function(){return a},e.xaxis,e.yaxis,he,e.bars.horizontal,e.bars.lineWidth)}function ne(e,n,i,r){if("string"==typeof e)return e;for(var a=le.createLinearGradient(0,i,0,n),s=0,o=e.colors.length;o>s;++s){var l=e.colors[s];if("string"!=typeof l){var h=t.color.parse(r);null!=l.brightness&&(h=h.scale("rgb",l.brightness)),null!=l.opacity&&(h.a*=l.opacity),l=h.toString()}a.addColorStop(s/(o-1),l)}return a}var ie=[],re={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},ae=null,se=null,oe=null,le=null,he=null,ue=[],ce=[],fe={left:0,right:0,top:0,bottom:0},pe=0,de=0,ge={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},me=this;me.setData=u,me.setupGrid=T,me.draw=P,me.getPlaceholder=function(){return n},me.getCanvas=function(){return ae.element
  },me.getPlotOffset=function(){return fe},me.width=function(){return pe},me.height=function(){return de},me.offset=function(){var t=oe.offset();return t.left+=fe.left,t.top+=fe.top,t},me.getData=function(){return ie},me.getAxes=function(){var e={};return t.each(ue.concat(ce),function(t,n){n&&(e[n.direction+(1!=n.n?n.n:"")+"axis"]=n)}),e},me.getXAxes=function(){return ue},me.getYAxes=function(){return ce},me.c2p=d,me.p2c=g,me.getOptions=function(){return re},me.highlight=Z,me.unhighlight=J,me.triggerRedrawOverlay=$,me.pointOffset=function(t){return{left:parseInt(ue[f(t,"x")-1].p2c(+t.x)+fe.left,10),top:parseInt(ce[f(t,"y")-1].p2c(+t.y)+fe.top,10)}},me.shutdown=w,me.destroy=function(){w(),n.removeData("plot").empty(),ie=[],re=null,ae=null,se=null,oe=null,le=null,he=null,ue=[],ce=[],ge=null,ve=[],me=null},me.resize=function(){var t=n.width(),e=n.height();ae.resize(t,e),se.resize(t,e)},me.hooks=ge,l(me),h(a),x(),u(r),T(),P(),b();var ve=[],ye=null}function i(t,e){return e*Math.floor(t/e)}var r=Object.prototype.hasOwnProperty;t.fn.detach||(t.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),e.prototype.resize=function(t,e){if(0>=t||0>=e)throw new Error("Invalid dimensions for plot, width = "+t+", height = "+e);var n=this.element,i=this.context,r=this.pixelRatio;this.width!=t&&(n.width=t*r,n.style.width=t+"px",this.width=t),this.height!=e&&(n.height=e*r,n.style.height=e+"px",this.height=e),i.restore(),i.save(),i.scale(r,r)},e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.render=function(){var t=this._textCache;for(var e in t)if(r.call(t,e)){var n=this.getTextLayer(e),i=t[e];n.hide();for(var a in i)if(r.call(i,a)){var s=i[a];for(var o in s)if(r.call(s,o)){for(var l,h=s[o].positions,u=0;l=h[u];u++)l.active?l.rendered||(n.append(l.element),l.rendered=!0):(h.splice(u--,1),l.rendered&&l.element.detach());0==h.length&&delete s[o]}}n.show()}},e.prototype.getTextLayer=function(e){var n=this.text[e];return null==n&&(null==this.textContainer&&(this.textContainer=t("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),n=this.text[e]=t("<div></div>").addClass(e).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),n},e.prototype.getTextInfo=function(e,n,i,r,a){var s,o,l,h;if(n=""+n,s="object"==typeof i?i.style+" "+i.variant+" "+i.weight+" "+i.size+"px/"+i.lineHeight+"px "+i.family:i,o=this._textCache[e],null==o&&(o=this._textCache[e]={}),l=o[s],null==l&&(l=o[s]={}),h=l[n],null==h){var u=t("<div></div>").html(n).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(e));"object"==typeof i?u.css({font:s,color:i.color}):"string"==typeof i&&u.addClass(i),h=l[n]={width:u.outerWidth(!0),height:u.outerHeight(!0),element:u,positions:[]},u.detach()}return h},e.prototype.addText=function(t,e,n,i,r,a,s,o,l){var h=this.getTextInfo(t,i,r,a,s),u=h.positions;"center"==o?e-=h.width/2:"right"==o&&(e-=h.width),"middle"==l?n-=h.height/2:"bottom"==l&&(n-=h.height);for(var c,f=0;c=u[f];f++)if(c.x==e&&c.y==n)return c.active=!0,void 0;c={active:!0,rendered:!1,element:u.length?h.element.clone():h.element,x:e,y:n},u.push(c),c.element.css({top:Math.round(n),left:Math.round(e),"text-align":o})},e.prototype.removeText=function(t,e,n,i,a,s){if(null==i){var o=this._textCache[t];if(null!=o)for(var l in o)if(r.call(o,l)){var h=o[l];for(var u in h)if(r.call(h,u))for(var c,f=h[u].positions,p=0;c=f[p];p++)c.active=!1}}else for(var c,f=this.getTextInfo(t,i,a,s).positions,p=0;c=f[p];p++)c.x==e&&c.y==n&&(c.active=!1)},t.plot=function(e,i,r){var a=new n(t(e),i,r,t.plot.plugins);return a},t.plot.version="0.8.3",t.plot.plugins=[],t.fn.plot=function(e,n){return this.each(function(){t.plot(this,e,n)})}}(jQuery),function(t){var e={tooltip:!1,tooltipOpts:{content:"%s | X: %x | Y: %y",xDateFormat:null,yDateFormat:null,shifts:{x:10,y:20},defaultTheme:!0,onHover:function(){}}},n=function(t){this.tipPosition={x:0,y:0},this.init(t)};n.prototype.init=function(e){function n(t){var e={};e.x=t.pageX,e.y=t.pageY,r.updateTooltipPosition(e)}function i(t,e,n){var i=r.getDomElement();if(n){var a;a=r.stringFormat(r.tooltipOptions.content,n),i.html(a),r.updateTooltipPosition({x:e.pageX,y:e.pageY}),i.css({left:r.tipPosition.x+r.tooltipOptions.shifts.x,top:r.tipPosition.y+r.tooltipOptions.shifts.y}).show(),"function"==typeof r.tooltipOptions.onHover&&r.tooltipOptions.onHover(n,i)}else i.hide().html("")}var r=this;e.hooks.bindEvents.push(function(e,a){r.plotOptions=e.getOptions(),r.plotOptions.tooltip!==!1&&void 0!==r.plotOptions.tooltip&&(r.tooltipOptions=r.plotOptions.tooltipOpts,r.getDomElement(),t(e.getPlaceholder()).bind("plothover",i),t(a).bind("mousemove",n))}),e.hooks.shutdown.push(function(e,r){t(e.getPlaceholder()).unbind("plothover",i),t(r).unbind("mousemove",n)})},n.prototype.getDomElement=function(){var e;return t("#flotTip").length>0?e=t("#flotTip"):(e=t("<div />").attr("id","flotTip"),e.appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&e.css({background:"#fff","z-index":"100",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),e},n.prototype.updateTooltipPosition=function(e){var n=t("#flotTip").outerWidth()+this.tooltipOptions.shifts.x,i=t("#flotTip").outerHeight()+this.tooltipOptions.shifts.y;e.x-t(window).scrollLeft()>t(window).innerWidth()-n&&(e.x-=n),e.y-t(window).scrollTop()>t(window).innerHeight()-i&&(e.y-=i),this.tipPosition.x=e.x,this.tipPosition.y=e.y},n.prototype.stringFormat=function(t,e){var n=/%p\.{0,1}(\d{0,})/,i=/%s/,r=/%x\.{0,1}(?:\d{0,})/,a=/%y\.{0,1}(?:\d{0,})/;return"function"==typeof t&&(t=t(e.series.label,e.series.data[e.dataIndex][0],e.series.data[e.dataIndex][1],e)),void 0!==e.series.percent&&(t=this.adjustValPrecision(n,t,e.series.percent)),void 0!==e.series.label&&(t=t.replace(i,e.series.label)),this.isTimeMode("xaxis",e)&&this.isXDateFormat(e)&&(t=t.replace(r,this.timestampToDate(e.series.data[e.dataIndex][0],this.tooltipOptions.xDateFormat))),this.isTimeMode("yaxis",e)&&this.isYDateFormat(e)&&(t=t.replace(a,this.timestampToDate(e.series.data[e.dataIndex][1],this.tooltipOptions.yDateFormat))),"number"==typeof e.series.data[e.dataIndex][0]&&(t=this.adjustValPrecision(r,t,e.series.data[e.dataIndex][0])),"number"==typeof e.series.data[e.dataIndex][1]&&(t=this.adjustValPrecision(a,t,e.series.data[e.dataIndex][1])),void 0!==e.series.xaxis.tickFormatter&&(t=t.replace(r,e.series.xaxis.tickFormatter(e.series.data[e.dataIndex][0],e.series.xaxis))),void 0!==e.series.yaxis.tickFormatter&&(t=t.replace(a,e.series.yaxis.tickFormatter(e.series.data[e.dataIndex][1],e.series.yaxis))),t},n.prototype.isTimeMode=function(t,e){return void 0!==e.series[t].options.mode&&"time"===e.series[t].options.mode},n.prototype.isXDateFormat=function(){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat},n.prototype.isYDateFormat=function(){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat},n.prototype.timestampToDate=function(e,n){var i=new Date(e);return t.plot.formatDate(i,n)},n.prototype.adjustValPrecision=function(t,e,n){var i,r=e.match(t);return null!==r&&""!==RegExp.$1&&(i=RegExp.$1,n=n.toFixed(i),e=e.replace(t,n)),e};var i=function(t){new n(t)};t.plot.plugins.push({init:i,options:e,name:"tooltip",version:"0.6.1"})}(jQuery),function(t,e,n){"$:nomunge";function i(n){o===!0&&(o=n||1);for(var l=a.length-1;l>=0;l--){var f=t(a[l]);if(f[0]==e||f.is(":visible")){var p=f.width(),d=f.height(),g=f.data(u);!g||p===g.w&&d===g.h||(f.trigger(h,[g.w=p,g.h=d]),o=n||!0)}else g=f.data(u),g.w=0,g.h=0}null!==r&&(o&&(null==n||1e3>n-o)?r=e.requestAnimationFrame(i):(r=setTimeout(i,s[c]),o=!1))}var r,a=[],s=t.resize=t.extend(t.resize,{}),o=!1,l="setTimeout",h="resize",u=h+"-special-event",c="pendingDelay",f="activeDelay",p="throttleWindow";s[c]=200,s[f]=20,s[p]=!0,t.event.special[h]={setup:function(){if(!s[p]&&this[l])return!1;var e=t(this);a.push(this),e.data(u,{w:e.width(),h:e.height()}),1===a.length&&(r=n,i())},teardown:function(){if(!s[p]&&this[l])return!1;for(var e=t(this),n=a.length-1;n>=0;n--)if(a[n]==this){a.splice(n,1);break}e.removeData(u),a.length||(o?cancelAnimationFrame(r):clearTimeout(r),r=null)},add:function(e){function i(e,i,a){var s=t(this),o=s.data(u)||{};o.w=i!==n?i:s.width(),o.h=a!==n?a:s.height(),r.apply(this,arguments)}if(!s[p]&&this[l])return!1;var r;return t.isFunction(e)?(r=e,i):(r=e.handler,e.handler=i,void 0)}},e.requestAnimationFrame||(e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){return e.setTimeout(function(){t((new Date).getTime())},s[f])}}()),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}())}(jQuery,this),function(t){function e(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}function n(t){t.getPlaceholder().resize(e)}function i(t){t.getPlaceholder().unbind("resize",e)}t.hooks.bindEvents.push(n),t.hooks.shutdown.push(i)}var n={};t.plot.plugins.push({init:e,options:n,name:"resize",version:"1.0"})}(jQuery),function(t){function e(e){function r(e){M||(M=!0,v=e.getCanvas(),y=t(v).parent(),x=e.getOptions(),e.setData(a(e.getData())))}function a(e){for(var n=0,i=0,r=0,a=x.series.pie.combine.color,s=[],o=0;o<e.length;++o){var l=e[o].data;t.isArray(l)&&1==l.length&&(l=l[0]),t.isArray(l)?l[1]=!isNaN(parseFloat(l[1]))&&isFinite(l[1])?+l[1]:0:l=!isNaN(parseFloat(l))&&isFinite(l)?[1,+l]:[1,0],e[o].data=[l]}for(var o=0;o<e.length;++o)n+=e[o].data[0][1];for(var o=0;o<e.length;++o){var l=e[o].data[0][1];l/n<=x.series.pie.combine.threshold&&(i+=l,r++,a||(a=e[o].color))}for(var o=0;o<e.length;++o){var l=e[o].data[0][1];(2>r||l/n>x.series.pie.combine.threshold)&&s.push(t.extend(e[o],{data:[[1,l]],color:e[o].color,label:e[o].label,angle:l*Math.PI*2/n,percent:l/(n/100)}))}return r>1&&s.push({data:[[1,i]],color:a,label:x.series.pie.combine.label,angle:i*Math.PI*2/n,percent:i/(n/100)}),s}function s(e,r){function a(){S.clearRect(0,0,h,u),y.children().filter(".pieLabel, .pieLabelBackground").remove()}function s(){var t=x.series.pie.shadow.left,e=x.series.pie.shadow.top,n=10,i=x.series.pie.shadow.alpha,r=x.series.pie.radius>1?x.series.pie.radius:b*x.series.pie.radius;if(!(r>=h/2-t||r*x.series.pie.tilt>=u/2-e||n>=r)){S.save(),S.translate(t,e),S.globalAlpha=i,S.fillStyle="#000",S.translate(w,k),S.scale(1,x.series.pie.tilt);for(var a=1;n>=a;a++)S.beginPath(),S.arc(0,0,r,0,2*Math.PI,!1),S.fill(),r-=a;S.restore()}}function l(){function e(t,e,n){0>=t||isNaN(t)||(n?S.fillStyle=e:(S.strokeStyle=e,S.lineJoin="round"),S.beginPath(),Math.abs(t-2*Math.PI)>1e-9&&S.moveTo(0,0),S.arc(0,0,r,a,a+t/2,!1),S.arc(0,0,r,a+t/2,a+t,!1),S.closePath(),a+=t,n?S.fill():S.stroke())}function n(){function e(e,n,i){if(0==e.data[0][1])return!0;var a,s=x.legend.labelFormatter,o=x.series.pie.label.formatter;a=s?s(e.label,e):e.label,o&&(a=o(a,e));var l=(n+e.angle+n)/2,c=w+Math.round(Math.cos(l)*r),f=k+Math.round(Math.sin(l)*r)*x.series.pie.tilt,p="<span class='pieLabel' id='pieLabel"+i+"' style='position:absolute;top:"+f+"px;left:"+c+"px;'>"+a+"</span>";y.append(p);var d=y.children("#pieLabel"+i),g=f-d.height()/2,m=c-d.width()/2;if(d.css("top",g),d.css("left",m),0-g>0||0-m>0||u-(g+d.height())<0||h-(m+d.width())<0)return!1;if(0!=x.series.pie.label.background.opacity){var v=x.series.pie.label.background.color;null==v&&(v=e.color);var b="top:"+g+"px;left:"+m+"px;";t("<div class='pieLabelBackground' style='position:absolute;width:"+d.width()+"px;height:"+d.height()+"px;"+b+"background-color:"+v+";'></div>").css("opacity",x.series.pie.label.background.opacity).insertBefore(d)}return!0}for(var n=i,r=x.series.pie.label.radius>1?x.series.pie.label.radius:b*x.series.pie.label.radius,a=0;a<f.length;++a){if(f[a].percent>=100*x.series.pie.label.threshold&&!e(f[a],n,a))return!1;n+=f[a].angle}return!0}var i=Math.PI*x.series.pie.startAngle,r=x.series.pie.radius>1?x.series.pie.radius:b*x.series.pie.radius;S.save(),S.translate(w,k),S.scale(1,x.series.pie.tilt),S.save();for(var a=i,s=0;s<f.length;++s)f[s].startAngle=a,e(f[s].angle,f[s].color,!0);if(S.restore(),x.series.pie.stroke.width>0){S.save(),S.lineWidth=x.series.pie.stroke.width,a=i;for(var s=0;s<f.length;++s)e(f[s].angle,x.series.pie.stroke.color,!1);S.restore()}return o(S),S.restore(),x.series.pie.label.show?n():!0}if(y){var h=e.getPlaceholder().width(),u=e.getPlaceholder().height(),c=y.children().filter(".legend").children().width()||0;S=r,M=!1,b=Math.min(h,u/x.series.pie.tilt)/2,k=u/2+x.series.pie.offset.top,w=h/2,"auto"==x.series.pie.offset.left?(x.legend.position.match("w")?w+=c/2:w-=c/2,b>w?w=b:w>h-b&&(w=h-b)):w+=x.series.pie.offset.left;var f=e.getData(),p=0;do p>0&&(b*=i),p+=1,a(),x.series.pie.tilt<=.8&&s();while(!l()&&n>p);p>=n&&(a(),y.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")),e.setSeries&&e.insertLegend&&(e.setSeries(f),e.insertLegend())}}function o(t){if(x.series.pie.innerRadius>0){t.save();var e=x.series.pie.innerRadius>1?x.series.pie.innerRadius:b*x.series.pie.innerRadius;t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle=x.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.strokeStyle=x.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.stroke(),t.closePath(),t.restore()}}function l(t,e){for(var n=!1,i=-1,r=t.length,a=r-1;++i<r;a=i)(t[i][1]<=e[1]&&e[1]<t[a][1]||t[a][1]<=e[1]&&e[1]<t[i][1])&&e[0]<(t[a][0]-t[i][0])*(e[1]-t[i][1])/(t[a][1]-t[i][1])+t[i][0]&&(n=!n);return n}function h(t,n){for(var i,r,a=e.getData(),s=e.getOptions(),o=s.series.pie.radius>1?s.series.pie.radius:b*s.series.pie.radius,h=0;h<a.length;++h){var u=a[h];if(u.pie.show){if(S.save(),S.beginPath(),S.moveTo(0,0),S.arc(0,0,o,u.startAngle,u.startAngle+u.angle/2,!1),S.arc(0,0,o,u.startAngle+u.angle/2,u.startAngle+u.angle,!1),S.closePath(),i=t-w,r=n-k,S.isPointInPath){if(S.isPointInPath(t-w,n-k))return S.restore(),{datapoint:[u.percent,u.data],dataIndex:0,series:u,seriesIndex:h}}else{var c=o*Math.cos(u.startAngle),f=o*Math.sin(u.startAngle),p=o*Math.cos(u.startAngle+u.angle/4),d=o*Math.sin(u.startAngle+u.angle/4),g=o*Math.cos(u.startAngle+u.angle/2),m=o*Math.sin(u.startAngle+u.angle/2),v=o*Math.cos(u.startAngle+u.angle/1.5),y=o*Math.sin(u.startAngle+u.angle/1.5),x=o*Math.cos(u.startAngle+u.angle),M=o*Math.sin(u.startAngle+u.angle),_=[[0,0],[c,f],[p,d],[g,m],[v,y],[x,M]],C=[i,r];if(l(_,C))return S.restore(),{datapoint:[u.percent,u.data],dataIndex:0,series:u,seriesIndex:h}}S.restore()}}return null}function u(t){f("plothover",t)}function c(t){f("plotclick",t)}function f(t,n){var i=e.offset(),r=parseInt(n.pageX-i.left),a=parseInt(n.pageY-i.top),s=h(r,a);if(x.grid.autoHighlight)for(var o=0;o<_.length;++o){var l=_[o];l.auto!=t||s&&l.series==s.series||d(l.series)}s&&p(s.series,t);var u={pageX:n.pageX,pageY:n.pageY};y.trigger(t,[u,s])}function p(t,n){var i=g(t);-1==i?(_.push({series:t,auto:n}),e.triggerRedrawOverlay()):n||(_[i].auto=!1)}function d(t){null==t&&(_=[],e.triggerRedrawOverlay());var n=g(t);-1!=n&&(_.splice(n,1),e.triggerRedrawOverlay())}function g(t){for(var e=0;e<_.length;++e){var n=_[e];if(n.series==t)return e}return-1}function m(t,e){function n(t){t.angle<=0||isNaN(t.angle)||(e.fillStyle="rgba(255, 255, 255, "+i.series.pie.highlight.opacity+")",e.beginPath(),Math.abs(t.angle-2*Math.PI)>1e-9&&e.moveTo(0,0),e.arc(0,0,r,t.startAngle,t.startAngle+t.angle/2,!1),e.arc(0,0,r,t.startAngle+t.angle/2,t.startAngle+t.angle,!1),e.closePath(),e.fill())}var i=t.getOptions(),r=i.series.pie.radius>1?i.series.pie.radius:b*i.series.pie.radius;e.save(),e.translate(w,k),e.scale(1,i.series.pie.tilt);for(var a=0;a<_.length;++a)n(_[a].series);o(e),e.restore()}var v=null,y=null,x=null,b=null,w=null,k=null,M=!1,S=null,_=[];e.hooks.processOptions.push(function(t,e){e.series.pie.show&&(e.grid.show=!1,"auto"==e.series.pie.label.show&&(e.series.pie.label.show=e.legend.show?!1:!0),"auto"==e.series.pie.radius&&(e.series.pie.radius=e.series.pie.label.show?.75:1),e.series.pie.tilt>1?e.series.pie.tilt=1:e.series.pie.tilt<0&&(e.series.pie.tilt=0))}),e.hooks.bindEvents.push(function(t,e){var n=t.getOptions();n.series.pie.show&&(n.grid.hoverable&&e.unbind("mousemove").mousemove(u),n.grid.clickable&&e.unbind("click").click(c))}),e.hooks.processDatapoints.push(function(t,e,n,i){var a=t.getOptions();a.series.pie.show&&r(t,e,n,i)}),e.hooks.drawOverlay.push(function(t,e){var n=t.getOptions();n.series.pie.show&&m(t,e)}),e.hooks.draw.push(function(t,e){var n=t.getOptions();n.series.pie.show&&s(t,e)})}var n=10,i=.95,r={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(t,e){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+e.color+";'>"+t+"<br/>"+Math.round(e.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};t.plot.plugins.push({init:e,options:r,name:"pie",version:"1.1"})}(jQuery),function(t){function e(t,e){return e*Math.floor(t/e)}function n(t,e,n,i){if("function"==typeof t.strftime)return t.strftime(e);var r=function(t,e){return t=""+t,e=""+(null==e?"0":e),1==t.length?e+t:t},a=[],s=!1,o=t.getHours(),l=12>o;null==n&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==i&&(i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var h;h=o>12?o-12:0==o?12:o;for(var u=0;u<e.length;++u){var c=e.charAt(u);if(s){switch(c){case"a":c=""+i[t.getDay()];break;case"b":c=""+n[t.getMonth()];break;case"d":c=r(t.getDate());break;case"e":c=r(t.getDate()," ");break;case"h":case"H":c=r(o);break;case"I":c=r(h);break;case"l":c=r(h," ");break;case"m":c=r(t.getMonth()+1);break;case"M":c=r(t.getMinutes());break;case"q":c=""+(Math.floor(t.getMonth()/3)+1);break;case"S":c=r(t.getSeconds());break;case"y":c=r(t.getFullYear()%100);break;case"Y":c=""+t.getFullYear();break;case"p":c=l?"am":"pm";break;case"P":c=l?"AM":"PM";break;case"w":c=""+t.getDay()}a.push(c),s=!1}else"%"==c?s=!0:a.push(c)}return a.join("")}function i(t){function e(t,e,n,i){t[e]=function(){return n[i].apply(n,arguments)}}var n={date:t};void 0!=t.strftime&&e(n,"strftime",t,"strftime"),e(n,"getTime",t,"getTime"),e(n,"setTime",t,"setTime");for(var i=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],r=0;r<i.length;r++)e(n,"get"+i[r],t,"getUTC"+i[r]),e(n,"set"+i[r],t,"setUTC"+i[r]);return n}function r(t,e){if("browser"==e.timezone)return new Date(t);if(e.timezone&&"utc"!=e.timezone){if("undefined"!=typeof timezoneJS&&"undefined"!=typeof timezoneJS.Date){var n=new timezoneJS.Date;return n.setTimezone(e.timezone),n.setTime(t),n}return i(new Date(t))}return i(new Date(t))}function a(i){i.hooks.processOptions.push(function(i){t.each(i.getAxes(),function(t,i){var a=i.options;"time"==a.mode&&(i.tickGenerator=function(t){var n=[],i=r(t.min,a),s=0,l=a.tickSize&&"quarter"===a.tickSize[1]||a.minTickSize&&"quarter"===a.minTickSize[1]?u:h;null!=a.minTickSize&&(s="number"==typeof a.tickSize?a.tickSize:a.minTickSize[0]*o[a.minTickSize[1]]);for(var c=0;c<l.length-1&&!(t.delta<(l[c][0]*o[l[c][1]]+l[c+1][0]*o[l[c+1][1]])/2&&l[c][0]*o[l[c][1]]>=s);++c);var f=l[c][0],p=l[c][1];if("year"==p){if(null!=a.minTickSize&&"year"==a.minTickSize[1])f=Math.floor(a.minTickSize[0]);else{var d=Math.pow(10,Math.floor(Math.log(t.delta/o.year)/Math.LN10)),g=t.delta/o.year/d;f=1.5>g?1:3>g?2:7.5>g?5:10,f*=d}1>f&&(f=1)}t.tickSize=a.tickSize||[f,p];var m=t.tickSize[0];p=t.tickSize[1];var v=m*o[p];"second"==p?i.setSeconds(e(i.getSeconds(),m)):"minute"==p?i.setMinutes(e(i.getMinutes(),m)):"hour"==p?i.setHours(e(i.getHours(),m)):"month"==p?i.setMonth(e(i.getMonth(),m)):"quarter"==p?i.setMonth(3*e(i.getMonth()/3,m)):"year"==p&&i.setFullYear(e(i.getFullYear(),m)),i.setMilliseconds(0),v>=o.minute&&i.setSeconds(0),v>=o.hour&&i.setMinutes(0),v>=o.day&&i.setHours(0),v>=4*o.day&&i.setDate(1),v>=2*o.month&&i.setMonth(e(i.getMonth(),3)),v>=2*o.quarter&&i.setMonth(e(i.getMonth(),6)),v>=o.year&&i.setMonth(0);var y,x=0,b=Number.NaN;do if(y=b,b=i.getTime(),n.push(b),"month"==p||"quarter"==p)if(1>m){i.setDate(1);var w=i.getTime();i.setMonth(i.getMonth()+("quarter"==p?3:1));var k=i.getTime();i.setTime(b+x*o.hour+(k-w)*m),x=i.getHours(),i.setHours(0)}else i.setMonth(i.getMonth()+m*("quarter"==p?3:1));else"year"==p?i.setFullYear(i.getFullYear()+m):i.setTime(b+v);while(b<t.max&&b!=y);return n},i.tickFormatter=function(t,e){var i=r(t,e.options);if(null!=a.timeformat)return n(i,a.timeformat,a.monthNames,a.dayNames);var s,l=e.options.tickSize&&"quarter"==e.options.tickSize[1]||e.options.minTickSize&&"quarter"==e.options.minTickSize[1],h=e.tickSize[0]*o[e.tickSize[1]],u=e.max-e.min,c=a.twelveHourClock?" %p":"",f=a.twelveHourClock?"%I":"%H";s=h<o.minute?f+":%M:%S"+c:h<o.day?u<2*o.day?f+":%M"+c:"%b %d "+f+":%M"+c:h<o.month?"%b %d":l&&h<o.quarter||!l&&h<o.year?u<o.year?"%b":"%b %Y":l&&h<o.year?u<o.year?"Q%q":"Q%q %Y":"%Y";var p=n(i,s,a.monthNames,a.dayNames);return p})})})}var s={xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},o={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},l=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],h=l.concat([[3,"month"],[6,"month"],[1,"year"]]),u=l.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);t.plot.plugins.push({init:a,options:s,name:"time",version:"1.0"}),t.plot.formatDate=n,t.plot.dateGenerator=r}(jQuery),function(t){"use strict";function e(t,e,n,i,r,a,s){var o,l,h,u,c,f,p,d,g=Math.pow,m=Math.sqrt;return o=m(g(n-t,2)+g(i-e,2)),l=m(g(r-n,2)+g(a-i,2)),h=s*o/(o+l),u=s-h,c=n+h*(t-r),f=i+h*(e-a),p=n-u*(t-r),d=i-u*(e-a),[c,f,p,d]}function n(e,n,i,r,a){var s=t.color.parse(a);s.a="number"==typeof r?r:.3,s.normalize(),s=s.toString(),n.beginPath(),n.moveTo(e[0][0],e[0][1]);for(var o=e.length,l=0;o>l;l++)n[e[l][3]].apply(n,e[l][2]);n.stroke(),n.lineWidth=0,n.lineTo(e[o-1][0],i),n.lineTo(e[0][0],i),n.closePath(),r!==!1&&(n.fillStyle=s,n.fill())}function i(t,e,n,i){(void 0===e||"bezier"!==e&&"quadratic"!==e)&&(e="quadratic"),e+="CurveTo",0==a.length?a.push([n[0],n[1],i.concat(n.slice(2)),e]):"quadraticCurveTo"==e&&2==n.length?(i=i.slice(0,2).concat(n),a.push([n[0],n[1],i,e])):a.push([n[2],n[3],i.concat(n.slice(2)),e])}function r(r,s,o){if(o.splines.show===!0){var l,h,u,c=[],f=o.splines.tension||.5,p=o.datapoints.points,d=o.datapoints.pointsize,g=r.getPlotOffset(),m=p.length,v=[];if(a=[],4>m/d)return t.extend(o.lines,o.splines),void 0;for(l=0;m>l;l+=d)h=p[l],u=p[l+1],null==h||h<o.xaxis.min||h>o.xaxis.max||u<o.yaxis.min||u>o.yaxis.max||v.push(o.xaxis.p2c(h)+g.left,o.yaxis.p2c(u)+g.top);for(m=v.length,l=0;m-2>l;l+=2)c=c.concat(e.apply(this,v.slice(l,l+6).concat([f])));for(s.save(),s.strokeStyle=o.color,s.lineWidth=o.splines.lineWidth,i(s,"quadratic",v.slice(0,4),c.slice(0,2)),l=2;m-3>l;l+=2)i(s,"bezier",v.slice(l,l+4),c.slice(2*l-2,2*l+2));i(s,"quadratic",v.slice(m-2,m),[c[2*m-10],c[2*m-9],v[m-4],v[m-3]]),n(a,s,r.height()+10,o.splines.fill,o.color),s.restore()}}var a=[];t.plot.plugins.push({init:function(t){t.hooks.drawSeries.push(r)},options:{series:{splines:{show:!1,lineWidth:2,tension:.5,fill:!1}}},name:"spline",version:"0.8.2"})}(jQuery),function(t,e,n){!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.sparkline&&t(jQuery)}(function(i){"use strict";var r,a,s,o,l,h,u,c,f,p,d,g,m,v,y,x,b,w,k,M,S,_,C,T,A,F,R,L,P,E,z,I,D={},B=0;r=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:n,normalRangeMax:n,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:n,chartRangeMax:n,chartRangeMinX:n,chartRangeMaxX:n,tooltipFormat:new s('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:n,nullColor:n,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,colorMap:n,tooltipFormat:new s('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new s('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:n,thresholdValue:0,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,tooltipFormat:new s("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:n,tooltipFormat:new s("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new s('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:n,targetColor:"#4a2",chartRangeMax:n,chartRangeMin:n,tooltipFormat:new s("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},F='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',a=function(){var t,e;return t=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(t.prototype=i.extend(new arguments[0],arguments[arguments.length-1]),t._super=arguments[0].prototype):t.prototype=arguments[arguments.length-1],arguments.length>2&&(e=Array.prototype.slice.call(arguments,1,-1),e.unshift(t.prototype),i.extend.apply(i,e))):t.prototype=arguments[0],t.prototype.cls=t,t},i.SPFormatClass=s=a({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(t,e){this.format=t,this.fclass=e},render:function(t,e,i){var r,a,s,o,l,h=this,u=t;return this.format.replace(this.fre,function(){var t;return a=arguments[1],s=arguments[3],r=h.precre.exec(a),r?(l=r[2],a=r[1]):l=!1,o=u[a],o===n?"":s&&e&&e[s]?(t=e[s],t.get?e[s].get(o)||o:e[s][o]||o):(f(o)&&(o=i.get("numberFormatter")?i.get("numberFormatter")(o):v(o,l,i.get("numberDigitGroupCount"),i.get("numberDigitGroupSep"),i.get("numberDecimalMark"))),o)})}}),i.spformat=function(t,e){return new s(t,e)},o=function(t,e,n){return e>t?e:t>n?n:t},l=function(t,n){var i;return 2===n?(i=e.floor(t.length/2),t.length%2?t[i]:(t[i-1]+t[i])/2):t.length%2?(i=(t.length*n+n)/4,i%1?(t[e.floor(i)]+t[e.floor(i)-1])/2:t[i-1]):(i=(t.length*n+2)/4,i%1?(t[e.floor(i)]+t[e.floor(i)-1])/2:t[i-1])},h=function(t){var e;switch(t){case"undefined":t=n;break;case"null":t=null;break;case"true":t=!0;break;case"false":t=!1;break;default:e=parseFloat(t),t==e&&(t=e)}return t},u=function(t){var e,n=[];for(e=t.length;e--;)n[e]=h(t[e]);return n},c=function(t,e){var n,i,r=[];for(n=0,i=t.length;i>n;n++)t[n]!==e&&r.push(t[n]);return r},f=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},v=function(t,e,n,r,a){var s,o;for(t=(e===!1?parseFloat(t).toString():t.toFixed(e)).split(""),s=(s=i.inArray(".",t))<0?t.length:s,s<t.length&&(t[s]=a),o=s-n;o>0;o-=n)t.splice(o,0,r);return t.join("")},p=function(t,e,n){var i;for(i=e.length;i--;)if((!n||null!==e[i])&&e[i]!==t)return!1;return!0},d=function(t){var e,n=0;for(e=t.length;e--;)n+="number"==typeof t[e]?t[e]:0;return n},m=function(t){return i.isArray(t)?t:[t]},g=function(e){var n;t.createStyleSheet?t.createStyleSheet().cssText=e:(n=t.createElement("style"),n.type="text/css",t.getElementsByTagName("head")[0].appendChild(n),n["string"==typeof t.body.style.WebkitAppearance?"innerText":"innerHTML"]=e)},i.fn.simpledraw=function(e,r,a,s){var o,l;if(a&&(o=this.data("_jqs_vcanvas")))return o;if(i.fn.sparkline.canvas===!1)return!1;if(i.fn.sparkline.canvas===n){var h=t.createElement("canvas");if(h.getContext&&h.getContext("2d"))i.fn.sparkline.canvas=function(t,e,n,i){return new E(t,e,n,i)};else{if(!t.namespaces||t.namespaces.v)return i.fn.sparkline.canvas=!1,!1;t.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),i.fn.sparkline.canvas=function(t,e,n){return new z(t,e,n)}}}return e===n&&(e=i(this).innerWidth()),r===n&&(r=i(this).innerHeight()),o=i.fn.sparkline.canvas(e,r,this,s),l=i(this).data("_jqs_mhandler"),l&&l.registerCanvas(o),o},i.fn.cleardraw=function(){var t=this.data("_jqs_vcanvas");t&&t.reset()},i.RangeMapClass=y=a({init:function(t){var e,n,i=[];for(e in t)t.hasOwnProperty(e)&&"string"==typeof e&&e.indexOf(":")>-1&&(n=e.split(":"),n[0]=0===n[0].length?-1/0:parseFloat(n[0]),n[1]=0===n[1].length?1/0:parseFloat(n[1]),n[2]=t[e],i.push(n));this.map=t,this.rangelist=i||!1},get:function(t){var e,i,r,a=this.rangelist;if((r=this.map[t])!==n)return r;if(a)for(e=a.length;e--;)if(i=a[e],i[0]<=t&&i[1]>=t)return i[2];return n}}),i.range_map=function(t){return new y(t)},x=a({init:function(t,e){var n=i(t);this.$el=n,this.options=e,this.currentPageX=0,this.currentPageY=0,this.el=t,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!e.get("disableTooltips"),this.highlightEnabled=!e.get("disableHighlight")},registerSparkline:function(t){this.splist.push(t),this.over&&this.updateDisplay()},registerCanvas:function(t){var e=i(t.canvas);this.canvas=t,this.$canvas=e,e.mouseenter(i.proxy(this.mouseenter,this)),e.mouseleave(i.proxy(this.mouseleave,this)),e.click(i.proxy(this.mouseclick,this))},reset:function(t){this.splist=[],this.tooltip&&t&&(this.tooltip.remove(),this.tooltip=n)},mouseclick:function(t){var e=i.Event("sparklineClick");e.originalEvent=t,e.sparklines=this.splist,this.$el.trigger(e)},mouseenter:function(e){i(t.body).unbind("mousemove.jqs"),i(t.body).bind("mousemove.jqs",i.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=e.pageX,this.currentPageY=e.pageY,this.currentEl=e.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new b(this.options),this.tooltip.updatePosition(e.pageX,e.pageY)),this.updateDisplay()},mouseleave:function(){i(t.body).unbind("mousemove.jqs");var e,n,r=this.splist,a=r.length,s=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),n=0;a>n;n++)e=r[n],e.clearRegionHighlight()&&(s=!0);s&&this.canvas.render()},mousemove:function(t){this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,this.tooltip&&this.tooltip.updatePosition(t.pageX,t.pageY),this.updateDisplay()},updateDisplay:function(){var t,e,n,r,a,s=this.splist,o=s.length,l=!1,h=this.$canvas.offset(),u=this.currentPageX-h.left,c=this.currentPageY-h.top;if(this.over){for(n=0;o>n;n++)e=s[n],r=e.setRegionHighlight(this.currentEl,u,c),r&&(l=!0);if(l){if(a=i.Event("sparklineRegionChange"),a.sparklines=this.splist,this.$el.trigger(a),this.tooltip){for(t="",n=0;o>n;n++)e=s[n],t+=e.getCurrentRegionTooltip();this.tooltip.setContent(t)
  }this.disableHighlight||this.canvas.render()}null===r&&this.mouseleave()}}}),b=a({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(e){var n,r=e.get("tooltipClassname","jqstooltip"),a=this.sizeStyle;this.container=e.get("tooltipContainer")||t.body,this.tooltipOffsetX=e.get("tooltipOffsetX",10),this.tooltipOffsetY=e.get("tooltipOffsetY",12),i("#jqssizetip").remove(),i("#jqstooltip").remove(),this.sizetip=i("<div/>",{id:"jqssizetip",style:a,"class":r}),this.tooltip=i("<div/>",{id:"jqstooltip","class":r}).appendTo(this.container),n=this.tooltip.offset(),this.offsetLeft=n.left,this.offsetTop=n.top,this.hidden=!0,i(window).unbind("resize.jqs scroll.jqs"),i(window).bind("resize.jqs scroll.jqs",i.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=i(window).scrollTop(),this.scrollLeft=i(window).scrollLeft(),this.scrollRight=this.scrollLeft+i(window).width(),this.updatePosition()},getSize:function(t){this.sizetip.html(t).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(t){return t?(this.getSize(t),this.tooltip.html(t).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition()),void 0):(this.tooltip.css("visibility","hidden"),this.hidden=!0,void 0)},updatePosition:function(t,e){if(t===n){if(this.mousex===n)return;t=this.mousex-this.offsetLeft,e=this.mousey-this.offsetTop}else this.mousex=t-=this.offsetLeft,this.mousey=e-=this.offsetTop;this.height&&this.width&&!this.hidden&&(e-=this.height+this.tooltipOffsetY,t+=this.tooltipOffsetX,e<this.scrollTop&&(e=this.scrollTop),t<this.scrollLeft?t=this.scrollLeft:t+this.width>this.scrollRight&&(t=this.scrollRight-this.width),this.tooltip.css({left:t,top:e}))},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=n,i(window).unbind("resize.jqs scroll.jqs")}}),R=function(){g(F)},i(R),I=[],i.fn.sparkline=function(e,r){return this.each(function(){var a,s,o=new i.fn.sparkline.options(this,r),l=i(this);if(a=function(){var r,a,s,h,u,c,f;return"html"===e||e===n?(f=this.getAttribute(o.get("tagValuesAttribute")),(f===n||null===f)&&(f=l.html()),r=f.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")):r=e,a="auto"===o.get("width")?r.length*o.get("defaultPixelsPerValue"):o.get("width"),"auto"===o.get("height")?o.get("composite")&&i.data(this,"_jqs_vcanvas")||(h=t.createElement("span"),h.innerHTML="a",l.html(h),s=i(h).innerHeight()||i(h).height(),i(h).remove(),h=null):s=o.get("height"),o.get("disableInteraction")?u=!1:(u=i.data(this,"_jqs_mhandler"),u?o.get("composite")||u.reset():(u=new x(this,o),i.data(this,"_jqs_mhandler",u))),o.get("composite")&&!i.data(this,"_jqs_vcanvas")?(i.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),i.data(this,"_jqs_errnotify",!0)),void 0):(c=new(i.fn.sparkline[o.get("type")])(this,r,o,a,s),c.render(),u&&u.registerSparkline(c),void 0)},i(this).html()&&!o.get("disableHiddenCheck")&&i(this).is(":hidden")||!i(this).parents("body").length){if(!o.get("composite")&&i.data(this,"_jqs_pending"))for(s=I.length;s;s--)I[s-1][0]==this&&I.splice(s-1,1);I.push([this,a]),i.data(this,"_jqs_pending",!0)}else a.call(this)})},i.fn.sparkline.defaults=r(),i.sparkline_display_visible=function(){var t,e,n,r=[];for(e=0,n=I.length;n>e;e++)t=I[e][0],i(t).is(":visible")&&!i(t).parents().is(":hidden")?(I[e][1].call(t),i.data(I[e][0],"_jqs_pending",!1),r.push(e)):!i(t).closest("html").length&&!i.data(t,"_jqs_pending")&&(i.data(I[e][0],"_jqs_pending",!1),r.push(e));for(e=r.length;e;e--)I.splice(r[e-1],1)},i.fn.sparkline.options=a({init:function(t,e){var n,r,a,s;this.userOptions=e=e||{},this.tag=t,this.tagValCache={},r=i.fn.sparkline.defaults,a=r.common,this.tagOptionsPrefix=e.enableTagOptions&&(e.tagOptionsPrefix||a.tagOptionsPrefix),s=this.getTagSetting("type"),n=s===D?r[e.type||a.type]:r[s],this.mergedOptions=i.extend({},a,n,e)},getTagSetting:function(t){var e,i,r,a,s=this.tagOptionsPrefix;if(s===!1||s===n)return D;if(this.tagValCache.hasOwnProperty(t))e=this.tagValCache.key;else{if(e=this.tag.getAttribute(s+t),e===n||null===e)e=D;else if("["===e.substr(0,1))for(e=e.substr(1,e.length-2).split(","),i=e.length;i--;)e[i]=h(e[i].replace(/(^\s*)|(\s*$)/g,""));else if("{"===e.substr(0,1))for(r=e.substr(1,e.length-2).split(","),e={},i=r.length;i--;)a=r[i].split(":",2),e[a[0].replace(/(^\s*)|(\s*$)/g,"")]=h(a[1].replace(/(^\s*)|(\s*$)/g,""));else e=h(e);this.tagValCache.key=e}return e},get:function(t,e){var i,r=this.getTagSetting(t);return r!==D?r:(i=this.mergedOptions[t])===n?e:i}}),i.fn.sparkline._base=a({disabled:!1,init:function(t,e,r,a,s){this.el=t,this.$el=i(t),this.values=e,this.options=r,this.width=a,this.height=s,this.currentRegion=n},initTarget:function(){var t=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),t))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return this.disabled?(this.el.innerHTML="",!1):!0},getRegion:function(){},setRegionHighlight:function(t,e,i){var r,a=this.currentRegion,s=!this.options.get("disableHighlight");return e>this.canvasWidth||i>this.canvasHeight||0>e||0>i?null:(r=this.getRegion(t,e,i),a!==r?(a!==n&&s&&this.removeHighlight(),this.currentRegion=r,r!==n&&s&&this.renderHighlight(),!0):!1)},clearRegionHighlight:function(){return this.currentRegion!==n?(this.removeHighlight(),this.currentRegion=n,!0):!1},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(){},getCurrentRegionTooltip:function(){var t,e,r,a,o,l,h,u,c,f,p,d,g,m,v=this.options,y="",x=[];if(this.currentRegion===n)return"";if(t=this.getCurrentRegionFields(),p=v.get("tooltipFormatter"))return p(this,v,t);if(v.get("tooltipChartTitle")&&(y+='<div class="jqs jqstitle">'+v.get("tooltipChartTitle")+"</div>\n"),e=this.options.get("tooltipFormat"),!e)return"";if(i.isArray(e)||(e=[e]),i.isArray(t)||(t=[t]),h=this.options.get("tooltipFormatFieldlist"),u=this.options.get("tooltipFormatFieldlistKey"),h&&u){for(c=[],l=t.length;l--;)f=t[l][u],-1!=(m=i.inArray(f,h))&&(c[m]=t[l]);t=c}for(r=e.length,g=t.length,l=0;r>l;l++)for(d=e[l],"string"==typeof d&&(d=new s(d)),a=d.fclass||"jqsfield",m=0;g>m;m++)t[m].isNull&&v.get("tooltipSkipNull")||(i.extend(t[m],{prefix:v.get("tooltipPrefix"),suffix:v.get("tooltipSuffix")}),o=d.render(t[m],v.get("tooltipValueLookups"),v),x.push('<div class="'+a+'">'+o+"</div>"));return x.length?y+x.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(t,n){var i,r,a,s,l=n.get("highlightColor"),h=n.get("highlightLighten");if(l)return l;if(h&&(i=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t))){for(a=[],r=4===t.length?16:1,s=0;3>s;s++)a[s]=o(e.round(parseInt(i[s+1],16)*r*h),0,255);return"rgb("+a.join(",")+")"}return t}}),w={changeHighlight:function(t){var e,n=this.currentRegion,r=this.target,a=this.regionShapes[n];a&&(e=this.renderRegion(n,t),i.isArray(e)||i.isArray(a)?(r.replaceWithShapes(a,e),this.regionShapes[n]=i.map(e,function(t){return t.id})):(r.replaceWithShape(a,e),this.regionShapes[n]=e.id))},render:function(){var t,e,n,r,a=this.values,s=this.target,o=this.regionShapes;if(this.cls._super.render.call(this)){for(n=a.length;n--;)if(t=this.renderRegion(n))if(i.isArray(t)){for(e=[],r=t.length;r--;)t[r].append(),e.push(t[r].id);o[n]=e}else t.append(),o[n]=t.id;else o[n]=null;s.render()}}},i.fn.sparkline.line=k=a(i.fn.sparkline._base,{type:"line",init:function(t,e,n,i,r){k._super.init.call(this,t,e,n,i,r),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(t,e){var i,r=this.regionMap;for(i=r.length;i--;)if(null!==r[i]&&e>=r[i][0]&&e<=r[i][1])return r[i][2];return n},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:null===this.yvalues[t],x:this.xvalues[t],y:this.yvalues[t],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:t}},renderHighlight:function(){var t,e,i=this.currentRegion,r=this.target,a=this.vertices[i],s=this.options,o=s.get("spotRadius"),l=s.get("highlightSpotColor"),h=s.get("highlightLineColor");a&&(o&&l&&(t=r.drawCircle(a[0],a[1],o,n,l),this.highlightSpotId=t.id,r.insertAfterShape(this.lastShapeId,t)),h&&(e=r.drawLine(a[0],this.canvasTop,a[0],this.canvasTop+this.canvasHeight,h),this.highlightLineId=e.id,r.insertAfterShape(this.lastShapeId,e)))},removeHighlight:function(){var t=this.target;this.highlightSpotId&&(t.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(t.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var t,n,i,r,a,s=this.values,o=s.length,l=this.xvalues,h=this.yvalues,u=this.yminmax;for(t=0;o>t;t++)n=s[t],i="string"==typeof s[t],r="object"==typeof s[t]&&s[t]instanceof Array,a=i&&s[t].split(":"),i&&2===a.length?(l.push(Number(a[0])),h.push(Number(a[1])),u.push(Number(a[1]))):r?(l.push(n[0]),h.push(n[1]),u.push(n[1])):(l.push(t),null===s[t]||"null"===s[t]?h.push(null):(h.push(Number(n)),u.push(Number(n))));this.options.get("xvalues")&&(l=this.options.get("xvalues")),this.maxy=this.maxyorg=e.max.apply(e,u),this.miny=this.minyorg=e.min.apply(e,u),this.maxx=e.max.apply(e,l),this.minx=e.min.apply(e,l),this.xvalues=l,this.yvalues=h,this.yminmax=u},processRangeOptions:function(){var t=this.options,e=t.get("normalRangeMin"),i=t.get("normalRangeMax");e!==n&&(e<this.miny&&(this.miny=e),i>this.maxy&&(this.maxy=i)),t.get("chartRangeMin")!==n&&(t.get("chartRangeClip")||t.get("chartRangeMin")<this.miny)&&(this.miny=t.get("chartRangeMin")),t.get("chartRangeMax")!==n&&(t.get("chartRangeClip")||t.get("chartRangeMax")>this.maxy)&&(this.maxy=t.get("chartRangeMax")),t.get("chartRangeMinX")!==n&&(t.get("chartRangeClipX")||t.get("chartRangeMinX")<this.minx)&&(this.minx=t.get("chartRangeMinX")),t.get("chartRangeMaxX")!==n&&(t.get("chartRangeClipX")||t.get("chartRangeMaxX")>this.maxx)&&(this.maxx=t.get("chartRangeMaxX"))},drawNormalRange:function(t,i,r,a,s){var o=this.options.get("normalRangeMin"),l=this.options.get("normalRangeMax"),h=i+e.round(r-r*((l-this.miny)/s)),u=e.round(r*(l-o)/s);this.target.drawRect(t,h,a,u,n,this.options.get("normalRangeColor")).append()},render:function(){var t,r,a,s,o,l,h,u,c,f,p,d,g,m,v,x,b,w,M,S,_,C,T,A,F,R=this.options,L=this.target,P=this.canvasWidth,E=this.canvasHeight,z=this.vertices,I=R.get("spotRadius"),D=this.regionMap;if(k._super.render.call(this)&&(this.scanValues(),this.processRangeOptions(),T=this.xvalues,A=this.yvalues,this.yminmax.length&&!(this.yvalues.length<2))){for(s=o=0,t=this.maxx-this.minx===0?1:this.maxx-this.minx,r=this.maxy-this.miny===0?1:this.maxy-this.miny,a=this.yvalues.length-1,I&&(4*I>P||4*I>E)&&(I=0),I&&(_=R.get("highlightSpotColor")&&!R.get("disableInteraction"),(_||R.get("minSpotColor")||R.get("spotColor")&&A[a]===this.miny)&&(E-=e.ceil(I)),(_||R.get("maxSpotColor")||R.get("spotColor")&&A[a]===this.maxy)&&(E-=e.ceil(I),s+=e.ceil(I)),(_||(R.get("minSpotColor")||R.get("maxSpotColor"))&&(A[0]===this.miny||A[0]===this.maxy))&&(o+=e.ceil(I),P-=e.ceil(I)),(_||R.get("spotColor")||R.get("minSpotColor")||R.get("maxSpotColor")&&(A[a]===this.miny||A[a]===this.maxy))&&(P-=e.ceil(I))),E--,R.get("normalRangeMin")!==n&&!R.get("drawNormalOnTop")&&this.drawNormalRange(o,s,E,P,r),h=[],u=[h],m=v=null,x=A.length,F=0;x>F;F++)c=T[F],p=T[F+1],f=A[F],d=o+e.round((c-this.minx)*(P/t)),g=x-1>F?o+e.round((p-this.minx)*(P/t)):P,v=d+(g-d)/2,D[F]=[m||0,v,F],m=v,null===f?F&&(null!==A[F-1]&&(h=[],u.push(h)),z.push(null)):(f<this.miny&&(f=this.miny),f>this.maxy&&(f=this.maxy),h.length||h.push([d,s+E]),l=[d,s+e.round(E-E*((f-this.miny)/r))],h.push(l),z.push(l));for(b=[],w=[],M=u.length,F=0;M>F;F++)h=u[F],h.length&&(R.get("fillColor")&&(h.push([h[h.length-1][0],s+E]),w.push(h.slice(0)),h.pop()),h.length>2&&(h[0]=[h[0][0],h[1][1]]),b.push(h));for(M=w.length,F=0;M>F;F++)L.drawShape(w[F],R.get("fillColor"),R.get("fillColor")).append();for(R.get("normalRangeMin")!==n&&R.get("drawNormalOnTop")&&this.drawNormalRange(o,s,E,P,r),M=b.length,F=0;M>F;F++)L.drawShape(b[F],R.get("lineColor"),n,R.get("lineWidth")).append();if(I&&R.get("valueSpots"))for(S=R.get("valueSpots"),S.get===n&&(S=new y(S)),F=0;x>F;F++)C=S.get(A[F]),C&&L.drawCircle(o+e.round((T[F]-this.minx)*(P/t)),s+e.round(E-E*((A[F]-this.miny)/r)),I,n,C).append();I&&R.get("spotColor")&&null!==A[a]&&L.drawCircle(o+e.round((T[T.length-1]-this.minx)*(P/t)),s+e.round(E-E*((A[a]-this.miny)/r)),I,n,R.get("spotColor")).append(),this.maxy!==this.minyorg&&(I&&R.get("minSpotColor")&&(c=T[i.inArray(this.minyorg,A)],L.drawCircle(o+e.round((c-this.minx)*(P/t)),s+e.round(E-E*((this.minyorg-this.miny)/r)),I,n,R.get("minSpotColor")).append()),I&&R.get("maxSpotColor")&&(c=T[i.inArray(this.maxyorg,A)],L.drawCircle(o+e.round((c-this.minx)*(P/t)),s+e.round(E-E*((this.maxyorg-this.miny)/r)),I,n,R.get("maxSpotColor")).append())),this.lastShapeId=L.getLastShapeId(),this.canvasTop=s,L.render()}}}),i.fn.sparkline.bar=M=a(i.fn.sparkline._base,w,{type:"bar",init:function(t,r,a,s,l){var f,p,d,g,m,v,x,b,w,k,S,_,C,T,A,F,R,L,P,E,z,I,D=parseInt(a.get("barWidth"),10),B=parseInt(a.get("barSpacing"),10),H=a.get("chartRangeMin"),W=a.get("chartRangeMax"),N=a.get("chartRangeClip"),O=1/0,q=-1/0;for(M._super.init.call(this,t,r,a,s,l),v=0,x=r.length;x>v;v++)E=r[v],f="string"==typeof E&&E.indexOf(":")>-1,(f||i.isArray(E))&&(A=!0,f&&(E=r[v]=u(E.split(":"))),E=c(E,null),p=e.min.apply(e,E),d=e.max.apply(e,E),O>p&&(O=p),d>q&&(q=d));this.stacked=A,this.regionShapes={},this.barWidth=D,this.barSpacing=B,this.totalBarWidth=D+B,this.width=s=r.length*D+(r.length-1)*B,this.initTarget(),N&&(C=H===n?-1/0:H,T=W===n?1/0:W),m=[],g=A?[]:m;var j=[],Y=[];for(v=0,x=r.length;x>v;v++)if(A)for(F=r[v],r[v]=P=[],j[v]=0,g[v]=Y[v]=0,R=0,L=F.length;L>R;R++)E=P[R]=N?o(F[R],C,T):F[R],null!==E&&(E>0&&(j[v]+=E),0>O&&q>0?0>E?Y[v]+=e.abs(E):g[v]+=E:g[v]+=e.abs(E-(0>E?q:O)),m.push(E));else E=N?o(r[v],C,T):r[v],E=r[v]=h(E),null!==E&&m.push(E);this.max=_=e.max.apply(e,m),this.min=S=e.min.apply(e,m),this.stackMax=q=A?e.max.apply(e,j):_,this.stackMin=O=A?e.min.apply(e,m):S,a.get("chartRangeMin")!==n&&(a.get("chartRangeClip")||a.get("chartRangeMin")<S)&&(S=a.get("chartRangeMin")),a.get("chartRangeMax")!==n&&(a.get("chartRangeClip")||a.get("chartRangeMax")>_)&&(_=a.get("chartRangeMax")),this.zeroAxis=w=a.get("zeroAxis",!0),k=0>=S&&_>=0&&w?0:0==w?S:S>0?S:_,this.xaxisOffset=k,b=A?e.max.apply(e,g)+e.max.apply(e,Y):_-S,this.canvasHeightEf=w&&0>S?this.canvasHeight-2:this.canvasHeight-1,k>S?(I=A&&_>=0?q:_,z=(I-k)/b*this.canvasHeight,z!==e.ceil(z)&&(this.canvasHeightEf-=2,z=e.ceil(z))):z=this.canvasHeight,this.yoffset=z,i.isArray(a.get("colorMap"))?(this.colorMapByIndex=a.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=a.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new y(this.colorMapByValue))),this.range=b},getRegion:function(t,i){var r=e.floor(i/this.totalBarWidth);return 0>r||r>=this.values.length?n:r},getCurrentRegionFields:function(){var t,e,n=this.currentRegion,i=m(this.values[n]),r=[];for(e=i.length;e--;)t=i[e],r.push({isNull:null===t,value:t,color:this.calcColor(e,t,n),offset:n});return r},calcColor:function(t,e,r){var a,s,o=this.colorMapByIndex,l=this.colorMapByValue,h=this.options;return a=this.stacked?h.get("stackedBarColor"):0>e?h.get("negBarColor"):h.get("barColor"),0===e&&h.get("zeroColor")!==n&&(a=h.get("zeroColor")),l&&(s=l.get(e))?a=s:o&&o.length>r&&(a=o[r]),i.isArray(a)?a[t%a.length]:a},renderRegion:function(t,r){var a,s,o,l,h,u,c,f,d,g,m=this.values[t],v=this.options,y=this.xaxisOffset,x=[],b=this.range,w=this.stacked,k=this.target,M=t*this.totalBarWidth,S=this.canvasHeightEf,_=this.yoffset;if(m=i.isArray(m)?m:[m],c=m.length,f=m[0],l=p(null,m),g=p(y,m,!0),l)return v.get("nullColor")?(o=r?v.get("nullColor"):this.calcHighlightColor(v.get("nullColor"),v),a=_>0?_-1:_,k.drawRect(M,a,this.barWidth-1,0,o,o)):n;for(h=_,u=0;c>u;u++){if(f=m[u],w&&f===y){if(!g||d)continue;d=!0}s=b>0?e.floor(S*(e.abs(f-y)/b))+1:1,y>f||f===y&&0===_?(a=h,h+=s):(a=_-s,_-=s),o=this.calcColor(u,f,t),r&&(o=this.calcHighlightColor(o,v)),x.push(k.drawRect(M,a,this.barWidth-1,s-1,o,o))}return 1===x.length?x[0]:x}}),i.fn.sparkline.tristate=S=a(i.fn.sparkline._base,w,{type:"tristate",init:function(t,e,r,a,s){var o=parseInt(r.get("barWidth"),10),l=parseInt(r.get("barSpacing"),10);S._super.init.call(this,t,e,r,a,s),this.regionShapes={},this.barWidth=o,this.barSpacing=l,this.totalBarWidth=o+l,this.values=i.map(e,Number),this.width=a=e.length*o+(e.length-1)*l,i.isArray(r.get("colorMap"))?(this.colorMapByIndex=r.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=r.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new y(this.colorMapByValue))),this.initTarget()},getRegion:function(t,n){return e.floor(n/this.totalBarWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===n,value:this.values[t],color:this.calcColor(this.values[t],t),offset:t}},calcColor:function(t,e){var n,i,r=this.values,a=this.options,s=this.colorMapByIndex,o=this.colorMapByValue;return n=o&&(i=o.get(t))?i:s&&s.length>e?s[e]:r[e]<0?a.get("negBarColor"):r[e]>0?a.get("posBarColor"):a.get("zeroBarColor")},renderRegion:function(t,n){var i,r,a,s,o,l,h=this.values,u=this.options,c=this.target;return i=c.pixelHeight,a=e.round(i/2),s=t*this.totalBarWidth,h[t]<0?(o=a,r=a-1):h[t]>0?(o=0,r=a-1):(o=a-1,r=2),l=this.calcColor(h[t],t),null!==l?(n&&(l=this.calcHighlightColor(l,u)),c.drawRect(s,o,this.barWidth-1,r-1,l,l)):void 0}}),i.fn.sparkline.discrete=_=a(i.fn.sparkline._base,w,{type:"discrete",init:function(t,r,a,s,o){_._super.init.call(this,t,r,a,s,o),this.regionShapes={},this.values=r=i.map(r,Number),this.min=e.min.apply(e,r),this.max=e.max.apply(e,r),this.range=this.max-this.min,this.width=s="auto"===a.get("width")?2*r.length:this.width,this.interval=e.floor(s/r.length),this.itemWidth=s/r.length,a.get("chartRangeMin")!==n&&(a.get("chartRangeClip")||a.get("chartRangeMin")<this.min)&&(this.min=a.get("chartRangeMin")),a.get("chartRangeMax")!==n&&(a.get("chartRangeClip")||a.get("chartRangeMax")>this.max)&&(this.max=a.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight="auto"===a.get("lineHeight")?e.round(.3*this.canvasHeight):a.get("lineHeight"))},getRegion:function(t,n){return e.floor(n/this.itemWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===n,value:this.values[t],offset:t}},renderRegion:function(t,n){var i,r,a,s,l=this.values,h=this.options,u=this.min,c=this.max,f=this.range,p=this.interval,d=this.target,g=this.canvasHeight,m=this.lineHeight,v=g-m;return r=o(l[t],u,c),s=t*p,i=e.round(v-v*((r-u)/f)),a=h.get("thresholdColor")&&r<h.get("thresholdValue")?h.get("thresholdColor"):h.get("lineColor"),n&&(a=this.calcHighlightColor(a,h)),d.drawLine(s,i,s,i+m,a)}}),i.fn.sparkline.bullet=C=a(i.fn.sparkline._base,{type:"bullet",init:function(t,i,r,a,s){var o,l,h;C._super.init.call(this,t,i,r,a,s),this.values=i=u(i),h=i.slice(),h[0]=null===h[0]?h[2]:h[0],h[1]=null===i[1]?h[2]:h[1],o=e.min.apply(e,i),l=e.max.apply(e,i),o=r.get("base")===n?0>o?o:0:r.get("base"),this.min=o,this.max=l,this.range=l-o,this.shapes={},this.valueShapes={},this.regiondata={},this.width=a="auto"===r.get("width")?"4.0em":a,this.target=this.$el.simpledraw(a,s,r.get("composite")),i.length||(this.disabled=!0),this.initTarget()},getRegion:function(t,e,i){var r=this.target.getShapeAt(t,e,i);return r!==n&&this.shapes[r]!==n?this.shapes[r]:n},getCurrentRegionFields:function(){var t=this.currentRegion;return{fieldkey:t.substr(0,1),value:this.values[t.substr(1)],region:t}},changeHighlight:function(t){var e,n=this.currentRegion,i=this.valueShapes[n];switch(delete this.shapes[i],n.substr(0,1)){case"r":e=this.renderRange(n.substr(1),t);break;case"p":e=this.renderPerformance(t);break;case"t":e=this.renderTarget(t)}this.valueShapes[n]=e.id,this.shapes[e.id]=n,this.target.replaceWithShape(i,e)},renderRange:function(t,n){var i=this.values[t],r=e.round(this.canvasWidth*((i-this.min)/this.range)),a=this.options.get("rangeColors")[t-2];return n&&(a=this.calcHighlightColor(a,this.options)),this.target.drawRect(0,0,r-1,this.canvasHeight-1,a,a)},renderPerformance:function(t){var n=this.values[1],i=e.round(this.canvasWidth*((n-this.min)/this.range)),r=this.options.get("performanceColor");return t&&(r=this.calcHighlightColor(r,this.options)),this.target.drawRect(0,e.round(.3*this.canvasHeight),i-1,e.round(.4*this.canvasHeight)-1,r,r)},renderTarget:function(t){var n=this.values[0],i=e.round(this.canvasWidth*((n-this.min)/this.range)-this.options.get("targetWidth")/2),r=e.round(.1*this.canvasHeight),a=this.canvasHeight-2*r,s=this.options.get("targetColor");return t&&(s=this.calcHighlightColor(s,this.options)),this.target.drawRect(i,r,this.options.get("targetWidth")-1,a-1,s,s)},render:function(){var t,e,n=this.values.length,i=this.target;if(C._super.render.call(this)){for(t=2;n>t;t++)e=this.renderRange(t).append(),this.shapes[e.id]="r"+t,this.valueShapes["r"+t]=e.id;null!==this.values[1]&&(e=this.renderPerformance().append(),this.shapes[e.id]="p1",this.valueShapes.p1=e.id),null!==this.values[0]&&(e=this.renderTarget().append(),this.shapes[e.id]="t0",this.valueShapes.t0=e.id),i.render()}}}),i.fn.sparkline.pie=T=a(i.fn.sparkline._base,{type:"pie",init:function(t,n,r,a,s){var o,l=0;if(T._super.init.call(this,t,n,r,a,s),this.shapes={},this.valueShapes={},this.values=n=i.map(n,Number),"auto"===r.get("width")&&(this.width=this.height),n.length>0)for(o=n.length;o--;)l+=n[o];this.total=l,this.initTarget(),this.radius=e.floor(e.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(t,e,i){var r=this.target.getShapeAt(t,e,i);return r!==n&&this.shapes[r]!==n?this.shapes[r]:n},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===n,value:this.values[t],percent:this.values[t]/this.total*100,color:this.options.get("sliceColors")[t%this.options.get("sliceColors").length],offset:t}},changeHighlight:function(t){var e=this.currentRegion,n=this.renderSlice(e,t),i=this.valueShapes[e];delete this.shapes[i],this.target.replaceWithShape(i,n),this.valueShapes[e]=n.id,this.shapes[n.id]=e},renderSlice:function(t,i){var r,a,s,o,l,h=this.target,u=this.options,c=this.radius,f=u.get("borderWidth"),p=u.get("offset"),d=2*e.PI,g=this.values,m=this.total,v=p?2*e.PI*(p/360):0;for(o=g.length,s=0;o>s;s++){if(r=v,a=v,m>0&&(a=v+d*(g[s]/m)),t===s)return l=u.get("sliceColors")[s%u.get("sliceColors").length],i&&(l=this.calcHighlightColor(l,u)),h.drawPieSlice(c,c,c-f,r,a,n,l);v=a}},render:function(){var t,i,r=this.target,a=this.values,s=this.options,o=this.radius,l=s.get("borderWidth");if(T._super.render.call(this)){for(l&&r.drawCircle(o,o,e.floor(o-l/2),s.get("borderColor"),n,l).append(),i=a.length;i--;)a[i]&&(t=this.renderSlice(i).append(),this.valueShapes[i]=t.id,this.shapes[t.id]=i);r.render()}}}),i.fn.sparkline.box=A=a(i.fn.sparkline._base,{type:"box",init:function(t,e,n,r,a){A._super.init.call(this,t,e,n,r,a),this.values=i.map(e,Number),this.width="auto"===n.get("width")?"4.0em":r,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var t=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==n&&t.push({field:"lo",value:this.loutlier}),this.routlier!==n&&t.push({field:"ro",value:this.routlier}),this.lwhisker!==n&&t.push({field:"lw",value:this.lwhisker}),this.rwhisker!==n&&t.push({field:"rw",value:this.rwhisker}),t},render:function(){var t,i,r,a,s,o,h,u,c,f,p,d=this.target,g=this.values,m=g.length,v=this.options,y=this.canvasWidth,x=this.canvasHeight,b=v.get("chartRangeMin")===n?e.min.apply(e,g):v.get("chartRangeMin"),w=v.get("chartRangeMax")===n?e.max.apply(e,g):v.get("chartRangeMax"),k=0;if(A._super.render.call(this)){if(v.get("raw"))v.get("showOutliers")&&g.length>5?(i=g[0],t=g[1],a=g[2],s=g[3],o=g[4],h=g[5],u=g[6]):(t=g[0],a=g[1],s=g[2],o=g[3],h=g[4]);else if(g.sort(function(t,e){return t-e}),a=l(g,1),s=l(g,2),o=l(g,3),r=o-a,v.get("showOutliers")){for(t=h=n,c=0;m>c;c++)t===n&&g[c]>a-r*v.get("outlierIQR")&&(t=g[c]),g[c]<o+r*v.get("outlierIQR")&&(h=g[c]);i=g[0],u=g[m-1]}else t=g[0],h=g[m-1];this.quartiles=[a,s,o],this.lwhisker=t,this.rwhisker=h,this.loutlier=i,this.routlier=u,p=y/(w-b+1),v.get("showOutliers")&&(k=e.ceil(v.get("spotRadius")),y-=2*e.ceil(v.get("spotRadius")),p=y/(w-b+1),t>i&&d.drawCircle((i-b)*p+k,x/2,v.get("spotRadius"),v.get("outlierLineColor"),v.get("outlierFillColor")).append(),u>h&&d.drawCircle((u-b)*p+k,x/2,v.get("spotRadius"),v.get("outlierLineColor"),v.get("outlierFillColor")).append()),d.drawRect(e.round((a-b)*p+k),e.round(.1*x),e.round((o-a)*p),e.round(.8*x),v.get("boxLineColor"),v.get("boxFillColor")).append(),d.drawLine(e.round((t-b)*p+k),e.round(x/2),e.round((a-b)*p+k),e.round(x/2),v.get("lineColor")).append(),d.drawLine(e.round((t-b)*p+k),e.round(x/4),e.round((t-b)*p+k),e.round(x-x/4),v.get("whiskerColor")).append(),d.drawLine(e.round((h-b)*p+k),e.round(x/2),e.round((o-b)*p+k),e.round(x/2),v.get("lineColor")).append(),d.drawLine(e.round((h-b)*p+k),e.round(x/4),e.round((h-b)*p+k),e.round(x-x/4),v.get("whiskerColor")).append(),d.drawLine(e.round((s-b)*p+k),e.round(.1*x),e.round((s-b)*p+k),e.round(.9*x),v.get("medianColor")).append(),v.get("target")&&(f=e.ceil(v.get("spotRadius")),d.drawLine(e.round((v.get("target")-b)*p+k),e.round(x/2-f),e.round((v.get("target")-b)*p+k),e.round(x/2+f),v.get("targetColor")).append(),d.drawLine(e.round((v.get("target")-b)*p+k-f),e.round(x/2),e.round((v.get("target")-b)*p+k+f),e.round(x/2),v.get("targetColor")).append()),d.render()}}}),L=a({init:function(t,e,n,i){this.target=t,this.id=e,this.type=n,this.args=i},append:function(){return this.target.appendShape(this),this}}),P=a({_pxregex:/(\d+)(px)?\s*$/i,init:function(t,e,n){t&&(this.width=t,this.height=e,this.target=n,this.lastShapeId=null,n[0]&&(n=n[0]),i.data(n,"_jqs_vcanvas",this))},drawLine:function(t,e,n,i,r,a){return this.drawShape([[t,e],[n,i]],r,a)},drawShape:function(t,e,n,i){return this._genShape("Shape",[t,e,n,i])},drawCircle:function(t,e,n,i,r,a){return this._genShape("Circle",[t,e,n,i,r,a])},drawPieSlice:function(t,e,n,i,r,a,s){return this._genShape("PieSlice",[t,e,n,i,r,a,s])},drawRect:function(t,e,n,i,r,a){return this._genShape("Rect",[t,e,n,i,r,a])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(t,e){i(e).html(t)},_calculatePixelDims:function(t,e,n){var r;r=this._pxregex.exec(e),this.pixelHeight=r?r[1]:i(n).height(),r=this._pxregex.exec(t),this.pixelWidth=r?r[1]:i(n).width()},_genShape:function(t,e){var n=B++;return e.unshift(n),new L(this,n,t,e)},appendShape:function(){alert("appendShape not implemented")},replaceWithShape:function(){alert("replaceWithShape not implemented")},insertAfterShape:function(){alert("insertAfterShape not implemented")},removeShapeId:function(){alert("removeShapeId not implemented")},getShapeAt:function(){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),E=a(P,{init:function(e,r,a,s){E._super.init.call(this,e,r,a),this.canvas=t.createElement("canvas"),a[0]&&(a=a[0]),i.data(a,"_jqs_vcanvas",this),i(this.canvas).css({display:"inline-block",width:e,height:r,verticalAlign:"top"}),this._insert(this.canvas,a),this._calculatePixelDims(e,r,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=s,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n,i(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(t,e,i){var r=this.canvas.getContext("2d");return t!==n&&(r.strokeStyle=t),r.lineWidth=i===n?1:i,e!==n&&(r.fillStyle=e),r},reset:function(){var t=this._getContext();t.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n},_drawShape:function(t,e,i,r,a){var s,o,l=this._getContext(i,r,a);for(l.beginPath(),l.moveTo(e[0][0]+.5,e[0][1]+.5),s=1,o=e.length;o>s;s++)l.lineTo(e[s][0]+.5,e[s][1]+.5);i!==n&&l.stroke(),r!==n&&l.fill(),this.targetX!==n&&this.targetY!==n&&l.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawCircle:function(t,i,r,a,s,o,l){var h=this._getContext(s,o,l);h.beginPath(),h.arc(i,r,a,0,2*e.PI,!1),this.targetX!==n&&this.targetY!==n&&h.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t),s!==n&&h.stroke(),o!==n&&h.fill()},_drawPieSlice:function(t,e,i,r,a,s,o,l){var h=this._getContext(o,l);h.beginPath(),h.moveTo(e,i),h.arc(e,i,r,a,s,!1),h.lineTo(e,i),h.closePath(),o!==n&&h.stroke(),l&&h.fill(),this.targetX!==n&&this.targetY!==n&&h.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawRect:function(t,e,n,i,r,a,s){return this._drawShape(t,[[e,n],[e+i,n],[e+i,n+r],[e,n+r],[e,n]],a,s)},appendShape:function(t){return this.shapes[t.id]=t,this.shapeseq.push(t.id),this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var n,i=this.shapeseq;for(this.shapes[e.id]=e,n=i.length;n--;)i[n]==t&&(i[n]=e.id);delete this.shapes[t]},replaceWithShapes:function(t,e){var n,i,r,a=this.shapeseq,s={};for(i=t.length;i--;)s[t[i]]=!0;for(i=a.length;i--;)n=a[i],s[n]&&(a.splice(i,1),delete this.shapes[n],r=i);for(i=e.length;i--;)a.splice(r,0,e[i].id),this.shapes[e[i].id]=e[i]},insertAfterShape:function(t,e){var n,i=this.shapeseq;for(n=i.length;n--;)if(i[n]===t)return i.splice(n+1,0,e.id),this.shapes[e.id]=e,void 0},removeShapeId:function(t){var e,n=this.shapeseq;for(e=n.length;e--;)if(n[e]===t){n.splice(e,1);break}delete this.shapes[t]},getShapeAt:function(t,e,n){return this.targetX=e,this.targetY=n,this.render(),this.currentTargetShapeId},render:function(){var t,e,n,i=this.shapeseq,r=this.shapes,a=i.length,s=this._getContext();for(s.clearRect(0,0,this.pixelWidth,this.pixelHeight),n=0;a>n;n++)t=i[n],e=r[t],this["_draw"+e.type].apply(this,e.args);this.interact||(this.shapes={},this.shapeseq=[])}}),z=a(P,{init:function(e,n,r){var a;z._super.init.call(this,e,n,r),r[0]&&(r=r[0]),i.data(r,"_jqs_vcanvas",this),this.canvas=t.createElement("span"),i(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:e,height:n,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,r),this._calculatePixelDims(e,n,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,a='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",a),this.group=i(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(t,e,i,r,a){var s,o,l,h,u,c,f,p=[];for(f=0,c=e.length;c>f;f++)p[f]=""+e[f][0]+","+e[f][1];return s=p.splice(0,1),a=a===n?1:a,o=i===n?' stroked="false" ':' strokeWeight="'+a+'px" strokeColor="'+i+'" ',l=r===n?' filled="false"':' fillColor="'+r+'" filled="true" ',h=p[0]===p[p.length-1]?"x ":"",u='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'"  id="jqsshape'+t+'" '+o+l+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;"  path="m '+s+" l "+p.join(", ")+" "+h+'e"> </v:shape>'},_drawCircle:function(t,e,i,r,a,s,o){var l,h,u;return e-=r,i-=r,l=a===n?' stroked="false" ':' strokeWeight="'+o+'px" strokeColor="'+a+'" ',h=s===n?' filled="false"':' fillColor="'+s+'" filled="true" ',u='<v:oval  id="jqsshape'+t+'" '+l+h+' style="position:absolute;top:'+i+"px; left:"+e+"px; width:"+2*r+"px; height:"+2*r+'px"></v:oval>'},_drawPieSlice:function(t,i,r,a,s,o,l,h){var u,c,f,p,d,g,m,v;if(s===o)return"";if(o-s===2*e.PI&&(s=0,o=2*e.PI),c=i+e.round(e.cos(s)*a),f=r+e.round(e.sin(s)*a),p=i+e.round(e.cos(o)*a),d=r+e.round(e.sin(o)*a),c===p&&f===d){if(o-s<e.PI)return"";c=p=i+a,f=d=r}return c===p&&f===d&&o-s<e.PI?"":(u=[i-a,r-a,i+a,r+a,c,f,p,d],g=l===n?' stroked="false" ':' strokeWeight="1px" strokeColor="'+l+'" ',m=h===n?' filled="false"':' fillColor="'+h+'" filled="true" ',v='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'"  id="jqsshape'+t+'" '+g+m+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;"  path="m '+i+","+r+" wa "+u.join(", ")+' x e"> </v:shape>')
  },_drawRect:function(t,e,n,i,r,a,s){return this._drawShape(t,[[e,n],[e,n+r],[e+i,n+r],[e+i,n],[e,n]],a,s)},reset:function(){this.group.innerHTML=""},appendShape:function(t){var e=this["_draw"+t.type].apply(this,t.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",e):this.prerender+=e,this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var n=i("#jqsshape"+t),r=this["_draw"+e.type].apply(this,e.args);n[0].outerHTML=r},replaceWithShapes:function(t,e){var n,r=i("#jqsshape"+t[0]),a="",s=e.length;for(n=0;s>n;n++)a+=this["_draw"+e[n].type].apply(this,e[n].args);for(r[0].outerHTML=a,n=1;n<t.length;n++)i("#jqsshape"+t[n]).remove()},insertAfterShape:function(t,e){var n=i("#jqsshape"+t),r=this["_draw"+e.type].apply(this,e.args);n[0].insertAdjacentHTML("afterEnd",r)},removeShapeId:function(t){var e=i("#jqsshape"+t);this.group.removeChild(e[0])},getShapeAt:function(t){var e=t.id.substr(8);return e},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})}(document,Math),function(){"use strict";var t=this,e=t.Chart,n=function(t){return this.canvas=t.canvas,this.ctx=t,this.width=t.canvas.width,this.height=t.canvas.height,this.aspectRatio=this.width/this.height,i.retinaScale(this),this};n.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},n.types={};var i=n.helpers={},r=i.each=function(t,e,n){var i=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var r;for(r=0;r<t.length;r++)e.apply(n,[t[r],r].concat(i))}else for(var a in t)e.apply(n,[t[a],a].concat(i))},a=i.clone=function(t){var e={};return r(t,function(n,i){t.hasOwnProperty(i)&&(e[i]=n)}),e},s=i.extend=function(t){return r(Array.prototype.slice.call(arguments,1),function(e){r(e,function(n,i){e.hasOwnProperty(i)&&(t[i]=n)})}),t},o=i.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),s.apply(null,t)},l=i.indexOf=function(t,e){if(Array.prototype.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1},h=(i.where=function(t,e){var n=[];return i.each(t,function(t){e(t)&&n.push(t)}),n},i.findNextWhere=function(t,e,n){n||(n=-1);for(var i=n+1;i<t.length;i++){var r=t[i];if(e(r))return r}},i.findPreviousWhere=function(t,e,n){n||(n=t.length);for(var i=n-1;i>=0;i--){var r=t[i];if(e(r))return r}},i.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=h,t&&s(n.prototype,t),n.__super__=e.prototype,n}),u=i.noop=function(){},c=i.uid=function(){var t=0;return function(){return"chart-"+t++}}(),f=i.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=i.amd="function"==typeof t.define&&t.define.amd,d=i.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=i.max=function(t){return Math.max.apply(Math,t)},m=i.min=function(t){return Math.min.apply(Math,t)},v=(i.cap=function(t,e,n){if(d(e)){if(t>e)return e}else if(d(n)&&n>t)return n;return t},i.getDecimalPlaces=function(t){return t%1!==0&&d(t)?t.toString().split(".")[1].length:0}),y=i.radians=function(t){return t*(Math.PI/180)},x=(i.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i),a=2*Math.PI+Math.atan2(i,n);return 0>n&&0>i&&(a+=2*Math.PI),{angle:a,distance:r}},i.aliasPixel=function(t){return t%2===0?0:.5}),b=(i.splineCurve=function(t,e,n,i){var r=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),a=Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2)),s=i*r/(r+a),o=i*a/(r+a);return{inner:{x:e.x-s*(n.x-t.x),y:e.y-s*(n.y-t.y)},outer:{x:e.x+o*(n.x-t.x),y:e.y+o*(n.y-t.y)}}},i.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),w=(i.calculateScaleRange=function(t,e,n,i,r){var a=2,s=Math.floor(e/(1.5*n)),o=a>=s,l=g(t),h=m(t);l===h&&(l+=.5,h>=.5&&!i?h-=.5:l+=.5);for(var u=Math.abs(l-h),c=b(u),f=Math.ceil(l/(1*Math.pow(10,c)))*Math.pow(10,c),p=i?0:Math.floor(h/(1*Math.pow(10,c)))*Math.pow(10,c),d=f-p,v=Math.pow(10,c),y=Math.round(d/v);(y>s||s>2*y)&&!o;)if(y>s)v*=2,y=Math.round(d/v),y%1!==0&&(o=!0);else if(r&&c>=0){if(v/2%1!==0)break;v/=2,y=Math.round(d/v)}else v/=2,y=Math.round(d/v);return o&&(y=a,v=d/y),{steps:y,stepValue:v,min:p,max:p+y*v}},i.template=function(t,e){function n(t,e){var n=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join("	").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("	").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):i[t]=i[t];return e?n(e):n}if(t instanceof Function)return t(e);var i={};return n(t,e)}),k=(i.generateLabels=function(t,e,n,i){var a=new Array(e);return labelTemplateString&&r(a,function(e,r){a[r]=w(t,{value:n+i*(r+1)})}),a},i.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1==(t/=1)?1:(n||(n=.3),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/n)))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1==(t/=1)?1:(n||(n=.3),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin(2*(1*t-e)*Math.PI/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.3*1.5),i<Math.abs(1)?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),1>t?-.5*i*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/n):i*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-e)*Math.PI/n)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*t*t*(((e*=1.525)+1)*t-e):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-k.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*k.easeInBounce(2*t):.5*k.easeOutBounce(2*t-1)+.5}}),M=i.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),S=(i.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),i.animationLoop=function(t,e,n,i,r,a){var s=0,o=k[n]||k.linear,l=function(){s++;var n=s/e,h=o(n);t.call(a,h,n,s),i.call(a,h,n),e>s?a.animationFrame=M(l):r.apply(a)};M(l)},i.getRelativePosition=function(t){var e,n,i=t.originalEvent||t,r=t.currentTarget||t.srcElement,a=r.getBoundingClientRect();return i.touches?(e=i.touches[0].clientX-a.left,n=i.touches[0].clientY-a.top):(e=i.clientX-a.left,n=i.clientY-a.top),{x:e,y:n}},i.addEvent=function(t,e,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}),_=i.removeEvent=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=u},C=(i.bindEvents=function(t,e,n){t.events||(t.events={}),r(e,function(e){t.events[e]=function(){n.apply(t,arguments)},S(t.chart.canvas,e,t.events[e])})},i.unbindEvents=function(t,e){r(e,function(e,n){_(t.chart.canvas,n,e)})}),T=i.getMaximumWidth=function(t){var e=t.parentNode;return e.clientWidth},A=i.getMaximumHeight=function(t){var e=t.parentNode;return e.clientHeight},F=(i.getMaximumSize=i.getMaximumWidth,i.retinaScale=function(t){var e=t.ctx,n=t.canvas.width,i=t.canvas.height;window.devicePixelRatio&&(e.canvas.style.width=n+"px",e.canvas.style.height=i+"px",e.canvas.height=i*window.devicePixelRatio,e.canvas.width=n*window.devicePixelRatio,e.scale(window.devicePixelRatio,window.devicePixelRatio))}),R=i.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},L=i.fontString=function(t,e,n){return e+" "+t+"px "+n},P=i.longestText=function(t,e,n){t.font=e;var i=0;return r(n,function(e){var n=t.measureText(e).width;i=n>i?n:i}),i},E=i.drawRoundedRectangle=function(t,e,n,i,r,a){t.beginPath(),t.moveTo(e+a,n),t.lineTo(e+i-a,n),t.quadraticCurveTo(e+i,n,e+i,n+a),t.lineTo(e+i,n+r-a),t.quadraticCurveTo(e+i,n+r,e+i-a,n+r),t.lineTo(e+a,n+r),t.quadraticCurveTo(e,n+r,e,n+r-a),t.lineTo(e,n+a),t.quadraticCurveTo(e,n,e+a,n),t.closePath()};n.instances={},n.Type=function(t,e,i){this.options=e,this.chart=i,this.id=c(),n.instances[this.id]=this,e.responsive&&this.resize(),this.initialize.call(this,t)},s(n.Type.prototype,{initialize:function(){return this},clear:function(){return R(this.chart),this},stop:function(){return i.cancelAnimFrame.call(t,this.animationFrame),this},resize:function(t){this.stop();var e=this.chart.canvas,n=T(this.chart.canvas),i=this.options.maintainAspectRatio?n/this.chart.aspectRatio:A(this.chart.canvas);return e.width=this.chart.width=n,e.height=this.chart.height=i,F(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:u,render:function(t){return t&&this.reflow(),this.options.animation&&!t?i.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return w(this.options.legendTemplate,this)},destroy:function(){this.clear(),C(this,this.events),delete n.instances[this.id]},showTooltip:function(t,e){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var a=function(t){var e=!1;return t.length!==this.activeElements.length?e=!0:(r(t,function(t,n){t!==this.activeElements[n]&&(e=!0)},this),e)}.call(this,t);if(a||e){if(this.activeElements=t,this.draw(),t.length>0)if(this.datasets&&this.datasets.length>1){for(var s,o,h=this.datasets.length-1;h>=0&&(s=this.datasets[h].points||this.datasets[h].bars||this.datasets[h].segments,o=l(s,t[0]),-1===o);h--);var u=[],c=[],f=function(){var t,e,n,r,a,s=[],l=[],h=[];return i.each(this.datasets,function(e){t=e.points||e.bars||e.segments,t[o]&&t[o].hasValue()&&s.push(t[o])}),i.each(s,function(t){l.push(t.x),h.push(t.y),u.push(i.template(this.options.multiTooltipTemplate,t)),c.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),a=m(h),n=g(h),r=m(l),e=g(l),{x:r>this.chart.width/2?r:e,y:(a+n)/2}}.call(this,o);new n.MultiTooltip({x:f.x,y:f.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:u,legendColors:c,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx}).draw()}else r(t,function(t){var e=t.tooltipPosition();new n.Tooltip({x:Math.round(e.x),y:Math.round(e.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:w(this.options.tooltipTemplate,t),chart:this.chart}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),n.Type.extend=function(t){var e=this,i=function(){return e.apply(this,arguments)};if(i.prototype=a(e.prototype),s(i.prototype,t),i.extend=n.Type.extend,t.name||e.prototype.name){var r=t.name||e.prototype.name,l=n.defaults[e.prototype.name]?a(n.defaults[e.prototype.name]):{};n.defaults[r]=s(l,t.defaults),n.types[r]=i,n.prototype[r]=function(t,e){var a=o(n.defaults.global,n.defaults[r],e||{});return new i(t,a,this)}}else f("Name not provided for this chart, so it hasn't been registered");return e},n.Element=function(t){s(this,t),this.initialize.apply(this,arguments),this.save()},s(n.Element.prototype,{initialize:function(){},restore:function(t){return t?r(t,function(t){this[t]=this._saved[t]},this):s(this,this._saved),this},save:function(){return this._saved=a(this),delete this._saved._saved,this},update:function(t){return r(t,function(t,e){this._saved[e]=this[e],this[e]=t},this),this},transition:function(t,e){return r(t,function(t,n){this[n]=(t-this._saved[n])*e+this._saved[n]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return d(this.value)}}),n.Element.extend=h,n.Point=n.Element.extend({display:!0,inRange:function(t,e){var n=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(e-this.y,2)<Math.pow(n,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),n.Arc=n.Element.extend({inRange:function(t,e){var n=i.getAngleFromPoint(this,{x:t,y:e}),r=n.angle>=this.startAngle&&n.angle<=this.endAngle,a=n.distance>=this.innerRadius&&n.distance<=this.outerRadius;return r&&a},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,e=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*e,y:this.y+Math.sin(t)*e}},draw:function(){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),t.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.lineJoin="bevel",this.showStroke&&t.stroke()}}),n.Rectangle=n.Element.extend({draw:function(){var t=this.ctx,e=this.width/2,n=this.x-e,i=this.x+e,r=this.base-(this.base-this.y),a=this.strokeWidth/2;this.showStroke&&(n+=a,i-=a,r+=a),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(n,this.base),t.lineTo(n,r),t.lineTo(i,r),t.lineTo(i,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,e){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&e>=this.y&&e<=this.base}}),n.Tooltip=n.Element.extend({draw:function(){var t=this.chart.ctx;t.font=L(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var e=2,n=t.measureText(this.text).width+2*this.xPadding,i=this.fontSize+2*this.yPadding,r=i+this.caretHeight+e;this.x+n/2>this.chart.width?this.xAlign="left":this.x-n/2<0&&(this.xAlign="right"),this.y-r<0&&(this.yAlign="below");var a=this.x-n/2,s=this.y-r;switch(t.fillStyle=this.fillColor,this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-e),t.lineTo(this.x+this.caretHeight,this.y-(e+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(e+this.caretHeight)),t.closePath(),t.fill();break;case"below":s=this.y+e+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+e),t.lineTo(this.x+this.caretHeight,this.y+e+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+e+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":a=this.x-n+(this.cornerRadius+this.caretHeight);break;case"right":a=this.x-(this.cornerRadius+this.caretHeight)}E(t,a,s,n,i,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,a+n/2,s+i/2)}}),n.MultiTooltip=n.Element.extend({initialize:function(){this.font=L(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=L(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,e=P(this.ctx,this.font,this.labels)+this.fontSize+3,n=g([e,t]);this.width=n+2*this.xPadding;var i=this.height/2;this.y-i<0?this.y=i:this.y+i>this.chart.height&&(this.y=this.chart.height-i),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var e=this.y-this.height/2+this.yPadding,n=t-1;return 0===t?e+this.titleFontSize/2:e+(1.5*this.fontSize*n+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){E(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,i.each(this.labels,function(e,n){t.fillStyle=this.textColor,t.fillText(e,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(n+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(n+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[n].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(n+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}),n.Scale=n.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(w(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?P(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,e=this.endPoint-this.startPoint;for(this.calculateYRange(e),this.buildYLabels(),this.calculateXLabelRotation();e>this.endPoint-this.startPoint;)e=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(e),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,e,n=this.ctx.measureText(this.xLabels[0]).width,i=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=i/2+3,this.xScalePaddingLeft=n/2>this.yLabelWidth+10?n/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var r,a=P(this.ctx,this.font,this.xLabels);this.xLabelWidth=a;for(var s=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>s&&0===this.xLabelRotation||this.xLabelWidth>s&&this.xLabelRotation<=90&&this.xLabelRotation>0;)r=Math.cos(y(this.xLabelRotation)),t=r*n,e=r*i,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=r*a;this.xLabelRotation>0&&(this.endPoint-=Math.sin(y(this.xLabelRotation))*a+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:u,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var e=this.drawingArea()/(this.min-this.max);return this.endPoint-e*(t-this.min)},calculateX:function(t){var e=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),n=e/(this.valuesCount-(this.offsetGridLines?0:1)),i=n*t+this.xScalePaddingLeft;return this.offsetGridLines&&(i+=n/2),Math.round(i)},update:function(t){i.extend(this,t),this.fit()},draw:function(){var t=this.ctx,e=(this.endPoint-this.startPoint)/this.steps,n=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,r(this.yLabels,function(r,a){var s=this.endPoint-e*a,o=Math.round(s);t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(r,n-10,s),t.beginPath(),a>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),o+=i.aliasPixel(t.lineWidth),t.moveTo(n,o),t.lineTo(this.width,o),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n-5,o),t.lineTo(n,o),t.stroke(),t.closePath()},this),r(this.xLabels,function(e,n){var i=this.calculateX(n)+x(this.lineWidth),r=this.calculateX(n-(this.offsetGridLines?.5:0))+x(this.lineWidth),a=this.xLabelRotation>0;t.beginPath(),n>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),t.moveTo(r,this.endPoint),t.lineTo(r,this.startPoint-3),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(r,this.endPoint),t.lineTo(r,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(i,a?this.endPoint+12:this.endPoint+8),t.rotate(-1*y(this.xLabelRotation)),t.font=this.font,t.textAlign=a?"right":"center",t.textBaseline=a?"middle":"top",t.fillText(e,0,0),t.restore()},this))}}),n.RadialScale=n.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var e=this.drawingArea/(this.max-this.min);return(t-this.min)*e},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),e=0;e<=this.steps;e++)this.yLabels.push(w(this.templateString,{value:(this.min+e*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,e,n,i,r,a,s,o,l,h,u,c,f=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=L(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),e=0;e<this.valuesCount;e++)t=this.getPointPosition(e,f),n=this.ctx.measureText(w(this.templateString,{value:this.labels[e]})).width+5,0===e||e===this.valuesCount/2?(i=n/2,t.x+i>p&&(p=t.x+i,r=e),t.x-i<g&&(g=t.x-i,s=e)):e<this.valuesCount/2?t.x+n>p&&(p=t.x+n,r=e):e>this.valuesCount/2&&t.x-n<g&&(g=t.x-n,s=e);l=g,h=Math.ceil(p-this.width),a=this.getIndexAngle(r),o=this.getIndexAngle(s),u=h/Math.sin(a+Math.PI/2),c=l/Math.sin(o+Math.PI/2),u=d(u)?u:0,c=d(c)?c:0,this.drawingArea=f-(c+u)/2,this.setCenterPoint(c,u)},setCenterPoint:function(t,e){var n=this.width-e-this.drawingArea,i=t+this.drawingArea;this.xCenter=(i+n)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var e=2*Math.PI/this.valuesCount;return t*e-Math.PI/2},getPointPosition:function(t,e){var n=this.getIndexAngle(t);return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(r(this.yLabels,function(e,n){if(n>0){var i,r=n*(this.drawingArea/this.steps),a=this.yCenter-r;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,r,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var s=0;s<this.valuesCount;s++)i=this.getPointPosition(s,this.calculateCenterOffset(this.min+n*this.stepValue)),0===s?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=L(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var o=t.measureText(e).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-o/2-this.backdropPaddingX,a-this.fontSize/2-this.backdropPaddingY,o+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(e,this.xCenter,a)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var e=this.valuesCount-1;e>=0;e--){if(this.angleLineWidth>0){var n=this.getPointPosition(e,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(n.x,n.y),t.stroke(),t.closePath()}var i=this.getPointPosition(e,this.calculateCenterOffset(this.max)+5);t.font=L(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var a=this.labels.length,s=this.labels.length/2,o=s/2,l=o>e||e>a-o,h=e===o||e===a-o;t.textAlign=0===e?"center":e===s?"center":s>e?"left":"right",t.textBaseline=h?"middle":l?"bottom":"top",t.fillText(this.labels[e],i.x,i.y)}}}}}),i.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){r(n.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return n}):"object"==typeof module&&module.exports&&(module.exports=n),t.Chart=n,n.noConflict=function(){return t.Chart=e,n}}.call(this),function(){"use strict";var t=this,e=t.Chart,n=e.helpers,i={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};e.Type.extend({name:"Bar",defaults:i,initialize:function(t){var i=this.options;this.ScaleClass=e.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,e,n){var r=this.calculateBaseWidth(),a=this.calculateX(n)-r/2,s=this.calculateBarWidth(t);return a+s*e+e*i.barDatasetSpacing+s/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*i.barValueSpacing},calculateBarWidth:function(t){var e=this.calculateBaseWidth()-(t-1)*i.barDatasetSpacing;return e/t}}),this.datasets=[],this.options.showTooltips&&n.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),n.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),this.BarClass=e.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),n.each(t.datasets,function(e){var i={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,bars:[]};this.datasets.push(i),n.each(e.data,function(n,r){i.bars.push(new this.BarClass({value:n,label:t.labels[r],datasetLabel:e.label,strokeColor:e.strokeColor,fillColor:e.fillColor,highlightFill:e.highlightFill||e.fillColor,highlightStroke:e.highlightStroke||e.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,e,i){n.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,i,e),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),n.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){n.each(this.datasets,function(e,i){n.each(e.bars,t,this,i)},this)},getBarsAtEvent:function(t){for(var e,i=[],r=n.getRelativePosition(t),a=function(t){i.push(t.bars[e])},s=0;s<this.datasets.length;s++)for(e=0;e<this.datasets[s].bars.length;e++)if(this.datasets[s].bars[e].inRange(r.x,r.y))return n.each(this.datasets,a),i;return i},buildScale:function(t){var e=this,i=function(){var t=[];return e.eachBars(function(e){t.push(e.value)}),t},r={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var e=n.calculateScaleRange(i(),t,this.fontSize,this.beginAtZero,this.integersOnly);n.extend(this,e)},xLabels:t,font:n.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&n.extend(r,{calculateYRange:n.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(r)},addData:function(t,e){n.each(t,function(t,n){this.datasets[n].bars.push(new this.BarClass({value:t,label:e,x:this.scale.calculateBarX(this.datasets.length,n,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[n].strokeColor,fillColor:this.datasets[n].fillColor}))},this),this.scale.addXLabel(e),this.update()},removeData:function(){this.scale.removeXLabel(),n.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){n.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=n.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var e=t||1;this.clear(),this.chart.ctx,this.scale.draw(e),n.each(this.datasets,function(t,i){n.each(t.bars,function(t,n){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,i,n),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},e).draw())
  },this)},this)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,n=e.helpers,i={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};e.Type.extend({name:"Doughnut",defaults:i,initialize:function(t){this.segments=[],this.outerRadius=(n.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=e.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&n.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];n.each(this.segments,function(t){t.restore(["fillColor"])}),n.each(e,function(t){t.fillColor=t.highlightColor}),this.showTooltip(e)}),this.calculateTotal(t),n.each(t,function(t,e){this.addData(t,e,!0)},this),this.render()},getSegmentsAtEvent:function(t){var e=[],i=n.getRelativePosition(t);return n.each(this.segments,function(t){t.inRange(i.x,i.y)&&e.push(t)},this),e},addData:function(t,e,n){var i=e||this.segments.length;this.segments.splice(i,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),n||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(t/this.total)},calculateTotal:function(t){this.total=0,n.each(t,function(t){this.total+=t.value},this)},update:function(){this.calculateTotal(this.segments),n.each(this.activeElements,function(t){t.restore(["fillColor"])}),n.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var e=n.isNumber(t)?t:this.segments.length-1;this.segments.splice(e,1),this.reflow(),this.update()},reflow:function(){n.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(n.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,n.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var e=t?t:1;this.clear(),n.each(this.segments,function(t,n){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},e),t.endAngle=t.startAngle+t.circumference,t.draw(),0===n&&(t.startAngle=1.5*Math.PI),n<this.segments.length-1&&(this.segments[n+1].startAngle=t.endAngle)},this)}}),e.types.Doughnut.extend({name:"Pie",defaults:n.merge(i,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,e=t.Chart,n=e.helpers,i={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};e.Type.extend({name:"Line",defaults:i,initialize:function(t){this.PointClass=e.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&n.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),n.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),n.each(t.datasets,function(e){var i={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,pointColor:e.pointColor,pointStrokeColor:e.pointStrokeColor,points:[]};this.datasets.push(i),n.each(e.data,function(n,r){i.points.push(new this.PointClass({value:n,label:t.labels[r],datasetLabel:e.label,strokeColor:e.pointStrokeColor,fillColor:e.pointColor,highlightFill:e.pointHighlightFill||e.pointColor,highlightStroke:e.pointHighlightStroke||e.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,e){n.extend(t,{x:this.scale.calculateX(e),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),n.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){n.each(this.datasets,function(e){n.each(e.points,t,this)},this)},getPointsAtEvent:function(t){var e=[],i=n.getRelativePosition(t);return n.each(this.datasets,function(t){n.each(t.points,function(t){t.inRange(i.x,i.y)&&e.push(t)})},this),e},buildScale:function(t){var i=this,r=function(){var t=[];return i.eachPoints(function(e){t.push(e.value)}),t},a={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var e=n.calculateScaleRange(r(),t,this.fontSize,this.beginAtZero,this.integersOnly);n.extend(this,e)},xLabels:t,font:n.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&n.extend(a,{calculateYRange:n.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new e.Scale(a)},addData:function(t,e){n.each(t,function(t,n){this.datasets[n].points.push(new this.PointClass({value:t,label:e,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[n].pointStrokeColor,fillColor:this.datasets[n].pointColor}))},this),this.scale.addXLabel(e),this.update()},removeData:function(){this.scale.removeXLabel(),n.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=n.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var e=t||1;this.clear();var i=this.chart.ctx,r=function(t){return null!==t.value},a=function(t,e,i){return n.findNextWhere(e,r,i)||t},s=function(t,e,i){return n.findPreviousWhere(e,r,i)||t};this.scale.draw(e),n.each(this.datasets,function(t){var o=n.where(t.points,r);n.each(t.points,function(t,n){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(n)},e)},this),this.options.bezierCurve&&n.each(o,function(t,e){var i=e>0&&e<o.length-1?this.options.bezierCurveTension:0;t.controlPoints=n.splineCurve(s(t,o,e),t,a(t,o,e),i),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),i.lineWidth=this.options.datasetStrokeWidth,i.strokeStyle=t.strokeColor,i.beginPath(),n.each(o,function(t,e){if(0===e)i.moveTo(t.x,t.y);else if(this.options.bezierCurve){var n=s(t,o,e);i.bezierCurveTo(n.controlPoints.outer.x,n.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else i.lineTo(t.x,t.y)},this),i.stroke(),this.options.datasetFill&&o.length>0&&(i.lineTo(o[o.length-1].x,this.scale.endPoint),i.lineTo(o[0].x,this.scale.endPoint),i.fillStyle=t.fillColor,i.closePath(),i.fill()),n.each(o,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,e=t.Chart,n=e.helpers,i={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};e.Type.extend({name:"PolarArea",defaults:i,initialize:function(t){this.segments=[],this.SegmentArc=e.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new e.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),n.each(t,function(t,e){this.addData(t,e,!0)},this),this.options.showTooltips&&n.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];n.each(this.segments,function(t){t.restore(["fillColor"])}),n.each(e,function(t){t.fillColor=t.highlightColor}),this.showTooltip(e)}),this.render()},getSegmentsAtEvent:function(t){var e=[],i=n.getRelativePosition(t);return n.each(this.segments,function(t){t.inRange(i.x,i.y)&&e.push(t)},this),e},addData:function(t,e,n){var i=e||this.segments.length;this.segments.splice(i,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),n||(this.reflow(),this.update())},removeData:function(t){var e=n.isNumber(t)?t:this.segments.length-1;this.segments.splice(e,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,n.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var e=[];n.each(t,function(t){e.push(t.value)});var i=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:n.calculateScaleRange(e,n.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);n.extend(this.scale,i,{size:n.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),n.each(this.segments,function(t){t.save()}),this.render()},reflow:function(){n.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),n.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),n.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var e=t||1;this.clear(),n.each(this.segments,function(t,n){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},e),t.endAngle=t.startAngle+t.circumference,0===n&&(t.startAngle=1.5*Math.PI),n<this.segments.length-1&&(this.segments[n+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,e=t.Chart,n=e.helpers;e.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(t){this.PointClass=e.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&n.bindEvents(this,this.options.tooltipEvents,function(t){var e="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),n.each(e,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(e)}),n.each(t.datasets,function(e){var i={label:e.label||null,fillColor:e.fillColor,strokeColor:e.strokeColor,pointColor:e.pointColor,pointStrokeColor:e.pointStrokeColor,points:[]};this.datasets.push(i),n.each(e.data,function(n,r){var a;this.scale.animation||(a=this.scale.getPointPosition(r,this.scale.calculateCenterOffset(n))),i.points.push(new this.PointClass({value:n,label:t.labels[r],datasetLabel:e.label,x:this.options.animation?this.scale.xCenter:a.x,y:this.options.animation?this.scale.yCenter:a.y,strokeColor:e.pointStrokeColor,fillColor:e.pointColor,highlightFill:e.pointHighlightFill||e.pointColor,highlightStroke:e.pointHighlightStroke||e.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){n.each(this.datasets,function(e){n.each(e.points,t,this)},this)},getPointsAtEvent:function(t){var e=n.getRelativePosition(t),i=n.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},e),r=2*Math.PI/this.scale.valuesCount,a=Math.round((i.angle-1.5*Math.PI)/r),s=[];return(a>=this.scale.valuesCount||0>a)&&(a=0),i.distance<=this.scale.drawingArea&&n.each(this.datasets,function(t){s.push(t.points[a])}),s},buildScale:function(t){this.scale=new e.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var e=function(){var e=[];return n.each(t,function(t){t.data?e=e.concat(t.data):n.each(t.points,function(t){e.push(t.value)})}),e}(),i=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:n.calculateScaleRange(e,n.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);n.extend(this.scale,i)},addData:function(t,e){this.scale.valuesCount++,n.each(t,function(t,n){var i=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[n].points.push(new this.PointClass({value:t,label:e,x:i.x,y:i.y,strokeColor:this.datasets[n].pointStrokeColor,fillColor:this.datasets[n].pointColor}))},this),this.scale.labels.push(e),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),n.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){n.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:n.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var e=t||1,i=this.chart.ctx;this.clear(),this.scale.draw(),n.each(this.datasets,function(t){n.each(t.points,function(t,n){t.hasValue()&&t.transition(this.scale.getPointPosition(n,this.scale.calculateCenterOffset(t.value)),e)},this),i.lineWidth=this.options.datasetStrokeWidth,i.strokeStyle=t.strokeColor,i.beginPath(),n.each(t.points,function(t,e){0===e?i.moveTo(t.x,t.y):i.lineTo(t.x,t.y)},this),i.closePath(),i.stroke(),i.fillStyle=t.fillColor,i.fill(),n.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this),function(t){var e,n,i="0.3.4",r="hasOwnProperty",a=/[\.\/]/,s="*",o=function(){},l=function(t,e){return t-e},h={n:{}},u=function(t,i){var r,a=n,s=Array.prototype.slice.call(arguments,2),o=u.listeners(t),h=0,c=[],f={},p=[],d=e;e=t,n=0;for(var g=0,m=o.length;m>g;g++)"zIndex"in o[g]&&(c.push(o[g].zIndex),o[g].zIndex<0&&(f[o[g].zIndex]=o[g]));for(c.sort(l);c[h]<0;)if(r=f[c[h++]],p.push(r.apply(i,s)),n)return n=a,p;for(g=0;m>g;g++)if(r=o[g],"zIndex"in r)if(r.zIndex==c[h]){if(p.push(r.apply(i,s)),n)break;do if(h++,r=f[c[h]],r&&p.push(r.apply(i,s)),n)break;while(r)}else f[r.zIndex]=r;else if(p.push(r.apply(i,s)),n)break;return n=a,e=d,p.length?p:null};u.listeners=function(t){var e,n,i,r,o,l,u,c,f=t.split(a),p=h,d=[p],g=[];for(r=0,o=f.length;o>r;r++){for(c=[],l=0,u=d.length;u>l;l++)for(p=d[l].n,n=[p[f[r]],p[s]],i=2;i--;)e=n[i],e&&(c.push(e),g=g.concat(e.f||[]));d=c}return g},u.on=function(t,e){for(var n=t.split(a),i=h,r=0,s=n.length;s>r;r++)i=i.n,!i[n[r]]&&(i[n[r]]={n:{}}),i=i[n[r]];for(i.f=i.f||[],r=0,s=i.f.length;s>r;r++)if(i.f[r]==e)return o;return i.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.off=u.unbind=function(t,e){var n,i,o,l,u,c,f,p=t.split(a),d=[h];for(l=0,u=p.length;u>l;l++)for(c=0;c<d.length;c+=o.length-2){if(o=[c,1],n=d[c].n,p[l]!=s)n[p[l]]&&o.push(n[p[l]]);else for(i in n)n[r](i)&&o.push(n[i]);d.splice.apply(d,o)}for(l=0,u=d.length;u>l;l++)for(n=d[l];n.n;){if(e){if(n.f){for(c=0,f=n.f.length;f>c;c++)if(n.f[c]==e){n.f.splice(c,1);break}!n.f.length&&delete n.f}for(i in n.n)if(n.n[r](i)&&n.n[i].f){var g=n.n[i].f;for(c=0,f=g.length;f>c;c++)if(g[c]==e){g.splice(c,1);break}!g.length&&delete n.n[i].f}}else{delete n.f;for(i in n.n)n.n[r](i)&&n.n[i].f&&delete n.n[i].f}n=n.n}},u.once=function(t,e){var n=function(){var i=e.apply(this,arguments);return u.unbind(t,n),i};return u.on(t,n)},u.version=i,u.toString=function(){return"You are running Eve "+i},"undefined"!=typeof module&&module.exports?module.exports=u:"undefined"!=typeof define?define("eve",[],function(){return u}):t.eve=u}(this),function(){function t(t){for(var e=0;e<sn.length;e++)sn[e].el.paper==t&&sn.splice(e--,1)}function e(t,e,n,r,s,o){n=Z(n);var l,h,u,c,f,p,d=t.ms,g={},m={},y={};if(r)for(w=0,k=sn.length;k>w;w++){var x=sn[w];if(x.el.id==e.id&&x.anim==t){x.percent!=n?(sn.splice(w,1),u=1):h=x,e.attr(x.totalOrigin);break}}else r=+m;for(var w=0,k=t.percents.length;k>w;w++){if(t.percents[w]==n||t.percents[w]>r*t.top){n=t.percents[w],f=t.percents[w-1]||0,d=d/t.top*(n-f),c=t.percents[w+1],l=t.anim[n];break}r&&e.attr(t.anim[t.percents[w]])}if(l){if(h)h.initstatus=r,h.start=new Date-h.ms*r;else{for(var S in l)if(l[M](S)&&(ee[M](S)||e.paper.customAttributes[M](S)))switch(g[S]=e.attr(S),null==g[S]&&(g[S]=te[S]),m[S]=l[S],ee[S]){case j:y[S]=(m[S]-g[S])/d;break;case"colour":g[S]=v.getRGB(g[S]);var _=v.getRGB(m[S]);y[S]={r:(_.r-g[S].r)/d,g:(_.g-g[S].g)/d,b:(_.b-g[S].b)/d};break;case"path":var C=ze(g[S],m[S]),T=C[1];for(g[S]=C[0],y[S]=[],w=0,k=g[S].length;k>w;w++){y[S][w]=[0];for(var F=1,R=g[S][w].length;R>F;F++)y[S][w][F]=(T[w][F]-g[S][w][F])/d}break;case"transform":var L=e._,z=We(L[S],m[S]);if(z)for(g[S]=z.from,m[S]=z.to,y[S]=[],y[S].real=!0,w=0,k=g[S].length;k>w;w++)for(y[S][w]=[g[S][w][0]],F=1,R=g[S][w].length;R>F;F++)y[S][w][F]=(m[S][w][F]-g[S][w][F])/d;else{var I=e.matrix||new a,D={_:{transform:L.transform},getBBox:function(){return e.getBBox(1)}};g[S]=[I.a,I.b,I.c,I.d,I.e,I.f],Be(D,m[S]),m[S]=D._.transform,y[S]=[(D.matrix.a-I.a)/d,(D.matrix.b-I.b)/d,(D.matrix.c-I.c)/d,(D.matrix.d-I.d)/d,(D.matrix.e-I.e)/d,(D.matrix.f-I.f)/d]}break;case"csv":var B=P(l[S])[E](b),H=P(g[S])[E](b);if("clip-rect"==S)for(g[S]=H,y[S]=[],w=H.length;w--;)y[S][w]=(B[w]-g[S][w])/d;m[S]=B;break;default:for(B=[][A](l[S]),H=[][A](g[S]),y[S]=[],w=e.paper.customAttributes[S].length;w--;)y[S][w]=((B[w]||0)-(H[w]||0))/d}var W=l.easing,N=v.easing_formulas[W];if(!N)if(N=P(W).match($),N&&5==N.length){var O=N;N=function(t){return i(t,+O[1],+O[2],+O[3],+O[4],d)}}else N=ce;if(p=l.start||t.start||+new Date,x={anim:t,percent:n,timestamp:p,start:p+(t.del||0),status:0,initstatus:r||0,stop:!1,ms:d,easing:N,from:g,diff:y,to:m,el:e,callback:l.callback,prev:f,next:c,repeat:o||t.times,origin:e.attr(),totalOrigin:s},sn.push(x),r&&!h&&!u&&(x.stop=!0,x.start=new Date-d*r,1==sn.length))return ln();u&&(x.start=new Date-x.ms*r),1==sn.length&&on(ln)}eve("raphael.anim.start."+e.id,e,t)}}function n(t,e){var n=[],i={};if(this.ms=e,this.times=1,t){for(var r in t)t[M](r)&&(i[Z(r)]=t[r],n.push(Z(r)));n.sort(he)}this.anim=i,this.top=n[n.length-1],this.percents=n}function i(t,e,n,i,r,a){function s(t,e){var n,i,r,a,s,o;for(r=t,o=0;8>o;o++){if(a=l(r)-t,N(a)<e)return r;if(s=(3*c*r+2*u)*r+h,N(s)<1e-6)break;r-=a/s}if(n=0,i=1,r=t,n>r)return n;if(r>i)return i;for(;i>n;){if(a=l(r),N(a-t)<e)return r;t>a?n=r:i=r,r=(i-n)/2+n}return r}function o(t,e){var n=s(t,e);return((d*n+p)*n+f)*n}function l(t){return((c*t+u)*t+h)*t}var h=3*e,u=3*(i-e)-h,c=1-h-u,f=3*n,p=3*(r-n)-f,d=1-f-p;return o(t,1/(200*a))}function r(){return this.x+L+this.y+L+this.width+" Ã— "+this.height}function a(t,e,n,i,r,a){null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+i,this.e=+r,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function s(t,e,n){t=v._path2curve(t),e=v._path2curve(e);for(var i,r,a,s,l,h,u,c,f,p,d=n?0:[],g=0,m=t.length;m>g;g++){var y=t[g];if("M"==y[0])i=l=y[1],r=h=y[2];else{"C"==y[0]?(f=[i,r].concat(y.slice(1)),i=f[6],r=f[7]):(f=[i,r,i,r,l,h,l,h],i=l,r=h);for(var x=0,b=e.length;b>x;x++){var w=e[x];if("M"==w[0])a=u=w[1],s=c=w[2];else{"C"==w[0]?(p=[a,s].concat(w.slice(1)),a=p[6],s=p[7]):(p=[a,s,a,s,u,c,u,c],a=u,s=c);var k=o(f,p,n);if(n)d+=k;else{for(var M=0,S=k.length;S>M;M++)k[M].segment1=g,k[M].segment2=x,k[M].bez1=f,k[M].bez2=p;d=d.concat(k)}}}}}return d}function o(t,e,n){var i=v.bezierBBox(t),r=v.bezierBBox(e);if(!v.isBBoxIntersect(i,r))return n?0:[];for(var a=u.apply(0,t),s=u.apply(0,e),o=~~(a/5),h=~~(s/5),c=[],f=[],p={},d=n?0:[],g=0;o+1>g;g++){var m=v.findDotsAtSegment.apply(v,t.concat(g/o));c.push({x:m.x,y:m.y,t:g/o})}for(g=0;h+1>g;g++)m=v.findDotsAtSegment.apply(v,e.concat(g/h)),f.push({x:m.x,y:m.y,t:g/h});for(g=0;o>g;g++)for(var y=0;h>y;y++){var x=c[g],b=c[g+1],w=f[y],k=f[y+1],M=N(b.x-x.x)<.001?"y":"x",S=N(k.x-w.x)<.001?"y":"x",_=l(x.x,x.y,b.x,b.y,w.x,w.y,k.x,k.y);if(_){if(p[_.x.toFixed(4)]==_.y.toFixed(4))continue;p[_.x.toFixed(4)]=_.y.toFixed(4);var C=x.t+N((_[M]-x[M])/(b[M]-x[M]))*(b.t-x.t),T=w.t+N((_[S]-w[S])/(k[S]-w[S]))*(k.t-w.t);C>=0&&1>=C&&T>=0&&1>=T&&(n?d++:d.push({x:_.x,y:_.y,t1:C,t2:T}))}}return d}function l(t,e,n,i,r,a,s,o){if(!(H(t,n)<W(r,s)||W(t,n)>H(r,s)||H(e,i)<W(a,o)||W(e,i)>H(a,o))){var l=(t*i-e*n)*(r-s)-(t-n)*(r*o-a*s),h=(t*i-e*n)*(a-o)-(e-i)*(r*o-a*s),u=(t-n)*(a-o)-(e-i)*(r-s);if(!u)return;var c=l/u,f=h/u,p=+c.toFixed(2),d=+f.toFixed(2);if(p<+W(t,n).toFixed(2)||p>+H(t,n).toFixed(2)||p<+W(r,s).toFixed(2)||p>+H(r,s).toFixed(2)||d<+W(e,i).toFixed(2)||d>+H(e,i).toFixed(2)||d<+W(a,o).toFixed(2)||d>+H(a,o).toFixed(2))return;return{x:c,y:f}}}function h(t,e,n,i,r,a,s,o,l){if(!(0>l||u(t,e,n,i,r,a,s,o)<l)){var h,c=1,f=c/2,p=c-f,d=.01;for(h=u(t,e,n,i,r,a,s,o,p);N(h-l)>d;)f/=2,p+=(l>h?1:-1)*f,h=u(t,e,n,i,r,a,s,o,p);return p}}function u(t,e,n,i,r,a,s,o,l){null==l&&(l=1),l=l>1?1:0>l?0:l;for(var h=l/2,u=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;u>g;g++){var m=h*f[g]+h,v=c(m,t,n,r,s),y=c(m,e,i,a,o),x=v*v+y*y;d+=p[g]*B.sqrt(x)}return h*d}function c(t,e,n,i,r){var a=-3*e+9*n-9*i+3*r,s=t*a+6*e-12*n+6*i;return t*s-3*e+3*n}function f(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4==i?a[3]={x:+t[0],y:+t[1]}:r-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[r-2],y:+t[r-1]}:r-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}function p(){return this.hex}function d(t,e,n){function i(){var r=Array.prototype.slice.call(arguments,0),a=r.join("â€"),s=i.cache=i.cache||{},o=i.count=i.count||[];return s[M](a)?(g(o,a),n?n(s[a]):s[a]):(o.length>=1e3&&delete s[o.shift()],o.push(a),s[a]=t[T](e,r),n?n(s[a]):s[a])}return i}function g(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}function m(t){if(Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[M](n)&&(e[n]=m(t[n]));return e}function v(t){if(v.is(t,"function"))return y?t():eve.on("raphael.DOMload",t);if(v.is(t,G))return v._engine.create[T](v,t.splice(0,3+v.is(t[0],j))).add(t);var e=Array.prototype.slice.call(arguments,0);if(v.is(e[e.length-1],"function")){var n=e.pop();return y?n.call(v._engine.create[T](v,e)):eve.on("raphael.DOMload",function(){n.call(v._engine.create[T](v,e))})}return v._engine.create[T](v,arguments)}v.version="2.1.0",v.eve=eve;var y,x,b=/[, ]+/,w={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},k=/\{(\d+)\}/g,M="hasOwnProperty",S={doc:document,win:window},_={was:Object.prototype[M].call(S.win,"Raphael"),is:S.win.Raphael},C=function(){this.ca=this.customAttributes={}},T="apply",A="concat",F="createTouch"in S.doc,R="",L=" ",P=String,E="split",z="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[E](L),I={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},D=P.prototype.toLowerCase,B=Math,H=B.max,W=B.min,N=B.abs,O=B.pow,q=B.PI,j="number",Y="string",G="array",X=Object.prototype.toString,V=(v._ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),U={NaN:1,Infinity:1,"-Infinity":1},$=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,Q=B.round,Z=parseFloat,J=parseInt,K=P.prototype.toUpperCase,te=v._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},ee=v._availableAnimAttrs={blur:j,"clip-rect":"csv",cx:j,cy:j,fill:"colour","fill-opacity":j,"font-size":j,height:j,opacity:j,path:"path",r:j,rx:j,ry:j,stroke:"colour","stroke-opacity":j,"stroke-width":j,transform:"transform",width:j,x:j,y:j},ne=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,ie={hs:1,rg:1},re=/,?([achlmqrstvxz]),?/gi,ae=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,se=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,oe=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,le=(v._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),he=function(t,e){return Z(t)-Z(e)},ue=function(){},ce=function(t){return t},fe=v._rectPath=function(t,e,n,i,r){return r?[["M",t+r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]]:[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]]},pe=function(t,e,n,i){return null==i&&(i=n),[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]]},de=v._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return pe(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return fe(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return fe(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return fe(e.x,e.y,e.width,e.height)
  }},ge=v.mapPath=function(t,e){if(!e)return t;var n,i,r,a,s,o,l;for(t=ze(t),r=0,s=t.length;s>r;r++)for(l=t[r],a=1,o=l.length;o>a;a+=2)n=e.x(l[a],l[a+1]),i=e.y(l[a],l[a+1]),l[a]=n,l[a+1]=i;return t};if(v._g=S,v.type=S.win.SVGAngle||S.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==v.type){var me,ve=S.doc.createElement("div");if(ve.innerHTML='<v:shape adj="1"/>',me=ve.firstChild,me.style.behavior="url(#default#VML)",!me||"object"!=typeof me.adj)return v.type=R;ve=null}v.svg=!(v.vml="VML"==v.type),v._Paper=C,v.fn=x=C.prototype=v.prototype,v._id=0,v._oid=0,v.is=function(t,e){return e=D.call(e),"finite"==e?!U[M](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||X.call(t).slice(8,-1).toLowerCase()==e},v.angle=function(t,e,n,i,r,a){if(null==r){var s=t-n,o=e-i;return s||o?(180+180*B.atan2(-o,-s)/q+360)%360:0}return v.angle(t,e,r,a)-v.angle(n,i,r,a)},v.rad=function(t){return t%360*q/180},v.deg=function(t){return 180*t/q%360},v.snapTo=function(t,e,n){if(n=v.is(n,"finite")?n:10,v.is(t,G)){for(var i=t.length;i--;)if(N(t[i]-e)<=n)return t[i]}else{t=+t;var r=e%t;if(n>r)return e-r;if(r>t-n)return e-r+t}return e};v.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*B.random()|0,n="x"==t?e:3&e|8;return n.toString(16)});v.setWindow=function(t){eve("raphael.setWindow",v,S.win,t),S.win=t,S.doc=S.win.document,v._engine.initWin&&v._engine.initWin(S.win)};var ye=function(t){if(v.vml){var e,n=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write("<body>"),i.close(),e=i.body}catch(r){e=createPopup().document.body}var a=e.createTextRange();ye=d(function(t){try{e.style.color=P(t).replace(n,R);var i=a.queryCommandValue("ForeColor");return i=(255&i)<<16|65280&i|(16711680&i)>>>16,"#"+("000000"+i.toString(16)).slice(-6)}catch(r){return"none"}})}else{var s=S.doc.createElement("i");s.title="RaphaÃ«l Colour Picker",s.style.display="none",S.doc.body.appendChild(s),ye=d(function(t){return s.style.color=t,S.doc.defaultView.getComputedStyle(s,R).getPropertyValue("color")})}return ye(t)},xe=function(){return"hsb("+[this.h,this.s,this.b]+")"},be=function(){return"hsl("+[this.h,this.s,this.l]+")"},we=function(){return this.hex},ke=function(t,e,n){if(null==e&&v.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(n=t.b,e=t.g,t=t.r),null==e&&v.is(t,Y)){var i=v.getRGB(t);t=i.r,e=i.g,n=i.b}return(t>1||e>1||n>1)&&(t/=255,e/=255,n/=255),[t,e,n]},Me=function(t,e,n,i){t*=255,e*=255,n*=255;var r={r:t,g:e,b:n,hex:v.rgb(t,e,n),toString:we};return v.is(i,"finite")&&(r.opacity=i),r};v.color=function(t){var e;return v.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=v.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):v.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=v.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):(v.is(t,"string")&&(t=v.getRGB(t)),v.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(e=v.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=v.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=we,t},v.hsb2rgb=function(t,e,n,i){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,t=t.h,i=t.o),t*=360;var r,a,s,o,l;return t=t%360/60,l=n*e,o=l*(1-N(t%2-1)),r=a=s=n-l,t=~~t,r+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],Me(r,a,s,i)},v.hsl2rgb=function(t,e,n,i){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),t*=360;var r,a,s,o,l;return t=t%360/60,l=2*e*(.5>n?n:1-n),o=l*(1-N(t%2-1)),r=a=s=n-l/2,t=~~t,r+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],Me(r,a,s,i)},v.rgb2hsb=function(t,e,n){n=ke(t,e,n),t=n[0],e=n[1],n=n[2];var i,r,a,s;return a=H(t,e,n),s=a-W(t,e,n),i=0==s?null:a==t?(e-n)/s:a==e?(n-t)/s+2:(t-e)/s+4,i=(i+360)%6*60/360,r=0==s?0:s/a,{h:i,s:r,b:a,toString:xe}},v.rgb2hsl=function(t,e,n){n=ke(t,e,n),t=n[0],e=n[1],n=n[2];var i,r,a,s,o,l;return s=H(t,e,n),o=W(t,e,n),l=s-o,i=0==l?null:s==t?(e-n)/l:s==e?(n-t)/l+2:(t-e)/l+4,i=(i+360)%6*60/360,a=(s+o)/2,r=0==l?0:.5>a?l/(2*a):l/(2-2*a),{h:i,s:r,l:a,toString:be}},v._path2string=function(){return this.join(",").replace(re,"$1")};v._preload=function(t,e){var n=S.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){e.call(this),this.onload=null,S.doc.body.removeChild(this)},n.onerror=function(){S.doc.body.removeChild(this)},S.doc.body.appendChild(n),n.src=t};v.getRGB=d(function(t){if(!t||(t=P(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:p};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:p};!ie[M](t.toLowerCase().substring(0,2))&&"#"!=t.charAt()&&(t=ye(t));var e,n,i,r,a,s,o=t.match(V);return o?(o[2]&&(i=J(o[2].substring(5),16),n=J(o[2].substring(3,5),16),e=J(o[2].substring(1,3),16)),o[3]&&(i=J((a=o[3].charAt(3))+a,16),n=J((a=o[3].charAt(2))+a,16),e=J((a=o[3].charAt(1))+a,16)),o[4]&&(s=o[4][E](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),i=Z(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),"rgba"==o[1].toLowerCase().slice(0,4)&&(r=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(r/=100)),o[5]?(s=o[5][E](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),i=Z(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"Â°"==s[0].slice(-1))&&(e/=360),"hsba"==o[1].toLowerCase().slice(0,4)&&(r=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(r/=100),v.hsb2rgb(e,n,i,r)):o[6]?(s=o[6][E](ne),e=Z(s[0]),"%"==s[0].slice(-1)&&(e*=2.55),n=Z(s[1]),"%"==s[1].slice(-1)&&(n*=2.55),i=Z(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"Â°"==s[0].slice(-1))&&(e/=360),"hsla"==o[1].toLowerCase().slice(0,4)&&(r=Z(s[3])),s[3]&&"%"==s[3].slice(-1)&&(r/=100),v.hsl2rgb(e,n,i,r)):(o={r:e,g:n,b:i,toString:p},o.hex="#"+(16777216|i|n<<8|e<<16).toString(16).slice(1),v.is(r,"finite")&&(o.opacity=r),o)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:p}},v),v.hsb=d(function(t,e,n){return v.hsb2rgb(t,e,n).hex}),v.hsl=d(function(t,e,n){return v.hsl2rgb(t,e,n).hex}),v.rgb=d(function(t,e,n){return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)}),v.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},n=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),n.hex},v.getColor.reset=function(){delete this.start},v.parsePathString=function(t){if(!t)return null;var e=Se(t);if(e.arr)return Ce(e.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return v.is(t,G)&&v.is(t[0],G)&&(i=Ce(t)),i.length||P(t).replace(ae,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(oe,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(i.push([e][A](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)i.push([e][A](a));else for(;a.length>=n[s]&&(i.push([e][A](a.splice(0,n[s]))),n[s]););}),i.toString=v._path2string,e.arr=Ce(i),i},v.parseTransformString=d(function(t){if(!t)return null;var e=[];return v.is(t,G)&&v.is(t[0],G)&&(e=Ce(t)),e.length||P(t).replace(se,function(t,n,i){{var r=[];D.call(n)}i.replace(oe,function(t,e){e&&r.push(+e)}),e.push([n][A](r))}),e.toString=v._path2string,e});var Se=function(t){var e=Se.ps=Se.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)e[M](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]};v.findDotsAtSegment=function(t,e,n,i,r,a,s,o,l){var h=1-l,u=O(h,3),c=O(h,2),f=l*l,p=f*l,d=u*t+3*c*l*n+3*h*l*l*r+p*s,g=u*e+3*c*l*i+3*h*l*l*a+p*o,m=t+2*l*(n-t)+f*(r-2*n+t),v=e+2*l*(i-e)+f*(a-2*i+e),y=n+2*l*(r-n)+f*(s-2*r+n),x=i+2*l*(a-i)+f*(o-2*a+i),b=h*t+l*n,w=h*e+l*i,k=h*r+l*s,M=h*a+l*o,S=90-180*B.atan2(m-y,v-x)/q;return(m>y||x>v)&&(S+=180),{x:d,y:g,m:{x:m,y:v},n:{x:y,y:x},start:{x:b,y:w},end:{x:k,y:M},alpha:S}},v.bezierBBox=function(t,e,n,i,r,a,s,o){v.is(t,"array")||(t=[t,e,n,i,r,a,s,o]);var l=Ee.apply(null,t);return{x:l.min.x,y:l.min.y,x2:l.max.x,y2:l.max.y,width:l.max.x-l.min.x,height:l.max.y-l.min.y}},v.isPointInsideBBox=function(t,e,n){return e>=t.x&&e<=t.x2&&n>=t.y&&n<=t.y2},v.isBBoxIntersect=function(t,e){var n=v.isPointInsideBBox;return n(e,t.x,t.y)||n(e,t.x2,t.y)||n(e,t.x,t.y2)||n(e,t.x2,t.y2)||n(t,e.x,e.y)||n(t,e.x2,e.y)||n(t,e.x,e.y2)||n(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)},v.pathIntersection=function(t,e){return s(t,e)},v.pathIntersectionNumber=function(t,e){return s(t,e,1)},v.isPointInsidePath=function(t,e,n){var i=v.pathBBox(t);return v.isPointInsideBBox(i,e,n)&&s(t,[["M",e,n],["H",i.x2+10]],1)%2==1},v._removedFactory=function(t){return function(){eve("raphael.log",null,"RaphaÃ«l: you are calling to method â€œ"+t+"â€ of removed object",t)}};var _e=v.pathBBox=function(t){var e=Se(t);if(e.bbox)return e.bbox;if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=ze(t);for(var n,i=0,r=0,a=[],s=[],o=0,l=t.length;l>o;o++)if(n=t[o],"M"==n[0])i=n[1],r=n[2],a.push(i),s.push(r);else{var h=Ee(i,r,n[1],n[2],n[3],n[4],n[5],n[6]);a=a[A](h.min.x,h.max.x),s=s[A](h.min.y,h.max.y),i=n[5],r=n[6]}var u=W[T](0,a),c=W[T](0,s),f=H[T](0,a),p=H[T](0,s),d={x:u,y:c,x2:f,y2:p,width:f-u,height:p-c};return e.bbox=m(d),d},Ce=function(t){var e=m(t);return e.toString=v._path2string,e},Te=v._pathToRelative=function(t){var e=Se(t);if(e.rel)return Ce(e.rel);v.is(t,G)&&v.is(t&&t[0],G)||(t=v.parsePathString(t));var n=[],i=0,r=0,a=0,s=0,o=0;"M"==t[0][0]&&(i=t[0][1],r=t[0][2],a=i,s=r,o++,n.push(["M",i,r]));for(var l=o,h=t.length;h>l;l++){var u=n[l]=[],c=t[l];if(c[0]!=D.call(c[0]))switch(u[0]=D.call(c[0]),u[0]){case"a":u[1]=c[1],u[2]=c[2],u[3]=c[3],u[4]=c[4],u[5]=c[5],u[6]=+(c[6]-i).toFixed(3),u[7]=+(c[7]-r).toFixed(3);break;case"v":u[1]=+(c[1]-r).toFixed(3);break;case"m":a=c[1],s=c[2];default:for(var f=1,p=c.length;p>f;f++)u[f]=+(c[f]-(f%2?i:r)).toFixed(3)}else{u=n[l]=[],"m"==c[0]&&(a=c[1]+i,s=c[2]+r);for(var d=0,g=c.length;g>d;d++)n[l][d]=c[d]}var m=n[l].length;switch(n[l][0]){case"z":i=a,r=s;break;case"h":i+=+n[l][m-1];break;case"v":r+=+n[l][m-1];break;default:i+=+n[l][m-2],r+=+n[l][m-1]}}return n.toString=v._path2string,e.rel=Ce(n),n},Ae=v._pathToAbsolute=function(t){var e=Se(t);if(e.abs)return Ce(e.abs);if(v.is(t,G)&&v.is(t&&t[0],G)||(t=v.parsePathString(t)),!t||!t.length)return[["M",0,0]];var n=[],i=0,r=0,a=0,s=0,o=0;"M"==t[0][0]&&(i=+t[0][1],r=+t[0][2],a=i,s=r,o++,n[0]=["M",i,r]);for(var l,h,u=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),c=o,p=t.length;p>c;c++){if(n.push(l=[]),h=t[c],h[0]!=K.call(h[0]))switch(l[0]=K.call(h[0]),l[0]){case"A":l[1]=h[1],l[2]=h[2],l[3]=h[3],l[4]=h[4],l[5]=h[5],l[6]=+(h[6]+i),l[7]=+(h[7]+r);break;case"V":l[1]=+h[1]+r;break;case"H":l[1]=+h[1]+i;break;case"R":for(var d=[i,r][A](h.slice(1)),g=2,m=d.length;m>g;g++)d[g]=+d[g]+i,d[++g]=+d[g]+r;n.pop(),n=n[A](f(d,u));break;case"M":a=+h[1]+i,s=+h[2]+r;default:for(g=1,m=h.length;m>g;g++)l[g]=+h[g]+(g%2?i:r)}else if("R"==h[0])d=[i,r][A](h.slice(1)),n.pop(),n=n[A](f(d,u)),l=["R"][A](h.slice(-2));else for(var y=0,x=h.length;x>y;y++)l[y]=h[y];switch(l[0]){case"Z":i=a,r=s;break;case"H":i=l[1];break;case"V":r=l[1];break;case"M":a=l[l.length-2],s=l[l.length-1];default:i=l[l.length-2],r=l[l.length-1]}}return n.toString=v._path2string,e.abs=Ce(n),n},Fe=function(t,e,n,i){return[t,e,n,i,n,i]},Re=function(t,e,n,i,r,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*i,s*r+o*n,s*a+o*i,r,a]},Le=function(t,e,n,i,r,a,s,o,l,h){var u,c=120*q/180,f=q/180*(+r||0),p=[],g=d(function(t,e,n){var i=t*B.cos(n)-e*B.sin(n),r=t*B.sin(n)+e*B.cos(n);return{x:i,y:r}});if(h)S=h[0],_=h[1],k=h[2],M=h[3];else{u=g(t,e,-f),t=u.x,e=u.y,u=g(o,l,-f),o=u.x,l=u.y;var m=(B.cos(q/180*r),B.sin(q/180*r),(t-o)/2),v=(e-l)/2,y=m*m/(n*n)+v*v/(i*i);y>1&&(y=B.sqrt(y),n=y*n,i=y*i);var x=n*n,b=i*i,w=(a==s?-1:1)*B.sqrt(N((x*b-x*v*v-b*m*m)/(x*v*v+b*m*m))),k=w*n*v/i+(t+o)/2,M=w*-i*m/n+(e+l)/2,S=B.asin(((e-M)/i).toFixed(9)),_=B.asin(((l-M)/i).toFixed(9));S=k>t?q-S:S,_=k>o?q-_:_,0>S&&(S=2*q+S),0>_&&(_=2*q+_),s&&S>_&&(S-=2*q),!s&&_>S&&(_-=2*q)}var C=_-S;if(N(C)>c){var T=_,F=o,R=l;_=S+c*(s&&_>S?1:-1),o=k+n*B.cos(_),l=M+i*B.sin(_),p=Le(o,l,n,i,r,0,s,F,R,[_,T,k,M])}C=_-S;var L=B.cos(S),P=B.sin(S),z=B.cos(_),I=B.sin(_),D=B.tan(C/4),H=4/3*n*D,W=4/3*i*D,O=[t,e],j=[t+H*P,e-W*L],Y=[o+H*I,l-W*z],G=[o,l];if(j[0]=2*O[0]-j[0],j[1]=2*O[1]-j[1],h)return[j,Y,G][A](p);p=[j,Y,G][A](p).join()[E](",");for(var X=[],V=0,U=p.length;U>V;V++)X[V]=V%2?g(p[V-1],p[V],f).y:g(p[V],p[V+1],f).x;return X},Pe=function(t,e,n,i,r,a,s,o,l){var h=1-l;return{x:O(h,3)*t+3*O(h,2)*l*n+3*h*l*l*r+O(l,3)*s,y:O(h,3)*e+3*O(h,2)*l*i+3*h*l*l*a+O(l,3)*o}},Ee=d(function(t,e,n,i,r,a,s,o){var l,h=r-2*n+t-(s-2*r+n),u=2*(n-t)-2*(r-n),c=t-n,f=(-u+B.sqrt(u*u-4*h*c))/2/h,p=(-u-B.sqrt(u*u-4*h*c))/2/h,d=[e,o],g=[t,s];return N(f)>"1e12"&&(f=.5),N(p)>"1e12"&&(p=.5),f>0&&1>f&&(l=Pe(t,e,n,i,r,a,s,o,f),g.push(l.x),d.push(l.y)),p>0&&1>p&&(l=Pe(t,e,n,i,r,a,s,o,p),g.push(l.x),d.push(l.y)),h=a-2*i+e-(o-2*a+i),u=2*(i-e)-2*(a-i),c=e-i,f=(-u+B.sqrt(u*u-4*h*c))/2/h,p=(-u-B.sqrt(u*u-4*h*c))/2/h,N(f)>"1e12"&&(f=.5),N(p)>"1e12"&&(p=.5),f>0&&1>f&&(l=Pe(t,e,n,i,r,a,s,o,f),g.push(l.x),d.push(l.y)),p>0&&1>p&&(l=Pe(t,e,n,i,r,a,s,o,p),g.push(l.x),d.push(l.y)),{min:{x:W[T](0,g),y:W[T](0,d)},max:{x:H[T](0,g),y:H[T](0,d)}}}),ze=v._path2curve=d(function(t,e){var n=!e&&Se(t);if(!e&&n.curve)return Ce(n.curve);for(var i=Ae(t),r=e&&Ae(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=(function(t,e){var n,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][A](Le[T](0,[e.x,e.y][A](t.slice(1))));break;case"S":n=e.x+(e.x-(e.bx||e.x)),i=e.y+(e.y-(e.by||e.y)),t=["C",n,i][A](t.slice(1));break;case"T":e.qx=e.x+(e.x-(e.qx||e.x)),e.qy=e.y+(e.y-(e.qy||e.y)),t=["C"][A](Re(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][A](Re(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][A](Fe(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][A](Fe(e.x,e.y,t[1],e.y));break;case"V":t=["C"][A](Fe(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][A](Fe(e.x,e.y,e.X,e.Y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)t.splice(e++,0,["C"][A](n.splice(0,6)));t.splice(e,1),c=H(i.length,r&&r.length||0)}},h=function(t,e,n,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),n.bx=0,n.by=0,n.x=t[s][1],n.y=t[s][2],c=H(i.length,r&&r.length||0))},u=0,c=H(i.length,r&&r.length||0);c>u;u++){i[u]=o(i[u],a),l(i,u),r&&(r[u]=o(r[u],s)),r&&l(r,u),h(i,r,a,s,u),h(r,i,s,a,u);var f=i[u],p=r&&r[u],d=f.length,g=r&&p.length;a.x=f[d-2],a.y=f[d-1],a.bx=Z(f[d-4])||a.x,a.by=Z(f[d-3])||a.y,s.bx=r&&(Z(p[g-4])||s.x),s.by=r&&(Z(p[g-3])||s.y),s.x=r&&p[g-2],s.y=r&&p[g-1]}return r||(n.curve=Ce(i)),r?[i,r]:i},null,Ce),Ie=(v._parseDots=d(function(t){for(var e=[],n=0,i=t.length;i>n;n++){var r={},a=t[n].match(/^([^:]*):?([\d\.]*)/);if(r.color=v.getRGB(a[1]),r.color.error)return null;r.color=r.color.hex,a[2]&&(r.offset=a[2]+"%"),e.push(r)}for(n=1,i=e.length-1;i>n;n++)if(!e[n].offset){for(var s=Z(e[n-1].offset||0),o=0,l=n+1;i>l;l++)if(e[l].offset){o=e[l].offset;break}o||(o=100,l=i),o=Z(o);for(var h=(o-s)/(l-n+1);l>n;n++)s+=h,e[n].offset=s+"%"}return e}),v._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),De=(v._tofront=function(t,e){e.top!==t&&(Ie(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},v._toback=function(t,e){e.bottom!==t&&(Ie(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},v._insertafter=function(t,e,n){Ie(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},v._insertbefore=function(t,e,n){Ie(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},v.toMatrix=function(t,e){var n=_e(t),i={_:{transform:R},getBBox:function(){return n}};return Be(i,e),i.matrix}),Be=(v.transformPath=function(t,e){return ge(t,De(t,e))},v._extractTransform=function(t,e){if(null==e)return t._.transform;e=P(e).replace(/\.{3}|\u2026/g,t._.transform||R);var n=v.parseTransformString(e),i=0,r=0,s=0,o=1,l=1,h=t._,u=new a;if(h.transform=n||[],n)for(var c=0,f=n.length;f>c;c++){var p,d,g,m,y,x=n[c],b=x.length,w=P(x[0]).toLowerCase(),k=x[0]!=w,M=k?u.invert():0;"t"==w&&3==b?k?(p=M.x(0,0),d=M.y(0,0),g=M.x(x[1],x[2]),m=M.y(x[1],x[2]),u.translate(g-p,m-d)):u.translate(x[1],x[2]):"r"==w?2==b?(y=y||t.getBBox(1),u.rotate(x[1],y.x+y.width/2,y.y+y.height/2),i+=x[1]):4==b&&(k?(g=M.x(x[2],x[3]),m=M.y(x[2],x[3]),u.rotate(x[1],g,m)):u.rotate(x[1],x[2],x[3]),i+=x[1]):"s"==w?2==b||3==b?(y=y||t.getBBox(1),u.scale(x[1],x[b-1],y.x+y.width/2,y.y+y.height/2),o*=x[1],l*=x[b-1]):5==b&&(k?(g=M.x(x[3],x[4]),m=M.y(x[3],x[4]),u.scale(x[1],x[2],g,m)):u.scale(x[1],x[2],x[3],x[4]),o*=x[1],l*=x[2]):"m"==w&&7==b&&u.add(x[1],x[2],x[3],x[4],x[5],x[6]),h.dirtyT=1,t.matrix=u}t.matrix=u,h.sx=o,h.sy=l,h.deg=i,h.dx=r=u.e,h.dy=s=u.f,1==o&&1==l&&!i&&h.bbox?(h.bbox.x+=+r,h.bbox.y+=+s):h.dirtyT=1}),He=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},We=v._equaliseTransform=function(t,e){e=P(e).replace(/\.{3}|\u2026/g,t),t=v.parseTransformString(t)||[],e=v.parseTransformString(e)||[];for(var n,i,r,a,s=H(t.length,e.length),o=[],l=[],h=0;s>h;h++){if(r=t[h]||He(e[h]),a=e[h]||He(r),r[0]!=a[0]||"r"==r[0].toLowerCase()&&(r[2]!=a[2]||r[3]!=a[3])||"s"==r[0].toLowerCase()&&(r[3]!=a[3]||r[4]!=a[4]))return;for(o[h]=[],l[h]=[],n=0,i=H(r.length,a.length);i>n;n++)n in r&&(o[h][n]=r[n]),n in a&&(l[h][n]=a[n])}return{from:o,to:l}};v._getContainer=function(t,e,n,i){var r;return r=null!=i||v.is(t,"object")?t:S.doc.getElementById(t),null!=r?r.tagName?null==e?{container:r,width:r.style.pixelWidth||r.offsetWidth,height:r.style.pixelHeight||r.offsetHeight}:{container:r,width:e,height:n}:{container:1,x:t,y:e,width:n,height:i}:void 0},v.pathToRelative=Te,v._engine={},v.path2curve=ze,v.matrix=function(t,e,n,i,r,s){return new a(t,e,n,i,r,s)},function(t){function e(t){var e=B.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}function n(t){return t[0]*t[0]+t[1]*t[1]}t.add=function(t,e,n,i,r,s){var o,l,h,u,c=[[],[],[]],f=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],p=[[t,n,r],[e,i,s],[0,0,1]];for(t&&t instanceof a&&(p=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(l=0;3>l;l++){for(u=0,h=0;3>h;h++)u+=f[o][h]*p[h][l];c[o][l]=u}this.a=c[0][0],this.b=c[1][0],this.c=c[0][1],this.d=c[1][1],this.e=c[0][2],this.f=c[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new a(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new a(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,i){null==e&&(e=t),(n||i)&&this.add(1,0,0,1,n,i),this.add(t,0,0,e,0,0),(n||i)&&this.add(1,0,0,1,-n,-i)},t.rotate=function(t,e,n){t=v.rad(t),e=e||0,n=n||0;var i=+B.cos(t).toFixed(9),r=+B.sin(t).toFixed(9);this.add(i,r,-r,i,e,n),this.add(1,0,0,1,-e,-n)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[P.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return v.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=B.sqrt(n(i[0])),e(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=B.sqrt(n(i[1])),e(i[1]),t.shear/=t.scaley;var r=-i[0][1],a=i[1][1];return 0>a?(t.rotate=v.deg(B.acos(a)),0>r&&(t.rotate=360-t.rotate)):t.rotate=v.deg(B.asin(r)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[E]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:R)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:R)+(e.rotate?"r"+[e.rotate,0,0]:R)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(a.prototype);var Ne=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);x.safari="Apple Computer, Inc."==navigator.vendor&&(Ne&&Ne[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Ne&&Ne[1]<8?function(){var t=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){t.remove()})}:ue;for(var Oe=function(){this.returnValue=!1},qe=function(){return this.originalEvent.preventDefault()},je=function(){this.cancelBubble=!0},Ye=function(){return this.originalEvent.stopPropagation()},Ge=function(){return S.doc.addEventListener?function(t,e,n,i){var r=F&&I[e]?I[e]:e,a=function(r){var a=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,s=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,o=r.clientX+s,l=r.clientY+a;if(F&&I[M](e))for(var h=0,u=r.targetTouches&&r.targetTouches.length;u>h;h++)if(r.targetTouches[h].target==t){var c=r;r=r.targetTouches[h],r.originalEvent=c,r.preventDefault=qe,r.stopPropagation=Ye;break}return n.call(i,r,o,l)};return t.addEventListener(r,a,!1),function(){return t.removeEventListener(r,a,!1),!0}}:S.doc.attachEvent?function(t,e,n,i){var r=function(t){t=t||S.win.event;var e=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,r=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,a=t.clientX+r,s=t.clientY+e;return t.preventDefault=t.preventDefault||Oe,t.stopPropagation=t.stopPropagation||je,n.call(i,t,a,s)};t.attachEvent("on"+e,r);var a=function(){return t.detachEvent("on"+e,r),!0};return a}:void 0}(),Xe=[],Ve=function(t){for(var e,n=t.clientX,i=t.clientY,r=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,a=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,s=Xe.length;s--;){if(e=Xe[s],F){for(var o,l=t.touches.length;l--;)if(o=t.touches[l],o.identifier==e.el._drag.id){n=o.clientX,i=o.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var h,u=e.el.node,c=u.nextSibling,f=u.parentNode,p=u.style.display;S.win.opera&&f.removeChild(u),u.style.display="none",h=e.el.paper.getElementByPoint(n,i),u.style.display=p,S.win.opera&&(c?f.insertBefore(u,c):f.appendChild(u)),h&&eve("raphael.drag.over."+e.el.id,e.el,h),n+=a,i+=r,eve("raphael.drag.move."+e.el.id,e.move_scope||e.el,n-e.el._drag.x,i-e.el._drag.y,n,i,t)}},Ue=function(t){v.unmousemove(Ve).unmouseup(Ue);for(var e,n=Xe.length;n--;)e=Xe[n],e.el._drag={},eve("raphael.drag.end."+e.el.id,e.end_scope||e.start_scope||e.move_scope||e.el,t);Xe=[]},$e=v.el={},Qe=z.length;Qe--;)(function(t){v[t]=$e[t]=function(e,n){return v.is(e,"function")&&(this.events=this.events||[],this.events.push({name:t,f:e,unbind:Ge(this.shape||this.node||S.doc,t,e,n||this)})),this},v["un"+t]=$e["un"+t]=function(e){for(var n=this.events||[],i=n.length;i--;)if(n[i].name==t&&n[i].f==e)return n[i].unbind(),n.splice(i,1),!n.length&&delete this.events,this;return this}})(z[Qe]);$e.data=function(t,e){var n=le[this.id]=le[this.id]||{};if(1==arguments.length){if(v.is(t,"object")){for(var i in t)t[M](i)&&this.data(i,t[i]);return this}return eve("raphael.data.get."+this.id,this,n[t],t),n[t]}return n[t]=e,eve("raphael.data.set."+this.id,this,e,t),this},$e.removeData=function(t){return null==t?le[this.id]={}:le[this.id]&&delete le[this.id][t],this},$e.hover=function(t,e,n,i){return this.mouseover(t,n).mouseout(e,i||n)},$e.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var Ze=[];$e.drag=function(t,e,n,i,r,a){function s(s){(s.originalEvent||s).preventDefault();var o=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,l=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft;this._drag.x=s.clientX+l,this._drag.y=s.clientY+o,this._drag.id=s.identifier,!Xe.length&&v.mousemove(Ve).mouseup(Ue),Xe.push({el:this,move_scope:i,start_scope:r,end_scope:a}),e&&eve.on("raphael.drag.start."+this.id,e),t&&eve.on("raphael.drag.move."+this.id,t),n&&eve.on("raphael.drag.end."+this.id,n),eve("raphael.drag.start."+this.id,r||i||this,s.clientX+l,s.clientY+o,s)}return this._drag={},Ze.push({el:this,start:s}),this.mousedown(s),this},$e.onDragOver=function(t){t?eve.on("raphael.drag.over."+this.id,t):eve.unbind("raphael.drag.over."+this.id)},$e.undrag=function(){for(var t=Ze.length;t--;)Ze[t].el==this&&(this.unmousedown(Ze[t].start),Ze.splice(t,1),eve.unbind("raphael.drag.*."+this.id));!Ze.length&&v.unmousemove(Ve).unmouseup(Ue)},x.circle=function(t,e,n){var i=v._engine.circle(this,t||0,e||0,n||0);return this.__set__&&this.__set__.push(i),i},x.rect=function(t,e,n,i,r){var a=v._engine.rect(this,t||0,e||0,n||0,i||0,r||0);return this.__set__&&this.__set__.push(a),a},x.ellipse=function(t,e,n,i){var r=v._engine.ellipse(this,t||0,e||0,n||0,i||0);return this.__set__&&this.__set__.push(r),r},x.path=function(t){t&&!v.is(t,Y)&&!v.is(t[0],G)&&(t+=R);var e=v._engine.path(v.format[T](v,arguments),this);return this.__set__&&this.__set__.push(e),e},x.image=function(t,e,n,i,r){var a=v._engine.image(this,t||"about:blank",e||0,n||0,i||0,r||0);return this.__set__&&this.__set__.push(a),a},x.text=function(t,e,n){var i=v._engine.text(this,t||0,e||0,P(n));return this.__set__&&this.__set__.push(i),i},x.set=function(t){!v.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var e=new un(t);return this.__set__&&this.__set__.push(e),e},x.setStart=function(t){this.__set__=t||this.set()},x.setFinish=function(){var t=this.__set__;return delete this.__set__,t},x.setSize=function(t,e){return v._engine.setSize.call(this,t,e)},x.setViewBox=function(t,e,n,i,r){return v._engine.setViewBox.call(this,t,e,n,i,r)},x.top=x.bottom=null,x.raphael=v;var Je=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,i=n.body,r=n.documentElement,a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,o=e.top+(S.win.pageYOffset||r.scrollTop||i.scrollTop)-a,l=e.left+(S.win.pageXOffset||r.scrollLeft||i.scrollLeft)-s;return{y:o,x:l}};x.getElementByPoint=function(t,e){var n=this,i=n.canvas,r=S.doc.elementFromPoint(t,e);if(S.win.opera&&"svg"==r.tagName){var a=Je(i),s=i.createSVGRect();s.x=t-a.x,s.y=e-a.y,s.width=s.height=1;var o=i.getIntersectionList(s,null);o.length&&(r=o[o.length-1])}if(!r)return null;for(;r.parentNode&&r!=i.parentNode&&!r.raphael;)r=r.parentNode;return r==n.canvas.parentNode&&(r=i),r=r&&r.raphael?n.getById(r.raphaelid):null},x.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},x.forEach=function(t,e){for(var n=this.bottom;n;){if(t.call(e,n)===!1)return this;n=n.next}return this},x.getElementsByPoint=function(t,e){var n=this.set();return this.forEach(function(i){i.isPointInside(t,e)&&n.push(i)}),n},$e.isPointInside=function(t,e){var n=this.realPath=this.realPath||de[this.type](this);return v.isPointInsidePath(n,t,e)},$e.getBBox=function(t){if(this.removed)return{};var e=this._;return t?((e.dirty||!e.bboxwt)&&(this.realPath=de[this.type](this),e.bboxwt=_e(this.realPath),e.bboxwt.toString=r,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&((e.dirty||!this.realPath)&&(e.bboxwt=0,this.realPath=de[this.type](this)),e.bbox=_e(ge(this.realPath,this.matrix)),e.bbox.toString=r,e.dirty=e.dirtyT=0),e.bbox)},$e.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},$e.glow=function(t){if("text"==this.type)return null;t=t||{};var e={width:(t.width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:t.opacity||.5,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},n=e.width/2,i=this.paper,r=i.set(),a=this.realPath||de[this.type](this);a=this.matrix?ge(a,this.matrix):a;for(var s=1;n+1>s;s++)r.push(i.path(a).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/n*s).toFixed(3),opacity:+(e.opacity/n).toFixed(3)}));return r.insertBefore(this).translate(e.offsetx,e.offsety)};var Ke=function(t,e,n,i,r,a,s,o,l){return null==l?u(t,e,n,i,r,a,s,o):v.findDotsAtSegment(t,e,n,i,r,a,s,o,h(t,e,n,i,r,a,s,o,l))},tn=function(t,e){return function(n,i,r){n=ze(n);for(var a,s,o,l,h,u="",c={},f=0,p=0,d=n.length;d>p;p++){if(o=n[p],"M"==o[0])a=+o[1],s=+o[2];else{if(l=Ke(a,s,o[1],o[2],o[3],o[4],o[5],o[6]),f+l>i){if(e&&!c.start){if(h=Ke(a,s,o[1],o[2],o[3],o[4],o[5],o[6],i-f),u+=["C"+h.start.x,h.start.y,h.m.x,h.m.y,h.x,h.y],r)return u;c.start=u,u=["M"+h.x,h.y+"C"+h.n.x,h.n.y,h.end.x,h.end.y,o[5],o[6]].join(),f+=l,a=+o[5],s=+o[6];continue}if(!t&&!e)return h=Ke(a,s,o[1],o[2],o[3],o[4],o[5],o[6],i-f),{x:h.x,y:h.y,alpha:h.alpha}}f+=l,a=+o[5],s=+o[6]}u+=o.shift()+o}return c.end=u,h=t?f:e?c:v.findDotsAtSegment(a,s,o[0],o[1],o[2],o[3],o[4],o[5],1),h.alpha&&(h={x:h.x,y:h.y,alpha:h.alpha}),h}},en=tn(1),nn=tn(),rn=tn(0,1);v.getTotalLength=en,v.getPointAtLength=nn,v.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return rn(t,e).end;var i=rn(t,n,1);return e?rn(i,e).end:i},$e.getTotalLength=function(){return"path"==this.type?this.node.getTotalLength?this.node.getTotalLength():en(this.attrs.path):void 0},$e.getPointAtLength=function(t){return"path"==this.type?nn(this.attrs.path,t):void 0},$e.getSubpath=function(t,e){return"path"==this.type?v.getSubpath(this.attrs.path,t,e):void 0};var an=v.easing_formulas={linear:function(t){return t},"<":function(t){return O(t,1.7)},">":function(t){return O(t,.48)},"<>":function(t){var e=.48-t/1.04,n=B.sqrt(.1734+e*e),i=n-e,r=O(N(i),1/3)*(0>i?-1:1),a=-n-e,s=O(N(a),1/3)*(0>a?-1:1),o=r+s+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:O(2,-10*t)*B.sin(2*(t-.075)*q/.3)+1},bounce:function(t){var e,n=7.5625,i=2.75;return 1/i>t?e=n*t*t:2/i>t?(t-=1.5/i,e=n*t*t+.75):2.5/i>t?(t-=2.25/i,e=n*t*t+.9375):(t-=2.625/i,e=n*t*t+.984375),e}};an.easeIn=an["ease-in"]=an["<"],an.easeOut=an["ease-out"]=an[">"],an.easeInOut=an["ease-in-out"]=an["<>"],an["back-in"]=an.backIn,an["back-out"]=an.backOut;var sn=[],on=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ln=function(){for(var t=+new Date,n=0;n<sn.length;n++){var i=sn[n];if(!i.el.removed&&!i.paused){var r,a,s=t-i.start,o=i.ms,l=i.easing,h=i.from,u=i.diff,c=i.to,f=(i.t,i.el),p={},d={};if(i.initstatus?(s=(i.initstatus*i.anim.top-i.prev)/(i.percent-i.prev)*o,i.status=i.initstatus,delete i.initstatus,i.stop&&sn.splice(n--,1)):i.status=(i.prev+(i.percent-i.prev)*(s/o))/i.anim.top,!(0>s))if(o>s){var g=l(s/o);for(var m in h)if(h[M](m)){switch(ee[m]){case j:r=+h[m]+g*o*u[m];break;case"colour":r="rgb("+[hn(Q(h[m].r+g*o*u[m].r)),hn(Q(h[m].g+g*o*u[m].g)),hn(Q(h[m].b+g*o*u[m].b))].join(",")+")";break;case"path":r=[];for(var y=0,x=h[m].length;x>y;y++){r[y]=[h[m][y][0]];for(var b=1,w=h[m][y].length;w>b;b++)r[y][b]=+h[m][y][b]+g*o*u[m][y][b];r[y]=r[y].join(L)}r=r.join(L);break;case"transform":if(u[m].real)for(r=[],y=0,x=h[m].length;x>y;y++)for(r[y]=[h[m][y][0]],b=1,w=h[m][y].length;w>b;b++)r[y][b]=h[m][y][b]+g*o*u[m][y][b];else{var k=function(t){return+h[m][t]+g*o*u[m][t]};r=[["m",k(0),k(1),k(2),k(3),k(4),k(5)]]}break;case"csv":if("clip-rect"==m)for(r=[],y=4;y--;)r[y]=+h[m][y]+g*o*u[m][y];break;default:var S=[][A](h[m]);for(r=[],y=f.paper.customAttributes[m].length;y--;)r[y]=+S[y]+g*o*u[m][y]}p[m]=r}f.attr(p),function(t,e,n){setTimeout(function(){eve("raphael.anim.frame."+t,e,n)})}(f.id,f,i.anim)}else{if(function(t,e,n){setTimeout(function(){eve("raphael.anim.frame."+e.id,e,n),eve("raphael.anim.finish."+e.id,e,n),v.is(t,"function")&&t.call(e)})}(i.callback,f,i.anim),f.attr(c),sn.splice(n--,1),i.repeat>1&&!i.next){for(a in c)c[M](a)&&(d[a]=i.totalOrigin[a]);i.el.attr(d),e(i.anim,i.el,i.anim.percents[0],null,i.totalOrigin,i.repeat-1)}i.next&&!i.stop&&e(i.anim,i.el,i.next,null,i.totalOrigin,i.repeat)}}}v.svg&&f&&f.paper&&f.paper.safari(),sn.length&&on(ln)},hn=function(t){return t>255?255:0>t?0:t};$e.animateWith=function(t,i,r,a,s,o){var l=this;if(l.removed)return o&&o.call(l),l;
  var h=r instanceof n?r:v.animation(r,a,s,o);e(h,l,h.percents[0],null,l.attr());for(var u=0,c=sn.length;c>u;u++)if(sn[u].anim==i&&sn[u].el==t){sn[c-1].start=sn[u].start;break}return l},$e.onAnimation=function(t){return t?eve.on("raphael.anim.frame."+this.id,t):eve.unbind("raphael.anim.frame."+this.id),this},n.prototype.delay=function(t){var e=new n(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},n.prototype.repeat=function(t){var e=new n(this.anim,this.ms);return e.del=this.del,e.times=B.floor(H(t,0))||1,e},v.animation=function(t,e,i,r){if(t instanceof n)return t;(v.is(i,"function")||!i)&&(r=r||i||null,i=null),t=Object(t),e=+e||0;var a,s,o={};for(s in t)t[M](s)&&Z(s)!=s&&Z(s)+"%"!=s&&(a=!0,o[s]=t[s]);return a?(i&&(o.easing=i),r&&(o.callback=r),new n({100:o},e)):new n(t,e)},$e.animate=function(t,i,r,a){var s=this;if(s.removed)return a&&a.call(s),s;var o=t instanceof n?t:v.animation(t,i,r,a);return e(o,s,o.percents[0],null,s.attr()),s},$e.setTime=function(t,e){return t&&null!=e&&this.status(t,W(e,t.ms)/t.ms),this},$e.status=function(t,n){var i,r,a=[],s=0;if(null!=n)return e(t,this,-1,W(n,1)),this;for(i=sn.length;i>s;s++)if(r=sn[s],r.el.id==this.id&&(!t||r.anim==t)){if(t)return r.status;a.push({anim:r.anim,status:r.status})}return t?0:a},$e.pause=function(t){for(var e=0;e<sn.length;e++)sn[e].el.id==this.id&&(!t||sn[e].anim==t)&&eve("raphael.anim.pause."+this.id,this,sn[e].anim)!==!1&&(sn[e].paused=!0);return this},$e.resume=function(t){for(var e=0;e<sn.length;e++)if(sn[e].el.id==this.id&&(!t||sn[e].anim==t)){var n=sn[e];eve("raphael.anim.resume."+this.id,this,n.anim)!==!1&&(delete n.paused,this.status(n.anim,n.status))}return this},$e.stop=function(t){for(var e=0;e<sn.length;e++)sn[e].el.id==this.id&&(!t||sn[e].anim==t)&&eve("raphael.anim.stop."+this.id,this,sn[e].anim)!==!1&&sn.splice(e--,1);return this},eve.on("raphael.remove",t),eve.on("raphael.clear",t),$e.toString=function(){return"RaphaÃ«lâ€™s object"};var un=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,n=t.length;n>e;e++)t[e]&&(t[e].constructor==$e.constructor||t[e].constructor==un)&&(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},cn=un.prototype;cn.push=function(){for(var t,e,n=0,i=arguments.length;i>n;n++)t=arguments[n],t&&(t.constructor==$e.constructor||t.constructor==un)&&(e=this.items.length,this[e]=this.items[e]=t,this.length++);return this},cn.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},cn.forEach=function(t,e){for(var n=0,i=this.items.length;i>n;n++)if(t.call(e,this.items[n],n)===!1)return this;return this};for(var fn in $e)$e[M](fn)&&(cn[fn]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t][T](n,e)})}}(fn));cn.attr=function(t,e){if(t&&v.is(t,G)&&v.is(t[0],"object"))for(var n=0,i=t.length;i>n;n++)this.items[n].attr(t[n]);else for(var r=0,a=this.items.length;a>r;r++)this.items[r].attr(t,e);return this},cn.clear=function(){for(;this.length;)this.pop()},cn.splice=function(t,e){t=0>t?H(this.length+t,0):t,e=H(0,W(this.length-t,e));var n,i=[],r=[],a=[];for(n=2;n<arguments.length;n++)a.push(arguments[n]);for(n=0;e>n;n++)r.push(this[t+n]);for(;n<this.length-t;n++)i.push(this[t+n]);var s=a.length;for(n=0;n<s+i.length;n++)this.items[t+n]=this[t+n]=s>n?a[n]:i[n-s];for(n=this.items.length=this.length-=e-s;this[n];)delete this[n++];return new un(r)},cn.exclude=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]==t)return this.splice(e,1),!0},cn.animate=function(t,e,n,i){(v.is(n,"function")||!n)&&(i=n||null);var r,a,s=this.items.length,o=s,l=this;if(!s)return this;i&&(a=function(){!--s&&i.call(l)}),n=v.is(n,Y)?n:a;var h=v.animation(t,e,n,a);for(r=this.items[--o].animate(h);o--;)this.items[o]&&!this.items[o].removed&&this.items[o].animateWith(r,h,h);return this},cn.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},cn.getBBox=function(){for(var t=[],e=[],n=[],i=[],r=this.items.length;r--;)if(!this.items[r].removed){var a=this.items[r].getBBox();t.push(a.x),e.push(a.y),n.push(a.x+a.width),i.push(a.y+a.height)}return t=W[T](0,t),e=W[T](0,e),n=H[T](0,n),i=H[T](0,i),{x:t,y:e,x2:n,y2:i,width:n-t,height:i-e}},cn.clone=function(t){t=new un;for(var e=0,n=this.items.length;n>e;e++)t.push(this.items[e].clone());return t},cn.toString=function(){return"RaphaÃ«lâ€˜s set"},v.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},n=t.face["font-family"];for(var i in t.face)t.face[M](i)&&(e.face[i]=t.face[i]);if(this.fonts[n]?this.fonts[n].push(e):this.fonts[n]=[e],!t.svg){e.face["units-per-em"]=J(t.face["units-per-em"],10);for(var r in t.glyphs)if(t.glyphs[M](r)){var a=t.glyphs[r];if(e.glyphs[r]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},a.k)for(var s in a.k)a[M](s)&&(e.glyphs[r].k[s]=a.k[s])}}return t},x.getFont=function(t,e,n,i){if(i=i||"normal",n=n||"normal",e=+e||{normal:400,bold:700,lighter:300,bolder:800}[e]||400,v.fonts){var r=v.fonts[t];if(!r){var a=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,R)+"(\\s|$)","i");for(var s in v.fonts)if(v.fonts[M](s)&&a.test(s)){r=v.fonts[s];break}}var o;if(r)for(var l=0,h=r.length;h>l&&(o=r[l],o.face["font-weight"]!=e||o.face["font-style"]!=n&&o.face["font-style"]||o.face["font-stretch"]!=i);l++);return o}},x.print=function(t,e,n,i,r,a,s){a=a||"middle",s=H(W(s||0,1),-1);var o,l=P(n)[E](R),h=0,u=0,c=R;if(v.is(i,n)&&(i=this.getFont(i)),i){o=(r||16)/i.face["units-per-em"];for(var f=i.face.bbox[E](b),p=+f[0],d=f[3]-f[1],g=0,m=+f[1]+("baseline"==a?d+ +i.face.descent:d/2),y=0,x=l.length;x>y;y++){if("\n"==l[y])h=0,k=0,u=0,g+=d;else{var w=u&&i.glyphs[l[y-1]]||{},k=i.glyphs[l[y]];h+=u?(w.w||i.w)+(w.k&&w.k[l[y]]||0)+i.w*s:0,u=1}k&&k.d&&(c+=v.transformPath(k.d,["t",h*o,g*o,"s",o,o,p,m,"t",(t-p)/o,(e-m)/o]))}}return this.path(c).attr({fill:"#000",stroke:"none"})},x.add=function(t){if(v.is(t,"array"))for(var e,n=this.set(),i=0,r=t.length;r>i;i++)e=t[i]||{},w[M](e.type)&&n.push(this[e.type]().attr(e));return n},v.format=function(t,e){var n=v.is(e,G)?[0][A](e):arguments;return t&&v.is(t,Y)&&n.length-1&&(t=t.replace(k,function(t,e){return null==n[++e]?R:n[e]})),t||R},v.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,i){var r=i;return n.replace(e,function(t,e,n,i,a){e=e||i,r&&(e in r&&(r=r[e]),"function"==typeof r&&a&&(r=r()))}),r=(null==r||r==i?t:r)+""};return function(e,i){return String(e).replace(t,function(t,e){return n(t,e,i)})}}(),v.ninja=function(){return _.was?S.win.Raphael=_.is:delete Raphael,v},v.st=cn,function(t,e,n){function i(){/in/.test(t.readyState)?setTimeout(i,9):v.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener(e,n=function(){t.removeEventListener(e,n,!1),t.readyState="complete"},!1),t.readyState="loading"),i()}(document,"DOMContentLoaded"),_.was?S.win.Raphael=v:Raphael=v,eve.on("raphael.DOMload",function(){y=!0})}(),window.Raphael.svg&&function(t){var e="hasOwnProperty",n=String,i=parseFloat,r=parseInt,a=Math,s=a.max,o=a.abs,l=a.pow,h=/[, ]+/,u=t.eve,c="",f=" ",p="http://www.w3.org/1999/xlink",d={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running RaphaÃ«l "+this.version};var m=function(i,r){if(r){"string"==typeof i&&(i=m(i));for(var a in r)r[e](a)&&("xlink:"==a.substring(0,6)?i.setAttributeNS(p,a.substring(6),n(r[a])):i.setAttribute(a,n(r[a])))}else i=t._g.doc.createElementNS("http://www.w3.org/2000/svg",i),i.style&&(i.style.webkitTapHighlightColor="rgba(0,0,0,0)");return i},v=function(e,r){var h="linear",u=e.id+r,f=.5,p=.5,d=e.node,g=e.paper,v=d.style,y=t._g.doc.getElementById(u);if(!y){if(r=n(r).replace(t._radial_gradient,function(t,e,n){if(h="radial",e&&n){f=i(e),p=i(n);var r=2*(p>.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*r+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*r)}return c}),r=r.split(/\s*\-\s*/),"linear"==h){var x=r.shift();if(x=-i(x),isNaN(x))return null;var b=[0,0,a.cos(t.rad(x)),a.sin(t.rad(x))],w=1/(s(o(b[2]),o(b[3]))||1);b[2]*=w,b[3]*=w,b[2]<0&&(b[0]=-b[2],b[2]=0),b[3]<0&&(b[1]=-b[3],b[3]=0)}var k=t._parseDots(r);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=m(h+"Gradient",{id:u}),e.gradient=y,m(y,"radial"==h?{fx:f,fy:p}:{x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var M=0,S=k.length;S>M;M++)y.appendChild(m("stop",{offset:k[M].offset?k[M].offset:M?"100%":"0%","stop-color":k[M].color||"#fff"}))}}return m(d,{fill:"url(#"+u+")",opacity:1,"fill-opacity":1}),v.fill=c,v.opacity=1,v.fillOpacity=1,1},y=function(t){var e=t.getBBox(1);m(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},x=function(i,r,a){if("path"==i.type){for(var s,o,l,h,u,f=n(r).toLowerCase().split("-"),p=i.paper,v=a?"end":"start",y=i.node,x=i.attrs,b=x["stroke-width"],w=f.length,k="classic",M=3,S=3,_=5;w--;)switch(f[w]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":k=f[w];break;case"wide":S=5;break;case"narrow":S=2;break;case"long":M=5;break;case"short":M=2}if("open"==k?(M+=2,S+=2,_+=2,l=1,h=a?4:1,u={fill:"none",stroke:x.stroke}):(h=l=M/2,u={fill:x.stroke,stroke:"none"}),i._.arrows?a?(i._.arrows.endPath&&g[i._.arrows.endPath]--,i._.arrows.endMarker&&g[i._.arrows.endMarker]--):(i._.arrows.startPath&&g[i._.arrows.startPath]--,i._.arrows.startMarker&&g[i._.arrows.startMarker]--):i._.arrows={},"none"!=k){var C="raphael-marker-"+k,T="raphael-marker-"+v+k+M+S;t._g.doc.getElementById(C)?g[C]++:(p.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:d[k],id:C})),g[C]=1);var A,F=t._g.doc.getElementById(T);F?(g[T]++,A=F.getElementsByTagName("use")[0]):(F=m(m("marker"),{id:T,markerHeight:S,markerWidth:M,orient:"auto",refX:h,refY:S/2}),A=m(m("use"),{"xlink:href":"#"+C,transform:(a?"rotate(180 "+M/2+" "+S/2+") ":c)+"scale("+M/_+","+S/_+")","stroke-width":(1/((M/_+S/_)/2)).toFixed(4)}),F.appendChild(A),p.defs.appendChild(F),g[T]=1),m(A,u);var R=l*("diamond"!=k&&"oval"!=k);a?(s=i._.arrows.startdx*b||0,o=t.getTotalLength(x.path)-R*b):(s=R*b,o=t.getTotalLength(x.path)-(i._.arrows.enddx*b||0)),u={},u["marker-"+v]="url(#"+T+")",(o||s)&&(u.d=Raphael.getSubpath(x.path,s,o)),m(y,u),i._.arrows[v+"Path"]=C,i._.arrows[v+"Marker"]=T,i._.arrows[v+"dx"]=R,i._.arrows[v+"Type"]=k,i._.arrows[v+"String"]=r}else a?(s=i._.arrows.startdx*b||0,o=t.getTotalLength(x.path)-s):(s=0,o=t.getTotalLength(x.path)-(i._.arrows.enddx*b||0)),i._.arrows[v+"Path"]&&m(y,{d:Raphael.getSubpath(x.path,s,o)}),delete i._.arrows[v+"Path"],delete i._.arrows[v+"Marker"],delete i._.arrows[v+"dx"],delete i._.arrows[v+"Type"],delete i._.arrows[v+"String"];for(u in g)if(g[e](u)&&!g[u]){var L=t._g.doc.getElementById(u);L&&L.parentNode.removeChild(L)}}},b={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(t,e,i){if(e=b[n(e).toLowerCase()]){for(var r=t.attrs["stroke-width"]||"1",a={round:r,square:r,butt:0}[t.attrs["stroke-linecap"]||i["stroke-linecap"]]||0,s=[],o=e.length;o--;)s[o]=e[o]*r+(o%2?1:-1)*a;m(t.node,{"stroke-dasharray":s.join(",")})}},k=function(i,a){var l=i.node,u=i.attrs,f=l.style.visibility;l.style.visibility="hidden";for(var d in a)if(a[e](d)){if(!t._availableAttrs[e](d))continue;var g=a[d];switch(u[d]=g,d){case"blur":i.blur(g);break;case"href":case"title":case"target":var b=l.parentNode;if("a"!=b.tagName.toLowerCase()){var k=m("a");b.insertBefore(k,l),k.appendChild(l),b=k}"target"==d?b.setAttributeNS(p,"show","blank"==g?"new":g):b.setAttributeNS(p,d,g);break;case"cursor":l.style.cursor=g;break;case"transform":i.transform(g);break;case"arrow-start":x(i,g);break;case"arrow-end":x(i,g,1);break;case"clip-rect":var M=n(g).split(h);if(4==M.length){i.clip&&i.clip.parentNode.parentNode.removeChild(i.clip.parentNode);var _=m("clipPath"),C=m("rect");_.id=t.createUUID(),m(C,{x:M[0],y:M[1],width:M[2],height:M[3]}),_.appendChild(C),i.paper.defs.appendChild(_),m(l,{"clip-path":"url(#"+_.id+")"}),i.clip=C}if(!g){var T=l.getAttribute("clip-path");if(T){var A=t._g.doc.getElementById(T.replace(/(^url\(#|\)$)/g,c));A&&A.parentNode.removeChild(A),m(l,{"clip-path":c}),delete i.clip}}break;case"path":"path"==i.type&&(m(l,{d:g?u.path=t._pathToAbsolute(g):"M0,0"}),i._.dirty=1,i._.arrows&&("startString"in i._.arrows&&x(i,i._.arrows.startString),"endString"in i._.arrows&&x(i,i._.arrows.endString,1)));break;case"width":if(l.setAttribute(d,g),i._.dirty=1,!u.fx)break;d="x",g=u.x;case"x":u.fx&&(g=-u.x-(u.width||0));case"rx":if("rx"==d&&"rect"==i.type)break;case"cx":l.setAttribute(d,g),i.pattern&&y(i),i._.dirty=1;break;case"height":if(l.setAttribute(d,g),i._.dirty=1,!u.fy)break;d="y",g=u.y;case"y":u.fy&&(g=-u.y-(u.height||0));case"ry":if("ry"==d&&"rect"==i.type)break;case"cy":l.setAttribute(d,g),i.pattern&&y(i),i._.dirty=1;break;case"r":"rect"==i.type?m(l,{rx:g,ry:g}):l.setAttribute(d,g),i._.dirty=1;break;case"src":"image"==i.type&&l.setAttributeNS(p,"href",g);break;case"stroke-width":(1!=i._.sx||1!=i._.sy)&&(g/=s(o(i._.sx),o(i._.sy))||1),i.paper._vbSize&&(g*=i.paper._vbSize),l.setAttribute(d,g),u["stroke-dasharray"]&&w(i,u["stroke-dasharray"],a),i._.arrows&&("startString"in i._.arrows&&x(i,i._.arrows.startString),"endString"in i._.arrows&&x(i,i._.arrows.endString,1));break;case"stroke-dasharray":w(i,g,a);break;case"fill":var F=n(g).match(t._ISURL);if(F){_=m("pattern");var R=m("image");_.id=t.createUUID(),m(_,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(R,{x:0,y:0,"xlink:href":F[1]}),_.appendChild(R),function(e){t._preload(F[1],function(){var t=this.offsetWidth,n=this.offsetHeight;m(e,{width:t,height:n}),m(R,{width:t,height:n}),i.paper.safari()})}(_),i.paper.defs.appendChild(_),m(l,{fill:"url(#"+_.id+")"}),i.pattern=_,i.pattern&&y(i);break}var L=t.getRGB(g);if(L.error){if(("circle"==i.type||"ellipse"==i.type||"r"!=n(g).charAt())&&v(i,g)){if("opacity"in u||"fill-opacity"in u){var P=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c));if(P){var E=P.getElementsByTagName("stop");m(E[E.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!t.is(u.opacity,"undefined")&&t.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!t.is(u["fill-opacity"],"undefined")&&t.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});L[e]("opacity")&&m(l,{"fill-opacity":L.opacity>1?L.opacity/100:L.opacity});case"stroke":L=t.getRGB(g),l.setAttribute(d,L.hex),"stroke"==d&&L[e]("opacity")&&m(l,{"stroke-opacity":L.opacity>1?L.opacity/100:L.opacity}),"stroke"==d&&i._.arrows&&("startString"in i._.arrows&&x(i,i._.arrows.startString),"endString"in i._.arrows&&x(i,i._.arrows.endString,1));break;case"gradient":("circle"==i.type||"ellipse"==i.type||"r"!=n(g).charAt())&&v(i,g);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){P=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)),P&&(E=P.getElementsByTagName("stop"),m(E[E.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=r(g,10)+"px");var z=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[z]=g,i._.dirty=1,l.setAttribute(d,g)}}S(i,a),l.style.visibility=f},M=1.2,S=function(i,a){if("text"==i.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstChild?r(t._g.doc.defaultView.getComputedStyle(o.firstChild,c).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h,u=n(a.text).split("\n"),f=[],p=0,d=u.length;d>p;p++)h=m("tspan"),p&&m(h,{dy:l*M,x:s.x}),h.appendChild(t._g.doc.createTextNode(u[p])),o.appendChild(h),f[p]=h}else for(f=o.getElementsByTagName("tspan"),p=0,d=f.length;d>p;p++)p?m(f[p],{dy:l*M,x:s.x}):m(f[0],{dy:0});m(o,{x:s.x,y:s.y}),i._.dirty=1;var g=i._getBBox(),v=s.y-(g.y+g.height/2);v&&t.is(v,"finite")&&m(f[0],{dy:v})}},_=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=n,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null},C=t.el;_.prototype=C,C.constructor=_,t._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var i=new _(n,e);return i.type="path",k(i,{fill:"none",stroke:"#000",path:t}),i},C.rotate=function(t,e,r){if(this.removed)return this;if(t=n(t).split(h),t.length-1&&(e=i(t[1]),r=i(t[2])),t=i(t[0]),null==r&&(e=r),null==e||null==r){var a=this.getBBox(1);e=a.x+a.width/2,r=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,e,r]])),this},C.scale=function(t,e,r,a){if(this.removed)return this;if(t=n(t).split(h),t.length-1&&(e=i(t[1]),r=i(t[2]),a=i(t[3])),t=i(t[0]),null==e&&(e=t),null==a&&(r=a),null==r||null==a)var s=this.getBBox(1);return r=null==r?s.x+s.width/2:r,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,r,a]])),this},C.translate=function(t,e){return this.removed?this:(t=n(t).split(h),t.length-1&&(e=i(t[1])),t=i(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]])),this)},C.transform=function(n){var i=this._;if(null==n)return i.transform;if(t._extractTransform(this,n),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=i.sx||1!=i.sy){var r=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":r})}return this},C.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},C.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},C.remove=function(){if(!this.removed&&this.node.parentNode){var e=this.paper;e.__set__&&e.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&e.defs.removeChild(this.gradient),t._tear(this,e),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var n in this)this[n]="function"==typeof this[n]?t._removedFactory(n):null;this.removed=!0}},C._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e={};try{e=this.node.getBBox()}catch(n){}finally{e=e||{}}return t&&this.hide(),e},C.attr=function(n,i){if(this.removed)return this;if(null==n){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==i&&t.is(n,"string")){if("fill"==n&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==n)return this._.transform;for(var s=n.split(h),o={},l=0,c=s.length;c>l;l++)n=s[l],o[n]=n in this.attrs?this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?this.paper.customAttributes[n].def:t._availableAttrs[n];return c-1?o:o[s[0]]}if(null==i&&t.is(n,"array")){for(o={},l=0,c=n.length;c>l;l++)o[n[l]]=this.attr(n[l]);return o}if(null!=i){var f={};f[n]=i}else null!=n&&t.is(n,"object")&&(f=n);for(var p in f)u("raphael.attr."+p+"."+this.id,this,f[p]);for(p in this.paper.customAttributes)if(this.paper.customAttributes[e](p)&&f[e](p)&&t.is(this.paper.customAttributes[p],"function")){var d=this.paper.customAttributes[p].apply(this,[].concat(f[p]));this.attrs[p]=f[p];for(var g in d)d[e](g)&&(f[g]=d[g])}return k(this,f),this},C.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var e=this.paper;return e.top!=this&&t._tofront(this,e),this},C.toBack=function(){if(this.removed)return this;var e=this.node.parentNode;"a"==e.tagName.toLowerCase()?e.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):e.firstChild!=this.node&&e.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper);this.paper;return this},C.insertAfter=function(e){if(this.removed)return this;var n=e.node||e[e.length-1].node;return n.nextSibling?n.parentNode.insertBefore(this.node,n.nextSibling):n.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this},C.insertBefore=function(e){if(this.removed)return this;var n=e.node||e[0].node;return n.parentNode.insertBefore(this.node,n),t._insertbefore(this,e,this.paper),this},C.blur=function(e){var n=this;if(0!==+e){var i=m("filter"),r=m("feGaussianBlur");n.attrs.blur=e,i.id=t.createUUID(),m(r,{stdDeviation:+e||1.5}),i.appendChild(r),n.paper.defs.appendChild(i),n._blur=i,m(n.node,{filter:"url(#"+i.id+")"})}else n._blur&&(n._blur.parentNode.removeChild(n._blur),delete n._blur,delete n.attrs.blur),n.node.removeAttribute("filter")},t._engine.circle=function(t,e,n,i){var r=m("circle");t.canvas&&t.canvas.appendChild(r);var a=new _(r,t);return a.attrs={cx:e,cy:n,r:i,fill:"none",stroke:"#000"},a.type="circle",m(r,a.attrs),a},t._engine.rect=function(t,e,n,i,r,a){var s=m("rect");t.canvas&&t.canvas.appendChild(s);var o=new _(s,t);return o.attrs={x:e,y:n,width:i,height:r,r:a||0,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},o.type="rect",m(s,o.attrs),o},t._engine.ellipse=function(t,e,n,i,r){var a=m("ellipse");t.canvas&&t.canvas.appendChild(a);var s=new _(a,t);return s.attrs={cx:e,cy:n,rx:i,ry:r,fill:"none",stroke:"#000"},s.type="ellipse",m(a,s.attrs),s},t._engine.image=function(t,e,n,i,r,a){var s=m("image");m(s,{x:n,y:i,width:r,height:a,preserveAspectRatio:"none"}),s.setAttributeNS(p,"href",e),t.canvas&&t.canvas.appendChild(s);var o=new _(s,t);return o.attrs={x:n,y:i,width:r,height:a,src:e},o.type="image",o},t._engine.text=function(e,n,i,r){var a=m("text");e.canvas&&e.canvas.appendChild(a);var s=new _(a,e);return s.attrs={x:n,y:i,"text-anchor":"middle",text:r,font:t._availableAttrs.font,stroke:"none",fill:"#000"},s.type="text",k(s,s.attrs),s},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e&&e.container,i=e.x,r=e.y,a=e.width,s=e.height;if(!n)throw new Error("SVG container not found.");var o,l=m("svg"),h="overflow:hidden;";return i=i||0,r=r||0,a=a||512,s=s||342,m(l,{height:s,version:1.1,width:a,xmlns:"http://www.w3.org/2000/svg"}),1==n?(l.style.cssText=h+"position:absolute;left:"+i+"px;top:"+r+"px",t._g.doc.body.appendChild(l),o=1):(l.style.cssText=h+"position:relative",n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l)),n=new t._Paper,n.width=a,n.height=s,n.canvas=l,n.clear(),n._left=n._top=0,o&&(n.renderfix=function(){}),n.renderfix(),n},t._engine.setViewBox=function(t,e,n,i,r){u("raphael.setViewBox",this,this._viewBox,[t,e,n,i,r]);var a,o,l=s(n/this.width,i/this.height),h=this.top,c=r?"meet":"xMinYMin";for(null==t?(this._vbSize&&(l=1),delete this._vbSize,a="0 0 "+this.width+f+this.height):(this._vbSize=l,a=t+f+e+f+n+f+i),m(this.canvas,{viewBox:a,preserveAspectRatio:c});l&&h;)o="stroke-width"in h.attrs?h.attrs["stroke-width"]:1,h.attr({"stroke-width":o}),h._.dirty=1,h._.dirtyT=1,h=h.prev;return this._viewBox=[t,e,n,i,!!r],this},t.prototype.renderfix=function(){var t,e=this.canvas,n=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(i){t=e.createSVGMatrix()}var r=-t.e%1,a=-t.f%1;(r||a)&&(r&&(this._left=(this._left+r)%1,n.left=this._left+"px"),a&&(this._top=(this._top+a)%1,n.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(t._g.doc.createTextNode("Created with RaphaÃ«l "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=m("defs"))},t.prototype.remove=function(){u("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var T=t.st;for(var A in C)C[e](A)&&!T[e](A)&&(T[A]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(A))}(window.Raphael),window.Raphael.vml&&function(t){var e="hasOwnProperty",n=String,i=parseFloat,r=Math,a=r.round,s=r.max,o=r.min,l=r.abs,h="fill",u=/[, ]+/,c=t.eve,f=" progid:DXImageTransform.Microsoft",p=" ",d="",g={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},m=/([clmz]),?([^clmz]*)/gi,v=/ progid:\S+Blur\([^\)]+\)/g,y=/-?[^,\s-]+/g,x="position:absolute;left:0;top:0;width:1px;height:1px",b=21600,w={path:1,rect:1,image:1},k={circle:1,ellipse:1},M=function(e){var i=/[ahqstv]/gi,r=t._pathToAbsolute;if(n(e).match(i)&&(r=t._path2curve),i=/[clmz]/g,r==t._pathToAbsolute&&!n(e).match(i)){var s=n(e).replace(m,function(t,e,n){var i=[],r="m"==e.toLowerCase(),s=g[e];return n.replace(y,function(t){r&&2==i.length&&(s+=i+g["m"==e?"l":"L"],i=[]),i.push(a(t*b))}),s+i});return s}var o,l,h=r(e);s=[];for(var u=0,c=h.length;c>u;u++){o=h[u],l=h[u][0].toLowerCase(),"z"==l&&(l="x");for(var f=1,v=o.length;v>f;f++)l+=a(o[f]*b)+(f!=v-1?",":d);s.push(l)}return s.join(p)},S=function(e,n,i){var r=t.matrix();return r.rotate(-e,.5,.5),{dx:r.x(n,i),dy:r.y(n,i)}},_=function(t,e,n,i,r,a){var s=t._,o=t.matrix,u=s.fillpos,c=t.node,f=c.style,d=1,g="",m=b/e,v=b/n;if(f.visibility="hidden",e&&n){if(c.coordsize=l(m)+p+l(v),f.rotation=a*(0>e*n?-1:1),a){var y=S(a,i,r);i=y.dx,r=y.dy}if(0>e&&(g+="x"),0>n&&(g+=" y")&&(d=-1),f.flip=g,c.coordorigin=i*-m+p+r*-v,u||s.fillsize){var x=c.getElementsByTagName(h);x=x&&x[0],c.removeChild(x),u&&(y=S(a,o.x(u[0],u[1]),o.y(u[0],u[1])),x.position=y.dx*d+p+y.dy*d),s.fillsize&&(x.size=s.fillsize[0]*l(e)+p+s.fillsize[1]*l(n)),c.appendChild(x)}f.visibility="visible"}};t.toString=function(){return"Your browser doesnâ€™t support SVG. Falling down to VML.\nYou are running RaphaÃ«l "+this.version};var C=function(t,e,i){for(var r=n(e).toLowerCase().split("-"),a=i?"end":"start",s=r.length,o="classic",l="medium",h="medium";s--;)switch(r[s]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":o=r[s];break;case"wide":case"narrow":h=r[s];break;case"long":case"short":l=r[s]}var u=t.node.getElementsByTagName("stroke")[0];u[a+"arrow"]=o,u[a+"arrowlength"]=l,u[a+"arrowwidth"]=h},T=function(r,l){r.attrs=r.attrs||{};var c=r.node,f=r.attrs,g=c.style,m=w[r.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),v=k[r.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),y=r;for(var x in l)l[e](x)&&(f[x]=l[x]);if(m&&(f.path=t._getPath[r.type](r),r._.dirty=1),l.href&&(c.href=l.href),l.title&&(c.title=l.title),l.target&&(c.target=l.target),l.cursor&&(g.cursor=l.cursor),"blur"in l&&r.blur(l.blur),(l.path&&"path"==r.type||m)&&(c.path=M(~n(f.path).toLowerCase().indexOf("r")?t._pathToAbsolute(f.path):f.path),"image"==r.type&&(r._.fillpos=[f.x,f.y],r._.fillsize=[f.width,f.height],_(r,1,1,0,0,0))),"transform"in l&&r.transform(l.transform),v){var S=+f.cx,T=+f.cy,F=+f.rx||+f.r||0,R=+f.ry||+f.r||0;c.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((S-F)*b),a((T-R)*b),a((S+F)*b),a((T+R)*b),a(S*b))}if("clip-rect"in l){var P=n(l["clip-rect"]).split(u);if(4==P.length){P[2]=+P[2]+ +P[0],P[3]=+P[3]+ +P[1];var E=c.clipRect||t._g.doc.createElement("div"),z=E.style;z.clip=t.format("rect({1}px {2}px {3}px {0}px)",P),c.clipRect||(z.position="absolute",z.top=0,z.left=0,z.width=r.paper.width+"px",z.height=r.paper.height+"px",c.parentNode.insertBefore(E,c),E.appendChild(c),c.clipRect=E)}l["clip-rect"]||c.clipRect&&(c.clipRect.style.clip="auto")}if(r.textpath){var I=r.textpath.style;l.font&&(I.font=l.font),l["font-family"]&&(I.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,d)+'"'),l["font-size"]&&(I.fontSize=l["font-size"]),l["font-weight"]&&(I.fontWeight=l["font-weight"]),l["font-style"]&&(I.fontStyle=l["font-style"])}if("arrow-start"in l&&C(y,l["arrow-start"]),"arrow-end"in l&&C(y,l["arrow-end"],1),null!=l.opacity||null!=l["stroke-width"]||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var D=c.getElementsByTagName(h),B=!1;if(D=D&&D[0],!D&&(B=D=L(h)),"image"==r.type&&l.src&&(D.src=l.src),l.fill&&(D.on=!0),(null==D.on||"none"==l.fill||null===l.fill)&&(D.on=!1),D.on&&l.fill){var H=n(l.fill).match(t._ISURL);if(H){D.parentNode==c&&c.removeChild(D),D.rotate=!0,D.src=H[1],D.type="tile";var W=r.getBBox(1);D.position=W.x+p+W.y,r._.fillpos=[W.x,W.y],t._preload(H[1],function(){r._.fillsize=[this.offsetWidth,this.offsetHeight]})}else D.color=t.getRGB(l.fill).hex,D.src=d,D.type="solid",t.getRGB(l.fill).error&&(y.type in{circle:1,ellipse:1}||"r"!=n(l.fill).charAt())&&A(y,l.fill,D)&&(f.fill="none",f.gradient=l.fill,D.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var N=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+t.getRGB(l.fill).o+1||2)-1);N=o(s(N,0),1),D.opacity=N,D.src&&(D.color="none")}c.appendChild(D);var O=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0],q=!1;!O&&(q=O=L("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(O.on=!0),("none"==l.stroke||null===l.stroke||null==O.on||0==l.stroke||0==l["stroke-width"])&&(O.on=!1);var j=t.getRGB(l.stroke);O.on&&l.stroke&&(O.color=j.hex),N=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+j.o+1||2)-1);var Y=.75*(i(l["stroke-width"])||1);if(N=o(s(N,0),1),null==l["stroke-width"]&&(Y=f["stroke-width"]),l["stroke-width"]&&(O.weight=Y),Y&&1>Y&&(N*=Y)&&(O.weight=1),O.opacity=N,l["stroke-linejoin"]&&(O.joinstyle=l["stroke-linejoin"]||"miter"),O.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(O.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),l["stroke-dasharray"]){var G={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};O.dashstyle=G[e](l["stroke-dasharray"])?G[l["stroke-dasharray"]]:d}q&&c.appendChild(O)}if("text"==y.type){y.paper.canvas.style.display=d;var X=y.paper.span,V=100,U=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);g=X.style,f.font&&(g.font=f.font),f["font-family"]&&(g.fontFamily=f["font-family"]),f["font-weight"]&&(g.fontWeight=f["font-weight"]),f["font-style"]&&(g.fontStyle=f["font-style"]),U=i(f["font-size"]||U&&U[0])||10,g.fontSize=U*V+"px",y.textpath.string&&(X.innerHTML=n(y.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var $=X.getBoundingClientRect();y.W=f.w=($.right-$.left)/V,y.H=f.h=($.bottom-$.top)/V,y.X=f.x,y.Y=f.y+y.H/2,("x"in l||"y"in l)&&(y.path.v=t.format("m{0},{1}l{2},{1}",a(f.x*b),a(f.y*b),a(f.x*b)+1));for(var Q=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,J=Q.length;J>Z;Z++)if(Q[Z]in l){y._.dirty=1;break}switch(f["text-anchor"]){case"start":y.textpath.style["v-text-align"]="left",y.bbx=y.W/2;break;case"end":y.textpath.style["v-text-align"]="right",y.bbx=-y.W/2;break;default:y.textpath.style["v-text-align"]="center",y.bbx=0}y.textpath.style["v-text-kern"]=!0}},A=function(e,a,s){e.attrs=e.attrs||{};var o=(e.attrs,Math.pow),l="linear",h=".5 .5";if(e.attrs.gradient=a,a=n(a).replace(t._radial_gradient,function(t,e,n){return l="radial",e&&n&&(e=i(e),n=i(n),o(e-.5,2)+o(n-.5,2)>.25&&(n=r.sqrt(.25-o(e-.5,2))*(2*(n>.5)-1)+.5),h=e+p+n),d}),a=a.split(/\s*\-\s*/),"linear"==l){var u=a.shift();if(u=-i(u),isNaN(u))return null}var c=t._parseDots(a);if(!c)return null;if(e=e.shape||e.node,c.length){e.removeChild(s),s.on=!0,s.method="none",s.color=c[0].color,s.color2=c[c.length-1].color;for(var f=[],g=0,m=c.length;m>g;g++)c[g].offset&&f.push(c[g].offset+p+c[g].color);s.colors=f.length?f.join():"0% "+s.color,"radial"==l?(s.type="gradientTitle",s.focus="100%",s.focussize="0 0",s.focusposition=h,s.angle=0):(s.type="gradient",s.angle=(270-u)%360),e.appendChild(s)}return 1},F=function(e,n){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=n,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!n.bottom&&(n.bottom=this),this.prev=n.top,n.top&&(n.top.next=this),n.top=this,this.next=null
  },R=t.el;F.prototype=R,R.constructor=F,R.transform=function(e){if(null==e)return this._.transform;var i,r=this.paper._viewBoxShift,a=r?"s"+[r.scale,r.scale]+"-1-1t"+[r.dx,r.dy]:d;r&&(i=e=n(e).replace(/\.{3}|\u2026/g,this._.transform||d)),t._extractTransform(this,a+e);var s,o=this.matrix.clone(),l=this.skew,h=this.node,u=~n(this.attrs.fill).indexOf("-"),c=!n(this.attrs.fill).indexOf("url(");if(o.translate(-.5,-.5),c||u||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",s=o.split(),u&&s.noRotation||!s.isSimple){h.style.filter=o.toFilter();var f=this.getBBox(),g=this.getBBox(1),m=f.x-g.x,v=f.y-g.y;h.coordorigin=m*-b+p+v*-b,_(this,1,1,m,v,0)}else h.style.filter=d,_(this,s.scalex,s.scaley,s.dx,s.dy,s.rotate);else h.style.filter=d,l.matrix=n(o),l.offset=o.offset();return i&&(this._.transform=i),this},R.rotate=function(t,e,r){if(this.removed)return this;if(null!=t){if(t=n(t).split(u),t.length-1&&(e=i(t[1]),r=i(t[2])),t=i(t[0]),null==r&&(e=r),null==e||null==r){var a=this.getBBox(1);e=a.x+a.width/2,r=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,r]])),this}},R.translate=function(t,e){return this.removed?this:(t=n(t).split(u),t.length-1&&(e=i(t[1])),t=i(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]])),this)},R.scale=function(t,e,r,a){if(this.removed)return this;if(t=n(t).split(u),t.length-1&&(e=i(t[1]),r=i(t[2]),a=i(t[3]),isNaN(r)&&(r=null),isNaN(a)&&(a=null)),t=i(t[0]),null==e&&(e=t),null==a&&(r=a),null==r||null==a)var s=this.getBBox(1);return r=null==r?s.x+s.width/2:r,a=null==a?s.y+s.height/2:a,this.transform(this._.transform.concat([["s",t,e,r,a]])),this._.dirtyT=1,this},R.hide=function(){return!this.removed&&(this.node.style.display="none"),this},R.show=function(){return!this.removed&&(this.node.style.display=d),this},R._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},R.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},R.attr=function(n,i){if(this.removed)return this;if(null==n){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==i&&t.is(n,"string")){if(n==h&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var s=n.split(u),o={},l=0,f=s.length;f>l;l++)n=s[l],o[n]=n in this.attrs?this.attrs[n]:t.is(this.paper.customAttributes[n],"function")?this.paper.customAttributes[n].def:t._availableAttrs[n];return f-1?o:o[s[0]]}if(this.attrs&&null==i&&t.is(n,"array")){for(o={},l=0,f=n.length;f>l;l++)o[n[l]]=this.attr(n[l]);return o}var p;null!=i&&(p={},p[n]=i),null==i&&t.is(n,"object")&&(p=n);for(var d in p)c("raphael.attr."+d+"."+this.id,this,p[d]);if(p){for(d in this.paper.customAttributes)if(this.paper.customAttributes[e](d)&&p[e](d)&&t.is(this.paper.customAttributes[d],"function")){var g=this.paper.customAttributes[d].apply(this,[].concat(p[d]));this.attrs[d]=p[d];for(var m in g)g[e](m)&&(p[m]=g[m])}p.text&&"text"==this.type&&(this.textpath.string=p.text),T(this,p)}return this},R.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},R.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this)},R.insertAfter=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this)},R.insertBefore=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper),this)},R.blur=function(e){var n=this.node.runtimeStyle,i=n.filter;i=i.replace(v,d),0!==+e?(this.attrs.blur=e,n.filter=i+p+f+".Blur(pixelradius="+(+e||1.5)+")",n.margin=t.format("-{0}px 0 0 -{0}px",a(+e||1.5))):(n.filter=i,n.margin=0,delete this.attrs.blur)},t._engine.path=function(t,e){var n=L("shape");n.style.cssText=x,n.coordsize=b+p+b,n.coordorigin=e.coordorigin;var i=new F(n,e),r={fill:"none",stroke:"#000"};t&&(r.path=t),i.type="path",i.path=[],i.Path=d,T(i,r),e.canvas.appendChild(n);var a=L("skew");return a.on=!0,n.appendChild(a),i.skew=a,i.transform(d),i},t._engine.rect=function(e,n,i,r,a,s){var o=t._rectPath(n,i,r,a,s),l=e.path(o),h=l.attrs;return l.X=h.x=n,l.Y=h.y=i,l.W=h.width=r,l.H=h.height=a,h.r=s,h.path=o,l.type="rect",l},t._engine.ellipse=function(t,e,n,i,r){{var a=t.path();a.attrs}return a.X=e-i,a.Y=n-r,a.W=2*i,a.H=2*r,a.type="ellipse",T(a,{cx:e,cy:n,rx:i,ry:r}),a},t._engine.circle=function(t,e,n,i){{var r=t.path();r.attrs}return r.X=e-i,r.Y=n-i,r.W=r.H=2*i,r.type="circle",T(r,{cx:e,cy:n,r:i}),r},t._engine.image=function(e,n,i,r,a,s){var o=t._rectPath(i,r,a,s),l=e.path(o).attr({stroke:"none"}),u=l.attrs,c=l.node,f=c.getElementsByTagName(h)[0];return u.src=n,l.X=u.x=i,l.Y=u.y=r,l.W=u.width=a,l.H=u.height=s,u.path=o,l.type="image",f.parentNode==c&&c.removeChild(f),f.rotate=!0,f.src=n,f.type="tile",l._.fillpos=[i,r],l._.fillsize=[a,s],c.appendChild(f),_(l,1,1,0,0,0),l},t._engine.text=function(e,i,r,s){var o=L("shape"),l=L("path"),h=L("textpath");i=i||0,r=r||0,s=s||"",l.v=t.format("m{0},{1}l{2},{1}",a(i*b),a(r*b),a(i*b)+1),l.textpathok=!0,h.string=n(s),h.on=!0,o.style.cssText=x,o.coordsize=b+p+b,o.coordorigin="0 0";var u=new F(o,e),c={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:s};u.shape=o,u.path=l,u.textpath=h,u.type="text",u.attrs.text=n(s),u.attrs.x=i,u.attrs.y=r,u.attrs.w=1,u.attrs.h=1,T(u,c),o.appendChild(h),o.appendChild(l),e.canvas.appendChild(o);var f=L("skew");return f.on=!0,o.appendChild(f),u.skew=f,u.transform(d),u},t._engine.setSize=function(e,n){var i=this.canvas.style;return this.width=e,this.height=n,e==+e&&(e+="px"),n==+n&&(n+="px"),i.width=e,i.height=n,i.clip="rect(0 "+e+" "+n+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,n,i,r,a){t.eve("raphael.setViewBox",this,this._viewBox,[e,n,i,r,a]);var o,l,h=this.width,u=this.height,c=1/s(i/h,r/u);return a&&(o=u/r,l=h/i,h>i*o&&(e-=(h-i*o)/2/o),u>r*l&&(n-=(u-r*l)/2/l)),this._viewBox=[e,n,i,r,!!a],this._viewBoxShift={dx:-e,dy:-n,scale:c},this.forEach(function(t){t.transform("...")}),this};var L;t._engine.initWin=function(t){var e=t.document;e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),L=function(t){return e.createElement("<rvml:"+t+' class="rvml">')}}catch(n){L=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),n=e.container,i=e.height,r=e.width,a=e.x,s=e.y;if(!n)throw new Error("VML container not found.");var o=new t._Paper,l=o.canvas=t._g.doc.createElement("div"),h=l.style;return a=a||0,s=s||0,r=r||512,i=i||342,o.width=r,o.height=i,r==+r&&(r+="px"),i==+i&&(i+="px"),o.coordsize=1e3*b+p+1e3*b,o.coordorigin="0 0",o.span=t._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(o.span),h.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",r,i),1==n?(t._g.doc.body.appendChild(l),h.left=a+"px",h.top=s+"px",h.position="absolute"):n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),o.renderfix=function(){},o},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var P=t.st;for(var E in R)R[e](E)&&!P[e](E)&&(P[E]=function(t){return function(){var e=arguments;return this.forEach(function(n){n[t].apply(n,e)})}}(E))}(window.Raphael),function(){var t,e,n,i,r=[].slice,a=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty,o=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},l=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=window.Morris={},t=jQuery,e.EventEmitter=function(){function t(){}return t.prototype.on=function(t,e){return null==this.handlers&&(this.handlers={}),null==this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this},t.prototype.fire=function(){var t,e,n,i,a,s,o;if(n=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[n]){for(s=this.handlers[n],o=[],i=0,a=s.length;a>i;i++)e=s[i],o.push(e.apply(null,t));return o}},t}(),e.commas=function(t){var e,n,i,r;return null!=t?(i=0>t?"-":"",e=Math.abs(t),n=Math.floor(e).toFixed(0),i+=n.replace(/(?=(?:\d{3})+$)(?!^)/g,","),r=e.toString(),r.length>n.length&&(i+=r.slice(n.length)),i):"-"},e.pad2=function(t){return(10>t?"0":"")+t},e.Grid=function(n){function i(e){this.resizeHandler=a(this.resizeHandler,this);var n=this;if(this.el="string"==typeof e.element?t(document.getElementById(e.element)):t(e.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=t.extend({},this.gridDefaults,this.defaults||{},e),"string"==typeof this.options.units&&(this.options.postUnits=e.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(t){var e,i,r,a,s;return i=n.el.offset(),s=t.pageX-i.left,n.selectFrom?(e=n.data[n.hitTest(Math.min(s,n.selectFrom))]._x,r=n.data[n.hitTest(Math.max(s,n.selectFrom))]._x,a=r-e,n.selectionRect.attr({x:e,width:a})):n.fire("hovermove",s,t.pageY-i.top)}),this.el.bind("mouseleave",function(){return n.selectFrom&&(n.selectionRect.hide(),n.selectFrom=null),n.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(t){var e,i;return i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],e=n.el.offset(),n.fire("hover",i.pageX-e.left,i.pageY-e.top),i}),this.el.bind("click",function(t){var e;return e=n.el.offset(),n.fire("gridclick",t.pageX-e.left,t.pageY-e.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(t){var e;return e=n.el.offset(),n.startRange(t.pageX-e.left)}),this.el.bind("mouseup",function(t){var e;return e=n.el.offset(),n.endRange(t.pageX-e.left),n.fire("hovermove",t.pageX-e.left,t.pageY-e.top)})),this.options.resize&&t(window).bind("resize",function(){return null!=n.timeoutId&&window.clearTimeout(n.timeoutId),n.timeoutId=window.setTimeout(n.resizeHandler,100)}),this.postInit&&this.postInit()}return o(i,n),i.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},i.prototype.setData=function(t,n){var i,r,a,s,o,l,h,u,c,f,p,d,g,m,v;return null==n&&(n=!0),this.options.data=t,null==t||0===t.length?(this.data=[],this.raphael.clear(),null!=this.hover&&this.hover.hide(),void 0):(d=this.cumulative?0:null,g=this.cumulative?0:null,this.options.goals.length>0&&(o=Math.min.apply(Math,this.options.goals),s=Math.max.apply(Math,this.options.goals),g=null!=g?Math.min(g,o):o,d=null!=d?Math.max(d,s):s),this.data=function(){var n,i,s;for(s=[],a=n=0,i=t.length;i>n;a=++n)h=t[a],l={src:h},l.label=h[this.options.xkey],this.options.parseTime?(l.x=e.parseDate(l.label),this.options.dateFormat?l.label=this.options.dateFormat(l.x):"number"==typeof l.label&&(l.label=new Date(l.label).toString())):(l.x=a,this.options.xLabelFormat&&(l.label=this.options.xLabelFormat(l))),c=0,l.y=function(){var t,e,n,i;for(n=this.options.ykeys,i=[],r=t=0,e=n.length;e>t;r=++t)p=n[r],m=h[p],"string"==typeof m&&(m=parseFloat(m)),null!=m&&"number"!=typeof m&&(m=null),null!=m&&(this.cumulative?c+=m:null!=d?(d=Math.max(m,d),g=Math.min(m,g)):d=g=m),this.cumulative&&null!=c&&(d=Math.max(c,d),g=Math.min(c,g)),i.push(m);return i}.call(this),s.push(l);return s}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(t,e){return(t.x>e.x)-(e.x>t.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.events=this.options.parseTime?function(){var t,n,r,a;for(r=this.options.events,a=[],t=0,n=r.length;n>t;t++)i=r[t],a.push(e.parseDate(i));return a}.call(this):this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",g),this.ymax=this.yboundary("max",d),this.ymin===this.ymax&&(g&&(this.ymin-=1),this.ymax+=1),((v=this.options.axes)===!0||"both"===v||"y"===v||this.options.grid===!0)&&(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(u=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var t,e,n,i;for(i=[],f=t=e=this.ymin,n=this.ymax;u>0?n>=t:t>=n;f=t+=u)i.push(f);return i}.call(this))),this.dirty=!0,n?this.redraw():void 0)},i.prototype.yboundary=function(t,e){var n,i;return n=this.options["y"+t],"string"==typeof n?"auto"===n.slice(0,4)?n.length>5?(i=parseInt(n.slice(5),10),null==e?i:Math[t](e,i)):null!=e?e:0:parseInt(n,10):n},i.prototype.autoGridLines=function(t,e,n){var i,r,a,s,o,l,h,u,c;return o=e-t,c=Math.floor(Math.log(o)/Math.log(10)),h=Math.pow(10,c),r=Math.floor(t/h)*h,i=Math.ceil(e/h)*h,l=(i-r)/(n-1),1===h&&l>1&&Math.ceil(l)!==l&&(l=Math.ceil(l),i=r+l*(n-1)),0>r&&i>0&&(r=Math.floor(t/l)*l,i=Math.ceil(e/l)*l),1>l?(s=Math.floor(Math.log(l)/Math.log(10)),a=function(){var t,e;for(e=[],u=t=r;l>0?i>=t:t>=i;u=t+=l)e.push(parseFloat(u.toFixed(1-s)));return e}()):a=function(){var t,e;for(e=[],u=t=r;l>0?i>=t:t>=i;u=t+=l)e.push(u);return e}(),a},i.prototype._calc=function(){var t,e,n,i,r,a,s,o;return r=this.el.width(),n=this.el.height(),(this.elementWidth!==r||this.elementHeight!==n||this.dirty)&&(this.elementWidth=r,this.elementHeight=n,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,((s=this.options.axes)===!0||"both"===s||"y"===s)&&(a=function(){var t,n,i,r;for(i=this.grid,r=[],t=0,n=i.length;n>t;t++)e=i[t],r.push(this.measureText(this.yAxisFormat(e)).width);return r}.call(this),this.left+=Math.max.apply(Math,a)),((o=this.options.axes)===!0||"both"===o||"x"===o)&&(t=function(){var t,e,n;for(n=[],i=t=0,e=this.data.length;e>=0?e>t:t>e;i=e>=0?++t:--t)n.push(this.measureText(this.data[i].text,-this.options.xLabelAngle).height);return n}.call(this),this.bottom-=Math.max.apply(Math,t)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc)?this.calc():void 0},i.prototype.transY=function(t){return this.bottom-(t-this.ymin)*this.dy},i.prototype.transX=function(t){return 1===this.data.length?(this.left+this.right)/2:this.left+(t-this.xmin)*this.dx},i.prototype.redraw=function(){return this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw?this.draw():void 0},i.prototype.measureText=function(t,e){var n,i;return null==e&&(e=0),i=this.raphael.text(100,100,t).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(e),n=i.getBBox(),i.remove(),n},i.prototype.yAxisFormat=function(t){return this.yLabelFormat(t)},i.prototype.yLabelFormat=function(t){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(t):""+this.options.preUnits+e.commas(t)+this.options.postUnits},i.prototype.drawGrid=function(){var t,e,n,i,r,a,s,o;if(this.options.grid!==!1||(r=this.options.axes)===!0||"both"===r||"y"===r){for(a=this.grid,o=[],n=0,i=a.length;i>n;n++)t=a[n],e=this.transY(t),((s=this.options.axes)===!0||"both"===s||"y"===s)&&this.drawYAxisLabel(this.left-this.options.padding/2,e,this.yAxisFormat(t)),this.options.grid?o.push(this.drawGridLine("M"+this.left+","+e+"H"+(this.left+this.width))):o.push(void 0);return o}},i.prototype.drawGoals=function(){var t,e,n,i,r,a,s;for(a=this.options.goals,s=[],n=i=0,r=a.length;r>i;n=++i)e=a[n],t=this.options.goalLineColors[n%this.options.goalLineColors.length],s.push(this.drawGoal(e,t));return s},i.prototype.drawEvents=function(){var t,e,n,i,r,a,s;for(a=this.events,s=[],n=i=0,r=a.length;r>i;n=++i)e=a[n],t=this.options.eventLineColors[n%this.options.eventLineColors.length],s.push(this.drawEvent(e,t));return s},i.prototype.drawGoal=function(t,e){return this.raphael.path("M"+this.left+","+this.transY(t)+"H"+this.right).attr("stroke",e).attr("stroke-width",this.options.goalStrokeWidth)},i.prototype.drawEvent=function(t,e){return this.raphael.path("M"+this.transX(t)+","+this.bottom+"V"+this.top).attr("stroke",e).attr("stroke-width",this.options.eventStrokeWidth)},i.prototype.drawYAxisLabel=function(t,e,n){return this.raphael.text(t,e,n).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},i.prototype.drawGridLine=function(t){return this.raphael.path(t).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},i.prototype.startRange=function(t){return this.hover.hide(),this.selectFrom=t,this.selectionRect.attr({x:t,width:0}).show()},i.prototype.endRange=function(t){var e,n;return this.selectFrom?(n=Math.min(this.selectFrom,t),e=Math.max(this.selectFrom,t),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(n)].x,end:this.data[this.hitTest(e)].x}),this.selectFrom=null):void 0},i.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},i}(e.EventEmitter),e.parseDate=function(t){var e,n,i,r,a,s,o,l,h,u,c;return"number"==typeof t?t:(n=t.match(/^(\d+) Q(\d)$/),r=t.match(/^(\d+)-(\d+)$/),a=t.match(/^(\d+)-(\d+)-(\d+)$/),o=t.match(/^(\d+) W(\d+)$/),l=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),h=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),n?new Date(parseInt(n[1],10),3*parseInt(n[2],10)-1,1).getTime():r?new Date(parseInt(r[1],10),parseInt(r[2],10)-1,1).getTime():a?new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10)).getTime():o?(u=new Date(parseInt(o[1],10),0,1),4!==u.getDay()&&u.setMonth(0,1+(4-u.getDay()+7)%7),u.getTime()+6048e5*parseInt(o[2],10)):l?l[6]?(s=0,"Z"!==l[6]&&(s=60*parseInt(l[8],10)+parseInt(l[9],10),"+"===l[7]&&(s=0-s)),Date.UTC(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)+s)):new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)).getTime():h?(c=parseFloat(h[6]),e=Math.floor(c),i=Math.round(1e3*(c-e)),h[8]?(s=0,"Z"!==h[8]&&(s=60*parseInt(h[10],10)+parseInt(h[11],10),"+"===h[9]&&(s=0-s)),Date.UTC(parseInt(h[1],10),parseInt(h[2],10)-1,parseInt(h[3],10),parseInt(h[4],10),parseInt(h[5],10)+s,e,i)):new Date(parseInt(h[1],10),parseInt(h[2],10)-1,parseInt(h[3],10),parseInt(h[4],10),parseInt(h[5],10),e,i).getTime()):new Date(parseInt(t,10),0,1).getTime())},e.Hover=function(){function n(n){null==n&&(n={}),this.options=t.extend({},e.Hover.defaults,n),this.el=t("<div class='"+this.options["class"]+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return n.defaults={"class":"morris-hover morris-default-style"},n.prototype.update=function(t,e,n){return this.html,this.show(),this.moveTo(e,n)},n.prototype.html=function(t){return this.el.html(t)},n.prototype.moveTo=function(t,e){var n,i,r,a,s,o;return s=this.options.parent.innerWidth(),a=this.options.parent.innerHeight(),i=this.el.outerWidth(),n=this.el.outerHeight(),r=Math.min(Math.max(0,t-i/2),s-i),null!=e?(o=e-n-10,0>o&&(o=e+10,o+n>a&&(o=a/2-n/2))):o=a/2-n/2,this.el.css({left:r+"px",top:parseInt(o)+"px"})},n.prototype.show=function(){return this.el.show()},n.prototype.hide=function(){return this.el.hide()},n}(),e.Line=function(t){function n(t){return this.hilight=a(this.hilight,this),this.onHoverOut=a(this.onHoverOut,this),this.onHoverMove=a(this.onHoverMove,this),this.onGridClick=a(this.onGridClick,this),this instanceof e.Line?(n.__super__.constructor.call(this,t),void 0):new e.Line(t)}return o(n,t),n.prototype.init=function(){return"always"!==this.options.hideHover?(this.hover=new e.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},n.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,continuousLine:!0,hideHover:!1},n.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},n.prototype.calcPoints=function(){var t,e,n,i,r,a;for(r=this.data,a=[],n=0,i=r.length;i>n;n++)t=r[n],t._x=this.transX(t.x),t._y=function(){var n,i,r,a;for(r=t.y,a=[],n=0,i=r.length;i>n;n++)e=r[n],null!=e?a.push(this.transY(e)):a.push(e);return a}.call(this),a.push(t._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var n,i,r,a;for(r=t._y,a=[],n=0,i=r.length;i>n;n++)e=r[n],null!=e&&a.push(e);return a}())));return a},n.prototype.hitTest=function(t){var e,n,i,r,a;if(0===this.data.length)return null;for(a=this.data.slice(1),e=i=0,r=a.length;r>i&&(n=a[e],!(t<(n._x+this.data[e]._x)/2));e=++i);return e},n.prototype.onGridClick=function(t,e){var n;return n=this.hitTest(t),this.fire("click",n,this.data[n].src,t,e)},n.prototype.onHoverMove=function(t){var e;return e=this.hitTest(t),this.displayHoverForRow(e)},n.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.displayHoverForRow(null):void 0},n.prototype.displayHoverForRow=function(t){var e;return null!=t?((e=this.hover).update.apply(e,this.hoverContentForRow(t)),this.hilight(t)):(this.hover.hide(),this.hilight())},n.prototype.hoverContentForRow=function(t){var e,n,i,r,a,s,o;for(i=this.data[t],e="<div class='morris-hover-row-label'>"+i.label+"</div>",o=i.y,n=a=0,s=o.length;s>a;n=++a)r=o[n],e+="<div class='morris-hover-point' style='color: "+this.colorFor(i,n,"label")+"'>\n  "+this.options.labels[n]+":\n  "+this.yLabelFormat(r)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(e=this.options.hoverCallback(t,this.options,e,i.src)),[e,i._x,i._ymax]},n.prototype.generatePaths=function(){var t,n,i,r,a;return this.paths=function(){var s,o,h,u;for(u=[],i=s=0,o=this.options.ykeys.length;o>=0?o>s:s>o;i=o>=0?++s:--s)a="boolean"==typeof this.options.smooth?this.options.smooth:(h=this.options.ykeys[i],l.call(this.options.smooth,h)>=0),n=function(){var t,e,n,a;for(n=this.data,a=[],t=0,e=n.length;e>t;t++)r=n[t],void 0!==r._y[i]&&a.push({x:r._x,y:r._y[i]});return a}.call(this),this.options.continuousLine&&(n=function(){var e,i,r;for(r=[],e=0,i=n.length;i>e;e++)t=n[e],null!==t.y&&r.push(t);return r}()),n.length>1?u.push(e.Line.createPath(n,a,this.bottom)):u.push(null);return u}.call(this)},n.prototype.draw=function(){var t;return((t=this.options.axes)===!0||"both"===t||"x"===t)&&this.drawXAxis(),this.drawSeries(),this.options.hideHover===!1?this.displayHoverForRow(this.data.length-1):void 0},n.prototype.drawXAxis=function(){var t,n,i,r,a,s,o,l,h,u,c=this;for(o=this.bottom+this.options.padding/2,a=null,r=null,t=function(t,e){var n,i,s,l,h;return n=c.drawXAxisLabel(c.transX(e),o,t),h=n.getBBox(),n.transform("r"+-c.options.xLabelAngle),i=n.getBBox(),n.transform("t0,"+i.height/2+"..."),0!==c.options.xLabelAngle&&(l=-.5*h.width*Math.cos(c.options.xLabelAngle*Math.PI/180),n.transform("t"+l+",0...")),i=n.getBBox(),(null==a||a>=i.x+i.width||null!=r&&r>=i.x)&&i.x>=0&&i.x+i.width<c.el.width()?(0!==c.options.xLabelAngle&&(s=1.25*c.options.gridTextSize/Math.sin(c.options.xLabelAngle*Math.PI/180),r=i.x-s),a=i.x-c.options.xLabelMargin):n.remove()},i=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:e.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var t,e,n,i;for(n=this.data,i=[],t=0,e=n.length;e>t;t++)s=n[t],i.push([s.label,s.x]);return i}.call(this),i.reverse(),u=[],l=0,h=i.length;h>l;l++)n=i[l],u.push(t(n[0],n[1]));return u},n.prototype.drawSeries=function(){var t,e,n,i,r,a;for(this.seriesPoints=[],t=e=i=this.options.ykeys.length-1;0>=i?0>=e:e>=0;t=0>=i?++e:--e)this._drawLineFor(t);for(a=[],t=n=r=this.options.ykeys.length-1;0>=r?0>=n:n>=0;t=0>=r?++n:--n)a.push(this._drawPointFor(t));return a},n.prototype._drawPointFor=function(t){var e,n,i,r,a,s;for(this.seriesPoints[t]=[],a=this.data,s=[],i=0,r=a.length;r>i;i++)n=a[i],e=null,null!=n._y[t]&&(e=this.drawLinePoint(n._x,n._y[t],this.colorFor(n,t,"point"),t)),s.push(this.seriesPoints[t].push(e));return s},n.prototype._drawLineFor=function(t){var e;return e=this.paths[t],null!==e?this.drawLinePath(e,this.colorFor(null,t,"line"),t):void 0},n.createPath=function(t,n,i){var r,a,s,o,l,h,u,c,f,p,d,g,m,v;for(u="",n&&(s=e.Line.gradients(t)),c={y:null},o=m=0,v=t.length;v>m;o=++m)r=t[o],null!=r.y&&(null!=c.y?n?(a=s[o],h=s[o-1],l=(r.x-c.x)/4,f=c.x+l,d=Math.min(i,c.y+l*h),p=r.x-l,g=Math.min(i,r.y-l*a),u+="C"+f+","+d+","+p+","+g+","+r.x+","+r.y):u+="L"+r.x+","+r.y:n&&null==s[o]||(u+="M"+r.x+","+r.y)),c=r;return u},n.gradients=function(t){var e,n,i,r,a,s,o,l;for(n=function(t,e){return(t.y-e.y)/(t.x-e.x)},l=[],i=s=0,o=t.length;o>s;i=++s)e=t[i],null!=e.y?(r=t[i+1]||{y:null},a=t[i-1]||{y:null},null!=a.y&&null!=r.y?l.push(n(a,r)):null!=a.y?l.push(n(a,e)):null!=r.y?l.push(n(e,r)):l.push(null)):l.push(null);return l},n.prototype.hilight=function(t){var e,n,i,r,a;if(null!==this.prevHilight&&this.prevHilight!==t)for(e=n=0,r=this.seriesPoints.length-1;r>=0?r>=n:n>=r;e=r>=0?++n:--n)this.seriesPoints[e][this.prevHilight]&&this.seriesPoints[e][this.prevHilight].animate(this.pointShrinkSeries(e));if(null!==t&&this.prevHilight!==t)for(e=i=0,a=this.seriesPoints.length-1;a>=0?a>=i:i>=a;e=a>=0?++i:--i)this.seriesPoints[e][t]&&this.seriesPoints[e][t].animate(this.pointGrowSeries(e));return this.prevHilight=t},n.prototype.colorFor=function(t,e,n){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,t,e,n):"point"===n?this.options.pointFillColors[e%this.options.pointFillColors.length]||this.options.lineColors[e%this.options.lineColors.length]:this.options.lineColors[e%this.options.lineColors.length]},n.prototype.drawXAxisLabel=function(t,e,n){return this.raphael.text(t,e,n).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},n.prototype.drawLinePath=function(t,e,n){return this.raphael.path(t).attr("stroke",e).attr("stroke-width",this.lineWidthForSeries(n))},n.prototype.drawLinePoint=function(t,e,n,i){return this.raphael.circle(t,e,this.pointSizeForSeries(i)).attr("fill",n).attr("stroke-width",this.pointStrokeWidthForSeries(i)).attr("stroke",this.pointStrokeColorForSeries(i))},n.prototype.pointStrokeWidthForSeries=function(t){return this.options.pointStrokeWidths[t%this.options.pointStrokeWidths.length]},n.prototype.pointStrokeColorForSeries=function(t){return this.options.pointStrokeColors[t%this.options.pointStrokeColors.length]},n.prototype.lineWidthForSeries=function(t){return this.options.lineWidth instanceof Array?this.options.lineWidth[t%this.options.lineWidth.length]:this.options.lineWidth},n.prototype.pointSizeForSeries=function(t){return this.options.pointSize instanceof Array?this.options.pointSize[t%this.options.pointSize.length]:this.options.pointSize},n.prototype.pointGrowSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)+3},25,"linear")},n.prototype.pointShrinkSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)},25,"linear")},n}(e.Grid),e.labelSeries=function(n,i,r,a,s){var o,l,h,u,c,f,p,d,g,m,v;if(h=200*(i-n)/r,l=new Date(n),p=e.LABEL_SPECS[a],void 0===p)for(v=e.AUTO_LABEL_ORDER,g=0,m=v.length;m>g;g++)if(u=v[g],f=e.LABEL_SPECS[u],h>=f.span){p=f;break}for(void 0===p&&(p=e.LABEL_SPECS.second),s&&(p=t.extend({},p,{fmt:s})),o=p.start(l),c=[];(d=o.getTime())<=i;)d>=n&&c.push([p.fmt(o),d]),p.incr(o);return c},n=function(t){return{span:60*t*1e3,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours())},fmt:function(t){return""+e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())},incr:function(e){return e.setUTCMinutes(e.getUTCMinutes()+t)}}},i=function(t){return{span:1e3*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes())},fmt:function(t){return""+e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())+":"+e.pad2(t.getSeconds())},incr:function(e){return e.setUTCSeconds(e.getUTCSeconds()+t)}}},e.LABEL_SPECS={decade:{span:1728e8,start:function(t){return new Date(t.getFullYear()-t.getFullYear()%10,0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+10)}},year:{span:1728e7,start:function(t){return new Date(t.getFullYear(),0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+1)}},month:{span:24192e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),1)},fmt:function(t){return""+t.getFullYear()+"-"+e.pad2(t.getMonth()+1)},incr:function(t){return t.setMonth(t.getMonth()+1)}},week:{span:6048e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return""+t.getFullYear()+"-"+e.pad2(t.getMonth()+1)+"-"+e.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+7)}},day:{span:864e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return""+t.getFullYear()+"-"+e.pad2(t.getMonth()+1)+"-"+e.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+1)}},hour:n(60),"30min":n(30),"15min":n(15),"10min":n(10),"5min":n(5),minute:n(1),"30sec":i(30),"15sec":i(15),"10sec":i(10),"5sec":i(5),second:i(1)},e.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],e.Area=function(n){function i(n){var a;return this instanceof e.Area?(a=t.extend({},r,n),this.cumulative=!a.behaveLikeLine,"auto"===a.fillOpacity&&(a.fillOpacity=a.behaveLikeLine?.8:1),i.__super__.constructor.call(this,a),void 0):new e.Area(n)}var r;return o(i,n),r={fillOpacity:"auto",behaveLikeLine:!1},i.prototype.calcPoints=function(){var t,e,n,i,r,a,s;for(a=this.data,s=[],i=0,r=a.length;r>i;i++)t=a[i],t._x=this.transX(t.x),e=0,t._y=function(){var i,r,a,s;for(a=t.y,s=[],i=0,r=a.length;r>i;i++)n=a[i],this.options.behaveLikeLine?s.push(this.transY(n)):(e+=n||0,s.push(this.transY(e)));
  return s}.call(this),s.push(t._ymax=Math.max.apply(Math,t._y));return s},i.prototype.drawSeries=function(){var t,e,n,i,r,a,s,o;for(this.seriesPoints=[],e=this.options.behaveLikeLine?function(){a=[];for(var t=0,e=this.options.ykeys.length-1;e>=0?e>=t:t>=e;e>=0?t++:t--)a.push(t);return a}.apply(this):function(){s=[];for(var t=r=this.options.ykeys.length-1;0>=r?0>=t:t>=0;0>=r?t++:t--)s.push(t);return s}.apply(this),o=[],n=0,i=e.length;i>n;n++)t=e[n],this._drawFillFor(t),this._drawLineFor(t),o.push(this._drawPointFor(t));return o},i.prototype._drawFillFor=function(t){var e;return e=this.paths[t],null!==e?(e+="L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(e,this.fillForSeries(t))):void 0},i.prototype.fillForSeries=function(t){var e;return e=Raphael.rgb2hsl(this.colorFor(this.data[t],t,"line")),Raphael.hsl(e.h,this.options.behaveLikeLine?.9*e.s:.75*e.s,Math.min(.98,this.options.behaveLikeLine?1.2*e.l:1.25*e.l))},i.prototype.drawFilledPath=function(t,e){return this.raphael.path(t).attr("fill",e).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},i}(e.Line),e.Bar=function(n){function i(n){return this.onHoverOut=a(this.onHoverOut,this),this.onHoverMove=a(this.onHoverMove,this),this.onGridClick=a(this.onGridClick,this),this instanceof e.Bar?(i.__super__.constructor.call(this,t.extend({},n,{parseTime:!1})),void 0):new e.Bar(n)}return o(i,n),i.prototype.init=function(){return this.cumulative=this.options.stacked,"always"!==this.options.hideHover?(this.hover=new e.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)):void 0},i.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},i.prototype.calc=function(){var t;return this.calcBars(),this.options.hideHover===!1?(t=this.hover).update.apply(t,this.hoverContentForRow(this.data.length-1)):void 0},i.prototype.calcBars=function(){var t,e,n,i,r,a,s;for(a=this.data,s=[],t=i=0,r=a.length;r>i;t=++i)e=a[t],e._x=this.left+this.width*(t+.5)/this.data.length,s.push(e._y=function(){var t,i,r,a;for(r=e.y,a=[],t=0,i=r.length;i>t;t++)n=r[t],null!=n?a.push(this.transY(n)):a.push(null);return a}.call(this));return s},i.prototype.draw=function(){var t;return((t=this.options.axes)===!0||"both"===t||"x"===t)&&this.drawXAxis(),this.drawSeries()},i.prototype.drawXAxis=function(){var t,e,n,i,r,a,s,o,l,h,u,c,f;for(h=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),s=null,a=null,f=[],t=u=0,c=this.data.length;c>=0?c>u:u>c;t=c>=0?++u:--u)o=this.data[this.data.length-1-t],e=this.drawXAxisLabel(o._x,h,o.label),l=e.getBBox(),e.transform("r"+-this.options.xLabelAngle),n=e.getBBox(),e.transform("t0,"+n.height/2+"..."),0!==this.options.xLabelAngle&&(r=-.5*l.width*Math.cos(this.options.xLabelAngle*Math.PI/180),e.transform("t"+r+",0...")),(null==s||s>=n.x+n.width||null!=a&&a>=n.x)&&n.x>=0&&n.x+n.width<this.el.width()?(0!==this.options.xLabelAngle&&(i=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),a=n.x-i),f.push(s=n.x-this.options.xLabelMargin)):f.push(e.remove());return f},i.prototype.drawSeries=function(){var t,e,n,i,r,a,s,o,l,h,u,c,f,p;return n=this.width/this.options.data.length,o=null!=this.options.stacked?1:this.options.ykeys.length,t=(n*this.options.barSizeRatio-this.options.barGap*(o-1))/o,s=n*(1-this.options.barSizeRatio)/2,p=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var o,d,g,m;for(g=this.data,m=[],i=o=0,d=g.length;d>o;i=++o)l=g[i],r=0,m.push(function(){var o,d,g,m;for(g=l._y,m=[],h=o=0,d=g.length;d>o;h=++o)f=g[h],null!==f?(p?(c=Math.min(f,p),e=Math.max(f,p)):(c=f,e=this.bottom),a=this.left+i*n+s,this.options.stacked||(a+=h*(t+this.options.barGap)),u=e-c,this.options.stacked&&(c-=r),this.drawBar(a,c,t,u,this.colorFor(l,h,"bar"),this.options.barOpacity,this.options.barRadius),m.push(r+=u)):m.push(null);return m}.call(this));return m}.call(this)},i.prototype.colorFor=function(t,e,n){var i,r;return"function"==typeof this.options.barColors?(i={x:t.x,y:t.y[e],label:t.label},r={index:e,key:this.options.ykeys[e],label:this.options.labels[e]},this.options.barColors.call(this,i,r,n)):this.options.barColors[e%this.options.barColors.length]},i.prototype.hitTest=function(t){return 0===this.data.length?null:(t=Math.max(Math.min(t,this.right),this.left),Math.min(this.data.length-1,Math.floor((t-this.left)/(this.width/this.data.length))))},i.prototype.onGridClick=function(t,e){var n;return n=this.hitTest(t),this.fire("click",n,this.data[n].src,t,e)},i.prototype.onHoverMove=function(t){var e,n;return e=this.hitTest(t),(n=this.hover).update.apply(n,this.hoverContentForRow(e))},i.prototype.onHoverOut=function(){return this.options.hideHover!==!1?this.hover.hide():void 0},i.prototype.hoverContentForRow=function(t){var e,n,i,r,a,s,o,l;for(i=this.data[t],e="<div class='morris-hover-row-label'>"+i.label+"</div>",l=i.y,n=s=0,o=l.length;o>s;n=++s)a=l[n],e+="<div class='morris-hover-point' style='color: "+this.colorFor(i,n,"label")+"'>\n  "+this.options.labels[n]+":\n  "+this.yLabelFormat(a)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(e=this.options.hoverCallback(t,this.options,e,i.src)),r=this.left+(t+.5)*this.width/this.data.length,[e,r]},i.prototype.drawXAxisLabel=function(t,e,n){var i;return i=this.raphael.text(t,e,n).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},i.prototype.drawBar=function(t,e,n,i,r,a,s){var o,l;return o=Math.max.apply(Math,s),l=0===o||o>i?this.raphael.rect(t,e,n,i):this.raphael.path(this.roundedRect(t,e,n,i,s)),l.attr("fill",r).attr("fill-opacity",a).attr("stroke","none")},i.prototype.roundedRect=function(t,e,n,i,r){return null==r&&(r=[0,0,0,0]),["M",t,r[0]+e,"Q",t,e,t+r[0],e,"L",t+n-r[1],e,"Q",t+n,e,t+n,e+r[1],"L",t+n,e+i-r[2],"Q",t+n,e+i,t+n-r[2],e+i,"L",t+r[3],e+i,"Q",t,e+i,t,e+i-r[3],"Z"]},i}(e.Grid),e.Donut=function(n){function i(n){this.resizeHandler=a(this.resizeHandler,this),this.select=a(this.select,this),this.click=a(this.click,this);var i=this;if(!(this instanceof e.Donut))return new e.Donut(n);if(this.options=t.extend({},this.defaults,n),this.el="string"==typeof n.element?t(document.getElementById(n.element)):t(n.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==n.data&&0!==n.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&t(window).bind("resize",function(){return null!=i.timeoutId&&window.clearTimeout(i.timeoutId),i.timeoutId=window.setTimeout(i.resizeHandler,100)}),this.setData(n.data))}return o(i,n),i.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:e.commas,resize:!1},i.prototype.redraw=function(){var t,n,i,r,a,s,o,l,h,u,c,f,p,d,g,m,v,y,x,b,w,k,M;for(this.raphael.clear(),n=this.el.width()/2,i=this.el.height()/2,p=(Math.min(n,i)-10)/3,c=0,b=this.values,d=0,v=b.length;v>d;d++)f=b[d],c+=f;for(l=5/(2*p),t=1.9999*Math.PI-l*this.data.length,s=0,a=0,this.segments=[],w=this.values,r=g=0,y=w.length;y>g;r=++g)f=w[r],h=s+l+t*(f/c),u=new e.DonutSegment(n,i,2*p,p,s,h,this.data[r].color||this.options.colors[a%this.options.colors.length],this.options.backgroundColor,a,this.raphael),u.render(),this.segments.push(u),u.on("hover",this.select),u.on("click",this.click),s=h,a+=1;for(this.text1=this.drawEmptyDonutLabel(n,i-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(n,i+10,this.options.labelColor,14),o=Math.max.apply(Math,this.values),a=0,k=this.values,M=[],m=0,x=k.length;x>m;m++){if(f=k[m],f===o){this.select(a);break}M.push(a+=1)}return M},i.prototype.setData=function(t){var e;return this.data=t,this.values=function(){var t,n,i,r;for(i=this.data,r=[],t=0,n=i.length;n>t;t++)e=i[t],r.push(parseFloat(e.value));return r}.call(this),this.redraw()},i.prototype.click=function(t){return this.fire("click",t,this.data[t])},i.prototype.select=function(t){var e,n,i,r,a,s;for(s=this.segments,r=0,a=s.length;a>r;r++)n=s[r],n.deselect();return i=this.segments[t],i.select(),e=this.data[t],this.setLabels(e.label,this.options.formatter(e.value,e))},i.prototype.setLabels=function(t,e){var n,i,r,a,s,o,l,h;return n=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,a=1.8*n,r=n/2,i=n/3,this.text1.attr({text:t,transform:""}),s=this.text1.getBBox(),o=Math.min(a/s.width,r/s.height),this.text1.attr({transform:"S"+o+","+o+","+(s.x+s.width/2)+","+(s.y+s.height)}),this.text2.attr({text:e,transform:""}),l=this.text2.getBBox(),h=Math.min(a/l.width,i/l.height),this.text2.attr({transform:"S"+h+","+h+","+(l.x+l.width/2)+","+l.y})},i.prototype.drawEmptyDonutLabel=function(t,e,n,i,r){var a;return a=this.raphael.text(t,e,"").attr("font-size",i).attr("fill",n),null!=r&&a.attr("font-weight",r),a},i.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},i}(e.EventEmitter),e.DonutSegment=function(t){function e(t,e,n,i,r,s,o,l,h,u){this.cx=t,this.cy=e,this.inner=n,this.outer=i,this.color=o,this.backgroundColor=l,this.index=h,this.raphael=u,this.deselect=a(this.deselect,this),this.select=a(this.select,this),this.sin_p0=Math.sin(r),this.cos_p0=Math.cos(r),this.sin_p1=Math.sin(s),this.cos_p1=Math.cos(s),this.is_long=s-r>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return o(e,t),e.prototype.calcArcPoints=function(t){return[this.cx+t*this.sin_p0,this.cy+t*this.cos_p0,this.cx+t*this.sin_p1,this.cy+t*this.cos_p1]},e.prototype.calcSegment=function(t,e){var n,i,r,a,s,o,l,h,u,c;return u=this.calcArcPoints(t),n=u[0],r=u[1],i=u[2],a=u[3],c=this.calcArcPoints(e),s=c[0],l=c[1],o=c[2],h=c[3],"M"+n+","+r+("A"+t+","+t+",0,"+this.is_long+",0,"+i+","+a)+("L"+o+","+h)+("A"+e+","+e+",0,"+this.is_long+",1,"+s+","+l)+"Z"},e.prototype.calcArc=function(t){var e,n,i,r,a;return a=this.calcArcPoints(t),e=a[0],i=a[1],n=a[2],r=a[3],"M"+e+","+i+("A"+t+","+t+",0,"+this.is_long+",0,"+n+","+r)},e.prototype.render=function(){var t=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return t.fire("hover",t.index)},function(){return t.fire("click",t.index)})},e.prototype.drawDonutArc=function(t,e){return this.raphael.path(t).attr({stroke:e,"stroke-width":2,opacity:0})},e.prototype.drawDonutSegment=function(t,e,n,i,r){return this.raphael.path(t).attr({fill:e,stroke:n,"stroke-width":3}).hover(i).click(r)},e.prototype.select=function(){return this.selected?void 0:(this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0)},e.prototype.deselect=function(){return this.selected?(this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1):void 0},e}(e.EventEmitter)}.call(this),d3=function(){function t(t){return null!=t&&!isNaN(t)}function e(t){return t.length}function n(t){for(var e=1;t*e%1;)e*=10;return e}function i(t,e){try{for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}catch(i){t.prototype=e}}function r(){}function a(){}function s(t,e,n){return function(){var i=n.apply(e,arguments);return i===e?t:i}}function o(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.substring(1);for(var n=0,i=Es.length;i>n;++n){var r=Es[n]+e;if(r in t)return r}}function l(){}function h(){}function u(t){function e(){for(var e,i=n,r=-1,a=i.length;++r<a;)(e=i[r].on)&&e.apply(this,arguments);return t}var n=[],i=new r;return e.on=function(e,r){var a,s=i.get(e);return arguments.length<2?s&&s.on:(s&&(s.on=null,n=n.slice(0,a=n.indexOf(s)).concat(n.slice(a+1)),i.remove(e)),r&&n.push(i.set(e,{on:r})),t)},e}function c(){vs.event.preventDefault()}function f(){for(var t,e=vs.event;t=e.sourceEvent;)e=t;return e}function p(t){for(var e=new h,n=0,i=arguments.length;++n<i;)e[arguments[n]]=u(e);return e.of=function(n,i){return function(r){try{var a=r.sourceEvent=vs.event;r.target=t,vs.event=r,e[r.type].apply(n,i)}finally{vs.event=a}}},e}function d(t){return Is(t,Ns),t}function g(t){return"function"==typeof t?t:function(){return Ds(t,this)}}function m(t){return"function"==typeof t?t:function(){return Bs(t,this)}}function v(t,e){function n(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function r(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function o(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=vs.ns.qualify(t),null==e?t.local?i:n:"function"==typeof e?t.local?o:s:t.local?a:r}function y(t){return t.trim().replace(/\s+/g," ")}function x(t){return new RegExp("(?:^|\\s+)"+vs.requote(t)+"(?:\\s+|$)","g")}function b(t,e){function n(){for(var n=-1;++n<r;)t[n](this,e)}function i(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}t=t.trim().split(/\s+/).map(w);var r=t.length;return"function"==typeof e?i:n}function w(t){var e=x(t);return function(n,i){if(r=n.classList)return i?r.add(t):r.remove(t);var r=n.getAttribute("class")||"";i?(e.lastIndex=0,e.test(r)||n.setAttribute("class",y(r+" "+t))):n.setAttribute("class",y(r.replace(e," ")))}}function k(t,e,n){function i(){this.style.removeProperty(t)}function r(){this.style.setProperty(t,e,n)}function a(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}return null==e?i:"function"==typeof e?a:r}function M(t,e){function n(){delete this[t]}function i(){this[t]=e}function r(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?r:i}function S(t){return"function"==typeof t?t:(t=vs.ns.qualify(t)).local?function(){return bs.createElementNS(t.space,t.local)}:function(){return bs.createElementNS(this.namespaceURI,t)}}function _(t){return{__data__:t}}function C(t){return function(){return Ws(this,t)}}function T(t){return arguments.length||(t=vs.ascending),function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function A(t,e){for(var n=0,i=t.length;i>n;n++)for(var r,a=t[n],s=0,o=a.length;o>s;s++)(r=a[s])&&e(r,s,n);return t}function F(t){return Is(t,qs),t}function R(t){var e,n;return function(i,r,a){var s,o=t[a].update,l=o.length;for(a!=n&&(n=a,e=0),r>=e&&(e=r+1);!(s=o[e])&&++e<l;);return s}}function L(){var t=this.__transition__;t&&++t.active}function P(t,e,n){function i(){var e=this[s];e&&(this.removeEventListener(t,e,e.$),delete this[s])}function r(){var r=h(e,xs(arguments));i.call(this),this.addEventListener(t,this[s]=r,r.$=n),r._=e}function a(){var e,n=new RegExp("^__on([^.]+)"+vs.requote(t)+"$");for(var i in this)if(e=i.match(n)){var r=this[i];this.removeEventListener(e[1],r,r.$),delete this[i]}}var s="__on"+t,o=t.indexOf("."),h=E;o>0&&(t=t.substring(0,o));var u=Ys.get(t);return u&&(t=u,h=z),o?e?r:i:e?l:a}function E(t,e){return function(n){var i=vs.event;vs.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{vs.event=i}}}function z(t,e){var n=E(t,e);return function(t){var e=this,i=t.relatedTarget;i&&(i===e||8&i.compareDocumentPosition(e))||n.call(e,t)}}function I(){var t=".dragsuppress-"+ ++Xs,e="touchmove"+t,n="selectstart"+t,i="dragstart"+t,r="click"+t,a=vs.select(ks).on(e,c).on(n,c).on(i,c),s=ws.style,o=s[Gs];return s[Gs]="none",function(e){function n(){a.on(r,null)}a.on(t,null),s[Gs]=o,e&&(a.on(r,function(){c(),n()},!0),setTimeout(n,0))}}function D(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Vs&&(ks.scrollX||ks.scrollY)){n=vs.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var r=n[0][0].getScreenCTM();Vs=!(r.f||r.e),n.remove()}return Vs?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}function B(t){return t>0?1:0>t?-1:0}function H(t){return t>1?0:-1>t?Us:Math.acos(t)}function W(t){return t>1?Qs:-1>t?-Qs:Math.asin(t)}function N(t){return((t=Math.exp(t))-1/t)/2}function O(t){return((t=Math.exp(t))+1/t)/2}function q(t){return((t=Math.exp(2*t))-1)/(t+1)}function j(t){return(t=Math.sin(t/2))*t}function Y(){}function G(t,e,n){return new X(t,e,n)}function X(t,e,n){this.h=t,this.s=e,this.l=n}function V(t,e,n){function i(t){return t>360?t-=360:0>t&&(t+=360),60>t?a+(s-a)*t/60:180>t?s:240>t?a+(s-a)*(240-t)/60:a}function r(t){return Math.round(255*i(t))}var a,s;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,s=.5>=n?n*(1+e):n+e-n*e,a=2*n-s,se(r(t+120),r(t),r(t-120))}function U(t,e,n){return new $(t,e,n)}function $(t,e,n){this.h=t,this.c=e,this.l=n}function Q(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),Z(n,Math.cos(t*=Ks)*e,Math.sin(t)*e)}function Z(t,e,n){return new J(t,e,n)}function J(t,e,n){this.l=t,this.a=e,this.b=n}function K(t,e,n){var i=(t+16)/116,r=i+e/500,a=i-n/200;return r=ee(r)*uo,i=ee(i)*co,a=ee(a)*fo,se(ie(3.2404542*r-1.5371385*i-.4985314*a),ie(-.969266*r+1.8760108*i+.041556*a),ie(.0556434*r-.2040259*i+1.0572252*a))}function te(t,e,n){return t>0?U(Math.atan2(n,e)*to,Math.sqrt(e*e+n*n),t):U(0/0,0/0,t)}function ee(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function re(t){return se(t>>16,255&t>>8,255&t)}function ae(t){return re(t)+""}function se(t,e,n){return new oe(t,e,n)}function oe(t,e,n){this.r=t,this.g=e,this.b=n}function le(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function he(t,e,n){var i,r,a,s=0,o=0,l=0;if(i=/([a-z]+)\((.*)\)/i.exec(t))switch(r=i[2].split(","),i[1]){case"hsl":return n(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100);case"rgb":return e(pe(r[0]),pe(r[1]),pe(r[2]))}return(a=mo.get(t))?e(a.r,a.g,a.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(s=t.charAt(1),s+=s,o=t.charAt(2),o+=o,l=t.charAt(3),l+=l):7===t.length&&(s=t.substring(1,3),o=t.substring(3,5),l=t.substring(5,7)),s=parseInt(s,16),o=parseInt(o,16),l=parseInt(l,16)),e(s,o,l))}function ue(t,e,n){var i,r,a=Math.min(t/=255,e/=255,n/=255),s=Math.max(t,e,n),o=s-a,l=(s+a)/2;return o?(r=.5>l?o/(s+a):o/(2-s-a),i=t==s?(e-n)/o+(n>e?6:0):e==s?(n-t)/o+2:(t-e)/o+4,i*=60):(i=0/0,r=l>0&&1>l?0:i),G(i,r,l)}function ce(t,e,n){t=fe(t),e=fe(e),n=fe(n);var i=ne((.4124564*t+.3575761*e+.1804375*n)/uo),r=ne((.2126729*t+.7151522*e+.072175*n)/co),a=ne((.0193339*t+.119192*e+.9503041*n)/fo);return Z(116*r-16,500*(i-r),200*(r-a))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function de(t){return"function"==typeof t?t:function(){return t}}function ge(t){return t}function me(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=null),ve(e,n,t,i)}}function ve(t,e,n,i){function r(){var t,e=l.status;if(!e&&l.responseText||e>=200&&300>e||304===e){try{t=n.call(a,l)}catch(i){return s.error.call(a,i),void 0}s.load.call(a,t)}else s.error.call(a,l)}var a={},s=vs.dispatch("beforesend","progress","load","error"),o={},l=new XMLHttpRequest,h=null;return!ks.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=r:l.onreadystatechange=function(){l.readyState>3&&r()},l.onprogress=function(t){var e=vs.event;vs.event=t;try{s.progress.call(a,l)}finally{vs.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?o[t]:(null==e?delete o[t]:o[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(h=t,a):h},a.response=function(t){return n=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(xs(arguments)))}}),a.send=function(n,i,r){if(2===arguments.length&&"function"==typeof i&&(r=i,i=null),l.open(n,t,!0),null==e||"accept"in o||(o.accept=e+",*/*"),l.setRequestHeader)for(var u in o)l.setRequestHeader(u,o[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=h&&(l.responseType=h),null!=r&&a.on("error",r).on("load",function(t){r(null,t)}),s.beforesend.call(a,l),l.send(null==i?null:i),a},a.abort=function(){return l.abort(),a},vs.rebind(a,s,"on"),null==i?a:a.get(ye(i))}function ye(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function xe(){var t=we(),e=ke()-t;e>24?(isFinite(e)&&(clearTimeout(bo),bo=setTimeout(xe,e)),xo=0):(xo=1,ko(xe))}function be(t,e,n){var i=arguments.length;2>i&&(e=0),3>i&&(n=Date.now()),wo.callback=t,wo.time=n+e}function we(){var t=Date.now();for(wo=vo;wo;)t>=wo.time&&(wo.flush=wo.callback(t-wo.time)),wo=wo.next;return t}function ke(){for(var t,e=vo,n=1/0;e;)e.flush?e=t?t.next=e.next:vo=e.next:(e.time<n&&(n=e.time),e=(t=e).next);return yo=t,n}function Me(t,e){var n=Math.pow(10,3*Math.abs(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Se(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function _e(t){return t+""}function Ce(){}function Te(t,e,n){var i=n.s=t+e,r=i-t,a=i-r;n.t=t-a+(e-r)}function Ae(t,e){t&&zo.hasOwnProperty(t.type)&&zo[t.type](t,e)}function Fe(t,e,n){var i,r=-1,a=t.length-n;for(e.lineStart();++r<a;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Re(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Fe(t[n],e,1);e.polygonEnd()}function Le(){function t(t,e){t*=Ks,e=e*Ks/2+Us/4;var n=t-i,s=Math.cos(e),o=Math.sin(e),l=a*o,h=r*s+l*Math.cos(n),u=l*Math.sin(n);Do.add(Math.atan2(u,h)),i=t,r=s,a=o}var e,n,i,r,a;Bo.point=function(s,o){Bo.point=t,i=(e=s)*Ks,r=Math.cos(o=(n=o)*Ks/2+Us/4),a=Math.sin(o)},Bo.lineEnd=function(){t(e,n)}}function Pe(t){var e=t[0],n=t[1],i=Math.cos(n);return[i*Math.cos(e),i*Math.sin(e),Math.sin(n)]}function Ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ze(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ie(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function De(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Be(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function He(t){return[Math.atan2(t[1],t[0]),W(t[2])]}function We(t,e){return Math.abs(t[0]-e[0])<Zs&&Math.abs(t[1]-e[1])<Zs}function Ne(t,e){t*=Ks;var n=Math.cos(e*=Ks);Oe(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function Oe(t,e,n){++Ho,No+=(t-No)/Ho,Oo+=(e-Oo)/Ho,qo+=(n-qo)/Ho}function qe(){function t(t,r){t*=Ks;var a=Math.cos(r*=Ks),s=a*Math.cos(t),o=a*Math.sin(t),l=Math.sin(r),h=Math.atan2(Math.sqrt((h=n*l-i*o)*h+(h=i*s-e*l)*h+(h=e*o-n*s)*h),e*s+n*o+i*l);Wo+=h,jo+=h*(e+(e=s)),Yo+=h*(n+(n=o)),Go+=h*(i+(i=l)),Oe(e,n,i)}var e,n,i;$o.point=function(r,a){r*=Ks;var s=Math.cos(a*=Ks);e=s*Math.cos(r),n=s*Math.sin(r),i=Math.sin(a),$o.point=t,Oe(e,n,i)}}function je(){$o.point=Ne}function Ye(){function t(t,e){t*=Ks;var n=Math.cos(e*=Ks),s=n*Math.cos(t),o=n*Math.sin(t),l=Math.sin(e),h=r*l-a*o,u=a*s-i*l,c=i*o-r*s,f=Math.sqrt(h*h+u*u+c*c),p=i*s+r*o+a*l,d=f&&-H(p)/f,g=Math.atan2(f,p);Xo+=d*h,Vo+=d*u,Uo+=d*c,Wo+=g,jo+=g*(i+(i=s)),Yo+=g*(r+(r=o)),Go+=g*(a+(a=l)),Oe(i,r,a)}var e,n,i,r,a;$o.point=function(s,o){e=s,n=o,$o.point=t,s*=Ks;var l=Math.cos(o*=Ks);i=l*Math.cos(s),r=l*Math.sin(s),a=Math.sin(o),Oe(i,r,a)},$o.lineEnd=function(){t(e,n),$o.lineEnd=je,$o.point=Ne}}function Ge(){return!0}function Xe(t,e,n,i,r){var a=[],s=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],i=t[e];if(We(n,i)){r.lineStart();for(var o=0;e>o;++o)r.point((n=t[o])[0],n[1]);return r.lineEnd(),void 0}var l={point:n,points:t,other:null,visited:!1,entry:!0,subject:!0},h={point:n,points:[n],other:l,visited:!1,entry:!1,subject:!1};l.other=h,a.push(l),s.push(h),l={point:i,points:[i],other:null,visited:!1,entry:!1,subject:!0},h={point:i,points:[i],other:l,visited:!1,entry:!0,subject:!1},l.other=h,a.push(l),s.push(h)}}),s.sort(e),Ve(a),Ve(s),a.length){for(var o=0,l=n,h=s.length;h>o;++o)s[o].entry=l=!l;for(var u,c,f,p=a[0];;){for(u=p;u.visited;)if((u=u.next)===p)return;c=u.points,r.lineStart();do{if(u.visited=u.other.visited=!0,u.entry){if(u.subject)for(var o=0;o<c.length;o++)r.point((f=c[o])[0],f[1]);else i(u.point,u.next.point,1,r);u=u.next}else{if(u.subject){c=u.prev.points;for(var o=c.length;--o>=0;)r.point((f=c[o])[0],f[1])}else i(u.point,u.prev.point,-1,r);u=u.prev}u=u.other,c=u.points}while(!u.visited);r.lineEnd()}}}function Ve(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.next=n=t[i],n.prev=r,r=n;r.next=n=t[0],n.prev=r}}function Ue(t,e,n,i){return function(r,a){function s(e,n){var i=r(e,n);t(e=i[0],n=i[1])&&a.point(e,n)}function o(t,e){var n=r(t,e);m.point(n[0],n[1])}function l(){y.point=o,m.lineStart()}function h(){y.point=s,m.lineEnd()}function u(t,e){g.push([t,e]);var n=r(t,e);b.point(n[0],n[1])}function c(){b.lineStart(),g=[]}function f(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),n=x.buffer(),i=n.length;if(g.pop(),d.push(g),g=null,i){if(1&e){t=n[0];var r,i=t.length-1,s=-1;for(a.lineStart();++s<i;)a.point((r=t[s])[0],r[1]);return a.lineEnd(),void 0}i>1&&2&e&&n.push(n.pop().concat(n.shift())),p.push(n.filter($e))}}var p,d,g,m=e(a),v=r.invert(i[0],i[1]),y={point:s,lineStart:l,lineEnd:h,polygonStart:function(){y.point=u,y.lineStart=c,y.lineEnd=f,p=[],d=[],a.polygonStart()},polygonEnd:function(){y.point=s,y.lineStart=l,y.lineEnd=h,p=vs.merge(p);var t=Je(v,d);p.length?Xe(p,Ze,t,n,a):t&&(a.lineStart(),n(null,null,1,a),a.lineEnd()),a.polygonEnd(),p=d=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}},x=Qe(),b=e(x);return y}}function $e(t){return t.length>1}function Qe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:l,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Ze(t,e){return((t=t.point)[0]<0?t[1]-Qs-Zs:Qs-t[1])-((e=e.point)[0]<0?e[1]-Qs-Zs:Qs-e[1])}function Je(t,e){var n=t[0],i=t[1],r=[Math.sin(n),-Math.cos(n),0],a=0,s=0;Do.reset();for(var o=0,l=e.length;l>o;++o){var h=e[o],u=h.length;if(u)for(var c=h[0],f=c[0],p=c[1]/2+Us/4,d=Math.sin(p),g=Math.cos(p),m=1;;){m===u&&(m=0),t=h[m];var v=t[0],y=t[1]/2+Us/4,x=Math.sin(y),b=Math.cos(y),w=v-f,k=Math.abs(w)>Us,M=d*x;if(Do.add(Math.atan2(M*Math.sin(w),g*b+M*Math.cos(w))),a+=k?w+(w>=0?2:-2)*Us:w,k^f>=n^v>=n){var S=ze(Pe(c),Pe(t));Be(S);var _=ze(r,S);Be(_);var C=(k^w>=0?-1:1)*W(_[2]);(i>C||i===C&&(S[0]||S[1]))&&(s+=k^w>=0?1:-1)}if(!m++)break;f=v,d=x,g=b,c=t}}return(-Zs>a||Zs>a&&0>Do)^1&s}function Ke(t){var e,n=0/0,i=0/0,r=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,s){var o=a>0?Us:-Us,l=Math.abs(a-n);Math.abs(l-Us)<Zs?(t.point(n,i=(i+s)/2>0?Qs:-Qs),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),t.point(a,i),e=0):r!==o&&l>=Us&&(Math.abs(n-r)<Zs&&(n-=r*Zs),Math.abs(a-o)<Zs&&(a-=o*Zs),i=tn(n,i,a,s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),e=0),t.point(n=a,i=s),r=o},lineEnd:function(){t.lineEnd(),n=i=0/0},clean:function(){return 2-e}}}function tn(t,e,n,i){var r,a,s=Math.sin(t-n);return Math.abs(s)>Zs?Math.atan((Math.sin(e)*(a=Math.cos(i))*Math.sin(n)-Math.sin(i)*(r=Math.cos(e))*Math.sin(t))/(r*a*s)):(e+i)/2}function en(t,e,n,i){var r;if(null==t)r=n*Qs,i.point(-Us,r),i.point(0,r),i.point(Us,r),i.point(Us,0),i.point(Us,-r),i.point(0,-r),i.point(-Us,-r),i.point(-Us,0),i.point(-Us,r);else if(Math.abs(t[0]-e[0])>Zs){var a=(t[0]<e[0]?1:-1)*Us;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}function nn(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function n(t){var n,a,l,h,u;return{lineStart:function(){h=l=!1,u=1},point:function(c,f){var p,d=[c,f],g=e(c,f),m=s?g?0:r(c,f):g?r(c+(0>c?Us:-Us),f):0;if(!n&&(h=l=g)&&t.lineStart(),g!==l&&(p=i(n,d),(We(n,p)||We(d,p))&&(d[0]+=Zs,d[1]+=Zs,g=e(d[0],d[1]))),g!==l)u=0,g?(t.lineStart(),p=i(d,n),t.point(p[0],p[1])):(p=i(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(o&&n&&s^g){var v;m&a||!(v=i(d,n,!0))||(u=0,s?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||n&&We(n,d)||t.point(d[0],d[1]),n=d,l=g,a=m},lineEnd:function(){l&&t.lineEnd(),n=null},clean:function(){return u|(h&&l)<<1}}}function i(t,e,n){var i=Pe(t),r=Pe(e),s=[1,0,0],o=ze(i,r),l=Ee(o,o),h=o[0],u=l-h*h;if(!u)return!n&&t;var c=a*l/u,f=-a*h/u,p=ze(s,o),d=De(s,c),g=De(o,f);Ie(d,g);var m=p,v=Ee(d,m),y=Ee(m,m),x=v*v-y*(Ee(d,d)-1);if(!(0>x)){var b=Math.sqrt(x),w=De(m,(-v-b)/y);if(Ie(w,d),w=He(w),!n)return w;var k,M=t[0],S=e[0],_=t[1],C=e[1];M>S&&(k=M,M=S,S=k);var T=S-M,A=Math.abs(T-Us)<Zs,F=A||Zs>T;if(!A&&_>C&&(k=_,_=C,C=k),F?A?_+C>0^w[1]<(Math.abs(w[0]-M)<Zs?_:C):_<=w[1]&&w[1]<=C:T>Us^(M<=w[0]&&w[0]<=S)){var R=De(m,(-v+b)/y);return Ie(R,d),[w,He(R)]}}}function r(e,n){var i=s?t:Us-t,r=0;return-i>e?r|=1:e>i&&(r|=2),-i>n?r|=4:n>i&&(r|=8),r}var a=Math.cos(t),s=a>0,o=Math.abs(a)>Zs,l=Rn(t,6*Ks);return Ue(e,n,l,s?[0,-t]:[-Us,t-Us])}function rn(t,e,n,i){function r(i,r){return Math.abs(i[0]-t)<Zs?r>0?0:3:Math.abs(i[0]-n)<Zs?r>0?2:1:Math.abs(i[1]-e)<Zs?r>0?1:0:r>0?3:2}function a(t,e){return s(t.point,e.point)}function s(t,e){var n=r(t,1),i=r(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}function o(r,a){var s=a[0]-r[0],o=a[1]-r[1],l=[0,1];return Math.abs(s)<Zs&&Math.abs(o)<Zs?t<=r[0]&&r[0]<=n&&e<=r[1]&&r[1]<=i:an(t-r[0],s,l)&&an(r[0]-n,-s,l)&&an(e-r[1],o,l)&&an(r[1]-i,-o,l)?(l[1]<1&&(a[0]=r[0]+l[1]*s,a[1]=r[1]+l[1]*o),l[0]>0&&(r[0]+=l[0]*s,r[1]+=l[0]*o),!0):!1}return function(l){function h(t){for(var e=0,n=y.length,i=t[1],r=0;n>r;++r)for(var a,s=1,o=y[r],l=o.length,h=o[0];l>s;++s)a=o[s],h[1]<=i?a[1]>i&&u(h,a,t)>0&&++e:a[1]<=i&&u(h,a,t)<0&&--e,h=a;return 0!==e}function u(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function c(a,o,l,h){var u=0,c=0;if(null==a||(u=r(a,l))!==(c=r(o,l))||s(a,o)<0^l>0){do h.point(0===u||3===u?t:n,u>1?i:e);while((u=(u+l+4)%4)!==c)}else h.point(o[0],o[1])}function f(r,a){return r>=t&&n>=r&&a>=e&&i>=a}function p(t,e){f(t,e)&&l.point(t,e)}function d(){R.point=m,y&&y.push(x=[]),C=!0,_=!1,M=S=0/0}function g(){v&&(m(b,w),k&&_&&F.rejoin(),v.push(F.buffer())),R.point=p,_&&l.lineEnd()}function m(t,e){t=Math.max(-Zo,Math.min(Zo,t)),e=Math.max(-Zo,Math.min(Zo,e));var n=f(t,e);if(y&&x.push([t,e]),C)b=t,w=e,k=n,C=!1,n&&(l.lineStart(),l.point(t,e));else if(n&&_)l.point(t,e);else{var i=[M,S],r=[t,e];o(i,r)?(_||(l.lineStart(),l.point(i[0],i[1])),l.point(r[0],r[1]),n||l.lineEnd(),T=!1):n&&(l.lineStart(),l.point(t,e),T=!1)}M=t,S=e,_=n}var v,y,x,b,w,k,M,S,_,C,T,A=l,F=Qe(),R={point:p,lineStart:d,lineEnd:g,polygonStart:function(){l=F,v=[],y=[],T=!0},polygonEnd:function(){l=A,v=vs.merge(v);var e=h([t,i]),n=T&&e,r=v.length;(n||r)&&(l.polygonStart(),n&&(l.lineStart(),c(null,null,1,l),l.lineEnd()),r&&Xe(v,a,e,c,l),l.polygonEnd()),v=y=x=null}};return R}}function an(t,e,n){if(Math.abs(e)<Zs)return 0>=t;var i=t/e;if(e>0){if(i>n[1])return!1;i>n[0]&&(n[0]=i)}else{if(i<n[0])return!1;i<n[1]&&(n[1]=i)}return!0}function sn(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return n=e.invert(n,i),n&&t.invert(n[0],n[1])}),n}function on(t){var e=0,n=Us/3,i=kn(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Us/180,n=t[1]*Us/180):[180*(e/Us),180*(n/Us)]},r}function ln(t,e){function n(t,e){var n=Math.sqrt(a-2*r*Math.sin(e))/r;return[n*Math.sin(t*=r),s-n*Math.cos(t)]}var i=Math.sin(t),r=(i+Math.sin(e))/2,a=1+i*(2*r-i),s=Math.sqrt(a)/r;return n.invert=function(t,e){var n=s-e;return[Math.atan2(t,n)/r,W((a-(t*t+n*n)*r*r)/(2*r))]},n}function hn(){function t(t,e){Ko+=r*t-i*e,i=t,r=e}var e,n,i,r;rl.point=function(a,s){rl.point=t,e=i=a,n=r=s},rl.lineEnd=function(){t(e,n)}}function un(t,e){tl>t&&(tl=t),t>nl&&(nl=t),el>e&&(el=e),e>il&&(il=e)}function cn(){function t(t,e){s.push("M",t,",",e,a)}function e(t,e){s.push("M",t,",",e),o.point=n}function n(t,e){s.push("L",t,",",e)}function i(){o.point=t}function r(){s.push("Z")}var a=fn(4.5),s=[],o={point:t,lineStart:function(){o.point=e},lineEnd:i,polygonStart:function(){o.lineEnd=r},polygonEnd:function(){o.lineEnd=i,o.point=t},pointRadius:function(t){return a=fn(t),o
  },result:function(){if(s.length){var t=s.join("");return s=[],t}}};return o}function fn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function pn(t,e){No+=t,Oo+=e,++qo}function dn(){function t(t,i){var r=t-e,a=i-n,s=Math.sqrt(r*r+a*a);jo+=s*(e+t)/2,Yo+=s*(n+i)/2,Go+=s,pn(e=t,n=i)}var e,n;sl.point=function(i,r){sl.point=t,pn(e=i,n=r)}}function gn(){sl.point=pn}function mn(){function t(t,e){var n=t-i,a=e-r,s=Math.sqrt(n*n+a*a);jo+=s*(i+t)/2,Yo+=s*(r+e)/2,Go+=s,s=r*t-i*e,Xo+=s*(i+t),Vo+=s*(r+e),Uo+=3*s,pn(i=t,r=e)}var e,n,i,r;sl.point=function(a,s){sl.point=t,pn(e=i=a,n=r=s)},sl.lineEnd=function(){t(e,n)}}function vn(t){function e(e,n){t.moveTo(e,n),t.arc(e,n,s,0,$s)}function n(e,n){t.moveTo(e,n),o.point=i}function i(e,n){t.lineTo(e,n)}function r(){o.point=e}function a(){t.closePath()}var s=4.5,o={point:e,lineStart:function(){o.point=n},lineEnd:r,polygonStart:function(){o.lineEnd=a},polygonEnd:function(){o.lineEnd=r,o.point=e},pointRadius:function(t){return s=t,o},result:l};return o}function yn(t){function e(e){function i(n,i){n=t(n,i),e.point(n[0],n[1])}function r(){x=0/0,S.point=s,e.lineStart()}function s(i,r){var s=Pe([i,r]),o=t(i,r);n(x,b,y,w,k,M,x=o[0],b=o[1],y=i,w=s[0],k=s[1],M=s[2],a,e),e.point(x,b)}function o(){S.point=i,e.lineEnd()}function l(){r(),S.point=h,S.lineEnd=u}function h(t,e){s(c=t,f=e),p=x,d=b,g=w,m=k,v=M,S.point=s}function u(){n(x,b,y,w,k,M,p,d,c,g,m,v,a,e),S.lineEnd=o,o()}var c,f,p,d,g,m,v,y,x,b,w,k,M,S={point:i,lineStart:r,lineEnd:o,polygonStart:function(){e.polygonStart(),S.lineStart=l},polygonEnd:function(){e.polygonEnd(),S.lineStart=r}};return S}function n(e,a,s,o,l,h,u,c,f,p,d,g,m,v){var y=u-e,x=c-a,b=y*y+x*x;if(b>4*i&&m--){var w=o+p,k=l+d,M=h+g,S=Math.sqrt(w*w+k*k+M*M),_=Math.asin(M/=S),C=Math.abs(Math.abs(M)-1)<Zs?(s+f)/2:Math.atan2(k,w),T=t(C,_),A=T[0],F=T[1],R=A-e,L=F-a,P=x*R-y*L;(P*P/b>i||Math.abs((y*R+x*L)/b-.5)>.3||r>o*p+l*d+h*g)&&(n(e,a,s,o,l,h,A,F,C,w/=S,k/=S,M,m,v),v.point(A,F),n(A,F,C,w,k,M,u,c,f,p,d,g,m,v))}}var i=.5,r=Math.cos(30*Ks),a=16;return e.precision=function(t){return arguments.length?(a=(i=t*t)>0&&16,e):Math.sqrt(i)},e}function xn(t){this.stream=t}function bn(t){var e=yn(function(e,n){return t([e*to,n*to])});return function(t){var n=new xn(t=e(t));return n.point=function(e,n){t.point(e*Ks,n*Ks)},n}}function wn(t){return kn(function(){return t})()}function kn(t){function e(t){return t=o(t[0]*Ks,t[1]*Ks),[t[0]*f+l,h-t[1]*f]}function n(t){return t=o.invert((t[0]-l)/f,(h-t[1])/f),t&&[t[0]*to,t[1]*to]}function i(){o=sn(s=Cn(v,y,x),a);var t=a(g,m);return l=p-t[0]*f,h=d+t[1]*f,r()}function r(){return u&&(u.valid=!1,u=null),e}var a,s,o,l,h,u,c=yn(function(t,e){return t=a(t,e),[t[0]*f+l,h-t[1]*f]}),f=150,p=480,d=250,g=0,m=0,v=0,y=0,x=0,b=Qo,w=ge,k=null,M=null;return e.stream=function(t){return u&&(u.valid=!1),u=Mn(b(s,c(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(b=null==t?(k=t,Qo):nn((k=+t)*Ks),r()):k},e.clipExtent=function(t){return arguments.length?(M=t,w=t?rn(t[0][0],t[0][1],t[1][0],t[1][1]):ge,r()):M},e.scale=function(t){return arguments.length?(f=+t,i()):f},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],i()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*Ks,m=t[1]%360*Ks,i()):[g*to,m*to]},e.rotate=function(t){return arguments.length?(v=t[0]%360*Ks,y=t[1]%360*Ks,x=t.length>2?t[2]%360*Ks:0,i()):[v*to,y*to,x*to]},vs.rebind(e,c,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&n,i()}}function Mn(t){var e=new xn(t);return e.point=function(e,n){t.point(e*Ks,n*Ks)},e}function Sn(t,e){return[t,e]}function _n(t,e){return[t>Us?t-$s:-Us>t?t+$s:t,e]}function Cn(t,e,n){return t?e||n?sn(An(t),Fn(e,n)):An(t):e||n?Fn(e,n):_n}function Tn(t){return function(e,n){return e+=t,[e>Us?e-$s:-Us>e?e+$s:e,n]}}function An(t){var e=Tn(t);return e.invert=Tn(-t),e}function Fn(t,e){function n(t,e){var n=Math.cos(e),o=Math.cos(t)*n,l=Math.sin(t)*n,h=Math.sin(e),u=h*i+o*r;return[Math.atan2(l*a-u*s,o*i-h*r),W(u*a+l*s)]}var i=Math.cos(t),r=Math.sin(t),a=Math.cos(e),s=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),o=Math.cos(t)*n,l=Math.sin(t)*n,h=Math.sin(e),u=h*a-l*s;return[Math.atan2(l*a+h*s,o*i+u*r),W(u*i-o*r)]},n}function Rn(t,e){var n=Math.cos(t),i=Math.sin(t);return function(r,a,s,o){var l=s*e;null!=r?(r=Ln(n,r),a=Ln(n,a),(s>0?a>r:r>a)&&(r+=s*$s)):(r=t+s*$s,a=t-.5*l);for(var h,u=r;s>0?u>a:a>u;u-=l)o.point((h=He([n,-i*Math.cos(u),-i*Math.sin(u)]))[0],h[1])}}function Ln(t,e){var n=Pe(e);n[0]-=t,Be(n);var i=H(-n[1]);return((-n[2]<0?-i:i)+2*Math.PI-Zs)%(2*Math.PI)}function Pn(t,e,n){var i=vs.range(t,e-Zs,n).concat(e);return function(t){return i.map(function(e){return[t,e]})}}function En(t,e,n){var i=vs.range(t,e-Zs,n).concat(e);return function(t){return i.map(function(e){return[e,t]})}}function zn(t){return t.source}function In(t){return t.target}function Dn(t,e,n,i){var r=Math.cos(e),a=Math.sin(e),s=Math.cos(i),o=Math.sin(i),l=r*Math.cos(t),h=r*Math.sin(t),u=s*Math.cos(n),c=s*Math.sin(n),f=2*Math.asin(Math.sqrt(j(i-e)+r*s*j(n-t))),p=1/Math.sin(f),d=f?function(t){var e=Math.sin(t*=f)*p,n=Math.sin(f-t)*p,i=n*l+e*u,r=n*h+e*c,s=n*a+e*o;return[Math.atan2(r,i)*to,Math.atan2(s,Math.sqrt(i*i+r*r))*to]}:function(){return[t*to,e*to]};return d.distance=f,d}function Bn(){function t(t,r){var a=Math.sin(r*=Ks),s=Math.cos(r),o=Math.abs((t*=Ks)-e),l=Math.cos(o);ol+=Math.atan2(Math.sqrt((o=s*Math.sin(o))*o+(o=i*a-n*s*l)*o),n*a+i*s*l),e=t,n=a,i=s}var e,n,i;ll.point=function(r,a){e=r*Ks,n=Math.sin(a*=Ks),i=Math.cos(a),ll.point=t},ll.lineEnd=function(){ll.point=ll.lineEnd=l}}function Hn(t,e){function n(e,n){var i=Math.cos(e),r=Math.cos(n),a=t(i*r);return[a*r*Math.sin(e),a*Math.sin(n)]}return n.invert=function(t,n){var i=Math.sqrt(t*t+n*n),r=e(i),a=Math.sin(r),s=Math.cos(r);return[Math.atan2(t*a,i*s),Math.asin(i&&n*a/i)]},n}function Wn(t,e){function n(t,e){var n=Math.abs(Math.abs(e)-Qs)<Zs?0:s/Math.pow(r(e),a);return[n*Math.sin(a*t),s-n*Math.cos(a*t)]}var i=Math.cos(t),r=function(t){return Math.tan(Us/4+t/2)},a=t===e?Math.sin(t):Math.log(i/Math.cos(e))/Math.log(r(e)/r(t)),s=i*Math.pow(r(t),a)/a;return a?(n.invert=function(t,e){var n=s-e,i=B(a)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/a,2*Math.atan(Math.pow(s/i,1/a))-Qs]},n):On}function Nn(t,e){function n(t,e){var n=a-e;return[n*Math.sin(r*t),a-n*Math.cos(r*t)]}var i=Math.cos(t),r=t===e?Math.sin(t):(i-Math.cos(e))/(e-t),a=i/r+t;return Math.abs(r)<Zs?Sn:(n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/r,a-B(r)*Math.sqrt(t*t+n*n)]},n)}function On(t,e){return[t,Math.log(Math.tan(Us/4+e/2))]}function qn(t){var e,n=wn(t),i=n.scale,r=n.translate,a=n.clipExtent;return n.scale=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var s=a.apply(n,arguments);if(s===n){if(e=null==t){var o=Us*i(),l=r();a([[l[0]-o,l[1]-o],[l[0]+o,l[1]+o]])}}else e&&(s=null);return s},n.clipExtent(null)}function jn(t,e){var n=Math.cos(e)*Math.sin(t);return[Math.log((1+n)/(1-n))/2,Math.atan2(Math.tan(e),Math.cos(t))]}function Yn(t){function e(e){function s(){h.push("M",a(t(u),o))}for(var l,h=[],u=[],c=-1,f=e.length,p=de(n),d=de(i);++c<f;)r.call(this,l=e[c],c)?u.push([+p.call(this,l,c),+d.call(this,l,c)]):u.length&&(s(),u=[]);return u.length&&s(),h.length?h.join(""):null}var n=Gn,i=Xn,r=Ge,a=Vn,s=a.key,o=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e.defined=function(t){return arguments.length?(r=t,e):r},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?a=t:(a=dl.get(t)||Vn).key,e):s},e.tension=function(t){return arguments.length?(o=t,e):o},e}function Gn(t){return t[0]}function Xn(t){return t[1]}function Vn(t){return t.join("L")}function Un(t){return Vn(t)+"Z"}function $n(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i[0]+(i=t[e])[0])/2,"V",i[1]);return n>1&&r.push("H",i[0]),r.join("")}function Qn(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("V",(i=t[e])[1],"H",i[0]);return r.join("")}function Zn(t){for(var e=0,n=t.length,i=t[0],r=[i[0],",",i[1]];++e<n;)r.push("H",(i=t[e])[0],"V",i[1]);return r.join("")}function Jn(t,e){return t.length<4?Vn(t):t[1]+ei(t.slice(1,t.length-1),ni(t,e))}function Kn(t,e){return t.length<3?Vn(t):t[0]+ei((t.push(t[0]),t),ni([t[t.length-2]].concat(t,[t[1]]),e))}function ti(t,e){return t.length<3?Vn(t):t[0]+ei(t,ni(t,e))}function ei(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Vn(t);var n=t.length!=e.length,i="",r=t[0],a=t[1],s=e[0],o=s,l=1;if(n&&(i+="Q"+(a[0]-2*s[0]/3)+","+(a[1]-2*s[1]/3)+","+a[0]+","+a[1],r=t[1],l=2),e.length>1){o=e[1],a=t[l],l++,i+="C"+(r[0]+s[0])+","+(r[1]+s[1])+","+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1];for(var h=2;h<e.length;h++,l++)a=t[l],o=e[h],i+="S"+(a[0]-o[0])+","+(a[1]-o[1])+","+a[0]+","+a[1]}if(n){var u=t[l];i+="Q"+(a[0]+2*o[0]/3)+","+(a[1]+2*o[1]/3)+","+u[0]+","+u[1]}return i}function ni(t,e){for(var n,i=[],r=(1-e)/2,a=t[0],s=t[1],o=1,l=t.length;++o<l;)n=a,a=s,s=t[o],i.push([r*(s[0]-n[0]),r*(s[1]-n[1])]);return i}function ii(t){if(t.length<3)return Vn(t);var e=1,n=t.length,i=t[0],r=i[0],a=i[1],s=[r,r,r,(i=t[1])[0]],o=[a,a,a,i[1]],l=[r,",",a,"L",oi(vl,s),",",oi(vl,o)];for(t.push(t[n-1]);++e<=n;)i=t[e],s.shift(),s.push(i[0]),o.shift(),o.push(i[1]),li(l,s,o);return t.pop(),l.push("L",i),l.join("")}function ri(t){if(t.length<4)return Vn(t);for(var e,n=[],i=-1,r=t.length,a=[0],s=[0];++i<3;)e=t[i],a.push(e[0]),s.push(e[1]);for(n.push(oi(vl,a)+","+oi(vl,s)),--i;++i<r;)e=t[i],a.shift(),a.push(e[0]),s.shift(),s.push(e[1]),li(n,a,s);return n.join("")}function ai(t){for(var e,n,i=-1,r=t.length,a=r+4,s=[],o=[];++i<4;)n=t[i%r],s.push(n[0]),o.push(n[1]);for(e=[oi(vl,s),",",oi(vl,o)],--i;++i<a;)n=t[i%r],s.shift(),s.push(n[0]),o.shift(),o.push(n[1]),li(e,s,o);return e.join("")}function si(t,e){var n=t.length-1;if(n)for(var i,r,a=t[0][0],s=t[0][1],o=t[n][0]-a,l=t[n][1]-s,h=-1;++h<=n;)i=t[h],r=h/n,i[0]=e*i[0]+(1-e)*(a+r*o),i[1]=e*i[1]+(1-e)*(s+r*l);return ii(t)}function oi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function li(t,e,n){t.push("C",oi(gl,e),",",oi(gl,n),",",oi(ml,e),",",oi(ml,n),",",oi(vl,e),",",oi(vl,n))}function hi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ui(t){for(var e=0,n=t.length-1,i=[],r=t[0],a=t[1],s=i[0]=hi(r,a);++e<n;)i[e]=(s+(s=hi(r=a,a=t[e+1])))/2;return i[e]=s,i}function ci(t){for(var e,n,i,r,a=[],s=ui(t),o=-1,l=t.length-1;++o<l;)e=hi(t[o],t[o+1]),Math.abs(e)<Zs?s[o]=s[o+1]=0:(n=s[o]/e,i=s[o+1]/e,r=n*n+i*i,r>9&&(r=3*e/Math.sqrt(r),s[o]=r*n,s[o+1]=r*i));for(o=-1;++o<=l;)r=(t[Math.min(l,o+1)][0]-t[Math.max(0,o-1)][0])/(6*(1+s[o]*s[o])),a.push([r||0,s[o]*r||0]);return a}function fi(t){return t.length<3?Vn(t):t[0]+ei(t,ci(t))}function pi(t,e,n,i){var r,a,s,o,l,h,u;return r=i[t],a=r[0],s=r[1],r=i[e],o=r[0],l=r[1],r=i[n],h=r[0],u=r[1],(u-s)*(o-a)-(l-s)*(h-a)>0}function di(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function gi(t,e,n,i){var r=t[0],a=n[0],s=e[0]-r,o=i[0]-a,l=t[1],h=n[1],u=e[1]-l,c=i[1]-h,f=(o*(l-h)-c*(r-a))/(c*s-o*u);return[r+f*s,l+f*u]}function mi(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function vi(t,e){var n={list:t.map(function(t,e){return{index:e,x:t[0],y:t[1]}}).sort(function(t,e){return t.y<e.y?-1:t.y>e.y?1:t.x<e.x?-1:t.x>e.x?1:0}),bottomSite:null},i={list:[],leftEnd:null,rightEnd:null,init:function(){i.leftEnd=i.createHalfEdge(null,"l"),i.rightEnd=i.createHalfEdge(null,"l"),i.leftEnd.r=i.rightEnd,i.rightEnd.l=i.leftEnd,i.list.unshift(i.leftEnd,i.rightEnd)},createHalfEdge:function(t,e){return{edge:t,side:e,vertex:null,l:null,r:null}},insert:function(t,e){e.l=t,e.r=t.r,t.r.l=e,t.r=e},leftBound:function(t){var e=i.leftEnd;do e=e.r;while(e!=i.rightEnd&&r.rightOf(e,t));return e=e.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[xl[t.side]]}},r={bisect:function(t,e){var n={region:{l:t,r:e},ep:{l:null,r:null}},i=e.x-t.x,r=e.y-t.y,a=i>0?i:-i,s=r>0?r:-r;return n.c=t.x*i+t.y*r+.5*(i*i+r*r),a>s?(n.a=1,n.b=r/i,n.c/=i):(n.b=1,n.a=i/r,n.c/=r),n},intersect:function(t,e){var n=t.edge,i=e.edge;if(!n||!i||n.region.r==i.region.r)return null;var r=n.a*i.b-n.b*i.a;if(Math.abs(r)<1e-10)return null;var a,s,o=(n.c*i.b-i.c*n.b)/r,l=(i.c*n.a-n.c*i.a)/r,h=n.region.r,u=i.region.r;h.y<u.y||h.y==u.y&&h.x<u.x?(a=t,s=n):(a=e,s=i);var c=o>=s.region.r.x;return c&&"l"===a.side||!c&&"r"===a.side?null:{x:o,y:l}},rightOf:function(t,e){var n=t.edge,i=n.region.r,r=e.x>i.x;if(r&&"l"===t.side)return 1;if(!r&&"r"===t.side)return 0;if(1===n.a){var a=e.y-i.y,s=e.x-i.x,o=0,l=0;if(!r&&n.b<0||r&&n.b>=0?l=o=a>=n.b*s:(l=e.x+e.y*n.b>n.c,n.b<0&&(l=!l),l||(o=1)),!o){var h=i.x-n.region.l.x;l=n.b*(s*s-a*a)<h*a*(1+2*s/h+n.b*n.b),n.b<0&&(l=!l)}}else{var u=n.c-n.a*e.x,c=e.y-u,f=e.x-i.x,p=u-i.y;l=c*c>f*f+p*p}return"l"===t.side?l:!l},endPoint:function(t,n,i){t.ep[n]=i,t.ep[xl[n]]&&e(t)},distance:function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}},a={list:[],insert:function(t,e,n){t.vertex=e,t.ystar=e.y+n;for(var i=0,r=a.list,s=r.length;s>i;i++){var o=r[i];if(!(t.ystar>o.ystar||t.ystar==o.ystar&&e.x>o.vertex.x))break}r.splice(i,0,t)},del:function(t){for(var e=0,n=a.list,i=n.length;i>e&&n[e]!=t;++e);n.splice(e,1)},empty:function(){return 0===a.list.length},nextEvent:function(t){for(var e=0,n=a.list,i=n.length;i>e;++e)if(n[e]==t)return n[e+1];return null},min:function(){var t=a.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return a.list.shift()}};i.init(),n.bottomSite=n.list.shift();for(var s,o,l,h,u,c,f,p,d,g,m,v,y,x=n.list.shift();;)if(a.empty()||(s=a.min()),x&&(a.empty()||x.y<s.y||x.y==s.y&&x.x<s.x))o=i.leftBound(x),l=i.right(o),f=i.rightRegion(o),v=r.bisect(f,x),c=i.createHalfEdge(v,"l"),i.insert(o,c),g=r.intersect(o,c),g&&(a.del(o),a.insert(o,g,r.distance(g,x))),o=c,c=i.createHalfEdge(v,"r"),i.insert(o,c),g=r.intersect(c,l),g&&a.insert(c,g,r.distance(g,x)),x=n.list.shift();else{if(a.empty())break;o=a.extractMin(),h=i.left(o),l=i.right(o),u=i.right(l),f=i.leftRegion(o),p=i.rightRegion(l),m=o.vertex,r.endPoint(o.edge,o.side,m),r.endPoint(l.edge,l.side,m),i.del(o),a.del(l),i.del(l),y="l",f.y>p.y&&(d=f,f=p,p=d,y="r"),v=r.bisect(f,p),c=i.createHalfEdge(v,y),i.insert(h,c),r.endPoint(v,xl[y],m),g=r.intersect(h,c),g&&(a.del(h),a.insert(h,g,r.distance(g,f))),g=r.intersect(c,u),g&&a.insert(c,g,r.distance(g,f))}for(o=i.right(i.leftEnd);o!=i.rightEnd;o=i.right(o))e(o.edge)}function yi(t){return t.x}function xi(t){return t.y}function bi(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function wi(t,e,n,i,r,a){if(!t(e,n,i,r,a)){var s=.5*(n+r),o=.5*(i+a),l=e.nodes;l[0]&&wi(t,l[0],n,i,s,o),l[1]&&wi(t,l[1],s,i,r,o),l[2]&&wi(t,l[2],n,o,s,a),l[3]&&wi(t,l[3],s,o,r,a)}}function ki(t,e){t=vs.rgb(t),e=vs.rgb(e);var n=t.r,i=t.g,r=t.b,a=e.r-n,s=e.g-i,o=e.b-r;return function(t){return"#"+le(Math.round(n+a*t))+le(Math.round(i+s*t))+le(Math.round(r+o*t))}}function Mi(t,e){var n,i={},r={};for(n in t)n in e?i[n]=Ci(t[n],e[n]):r[n]=t[n];for(n in e)n in t||(r[n]=e[n]);return function(t){for(n in i)r[n]=i[n](t);return r}}function Si(t,e){return e-=t=+t,function(n){return t+e*n}}function _i(t,e){var n,i,r,a,s,o=0,l=0,h=[],u=[];for(t+="",e+="",bl.lastIndex=0,i=0;n=bl.exec(e);++i)n.index&&h.push(e.substring(o,l=n.index)),u.push({i:h.length,x:n[0]}),h.push(null),o=bl.lastIndex;for(o<e.length&&h.push(e.substring(o)),i=0,a=u.length;(n=bl.exec(t))&&a>i;++i)if(s=u[i],s.x==n[0]){if(s.i)if(null==h[s.i+1])for(h[s.i-1]+=s.x,h.splice(s.i,1),r=i+1;a>r;++r)u[r].i--;else for(h[s.i-1]+=s.x+h[s.i+1],h.splice(s.i,2),r=i+1;a>r;++r)u[r].i-=2;else if(null==h[s.i+1])h[s.i]=s.x;else for(h[s.i]=s.x+h[s.i+1],h.splice(s.i+1,1),r=i+1;a>r;++r)u[r].i--;u.splice(i,1),a--,i--}else s.x=Si(parseFloat(n[0]),parseFloat(s.x));for(;a>i;)s=u.pop(),null==h[s.i+1]?h[s.i]=s.x:(h[s.i]=s.x+h[s.i+1],h.splice(s.i+1,1)),a--;return 1===h.length?null==h[0]?(s=u[0].x,function(t){return s(t)+""}):function(){return e}:function(t){for(i=0;a>i;++i)h[(s=u[i]).i]=s.x(t);return h.join("")}}function Ci(t,e){for(var n,i=vs.interpolators.length;--i>=0&&!(n=vs.interpolators[i](t,e)););return n}function Ti(t,e){var n,i=[],r=[],a=t.length,s=e.length,o=Math.min(t.length,e.length);for(n=0;o>n;++n)i.push(Ci(t[n],e[n]));for(;a>n;++n)r[n]=t[n];for(;s>n;++n)r[n]=e[n];return function(t){for(n=0;o>n;++n)r[n]=i[n](t);return r}}function Ai(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Fi(t){return function(e){return 1-t(1-e)}}function Ri(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function Li(t){return t*t}function Pi(t){return t*t*t}function Ei(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function zi(t){return function(e){return Math.pow(e,t)}}function Ii(t){return 1-Math.cos(t*Qs)}function Di(t){return Math.pow(2,10*(t-1))}function Bi(t){return 1-Math.sqrt(1-t*t)}function Hi(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/$s*Math.asin(1/t):(t=1,n=e/4),function(i){return 1+t*Math.pow(2,-10*i)*Math.sin((i-n)*$s/e)}}function Wi(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function Ni(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Oi(t,e){t=vs.hcl(t),e=vs.hcl(e);var n=t.h,i=t.c,r=t.l,a=e.h-n,s=e.c-i,o=e.l-r;return isNaN(s)&&(s=0,i=isNaN(i)?e.c:i),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return Q(n+a*t,i+s*t,r+o*t)+""}}function qi(t,e){t=vs.hsl(t),e=vs.hsl(e);var n=t.h,i=t.s,r=t.l,a=e.h-n,s=e.s-i,o=e.l-r;return isNaN(s)&&(s=0,i=isNaN(i)?e.s:i),isNaN(a)?(a=0,n=isNaN(n)?e.h:n):a>180?a-=360:-180>a&&(a+=360),function(t){return V(n+a*t,i+s*t,r+o*t)+""}}function ji(t,e){t=vs.lab(t),e=vs.lab(e);var n=t.l,i=t.a,r=t.b,a=e.l-n,s=e.a-i,o=e.b-r;return function(t){return K(n+a*t,i+s*t,r+o*t)+""}}function Yi(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Gi(t){var e=[t.a,t.b],n=[t.c,t.d],i=Vi(e),r=Xi(e,n),a=Vi(Ui(n,e,-r))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,i*=-1,r*=-1),this.rotate=(i?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*to,this.translate=[t.e,t.f],this.scale=[i,a],this.skew=a?Math.atan2(r,a)*to:0}function Xi(t,e){return t[0]*e[0]+t[1]*e[1]}function Vi(t){var e=Math.sqrt(Xi(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Ui(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function $i(t,e){var n,i=[],r=[],a=vs.transform(t),s=vs.transform(e),o=a.translate,l=s.translate,h=a.rotate,u=s.rotate,c=a.skew,f=s.skew,p=a.scale,d=s.scale;return o[0]!=l[0]||o[1]!=l[1]?(i.push("translate(",null,",",null,")"),r.push({i:1,x:Si(o[0],l[0])},{i:3,x:Si(o[1],l[1])})):l[0]||l[1]?i.push("translate("+l+")"):i.push(""),h!=u?(h-u>180?u+=360:u-h>180&&(h+=360),r.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:Si(h,u)})):u&&i.push(i.pop()+"rotate("+u+")"),c!=f?r.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:Si(c,f)}):f&&i.push(i.pop()+"skewX("+f+")"),p[0]!=d[0]||p[1]!=d[1]?(n=i.push(i.pop()+"scale(",null,",",null,")"),r.push({i:n-4,x:Si(p[0],d[0])},{i:n-2,x:Si(p[1],d[1])})):(1!=d[0]||1!=d[1])&&i.push(i.pop()+"scale("+d+")"),n=r.length,function(t){for(var e,a=-1;++a<n;)i[(e=r[a]).i]=e.x(t);return i.join("")}}function Qi(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function Zi(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function Ji(t){for(var e=t.source,n=t.target,i=tr(e,n),r=[e];e!==i;)e=e.parent,r.push(e);for(var a=r.length;n!==i;)r.splice(a,0,n),n=n.parent;return r}function Ki(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function tr(t,e){if(t===e)return t;for(var n=Ki(t),i=Ki(e),r=n.pop(),a=i.pop(),s=null;r===a;)s=r,r=n.pop(),a=i.pop();return s}function er(t){t.fixed|=2}function nr(t){t.fixed&=-7}function ir(t){t.fixed|=4,t.px=t.x,t.py=t.y}function rr(t){t.fixed&=-5}function ar(t,e,n){var i=0,r=0;if(t.charge=0,!t.leaf)for(var a,s=t.nodes,o=s.length,l=-1;++l<o;)a=s[l],null!=a&&(ar(a,e,n),t.charge+=a.charge,i+=a.charge*a.cx,r+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var h=e*n[t.point.index];t.charge+=t.pointCharge=h,i+=h*t.point.x,r+=h*t.point.y}t.cx=i/t.charge,t.cy=r/t.charge}function sr(t,e){return vs.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=ur,t}function or(t){return t.children}function lr(t){return t.value}function hr(t,e){return e.value-t.value}function ur(t){return vs.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function cr(t){return t.x}function fr(t){return t.y}function pr(t,e,n){t.y0=e,t.y=n}function dr(t){return vs.range(t.length)}function gr(t){for(var e=-1,n=t[0].length,i=[];++e<n;)i[e]=0;return i}function mr(t){for(var e,n=1,i=0,r=t[0][1],a=t.length;a>n;++n)(e=t[n][1])>r&&(i=n,r=e);return i}function vr(t){return t.reduce(yr,0)}function yr(t,e){return t+e[1]}function xr(t,e){return br(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function br(t,e){for(var n=-1,i=+t[0],r=(t[1]-i)/e,a=[];++n<=e;)a[n]=r*n+i;return a}function wr(t){return[vs.min(t),vs.max(t)]}function kr(t,e){return t.parent==e.parent?1:2}function Mr(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function Sr(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function _r(t,e){var n=t.children;if(n&&(r=n.length))for(var i,r,a=-1;++a<r;)e(i=_r(n[a],e),t)>0&&(t=i);return t}function Cr(t,e){return t.x-e.x}function Tr(t,e){return e.x-t.x}function Ar(t,e){return t.depth-e.depth}function Fr(t,e){function n(t,i){var r=t.children;if(r&&(s=r.length))for(var a,s,o=null,l=-1;++l<s;)a=r[l],n(a,o),o=a;e(t,i)}n(t,null)}function Rr(t){for(var e,n=0,i=0,r=t.children,a=r.length;--a>=0;)e=r[a]._tree,e.prelim+=n,e.mod+=n,n+=e.shift+(i+=e.change)}function Lr(t,e,n){t=t._tree,e=e._tree;var i=n/(e.number-t.number);t.change+=i,e.change-=i,e.shift+=n,e.prelim+=n,e.mod+=n}function Pr(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}function Er(t,e){return t.value-e.value}function zr(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function Ir(t,e){t._pack_next=e,e._pack_prev=t}function Dr(t,e){var n=e.x-t.x,i=e.y-t.y,r=t.r+e.r;return.999*r*r>n*n+i*i}function Br(t){function e(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),f=Math.min(t.y-t.r,f),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(h=n.length)){var n,i,r,a,s,o,l,h,u=1/0,c=-1/0,f=1/0,p=-1/0;if(n.forEach(Hr),i=n[0],i.x=-i.r,i.y=0,e(i),h>1&&(r=n[1],r.x=r.r,r.y=0,e(r),h>2))for(a=n[2],Or(i,r,a),e(a),zr(i,a),i._pack_prev=a,zr(a,r),r=i._pack_next,s=3;h>s;s++){Or(i,r,a=n[s]);var d=0,g=1,m=1;for(o=r._pack_next;o!==r;o=o._pack_next,g++)if(Dr(o,a)){d=1;break}if(1==d)for(l=i._pack_prev;l!==o._pack_prev&&!Dr(l,a);l=l._pack_prev,m++);d?(m>g||g==m&&r.r<i.r?Ir(i,r=o):Ir(i=l,r),s--):(zr(i,a),r=a,e(a))}var v=(u+c)/2,y=(f+p)/2,x=0;for(s=0;h>s;s++)a=n[s],a.x-=v,a.y-=y,x=Math.max(x,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=x,n.forEach(Wr)}}function Hr(t){t._pack_next=t._pack_prev=t}function Wr(t){delete t._pack_next,delete t._pack_prev}function Nr(t,e,n,i){var r=t.children;if(t.x=e+=i*t.x,t.y=n+=i*t.y,t.r*=i,r)for(var a=-1,s=r.length;++a<s;)Nr(r[a],e,n,i)}function Or(t,e,n){var i=t.r+n.r,r=e.x-t.x,a=e.y-t.y;if(i&&(r||a)){var s=e.r+n.r,o=r*r+a*a;s*=s,i*=i;var l=.5+(i-s)/(2*o),h=Math.sqrt(Math.max(0,2*s*(i+o)-(i-=o)*i-s*s))/(2*o);n.x=t.x+l*r+h*a,n.y=t.y+l*a-h*r}else n.x=t.x+i,n.y=t.y}function qr(t){return 1+vs.max(t,function(t){return t.y})}function jr(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Yr(t){var e=t.children;return e&&e.length?Yr(e[0]):t}function Gr(t){var e,n=t.children;return n&&(e=n.length)?Gr(n[e-1]):t}function Xr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Vr(t,e){var n=t.x+e[3],i=t.y+e[0],r=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return 0>r&&(n+=r/2,r=0),0>a&&(i+=a/2,a=0),{x:n,y:i,dx:r,dy:a}}function Ur(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function $r(t){return t.rangeExtent?t.rangeExtent():Ur(t.range())}function Qr(t,e,n,i){var r=n(t[0],t[1]),a=i(e[0],e[1]);return function(t){return a(r(t))}}function Zr(t,e){var n,i=0,r=t.length-1,a=t[i],s=t[r];return a>s&&(n=i,i=r,r=n,n=a,a=s,s=n),t[i]=e.floor(a),t[r]=e.ceil(s),t}function Jr(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:Rl}function Kr(t,e,n,i){var r=[],a=[],s=0,o=Math.min(t.length,e.length)-1;for(t[o]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<=o;)r.push(n(t[s-1],t[s])),a.push(i(e[s-1],e[s]));return function(e){var n=vs.bisect(t,e,1,o)-1;return a[n](r[n](e))}}function ta(t,e,n,i){function r(){var r=Math.min(t.length,e.length)>2?Kr:Qr,l=i?Zi:Qi;return s=r(t,e,l,n),o=r(e,t,l,Ci),a}function a(t){return s(t)}var s,o;return a.invert=function(t){return o(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),r()):t},a.range=function(t){return arguments.length?(e=t,r()):e},a.rangeRound=function(t){return a.range(t).interpolate(Yi)},a.clamp=function(t){return arguments.length?(i=t,r()):i},a.interpolate=function(t){return arguments.length?(n=t,r()):n},a.ticks=function(e){return ra(t,e)},a.tickFormat=function(e,n){return aa(t,e,n)},a.nice=function(e){return na(t,e),r()},a.copy=function(){return ta(t,e,n,i)},r()}function ea(t,e){return vs.rebind(t,e,"range","rangeRound","interpolate","clamp")}function na(t,e){return Zr(t,Jr(ia(t,e)[2]))}function ia(t,e){null==e&&(e=10);var n=Ur(t),i=n[1]-n[0],r=Math.pow(10,Math.floor(Math.log(i/e)/Math.LN10)),a=e/i*r;return.15>=a?r*=10:.35>=a?r*=5:.75>=a&&(r*=2),n[0]=Math.ceil(n[0]/r)*r,n[1]=Math.floor(n[1]/r)*r+.5*r,n[2]=r,n}function ra(t,e){return vs.range.apply(vs,ia(t,e))}function aa(t,e,n){var i=-Math.floor(Math.log(ia(t,e)[2])/Math.LN10+.01);return vs.format(n?n.replace(Ao,function(t,e,n,r,a,s,o,l,h,u){return[e,n,r,a,s,o,l,h||"."+(i-2*("%"===u)),u].join("")}):",."+i+"f")}function sa(t,e,n,i){function r(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function s(e){return t(r(e))}return s.invert=function(e){return a(t.invert(e))},s.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((i=e.map(Number)).map(r)),s):i},s.base=function(n){return arguments.length?(e=+n,t.domain(i.map(r)),s):e},s.nice=function(){var e=Zr(i.map(r),n?Math:Pl);return t.domain(e),i=e.map(a),s},s.ticks=function(){var t=Ur(i),s=[],o=t[0],l=t[1],h=Math.floor(r(o)),u=Math.ceil(r(l)),c=e%1?2:e;if(isFinite(u-h)){if(n){for(;u>h;h++)for(var f=1;c>f;f++)s.push(a(h)*f);s.push(a(h))}else for(s.push(a(h));h++<u;)for(var f=c-1;f>0;f--)s.push(a(h)*f);for(h=0;s[h]<o;h++);for(u=s.length;s[u-1]>l;u--);s=s.slice(h,u)}return s},s.tickFormat=function(t,e){if(!arguments.length)return Ll;arguments.length<2?e=Ll:"function"!=typeof e&&(e=vs.format(e));var i,o=Math.max(.1,t/s.ticks().length),l=n?(i=1e-12,Math.ceil):(i=-1e-12,Math.floor);return function(t){return t/a(l(r(t)+i))<=o?e(t):""}},s.copy=function(){return sa(t.copy(),e,n,i)},ea(s,t)}function oa(t,e,n){function i(e){return t(r(e))}var r=la(e),a=la(1/e);return i.invert=function(e){return a(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(r)),i):n},i.ticks=function(t){return ra(n,t)},i.tickFormat=function(t,e){return aa(n,t,e)},i.nice=function(t){return i.domain(na(n,t))},i.exponent=function(s){return arguments.length?(r=la(e=s),a=la(1/e),t.domain(n.map(r)),i):e},i.copy=function(){return oa(t.copy(),e,n)},ea(i,t)}function la(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ha(t,e){function n(n){return s[((a.get(n)||"range"===e.t&&a.set(n,t.push(n)))-1)%s.length]}function i(e,n){return vs.range(t.length).map(function(t){return e+n*t})}var a,s,o;return n.domain=function(i){if(!arguments.length)return t;t=[],a=new r;for(var s,o=-1,l=i.length;++o<l;)a.has(s=i[o])||a.set(s,t.push(s));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(s=t,o=0,e={t:"range",a:arguments},n):s},n.rangePoints=function(r,a){arguments.length<2&&(a=0);var l=r[0],h=r[1],u=(h-l)/(Math.max(1,t.length-1)+a);return s=i(t.length<2?(l+h)/2:l+u*a/2,u),o=0,e={t:"rangePoints",a:arguments},n},n.rangeBands=function(r,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var h=r[1]<r[0],u=r[h-0],c=r[1-h],f=(c-u)/(t.length-a+2*l);return s=i(u+f*l,f),h&&s.reverse(),o=f*(1-a),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(r,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var h=r[1]<r[0],u=r[h-0],c=r[1-h],f=Math.floor((c-u)/(t.length-a+2*l)),p=c-u-(t.length-a)*f;return s=i(u+Math.round(p/2),f),h&&s.reverse(),o=Math.round(f*(1-a)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return o},n.rangeExtent=function(){return Ur(e.a[0])},n.copy=function(){return ha(t,e)},n.domain(t)}function ua(t,e){function n(){var n=0,a=e.length;for(r=[];++n<a;)r[n-1]=vs.quantile(t,n/a);return i}function i(t){return isNaN(t=+t)?void 0:e[vs.bisect(r,t)]}var r;return i.domain=function(e){return arguments.length?(t=e.filter(function(t){return!isNaN(t)}).sort(vs.ascending),n()):t},i.range=function(t){return arguments.length?(e=t,n()):e},i.quantiles=function(){return r},i.invertExtent=function(n){return n=e.indexOf(n),0>n?[0/0,0/0]:[n>0?r[n-1]:t[0],n<r.length?r[n]:t[t.length-1]]},i.copy=function(){return ua(t,e)},n()}function ca(t,e,n){function i(e){return n[Math.max(0,Math.min(s,Math.floor(a*(e-t))))]}function r(){return a=n.length/(e-t),s=n.length-1,i}var a,s;return i.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],r()):[t,e]},i.range=function(t){return arguments.length?(n=t,r()):n},i.invertExtent=function(e){return e=n.indexOf(e),e=0>e?0/0:e/a+t,[e,e+1/a]},i.copy=function(){return ca(t,e,n)},r()}function fa(t,e){function n(n){return n>=n?e[vs.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return fa(t,e)},n}function pa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return ra(t,e)},e.tickFormat=function(e,n){return aa(t,e,n)},e.copy=function(){return pa(t)},e}function da(t){return t.innerRadius}function ga(t){return t.outerRadius}function ma(t){return t.startAngle}function va(t){return t.endAngle}function ya(t){for(var e,n,i,r=-1,a=t.length;++r<a;)e=t[r],n=e[0],i=e[1]+Bl,e[0]=n*Math.cos(i),e[1]=n*Math.sin(i);return t}function xa(t){function e(e){function l(){g.push("M",o(t(v),c),u,h(t(m.reverse()),c),"Z")}for(var f,p,d,g=[],m=[],v=[],y=-1,x=e.length,b=de(n),w=de(r),k=n===i?function(){return p}:de(i),M=r===a?function(){return d}:de(a);++y<x;)s.call(this,f=e[y],y)?(m.push([p=+b.call(this,f,y),d=+w.call(this,f,y)]),v.push([+k.call(this,f,y),+M.call(this,f,y)])):m.length&&(l(),m=[],v=[]);return m.length&&l(),g.length?g.join(""):null}var n=Gn,i=Gn,r=0,a=Xn,s=Ge,o=Vn,l=o.key,h=o,u="L",c=.7;return e.x=function(t){return arguments.length?(n=i=t,e):i},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(r=a=t,e):a},e.y0=function(t){return arguments.length?(r=t,e):r},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(s=t,e):s},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?o=t:(o=dl.get(t)||Vn).key,h=o.reverse||o,u=o.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(c=t,e):c},e}function ba(t){return t.radius}function wa(t){return[t.x,t.y]}function ka(t){return function(){var e=t.apply(this,arguments),n=e[0],i=e[1]+Bl;return[n*Math.cos(i),n*Math.sin(i)]}}function Ma(){return 64}function Sa(){return"circle"}function _a(t){var e=Math.sqrt(t/Us);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Ca(t,e){return Is(t,Yl),t.id=e,t}function Ta(t,e,n,i){var r=t.id;return A(t,"function"==typeof n?function(t,a,s){t.__transition__[r].tween.set(e,i(n.call(t,t.__data__,a,s)))}:(n=i(n),function(t){t.__transition__[r].tween.set(e,n)}))}function Aa(t){return null==t&&(t=""),function(){this.textContent=t}}function Fa(t,e,n,i){var a=t.__transition__||(t.__transition__={active:0,count:0}),s=a[n];if(!s){var o=i.time;s=a[n]={tween:new r,time:o,ease:i.ease,delay:i.delay,duration:i.duration},++a.count,vs.timer(function(i){function r(i){return a.active>n?h():(a.active=n,s.event&&s.event.start.call(t,u,e),s.tween.forEach(function(n,i){(i=i.call(t,u,e))&&d.push(i)
  }),l(i||1)?1:(be(l,f,o),void 0))}function l(i){if(a.active!==n)return h();for(var r=i/p,o=c(r),l=d.length;l>0;)d[--l].call(t,o);return r>=1?(s.event&&s.event.end.call(t,u,e),h()):void 0}function h(){return--a.count?delete a[n]:delete t.__transition__,1}var u=t.__data__,c=s.ease,f=s.delay,p=s.duration,d=[];return i>=f?r(i-f):(be(r,f,o),void 0)},0,o)}}function Ra(t,e){t.attr("transform",function(t){return"translate("+e(t)+",0)"})}function La(t,e){t.attr("transform",function(t){return"translate(0,"+e(t)+")"})}function Pa(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ea(t,e,n){function i(e){var n=t(e),i=a(n,1);return i-e>e-n?n:i}function r(n){return e(n=t(new Zl(n-1)),1),n}function a(t,n){return e(t=new Zl(+t),n),t}function s(t,i,a){var s=r(t),o=[];if(a>1)for(;i>s;)n(s)%a||o.push(new Date(+s)),e(s,1);else for(;i>s;)o.push(new Date(+s)),e(s,1);return o}function o(t,e,n){try{Zl=Pa;var i=new Pa;return i._=t,s(i,e,n)}finally{Zl=Date}}t.floor=t,t.round=i,t.ceil=r,t.offset=a,t.range=s;var l=t.utc=za(t);return l.floor=l,l.round=za(i),l.ceil=za(r),l.offset=za(a),l.range=o,t}function za(t){return function(e,n){try{Zl=Pa;var i=new Pa;return i._=e,t(i,n)._}finally{Zl=Date}}}function Ia(t){function e(e){for(var i,r,a,s=[],o=-1,l=0;++o<n;)37===t.charCodeAt(o)&&(s.push(t.substring(l,o)),null!=(r=mh[i=t.charAt(++o)])&&(i=t.charAt(++o)),(a=vh[i])&&(i=a(e,null==r?"e"===i?" ":"0":r)),s.push(i),l=o+1);return s.push(t.substring(l,o)),s.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=Da(n,t,e,0);if(i!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&Zl!==Pa,a=new(r?Pa:Zl);return"j"in n?a.setFullYear(n.y,0,n.j):"w"in n&&("W"in n||"U"in n)?(a.setFullYear(n.y,0,1),a.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(a.getDay()+5)%7:n.w+7*n.U-(a.getDay()+6)%7)):a.setFullYear(n.y,n.m,n.d),a.setHours(n.H+Math.floor(n.Z/100),n.M+n.Z%100,n.S,n.L),r?a._:a},e.toString=function(){return t},e}function Da(t,e,n,i){for(var r,a,s,o=0,l=e.length,h=n.length;l>o;){if(i>=h)return-1;if(r=e.charCodeAt(o++),37===r){if(s=e.charAt(o++),a=yh[s in mh?e.charAt(o++):s],!a||(i=a(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}function Ba(t){return new RegExp("^(?:"+t.map(vs.requote).join("|")+")","i")}function Ha(t){for(var e=new r,n=-1,i=t.length;++n<i;)e.set(t[n].toLowerCase(),n);return e}function Wa(t,e,n){var i=0>t?"-":"",r=(i?-t:t)+"",a=r.length;return i+(n>a?new Array(n-a+1).join(e)+r:r)}function Na(t,e,n){hh.lastIndex=0;var i=hh.exec(e.substring(n));return i?(t.w=uh.get(i[0].toLowerCase()),n+i[0].length):-1}function Oa(t,e,n){oh.lastIndex=0;var i=oh.exec(e.substring(n));return i?(t.w=lh.get(i[0].toLowerCase()),n+i[0].length):-1}function qa(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function ja(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n));return i?(t.U=+i[0],n+i[0].length):-1}function Ya(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n));return i?(t.W=+i[0],n+i[0].length):-1}function Ga(t,e,n){ph.lastIndex=0;var i=ph.exec(e.substring(n));return i?(t.m=dh.get(i[0].toLowerCase()),n+i[0].length):-1}function Xa(t,e,n){ch.lastIndex=0;var i=ch.exec(e.substring(n));return i?(t.m=fh.get(i[0].toLowerCase()),n+i[0].length):-1}function Va(t,e,n){return Da(t,vh.c.toString(),e,n)}function Ua(t,e,n){return Da(t,vh.x.toString(),e,n)}function $a(t,e,n){return Da(t,vh.X.toString(),e,n)}function Qa(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Za(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.y=Ka(+i[0]),n+i[0].length):-1}function Ja(t,e,n){return/^[+-]\d{4}$/.test(e=e.substring(n,n+5))?(t.Z=+e,n+5):-1}function Ka(t){return t+(t>68?1900:2e3)}function ts(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function es(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function ns(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+3));return i?(t.j=+i[0],n+i[0].length):-1}function is(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function rs(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function as(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function ss(t,e,n){xh.lastIndex=0;var i=xh.exec(e.substring(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function os(t,e,n){var i=bh.get(e.substring(n,n+=2).toLowerCase());return null==i?-1:(t.p=i,n)}function ls(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",i=~~(Math.abs(e)/60),r=Math.abs(e)%60;return n+Wa(i,"0",2)+Wa(r,"0",2)}function hs(t,e,n){gh.lastIndex=0;var i=gh.exec(e.substring(n,n+1));return i?n+i[0].length:-1}function us(t){function e(t){try{Zl=Pa;var e=new Zl;return e._=t,n(e)}finally{Zl=Date}}var n=Ia(t);return e.parse=function(t){try{Zl=Pa;var e=n.parse(t);return e&&e._}finally{Zl=Date}},e.toString=n.toString,e}function cs(t){return t.toISOString()}function fs(t,e,n){function i(e){return t(e)}function r(t,n){var i=t[1]-t[0],r=i/n,a=vs.bisect(kh,r);return a==kh.length?[e.year,ia(t.map(function(t){return t/31536e6}),n)[2]]:a?e[r/kh[a-1]<kh[a]/r?a-1:a]:[Ch,ia(t,n)[2]]}return i.invert=function(e){return ps(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(ps)},i.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,ps(+n+1),e).length}var a=i.domain(),s=Ur(a),o=null==t?r(s,10):"number"==typeof t&&r(s,t);return o&&(t=o[0],e=o[1]),i.domain(Zr(a,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=ps(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=ps(+e+1);return e}}:t))},i.ticks=function(t,e){var n=Ur(i.domain()),a=null==t?r(n,10):"number"==typeof t?r(n,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(n[0],ps(+n[1]+1),1>e?1:e)},i.tickFormat=function(){return n},i.copy=function(){return fs(t.copy(),e,n)},ea(i,t)}function ps(t){return new Date(t)}function ds(t){return function(e){for(var n=t.length-1,i=t[n];!i[1](e);)i=t[--n];return i[0](e)}}function gs(t){return JSON.parse(t.responseText)}function ms(t){var e=bs.createRange();return e.selectNode(bs.body),e.createContextualFragment(t.responseText)}var vs={version:"3.3.6"};Date.now||(Date.now=function(){return+new Date});var ys=[].slice,xs=function(t){return ys.call(t)},bs=document,ws=bs.documentElement,ks=window;try{xs(ws.childNodes)[0].nodeType}catch(Ms){xs=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}try{bs.createElement("div").style.setProperty("opacity",0,"")}catch(Ss){var _s=ks.Element.prototype,Cs=_s.setAttribute,Ts=_s.setAttributeNS,As=ks.CSSStyleDeclaration.prototype,Fs=As.setProperty;_s.setAttribute=function(t,e){Cs.call(this,t,e+"")},_s.setAttributeNS=function(t,e,n){Ts.call(this,t,e,n+"")},As.setProperty=function(t,e,n){Fs.call(this,t,e+"",n)}}vs.ascending=function(t,e){return e>t?-1:t>e?1:t>=e?0:0/0},vs.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},vs.min=function(t,e){var n,i,r=-1,a=t.length;if(1===arguments.length){for(;++r<a&&!(null!=(n=t[r])&&n>=n);)n=void 0;for(;++r<a;)null!=(i=t[r])&&n>i&&(n=i)}else{for(;++r<a&&!(null!=(n=e.call(t,t[r],r))&&n>=n);)n=void 0;for(;++r<a;)null!=(i=e.call(t,t[r],r))&&n>i&&(n=i)}return n},vs.max=function(t,e){var n,i,r=-1,a=t.length;if(1===arguments.length){for(;++r<a&&!(null!=(n=t[r])&&n>=n);)n=void 0;for(;++r<a;)null!=(i=t[r])&&i>n&&(n=i)}else{for(;++r<a&&!(null!=(n=e.call(t,t[r],r))&&n>=n);)n=void 0;for(;++r<a;)null!=(i=e.call(t,t[r],r))&&i>n&&(n=i)}return n},vs.extent=function(t,e){var n,i,r,a=-1,s=t.length;if(1===arguments.length){for(;++a<s&&!(null!=(n=r=t[a])&&n>=n);)n=r=void 0;for(;++a<s;)null!=(i=t[a])&&(n>i&&(n=i),i>r&&(r=i))}else{for(;++a<s&&!(null!=(n=r=e.call(t,t[a],a))&&n>=n);)n=void 0;for(;++a<s;)null!=(i=e.call(t,t[a],a))&&(n>i&&(n=i),i>r&&(r=i))}return[n,r]},vs.sum=function(t,e){var n,i=0,r=t.length,a=-1;if(1===arguments.length)for(;++a<r;)isNaN(n=+t[a])||(i+=n);else for(;++a<r;)isNaN(n=+e.call(t,t[a],a))||(i+=n);return i},vs.mean=function(e,n){var i,r=e.length,a=0,s=-1,o=0;if(1===arguments.length)for(;++s<r;)t(i=e[s])&&(a+=(i-a)/++o);else for(;++s<r;)t(i=n.call(e,e[s],s))&&(a+=(i-a)/++o);return o?a:void 0},vs.quantile=function(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],a=n-i;return a?r+a*(t[i]-r):r},vs.median=function(e,n){return arguments.length>1&&(e=e.map(n)),e=e.filter(t),e.length?vs.quantile(e.sort(vs.ascending),.5):void 0},vs.bisector=function(t){return{left:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);r>i;){var a=i+r>>>1;t.call(e,e[a],a)<n?i=a+1:r=a}return i},right:function(e,n,i,r){for(arguments.length<3&&(i=0),arguments.length<4&&(r=e.length);r>i;){var a=i+r>>>1;n<t.call(e,e[a],a)?r=a:i=a+1}return i}}};var Rs=vs.bisector(function(t){return t});vs.bisectLeft=Rs.left,vs.bisect=vs.bisectRight=Rs.right,vs.shuffle=function(t){for(var e,n,i=t.length;i;)n=0|Math.random()*i--,e=t[i],t[i]=t[n],t[n]=e;return t},vs.permute=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},vs.pairs=function(t){for(var e,n=0,i=t.length-1,r=t[0],a=new Array(0>i?0:i);i>n;)a[n]=[e=r,r=t[++n]];return a},vs.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=vs.min(arguments,e),i=new Array(n);++t<n;)for(var r,a=-1,s=i[t]=new Array(r);++a<r;)s[a]=arguments[a][t];return i},vs.transpose=function(t){return vs.zip.apply(vs,t)},vs.keys=function(t){var e=[];for(var n in t)e.push(n);return e},vs.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},vs.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},vs.merge=function(t){return Array.prototype.concat.apply([],t)},vs.range=function(t,e,i){if(arguments.length<3&&(i=1,arguments.length<2&&(e=t,t=0)),1/0===(e-t)/i)throw new Error("infinite range");var r,a=[],s=n(Math.abs(i)),o=-1;if(t*=s,e*=s,i*=s,0>i)for(;(r=t+i*++o)>e;)a.push(r/s);else for(;(r=t+i*++o)<e;)a.push(r/s);return a},vs.map=function(t){var e=new r;if(t instanceof r)t.forEach(function(t,n){e.set(t,n)});else for(var n in t)e.set(n,t[n]);return e},i(r,{has:function(t){return Ls+t in this},get:function(t){return this[Ls+t]},set:function(t,e){return this[Ls+t]=e},remove:function(t){return t=Ls+t,t in this&&delete this[t]},keys:function(){var t=[];return this.forEach(function(e){t.push(e)}),t},values:function(){var t=[];return this.forEach(function(e,n){t.push(n)}),t},entries:function(){var t=[];return this.forEach(function(e,n){t.push({key:e,value:n})}),t},forEach:function(t){for(var e in this)e.charCodeAt(0)===Ps&&t.call(this,e.substring(1),this[e])}});var Ls="\x00",Ps=Ls.charCodeAt(0);vs.nest=function(){function t(e,o,l){if(l>=s.length)return i?i.call(a,o):n?o.sort(n):o;for(var h,u,c,f,p=-1,d=o.length,g=s[l++],m=new r;++p<d;)(f=m.get(h=g(u=o[p])))?f.push(u):m.set(h,[u]);return e?(u=e(),c=function(n,i){u.set(n,t(e,i,l))}):(u={},c=function(n,i){u[n]=t(e,i,l)}),m.forEach(c),u}function e(t,n){if(n>=s.length)return t;var i=[],r=o[n++];return t.forEach(function(t,r){i.push({key:t,values:e(r,n)})}),r?i.sort(function(t,e){return r(t.key,e.key)}):i}var n,i,a={},s=[],o=[];return a.map=function(e,n){return t(n,e,0)},a.entries=function(n){return e(t(vs.map,n,0),0)},a.key=function(t){return s.push(t),a},a.sortKeys=function(t){return o[s.length-1]=t,a},a.sortValues=function(t){return n=t,a},a.rollup=function(t){return i=t,a},a},vs.set=function(t){var e=new a;if(t)for(var n=0,i=t.length;i>n;++n)e.add(t[n]);return e},i(a,{has:function(t){return Ls+t in this},add:function(t){return this[Ls+t]=!0,t},remove:function(t){return t=Ls+t,t in this&&delete this[t]},values:function(){var t=[];return this.forEach(function(e){t.push(e)}),t},forEach:function(t){for(var e in this)e.charCodeAt(0)===Ps&&t.call(this,e.substring(1))}}),vs.behavior={},vs.rebind=function(t,e){for(var n,i=1,r=arguments.length;++i<r;)t[n=arguments[i]]=s(t,e,e[n]);return t};var Es=["webkit","ms","moz","Moz","o","O"];vs.dispatch=function(){for(var t=new h,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=u(t);return t},h.prototype.on=function(t,e){var n=t.indexOf("."),i="";if(n>=0&&(i=t.substring(n+1),t=t.substring(0,n)),t)return arguments.length<2?this[t].on(i):this[t].on(i,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(i,null);return this}},vs.event=null,vs.requote=function(t){return t.replace(zs,"\\$&")};var zs=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Is={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Ds=function(t,e){return e.querySelector(t)},Bs=function(t,e){return e.querySelectorAll(t)},Hs=ws[o(ws,"matchesSelector")],Ws=function(t,e){return Hs.call(t,e)};"function"==typeof Sizzle&&(Ds=function(t,e){return Sizzle(t,e)[0]||null},Bs=function(t,e){return Sizzle.uniqueSort(Sizzle(t,e))},Ws=Sizzle.matchesSelector),vs.selection=function(){return js};var Ns=vs.selection.prototype=[];Ns.select=function(t){var e,n,i,r,a=[];t=g(t);for(var s=-1,o=this.length;++s<o;){a.push(e=[]),e.parentNode=(i=this[s]).parentNode;for(var l=-1,h=i.length;++l<h;)(r=i[l])?(e.push(n=t.call(r,r.__data__,l,s)),n&&"__data__"in r&&(n.__data__=r.__data__)):e.push(null)}return d(a)},Ns.selectAll=function(t){var e,n,i=[];t=m(t);for(var r=-1,a=this.length;++r<a;)for(var s=this[r],o=-1,l=s.length;++o<l;)(n=s[o])&&(i.push(e=xs(t.call(n,n.__data__,o,r))),e.parentNode=n);return d(i)};var Os={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};vs.ns={prefix:Os,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.substring(0,e),t=t.substring(e+1)),Os.hasOwnProperty(n)?{space:Os[n],local:t}:t}},Ns.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=vs.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(v(e,t[e]));return this}return this.each(v(t,e))},Ns.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),i=(t=t.trim().split(/^|\s+/g)).length,r=-1;if(e=n.classList){for(;++r<i;)if(!e.contains(t[r]))return!1}else for(e=n.getAttribute("class");++r<i;)if(!x(t[r]).test(e))return!1;return!0}for(e in t)this.each(b(e,t[e]));return this}return this.each(b(t,e))},Ns.style=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(k(n,t[n],e));return this}if(2>i)return ks.getComputedStyle(this.node(),null).getPropertyValue(t);n=""}return this.each(k(t,e,n))},Ns.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(M(e,t[e]));return this}return this.each(M(t,e))},Ns.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},Ns.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},Ns.append=function(t){return t=S(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Ns.insert=function(t,e){return t=S(t),e=g(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments))})},Ns.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},Ns.data=function(t,e){function n(t,n){var i,a,s,o=t.length,c=n.length,f=Math.min(o,c),p=new Array(c),d=new Array(c),g=new Array(o);if(e){var m,v=new r,y=new r,x=[];for(i=-1;++i<o;)m=e.call(a=t[i],a.__data__,i),v.has(m)?g[i]=a:v.set(m,a),x.push(m);for(i=-1;++i<c;)m=e.call(n,s=n[i],i),(a=v.get(m))?(p[i]=a,a.__data__=s):y.has(m)||(d[i]=_(s)),y.set(m,s),v.remove(m);for(i=-1;++i<o;)v.has(x[i])&&(g[i]=t[i])}else{for(i=-1;++i<f;)a=t[i],s=n[i],a?(a.__data__=s,p[i]=a):d[i]=_(s);for(;c>i;++i)d[i]=_(n[i]);for(;o>i;++i)g[i]=t[i]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,l.push(d),h.push(p),u.push(g)}var i,a,s=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(i=this[0]).length);++s<o;)(a=i[s])&&(t[s]=a.__data__);return t}var l=F([]),h=d([]),u=d([]);if("function"==typeof t)for(;++s<o;)n(i=this[s],t.call(i,i.parentNode.__data__,s));else for(;++s<o;)n(i=this[s],t);return h.enter=function(){return l},h.exit=function(){return u},h},Ns.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Ns.filter=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=C(t));for(var a=0,s=this.length;s>a;a++){r.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var o=0,l=n.length;l>o;o++)(i=n[o])&&t.call(i,i.__data__,o)&&e.push(i)}return d(r)},Ns.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,i=this[t],r=i.length-1,a=i[r];--r>=0;)(n=i[r])&&(a&&a!==n.nextSibling&&a.parentNode.insertBefore(n,a),a=n);return this},Ns.sort=function(t){t=T.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},Ns.each=function(t){return A(this,function(e,n,i){t.call(e,e.__data__,n,i)})},Ns.call=function(t){var e=xs(arguments);return t.apply(e[0]=this,e),this},Ns.empty=function(){return!this.node()},Ns.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],i=0,r=n.length;r>i;i++){var a=n[i];if(a)return a}return null},Ns.size=function(){var t=0;return this.each(function(){++t}),t};var qs=[];vs.selection.enter=F,vs.selection.enter.prototype=qs,qs.append=Ns.append,qs.empty=Ns.empty,qs.node=Ns.node,qs.call=Ns.call,qs.size=Ns.size,qs.select=function(t){for(var e,n,i,r,a,s=[],o=-1,l=this.length;++o<l;){i=(r=this[o]).update,s.push(e=[]),e.parentNode=r.parentNode;for(var h=-1,u=r.length;++h<u;)(a=r[h])?(e.push(i[h]=n=t.call(r.parentNode,a.__data__,h,o)),n.__data__=a.__data__):e.push(null)}return d(s)},qs.insert=function(t,e){return arguments.length<2&&(e=R(this)),Ns.insert.call(this,t,e)},Ns.transition=function(){for(var t,e,n=Nl||++Gl,i=[],r=Ol||{time:Date.now(),ease:Ei,delay:0,duration:250},a=-1,s=this.length;++a<s;){i.push(t=[]);for(var o=this[a],l=-1,h=o.length;++l<h;)(e=o[l])&&Fa(e,l,n,r),t.push(e)}return Ca(i,n)},Ns.interrupt=function(){return this.each(L)},vs.select=function(t){var e=["string"==typeof t?Ds(t,bs):t];return e.parentNode=ws,d([e])},vs.selectAll=function(t){var e=xs("string"==typeof t?Bs(t,bs):t);return e.parentNode=ws,d([e])};var js=vs.select(ws);Ns.on=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e=!1);for(n in t)this.each(P(n,t[n],e));return this}if(2>i)return(i=this.node()["__on"+t])&&i._;n=!1}return this.each(P(t,e,n))};var Ys=vs.map({mouseenter:"mouseover",mouseleave:"mouseout"});Ys.forEach(function(t){"on"+t in bs&&Ys.remove(t)});var Gs=o(ws.style,"userSelect"),Xs=0;vs.mouse=function(t){return D(t,f())};var Vs=/WebKit/.test(ks.navigator.userAgent)?-1:0;vs.touches=function(t,e){return arguments.length<2&&(e=f().touches),e?xs(e).map(function(e){var n=D(t,e);return n.identifier=e.identifier,n}):[]},vs.behavior.drag=function(){function t(){this.on("mousedown.drag",s).on("touchstart.drag",o)}function e(){return vs.event.changedTouches[0].identifier}function n(t,e){return vs.touches(t).filter(function(t){return t.identifier===e})[0]}function i(t,e,n,i){return function(){function s(){var t=e(u,p),n=t[0]-g[0],i=t[1]-g[1];m|=n|i,g=t,c({type:"drag",x:t[0]+l[0],y:t[1]+l[1],dx:n,dy:i})}function o(){v.on(n+"."+d,null).on(i+"."+d,null),y(m&&vs.event.target===f),c({type:"dragend"})}var l,h=this,u=h.parentNode,c=r.of(h,arguments),f=vs.event.target,p=t(),d=null==p?"drag":"drag-"+p,g=e(u,p),m=0,v=vs.select(ks).on(n+"."+d,s).on(i+"."+d,o),y=I();a?(l=a.apply(h,arguments),l=[l.x-g[0],l.y-g[1]]):l=[0,0],c({type:"dragstart"})}}var r=p(t,"drag","dragstart","dragend"),a=null,s=i(l,vs.mouse,"mousemove","mouseup"),o=i(e,n,"touchmove","touchend");return t.origin=function(e){return arguments.length?(a=e,t):a},vs.rebind(t,r,"on")};var Us=Math.PI,$s=2*Us,Qs=Us/2,Zs=1e-6,Js=Zs*Zs,Ks=Us/180,to=180/Us,eo=Math.SQRT2,no=2,io=4;vs.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=O(g),s=a/(no*f)*(n*q(eo*e+g)-N(g));return[i+s*h,r+s*u,a*n/O(eo*e+g)]}return[i+t*h,r+t*u,a*Math.exp(eo*e)]}var i=t[0],r=t[1],a=t[2],s=e[0],o=e[1],l=e[2],h=s-i,u=o-r,c=h*h+u*u,f=Math.sqrt(c),p=(l*l-a*a+io*c)/(2*a*no*f),d=(l*l-a*a-io*c)/(2*l*no*f),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(d*d+1)-d),v=m-g,y=(v||Math.log(l/a))/eo;return n.duration=1e3*y,n},vs.behavior.zoom=function(){function t(t){t.on(T,h).on(so+".zoom",f).on(A,d).on("dblclick.zoom",g).on(R,u)}function e(t){return[(t[0]-S.x)/S.k,(t[1]-S.y)/S.k]}function n(t){return[t[0]*S.k+S.x,t[1]*S.k+S.y]}function i(t){S.k=Math.max(C[0],Math.min(C[1],t))}function r(t,e){e=n(e),S.x+=t[0]-e[0],S.y+=t[1]-e[1]}function a(){w&&w.domain(b.range().map(function(t){return(t-S.x)/S.k}).map(b.invert)),M&&M.domain(k.range().map(function(t){return(t-S.y)/S.k}).map(k.invert))}function s(t){t({type:"zoomstart"})}function o(t){a(),t({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function l(t){t({type:"zoomend"})}function h(){function t(){u=1,r(vs.mouse(i),f),o(a)}function n(){c.on(A,ks===i?d:null).on(F,null),p(u&&vs.event.target===h),l(a)}var i=this,a=P.of(i,arguments),h=vs.event.target,u=0,c=vs.select(ks).on(A,t).on(F,n),f=e(vs.mouse(i)),p=I();L.call(i),s(a)}function u(){function t(){var t=vs.touches(d);return p=S.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))}),t}function n(){for(var e=vs.event.changedTouches,n=0,a=e.length;a>n;++n)m[e[n].identifier]=null;var s=t(),l=Date.now();if(1===s.length){if(500>l-x){var h=s[0],u=m[h.identifier];i(2*S.k),r(h,u),c(),o(g)}x=l}else if(s.length>1){var h=s[0],f=s[1],p=h[0]-f[0],d=h[1]-f[1];v=p*p+d*d}}function a(){for(var t,e,n,a,s=vs.touches(d),l=0,h=s.length;h>l;++l,a=null)if(n=s[l],a=m[n.identifier]){if(e)break;t=n,e=a}if(a){var u=(u=n[0]-t[0])*u+(u=n[1]-t[1])*u,c=v&&Math.sqrt(u/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+a[0])/2,(e[1]+a[1])/2],i(c*p)}x=null,r(t,e),o(g)}function f(){if(vs.event.touches.length){for(var e=vs.event.changedTouches,n=0,i=e.length;i>n;++n)delete m[e[n].identifier];for(var r in m)return void t()}k.on(b,null).on(w,null),M.on(T,h).on(R,u),_(),l(g)}var p,d=this,g=P.of(d,arguments),m={},v=0,y=vs.event.changedTouches[0].identifier,b="touchmove.zoom-"+y,w="touchend.zoom-"+y,k=vs.select(ks).on(b,a).on(w,f),M=vs.select(d).on(T,null).on(R,n),_=I();L.call(d),n(),s(g)}function f(){var t=P.of(this,arguments);y?clearTimeout(y):(L.call(this),s(t)),y=setTimeout(function(){y=null,l(t)},50),c();var n=v||vs.mouse(this);m||(m=e(n)),i(Math.pow(2,.002*ro())*S.k),r(n,m),o(t)}function d(){m=null}function g(){var t=P.of(this,arguments),n=vs.mouse(this),a=e(n),h=Math.log(S.k)/Math.LN2;s(t),i(Math.pow(2,vs.event.shiftKey?Math.ceil(h)-1:Math.floor(h)+1)),r(n,a),o(t),l(t)}var m,v,y,x,b,w,k,M,S={x:0,y:0,k:1},_=[960,500],C=ao,T="mousedown.zoom",A="mousemove.zoom",F="mouseup.zoom",R="touchstart.zoom",P=p(t,"zoomstart","zoom","zoomend");return t.event=function(t){t.each(function(){var t=P.of(this,arguments),e=S;Nl?vs.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=_[0],i=_[1],r=n/2,a=i/2,s=vs.interpolateZoom([(r-S.x)/S.k,(a-S.y)/S.k,n/S.k],[(r-e.x)/e.k,(a-e.y)/e.k,n/e.k]);return function(e){var i=s(e),l=n/i[2];this.__chart__=S={x:r-i[0]*l,y:a-i[1]*l,k:l},o(t)}}).each("end.zoom",function(){l(t)}):(this.__chart__=S,s(t),o(t),l(t))})},t.translate=function(e){return arguments.length?(S={x:+e[0],y:+e[1],k:S.k},a(),t):[S.x,S.y]},t.scale=function(e){return arguments.length?(S={x:S.x,y:S.y,k:+e},a(),t):S.k},t.scaleExtent=function(e){return arguments.length?(C=null==e?ao:[+e[0],+e[1]],t):C},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(_=e&&[+e[0],+e[1]],t):_},t.x=function(e){return arguments.length?(w=e,b=e.copy(),S={x:0,y:0,k:1},t):w},t.y=function(e){return arguments.length?(M=e,k=e.copy(),S={x:0,y:0,k:1},t):M},vs.rebind(t,P,"on")};var ro,ao=[0,1/0],so="onwheel"in bs?(ro=function(){return-vs.event.deltaY*(vs.event.deltaMode?120:1)},"wheel"):"onmousewheel"in bs?(ro=function(){return vs.event.wheelDelta},"mousewheel"):(ro=function(){return-vs.event.detail},"MozMousePixelScroll");Y.prototype.toString=function(){return this.rgb()+""},vs.hsl=function(t,e,n){return 1===arguments.length?t instanceof X?G(t.h,t.s,t.l):he(""+t,ue,G):G(+t,+e,+n)};var oo=X.prototype=new Y;oo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),G(this.h,this.s,this.l/t)},oo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),G(this.h,this.s,t*this.l)},oo.rgb=function(){return V(this.h,this.s,this.l)},vs.hcl=function(t,e,n){return 1===arguments.length?t instanceof $?U(t.h,t.c,t.l):t instanceof J?te(t.l,t.a,t.b):te((t=ce((t=vs.rgb(t)).r,t.g,t.b)).l,t.a,t.b):U(+t,+e,+n)};var lo=$.prototype=new Y;lo.brighter=function(t){return U(this.h,this.c,Math.min(100,this.l+ho*(arguments.length?t:1)))},lo.darker=function(t){return U(this.h,this.c,Math.max(0,this.l-ho*(arguments.length?t:1)))},lo.rgb=function(){return Q(this.h,this.c,this.l).rgb()},vs.lab=function(t,e,n){return 1===arguments.length?t instanceof J?Z(t.l,t.a,t.b):t instanceof $?Q(t.l,t.c,t.h):ce((t=vs.rgb(t)).r,t.g,t.b):Z(+t,+e,+n)};var ho=18,uo=.95047,co=1,fo=1.08883,po=J.prototype=new Y;po.brighter=function(t){return Z(Math.min(100,this.l+ho*(arguments.length?t:1)),this.a,this.b)},po.darker=function(t){return Z(Math.max(0,this.l-ho*(arguments.length?t:1)),this.a,this.b)},po.rgb=function(){return K(this.l,this.a,this.b)},vs.rgb=function(t,e,n){return 1===arguments.length?t instanceof oe?se(t.r,t.g,t.b):he(""+t,se,V):se(~~t,~~e,~~n)};var go=oe.prototype=new Y;go.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,i=this.b,r=30;return e||n||i?(e&&r>e&&(e=r),n&&r>n&&(n=r),i&&r>i&&(i=r),se(Math.min(255,~~(e/t)),Math.min(255,~~(n/t)),Math.min(255,~~(i/t)))):se(r,r,r)},go.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),se(~~(t*this.r),~~(t*this.g),~~(t*this.b))},go.hsl=function(){return ue(this.r,this.g,this.b)},go.toString=function(){return"#"+le(this.r)+le(this.g)+le(this.b)};var mo=vs.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});mo.forEach(function(t,e){mo.set(t,re(e))}),vs.functor=de,vs.xhr=me(ge),vs.dsv=function(t,e){function n(t,n,a){arguments.length<3&&(a=n,n=null);var s=vs.xhr(t,e,a);return s.row=function(t){return arguments.length?s.response(null==(n=t)?i:r(t)):n},s.row(n)}function i(t){return n.parse(t.responseText)}function r(t){return function(e){return n.parse(e.responseText,t)}}function s(e){return e.map(o).join(t)}function o(t){return l.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var l=new RegExp('["'+t+"\n]"),h=t.charCodeAt(0);return n.parse=function(t,e){var i;return n.parseRows(t,function(t,n){if(i)return i(t,n-1);var r=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");i=e?function(t,n){return e(r(t),n)}:r})},n.parseRows=function(t,e){function n(){if(u>=l)return s;if(r)return r=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var n=e;n++<l;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}u=n+2;var i=t.charCodeAt(n+1);return 13===i?(r=!0,10===t.charCodeAt(n+2)&&++u):10===i&&(r=!0),t.substring(e+1,n).replace(/""/g,'"')}for(;l>u;){var i=t.charCodeAt(u++),o=1;if(10===i)r=!0;else if(13===i)r=!0,10===t.charCodeAt(u)&&(++u,++o);else if(i!==h)continue;return t.substring(e,u-o)}return t.substring(e)}for(var i,r,a={},s={},o=[],l=t.length,u=0,c=0;(i=n())!==s;){for(var f=[];i!==a&&i!==s;)f.push(i),i=n();(!e||(f=e(f,c++)))&&o.push(f)}return o},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var i=new a,r=[];return e.forEach(function(t){for(var e in t)i.has(e)||r.push(i.add(e))}),[r.map(o).join(t)].concat(e.map(function(e){return r.map(function(t){return o(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(s).join("\n")},n},vs.csv=vs.dsv(",","text/csv"),vs.tsv=vs.dsv("	","text/tab-separated-values");var vo,yo,xo,bo,wo,ko=ks[o(ks,"requestAnimationFrame")]||function(t){setTimeout(t,17)};vs.timer=function(t,e,n){var i=arguments.length;2>i&&(e=0),3>i&&(n=Date.now());var r=n+e,a={callback:t,time:r,next:null};yo?yo.next=a:vo=a,yo=a,xo||(bo=clearTimeout(bo),xo=1,ko(xe))},vs.timer.flush=function(){we(),ke()};var Mo=".",So=",",_o=[3,3],Co="$",To=["y","z","a","f","p","n","Âµ","m","","k","M","G","T","P","E","Z","Y"].map(Me);vs.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=vs.round(t,Se(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((0>=n?n+1:n-1)/3)))),To[8+n/3]},vs.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},vs.format=function(t){var e=Ao.exec(t),n=e[1]||" ",i=e[2]||">",r=e[3]||"",a=e[4]||"",s=e[5],o=+e[6],l=e[7],h=e[8],u=e[9],c=1,f="",p=!1;switch(h&&(h=+h.substring(1)),(s||"0"===n&&"="===i)&&(s=n="0",i="=",l&&(o-=Math.floor((o-1)/4))),u){case"n":l=!0,u="g";break;case"%":c=100,f="%",u="f";break;case"p":c=100,f="%",u="r";break;case"b":case"o":case"x":case"X":"#"===a&&(a="0"+u.toLowerCase());case"c":case"d":p=!0,h=0;break;case"s":c=-1,u="r"}"#"===a?a="":"$"===a&&(a=Co),"r"!=u||h||(u="g"),null!=h&&("g"==u?h=Math.max(1,Math.min(21,h)):("e"==u||"f"==u)&&(h=Math.max(0,Math.min(20,h)))),u=Fo.get(u)||_e;var d=s&&l;return function(t){if(p&&t%1)return"";var e=0>t||0===t&&0>1/t?(t=-t,"-"):r;if(0>c){var g=vs.formatPrefix(t,h);t=g.scale(t),f=g.symbol}else t*=c;t=u(t,h);var m=t.lastIndexOf("."),v=0>m?t:t.substring(0,m),y=0>m?"":Mo+t.substring(m+1);!s&&l&&(v=Ro(v));var x=a.length+v.length+y.length+(d?0:e.length),b=o>x?new Array(x=o-x+1).join(n):"";return d&&(v=Ro(b+v)),e+=a,t=v+y,("<"===i?e+t+b:">"===i?b+e+t:"^"===i?b.substring(0,x>>=1)+e+t+b.substring(x):e+(d?t:b+t))+f}};var Ao=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Fo=vs.map({b:function(t){return t.toString(2)
  },c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=vs.round(t,Se(t,e))).toFixed(Math.max(0,Math.min(20,Se(t*(1+1e-15),e))))}}),Ro=ge;if(_o){var Lo=_o.length;Ro=function(t){for(var e=t.length,n=[],i=0,r=_o[0];e>0&&r>0;)n.push(t.substring(e-=r,e+r)),r=_o[i=(i+1)%Lo];return n.reverse().join(So)}}vs.geo={},Ce.prototype={s:0,t:0,add:function(t){Te(t,this.t,Po),Te(Po.s,this.s,this),this.s?this.t+=Po.t:this.s=Po.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Po=new Ce;vs.geo.stream=function(t,e){t&&Eo.hasOwnProperty(t.type)?Eo[t.type](t,e):Ae(t,e)};var Eo={Feature:function(t,e){Ae(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ae(n[i].geometry,e)}},zo={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Fe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Fe(n[i],e,0)},Polygon:function(t,e){Re(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Re(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ae(n[i],e)}};vs.geo.area=function(t){return Io=0,vs.geo.stream(t,Bo),Io};var Io,Do=new Ce,Bo={sphere:function(){Io+=4*Us},point:l,lineStart:l,lineEnd:l,polygonStart:function(){Do.reset(),Bo.lineStart=Le},polygonEnd:function(){var t=2*Do;Io+=0>t?4*Us+t:t,Bo.lineStart=Bo.lineEnd=Bo.point=l}};vs.geo.bounds=function(){function t(t,e){x.push(b=[u=t,f=t]),c>e&&(c=e),e>p&&(p=e)}function e(e,n){var i=Pe([e*Ks,n*Ks]);if(v){var r=ze(v,i),a=[r[1],-r[0],0],s=ze(a,r);Be(s),s=He(s);var l=e-d,h=l>0?1:-1,g=s[0]*to*h,m=Math.abs(l)>180;if(m^(g>h*d&&h*e>g)){var y=s[1]*to;y>p&&(p=y)}else if(g=(g+360)%360-180,m^(g>h*d&&h*e>g)){var y=-s[1]*to;c>y&&(c=y)}else c>n&&(c=n),n>p&&(p=n);m?d>e?o(u,e)>o(u,f)&&(f=e):o(e,f)>o(u,f)&&(u=e):f>=u?(u>e&&(u=e),e>f&&(f=e)):e>d?o(u,e)>o(u,f)&&(f=e):o(e,f)>o(u,f)&&(u=e)}else t(e,n);v=i,d=e}function n(){w.point=e}function i(){b[0]=u,b[1]=f,w.point=t,v=null}function r(t,n){if(v){var i=t-d;y+=Math.abs(i)>180?i+(i>0?360:-360):i}else g=t,m=n;Bo.point(t,n),e(t,n)}function a(){Bo.lineStart()}function s(){r(g,m),Bo.lineEnd(),Math.abs(y)>Zs&&(u=-(f=180)),b[0]=u,b[1]=f,v=null}function o(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function h(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var u,c,f,p,d,g,m,v,y,x,b,w={point:t,lineStart:n,lineEnd:i,polygonStart:function(){w.point=r,w.lineStart=a,w.lineEnd=s,y=0,Bo.polygonStart()},polygonEnd:function(){Bo.polygonEnd(),w.point=t,w.lineStart=n,w.lineEnd=i,0>Do?(u=-(f=180),c=-(p=90)):y>Zs?p=90:-Zs>y&&(c=-90),b[0]=u,b[1]=f}};return function(t){p=f=-(u=c=1/0),x=[],vs.geo.stream(t,w);var e=x.length;if(e){x.sort(l);for(var n,i=1,r=x[0],a=[r];e>i;++i)n=x[i],h(n[0],r)||h(n[1],r)?(o(r[0],n[1])>o(r[0],r[1])&&(r[1]=n[1]),o(n[0],r[1])>o(r[0],r[1])&&(r[0]=n[0])):a.push(r=n);for(var s,n,d=-1/0,e=a.length-1,i=0,r=a[e];e>=i;r=n,++i)n=a[i],(s=o(r[1],n[0]))>d&&(d=s,u=n[0],f=r[1])}return x=b=null,1/0===u||1/0===c?[[0/0,0/0],[0/0,0/0]]:[[u,c],[f,p]]}}(),vs.geo.centroid=function(t){Ho=Wo=No=Oo=qo=jo=Yo=Go=Xo=Vo=Uo=0,vs.geo.stream(t,$o);var e=Xo,n=Vo,i=Uo,r=e*e+n*n+i*i;return Js>r&&(e=jo,n=Yo,i=Go,Zs>Wo&&(e=No,n=Oo,i=qo),r=e*e+n*n+i*i,Js>r)?[0/0,0/0]:[Math.atan2(n,e)*to,W(i/Math.sqrt(r))*to]};var Ho,Wo,No,Oo,qo,jo,Yo,Go,Xo,Vo,Uo,$o={sphere:l,point:Ne,lineStart:qe,lineEnd:je,polygonStart:function(){$o.lineStart=Ye},polygonEnd:function(){$o.lineStart=qe}},Qo=Ue(Ge,Ke,en,[-Us,-Us/2]),Zo=1e9;vs.geo.clipExtent=function(){var t,e,n,i,r,a,s={stream:function(t){return r&&(r.valid=!1),r=a(t),r.valid=!0,r},extent:function(o){return arguments.length?(a=rn(t=+o[0][0],e=+o[0][1],n=+o[1][0],i=+o[1][1]),r&&(r.valid=!1,r=null),s):[[t,e],[n,i]]}};return s.extent([[0,0],[960,500]])},(vs.geo.conicEqualArea=function(){return on(ln)}).raw=ln,vs.geo.albers=function(){return vs.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},vs.geo.albersUsa=function(){function t(t){var a=t[0],s=t[1];return e=null,n(a,s),e||(i(a,s),e)||r(a,s),e}var e,n,i,r,a=vs.geo.albers(),s=vs.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=vs.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=a.scale(),n=a.translate(),i=(t[0]-n[0])/e,r=(t[1]-n[1])/e;return(r>=.12&&.234>r&&i>=-.425&&-.214>i?s:r>=.166&&.234>r&&i>=-.214&&-.115>i?o:a).invert(t)},t.stream=function(t){var e=a.stream(t),n=s.stream(t),i=o.stream(t);return{point:function(t,r){e.point(t,r),n.point(t,r),i.point(t,r)},sphere:function(){e.sphere(),n.sphere(),i.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),i.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),i.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),i.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),i.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),s.precision(e),o.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),s.scale(.35*e),o.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var h=a.scale(),u=+e[0],c=+e[1];return n=a.translate(e).clipExtent([[u-.455*h,c-.238*h],[u+.455*h,c+.238*h]]).stream(l).point,i=s.translate([u-.307*h,c+.201*h]).clipExtent([[u-.425*h+Zs,c+.12*h+Zs],[u-.214*h-Zs,c+.234*h-Zs]]).stream(l).point,r=o.translate([u-.205*h,c+.212*h]).clipExtent([[u-.214*h+Zs,c+.166*h+Zs],[u-.115*h-Zs,c+.234*h-Zs]]).stream(l).point,t},t.scale(1070)};var Jo,Ko,tl,el,nl,il,rl={point:l,lineStart:l,lineEnd:l,polygonStart:function(){Ko=0,rl.lineStart=hn},polygonEnd:function(){rl.lineStart=rl.lineEnd=rl.point=l,Jo+=Math.abs(Ko/2)}},al={point:un,lineStart:l,lineEnd:l,polygonStart:l,polygonEnd:l},sl={point:pn,lineStart:dn,lineEnd:gn,polygonStart:function(){sl.lineStart=mn},polygonEnd:function(){sl.point=pn,sl.lineStart=dn,sl.lineEnd=gn}};vs.geo.transform=function(t){return{stream:function(e){var n=new xn(e);for(var i in t)n[i]=t[i];return n}}},xn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},vs.geo.path=function(){function t(t){return t&&("function"==typeof o&&a.pointRadius(+o.apply(this,arguments)),s&&s.valid||(s=r(a)),vs.geo.stream(t,s)),a.result()}function e(){return s=null,t}var n,i,r,a,s,o=4.5;return t.area=function(t){return Jo=0,vs.geo.stream(t,r(rl)),Jo},t.centroid=function(t){return No=Oo=qo=jo=Yo=Go=Xo=Vo=Uo=0,vs.geo.stream(t,r(sl)),Uo?[Xo/Uo,Vo/Uo]:Go?[jo/Go,Yo/Go]:qo?[No/qo,Oo/qo]:[0/0,0/0]},t.bounds=function(t){return nl=il=-(tl=el=1/0),vs.geo.stream(t,r(al)),[[tl,el],[nl,il]]},t.projection=function(t){return arguments.length?(r=(n=t)?t.stream||bn(t):ge,e()):n},t.context=function(t){return arguments.length?(a=null==(i=t)?new cn:new vn(t),"function"!=typeof o&&a.pointRadius(o),e()):i},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:(a.pointRadius(+e),+e),t):o},t.projection(vs.geo.albersUsa()).context(null)},vs.geo.projection=wn,vs.geo.projectionMutator=kn,(vs.geo.equirectangular=function(){return wn(Sn)}).raw=Sn.invert=Sn,vs.geo.rotation=function(t){function e(e){return e=t(e[0]*Ks,e[1]*Ks),e[0]*=to,e[1]*=to,e}return t=Cn(t[0]%360*Ks,t[1]*Ks,t.length>2?t[2]*Ks:0),e.invert=function(e){return e=t.invert(e[0]*Ks,e[1]*Ks),e[0]*=to,e[1]*=to,e},e},_n.invert=Sn,vs.geo.circle=function(){function t(){var t="function"==typeof i?i.apply(this,arguments):i,e=Cn(-t[0]*Ks,-t[1]*Ks,0).invert,r=[];return n(null,null,1,{point:function(t,n){r.push(t=e(t,n)),t[0]*=to,t[1]*=to}}),{type:"Polygon",coordinates:[r]}}var e,n,i=[0,0],r=6;return t.origin=function(e){return arguments.length?(i=e,t):i},t.angle=function(i){return arguments.length?(n=Rn((e=+i)*Ks,r*Ks),t):e},t.precision=function(i){return arguments.length?(n=Rn(e*Ks,(r=+i)*Ks),t):r},t.angle(90)},vs.geo.distance=function(t,e){var n,i=(e[0]-t[0])*Ks,r=t[1]*Ks,a=e[1]*Ks,s=Math.sin(i),o=Math.cos(i),l=Math.sin(r),h=Math.cos(r),u=Math.sin(a),c=Math.cos(a);return Math.atan2(Math.sqrt((n=c*s)*n+(n=h*u-l*c*o)*n),l*u+h*c*o)},vs.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return vs.range(Math.ceil(a/m)*m,r,m).map(f).concat(vs.range(Math.ceil(h/v)*v,l,v).map(p)).concat(vs.range(Math.ceil(i/d)*d,n,d).filter(function(t){return Math.abs(t%m)>Zs}).map(u)).concat(vs.range(Math.ceil(o/g)*g,s,g).filter(function(t){return Math.abs(t%v)>Zs}).map(c))}var n,i,r,a,s,o,l,h,u,c,f,p,d=10,g=d,m=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(p(l).slice(1),f(r).reverse().slice(1),p(h).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],r=+e[1][0],h=+e[0][1],l=+e[1][1],a>r&&(e=a,a=r,r=e),h>l&&(e=h,h=l,l=e),t.precision(y)):[[a,h],[r,l]]},t.minorExtent=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],o=+e[0][1],s=+e[1][1],i>n&&(e=i,i=n,n=e),o>s&&(e=o,o=s,s=e),t.precision(y)):[[i,o],[n,s]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(m=+e[0],v=+e[1],t):[m,v]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(y=+e,u=Pn(o,s,90),c=En(i,n,y),f=Pn(h,l,90),p=En(a,r,y),t):y},t.majorExtent([[-180,-90+Zs],[180,90-Zs]]).minorExtent([[-180,-80-Zs],[180,80+Zs]])},vs.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||i.apply(this,arguments),n||r.apply(this,arguments)]}}var e,n,i=zn,r=In;return t.distance=function(){return vs.geo.distance(e||i.apply(this,arguments),n||r.apply(this,arguments))},t.source=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,t):i},t.target=function(e){return arguments.length?(r=e,n="function"==typeof e?null:e,t):r},t.precision=function(){return arguments.length?t:0},t},vs.geo.interpolate=function(t,e){return Dn(t[0]*Ks,t[1]*Ks,e[0]*Ks,e[1]*Ks)},vs.geo.length=function(t){return ol=0,vs.geo.stream(t,ll),ol};var ol,ll={sphere:l,point:l,lineStart:Bn,lineEnd:l,polygonStart:l,polygonEnd:l},hl=Hn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(vs.geo.azimuthalEqualArea=function(){return wn(hl)}).raw=hl;var ul=Hn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},ge);(vs.geo.azimuthalEquidistant=function(){return wn(ul)}).raw=ul,(vs.geo.conicConformal=function(){return on(Wn)}).raw=Wn,(vs.geo.conicEquidistant=function(){return on(Nn)}).raw=Nn;var cl=Hn(function(t){return 1/t},Math.atan);(vs.geo.gnomonic=function(){return wn(cl)}).raw=cl,On.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Qs]},(vs.geo.mercator=function(){return qn(On)}).raw=On;var fl=Hn(function(){return 1},Math.asin);(vs.geo.orthographic=function(){return wn(fl)}).raw=fl;var pl=Hn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(vs.geo.stereographic=function(){return wn(pl)}).raw=pl,jn.invert=function(t,e){return[Math.atan2(N(t),Math.cos(e)),W(Math.sin(e)/O(t))]},(vs.geo.transverseMercator=function(){return qn(jn)}).raw=jn,vs.geom={},vs.svg={},vs.svg.line=function(){return Yn(ge)};var dl=vs.map({linear:Vn,"linear-closed":Un,step:$n,"step-before":Qn,"step-after":Zn,basis:ii,"basis-open":ri,"basis-closed":ai,bundle:si,cardinal:ti,"cardinal-open":Jn,"cardinal-closed":Kn,monotone:fi});dl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var gl=[0,2/3,1/3,0],ml=[0,1/3,2/3,0],vl=[0,1/6,2/3,1/6];vs.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,r,a,s,o,l,h,u,c,f,p,d,g=de(n),m=de(i),v=t.length,y=v-1,x=[],b=[],w=0;if(g===Gn&&i===Xn)e=t;else for(a=0,e=[];v>a;++a)e.push([+g.call(this,r=t[a],a),+m.call(this,r,a)]);for(a=1;v>a;++a)(e[a][1]<e[w][1]||e[a][1]==e[w][1]&&e[a][0]<e[w][0])&&(w=a);for(a=0;v>a;++a)a!==w&&(l=e[a][1]-e[w][1],o=e[a][0]-e[w][0],x.push({angle:Math.atan2(l,o),index:a}));for(x.sort(function(t,e){return t.angle-e.angle}),p=x[0].angle,f=x[0].index,c=0,a=1;y>a;++a){if(s=x[a].index,p==x[a].angle){if(o=e[f][0]-e[w][0],l=e[f][1]-e[w][1],h=e[s][0]-e[w][0],u=e[s][1]-e[w][1],o*o+l*l>=h*h+u*u){x[a].index=-1;continue}x[c].index=-1}p=x[a].angle,c=a,f=s}for(b.push(w),a=0,s=0;2>a;++s)x[s].index>-1&&(b.push(x[s].index),a++);for(d=b.length;y>s;++s)if(!(x[s].index<0)){for(;!pi(b[d-2],b[d-1],x[s].index,e);)--d;b[d++]=x[s].index}var k=[];for(a=d-1;a>=0;--a)k.push(t[b[a]]);return k}var n=Gn,i=Xn;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e)},vs.geom.polygon=function(t){return Is(t,yl),t};var yl=vs.geom.polygon.prototype=[];yl.area=function(){for(var t,e=-1,n=this.length,i=this[n-1],r=0;++e<n;)t=i,i=this[e],r+=t[1]*i[0]-t[0]*i[1];return.5*r},yl.centroid=function(t){var e,n,i=-1,r=this.length,a=0,s=0,o=this[r-1];for(arguments.length||(t=-1/(6*this.area()));++i<r;)e=o,o=this[i],n=e[0]*o[1]-o[0]*e[1],a+=(e[0]+o[0])*n,s+=(e[1]+o[1])*n;return[a*t,s*t]},yl.clip=function(t){for(var e,n,i,r,a,s,o=mi(t),l=-1,h=this.length-mi(this),u=this[h-1];++l<h;){for(e=t.slice(),t.length=0,r=this[l],a=e[(i=e.length-o)-1],n=-1;++n<i;)s=e[n],di(s,u,r)?(di(a,u,r)||t.push(gi(a,s,u,r)),t.push(s)):di(a,u,r)&&t.push(gi(a,s,u,r)),a=s;o&&t.push(t[0]),u=r}return t},vs.geom.delaunay=function(t){var e=t.map(function(){return[]}),n=[];return vi(t,function(n){e[n.region.l.index].push(t[n.region.r.index])}),e.forEach(function(e,i){var r=t[i],a=r[0],s=r[1];e.forEach(function(t){t.angle=Math.atan2(t[0]-a,t[1]-s)}),e.sort(function(t,e){return t.angle-e.angle});for(var o=0,l=e.length-1;l>o;o++)n.push([r,e[o],e[o+1]])}),n},vs.geom.voronoi=function(t){function e(t){var e,a,s,o=t.map(function(){return[]}),l=de(n),h=de(i),u=t.length,c=1e6;if(l===Gn&&h===Xn)e=t;else for(e=new Array(u),s=0;u>s;++s)e[s]=[+l.call(this,a=t[s],s),+h.call(this,a,s)];if(vi(e,function(t){var e,n,i,r,a,s;1===t.a&&t.b>=0?(e=t.ep.r,n=t.ep.l):(e=t.ep.l,n=t.ep.r),1===t.a?(a=e?e.y:-c,i=t.c-t.b*a,s=n?n.y:c,r=t.c-t.b*s):(i=e?e.x:-c,a=t.c-t.a*i,r=n?n.x:c,s=t.c-t.a*r);var l=[i,a],h=[r,s];o[t.region.l.index].push(l,h),o[t.region.r.index].push(l,h)}),o=o.map(function(t,n){var i=e[n][0],r=e[n][1],a=t.map(function(t){return Math.atan2(t[0]-i,t[1]-r)}),s=vs.range(t.length).sort(function(t,e){return a[t]-a[e]});return s.filter(function(t,e){return!e||a[t]-a[s[e-1]]>Zs}).map(function(e){return t[e]})}),o.forEach(function(t,n){var i=t.length;if(!i)return t.push([-c,-c],[-c,c],[c,c],[c,-c]);if(!(i>2)){var r=e[n],a=t[0],s=t[1],o=r[0],l=r[1],h=a[0],u=a[1],f=s[0],p=s[1],d=Math.abs(f-h),g=p-u;if(Math.abs(g)<Zs){var m=u>l?-c:c;t.push([-c,m],[c,m])}else if(Zs>d){var v=h>o?-c:c;t.push([v,-c],[v,c])}else{var m=(h-o)*(p-u)>(f-h)*(u-l)?c:-c,y=Math.abs(g)-d;Math.abs(y)<Zs?t.push([0>g?m:-m,m]):(y>0&&(m*=-1),t.push([-c,m],[c,m]))}}}),r)for(s=0;u>s;++s)r.clip(o[s]);for(s=0;u>s;++s)o[s].point=t[s];return o}var n=Gn,i=Xn,r=null;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e.clipExtent=function(t){if(!arguments.length)return r&&[r[0],r[2]];if(null==t)r=null;else{var n=+t[0][0],i=+t[0][1],a=+t[1][0],s=+t[1][1];r=vs.geom.polygon([[n,i],[n,s],[a,s],[a,i]])}return e},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):r&&r[2]},e.links=function(t){var e,r,a,s=t.map(function(){return[]}),o=[],l=de(n),h=de(i),u=t.length;if(l===Gn&&h===Xn)e=t;else for(e=new Array(u),a=0;u>a;++a)e[a]=[+l.call(this,r=t[a],a),+h.call(this,r,a)];return vi(e,function(e){var n=e.region.l.index,i=e.region.r.index;s[n][i]||(s[n][i]=s[i][n]=!0,o.push({source:t[n],target:t[i]}))}),o},e.triangles=function(t){if(n===Gn&&i===Xn)return vs.geom.delaunay(t);for(var e,r=new Array(l),a=de(n),s=de(i),o=-1,l=t.length;++o<l;)(r[o]=[+a.call(this,e=t[o],o),+s.call(this,e,o)]).data=e;return vs.geom.delaunay(r).map(function(t){return t.map(function(t){return t.data})})},e)};var xl={l:"r",r:"l"};vs.geom.quadtree=function(t,e,n,i,r){function a(t){function a(t,e,n,i,r,a,s,o){if(!isNaN(n)&&!isNaN(i))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(Math.abs(l-n)+Math.abs(u-i)<.01)h(t,e,n,i,r,a,s,o);else{var c=t.point;t.x=t.y=t.point=null,h(t,c,l,u,r,a,s,o),h(t,e,n,i,r,a,s,o)}else t.x=n,t.y=i,t.point=e}else h(t,e,n,i,r,a,s,o)}function h(t,e,n,i,r,s,o,l){var h=.5*(r+o),u=.5*(s+l),c=n>=h,f=i>=u,p=(f<<1)+c;t.leaf=!1,t=t.nodes[p]||(t.nodes[p]=bi()),c?r=h:o=h,f?s=u:l=u,a(t,e,n,i,r,s,o,l)}var u,c,f,p,d,g,m,v,y,x=de(o),b=de(l);if(null!=e)g=e,m=n,v=i,y=r;else if(v=y=-(g=m=1/0),c=[],f=[],d=t.length,s)for(p=0;d>p;++p)u=t[p],u.x<g&&(g=u.x),u.y<m&&(m=u.y),u.x>v&&(v=u.x),u.y>y&&(y=u.y),c.push(u.x),f.push(u.y);else for(p=0;d>p;++p){var w=+x(u=t[p],p),k=+b(u,p);g>w&&(g=w),m>k&&(m=k),w>v&&(v=w),k>y&&(y=k),c.push(w),f.push(k)}var M=v-g,S=y-m;M>S?y=m+M:v=g+S;var _=bi();if(_.add=function(t){a(_,t,+x(t,++p),+b(t,p),g,m,v,y)},_.visit=function(t){wi(t,_,g,m,v,y)},p=-1,null==e){for(;++p<d;)a(_,t[p],c[p],f[p],g,m,v,y);--p}else t.forEach(_.add);return c=f=t=u=null,_}var s,o=Gn,l=Xn;return(s=arguments.length)?(o=yi,l=xi,3===s&&(r=n,i=e,n=e=0),a(t)):(a.x=function(t){return arguments.length?(o=t,a):o},a.y=function(t){return arguments.length?(l=t,a):l},a.extent=function(t){return arguments.length?(null==t?e=n=i=r=null:(e=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),a):null==e?null:[[e,n],[i,r]]},a.size=function(t){return arguments.length?(null==t?e=n=i=r=null:(e=n=0,i=+t[0],r=+t[1]),a):null==e?null:[i-e,r-n]},a)},vs.interpolateRgb=ki,vs.interpolateObject=Mi,vs.interpolateNumber=Si,vs.interpolateString=_i;var bl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;vs.interpolate=Ci,vs.interpolators=[function(t,e){var n=typeof e;return("string"===n?mo.has(e)||/^(#|rgb\(|hsl\()/.test(e)?ki:_i:e instanceof Y?ki:"object"===n?Array.isArray(e)?Ti:Mi:Si)(t,e)}],vs.interpolateArray=Ti;var wl=function(){return ge},kl=vs.map({linear:wl,poly:zi,quad:function(){return Li},cubic:function(){return Pi},sin:function(){return Ii},exp:function(){return Di},circle:function(){return Bi},elastic:Hi,back:Wi,bounce:function(){return Ni}}),Ml=vs.map({"in":ge,out:Fi,"in-out":Ri,"out-in":function(t){return Ri(Fi(t))}});vs.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.substring(0,e):t,i=e>=0?t.substring(e+1):"in";return n=kl.get(n)||wl,i=Ml.get(i)||ge,Ai(i(n.apply(null,Array.prototype.slice.call(arguments,1))))},vs.interpolateHcl=Oi,vs.interpolateHsl=qi,vs.interpolateLab=ji,vs.interpolateRound=Yi,vs.transform=function(t){var e=bs.createElementNS(vs.ns.prefix.svg,"g");return(vs.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Gi(n?n.matrix:Sl)})(t)},Gi.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Sl={a:1,b:0,c:0,d:1,e:0,f:0};vs.interpolateTransform=$i,vs.layout={},vs.layout.bundle=function(){return function(t){for(var e=[],n=-1,i=t.length;++n<i;)e.push(Ji(t[n]));return e}},vs.layout.chord=function(){function t(){var t,h,c,f,p,d={},g=[],m=vs.range(a),v=[];for(n=[],i=[],t=0,f=-1;++f<a;){for(h=0,p=-1;++p<a;)h+=r[f][p];g.push(h),v.push(vs.range(a)),t+=h}for(s&&m.sort(function(t,e){return s(g[t],g[e])}),o&&v.forEach(function(t,e){t.sort(function(t,n){return o(r[e][t],r[e][n])})}),t=($s-u*a)/t,h=0,f=-1;++f<a;){for(c=h,p=-1;++p<a;){var y=m[f],x=v[y][p],b=r[y][x],w=h,k=h+=b*t;d[y+"-"+x]={index:y,subindex:x,startAngle:w,endAngle:k,value:b}}i[y]={index:y,startAngle:c,endAngle:h,value:(h-c)/t},h+=u}for(f=-1;++f<a;)for(p=f-1;++p<a;){var M=d[f+"-"+p],S=d[p+"-"+f];(M.value||S.value)&&n.push(M.value<S.value?{source:S,target:M}:{source:M,target:S})}l&&e()}function e(){n.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,i,r,a,s,o,l,h={},u=0;return h.matrix=function(t){return arguments.length?(a=(r=t)&&r.length,n=i=null,h):r},h.padding=function(t){return arguments.length?(u=t,n=i=null,h):u},h.sortGroups=function(t){return arguments.length?(s=t,n=i=null,h):s},h.sortSubgroups=function(t){return arguments.length?(o=t,n=null,h):o},h.sortChords=function(t){return arguments.length?(l=t,n&&e(),h):l},h.chords=function(){return n||t(),n},h.groups=function(){return i||t(),i},h},vs.layout.force=function(){function t(t){return function(e,n,i,r){if(e.point!==t){var a=e.cx-t.x,s=e.cy-t.y,o=1/Math.sqrt(a*a+s*s);if(g>(r-n)*o){var l=e.charge*o*o;return t.px-=a*l,t.py-=s*l,!0}if(e.point&&isFinite(o)){var l=e.pointCharge*o*o;t.px-=a*l,t.py-=s*l}}return!e.charge}}function e(t){t.px=vs.event.x,t.py=vs.event.y,o.resume()}var n,i,r,a,s,o={},l=vs.dispatch("start","tick","end"),h=[1,1],u=.9,c=_l,f=Cl,p=-30,d=.1,g=.8,m=[],v=[];return o.tick=function(){if((i*=.99)<.005)return l.end({type:"end",alpha:i=0}),!0;var e,n,o,c,f,g,y,x,b,w=m.length,k=v.length;for(n=0;k>n;++n)o=v[n],c=o.source,f=o.target,x=f.x-c.x,b=f.y-c.y,(g=x*x+b*b)&&(g=i*a[n]*((g=Math.sqrt(g))-r[n])/g,x*=g,b*=g,f.x-=x*(y=c.weight/(f.weight+c.weight)),f.y-=b*y,c.x+=x*(y=1-y),c.y+=b*y);if((y=i*d)&&(x=h[0]/2,b=h[1]/2,n=-1,y))for(;++n<w;)o=m[n],o.x+=(x-o.x)*y,o.y+=(b-o.y)*y;if(p)for(ar(e=vs.geom.quadtree(m),i,s),n=-1;++n<w;)(o=m[n]).fixed||e.visit(t(o));for(n=-1;++n<w;)o=m[n],o.fixed?(o.x=o.px,o.y=o.py):(o.x-=(o.px-(o.px=o.x))*u,o.y-=(o.py-(o.py=o.y))*u);l.tick({type:"tick",alpha:i})},o.nodes=function(t){return arguments.length?(m=t,o):m},o.links=function(t){return arguments.length?(v=t,o):v},o.size=function(t){return arguments.length?(h=t,o):h},o.linkDistance=function(t){return arguments.length?(c="function"==typeof t?t:+t,o):c},o.distance=o.linkDistance,o.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,o):f},o.friction=function(t){return arguments.length?(u=+t,o):u},o.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,o):p},o.gravity=function(t){return arguments.length?(d=+t,o):d},o.theta=function(t){return arguments.length?(g=+t,o):g},o.alpha=function(t){return arguments.length?(t=+t,i?i=t>0?t:0:t>0&&(l.start({type:"start",alpha:i=t}),vs.timer(o.tick)),o):i},o.start=function(){function t(t,i){for(var r,a=e(n),s=-1,o=a.length;++s<o;)if(!isNaN(r=a[s][t]))return r;return Math.random()*i}function e(){if(!l){for(l=[],i=0;d>i;++i)l[i]=[];for(i=0;g>i;++i){var t=v[i];l[t.source.index].push(t.target),l[t.target.index].push(t.source)}}return l[n]}var n,i,l,u,d=m.length,g=v.length,y=h[0],x=h[1];for(n=0;d>n;++n)(u=m[n]).index=n,u.weight=0;for(n=0;g>n;++n)u=v[n],"number"==typeof u.source&&(u.source=m[u.source]),"number"==typeof u.target&&(u.target=m[u.target]),++u.source.weight,++u.target.weight;for(n=0;d>n;++n)u=m[n],isNaN(u.x)&&(u.x=t("x",y)),isNaN(u.y)&&(u.y=t("y",x)),isNaN(u.px)&&(u.px=u.x),isNaN(u.py)&&(u.py=u.y);if(r=[],"function"==typeof c)for(n=0;g>n;++n)r[n]=+c.call(this,v[n],n);else for(n=0;g>n;++n)r[n]=c;if(a=[],"function"==typeof f)for(n=0;g>n;++n)a[n]=+f.call(this,v[n],n);else for(n=0;g>n;++n)a[n]=f;if(s=[],"function"==typeof p)for(n=0;d>n;++n)s[n]=+p.call(this,m[n],n);else for(n=0;d>n;++n)s[n]=p;return o.resume()},o.resume=function(){return o.alpha(.1)},o.stop=function(){return o.alpha(0)},o.drag=function(){return n||(n=vs.behavior.drag().origin(ge).on("dragstart.force",er).on("drag.force",e).on("dragend.force",nr)),arguments.length?(this.on("mouseover.force",ir).on("mouseout.force",rr).call(n),void 0):n},vs.rebind(o,l,"on")};var _l=20,Cl=1;vs.layout.hierarchy=function(){function t(e,s,o){var l=r.call(n,e,s);if(e.depth=s,o.push(e),l&&(h=l.length)){for(var h,u,c=-1,f=e.children=[],p=0,d=s+1;++c<h;)u=t(l[c],d,o),u.parent=e,f.push(u),p+=u.value;i&&f.sort(i),a&&(e.value=p)}else a&&(e.value=+a.call(n,e,s)||0);return e}function e(t,i){var r=t.children,s=0;if(r&&(o=r.length))for(var o,l=-1,h=i+1;++l<o;)s+=e(r[l],h);else a&&(s=+a.call(n,t,i)||0);return a&&(t.value=s),s}function n(e){var n=[];return t(e,0,n),n}var i=hr,r=or,a=lr;return n.sort=function(t){return arguments.length?(i=t,n):i},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(t){return arguments.length?(a=t,n):a},n.revalue=function(t){return e(t,0),t},n},vs.layout.partition=function(){function t(e,n,i,r){var a=e.children;if(e.x=n,e.y=e.depth*r,e.dx=i,e.dy=r,a&&(s=a.length)){var s,o,l,h=-1;for(i=e.value?i/e.value:0;++h<s;)t(o=a[h],n,l=o.value*i,r),n+=l}}function e(t){var n=t.children,i=0;if(n&&(r=n.length))for(var r,a=-1;++a<r;)i=Math.max(i,e(n[a]));return 1+i}function n(n,a){var s=i.call(this,n,a);return t(s[0],0,r[0],r[1]/e(s[0])),s}var i=vs.layout.hierarchy(),r=[1,1];return n.size=function(t){return arguments.length?(r=t,n):r},sr(n,i)},vs.layout.pie=function(){function t(a){var s=a.map(function(n,i){return+e.call(t,n,i)}),o=+("function"==typeof i?i.apply(this,arguments):i),l=(("function"==typeof r?r.apply(this,arguments):r)-o)/vs.sum(s),h=vs.range(a.length);null!=n&&h.sort(n===Tl?function(t,e){return s[e]-s[t]}:function(t,e){return n(a[t],a[e])});var u=[];return h.forEach(function(t){var e;u[t]={data:a[t],value:e=s[t],startAngle:o,endAngle:o+=e*l}}),u}var e=Number,n=Tl,i=0,r=$s;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(i=e,t):i},t.endAngle=function(e){return arguments.length?(r=e,t):r},t};var Tl={};vs.layout.stack=function(){function t(o,l){var h=o.map(function(n,i){return e.call(t,n,i)}),u=h.map(function(e){return e.map(function(e,n){return[a.call(t,e,n),s.call(t,e,n)]})}),c=n.call(t,u,l);h=vs.permute(h,c),u=vs.permute(u,c);var f,p,d,g=i.call(t,u,l),m=h.length,v=h[0].length;for(p=0;v>p;++p)for(r.call(t,h[0][p],d=g[p],u[0][p][1]),f=1;m>f;++f)r.call(t,h[f][p],d+=u[f-1][p][1],u[f][p][1]);return o}var e=ge,n=dr,i=gr,r=pr,a=cr,s=fr;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:Al.get(e)||dr,t):n},t.offset=function(e){return arguments.length?(i="function"==typeof e?e:Fl.get(e)||gr,t):i},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(s=e,t):s},t.out=function(e){return arguments.length?(r=e,t):r},t};var Al=vs.map({"inside-out":function(t){var e,n,i=t.length,r=t.map(mr),a=t.map(vr),s=vs.range(i).sort(function(t,e){return r[t]-r[e]}),o=0,l=0,h=[],u=[];for(e=0;i>e;++e)n=s[e],l>o?(o+=a[n],h.push(n)):(l+=a[n],u.push(n));return u.reverse().concat(h)},reverse:function(t){return vs.range(t.length).reverse()},"default":dr}),Fl=vs.map({silhouette:function(t){var e,n,i,r=t.length,a=t[0].length,s=[],o=0,l=[];for(n=0;a>n;++n){for(e=0,i=0;r>e;e++)i+=t[e][n][1];i>o&&(o=i),s.push(i)}for(n=0;a>n;++n)l[n]=(o-s[n])/2;return l},wiggle:function(t){var e,n,i,r,a,s,o,l,h,u=t.length,c=t[0],f=c.length,p=[];for(p[0]=l=h=0,n=1;f>n;++n){for(e=0,r=0;u>e;++e)r+=t[e][n][1];for(e=0,a=0,o=c[n][0]-c[n-1][0];u>e;++e){for(i=0,s=(t[e][n][1]-t[e][n-1][1])/(2*o);e>i;++i)s+=(t[i][n][1]-t[i][n-1][1])/o;a+=s*t[e][n][1]}p[n]=l-=r?a/r*o:0,h>l&&(h=l)}for(n=0;f>n;++n)p[n]-=h;return p},expand:function(t){var e,n,i,r=t.length,a=t[0].length,s=1/r,o=[];for(n=0;a>n;++n){for(e=0,i=0;r>e;e++)i+=t[e][n][1];if(i)for(e=0;r>e;e++)t[e][n][1]/=i;else for(e=0;r>e;e++)t[e][n][1]=s}for(n=0;a>n;++n)o[n]=0;return o},zero:gr});vs.layout.histogram=function(){function t(t,a){for(var s,o,l=[],h=t.map(n,this),u=i.call(this,h,a),c=r.call(this,u,h,a),a=-1,f=h.length,p=c.length-1,d=e?1:1/f;++a<p;)s=l[a]=[],s.dx=c[a+1]-(s.x=c[a]),s.y=0;if(p>0)for(a=-1;++a<f;)o=h[a],o>=u[0]&&o<=u[1]&&(s=l[vs.bisect(c,o,1,p)-1],s.y+=d,s.push(t[a]));return l}var e=!0,n=Number,i=wr,r=xr;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(i=de(e),t):i},t.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return br(t,e)}:de(e),t):r},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},vs.layout.tree=function(){function t(t,a){function s(t,e){var i=t.children,r=t._tree;if(i&&(a=i.length)){for(var a,o,h,u=i[0],c=u,f=-1;++f<a;)h=i[f],s(h,o),c=l(h,o,c),o=h;Rr(t);var p=.5*(u._tree.prelim+h._tree.prelim);e?(r.prelim=e._tree.prelim+n(t,e),r.mod=r.prelim-p):r.prelim=p}else e&&(r.prelim=e._tree.prelim+n(t,e))}function o(t,e){t.x=t._tree.prelim+e;var n=t.children;if(n&&(i=n.length)){var i,r=-1;for(e+=t._tree.mod;++r<i;)o(n[r],e)}}function l(t,e,i){if(e){for(var r,a=t,s=t,o=e,l=t.parent.children[0],h=a._tree.mod,u=s._tree.mod,c=o._tree.mod,f=l._tree.mod;o=Sr(o),a=Mr(a),o&&a;)l=Mr(l),s=Sr(s),s._tree.ancestor=t,r=o._tree.prelim+c-a._tree.prelim-h+n(o,a),r>0&&(Lr(Pr(o,t,i),t,r),h+=r,u+=r),c+=o._tree.mod,h+=a._tree.mod,f+=l._tree.mod,u+=s._tree.mod;o&&!Sr(s)&&(s._tree.thread=o,s._tree.mod+=c-u),a&&!Mr(l)&&(l._tree.thread=a,l._tree.mod+=h-f,i=t)}return i}var h=e.call(this,t,a),u=h[0];Fr(u,function(t,e){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:e?e._tree.number+1:0}}),s(u),o(u,-u._tree.prelim);var c=_r(u,Tr),f=_r(u,Cr),p=_r(u,Ar),d=c.x-n(c,f)/2,g=f.x+n(f,c)/2,m=p.depth||1;return Fr(u,r?function(t){t.x*=i[0],t.y=t.depth*i[1],delete t._tree}:function(t){t.x=(t.x-d)/(g-d)*i[0],t.y=t.depth/m*i[1],delete t._tree}),h}var e=vs.layout.hierarchy().sort(null).value(null),n=kr,i=[1,1],r=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=null==(i=e),t):r?null:i},t.nodeSize=function(e){return arguments.length?(r=null!=(i=e),t):r?i:null},sr(t,e)},vs.layout.pack=function(){function t(t,a){var s=n.call(this,t,a),o=s[0],l=r[0],h=r[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(o.x=o.y=0,Fr(o,function(t){t.r=+u(t.value)}),Fr(o,Br),i){var c=i*(e?1:Math.max(2*o.r/l,2*o.r/h))/2;Fr(o,function(t){t.r+=c}),Fr(o,Br),Fr(o,function(t){t.r-=c})}return Nr(o,l/2,h/2,e?1:1/Math.max(2*o.r/l,2*o.r/h)),s}var e,n=vs.layout.hierarchy().sort(Er),i=0,r=[1,1];return t.size=function(e){return arguments.length?(r=e,t):r},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(i=+e,t):i},sr(t,n)},vs.layout.cluster=function(){function t(t,a){var s,o=e.call(this,t,a),l=o[0],h=0;Fr(l,function(t){var e=t.children;e&&e.length?(t.x=jr(e),t.y=qr(e)):(t.x=s?h+=n(t,s):0,t.y=0,s=t)});var u=Yr(l),c=Gr(l),f=u.x-n(u,c)/2,p=c.x+n(c,u)/2;return Fr(l,r?function(t){t.x=(t.x-l.x)*i[0],t.y=(l.y-t.y)*i[1]}:function(t){t.x=(t.x-f)/(p-f)*i[0],t.y=(1-(l.y?t.y/l.y:1))*i[1]}),o}var e=vs.layout.hierarchy().sort(null).value(null),n=kr,i=[1,1],r=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=null==(i=e),t):r?null:i},t.nodeSize=function(e){return arguments.length?(r=null!=(i=e),t):r?i:null},sr(t,e)},vs.layout.treemap=function(){function t(t,e){for(var n,i,r=-1,a=t.length;++r<a;)i=(n=t[r]).value*(0>e?0:e),n.area=isNaN(i)||0>=i?0:i}function e(n){var a=n.children;if(a&&a.length){var s,o,l,h=c(n),u=[],f=a.slice(),d=1/0,g="slice"===p?h.dx:"dice"===p?h.dy:"slice-dice"===p?1&n.depth?h.dy:h.dx:Math.min(h.dx,h.dy);for(t(f,h.dx*h.dy/n.value),u.area=0;(l=f.length)>0;)u.push(s=f[l-1]),u.area+=s.area,"squarify"!==p||(o=i(u,g))<=d?(f.pop(),d=o):(u.area-=u.pop().area,r(u,g,h,!1),g=Math.min(h.dx,h.dy),u.length=u.area=0,d=1/0);u.length&&(r(u,g,h,!0),u.length=u.area=0),a.forEach(e)}}function n(e){var i=e.children;if(i&&i.length){var a,s=c(e),o=i.slice(),l=[];for(t(o,s.dx*s.dy/e.value),l.area=0;a=o.pop();)l.push(a),l.area+=a.area,null!=a.z&&(r(l,a.z?s.dx:s.dy,s,!o.length),l.length=l.area=0);i.forEach(n)}}function i(t,e){for(var n,i=t.area,r=0,a=1/0,s=-1,o=t.length;++s<o;)(n=t[s].area)&&(a>n&&(a=n),n>r&&(r=n));return i*=i,e*=e,i?Math.max(e*r*d/i,i/(e*a*d)):1/0}function r(t,e,n,i){var r,a=-1,s=t.length,o=n.x,h=n.y,u=e?l(t.area/e):0;if(e==n.dx){for((i||u>n.dy)&&(u=n.dy);++a<s;)r=t[a],r.x=o,r.y=h,r.dy=u,o+=r.dx=Math.min(n.x+n.dx-o,u?l(r.area/u):0);r.z=!0,r.dx+=n.x+n.dx-o,n.y+=u,n.dy-=u}else{for((i||u>n.dx)&&(u=n.dx);++a<s;)r=t[a],r.x=o,r.y=h,r.dx=u,h+=r.dy=Math.min(n.y+n.dy-h,u?l(r.area/u):0);r.z=!1,r.dy+=n.y+n.dy-h,n.x+=u,n.dx-=u}}function a(i){var r=s||o(i),a=r[0];
  return a.x=0,a.y=0,a.dx=h[0],a.dy=h[1],s&&o.revalue(a),t([a],a.dx*a.dy/a.value),(s?n:e)(a),f&&(s=r),r}var s,o=vs.layout.hierarchy(),l=Math.round,h=[1,1],u=null,c=Xr,f=!1,p="squarify",d=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(h=t,a):h},a.padding=function(t){function e(e){var n=t.call(a,e,e.depth);return null==n?Xr(e):Vr(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Vr(e,t)}if(!arguments.length)return u;var i;return c=null==(u=t)?Xr:"function"==(i=typeof t)?e:"number"===i?(t=[t,t,t,t],n):n,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,s=null,a):f},a.ratio=function(t){return arguments.length?(d=t,a):d},a.mode=function(t){return arguments.length?(p=t+"",a):p},sr(a,o)},vs.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,i,r;do n=2*Math.random()-1,i=2*Math.random()-1,r=n*n+i*i;while(!r||r>1);return t+e*n*Math.sqrt(-2*Math.log(r)/r)}},logNormal:function(){var t=vs.random.normal.apply(vs,arguments);return function(){return Math.exp(t())}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e/t}}},vs.scale={};var Rl={floor:ge,ceil:ge};vs.scale.linear=function(){return ta([0,1],[0,1],Ci,!1)},vs.scale.log=function(){return sa(vs.scale.linear().domain([0,1]),10,!0,[1,10])};var Ll=vs.format(".0e"),Pl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};vs.scale.pow=function(){return oa(vs.scale.linear(),1,[0,1])},vs.scale.sqrt=function(){return vs.scale.pow().exponent(.5)},vs.scale.ordinal=function(){return ha([],{t:"range",a:[[]]})},vs.scale.category10=function(){return vs.scale.ordinal().range(El)},vs.scale.category20=function(){return vs.scale.ordinal().range(zl)},vs.scale.category20b=function(){return vs.scale.ordinal().range(Il)},vs.scale.category20c=function(){return vs.scale.ordinal().range(Dl)};var El=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ae),zl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ae),Il=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ae),Dl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ae);vs.scale.quantile=function(){return ua([],[])},vs.scale.quantize=function(){return ca(0,1,[0,1])},vs.scale.threshold=function(){return fa([.5],[0,1])},vs.scale.identity=function(){return pa([0,1])},vs.svg.arc=function(){function t(){var t=e.apply(this,arguments),a=n.apply(this,arguments),s=i.apply(this,arguments)+Bl,o=r.apply(this,arguments)+Bl,l=(s>o&&(l=s,s=o,o=l),o-s),h=Us>l?"0":"1",u=Math.cos(s),c=Math.sin(s),f=Math.cos(o),p=Math.sin(o);return l>=Hl?t?"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z":t?"M"+a*u+","+a*c+"A"+a+","+a+" 0 "+h+",1 "+a*f+","+a*p+"L"+t*f+","+t*p+"A"+t+","+t+" 0 "+h+",0 "+t*u+","+t*c+"Z":"M"+a*u+","+a*c+"A"+a+","+a+" 0 "+h+",1 "+a*f+","+a*p+"L0,0Z"}var e=da,n=ga,i=ma,r=va;return t.innerRadius=function(n){return arguments.length?(e=de(n),t):e},t.outerRadius=function(e){return arguments.length?(n=de(e),t):n},t.startAngle=function(e){return arguments.length?(i=de(e),t):i},t.endAngle=function(e){return arguments.length?(r=de(e),t):r},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,a=(i.apply(this,arguments)+r.apply(this,arguments))/2+Bl;return[Math.cos(a)*t,Math.sin(a)*t]},t};var Bl=-Qs,Hl=$s-Zs;vs.svg.line.radial=function(){var t=Yn(ya);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Qn.reverse=Zn,Zn.reverse=Qn,vs.svg.area=function(){return xa(ge)},vs.svg.area.radial=function(){var t=xa(ya);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},vs.svg.chord=function(){function t(t,o){var l=e(this,a,t,o),h=e(this,s,t,o);return"M"+l.p0+i(l.r,l.p1,l.a1-l.a0)+(n(l,h)?r(l.r,l.p1,l.r,l.p0):r(l.r,l.p1,h.r,h.p0)+i(h.r,h.p1,h.a1-h.a0)+r(h.r,h.p1,l.r,l.p0))+"Z"}function e(t,e,n,i){var r=e.call(t,n,i),a=o.call(t,r,i),s=l.call(t,r,i)+Bl,u=h.call(t,r,i)+Bl;return{r:a,a0:s,a1:u,p0:[a*Math.cos(s),a*Math.sin(s)],p1:[a*Math.cos(u),a*Math.sin(u)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function i(t,e,n){return"A"+t+","+t+" 0 "+ +(n>Us)+",1 "+e}function r(t,e,n,i){return"Q 0,0 "+i}var a=zn,s=In,o=ba,l=ma,h=va;return t.radius=function(e){return arguments.length?(o=de(e),t):o},t.source=function(e){return arguments.length?(a=de(e),t):a},t.target=function(e){return arguments.length?(s=de(e),t):s},t.startAngle=function(e){return arguments.length?(l=de(e),t):l},t.endAngle=function(e){return arguments.length?(h=de(e),t):h},t},vs.svg.diagonal=function(){function t(t,r){var a=e.call(this,t,r),s=n.call(this,t,r),o=(a.y+s.y)/2,l=[a,{x:a.x,y:o},{x:s.x,y:o},s];return l=l.map(i),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=zn,n=In,i=wa;return t.source=function(n){return arguments.length?(e=de(n),t):e},t.target=function(e){return arguments.length?(n=de(e),t):n},t.projection=function(e){return arguments.length?(i=e,t):i},t},vs.svg.diagonal.radial=function(){var t=vs.svg.diagonal(),e=wa,n=t.projection;return t.projection=function(t){return arguments.length?n(ka(e=t)):e},t},vs.svg.symbol=function(){function t(t,i){return(Wl.get(e.call(this,t,i))||_a)(n.call(this,t,i))}var e=Sa,n=Ma;return t.type=function(n){return arguments.length?(e=de(n),t):e},t.size=function(e){return arguments.length?(n=de(e),t):n},t};var Wl=vs.map({circle:_a,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*jl)),n=e*jl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});vs.svg.symbolTypes=Wl.keys();var Nl,Ol,ql=Math.sqrt(3),jl=Math.tan(30*Ks),Yl=[],Gl=0;Yl.call=Ns.call,Yl.empty=Ns.empty,Yl.node=Ns.node,Yl.size=Ns.size,vs.transition=function(t){return arguments.length?Nl?t.transition():t:js.transition()},vs.transition.prototype=Yl,Yl.select=function(t){var e,n,i,r=this.id,a=[];t=g(t);for(var s=-1,o=this.length;++s<o;){a.push(e=[]);for(var l=this[s],h=-1,u=l.length;++h<u;)(i=l[h])&&(n=t.call(i,i.__data__,h,s))?("__data__"in i&&(n.__data__=i.__data__),Fa(n,h,r,i.__transition__[r]),e.push(n)):e.push(null)}return Ca(a,r)},Yl.selectAll=function(t){var e,n,i,r,a,s=this.id,o=[];t=m(t);for(var l=-1,h=this.length;++l<h;)for(var u=this[l],c=-1,f=u.length;++c<f;)if(i=u[c]){a=i.__transition__[s],n=t.call(i,i.__data__,c,l),o.push(e=[]);for(var p=-1,d=n.length;++p<d;)(r=n[p])&&Fa(r,p,s,a),e.push(r)}return Ca(o,s)},Yl.filter=function(t){var e,n,i,r=[];"function"!=typeof t&&(t=C(t));for(var a=0,s=this.length;s>a;a++){r.push(e=[]);for(var n=this[a],o=0,l=n.length;l>o;o++)(i=n[o])&&t.call(i,i.__data__,o)&&e.push(i)}return Ca(r,this.id)},Yl.tween=function(t,e){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(t):A(this,null==e?function(e){e.__transition__[n].tween.remove(t)}:function(i){i.__transition__[n].tween.set(t,e)})},Yl.attr=function(t,e){function n(){this.removeAttribute(o)}function i(){this.removeAttributeNS(o.space,o.local)}function r(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(o);return n!==t&&(e=s(n,t),function(t){this.setAttribute(o,e(t))})})}function a(t){return null==t?i:(t+="",function(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=s(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var s="transform"==t?$i:Ci,o=vs.ns.qualify(t);return Ta(this,"attr."+t,e,o.local?a:r)},Yl.attrTween=function(t,e){function n(t,n){var i=e.call(this,t,n,this.getAttribute(r));return i&&function(t){this.setAttribute(r,i(t))}}function i(t,n){var i=e.call(this,t,n,this.getAttributeNS(r.space,r.local));return i&&function(t){this.setAttributeNS(r.space,r.local,i(t))}}var r=vs.ns.qualify(t);return this.tween("attr."+t,r.local?i:n)},Yl.style=function(t,e,n){function i(){this.style.removeProperty(t)}function r(e){return null==e?i:(e+="",function(){var i,r=ks.getComputedStyle(this,null).getPropertyValue(t);return r!==e&&(i=Ci(r,e),function(e){this.style.setProperty(t,i(e),n)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Ta(this,"style."+t,e,r)},Yl.styleTween=function(t,e,n){function i(i,r){var a=e.call(this,i,r,ks.getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}}return arguments.length<3&&(n=""),this.tween("style."+t,i)},Yl.text=function(t){return Ta(this,"text",t,Aa)},Yl.remove=function(){return this.each("end.transition",function(){var t;this.__transition__.count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof t&&(t=vs.ease.apply(vs,arguments)),A(this,function(n){n.__transition__[e].ease=t}))},Yl.delay=function(t){var e=this.id;return A(this,"function"==typeof t?function(n,i,r){n.__transition__[e].delay=+t.call(n,n.__data__,i,r)}:(t=+t,function(n){n.__transition__[e].delay=t}))},Yl.duration=function(t){var e=this.id;return A(this,"function"==typeof t?function(n,i,r){n.__transition__[e].duration=Math.max(1,t.call(n,n.__data__,i,r))}:(t=Math.max(1,t),function(n){n.__transition__[e].duration=t}))},Yl.each=function(t,e){var n=this.id;if(arguments.length<2){var i=Ol,r=Nl;Nl=n,A(this,function(e,i,r){Ol=e.__transition__[n],t.call(e,e.__data__,i,r)}),Ol=i,Nl=r}else A(this,function(i){var r=i.__transition__[n];(r.event||(r.event=vs.dispatch("start","end"))).on(t,e)});return this},Yl.transition=function(){for(var t,e,n,i,r=this.id,a=++Gl,s=[],o=0,l=this.length;l>o;o++){s.push(t=[]);for(var e=this[o],h=0,u=e.length;u>h;h++)(n=e[h])&&(i=Object.create(n.__transition__[r]),i.delay+=i.duration,Fa(n,h,a,i)),t.push(n)}return Ca(s,a)},vs.svg.axis=function(){function t(t){t.each(function(){var t,h=vs.select(this),u=this.__chart__||n,c=this.__chart__=n.copy(),f=null==l?c.ticks?c.ticks.apply(c,o):c.domain():l,p=null==e?c.tickFormat?c.tickFormat.apply(c,o):ge:e,d=h.selectAll(".tick").data(f,c),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Zs),m=vs.transition(d.exit()).style("opacity",Zs).remove(),v=vs.transition(d).style("opacity",1),y=$r(c),x=h.selectAll(".domain").data([0]),b=(x.enter().append("path").attr("class","domain"),vs.transition(x));g.append("line"),g.append("text");var w=g.select("line"),k=v.select("line"),M=d.select("text").text(p),S=g.select("text"),_=v.select("text");switch(i){case"bottom":t=Ra,w.attr("y2",r),S.attr("y",Math.max(r,0)+s),k.attr("x2",0).attr("y2",r),_.attr("x",0).attr("y",Math.max(r,0)+s),M.attr("dy",".71em").style("text-anchor","middle"),b.attr("d","M"+y[0]+","+a+"V0H"+y[1]+"V"+a);break;case"top":t=Ra,w.attr("y2",-r),S.attr("y",-(Math.max(r,0)+s)),k.attr("x2",0).attr("y2",-r),_.attr("x",0).attr("y",-(Math.max(r,0)+s)),M.attr("dy","0em").style("text-anchor","middle"),b.attr("d","M"+y[0]+","+-a+"V0H"+y[1]+"V"+-a);break;case"left":t=La,w.attr("x2",-r),S.attr("x",-(Math.max(r,0)+s)),k.attr("x2",-r).attr("y2",0),_.attr("x",-(Math.max(r,0)+s)).attr("y",0),M.attr("dy",".32em").style("text-anchor","end"),b.attr("d","M"+-a+","+y[0]+"H0V"+y[1]+"H"+-a);break;case"right":t=La,w.attr("x2",r),S.attr("x",Math.max(r,0)+s),k.attr("x2",r).attr("y2",0),_.attr("x",Math.max(r,0)+s).attr("y",0),M.attr("dy",".32em").style("text-anchor","start"),b.attr("d","M"+a+","+y[0]+"H0V"+y[1]+"H"+a)}if(c.rangeBand){var C=c.rangeBand()/2,T=function(t){return c(t)+C};g.call(t,T),v.call(t,T)}else g.call(t,u),v.call(t,c),m.call(t,c)})}var e,n=vs.scale.linear(),i=Xl,r=6,a=6,s=3,o=[10],l=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(i=e in Vl?e+"":Xl,t):i},t.ticks=function(){return arguments.length?(o=arguments,t):o},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(r=+e,a=+arguments[n-1],t):r},t.innerTickSize=function(e){return arguments.length?(r=+e,t):r},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(s=+e,t):s},t.tickSubdivide=function(){return arguments.length&&t},t};var Xl="bottom",Vl={top:1,right:1,bottom:1,left:1};vs.svg.brush=function(){function t(a){a.each(function(){var a=vs.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",r).on("touchstart.brush",r),s=a.selectAll(".background").data([0]);s.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),a.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=a.selectAll(".resize").data(m,ge);o.exit().remove(),o.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ul[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",t.empty()?"none":null);var u,c=vs.transition(a),f=vs.transition(s);l&&(u=$r(l),f.attr("x",u[0]).attr("width",u[1]-u[0]),n(c)),h&&(u=$r(h),f.attr("y",u[0]).attr("height",u[1]-u[0]),i(c)),e(c)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+u[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",u[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",u[1]-u[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function r(){function r(){32==vs.event.keyCode&&(A||(x=null,R[0]-=u[1],R[1]-=f[1],A=2),c())}function p(){32==vs.event.keyCode&&2==A&&(R[0]+=u[1],R[1]+=f[1],A=0,c())}function m(){var t=vs.mouse(w),r=!1;b&&(t[0]+=b[0],t[1]+=b[1]),A||(vs.event.altKey?(x||(x=[(u[0]+u[1])/2,(f[0]+f[1])/2]),R[0]=u[+(t[0]<x[0])],R[1]=f[+(t[1]<x[1])]):x=null),C&&v(t,l,0)&&(n(S),r=!0),T&&v(t,h,1)&&(i(S),r=!0),r&&(e(S),M({type:"brush",mode:A?"move":"resize"}))}function v(t,e,n){var i,r,o=$r(e),l=o[0],h=o[1],c=R[n],p=n?f:u,m=p[1]-p[0];return A&&(l-=c,h-=m+c),i=(n?g:d)?Math.max(l,Math.min(h,t[n])):t[n],A?r=(i+=c)+m:(x&&(c=Math.max(l,Math.min(h,2*x[n]-i))),i>c?(r=i,i=c):r=c),p[0]!=i||p[1]!=r?(n?s=null:a=null,p[0]=i,p[1]=r,!0):void 0}function y(){m(),S.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),vs.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),F(),M({type:"brushend"})}var x,b,w=this,k=vs.select(vs.event.target),M=o.of(w,arguments),S=vs.select(w),_=k.datum(),C=!/^(n|s)$/.test(_)&&l,T=!/^(e|w)$/.test(_)&&h,A=k.classed("extent"),F=I(),R=vs.mouse(w),L=vs.select(ks).on("keydown.brush",r).on("keyup.brush",p);if(vs.event.changedTouches?L.on("touchmove.brush",m).on("touchend.brush",y):L.on("mousemove.brush",m).on("mouseup.brush",y),S.interrupt().selectAll("*").interrupt(),A)R[0]=u[0]-R[0],R[1]=f[0]-R[1];else if(_){var P=+/w$/.test(_),E=+/^n/.test(_);b=[u[1-P]-R[0],f[1-E]-R[1]],R[0]=u[P],R[1]=f[E]}else vs.event.altKey&&(x=R.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),vs.select("body").style("cursor",k.style("cursor")),M({type:"brushstart"}),m()}var a,s,o=p(t,"brushstart","brush","brushend"),l=null,h=null,u=[0,0],f=[0,0],d=!0,g=!0,m=$l[0];return t.event=function(t){t.each(function(){var t=o.of(this,arguments),e={x:u,y:f,i:a,j:s},n=this.__chart__||e;this.__chart__=e,Nl?vs.select(this).transition().each("start.brush",function(){a=n.i,s=n.j,u=n.x,f=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=Ti(u,e.x),i=Ti(f,e.y);return a=s=null,function(r){u=e.x=n(r),f=e.y=i(r),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(l=e,m=$l[!l<<1|!h],t):l},t.y=function(e){return arguments.length?(h=e,m=$l[!l<<1|!h],t):h},t.clamp=function(e){return arguments.length?(l&&h?(d=!!e[0],g=!!e[1]):l?d=!!e:h&&(g=!!e),t):l&&h?[d,g]:l?d:h?g:null},t.extent=function(e){var n,i,r,o,c;return arguments.length?(l&&(n=e[0],i=e[1],h&&(n=n[0],i=i[0]),a=[n,i],l.invert&&(n=l(n),i=l(i)),n>i&&(c=n,n=i,i=c),(n!=u[0]||i!=u[1])&&(u=[n,i])),h&&(r=e[0],o=e[1],l&&(r=r[1],o=o[1]),s=[r,o],h.invert&&(r=h(r),o=h(o)),r>o&&(c=r,r=o,o=c),(r!=f[0]||o!=f[1])&&(f=[r,o])),t):(l&&(a?(n=a[0],i=a[1]):(n=u[0],i=u[1],l.invert&&(n=l.invert(n),i=l.invert(i)),n>i&&(c=n,n=i,i=c))),h&&(s?(r=s[0],o=s[1]):(r=f[0],o=f[1],h.invert&&(r=h.invert(r),o=h.invert(o)),r>o&&(c=r,r=o,o=c))),l&&h?[[n,r],[i,o]]:l?[n,i]:h&&[r,o])},t.clear=function(){return t.empty()||(u=[0,0],f=[0,0],a=s=null),t},t.empty=function(){return!!l&&u[0]==u[1]||!!h&&f[0]==f[1]},vs.rebind(t,o,"on")};var Ul={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ql=vs.time={},Zl=Date,Jl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Pa.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Kl.setUTCDate.apply(this._,arguments)},setDay:function(){Kl.setUTCDay.apply(this._,arguments)},setFullYear:function(){Kl.setUTCFullYear.apply(this._,arguments)},setHours:function(){Kl.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Kl.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Kl.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Kl.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Kl.setUTCSeconds.apply(this._,arguments)},setTime:function(){Kl.setTime.apply(this._,arguments)}};var Kl=Date.prototype,th="%a %b %e %X %Y",eh="%m/%d/%Y",nh="%H:%M:%S",ih=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],rh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ah=["January","February","March","April","May","June","July","August","September","October","November","December"],sh=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ql.year=Ea(function(t){return t=Ql.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ql.years=Ql.year.range,Ql.years.utc=Ql.year.utc.range,Ql.day=Ea(function(t){var e=new Zl(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ql.days=Ql.day.range,Ql.days.utc=Ql.day.utc.range,Ql.dayOfYear=function(t){var e=Ql.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},Jl.forEach(function(t,e){t=t.toLowerCase(),e=7-e;var n=Ql[t]=Ea(function(t){return(t=Ql.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Ql.year(t).getDay();return Math.floor((Ql.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Ql[t+"s"]=n.range,Ql[t+"s"].utc=n.utc.range,Ql[t+"OfYear"]=function(t){var n=Ql.year(t).getDay();return Math.floor((Ql.dayOfYear(t)+(n+e)%7)/7)}}),Ql.week=Ql.sunday,Ql.weeks=Ql.sunday.range,Ql.weeks.utc=Ql.sunday.utc.range,Ql.weekOfYear=Ql.sundayOfYear,Ql.format=Ia;var oh=Ba(ih),lh=Ha(ih),hh=Ba(rh),uh=Ha(rh),ch=Ba(ah),fh=Ha(ah),ph=Ba(sh),dh=Ha(sh),gh=/^%/,mh={"-":"",_:" ",0:"0"},vh={a:function(t){return rh[t.getDay()]},A:function(t){return ih[t.getDay()]},b:function(t){return sh[t.getMonth()]},B:function(t){return ah[t.getMonth()]},c:Ia(th),d:function(t,e){return Wa(t.getDate(),e,2)},e:function(t,e){return Wa(t.getDate(),e,2)},H:function(t,e){return Wa(t.getHours(),e,2)},I:function(t,e){return Wa(t.getHours()%12||12,e,2)},j:function(t,e){return Wa(1+Ql.dayOfYear(t),e,3)},L:function(t,e){return Wa(t.getMilliseconds(),e,3)},m:function(t,e){return Wa(t.getMonth()+1,e,2)},M:function(t,e){return Wa(t.getMinutes(),e,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,e){return Wa(t.getSeconds(),e,2)},U:function(t,e){return Wa(Ql.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Wa(Ql.mondayOfYear(t),e,2)},x:Ia(eh),X:Ia(nh),y:function(t,e){return Wa(t.getFullYear()%100,e,2)},Y:function(t,e){return Wa(t.getFullYear()%1e4,e,4)},Z:ls,"%":function(){return"%"}},yh={a:Na,A:Oa,b:Ga,B:Xa,c:Va,d:es,e:es,H:is,I:is,j:ns,L:ss,m:ts,M:rs,p:os,S:as,U:ja,w:qa,W:Ya,x:Ua,X:$a,y:Za,Y:Qa,Z:Ja,"%":hs},xh=/^\s*\d+/,bh=vs.map({am:0,pm:1});Ia.utc=us;var wh=us("%Y-%m-%dT%H:%M:%S.%LZ");Ia.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?cs:wh,cs.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},cs.toString=wh.toString,Ql.second=Ea(function(t){return new Zl(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Ql.seconds=Ql.second.range,Ql.seconds.utc=Ql.second.utc.range,Ql.minute=Ea(function(t){return new Zl(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Ql.minutes=Ql.minute.range,Ql.minutes.utc=Ql.minute.utc.range,Ql.hour=Ea(function(t){var e=t.getTimezoneOffset()/60;return new Zl(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Ql.hours=Ql.hour.range,Ql.hours.utc=Ql.hour.utc.range,Ql.month=Ea(function(t){return t=Ql.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Ql.months=Ql.month.range,Ql.months.utc=Ql.month.utc.range;var kh=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Mh=[[Ql.second,1],[Ql.second,5],[Ql.second,15],[Ql.second,30],[Ql.minute,1],[Ql.minute,5],[Ql.minute,15],[Ql.minute,30],[Ql.hour,1],[Ql.hour,3],[Ql.hour,6],[Ql.hour,12],[Ql.day,1],[Ql.day,2],[Ql.week,1],[Ql.month,1],[Ql.month,3],[Ql.year,1]],Sh=[[Ia("%Y"),Ge],[Ia("%B"),function(t){return t.getMonth()}],[Ia("%b %d"),function(t){return 1!=t.getDate()}],[Ia("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[Ia("%I %p"),function(t){return t.getHours()}],[Ia("%I:%M"),function(t){return t.getMinutes()}],[Ia(":%S"),function(t){return t.getSeconds()}],[Ia(".%L"),function(t){return t.getMilliseconds()}]],_h=ds(Sh);Mh.year=Ql.year,Ql.scale=function(){return fs(vs.scale.linear(),Mh,_h)};var Ch={range:function(t,e,n){return vs.range(+t,+e,n).map(ps)}},Th=Mh.map(function(t){return[t[0].utc,t[1]]}),Ah=[[us("%Y"),Ge],[us("%B"),function(t){return t.getUTCMonth()}],[us("%b %d"),function(t){return 1!=t.getUTCDate()}],[us("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[us("%I %p"),function(t){return t.getUTCHours()}],[us("%I:%M"),function(t){return t.getUTCMinutes()}],[us(":%S"),function(t){return t.getUTCSeconds()}],[us(".%L"),function(t){return t.getUTCMilliseconds()}]],Fh=ds(Ah);return Th.year=Ql.year.utc,Ql.scale.utc=function(){return fs(vs.scale.linear(),Th,Fh)},vs.text=me(function(t){return t.responseText}),vs.json=function(t,e){return ve(t,"application/json",gs,e)},vs.html=function(t,e){return ve(t,"text/html",ms,e)},vs.xml=me(function(t){return t.responseXML}),vs}(),function(t,e){"function"==typeof define&&define.amd?define(["d3"],function(n){return t.Rickshaw=e(n)}):"object"==typeof exports?module.exports=e(require("d3")):t.Rickshaw=e(d3)}(this,function(t){var e={namespace:function(t){for(var n=t.split("."),i=e,r=1,a=n.length;a>r;r++){var s=n[r];i[s]=i[s]||{},i=i[s]}return i},keys:function(t){var e=[];for(var n in t)e.push(n);return e},extend:function(t,e){for(var n in e)t[n]=e[n];return t},clone:function(t){return JSON.parse(JSON.stringify(t))}};return function(t){function e(t){return c.call(t)===y}function n(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(t){if(r(t)!==v)throw new TypeError;var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}function r(t){switch(t){case null:return f;case void 0:return p}var e=typeof t;switch(e){case"boolean":return d;case"number":return g;case"string":return m}return v}function a(t){return"undefined"==typeof t}function s(t){var e=t.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return 1!=e.length||e[0]?e:[]}function o(t,e){var n=t;return function(){var t=l([u(n,this)],arguments);return e.apply(this,t)}}function l(t,e){for(var n=t.length,i=e.length;i--;)t[n+i]=e[i];return t}function h(t,e){return t=x.call(t,0),l(t,e)}function u(t,e){if(arguments.length<2&&a(arguments[0]))return this;var n=t,i=x.call(arguments,2);return function(){var t=h(i,arguments);return n.apply(e,t)}}var c=Object.prototype.toString,f="Null",p="Undefined",d="Boolean",g="Number",m="String",v="Object",y="[object Function]",x=Array.prototype.slice,b=function(){},w=function(){function t(){}function r(){function i(){this.initialize.apply(this,arguments)}var r=null,a=[].slice.apply(arguments);if(e(a[0])&&(r=a.shift()),n(i,w.Methods),i.superclass=r,i.subclasses=[],r){t.prototype=r.prototype,i.prototype=new t;try{r.subclasses.push(i)}catch(s){}}for(var o=0,l=a.length;l>o;o++)i.addMethods(a[o]);return i.prototype.initialize||(i.prototype.initialize=b),i.prototype.constructor=i,i}function a(t){var n=this.superclass&&this.superclass.prototype,r=i(t);l&&(t.toString!=Object.prototype.toString&&r.push("toString"),t.valueOf!=Object.prototype.valueOf&&r.push("valueOf"));for(var a=0,h=r.length;h>a;a++){var c=r[a],f=t[c];if(n&&e(f)&&"$super"==s(f)[0]){var p=f;f=o(function(t){return function(){return n[t].apply(this,arguments)}}(c),p),f.valueOf=u(p.valueOf,p),f.toString=u(p.toString,p)}this.prototype[c]=f}return this}var l=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}();return{create:r,Methods:{addMethods:a}}}();t.exports?t.exports.Class=w:t.Class=w}(e),e.namespace("Rickshaw.Compat.ClassList"),e.Compat.ClassList=function(){"undefined"==typeof document||"classList"in document.createElement("a")||!function(t){"use strict";var e="classList",n="prototype",i=(t.HTMLElement||t.Element)[n],r=Object,a=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},o=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},l=function(t,e){if(""===e)throw new o("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new o("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},h=function(t){for(var e=a.call(t.className),n=e?e.split(/\s+/):[],i=0,r=n.length;r>i;i++)this.push(n[i]);this._updateClassName=function(){t.className=this.toString()}},u=h[n]=[],c=function(){return new h(this)};if(o[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==l(this,t)},u.add=function(t){t+="",-1===l(this,t)&&(this.push(t),this._updateClassName())},u.remove=function(t){t+="";var e=l(this,t);-1!==e&&(this.splice(e,1),this._updateClassName())},u.toggle=function(t){t+="",-1===l(this,t)?this.add(t):this.remove(t)},u.toString=function(){return this.join(" ")},r.defineProperty){var f={get:c,enumerable:!0,configurable:!0};try{r.defineProperty(i,e,f)}catch(p){-2146823252===p.number&&(f.enumerable=!1,r.defineProperty(i,e,f))}}else r[n].__defineGetter__&&i.__defineGetter__(e,c)}(window)},("undefined"!=typeof RICKSHAW_NO_COMPAT&&!RICKSHAW_NO_COMPAT||"undefined"==typeof RICKSHAW_NO_COMPAT)&&new e.Compat.ClassList,e.namespace("Rickshaw.Graph"),e.Graph=function(n){var i=this;this.initialize=function(e){if(!e.element)throw"Rickshaw.Graph needs a reference to an element";if(1!==e.element.nodeType)throw"Rickshaw.Graph element was defined but not an HTML element";this.element=e.element,this.series=e.series,this.window={},this.updateCallbacks=[],this.configureCallbacks=[],this.defaults={interpolation:"cardinal",offset:"zero",min:void 0,max:void 0,preserve:!1,xScale:void 0,yScale:void 0,stack:!0},this._loadRenderers(),this.configure(e),this.validateSeries(e.series),this.series.active=function(){return i.series.filter(function(t){return!t.disabled})},this.setSize({width:e.width,height:e.height}),this.element.classList.add("rickshaw_graph"),this.vis=t.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height),this.discoverRange()},this._loadRenderers=function(){for(var t in e.Graph.Renderer)if(t&&e.Graph.Renderer.hasOwnProperty(t)){var n=e.Graph.Renderer[t];n&&n.prototype&&n.prototype.render&&i.registerRenderer(new n({graph:i}))}},this.validateSeries=function(t){if(!(Array.isArray(t)||t instanceof e.Series)){var n=Object.prototype.toString.apply(t);throw"series is not an array: "+n}t.forEach(function(t){if(!(t instanceof Object))throw"series element is not an object: "+t;if(!t.data)throw"series has no data: "+JSON.stringify(t);if(!Array.isArray(t.data))throw"series data is not an array: "+JSON.stringify(t.data);if(t.data.length>0){var e=t.data[0].x,n=t.data[0].y;if("number"!=typeof e||"number"!=typeof n&&null!==n)throw"x and y properties of points should be numbers instead of "+typeof e+" and "+typeof n}if(t.data.length>=3&&(t.data[2].x<t.data[1].x||t.data[1].x<t.data[0].x||t.data[t.data.length-1].x<t.data[0].x))throw"series data needs to be sorted on x values for series name: "+t.name},this)},this.dataDomain=function(){var e=this.series.map(function(t){return t.data}),n=t.min(e.map(function(t){return t[0].x})),i=t.max(e.map(function(t){return t[t.length-1].x}));return[n,i]},this.discoverRange=function(){var e=this.renderer.domain();this.x=(this.xScale||t.scale.linear()).copy().domain(e.x).range([0,this.width]),this.y=(this.yScale||t.scale.linear()).copy().domain(e.y).range([this.height,0]),this.x.magnitude=t.scale.linear().domain([e.x[0]-e.x[0],e.x[1]-e.x[0]]).range([0,this.width]),this.y.magnitude=t.scale.linear().domain([e.y[0]-e.y[0],e.y[1]-e.y[0]]).range([0,this.height])},this.render=function(){this.stackData();this.discoverRange(),this.renderer.render(),this.updateCallbacks.forEach(function(t){t()})},this.update=this.render,this.stackData=function(){var n=this.series.active().map(function(t){return t.data}).map(function(t){return t.filter(function(t){return this._slice(t)},this)},this),r=this.preserve;r||this.series.forEach(function(t){t.scale&&(r=!0)}),n=r?e.clone(n):n,this.series.active().forEach(function(t,e){if(t.scale){var i=n[e];i&&i.forEach(function(e){e.y=t.scale(e.y)})}}),this.stackData.hooks.data.forEach(function(t){n=t.f.apply(i,[n])});var a;if(!this.renderer.unstack){this._validateStackable();var s=t.layout.stack();s.offset(i.offset),a=s(n)}a=a||n,this.renderer.unstack&&a.forEach(function(t){t.forEach(function(t){t.y0=void 0===t.y0?0:t.y0})}),this.stackData.hooks.after.forEach(function(t){a=t.f.apply(i,[n])});var o=0;return this.series.forEach(function(t){t.disabled||(t.stack=a[o++])}),this.stackedData=a,a},this._validateStackable=function(){var t,e=this.series;e.forEach(function(e){if(t=t||e.data.length,t&&e.data.length!=t)throw"stacked series cannot have differing numbers of points: "+t+" vs "+e.data.length+"; see Rickshaw.Series.fill()"},this)},this.stackData.hooks={data:[],after:[]},this._slice=function(t){if(this.window.xMin||this.window.xMax){var e=!0;
  return this.window.xMin&&t.x<this.window.xMin&&(e=!1),this.window.xMax&&t.x>this.window.xMax&&(e=!1),e}return!0},this.onUpdate=function(t){this.updateCallbacks.push(t)},this.onConfigure=function(t){this.configureCallbacks.push(t)},this.registerRenderer=function(t){this._renderers=this._renderers||{},this._renderers[t.name]=t},this.configure=function(t){this.config=this.config||{},(t.width||t.height)&&this.setSize(t),e.keys(this.defaults).forEach(function(e){this.config[e]=e in t?t[e]:e in this?this[e]:this.defaults[e]},this),e.keys(this.config).forEach(function(t){this[t]=this.config[t]},this),"stack"in t&&(t.unstack=!t.stack);var n=t.renderer||this.renderer&&this.renderer.name||"stack";this.setRenderer(n,t),this.configureCallbacks.forEach(function(e){e(t)})},this.setRenderer=function(t,e){if("function"==typeof t)this.renderer=new t({graph:i}),this.registerRenderer(this.renderer);else{if(!this._renderers[t])throw"couldn't find renderer "+t;this.renderer=this._renderers[t]}"object"==typeof e&&this.renderer.configure(e)},this.setSize=function(t){if(t=t||{},void 0!==typeof window)var e=window.getComputedStyle(this.element,null),n=parseInt(e.getPropertyValue("width"),10),i=parseInt(e.getPropertyValue("height"),10);this.width=t.width||n||400,this.height=t.height||i||250,this.vis&&this.vis.attr("width",this.width).attr("height",this.height)},this.initialize(n)},e.namespace("Rickshaw.Fixtures.Color"),e.Fixtures.Color=function(){this.schemes={},this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse(),this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"],this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"],this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse(),this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"},this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse(),this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"],this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]},e.namespace("Rickshaw.Fixtures.RandomData"),e.Fixtures.RandomData=function(t){t=t||1;var e=200,n=Math.floor((new Date).getTime()/1e3);this.addData=function(i){var r=100*Math.random()+15+e,a=i[0].length,s=1;i.forEach(function(e){var i=20*Math.random(),o=r/25+s++ +15*(Math.cos(a*s*11/960)+2)+7*(Math.cos(a/7)+2)+1*(Math.cos(a/17)+2);e.push({x:a*t+n,y:o+i})}),e=.85*r},this.removeData=function(e){e.forEach(function(t){t.shift()}),n+=t}},e.namespace("Rickshaw.Fixtures.Time"),e.Fixtures.Time=function(){var e=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.units=[{name:"decade",seconds:315576e3,formatter:function(t){return 10*parseInt(t.getUTCFullYear()/10,10)}},{name:"year",seconds:31557600,formatter:function(t){return t.getUTCFullYear()}},{name:"month",seconds:2635200,formatter:function(t){return e.months[t.getUTCMonth()]}},{name:"week",seconds:604800,formatter:function(t){return e.formatDate(t)}},{name:"day",seconds:86400,formatter:function(t){return t.getUTCDate()}},{name:"6 hour",seconds:21600,formatter:function(t){return e.formatTime(t)}},{name:"hour",seconds:3600,formatter:function(t){return e.formatTime(t)}},{name:"15 minute",seconds:900,formatter:function(t){return e.formatTime(t)}},{name:"minute",seconds:60,formatter:function(t){return t.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(t){return t.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(t){return t.getUTCSeconds()+"s"}},{name:"decisecond",seconds:.1,formatter:function(t){return t.getUTCMilliseconds()+"ms"}},{name:"centisecond",seconds:.01,formatter:function(t){return t.getUTCMilliseconds()+"ms"}}],this.unit=function(t){return this.units.filter(function(e){return t==e.name}).shift()},this.formatDate=function(e){return t.time.format("%b %e")(e)},this.formatTime=function(t){return t.toUTCString().match(/(\d+:\d+):/)[1]},this.ceil=function(t,e){var n,i,r;if("month"==e.name){if(n=new Date(1e3*t),i=Date.UTC(n.getUTCFullYear(),n.getUTCMonth())/1e3,i==t)return t;r=n.getUTCFullYear();var a=n.getUTCMonth();return 11==a?(a=0,r+=1):a+=1,Date.UTC(r,a)/1e3}return"year"==e.name?(n=new Date(1e3*t),i=Date.UTC(n.getUTCFullYear(),0)/1e3,i==t?t:(r=n.getUTCFullYear()+1,Date.UTC(r,0)/1e3)):Math.ceil(t/e.seconds)*e.seconds}},e.namespace("Rickshaw.Fixtures.Time.Local"),e.Fixtures.Time.Local=function(){var e=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.units=[{name:"decade",seconds:315576e3,formatter:function(t){return 10*parseInt(t.getFullYear()/10,10)}},{name:"year",seconds:31557600,formatter:function(t){return t.getFullYear()}},{name:"month",seconds:2635200,formatter:function(t){return e.months[t.getMonth()]}},{name:"week",seconds:604800,formatter:function(t){return e.formatDate(t)}},{name:"day",seconds:86400,formatter:function(t){return t.getDate()}},{name:"6 hour",seconds:21600,formatter:function(t){return e.formatTime(t)}},{name:"hour",seconds:3600,formatter:function(t){return e.formatTime(t)}},{name:"15 minute",seconds:900,formatter:function(t){return e.formatTime(t)}},{name:"minute",seconds:60,formatter:function(t){return t.getMinutes()}},{name:"15 second",seconds:15,formatter:function(t){return t.getSeconds()+"s"}},{name:"second",seconds:1,formatter:function(t){return t.getSeconds()+"s"}},{name:"decisecond",seconds:.1,formatter:function(t){return t.getMilliseconds()+"ms"}},{name:"centisecond",seconds:.01,formatter:function(t){return t.getMilliseconds()+"ms"}}],this.unit=function(t){return this.units.filter(function(e){return t==e.name}).shift()},this.formatDate=function(e){return t.time.format("%b %e")(e)},this.formatTime=function(t){return t.toString().match(/(\d+:\d+):/)[1]},this.ceil=function(t,e){var n,i,r;if("day"==e.name){var a=new Date(1e3*(t+e.seconds-1)),s=new Date(0);return s.setMilliseconds(0),s.setSeconds(0),s.setMinutes(0),s.setHours(0),s.setDate(a.getDate()),s.setMonth(a.getMonth()),s.setFullYear(a.getFullYear()),s.getTime()/1e3}if("month"==e.name){if(n=new Date(1e3*t),i=new Date(n.getFullYear(),n.getMonth()).getTime()/1e3,i==t)return t;r=n.getFullYear();var o=n.getMonth();return 11==o?(o=0,r+=1):o+=1,new Date(r,o).getTime()/1e3}return"year"==e.name?(n=new Date(1e3*t),i=new Date(n.getUTCFullYear(),0).getTime()/1e3,i==t?t:(r=n.getFullYear()+1,new Date(r,0).getTime()/1e3)):Math.ceil(t/e.seconds)*e.seconds}},e.namespace("Rickshaw.Fixtures.Number"),e.Fixtures.Number.formatKMBT=function(t){var e=Math.abs(t);return e>=1e12?t/1e12+"T":e>=1e9?t/1e9+"B":e>=1e6?t/1e6+"M":e>=1e3?t/1e3+"K":1>e&&t>0?t.toFixed(2):0===e?"":t},e.Fixtures.Number.formatBase1024KMGTP=function(t){var e=Math.abs(t);return e>=0x4000000000000?t/0x4000000000000+"P":e>=1099511627776?t/1099511627776+"T":e>=1073741824?t/1073741824+"G":e>=1048576?t/1048576+"M":e>=1024?t/1024+"K":1>e&&t>0?t.toFixed(2):0===e?"":t},e.namespace("Rickshaw.Color.Palette"),e.Color.Palette=function(n){var i=new e.Fixtures.Color;if(n=n||{},this.schemes={},this.scheme=i.schemes[n.scheme]||n.scheme||i.schemes.colorwheel,this.runningIndex=0,this.generatorIndex=0,n.interpolatedStopCount){var r,a,s=this.scheme.length-1,o=[];for(r=0;s>r;r++){o.push(this.scheme[r]);var l=t.interpolateHsl(this.scheme[r],this.scheme[r+1]);for(a=1;a<n.interpolatedStopCount;a++)o.push(l(1/n.interpolatedStopCount*a))}o.push(this.scheme[this.scheme.length-1]),this.scheme=o}this.rotateCount=this.scheme.length,this.color=function(t){return this.scheme[t]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"},this.interpolateColor=function(){if(Array.isArray(this.scheme)){var e;return this.generatorIndex==2*this.rotateCount-1?(e=t.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5),this.generatorIndex=0,this.rotateCount*=2):(e=t.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5),this.generatorIndex++),this.scheme.push(e),e}}},e.namespace("Rickshaw.Graph.Ajax"),e.Graph.Ajax=e.Class.create({initialize:function(t){this.dataURL=t.dataURL,this.onData=t.onData||function(t){return t},this.onComplete=t.onComplete||function(){},this.onError=t.onError||function(){},this.args=t,this.request()},request:function(){jQuery.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL),this.onError(this)},success:function(t){t=this.onData(t),this.args.series=this._splice({data:t,series:this.args.series}),this.graph=this.graph||new e.Graph(this.args),this.graph.render(),this.onComplete(this)},_splice:function(t){var e=t.data,n=t.series;return t.series?(n.forEach(function(t){var n=t.key||t.name;if(!n)throw"series needs a key or a name";e.forEach(function(e){var i=e.key||e.name;if(!i)throw"data needs a key or a name";if(n==i){var r=["color","name","data"];r.forEach(function(n){e[n]&&(t[n]=e[n])})}})}),n):e}}),e.namespace("Rickshaw.Graph.Annotate"),e.Graph.Annotate=function(t){this.graph=t.graph;this.elements={intimeline:t.element};var n=this;this.data={},this.elements.intimeline.classList.add("rickshaw_annotation_intimeline"),this.add=function(t,e,i){n.data[t]=n.data[t]||{boxes:[]},n.data[t].boxes.push({content:e,end:i})},this.update=function(){e.keys(n.data).forEach(function(t){var e=n.data[t],i=n.graph.x(t);if(0>i||i>n.graph.x.range()[1])return e.element&&(e.line.classList.add("offscreen"),e.element.style.display="none"),e.boxes.forEach(function(t){t.rangeElement&&t.rangeElement.classList.add("offscreen")}),void 0;if(!e.element){var r=e.element=document.createElement("div");r.classList.add("annotation"),this.elements.intimeline.appendChild(r),r.addEventListener("click",function(){r.classList.toggle("active"),e.line.classList.toggle("active"),e.boxes.forEach(function(t){t.rangeElement&&t.rangeElement.classList.toggle("active")})},!1)}e.element.style.left=i+"px",e.element.style.display="block",e.boxes.forEach(function(t){var r=t.element;if(r||(r=t.element=document.createElement("div"),r.classList.add("content"),r.innerHTML=t.content,e.element.appendChild(r),e.line=document.createElement("div"),e.line.classList.add("annotation_line"),n.graph.element.appendChild(e.line),t.end&&(t.rangeElement=document.createElement("div"),t.rangeElement.classList.add("annotation_range"),n.graph.element.appendChild(t.rangeElement))),t.end){var a=i,s=Math.min(n.graph.x(t.end),n.graph.x.range()[1]);a>s&&(s=i,a=Math.max(n.graph.x(t.end),n.graph.x.range()[0]));var o=s-a;t.rangeElement.style.left=a+"px",t.rangeElement.style.width=o+"px",t.rangeElement.classList.remove("offscreen")}e.line.classList.remove("offscreen"),e.line.style.left=i+"px"})},this)},this.graph.onUpdate(function(){n.update()})},e.namespace("Rickshaw.Graph.Axis.Time"),e.Graph.Axis.Time=function(t){var n=this;this.graph=t.graph,this.elements=[],this.ticksTreatment=t.ticksTreatment||"plain",this.fixedTimeUnit=t.timeUnit;var i=t.timeFixture||new e.Fixtures.Time;this.appropriateTimeUnit=function(){var t,e=i.units,n=this.graph.x.domain(),r=n[1]-n[0];return e.forEach(function(e){Math.floor(r/e.seconds)>=2&&(t=t||e)}),t||i.units[i.units.length-1]},this.tickOffsets=function(){for(var t=this.graph.x.domain(),e=this.fixedTimeUnit||this.appropriateTimeUnit(),n=Math.ceil((t[1]-t[0])/e.seconds),r=t[0],a=[],s=0;n>s;s++){var o=i.ceil(r,e);r=o+e.seconds/2,a.push({value:o,unit:e})}return a},this.render=function(){this.elements.forEach(function(t){t.parentNode.removeChild(t)}),this.elements=[];var t=this.tickOffsets();t.forEach(function(t){if(!(n.graph.x(t.value)>n.graph.x.range()[1])){var e=document.createElement("div");e.style.left=n.graph.x(t.value)+"px",e.classList.add("x_tick"),e.classList.add(n.ticksTreatment);var i=document.createElement("div");i.classList.add("title"),i.innerHTML=t.unit.formatter(new Date(1e3*t.value)),e.appendChild(i),n.graph.element.appendChild(e),n.elements.push(e)}})},this.graph.onUpdate(function(){n.render()})},e.namespace("Rickshaw.Graph.Axis.X"),e.Graph.Axis.X=function(e){var n=this,i=.1;this.initialize=function(e){this.graph=e.graph,this.orientation=e.orientation||"top",this.pixelsPerTick=e.pixelsPerTick||75,e.ticks&&(this.staticTicks=e.ticks),e.tickValues&&(this.tickValues=e.tickValues),this.tickSize=e.tickSize||4,this.ticksTreatment=e.ticksTreatment||"plain",e.element?(this.element=e.element,this._discoverSize(e.element,e),this.vis=t.select(e.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3"),this.element=this.vis[0][0],this.element.style.position="relative",this.setSize({width:e.width,height:e.height})):this.vis=this.graph.vis,this.graph.onUpdate(function(){n.render()})},this.setSize=function(t){if(t=t||{},this.element){this._discoverSize(this.element.parentNode,t),this.vis.attr("height",this.height).attr("width",this.width*(1+i));var e=Math.floor(this.width*i/2);this.element.style.left=-1*e+"px"}},this.render=function(){void 0!==this._renderWidth&&this.graph.width!==this._renderWidth&&this.setSize({auto:!0});var n=t.svg.axis().scale(this.graph.x).orient(this.orientation);n.tickFormat(e.tickFormat||function(t){return t}),this.tickValues&&n.tickValues(this.tickValues),this.ticks=this.staticTicks||Math.floor(this.graph.width/this.pixelsPerTick);var r,a=Math.floor(this.width*i/2)||0;if("top"==this.orientation){var s=this.height||this.graph.height;r="translate("+a+","+s+")"}else r="translate("+a+", 0)";this.element&&this.vis.selectAll("*").remove(),this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",r).call(n.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var o=("bottom"==this.orientation?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(n.ticks(this.ticks).tickSubdivide(0).tickSize(o)).selectAll("text").each(function(){this.parentNode.setAttribute("data-x-value",this.textContent)}),this._renderHeight=this.graph.height},this._discoverSize=function(t,e){if("undefined"!=typeof window){var n=window.getComputedStyle(t,null),r=parseInt(n.getPropertyValue("height"),10);if(!e.auto)var a=parseInt(n.getPropertyValue("width"),10)}this.width=(e.width||a||this.graph.width)*(1+i),this.height=e.height||r||40},this.initialize(e)},e.namespace("Rickshaw.Graph.Axis.Y"),e.Graph.Axis.Y=e.Class.create({initialize:function(e){this.graph=e.graph,this.orientation=e.orientation||"right",this.pixelsPerTick=e.pixelsPerTick||75,e.ticks&&(this.staticTicks=e.ticks),e.tickValues&&(this.tickValues=e.tickValues),this.tickSize=e.tickSize||4,this.ticksTreatment=e.ticksTreatment||"plain",this.tickFormat=e.tickFormat||function(t){return t},this.berthRate=.1,e.element?(this.element=e.element,this.vis=t.select(e.element).append("svg:svg").attr("class","rickshaw_graph y_axis"),this.element=this.vis[0][0],this.element.style.position="relative",this.setSize({width:e.width,height:e.height})):this.vis=this.graph.vis;var n=this;this.graph.onUpdate(function(){n.render()})},setSize:function(t){if(t=t||{},this.element){if("undefined"!=typeof window){var e=window.getComputedStyle(this.element.parentNode,null),n=parseInt(e.getPropertyValue("width"),10);if(!t.auto)var i=parseInt(e.getPropertyValue("height"),10)}this.width=t.width||n||this.graph.width*this.berthRate,this.height=t.height||i||this.graph.height,this.vis.attr("width",this.width).attr("height",this.height*(1+this.berthRate));var r=this.height*this.berthRate;"left"==this.orientation&&(this.element.style.top=-1*r+"px")}},render:function(){void 0!==this._renderHeight&&this.graph.height!==this._renderHeight&&this.setSize({auto:!0}),this.ticks=this.staticTicks||Math.floor(this.graph.height/this.pixelsPerTick);var t=this._drawAxis(this.graph.y);this._drawGrid(t),this._renderHeight=this.graph.height},_drawAxis:function(e){var n=t.svg.axis().scale(e).orient(this.orientation);if(n.tickFormat(this.tickFormat),this.tickValues&&n.tickValues(this.tickValues),"left"==this.orientation)var i=this.height*this.berthRate,r="translate("+this.width+", "+i+")";return this.element&&this.vis.selectAll("*").remove(),this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",r).call(n.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize)),n},_drawGrid:function(t){var e=("right"==this.orientation?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(t.ticks(this.ticks).tickSubdivide(0).tickSize(e)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)})}}),e.namespace("Rickshaw.Graph.Axis.Y.Scaled"),e.Graph.Axis.Y.Scaled=e.Class.create(e.Graph.Axis.Y,{initialize:function($super,t){if("undefined"==typeof t.scale)throw new Error("Scaled requires scale");this.scale=t.scale,this.grid="undefined"==typeof t.grid?!0:t.grid,$super(t)},_drawAxis:function($super,e){var n=this.scale.domain(),i=this.graph.renderer.domain().y,r=[Math.min.apply(Math,n),Math.max.apply(Math,n)],a=t.scale.linear().domain([0,1]).range(r),s=[a(i[0]),a(i[1])],o=t.scale.linear().domain(r).range(s),l=this.scale.copy().domain(n.map(o)).range(e.range());return $super(l)},_drawGrid:function($super,t){this.grid&&$super(t)}}),e.namespace("Rickshaw.Graph.Behavior.Series.Highlight"),e.Graph.Behavior.Series.Highlight=function(e){this.graph=e.graph,this.legend=e.legend;var n=this,i={},r=null,a=e.disabledColor||function(e){return t.interpolateRgb(e,t.rgb("#d8d8d8"))(.8).toString()};this.addHighlightEvents=function(t){t.element.addEventListener("mouseover",function(){r||(r=t,n.legend.lines.forEach(function(e){if(t!==e)i[e.series.name]=i[e.series.name]||e.series.color,e.series.color=a(e.series.color);else if(n.graph.renderer.unstack&&(e.series.renderer?e.series.renderer.unstack:!0)){var r=n.graph.series.indexOf(e.series);e.originalIndex=r;var s=n.graph.series.splice(r,1)[0];n.graph.series.push(s)}}),n.graph.update())},!1),t.element.addEventListener("mouseout",function(){r&&(r=null,n.legend.lines.forEach(function(e){if(t===e&&e.hasOwnProperty("originalIndex")){var r=n.graph.series.pop();n.graph.series.splice(e.originalIndex,0,r),delete e.originalIndex}i[e.series.name]&&(e.series.color=i[e.series.name])}),n.graph.update())},!1)},this.legend&&this.legend.lines.forEach(function(t){n.addHighlightEvents(t)})},e.namespace("Rickshaw.Graph.Behavior.Series.Order"),e.Graph.Behavior.Series.Order=function(t){this.graph=t.graph,this.legend=t.legend;var e=this;if("undefined"==typeof window.jQuery)throw"couldn't find jQuery at window.jQuery";if("undefined"==typeof window.jQuery.ui)throw"couldn't find jQuery UI at window.jQuery.ui";jQuery(function(){jQuery(e.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(){var t=[];jQuery(e.legend.list).find("li").each(function(e,n){n.series&&t.push(n.series)});for(var n=e.graph.series.length-1;n>=0;n--)e.graph.series[n]=t.shift();e.graph.update()}}),jQuery(e.legend.list).disableSelection()}),this.graph.onUpdate(function(){var t=window.getComputedStyle(e.legend.element).height;e.legend.element.style.height=t})},e.namespace("Rickshaw.Graph.Behavior.Series.Toggle"),e.Graph.Behavior.Series.Toggle=function(t){this.graph=t.graph,this.legend=t.legend;var e=this;if(this.addAnchor=function(t){var n=document.createElement("a");n.innerHTML="&#10004;",n.classList.add("action"),t.element.insertBefore(n,t.element.firstChild),n.onclick=function(){if(t.series.disabled)t.series.enable(),t.element.classList.remove("disabled");else{if(this.graph.series.filter(function(t){return!t.disabled}).length<=1)return;t.series.disable(),t.element.classList.add("disabled")}}.bind(this);var i=t.element.getElementsByTagName("span")[0];i.onclick=function(){var n=t.series.disabled;if(!n)for(var i=0;i<e.legend.lines.length;i++){var r=e.legend.lines[i];if(t.series===r.series);else if(!r.series.disabled){n=!0;break}}n?(t.series.enable(),t.element.classList.remove("disabled"),e.legend.lines.forEach(function(e){t.series===e.series||(e.series.disable(),e.element.classList.add("disabled"))})):e.legend.lines.forEach(function(t){t.series.enable(),t.element.classList.remove("disabled")})}},this.legend){var n=jQuery;"undefined"!=typeof n&&n(this.legend.list).sortable&&n(this.legend.list).sortable({start:function(t,e){e.item.bind("no.onclick",function(t){t.preventDefault()})},stop:function(t,e){setTimeout(function(){e.item.unbind("no.onclick")},250)}}),this.legend.lines.forEach(function(t){e.addAnchor(t)})}this._addBehavior=function(){this.graph.series.forEach(function(t){t.disable=function(){if(e.graph.series.length<=1)throw"only one series left";t.disabled=!0,e.graph.update()},t.enable=function(){t.disabled=!1,e.graph.update()}})},this._addBehavior(),this.updateBehaviour=function(){this._addBehavior()}},e.namespace("Rickshaw.Graph.HoverDetail"),e.Graph.HoverDetail=e.Class.create({initialize:function(t){var e=this.graph=t.graph;this.xFormatter=t.xFormatter||function(t){return new Date(1e3*t).toUTCString()},this.yFormatter=t.yFormatter||function(t){return null===t?t:t.toFixed(2)};var n=this.element=document.createElement("div");n.className="detail",this.visible=!0,e.element.appendChild(n),this.lastEvent=null,this._addListeners(),this.onShow=t.onShow,this.onHide=t.onHide,this.onRender=t.onRender,this.formatter=t.formatter||this.formatter},formatter:function(t,e,n,i,r){return t.name+":&nbsp;"+r},update:function(e){if(e=e||this.lastEvent,e&&(this.lastEvent=e,e.target.nodeName.match(/^(path|svg|rect|circle)$/))){var n,i=this.graph,r=e.offsetX||e.layerX,a=e.offsetY||e.layerY,s=0,o=[];if(this.graph.series.active().forEach(function(e){var l=this.graph.stackedData[s++];if(l.length){var h=i.x.invert(r),u=t.scale.linear().domain([l[0].x,l.slice(-1)[0].x]).range([0,l.length-1]),c=Math.round(u(h));c==l.length-1&&c--;for(var f=Math.min(c||0,l.length-1),p=c;p<l.length-1&&(l[p]&&l[p+1]);){if(l[p].x<=h&&l[p+1].x>h){f=Math.abs(h-l[p].x)<Math.abs(h-l[p+1].x)?p:p+1;break}l[p+1].x<=h?p++:p--}0>f&&(f=0);var d=l[f],g=Math.sqrt(Math.pow(Math.abs(i.x(d.x)-r),2)+Math.pow(Math.abs(i.y(d.y+d.y0)-a),2)),m=e.xFormatter||this.xFormatter,v=e.yFormatter||this.yFormatter,y={formattedXValue:m(d.x),formattedYValue:v(e.scale?e.scale.invert(d.y):d.y),series:e,value:d,distance:g,order:s,name:e.name};(!n||g<n.distance)&&(n=y),o.push(y)}},this),n){n.active=!0;var l=n.value.x,h=n.formattedXValue;this.element.innerHTML="",this.element.style.left=i.x(l)+"px",this.visible&&this.render({points:o,detail:o,mouseX:r,mouseY:a,formattedXValue:h,domainX:l})}}},hide:function(){this.visible=!1,this.element.classList.add("inactive"),"function"==typeof this.onHide&&this.onHide()},show:function(){this.visible=!0,this.element.classList.remove("inactive"),"function"==typeof this.onShow&&this.onShow()},render:function(t){var e=this.graph,n=t.points,i=n.filter(function(t){return t.active}).shift();if(null!==i.value.y){var r=i.formattedXValue,a=i.formattedYValue;this.element.innerHTML="",this.element.style.left=e.x(i.value.x)+"px";var s=document.createElement("div");s.className="x_label",s.innerHTML=r,this.element.appendChild(s);var o=document.createElement("div");o.className="item";var l=i.series,h=l.scale?l.scale.invert(i.value.y):i.value.y;o.innerHTML=this.formatter(l,i.value.x,h,r,a,i),o.style.top=this.graph.y(i.value.y0+i.value.y)+"px",this.element.appendChild(o);var u=document.createElement("div");u.className="dot",u.style.top=o.style.top,u.style.borderColor=l.color,this.element.appendChild(u),i.active&&(o.classList.add("active"),u.classList.add("active"));var c=[s,o];c.forEach(function(t){t.classList.add("left")}),this.show();var f=this._calcLayoutError(c);if(f>0){c.forEach(function(t){t.classList.remove("left"),t.classList.add("right")});var p=this._calcLayoutError(c);p>f&&c.forEach(function(t){t.classList.remove("right"),t.classList.add("left")})}"function"==typeof this.onRender&&this.onRender(t)}},_calcLayoutError:function(t){{var e=this.element.parentNode.getBoundingClientRect(),n=0;t.forEach(function(t){var i=t.getBoundingClientRect();i.width&&(i.right>e.right&&(n+=i.right-e.right),i.left<e.left&&(n+=e.left-i.left))})}return n},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(t){this.visible=!0,this.update(t)}.bind(this),!1),this.graph.onUpdate(function(){this.update()}.bind(this)),this.graph.element.addEventListener("mouseout",function(t){!t.relatedTarget||t.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS||this.hide()}.bind(this),!1)}}),e.namespace("Rickshaw.Graph.JSONP"),e.Graph.JSONP=e.Class.create(e.Graph.Ajax,{request:function(){jQuery.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}}),e.namespace("Rickshaw.Graph.Legend"),e.Graph.Legend=e.Class.create({className:"rickshaw_legend",initialize:function(t){this.element=t.element,this.graph=t.graph,this.naturalOrder=t.naturalOrder,this.element.classList.add(this.className),this.list=document.createElement("ul"),this.element.appendChild(this.list),this.render(),this.graph.onUpdate(function(){})},render:function(){for(var t=this;this.list.firstChild;)this.list.removeChild(this.list.firstChild);this.lines=[];var e=this.graph.series.map(function(t){return t});this.naturalOrder||(e=e.reverse()),e.forEach(function(e){t.addLine(e)})},addLine:function(e){var n=document.createElement("li");n.className="line",e.disabled&&(n.className+=" disabled"),e.className&&t.select(n).classed(e.className,!0);var i=document.createElement("div");i.className="swatch",i.style.backgroundColor=e.color,n.appendChild(i);var r=document.createElement("span");r.className="label",r.innerHTML=e.name,n.appendChild(r),this.list.appendChild(n),n.series=e,e.noLegend&&(n.style.display="none");var a={element:n,series:e};return this.shelving&&(this.shelving.addAnchor(a),this.shelving.updateBehaviour()),this.highlighter&&this.highlighter.addHighlightEvents(a),this.lines.push(a),n}}),e.namespace("Rickshaw.Graph.RangeSlider"),e.Graph.RangeSlider=e.Class.create({initialize:function(t){var e=(this.element=t.element,this.graph=t.graph);this.slideCallbacks=[],this.build(),e.onUpdate(function(){this.update()}.bind(this))},build:function(){var t=this.element,e=this.graph,n=jQuery,i=e.dataDomain(),r=this;n(function(){n(t).slider({range:!0,min:i[0],max:i[1],values:[i[0],i[1]],slide:function(t,n){if(!(n.values[1]<=n.values[0])){e.window.xMin=n.values[0],e.window.xMax=n.values[1],e.update();var i=e.dataDomain();i[0]==n.values[0]&&(e.window.xMin=void 0),i[1]==n.values[1]&&(e.window.xMax=void 0),r.slideCallbacks.forEach(function(t){t(e,e.window.xMin,e.window.xMax)})}}})}),n(t)[0].style.width=e.width+"px"},update:function(){var t=this.element,e=this.graph,n=jQuery,i=n(t).slider("option","values"),r=e.dataDomain();n(t).slider("option","min",r[0]),n(t).slider("option","max",r[1]),null==e.window.xMin&&(i[0]=r[0]),null==e.window.xMax&&(i[1]=r[1]),n(t).slider("option","values",i)},onSlide:function(t){this.slideCallbacks.push(t)}}),e.namespace("Rickshaw.Graph.RangeSlider.Preview"),e.Graph.RangeSlider.Preview=e.Class.create({initialize:function(e){if(!e.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!e.graph&&!e.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=e.element,this.element.style.position="relative",this.graphs=e.graph?[e.graph]:e.graphs,this.defaults={height:75,width:400,gripperColor:void 0,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0,heightRatio:.2},this.heightRatio=e.heightRatio||this.defaults.heightRatio,this.defaults.gripperColor=t.rgb(this.defaults.frameColor).darker().toString(),this.configureCallbacks=[],this.slideCallbacks=[],this.previews=[],e.width||(this.widthFromGraph=!0),e.height||(this.heightFromGraph=!0),(this.widthFromGraph||this.heightFromGraph)&&this.graphs[0].onConfigure(function(){this.configure(e),this.render()}.bind(this)),e.width=e.width||this.graphs[0].width||this.defaults.width,e.height=e.height||this.graphs[0].height*this.heightRatio||this.defaults.height,this.configure(e),this.render()},onSlide:function(t){this.slideCallbacks.push(t)},onConfigure:function(t){this.configureCallbacks.push(t)},configure:function(t){this.config=this.config||{},this.configureCallbacks.forEach(function(e){e(t)}),e.keys(this.defaults).forEach(function(e){this.config[e]=e in t?t[e]:e in this.config?this.config[e]:this.defaults[e]},this),("width"in t||"height"in t)&&(this.widthFromGraph&&(this.config.width=this.graphs[0].width),this.heightFromGraph&&(this.config.height=this.graphs[0].height*this.heightRatio,this.previewHeight=this.config.height),this.previews.forEach(function(t){var e=this.previewHeight/this.graphs.length-2*this.config.frameTopThickness,n=this.config.width-2*this.config.frameHandleThickness;if(t.setSize({width:n,height:e}),this.svg){var i=e+2*this.config.frameHandleThickness,r=n+2*this.config.frameHandleThickness;this.svg.style("width",r+"px"),this.svg.style("height",i+"px")}},this))},render:function(){var n=this;this.svg=t.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]),this.previewHeight=this.config.height-2*this.config.frameTopThickness,this.previewWidth=this.config.width-2*this.config.frameHandleThickness,this.currentFrame=[0,this.previewWidth];var i=function(t){var i=e.extend({},t.config),r=n.previewHeight/n.graphs.length,a=t.renderer.name;e.extend(i,{element:this.appendChild(document.createElement("div")),height:r,width:n.previewWidth,series:t.series,renderer:a});var s=new e.Graph(i);n.previews.push(s),t.onUpdate(function(){s.render(),n.render()}),t.onConfigure(function(t){delete t.height,t.width=t.width-2*n.config.frameHandleThickness,s.configure(t),s.render()}),s.render()},r=t.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs),a="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";r.enter().append("div").classed("rickshaw_range_slider_preview_container",!0).style("-webkit-transform",a).style("-moz-transform",a).style("-ms-transform",a).style("transform",a).each(i),r.exit().remove();var s=this.graphs[0],o=t.scale.linear().domain([0,this.previewWidth]).range(s.dataDomain()),l=[s.window.xMin,s.window.xMax];this.currentFrame[0]=void 0===l[0]?0:Math.round(o.invert(l[0])),this.currentFrame[0]<0&&(this.currentFrame[0]=0),this.currentFrame[1]=void 0===l[1]?this.previewWidth:o.invert(l[1]),this.currentFrame[1]-this.currentFrame[0]<n.config.minimumFrameWidth&&(this.currentFrame[1]=(this.currentFrame[0]||0)+n.config.minimumFrameWidth),this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",!0).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","absolute").style("top",0),this._renderDimming(),this._renderFrame(),this._renderGrippers(),this._renderHandles(),this._renderMiddle(),this._registerMouseEvents()},_renderDimming:function(){var t=this.svg.selectAll("path.dimming").data([null]);t.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",!0);var e="";e+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness,e+=" h "+this.previewWidth,e+=" v "+this.previewHeight,e+=" h "+-this.previewWidth,e+=" z ",e+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness,e+=" H "+Math.min(this.currentFrame[1]+2*this.config.frameHandleThickness,this.previewWidth+this.config.frameHandleThickness),e+=" v "+this.previewHeight,e+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness),e+=" z",t.attr("d",e)},_renderFrame:function(){var t=this.svg.selectAll("path.frame").data([null]);
  t.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",!0);var e="";e+=" M "+this.currentFrame[0]+" 0",e+=" H "+(this.currentFrame[1]+2*this.config.frameHandleThickness),e+=" V "+this.config.height,e+=" H "+this.currentFrame[0],e+=" z",e+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness,e+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness),e+=" v "+this.previewHeight,e+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness),e+=" z",t.attr("d",e)},_renderGrippers:function(){var t=this.svg.selectAll("path.gripper").data([null]);t.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",!0);var e="";[.4,.6].forEach(function(t){e+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*t)+" "+Math.round(.3*this.config.height),e+=" V "+Math.round(.7*this.config.height),e+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+t))+" "+Math.round(.3*this.config.height),e+=" V "+Math.round(.7*this.config.height)}.bind(this)),t.attr("d",e)},_renderHandles:function(){var t=this.svg.selectAll("rect.left_handle").data([null]);t.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",!0),t.attr("x",this.currentFrame[0]).attr("height",this.config.height);var e=this.svg.selectAll("rect.right_handle").data([null]);e.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",!0),e.attr("x",this.currentFrame[1]+this.config.frameHandleThickness).attr("height",this.config.height)},_renderMiddle:function(){var t=this.svg.selectAll("rect.middle_handle").data([null]);t.enter().append("rect").style("cursor","move").style("fill-opacity","0").classed("middle_handle",!0),t.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness).attr("height",this.config.height)},_registerMouseEvents:function(){function e(){l.stop=h._getClientXFromEvent(t.event,l);var e=l.stop-l.start,n=h.frameBeforeDrag.slice(0),i=h.config.minimumFrameWidth;l.rigid&&(i=h.frameBeforeDrag[1]-h.frameBeforeDrag[0]),l.left&&(n[0]=Math.max(n[0]+e,0)),l.right&&(n[1]=Math.min(n[1]+e,h.previewWidth));var r=n[1]-n[0];i>=r&&(l.left&&(n[0]=n[1]-i),l.right&&(n[1]=n[0]+i),n[0]<=0&&(n[1]-=n[0],n[0]=0),n[1]>=h.previewWidth&&(n[0]-=n[1]-h.previewWidth,n[1]=h.previewWidth)),h.graphs.forEach(function(e){var i=t.scale.linear().interpolate(t.interpolateNumber).domain([0,h.previewWidth]).range(e.dataDomain()),r=[i(n[0]),i(n[1])];h.slideCallbacks.forEach(function(t){t(e,r[0],r[1])}),0===n[0]&&(r[0]=void 0),n[1]===h.previewWidth&&(r[1]=void 0),e.window.xMin=r[0],e.window.xMax=r[1],e.update()})}function n(){l.target=t.event.target,l.start=h._getClientXFromEvent(t.event,l),h.frameBeforeDrag=h.currentFrame.slice(),t.event.preventDefault?t.event.preventDefault():t.event.returnValue=!1,t.select(document).on("mousemove.rickshaw_range_slider_preview",e),t.select(document).on("mouseup.rickshaw_range_slider_preview",s),t.select(document).on("touchmove.rickshaw_range_slider_preview",e),t.select(document).on("touchend.rickshaw_range_slider_preview",s),t.select(document).on("touchcancel.rickshaw_range_slider_preview",s)}function i(){l.left=!0,n()}function r(){l.right=!0,n()}function a(){l.left=!0,l.right=!0,l.rigid=!0,n()}function s(){t.select(document).on("mousemove.rickshaw_range_slider_preview",null),t.select(document).on("mouseup.rickshaw_range_slider_preview",null),t.select(document).on("touchmove.rickshaw_range_slider_preview",null),t.select(document).on("touchend.rickshaw_range_slider_preview",null),t.select(document).on("touchcancel.rickshaw_range_slider_preview",null),delete h.frameBeforeDrag,l.left=!1,l.right=!1,l.rigid=!1}var o=t.select(this.element),l={target:null,start:null,stop:null,left:!1,right:!1,rigid:!1},h=this;o.select("rect.left_handle").on("mousedown",i),o.select("rect.right_handle").on("mousedown",r),o.select("rect.middle_handle").on("mousedown",a),o.select("rect.left_handle").on("touchstart",i),o.select("rect.right_handle").on("touchstart",r),o.select("rect.middle_handle").on("touchstart",a)},_getClientXFromEvent:function(t,e){switch(t.type){case"touchstart":case"touchmove":for(var n=t.changedTouches,i=null,r=0;r<n.length;r++)if(n[r].target===e.target){i=n[r];break}return null!==i?i.clientX:void 0;default:return t.clientX}}}),e.namespace("Rickshaw.Graph.Renderer"),e.Graph.Renderer=e.Class.create({initialize:function(t){this.graph=t.graph,this.tension=t.tension||this.tension,this.configure(t)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:!0,padding:{top:.01,right:0,bottom:.01,left:0},stroke:!1,fill:!1}},domain:function(t){var e=t||this.graph.stackedData||this.graph.stackData(),n=+1/0,i=-1/0,r=+1/0,a=-1/0;return e.forEach(function(t){t.forEach(function(t){if(null!=t.y){var e=t.y+t.y0;r>e&&(r=e),e>a&&(a=e)}}),t.length&&(t[0].x<n&&(n=t[0].x),t[t.length-1].x>i&&(i=t[t.length-1].x))}),n-=(i-n)*this.padding.left,i+=(i-n)*this.padding.right,r="auto"===this.graph.min?r:this.graph.min||0,a=void 0===this.graph.max?a:this.graph.max,("auto"===this.graph.min||0>r)&&(r-=(a-r)*this.padding.bottom),void 0===this.graph.max&&(a+=(a-r)*this.padding.top),{x:[n,i],y:[r,a]}},render:function(t){t=t||{};var e=this.graph,n=t.series||e.series,i=t.vis||e.vis;i.selectAll("*").remove();var r=n.filter(function(t){return!t.disabled}).map(function(t){return t.stack}),a=i.selectAll("path.path").data(r).enter().append("svg:path").classed("path",!0).attr("d",this.seriesPathFactory());if(this.stroke)var s=i.selectAll("path.stroke").data(r).enter().append("svg:path").classed("stroke",!0).attr("d",this.seriesStrokeFactory());var o=0;n.forEach(function(t){t.disabled||(t.path=a[0][o],this.stroke&&(t.stroke=s[0][o]),this._styleSeries(t),o++)},this)},_styleSeries:function(e){var n=this.fill?e.color:"none",i=this.stroke?e.color:"none";e.path.setAttribute("fill",n),e.path.setAttribute("stroke",i),e.path.setAttribute("stroke-width",this.strokeWidth),e.className&&t.select(e.path).classed(e.className,!0),e.className&&this.stroke&&t.select(e.stroke).classed(e.className,!0)},configure:function(t){t=t||{},e.keys(this.defaults()).forEach(function(n){return t.hasOwnProperty(n)?("object"==typeof this.defaults()[n]?e.keys(this.defaults()[n]).forEach(function(e){this[n][e]=void 0!==t[n][e]?t[n][e]:void 0!==this[n][e]?this[n][e]:this.defaults()[n][e]},this):this[n]=void 0!==t[n]?t[n]:void 0!==this[n]?this[n]:void 0!==this.graph[n]?this.graph[n]:this.defaults()[n],void 0):(this[n]=this[n]||this.graph[n]||this.defaults()[n],void 0)},this)},setStrokeWidth:function(t){void 0!==t&&(this.strokeWidth=t)},setTension:function(t){void 0!==t&&(this.tension=t)}}),e.namespace("Rickshaw.Graph.Renderer.Line"),e.Graph.Renderer.Line=e.Class.create(e.Graph.Renderer,{name:"line",defaults:function($super){return e.extend($super(),{unstack:!0,fill:!1,stroke:!0})},seriesPathFactory:function(){var e=this.graph,n=t.svg.line().x(function(t){return e.x(t.x)}).y(function(t){return e.y(t.y)}).interpolate(this.graph.interpolation).tension(this.tension);return n.defined&&n.defined(function(t){return null!==t.y}),n}}),e.namespace("Rickshaw.Graph.Renderer.Stack"),e.Graph.Renderer.Stack=e.Class.create(e.Graph.Renderer,{name:"stack",defaults:function($super){return e.extend($super(),{fill:!0,stroke:!1,unstack:!1})},seriesPathFactory:function(){var e=this.graph,n=t.svg.area().x(function(t){return e.x(t.x)}).y0(function(t){return e.y(t.y0)}).y1(function(t){return e.y(t.y+t.y0)}).interpolate(this.graph.interpolation).tension(this.tension);return n.defined&&n.defined(function(t){return null!==t.y}),n}}),e.namespace("Rickshaw.Graph.Renderer.Bar"),e.Graph.Renderer.Bar=e.Class.create(e.Graph.Renderer,{name:"bar",defaults:function($super){var t=e.extend($super(),{gapSize:.05,unstack:!1});return delete t.tension,t},initialize:function($super,t){t=t||{},this.gapSize=t.gapSize||this.gapSize,$super(t)},domain:function($super){var t=$super(),e=this._frequentInterval(this.graph.stackedData.slice(-1).shift());return t.x[1]+=Number(e.magnitude),t},barWidth:function(t){var e=this._frequentInterval(t.stack),n=this.graph.x.magnitude(e.magnitude)*(1-this.gapSize);return n},render:function(t){t=t||{};var e=this.graph,n=t.series||e.series,i=t.vis||e.vis;i.selectAll("*").remove();var r=this.barWidth(n.active()[0]),a=0,s=n.filter(function(t){return!t.disabled}).length,o=this.unstack?r/s:r,l=function(t){var n=[1,0,0,t.y<0?-1:1,0,t.y<0?2*e.y.magnitude(Math.abs(t.y)):0];return"matrix("+n.join(",")+")"};n.forEach(function(t){if(!t.disabled){var n=(this.barWidth(t),i.selectAll("path").data(t.stack.filter(function(t){return null!==t.y})).enter().append("svg:rect").attr("x",function(t){return e.x(t.x)+a}).attr("y",function(t){return e.y(t.y0+Math.abs(t.y))*(t.y<0?-1:1)}).attr("width",o).attr("height",function(t){return e.y.magnitude(Math.abs(t.y))}).attr("transform",l));Array.prototype.forEach.call(n[0],function(e){e.setAttribute("fill",t.color)}),this.unstack&&(a+=o)}},this)},_frequentInterval:function(t){for(var n={},i=0;i<t.length-1;i++){var r=t[i+1].x-t[i].x;n[r]=n[r]||0,n[r]++}var a={count:0,magnitude:1};return e.keys(n).forEach(function(t){a.count<n[t]&&(a={count:n[t],magnitude:t})}),a}}),e.namespace("Rickshaw.Graph.Renderer.Area"),e.Graph.Renderer.Area=e.Class.create(e.Graph.Renderer,{name:"area",defaults:function($super){return e.extend($super(),{unstack:!1,fill:!1,stroke:!1})},seriesPathFactory:function(){var e=this.graph,n=t.svg.area().x(function(t){return e.x(t.x)}).y0(function(t){return e.y(t.y0)}).y1(function(t){return e.y(t.y+t.y0)}).interpolate(e.interpolation).tension(this.tension);return n.defined&&n.defined(function(t){return null!==t.y}),n},seriesStrokeFactory:function(){var e=this.graph,n=t.svg.line().x(function(t){return e.x(t.x)}).y(function(t){return e.y(t.y+t.y0)}).interpolate(e.interpolation).tension(this.tension);return n.defined&&n.defined(function(t){return null!==t.y}),n},render:function(t){t=t||{};var e=this.graph,n=t.series||e.series,i=t.vis||e.vis;i.selectAll("*").remove();var r=this.unstack?"append":"insert",a=n.filter(function(t){return!t.disabled}).map(function(t){return t.stack}),s=i.selectAll("path").data(a).enter()[r]("svg:g","g");s.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area"),this.stroke&&s.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line");var o=0;n.forEach(function(t){t.disabled||(t.path=s[0][o++],this._styleSeries(t))},this)},_styleSeries:function(e){e.path&&(t.select(e.path).select(".area").attr("fill",e.color),this.stroke&&t.select(e.path).select(".line").attr("fill","none").attr("stroke",e.stroke||t.interpolateRgb(e.color,"black")(.125)).attr("stroke-width",this.strokeWidth),e.className&&e.path.setAttribute("class",e.className))}}),e.namespace("Rickshaw.Graph.Renderer.ScatterPlot"),e.Graph.Renderer.ScatterPlot=e.Class.create(e.Graph.Renderer,{name:"scatterplot",defaults:function($super){return e.extend($super(),{unstack:!0,fill:!0,stroke:!1,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,t){$super(t)},render:function(t){t=t||{};var e=this.graph,n=t.series||e.series,i=t.vis||e.vis,r=this.dotSize;i.selectAll("*").remove(),n.forEach(function(t){if(!t.disabled){var n=i.selectAll("path").data(t.stack.filter(function(t){return null!==t.y})).enter().append("svg:circle").attr("cx",function(t){return e.x(t.x)}).attr("cy",function(t){return e.y(t.y)}).attr("r",function(t){return"r"in t?t.r:r});t.className&&n.classed(t.className,!0),Array.prototype.forEach.call(n[0],function(e){e.setAttribute("fill",t.color)})}},this)}}),e.namespace("Rickshaw.Graph.Renderer.Multi"),e.Graph.Renderer.Multi=e.Class.create(e.Graph.Renderer,{name:"multi",initialize:function($super,t){$super(t)},defaults:function($super){return e.extend($super(),{unstack:!0,fill:!1,stroke:!0})},configure:function($super,t){t=t||{},this.config=t,$super(t)},domain:function($super){this.graph.stackData();var e=[],n=this._groups();this._stack(n),n.forEach(function(t){var n=t.series.filter(function(t){return!t.disabled}).map(function(t){return t.stack});if(n.length){var i=null;i=t.renderer&&t.renderer.domain?t.renderer.domain(n):$super(n),e.push(i)}});var i=t.min(e.map(function(t){return t.x[0]})),r=t.max(e.map(function(t){return t.x[1]})),a=t.min(e.map(function(t){return t.y[0]})),s=t.max(e.map(function(t){return t.y[1]}));return{x:[i,r],y:[a,s]}},_groups:function(){var n=this.graph,i={};n.series.forEach(function(r){if(!r.disabled){if(!i[r.renderer]){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"g");n.vis[0][0].appendChild(s);var o=n._renderers[r.renderer],l={},h=[this.defaults(),o.defaults(),this.config,this.graph];h.forEach(function(t){e.extend(l,t)}),o.configure(l),i[r.renderer]={renderer:o,series:[],vis:t.select(s)}}i[r.renderer].series.push(r)}},this);var r=[];return Object.keys(i).forEach(function(t){var e=i[t];r.push(e)}),r},_stack:function(n){return n.forEach(function(n){var i=n.series.filter(function(t){return!t.disabled}),r=i.map(function(t){return t.stack});if(!n.renderer.unstack){var a=t.layout.stack(),s=e.clone(a(r));i.forEach(function(t,n){t._stack=e.clone(s[n])})}},this),n},render:function(){this.graph.series.forEach(function(t){if(!t.renderer)throw new Error("Each series needs a renderer for graph 'multi' renderer")}),this.graph.vis.selectAll("*").remove();var t=this._groups();t=this._stack(t),t.forEach(function(t){var e=t.series.filter(function(t){return!t.disabled});e.active=function(){return e},t.renderer.render({series:e,vis:t.vis}),e.forEach(function(t){t.stack=t._stack||t.stack||t.data})})}}),e.namespace("Rickshaw.Graph.Renderer.LinePlot"),e.Graph.Renderer.LinePlot=e.Class.create(e.Graph.Renderer,{name:"lineplot",defaults:function($super){return e.extend($super(),{unstack:!0,fill:!1,stroke:!0,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},seriesPathFactory:function(){var e=this.graph,n=t.svg.line().x(function(t){return e.x(t.x)}).y(function(t){return e.y(t.y)}).interpolate(this.graph.interpolation).tension(this.tension);return n.defined&&n.defined(function(t){return null!==t.y}),n},render:function(t){t=t||{};var e=this.graph,n=t.series||e.series,i=t.vis||e.vis,r=this.dotSize;i.selectAll("*").remove();var a=n.filter(function(t){return!t.disabled}).map(function(t){return t.stack}),s=i.selectAll("path").data(a).enter().append("svg:path").attr("d",this.seriesPathFactory()),o=0;n.forEach(function(t){t.disabled||(t.path=s[0][o++],this._styleSeries(t))},this),n.forEach(function(t){if(!t.disabled){var n=i.selectAll("x").data(t.stack.filter(function(t){return null!==t.y})).enter().append("svg:circle").attr("cx",function(t){return e.x(t.x)}).attr("cy",function(t){return e.y(t.y)}).attr("r",function(t){return"r"in t?t.r:r});Array.prototype.forEach.call(n[0],function(e){e&&(e.setAttribute("data-color",t.color),e.setAttribute("fill","white"),e.setAttribute("stroke",t.color),e.setAttribute("stroke-width",this.strokeWidth))}.bind(this))}},this)}}),e.namespace("Rickshaw.Graph.Smoother"),e.Graph.Smoother=e.Class.create({initialize:function(t){this.graph=t.graph,this.element=t.element,this.aggregationScale=1,this.build(),this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var t=this,e=jQuery;this.element&&e(function(){e(t.element).slider({min:1,max:100,slide:function(e,n){t.setScale(n.value),t.graph.update()}})})},setScale:function(t){if(1>t)throw"scale out of range: "+t;this.aggregationScale=t,this.graph.update()},transformer:function(t){if(1==this.aggregationScale)return t;var e=[];return t.forEach(function(t){for(var n=[];t.length;){var i=0,r=0,a=t.splice(0,this.aggregationScale);a.forEach(function(t){i+=t.x/a.length,r+=t.y/a.length}),n.push({x:i,y:r})}e.push(n)}.bind(this)),e}}),e.namespace("Rickshaw.Graph.Socketio"),e.Graph.Socketio=e.Class.create(e.Graph.Ajax,{request:function(){var t=io.connect(this.dataURL),e=this;t.on("rickshaw",function(t){e.success(t)})}}),e.namespace("Rickshaw.Series"),e.Series=e.Class.create(Array,{initialize:function(t,n,i){i=i||{},this.palette=new e.Color.Palette(n),this.timeBase="undefined"==typeof i.timeBase?Math.floor((new Date).getTime()/1e3):i.timeBase;var r="undefined"==typeof i.timeInterval?1e3:i.timeInterval;this.setTimeInterval(r),t&&"object"==typeof t&&Array.isArray(t)&&t.forEach(function(t){this.addItem(t)},this)},addItem:function(t){if("undefined"==typeof t.name)throw"addItem() needs a name";t.color=t.color||this.palette.color(t.name),t.data=t.data||[],0===t.data.length&&this.length&&this.getIndex()>0?this[0].data.forEach(function(e){t.data.push({x:e.x,y:0})}):0===t.data.length&&t.data.push({x:this.timeBase-(this.timeInterval||0),y:0}),this.push(t),this.legend&&this.legend.addLine(this.itemByName(t.name))},addData:function(t,n){var i=this.getIndex();e.keys(t).forEach(function(t){this.itemByName(t)||this.addItem({name:t})},this),this.forEach(function(e){e.data.push({x:n||(i*this.timeInterval||1)+this.timeBase,y:t[e.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return this[e]},setTimeInterval:function(t){this.timeInterval=t/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var t={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};return this.forEach(function(e){var n={color:e.color,name:e.name,data:[]};e.data.forEach(function(t){n.data.push({x:t.x,y:t.y})}),t.items.push(n)}),t},load:function(t){t.timeInterval&&(this.timeInterval=t.timeInterval),t.timeBase&&(this.timeBase=t.timeBase),t.items&&t.items.forEach(function(t){this.push(t),this.legend&&this.legend.addLine(this.itemByName(t.name))},this)}}),e.Series.zeroFill=function(t){e.Series.fill(t,0)},e.Series.fill=function(t,e){for(var n,i=0,r=t.map(function(t){return t.data});i<Math.max.apply(null,r.map(function(t){return t.length}));)n=Math.min.apply(null,r.filter(function(t){return t[i]}).map(function(t){return t[i].x})),r.forEach(function(t){t[i]&&t[i].x==n||t.splice(i,0,{x:n,y:e})}),i++},e.namespace("Rickshaw.Series.FixedDuration"),e.Series.FixedDuration=e.Class.create(e.Series,{initialize:function(t,n,i){if(i=i||{},"undefined"==typeof i.timeInterval)throw new Error("FixedDuration series requires timeInterval");if("undefined"==typeof i.maxDataPoints)throw new Error("FixedDuration series requires maxDataPoints");if(this.palette=new e.Color.Palette(n),this.timeBase="undefined"==typeof i.timeBase?Math.floor((new Date).getTime()/1e3):i.timeBase,this.setTimeInterval(i.timeInterval),this[0]&&this[0].data&&this[0].data.length?(this.currentSize=this[0].data.length,this.currentIndex=this[0].data.length):(this.currentSize=0,this.currentIndex=0),this.maxDataPoints=i.maxDataPoints,t&&"object"==typeof t&&Array.isArray(t)&&(t.forEach(function(t){this.addItem(t)},this),this.currentSize+=1,this.currentIndex+=1),this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval,"undefined"!=typeof this.maxDataPoints&&this.currentSize<this.maxDataPoints)for(var r=this.maxDataPoints-this.currentSize-1;r>1;r--)this.currentSize+=1,this.currentIndex+=1,this.forEach(function(t){t.data.unshift({x:((r-1)*this.timeInterval||1)+this.timeBase,y:0,i:r})},this)},addData:function($super,t,e){if($super(t,e),this.currentSize+=1,this.currentIndex+=1,void 0!==this.maxDataPoints)for(;this.currentSize>this.maxDataPoints;)this.dropData()},dropData:function(){this.forEach(function(t){t.data.splice(0,1)}),this.currentSize-=1},getIndex:function(){return this.currentIndex}}),e});
  