/*
 Highcharts JS v7.2.0 (2019-09-03)

 Boost module

 (c) 2010-2019 Highsoft AS
 Author: Torstein Honsi

 License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?(d["default"]=d,module.exports=d):"function"===typeof define&&define.amd?define("highcharts/modules/boost-canvas",["highcharts"],function(p){d(p);d.Highcharts=p;return d}):d("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(d){function p(c,d,p,q){c.hasOwnProperty(d)||(c[d]=q.apply(null,p))}d=d?d._modules:{};p(d,"modules/boost-canvas.src.js",[d["parts/Globals.js"],d["parts/Utilities.js"]],function(c,d){var p=d.isNumber,q=c.win.document,
aa=function(){},ba=c.Color,x=c.Series,l=c.seriesTypes,y=c.extend,z=c.addEvent,ca=c.fireEvent,da=c.merge,ea=c.pick,A=c.wrap,K;c.initCanvasBoost=function(){c.seriesTypes.heatmap&&c.wrap(c.seriesTypes.heatmap.prototype,"drawPoints",function(){var a=this.chart,b=this.getContext(),f=this.chart.inverted,c=this.xAxis,e=this.yAxis;b?(this.points.forEach(function(d){var g=d.plotY;void 0===g||isNaN(g)||null===d.y||(g=d.shapeArgs,d=a.styledMode?d.series.colorAttribs(d):d.series.pointAttribs(d),b.fillStyle=d.fill,
f?b.fillRect(e.len-g.y+c.left,c.len-g.x+e.top,-g.height,-g.width):b.fillRect(g.x+c.left,g.y+e.top,g.width,g.height))}),this.canvasToSVG()):this.chart.showLoading("Your browser doesn't support HTML5 canvas, <br>please use a modern browser")});c.extend(x.prototype,{getContext:function(){var a=this.chart,b=a.chartWidth,f=a.chartHeight,d=a.seriesGroup||this.group,e=this,c=function(a,e,f,b,d,c,g){a.call(this,f,e,b,d,c,g)};a.isChartSeriesBoosting()&&(e=a,d=a.seriesGroup);var g=e.ctx;e.canvas||(e.canvas=
q.createElement("canvas"),e.renderTarget=a.renderer.image("",0,0,b,f).addClass("highcharts-boost-canvas").add(d),e.ctx=g=e.canvas.getContext("2d"),a.inverted&&["moveTo","lineTo","rect","arc"].forEach(function(a){A(g,a,c)}),e.boostCopy=function(){e.renderTarget.attr({href:e.canvas.toDataURL("image/png")})},e.boostClear=function(){g.clearRect(0,0,e.canvas.width,e.canvas.height);e===this&&e.renderTarget.attr({href:""})},e.boostClipRect=a.renderer.clipRect(),e.renderTarget.clip(e.boostClipRect));e.canvas.width!==
b&&(e.canvas.width=b);e.canvas.height!==f&&(e.canvas.height=f);e.renderTarget.attr({x:0,y:0,width:b,height:f,style:"pointer-events: none",href:""});e.boostClipRect.attr(a.getBoostClipRect(e));return g},canvasToSVG:function(){this.chart.isChartSeriesBoosting()?this.boostClear&&this.boostClear():(this.boostCopy||this.chart.boostCopy)&&(this.boostCopy||this.chart.boostCopy)()},cvsLineTo:function(a,b,f){a.lineTo(b,f)},renderCanvas:function(){var a=this,b=a.options,f=a.chart,d=this.xAxis,e=this.yAxis,
l=(f.options.boost||{}).timeRendering||!1,g=0,q=a.processedXData,x=a.processedYData,L=b.data,k=d.getExtremes(),B=k.min,C=k.max;k=e.getExtremes();var A=k.min,fa=k.max,M={},D,ha=!!a.sampling,E=b.marker&&b.marker.radius,N=this.cvsDrawPoint,F=b.lineWidth?this.cvsLineTo:!1,O=E&&1>=E?this.cvsMarkerSquare:this.cvsMarkerCircle,ia=this.cvsStrokeBatch||1E3,ja=!1!==b.enableMouseTracking,P;k=b.threshold;var t=e.getThreshold(k),Q=p(k),R=t,ka=this.fill,S=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),
T=!!b.stacking,U=a.cropStart||0;k=f.options.loading;var la=a.requireSorting,V,ma=b.connectNulls,W=!q,G,H,u,w,I,r=T?a.data:q||L,na=a.fillOpacity?(new ba(a.color)).setOpacity(ea(b.fillOpacity,.75)).get():a.color,X=function(){ka?(m.fillStyle=na,m.fill()):(m.strokeStyle=a.color,m.lineWidth=b.lineWidth,m.stroke())},Y=function(e,b,d,c){0===g&&(m.beginPath(),F&&(m.lineJoin="round"));f.scroller&&"highcharts-navigator-series"===a.options.className?(b+=f.scroller.top,d&&(d+=f.scroller.top)):b+=f.plotTop;e+=
f.plotLeft;V?m.moveTo(e,b):N?N(m,e,b,d,P):F?F(m,e,b):O&&O.call(a,m,e,b,E,c);g+=1;g===ia&&(X(),g=0);P={clientX:e,plotY:b,yBottom:d}},oa="x"===b.findNearestPointBy,Z=this.xData||this.options.xData||this.processedXData||!1,J=function(a,b,c){I=oa?a:a+","+b;ja&&!M[I]&&(M[I]=!0,f.inverted&&(a=d.len-a,b=e.len-b),pa.push({x:Z?Z[U+c]:!1,clientX:a,plotX:a,plotY:b,i:U+c}))};this.renderTarget&&this.renderTarget.attr({href:""});(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?
"visible":"hidden",b.zIndex,f.seriesGroup);a.markerGroup=a.group;z(a,"destroy",function(){a.markerGroup=null});var pa=this.points=[];var m=this.getContext();a.buildKDTree=aa;this.boostClear&&this.boostClear();this.visible&&(99999<L.length&&(f.options.loading=da(k,{labelStyle:{backgroundColor:c.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),c.clearTimeout(K),f.showLoading("Drawing..."),f.options.loading=k),l&&console.time("canvas rendering"),
c.eachAsync(r,function(b,c){var g=!1,l=!1,v=!1,k=!1,m="undefined"===typeof f.index,p=!0;if(!m){if(W){var n=b[0];var h=b[1];r[c+1]&&(v=r[c+1][0]);r[c-1]&&(k=r[c-1][0])}else n=b,h=x[c],r[c+1]&&(v=r[c+1]),r[c-1]&&(k=r[c-1]);v&&v>=B&&v<=C&&(g=!0);k&&k>=B&&k<=C&&(l=!0);if(S){W&&(h=b.slice(1,3));var q=h[0];h=h[1]}else T&&(n=b.x,h=b.stackY,q=h-b.y);b=null===h;la||(p=h>=A&&h<=fa);if(!b&&(n>=B&&n<=C&&p||g||l))if(n=Math.round(d.toPixels(n,!0)),ha){if(void 0===u||n===D){S||(q=h);if(void 0===w||h>H)H=h,w=c;if(void 0===
u||q<G)G=q,u=c}n!==D&&(void 0!==u&&(h=e.toPixels(H,!0),t=e.toPixels(G,!0),Y(n,Q?Math.min(h,R):h,Q?Math.max(t,R):t,c),J(n,h,w),t!==h&&J(n,t,u)),u=w=void 0,D=n)}else h=Math.round(e.toPixels(h,!0)),Y(n,h,t,c),J(n,h,c);V=b&&!ma;0===c%5E4&&(a.boostCopy||a.chart.boostCopy)&&(a.boostCopy||a.chart.boostCopy)()}return!m},function(){var b=f.loadingDiv,e=f.loadingShown;X();a.canvasToSVG();l&&console.timeEnd("canvas rendering");ca(a,"renderedCanvas");e&&(y(b.style,{transition:"opacity 250ms",opacity:0}),f.loadingShown=
!1,K=setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);f.loadingDiv=f.loadingSpan=null},250));delete a.buildKDTree;a.buildKDTree()},f.renderer.forExport?Number.MAX_VALUE:void 0))}});l.scatter.prototype.cvsMarkerCircle=function(a,b,c,d){a.moveTo(b,c);a.arc(b,c,d,0,2*Math.PI,!1)};l.scatter.prototype.cvsMarkerSquare=function(a,b,c,d){a.rect(b-d,c-d,2*d,2*d)};l.scatter.prototype.fill=!0;l.bubble&&(l.bubble.prototype.cvsMarkerCircle=function(a,b,c,d,e){a.moveTo(b,c);a.arc(b,c,this.radii&&
this.radii[e],0,2*Math.PI,!1)},l.bubble.prototype.cvsStrokeBatch=1);y(l.area.prototype,{cvsDrawPoint:function(a,b,c,d,e){e&&b!==e.clientX&&(a.moveTo(e.clientX,e.yBottom),a.lineTo(e.clientX,e.plotY),a.lineTo(b,c),a.lineTo(b,d))},fill:!0,fillOpacity:!0,sampling:!0});y(l.column.prototype,{cvsDrawPoint:function(a,b,c,d){a.rect(b-1,c,1,d-c)},fill:!0,sampling:!0});c.Chart.prototype.callbacks.push(function(a){z(a,"predraw",function(){a.renderTarget&&a.renderTarget.attr({href:""});a.canvas&&a.canvas.getContext("2d").clearRect(0,
0,a.canvas.width,a.canvas.height)});z(a,"render",function(){a.boostCopy&&a.boostCopy()})})}});p(d,"masters/modules/boost-canvas.src.js",[],function(){})});
//# sourceMappingURL=boost-canvas.js.map