highcharts
Version:
JavaScript charting framework
13 lines • 49.5 kB
JavaScript
let t,e;/**
* Highcharts JS v13.0.1 (2026-08-17)
* @module highcharts/modules/boost-canvas
* @requires highcharts
*
* Boost module
*
* (c) 2010-2026 Highsoft AS
* Author: Torstein Hønsi
*
* A commercial license may be required depending on use,
* see www.highcharts.com/license
*/import*as i from"../highcharts.js";let s={};s.n=t=>{let e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var r=e[i++],o=e[i++];s.o(t,r)?0===o&&i++:0===o?Object.defineProperty(t,r,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,r,{enumerable:!0,get:o})}else for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=i.default;var o,n=s.n(r);let a=["area","areaspline","arearange","column","columnrange","bar","line","scatter","heatmap","bubble","treemap"],l={};a.forEach(t=>{l[t]=!0});let{composed:h}=n();function u(t){let e=t.series,i=t.boost=t.boost||{},s=t.options.boost||{},o=(0,r.pick)(s.seriesThreshold,50);if(e.length>=o)return!0;if(1===e.length)return!1;let n=s.allowForce;if(void 0===n){for(let e of(n=!0,t.xAxis))if((0,r.pick)(e.min,-1/0)>(0,r.pick)(e.dataMin,-1/0)||(0,r.pick)(e.max,1/0)<(0,r.pick)(e.dataMax,1/0)){n=!1;break}}if(void 0!==i.forceChartBoost){if(n)return i.forceChartBoost;i.forceChartBoost=void 0}let a=0,h=0,u=0,d;for(let t of e)0!==(d=t.options).boostThreshold&&!1!==t.visible&&"heatmap"!==t.type&&(++h,l[t.type]&&++a,function(...t){let e=-Number.MAX_VALUE;return t.forEach(t=>{if(null!=t&&void 0!==t.length&&t.length>0)return e=t.length,!0}),e}(t.getColumn("x",!0),d.data||[],t.points)>=(d.boostThreshold||Number.MAX_VALUE)&&++u);return i.forceChartBoost=n&&(a===e.length&&u===a||!!i.markerGroup&&a===h&&u===a||u>5),i.forceChartBoost}function d(t){function e(){t.boost&&t.boost.wgl&&u(t)&&t.boost.wgl.render(t)}(0,r.addEvent)(t,"predraw",function(){t.boost=t.boost||{},t.boost.forceChartBoost=void 0,t.boosted=!1,t.axes.some(t=>t.isPanning)||t.boost.clear?.(),t.boost.canvas&&t.boost.wgl&&u(t)&&t.boost.wgl.allocateBuffer(t),t.boost.markerGroup&&t.xAxis&&t.xAxis.length>0&&t.yAxis&&t.yAxis.length>0&&t.boost.markerGroup.translate(t.xAxis[0].pos,t.yAxis[0].pos)}),(0,r.addEvent)(t,"load",e,{order:-1}),(0,r.addEvent)(t,"redraw",e);let i=-1,s=-1;(0,r.addEvent)(t.pointer,"afterGetHoverData",e=>{let r=e.hoverPoint?.series;if(t.boost=t.boost||{},t.boost.markerGroup&&r){let e=t.inverted?r.yAxis:r.xAxis,o=t.inverted?r.xAxis:r.yAxis;(e&&e.pos!==i||o&&o.pos!==s)&&(t.series.forEach(t=>{t.halo?.hide()}),t.boost.markerGroup.translate(e.pos,o.pos),i=e.pos,s=o.pos)}})}let c={compose:function(t,e){return e&&(0,r.pushUnique)(h,"Boost.Chart")&&t.prototype.callbacks.push(d),t},getBoostClipRect:function(t,e){let i=t.navigator,s={x:t.plotLeft,y:t.plotTop,width:t.plotWidth,height:t.plotHeight};if(i&&t.inverted?(s.width+=i.top+i.height,i.opposite||(s.x=i.left)):i&&!t.inverted&&(s.height=i.top+i.height-t.plotTop),e.is){let{xAxis:i,yAxis:r}=e;if(s=t.getClipBox(e),t.inverted){let t=s.width;s.width=s.height,s.height=t,s.x=r.pos,s.y=i.pos}else s.x=i.pos,s.y=r.pos}if(e===t){let e=t.inverted?t.xAxis:t.yAxis;e.length<=1&&(s.y=Math.min(e[0].pos,s.y),s.height=e[0].pos-t.plotTop+e[0].len)}return s},isChartSeriesBoosting:u},g=i.default.Color;var m=s.n(g);let p={area:"LINES",arearange:"LINES",areaspline:"LINES",column:"LINES",columnrange:"LINES",bar:"LINES",line:"LINE_STRIP",scatter:"POINTS",heatmap:"TRIANGLES",treemap:"TRIANGLES",bubble:"POINTS"},f=class{constructor(t){if(this.errors=[],this.uLocations={},this.gl=t,t&&!this.createShader())return}bind(){this.gl&&this.shaderProgram&&this.gl.useProgram(this.shaderProgram)}createShader(){let t=this.stringToProgram("#version 100\n#define LN10 2.302585092994046\nprecision highp float;\nattribute vec4 aVertexPosition;\nattribute vec4 aColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform mat4 uPMatrix;\nuniform float pSize;\nuniform float translatedThreshold;\nuniform bool hasThreshold;\nuniform bool skipTranslation;\nuniform float xAxisTrans;\nuniform float xAxisMin;\nuniform float xAxisMax;\nuniform float xAxisMinPad;\nuniform float xAxisPointRange;\nuniform float xAxisLen;\nuniform bool xAxisPostTranslate;\nuniform float xAxisOrdinalSlope;\nuniform float xAxisOrdinalOffset;\nuniform float xAxisPos;\nuniform bool xAxisCVSCoord;\nuniform bool xAxisIsLog;\nuniform bool xAxisReversed;\nuniform float yAxisTrans;\nuniform float yAxisMin;\nuniform float yAxisMax;\nuniform float yAxisMinPad;\nuniform float yAxisPointRange;\nuniform float yAxisLen;\nuniform bool yAxisPostTranslate;\nuniform float yAxisOrdinalSlope;\nuniform float yAxisOrdinalOffset;\nuniform float yAxisPos;\nuniform bool yAxisCVSCoord;\nuniform bool yAxisIsLog;\nuniform bool yAxisReversed;\nuniform bool isCircle;\nuniform bool isBubble;\nuniform bool bubbleSizeByArea;\nuniform float bubbleZMin;\nuniform float bubbleZMax;\nuniform float bubbleZThreshold;\nuniform float bubbleMinSize;\nuniform float bubbleMaxSize;\nuniform bool bubbleSizeAbs;\nuniform bool isInverted;\nfloat bubbleRadius(){\nfloat value = aVertexPosition.w;\nfloat zMax = bubbleZMax;\nfloat zMin = bubbleZMin;\nfloat radius = 0.0;\nfloat pos = 0.0;\nfloat zRange = zMax - zMin;\nif (bubbleSizeAbs){\nvalue = value - bubbleZThreshold;\nzMax = max(zMax - bubbleZThreshold, zMin - bubbleZThreshold);\nzMin = 0.0;\n}\nif (value < zMin){\nradius = bubbleZMin / 2.0 - 1.0;\n} else {\npos = zRange > 0.0 ? (value - zMin) / zRange : 0.5;\nif (bubbleSizeByArea && pos > 0.0){\npos = sqrt(pos);\n}\nradius = ceil(bubbleMinSize + pos * (bubbleMaxSize - bubbleMinSize)) / 2.0;\n}\nreturn radius * 2.0;\n}\nfloat translate(float val,\nfloat pointPlacement,\nfloat localA,\nfloat localMin,\nfloat minPixelPadding,\nfloat pointRange,\nfloat len,\nbool cvsCoord,\nbool isLog,\nbool reversed\n){\nfloat sign = 1.0;\nfloat cvsOffset = 0.0;\nif (cvsCoord) {\nsign *= -1.0;\ncvsOffset = len;\n}\nif (isLog) {\nval = log(val) / LN10;\n}\nif (reversed) {\nsign *= -1.0;\ncvsOffset -= sign * len;\n}\nreturn sign * (val - localMin) * localA + cvsOffset + \n(sign * minPixelPadding);\n}\nfloat xToPixels(float value) {\nif (skipTranslation){\nreturn value;// + xAxisPos;\n}\nreturn translate(value, 0.0, xAxisTrans, xAxisMin, xAxisMinPad, xAxisPointRange, xAxisLen, xAxisCVSCoord, xAxisIsLog, xAxisReversed);// + xAxisPos;\n}\nfloat yToPixels(float value, float checkThreshold) {\nfloat v;\nif (skipTranslation){\nv = value;// + yAxisPos;\n} else {\nv = translate(value, 0.0, yAxisTrans, yAxisMin, yAxisMinPad, yAxisPointRange, yAxisLen, yAxisCVSCoord, yAxisIsLog, yAxisReversed);// + yAxisPos;\nif (v > yAxisLen) {\nv = yAxisLen;\n}\n}\nif (checkThreshold > 0.0 && hasThreshold) {\nv = min(v, translatedThreshold);\n}\nreturn v;\n}\nvoid main(void) {\nif (isBubble){\ngl_PointSize = bubbleRadius();\n} else {\ngl_PointSize = pSize;\n}\nvColor = aColor;\nif (!skipTranslation && isCircle && (\naVertexPosition.x < xAxisMin ||\naVertexPosition.x > xAxisMax ||\naVertexPosition.y < yAxisMin ||\naVertexPosition.y > yAxisMax\n)) {\ngl_Position = uPMatrix * vec4(2.0, 2.0, 2.0, 1.0);\n} else if (skipTranslation && isInverted) {\ngl_Position = uPMatrix * vec4(aVertexPosition.y + yAxisPos, aVertexPosition.x + xAxisPos, 0.0, 1.0);\n} else if (isInverted) {\ngl_Position = uPMatrix * vec4(yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, xToPixels(aVertexPosition.x) + xAxisPos, 0.0, 1.0);\n} else {\ngl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.x) + xAxisPos, yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, 0.0, 1.0);\n}\n}","vertex"),e=this.stringToProgram("precision highp float;\nuniform vec4 fillColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform sampler2D uSampler;\nuniform bool isCircle;\nuniform bool hasColor;\nvoid main(void) {\nvec4 col = fillColor;\nvec4 tcol = texture2D(uSampler, gl_PointCoord.st);\nif (hasColor) {\ncol = vColor;\n}\nif (isCircle) {\ncol *= tcol;\nif (tcol.r < 0.0) {\ndiscard;\n} else {\ngl_FragColor = col;\n}\n} else {\ngl_FragColor = col;\n}\n}","fragment"),i=t=>this.gl.getUniformLocation(this.shaderProgram,t);return t&&e?(this.shaderProgram=this.gl.createProgram(),this.gl.attachShader(this.shaderProgram,t),this.gl.attachShader(this.shaderProgram,e),this.gl.linkProgram(this.shaderProgram),this.gl.getProgramParameter(this.shaderProgram,this.gl.LINK_STATUS))?(this.gl.useProgram(this.shaderProgram),this.gl.bindAttribLocation(this.shaderProgram,0,"aVertexPosition"),this.pUniform=i("uPMatrix"),this.psUniform=i("pSize"),this.fcUniform=i("fillColor"),this.isBubbleUniform=i("isBubble"),this.bubbleSizeAbsUniform=i("bubbleSizeAbs"),this.bubbleSizeAreaUniform=i("bubbleSizeByArea"),this.uSamplerUniform=i("uSampler"),this.skipTranslationUniform=i("skipTranslation"),this.isCircleUniform=i("isCircle"),this.isInverted=i("isInverted"),!0):(this.errors.push(this.gl.getProgramInfoLog(this.shaderProgram)),this.handleErrors(),this.shaderProgram=!1,!1):(this.shaderProgram=!1,this.handleErrors(),!1)}handleErrors(){this.errors.length&&(0,r.error)("[highcharts boost] shader error - "+this.errors.join("\n"))}stringToProgram(t,e){let i=this.gl.createShader("vertex"===e?this.gl.VERTEX_SHADER:this.gl.FRAGMENT_SHADER);return(this.gl.shaderSource(i,t),this.gl.compileShader(i),this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS))?i:(this.errors.push("when compiling "+e+" shader:\n"+this.gl.getShaderInfoLog(i)),!1)}destroy(){this.gl&&this.shaderProgram&&(this.gl.deleteProgram(this.shaderProgram),this.shaderProgram=!1)}fillColorUniform(){return this.fcUniform}getProgram(){return this.shaderProgram}pointSizeUniform(){return this.psUniform}perspectiveUniform(){return this.pUniform}reset(){this.gl&&this.shaderProgram&&(this.gl.uniform1i(this.isBubbleUniform,0),this.gl.uniform1i(this.isCircleUniform,0))}setBubbleUniforms(t,e,i,s=1){let o=t.options,n=Number.MAX_VALUE,a=-Number.MAX_VALUE;if(this.gl&&this.shaderProgram&&t.is("bubble")){let l=t.getPxExtremes();n=(0,r.pick)(o.zMin,(0,r.clamp)(e,!1===o.displayNegative?o.zThreshold:-Number.MAX_VALUE,n)),a=(0,r.pick)(o.zMax,Math.max(a,i)),this.gl.uniform1i(this.isBubbleUniform,1),this.gl.uniform1i(this.isCircleUniform,1),this.gl.uniform1i(this.bubbleSizeAreaUniform,"width"!==t.options.sizeBy),this.gl.uniform1i(this.bubbleSizeAbsUniform,t.options.sizeByAbsoluteValue),this.setUniform("bubbleMinSize",l.minPxSize*s),this.setUniform("bubbleMaxSize",l.maxPxSize*s),this.setUniform("bubbleZMin",n),this.setUniform("bubbleZMax",a),this.setUniform("bubbleZThreshold",t.options.zThreshold)}}setColor(t){this.gl&&this.shaderProgram&&this.gl.uniform4f(this.fcUniform,t[0]/255,t[1]/255,t[2]/255,t[3])}setDrawAsCircle(t){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.isCircleUniform,+!!t)}setInverted(t){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.isInverted,t)}setPMatrix(t){this.gl&&this.shaderProgram&&this.gl.uniformMatrix4fv(this.pUniform,!1,t)}setPointSize(t){this.gl&&this.shaderProgram&&this.gl.uniform1f(this.psUniform,t)}setSkipTranslation(t){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.skipTranslationUniform,+(!0===t))}setTexture(t){this.gl&&this.shaderProgram&&this.gl.uniform1i(this.uSamplerUniform,t)}setUniform(t,e){if(this.gl&&this.shaderProgram){let i=this.uLocations[t]=this.uLocations[t]||this.gl.getUniformLocation(this.shaderProgram,t);this.gl.uniform1f(i,e)}}},b=class{constructor(t,e,i){this.buffer=!1,this.iterator=0,this.preAllocated=!1,this.vertAttribute=!1,this.components=i||2,this.dataComponents=i,this.gl=t,this.shader=e}allocate(t){this.iterator=-1,this.preAllocated=new Float32Array(4*t)}bind(){if(!this.buffer)return!1;this.gl.vertexAttribPointer(this.vertAttribute,this.components,this.gl.FLOAT,!1,0,0)}build(t,e,i){let s;return(this.data=t||[],this.data&&0!==this.data.length||this.preAllocated)?(this.components=i||this.components,this.buffer&&this.gl.deleteBuffer(this.buffer),this.preAllocated||(s=new Float32Array(this.data)),this.buffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.preAllocated||s,this.gl.STATIC_DRAW),this.vertAttribute=this.gl.getAttribLocation(this.shader.getProgram(),e),this.gl.enableVertexAttribArray(this.vertAttribute),s=!1,!0):(this.destroy(),!1)}destroy(){this.buffer&&(this.gl.deleteBuffer(this.buffer),this.buffer=!1,this.vertAttribute=!1),this.iterator=0,this.components=this.dataComponents||2,this.data=[]}push(t,e,i,s){this.preAllocated&&(this.preAllocated[++this.iterator]=t,this.preAllocated[++this.iterator]=e,this.preAllocated[++this.iterator]=i,this.preAllocated[++this.iterator]=s)}render(t,e,i){let s=this.preAllocated?this.preAllocated.length:this.data?.length||0;return!!this.buffer&&!!s&&((!t||t>s||t<0)&&(t=0),(!e||e>s)&&(e=s),!(t>=e)&&(i=i||"POINTS",this.gl.drawArrays(this.gl[i],t/this.components,(e-t)/this.components),!0))}},{getBoostClipRect:x}=c,{parse:A}=m(),{doc:y,win:v}=n(),P={column:!0,columnrange:!0,bar:!0,area:!0,areaspline:!0,arearange:!0},T={scatter:!0,bubble:!0},C=["webgl","experimental-webgl","moz-webgl","webkit-3d"],M={},E=(t,e)=>{if(M[e])return M[e];let i=0===e.indexOf("var(")&&t[e.slice(4,-1).trim()];if(i)return M[e]=i,i;if(0===e.indexOf("color-mix(")){let i=/^color-mix\(in srgb,([a-z0-9\(\)\-\#]+),([a-z0-9\(\)\-\#]+) ([0-9\.%]+)/.exec(e);if(i){let s=parseFloat(i[3])/100,r=E(t,i[1]),o=E(t,i[2]),n=new(m())(r).tweenTo(new(m())(o),s);return M[e]=n,n}}return e};class k{static orthoMatrix(t,e){return[2/t,0,0,0,0,-(2/e),0,0,0,0,-2,0,-1,1,-1,1]}static seriesPointCount(t){let e,i,s;return t.boosted?(e=!!t.options.stacking,i=(t.getColumn("x").length?t.getColumn("x"):void 0)||t.options.xData||t.getColumn("x",!0),s=(e?t.data:i||t.options.data).length,"treemap"===t.type?s*=12:"heatmap"===t.type?s*=6:P[t.type]&&(s*=2),s):0}constructor(t){this.data=[],this.height=0,this.isInited=!1,this.markerData=[],this.series=[],this.textureHandles={},this.width=0,this.postRenderCallback=t,this.settings={pointSize:1,lineWidth:1,fillColor:"#AA00AA",useAlpha:!0,usePreallocated:!1,useGPUTranslations:!1,debug:{timeRendering:!1,timeSeriesProcessing:!1,timeSetup:!1,timeBufferCopy:!1,timeKDTree:!1,showSkipSummary:!1}}}getPixelRatio(){return this.settings.pixelRatio||v.devicePixelRatio||1}setOptions(t){"pixelRatio"in t||(t.pixelRatio=1),(0,r.merge)(!0,this.settings,t)}allocateBuffer(t){let e=this.vbuffer,i=0;this.settings.usePreallocated&&(t.series.forEach(t=>{t.boosted&&(i+=k.seriesPointCount(t))}),e&&e.allocate(i))}allocateBufferForSingleSeries(t){let e=this.vbuffer,i=0;this.settings.usePreallocated&&(t.boosted&&(i=k.seriesPointCount(t)),e&&e.allocate(i))}clear(){let t=this.gl;t&&t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}pushSeriesData(t,e){let i=this.data,s=this.settings,o=this.vbuffer,n=t.pointArrayMap&&"low,high"===t.pointArrayMap.join(","),{chart:a,options:l,sorted:h,xAxis:u,yAxis:d}=t,c=!!l.stacking,g=l.data,p=t.xAxis.getExtremes(),f=p.min-(t.xAxis.minPointOffset||0),b=p.max+(t.xAxis.minPointOffset||0),x=t.yAxis.getExtremes(),y=x.min-(t.yAxis.minPointOffset||0),v=x.max+(t.yAxis.minPointOffset||0),T=(t.getColumn("x").length?t.getColumn("x"):void 0)||l.xData||t.getColumn("x",!0),C=(t.getColumn("y").length?t.getColumn("y"):void 0)||l.yData||t.getColumn("y",!0),M=(t.getColumn("z").length?t.getColumn("z"):void 0)||l.zData||t.getColumn("z",!0),k=!T||0===T.length,{colorByPoint:S,connectNulls:w,threshold:R,zoneAxis:U="y",zones:N}=l,L=t.points||!1,_=c?t.data:T||g,z={x:Number.MAX_VALUE,y:0},D={x:-Number.MAX_VALUE,y:0},O=void 0===a.index,G=P[t.type],I=this.getPixelRatio(),B=a.options.colors||[],V=t.chart.plotWidth,X=!1,F=!1,j,H,Y=0,W=!1,K,q,Z,Q,J=-1,$=!1,tt=!1,te,ti=!1,ts=!1,tr,to=!1,tn=!0,ta=!0,tl=[],th=!1,tu=!1,td=0,tc=0;if(l.boostData&&l.boostData.length>0)return;if(l.gapSize&&(tu="value"!==l.gapUnit?l.gapSize*t.closestPointRange:l.gapSize),a.boost){let t=a.renderer.circle(0,0,1).attr({fill:"var(--highcharts-background-color)"}).add(),e=new(m())(getComputedStyle(t.element).getPropertyValue("fill")).get(),i=new(m())(a.palette?.cssVars.dark["--highcharts-background-color"]||"").get();t.destroy(),a.boost.cssVars=a.palette?.cssVars[e===i?"dark":"light"]}let tg=a.boost?.cssVars||{};if(N?.length&&(tl=[],N.forEach((t,e)=>{if("string"==typeof t.color){let i=A(E(tg,t.color)).rgba;i[0]/=255,i[1]/=255,i[2]/=255,tl[e]=i,th||void 0!==t.value||(th=i)}}),!th)){let e=t.pointAttribs&&t.pointAttribs().fill||t.color;th=A("string"==typeof e?E(tg,e):"").rgba,th[0]/=255,th[1]/=255,th[2]/=255}a.inverted&&(V=t.chart.plotHeight),t.closestPointRangePx=Number.MAX_VALUE;let tm=t=>{t&&(e.colorData.push(t[0]),e.colorData.push(t[1]),e.colorData.push(t[2]),e.colorData.push(t[3]))},tp=(t,r,n,a=1,l)=>{tm(l),1!==I&&(!s.useGPUTranslations||e.skipTranslation)&&(t*=I,r*=I,a*=I),s.usePreallocated&&o?(o.push(t,r,+!!n,a),td+=4):(i.push(t),i.push(r),i.push(n?I:0),i.push(a))},tf=()=>{e.segments.length&&(e.segments[e.segments.length-1].to=i.length||td)},tb=()=>{e.segments.length&&e.segments[e.segments.length-1].from===(i.length||td)||(tf(),e.segments.push({from:i.length||td}))},tx=(t,e,i,s,r)=>{tm(r),tp(t+i,e),tm(r),tp(t,e),tm(r),tp(t,e+s),tm(r),tp(t,e+s),tm(r),tp(t+i,e+s),tm(r),tp(t+i,e)};if(tb(),L&&L.length>0){e.skipTranslation=!0,e.drawMode="TRIANGLES",L[0].node&&L[0].node.levelDynamic&&L.sort((t,e)=>{if(t.node){if(t.node.levelDynamic>e.node.levelDynamic)return 1;if(t.node.levelDynamic<e.node.levelDynamic)return -1}return 0}),L.forEach(e=>{let i,s,r=e.plotY;if(void 0!==r&&!isNaN(r)&&null!==e.y&&e.shapeArgs){let{x:r=0,y:o=0,width:n=0,height:l=0}=e.shapeArgs;i=(s=a.styledMode?e.series.colorAttribs(e):s=e.series.pointAttribs(e))["stroke-width"]||0,"string"==typeof s.fill&&(s.fill=E(tg,s.fill)),tr=A(s.fill).rgba,tr[0]/=255,tr[1]/=255,tr[2]/=255,t.is("treemap")&&(i=i||1,"string"==typeof s.stroke&&(s.stroke=E(tg,s.stroke)),H=A(s.stroke).rgba,H[0]/=255,H[1]/=255,H[2]/=255,tx(r,o,n,l,H),i/=2),t.is("heatmap")&&a.inverted&&(r=u.len-r,o=d.len-o,n=-n,l=-l),tx(r+i,o+i,n-2*i,l-2*i,tr)}}),tf();return}for(;J<_.length-1;){if(void 0===(Z=_[++J]))continue;if(O)break;let i=g&&g[J];if(!k){let e;(0,r.isObject)(i,!0)&&i.color&&(e=A(i.color).rgba);let s=t.options.keys?.indexOf("color");Array.isArray(i)&&s&&"string"==typeof i[s]?e=A(i[s]).rgba:S&&(tc%=B.length,e=A(E(tg,B[tc])).rgba),e&&((tr=e)[0]=e[0]/255,tr[1]=e[1]/255,tr[2]=e[2]/255,tr[3]=e[3]),tc++}if(k?(K=Z[0],q=Z[1],_[J+1]&&(tt=_[J+1][0]),_[J-1]&&($=_[J-1][0]),Z.length>=3&&(Q=Z[2],Z[2]>e.zMax&&(e.zMax=Z[2]),Z[2]<e.zMin&&(e.zMin=Z[2]))):(K=Z,q=C?.[J],_[J+1]&&(tt=_[J+1]),_[J-1]&&($=_[J-1]),M&&M.length&&(Q=M[J],M[J]>e.zMax&&(e.zMax=M[J]),M[J]<e.zMin&&(e.zMin=M[J]))),!w&&(null===K||null===q)){tb();continue}if(tt&&tt>=f&&tt<=b&&(ti=!0),$&&$>=f&&$<=b&&(ts=!0),n?(k&&(q=Z.slice(1,3)),te=t.getColumn("low",!0)?.[J],q=t.getColumn("high",!0)?.[J]||0):c&&(K=Z.x,te=(q=Z.stackY)-Z.y),null!=y&&null!=v&&(tn=q>=y&&q<=v),!h&&!tn||(K>b&&D.x<b&&(D.x=K,D.y=q),K<f&&z.x>f&&(z.x=K,z.y=q),null===q&&w))continue;if(null===q||!tn&&_.length>1&&!ti&&!ts){tb();continue}if((h&&(tt>=f||K>=f)&&($<=b||K<=b)||!h&&K>=f&&K<=b)&&(to=!0),to||ti||ts){if(tu&&K-$>tu&&tb(),N?.length){let t,e,i="x"===U?K:q;N.some((t,s)=>void 0!==t.value&&i<t.value&&(e=s,!0)),void 0!==e&&tl[e]&&(t=tl[e]),tr=t||th||tr}if(s.useGPUTranslations||(e.skipTranslation=!0,K=u.toPixels(K,!0),q=d.toPixels(q,!0),!(K>V)||"POINTS"!==e.drawMode)){if(e.hasMarkers&&to&&!1!==X&&(t.closestPointRangePx=Math.min(t.closestPointRangePx,Math.abs(K-X))),!s.useGPUTranslations&&!s.usePreallocated&&X&&1>Math.abs(K-X)&&F&&1>Math.abs(q-F)){s.debug.showSkipSummary&&++Y;continue}G&&(j=te||0,(!1===te||void 0===te)&&(j=q<0?q:0),(n||c)&&!d.logarithmic||(j=Math.max(R??y,y)),s.useGPUTranslations||(j=d.toPixels(j,!0)),tp(K,j,!1,0,tr)),l.step&&!ta&&tp(K,F,!1,2,tr),tp(K,q,!1,"bubble"===t.type?Q||1:2,tr),X=K,F=q,W=!0,ta=!1}}}s.debug.showSkipSummary&&console.log("skipped points:",Y);let tA=(t,i)=>{if(s.useGPUTranslations||(e.skipTranslation=!0,t.x=u.toPixels(t.x,!0),t.y=d.toPixels(t.y,!0)),i){this.data=[t.x,t.y,0,2].concat(this.data);return}tp(t.x,t.y,0,2)};!W&&!1!==w&&"line_strip"===t.drawMode&&(z.x<Number.MAX_VALUE&&tA(z,!0),D.x>-Number.MAX_VALUE&&tA(D)),tf()}pushSeries(t){let e=this.markerData,i=this.series,s=this.settings;i.length>0&&i[i.length-1].hasMarkers&&(i[i.length-1].markerTo=e.length),s.debug.timeSeriesProcessing&&console.time("building "+t.type+" series");let r={segments:[],markerFrom:e.length,colorData:[],series:t,zMin:Number.MAX_VALUE,zMax:-Number.MAX_VALUE,hasMarkers:!!t.options.marker&&!1!==t.options.marker.enabled,showMarkers:!0,drawMode:p[t.type]||"LINE_STRIP"};t.index>=i.length?i.push(r):i[t.index]=r,this.pushSeriesData(t,r),s.debug.timeSeriesProcessing&&console.timeEnd("building "+t.type+" series")}flush(){let t=this.vbuffer;this.data=[],this.markerData=[],this.series=[],t&&t.destroy()}setXAxis(t){let e=this.shader;if(!e)return;let i=this.getPixelRatio();e.setUniform("xAxisTrans",t.transA*i),e.setUniform("xAxisMin",t.min),e.setUniform("xAxisMax",t.max),e.setUniform("xAxisMinPad",t.minPixelPadding*i),e.setUniform("xAxisPointRange",t.pointRange),e.setUniform("xAxisLen",t.len*i),e.setUniform("xAxisPos",t.pos*i),e.setUniform("xAxisCVSCoord",!t.horiz),e.setUniform("xAxisIsLog",!!t.logarithmic),e.setUniform("xAxisReversed",!!t.reversed)}setYAxis(t){let e=this.shader;if(!e)return;let i=this.getPixelRatio();e.setUniform("yAxisTrans",t.transA*i),e.setUniform("yAxisMin",t.min),e.setUniform("yAxisMax",t.max),e.setUniform("yAxisMinPad",t.minPixelPadding*i),e.setUniform("yAxisPointRange",t.pointRange),e.setUniform("yAxisLen",t.len*i),e.setUniform("yAxisPos",t.pos*i),e.setUniform("yAxisCVSCoord",!t.horiz),e.setUniform("yAxisIsLog",!!t.logarithmic),e.setUniform("yAxisReversed",!!t.reversed)}setThreshold(t,e){let i=this.shader;i&&(i.setUniform("hasThreshold",t),i.setUniform("translatedThreshold",e))}renderChart(t){let e=this.gl,i=this.settings,s=this.shader,o=this.vbuffer;M={};let a=this.getPixelRatio();if(!t)return!1;this.width=t.chartWidth*a,this.height=t.chartHeight*a;let l=this.height,h=this.width,u=t.options.colors||[];if(!e||!s||!h||!l)return!1;i.debug.timeRendering&&console.time("gl rendering"),e.canvas.width=h,e.canvas.height=l,s.bind(),e.viewport(0,0,h,l),s.setPMatrix(k.orthoMatrix(h,l)),i.lineWidth>1&&!n().isMS&&e.lineWidth(i.lineWidth),o&&(o.build(this.data,"aVertexPosition",4),o.bind()),s.setInverted(t.inverted),this.series.forEach((n,h)=>{let d=n.series.options,c=d.marker,g=void 0!==d.lineWidth?d.lineWidth:1,p=d.threshold,f=(0,r.isNumber)(p),y=n.series.yAxis.getThreshold(p),v=(0,r.pick)(d.marker?d.marker.enabled:null,!!n.series.xAxis.isRadial||null,n.series.closestPointRangePx>2*((d.marker?d.marker.radius:10)||10)),P=this.textureHandles[c&&c.symbol||n.series.symbol]||this.textureHandles.circle,C,M,k,S=[];if(0!==n.segments.length&&n.segments[0].from!==n.segments[0].to&&(P.isReady&&(e.bindTexture(e.TEXTURE_2D,P.handle),s.setTexture(P.handle)),t.styledMode?n.series.markerGroup===n.series.chart.boost?.markerGroup?(delete n.series.markerGroup,n.series.markerGroup=n.series.plotGroup("markerGroup","markers","visible",1,t.seriesGroup).addClass("highcharts-tracker"),k=n.series.markerGroup.getStyle("fill"),n.series.markerGroup.destroy(),n.series.markerGroup=n.series.chart.boost?.markerGroup):k=n.series.markerGroup?.getStyle("fill"):(k="POINTS"===n.drawMode&&n.series.pointAttribs&&n.series.pointAttribs().fill||n.series.color,d.colorByPoint&&"string"==typeof u[h]&&(k=u[h])),n.series.fillOpacity&&d.fillOpacity&&k&&(k=new(m())(k).setOpacity((0,r.pick)(d.fillOpacity,1)).get()),"string"==typeof k&&(k=E(t.boost?.cssVars||{},k)),S=A(k).rgba,i.useAlpha||(S[3]=1),"add"===d.boostBlending?(e.blendFunc(e.SRC_ALPHA,e.ONE),e.blendEquation(e.FUNC_ADD)):"mult"===d.boostBlending||"multiply"===d.boostBlending?e.blendFunc(e.DST_COLOR,e.ZERO):"darken"===d.boostBlending?(e.blendFunc(e.ONE,e.ONE),e.blendEquation(e.FUNC_MIN)):e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),s.reset(),n.colorData.length>0?(s.setUniform("hasColor",1),(M=new b(e,s)).build(Array(n.segments[0].from).concat(n.colorData),"aColor",4),M.bind()):(s.setUniform("hasColor",0),e.disableVertexAttribArray(e.getAttribLocation(s.getProgram(),"aColor"))),s.setColor(S),this.setXAxis(n.series.xAxis),this.setYAxis(n.series.yAxis),this.setThreshold(f,y),"POINTS"===n.drawMode&&s.setPointSize(2*(0,r.pick)(d.marker&&d.marker.radius,.5)*a),s.setSkipTranslation(n.skipTranslation),"bubble"===n.series.type&&s.setBubbleUniforms(n.series,n.zMin,n.zMax,a),s.setDrawAsCircle(T[n.series.type]||!1),o)){if(g>0||"LINE_STRIP"!==n.drawMode){let{x:i,y:s,width:r,height:h}=x(t,n.series);for(e.enable(e.SCISSOR_TEST),e.scissor(i*a,l-(s+h)*a,r*a,h*a),C=0;C<n.segments.length;C++)o.render(n.segments[C].from,n.segments[C].to,n.drawMode);e.disable(e.SCISSOR_TEST)}if(n.hasMarkers&&v)for(s.setPointSize(2*(0,r.pick)(d.marker&&d.marker.radius,5)*a),s.setDrawAsCircle(!0),C=0;C<n.segments.length;C++)o.render(n.segments[C].from,n.segments[C].to,"POINTS")}}),i.debug.timeRendering&&console.timeEnd("gl rendering"),this.postRenderCallback&&this.postRenderCallback(this),this.flush()}render(t){if(this.clear(),t.renderer.forExport)return this.renderChart(t);this.isInited?this.renderChart(t):setTimeout(()=>{this.render(t)},1)}setSize(t,e){let i=this.shader;i&&(this.width!==t||this.height!==e)&&(this.width=t,this.height=e,i.bind(),i.setPMatrix(k.orthoMatrix(t,e)))}init(t,e){let i=this.settings;if(this.isInited=!1,!t)return!1;i.debug.timeSetup&&console.time("gl setup");for(let e=0;e<C.length&&(this.gl=t.getContext(C[e],{}),!this.gl);++e);let s=this.gl;if(!s)return!1;e||this.flush(),s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),s.disable(s.DEPTH_TEST),s.depthFunc(s.LESS);let r=this.shader=new f(s);if(!r)return!1;this.vbuffer=new b(s,r);let o=(t,e)=>{let i={isReady:!1,texture:y.createElement("canvas"),handle:s.createTexture()},r=i.texture.getContext("2d");this.textureHandles[t]=i,i.texture.width=512,i.texture.height=512,r.mozImageSmoothingEnabled=!1,r.webkitImageSmoothingEnabled=!1,r.msImageSmoothingEnabled=!1,r.imageSmoothingEnabled=!1,r.strokeStyle="rgba(255, 255, 255, 0)",r.fillStyle="#FFF",e(r);try{s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,i.handle),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,i.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.bindTexture(s.TEXTURE_2D,null),i.isReady=!0}catch{}};return o("circle",t=>{t.beginPath(),t.arc(256,256,256,0,2*Math.PI),t.stroke(),t.fill()}),o("square",t=>{t.fillRect(0,0,512,512)}),o("diamond",t=>{t.beginPath(),t.moveTo(256,0),t.lineTo(512,256),t.lineTo(256,512),t.lineTo(0,256),t.lineTo(256,0),t.fill()}),o("triangle",t=>{t.beginPath(),t.moveTo(0,512),t.lineTo(256,0),t.lineTo(512,512),t.lineTo(0,512),t.fill()}),o("triangle-down",t=>{t.beginPath(),t.moveTo(0,0),t.lineTo(256,512),t.lineTo(512,0),t.lineTo(0,0),t.fill()}),this.isInited=!0,i.debug.timeSetup&&console.timeEnd("gl setup"),!0}destroy(){let t=this.gl,e=this.shader,i=this.vbuffer;this.flush(),i&&i.destroy(),e&&e.destroy(),t&&((0,r.objectEach)(this.textureHandles,e=>{e.handle&&t.deleteTexture(e.handle)}),t.canvas.width=1,t.canvas.height=1)}}let{setLength:S,splice:w}={convertToNumber:function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??""}`))&&!e?null:t}},setLength:function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},splice:function(t,e,i,s,r=[]){if(Array.isArray(t))return Array.isArray(r)||(r=Array.from(r)),{removed:t.splice(e,i,...r),array:t};let o=Object.getPrototypeOf(t).constructor,n=t[s?"subarray":"slice"](e,e+i),a=new o(t.length-i+r.length);return a.set(t.subarray(0,e),0),a.set(r,e),a.set(t.subarray(e+i),e+r.length),{removed:n,array:a}}},R=class{constructor(t={}){this.isDataTable=!0,this.autoId=!t.id,this.columns={},this.id=t.id||(0,r.uniqueKey)(),this.rowCount=0,this.versionTag=(0,r.uniqueKey)();let e=0;(0,r.objectEach)(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,(0,r.objectEach)(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=S(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;(0,r.objectEach)(this.columns,(s,r)=>{this.columns[r]=w(s,t,e).array,i=s.length}),this.rowCount=i}(0,r.fireEvent)(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,r.uniqueKey)()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRowObject(t,e){let i={},s=this.columns;for(let r of(e??(e=Object.keys(this.columns)),e))i[r]=s[r]?.[t];return i}setColumn(t,e=[],i=0,s){this.setColumns({[t]:e},i,s)}setColumns(t,e,i){let s=this.rowCount;(0,r.objectEach)(t,(t,e)=>{this.columns[e]=t.slice(),s=t.length}),this.applyRowCount(s),i?.silent||((0,r.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,r.uniqueKey)())}setRow(t,e=this.rowCount,i,s){var o;let{columns:n}=this,a=i?this.rowCount+1:e+1,l=Object.keys(t);if(s?.addColumns!==!1)for(let t=0,e=l.length;t<e;t++)n[o=l[t]]||(n[o]=Array(this.rowCount));(0,r.objectEach)(n,(s,r)=>{s&&(i?s=w(s,e,0,!0,[t[r]]).array:s[e]=r in t?t[r]:s[e],n[r]=s)}),this.applyRowCount(Math.max(a,this.rowCount)),s?.silent||((0,r.fireEvent)(this,"afterSetRows",{rowIndex:e}),this.versionTag=(0,r.uniqueKey)())}getModified(){return this.modified||this}},{getBoostClipRect:U,isChartSeriesBoosting:N}=c,{getOptions:L}=n(),{composed:_,doc:z,noop:D,win:O}=n();function G(t,e){let i=e.boost;t&&i&&i.target&&i.canvas&&!N(e.chart)&&t.allocateBufferForSingleSeries(e)}function I(t){return(0,r.pick)(t&&t.options&&t.options.boost&&t.options.boost.enabled,!0)}function B(t,i){let s=t.constructor,o=t.seriesGroup||i.group,n=t.chartWidth,a=t.chartHeight,l=t,h="u">typeof SVGForeignObjectElement,u=!1;N(t)?l=t:(l=i,u=!!(i.options.events?.click||i.options.point?.events?.click));let d=l.boost=l.boost||{};if(h=!1,e||(e=z.createElement("canvas")),!d.target&&(d.canvas=e,t.renderer.forExport||!h?(l.renderTarget=d.target=t.renderer.image("",0,0,n,a).addClass("highcharts-boost-canvas").add(o),d.clear=function(){d.target.attr({href:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="})},d.copy=function(){d.resize(),d.target.attr({href:d.canvas.toDataURL("image/png")})}):(d.targetFo=t.renderer.createElement("foreignObject").add(o),l.renderTarget=d.target=z.createElement("canvas"),d.targetCtx=d.target.getContext("2d"),d.targetFo.element.appendChild(d.target),d.clear=function(){d.target.width=d.canvas.width,d.target.height=d.canvas.height},d.copy=function(){d.target.width=d.canvas.width,d.target.height=d.canvas.height,d.targetCtx.drawImage(d.canvas,0,0)}),d.resize=function(){n=t.chartWidth,a=t.chartHeight,(d.targetFo||d.target).attr({x:0,y:0,width:n,height:a}).css({pointerEvents:u?void 0:"none",mixedBlendMode:"normal",opacity:1}).addClass(u?"highcharts-tracker":""),l instanceof s&&l.boost?.markerGroup?.translate(t.plotLeft,t.plotTop)},d.clipRect=t.renderer.clipRect(),(d.targetFo||d.target).attr({zIndex:i.options.zIndex}),l instanceof s&&(l.boost.markerGroup=l.renderer.g().add(o).translate(i.xAxis.pos,i.yAxis.pos))),d.canvas.width=n,d.canvas.height=a,d.clipRect){let e=U(t,l);d.clipRect.attr(e),t.navigator||e.width!==t.clipBox.width||e.height!==t.clipBox.height?(d.targetFo||d.target).clip(d.clipRect):o?.clip(t.renderer.clipRect(e.x-4,e.y,e.width+4,e.height+4))}return d.resize(),d.clear(),!d.wgl&&(d.wgl=new k(t=>{t.settings.debug.timeBufferCopy&&console.time("buffer copy"),d.copy(),t.settings.debug.timeBufferCopy&&console.timeEnd("buffer copy")}),d.wgl.init(d.canvas)||(0,r.error)("[highcharts boost] - unable to init WebGL renderer"),d.wgl.setOptions(t.options.boost||{}),l instanceof s&&d.wgl.allocateBuffer(t)),d.wgl.setSize(n,a),d.wgl}function V(t){let e=t.points;if(e){let t,i;for(i=0;i<e.length;i+=1)(t=e[i])&&t.destroyElements&&t.destroyElements()}for(let e of(["graph","area","tracker"].forEach(e=>{let i=t[e];i&&(t[e]=i.destroy())}),t.zones))(0,r.destroyObjectProperties)(e,void 0,!0)}function X(t,e,i,s,r,o){let n=(r=r||0)+(s=s||3e3),a=!0;for(;a&&r<n&&r<t.length;)a=e(t[r],r),++r;a&&(r<t.length?o?X(t,e,i,s,r,o):O.requestAnimationFrame?O.requestAnimationFrame(function(){X(t,e,i,s,r)}):setTimeout(X,0,t,e,i,s,r):i&&i())}function F(t,e){let i=t.options,s=(0,r.pick)(i.boostThreshold,Number.MAX_VALUE);if(0===s)return!1;let o=t.dataTable.getModified().rowCount,n=t.xAxis&&t.xAxis.options,a=t.yAxis&&t.yAxis.options,l=t.colorAxis&&t.colorAxis.options;return o>=s&&(0,r.isNumber)(a?.min)&&(0,r.isNumber)(a?.max)&&(!e||(0,r.isNumber)(n?.min)&&(0,r.isNumber)(n?.max))&&(!l||(0,r.isNumber)(l.min)&&(0,r.isNumber)(l.max))}let j=(t,e)=>{let{options:i,forceCrop:s,chart:o}=t,n=(0,r.pick)(i.boostThreshold,Number.MAX_VALUE);return!s&&0!==n&&(N(o)||(e?.length??0)>=n)};function H(){let t=this,e=t.chart;e.boost&&e.boost.markerGroup===t.markerGroup&&(t.markerGroup=void 0),e.hoverPoints&&(e.hoverPoints=e.hoverPoints.filter(function(e){return e.series===t})),e.hoverPoint&&e.hoverPoint.series===t&&(e.hoverPoint=void 0)}function Y(){let t=this.boost,e=this.chart.boost,i=e?.markerGroup;t&&t.canvas&&t.target&&(t.wgl&&t.wgl.clear(),t.clear&&t.clear()),i&&this.markerGroup===i&&this.chart.series.some(t=>t.visible&&t.markerGroup===i)&&i.show()}function W(t){let e=t.boost;e&&e.canvas&&e.target&&e.wgl&&!N(t.chart)&&e.wgl.render(t.chart)}function K(t,e){let i=t.options,s=t.xAxis,o=t.pointClass;if(e instanceof o)return e;let n=i.data,a=t.is("scatter"),l=(a&&t.getColumn("x",!0).length?t.getColumn("x",!0):void 0)||(t.getColumn("x").length?t.getColumn("x"):void 0)||i.xData||t.getColumn("x",!0)||!1,h=t.getColumn("y",!0)||i.yData||!1,u=e.i,d=n?.[u]?.color,c=new o(t,a&&l&&h?[l[u],h[u]]:((0,r.isArray)(n)?n:[])[u],l?l[u]:void 0);if(a&&i?.keys?.length){let t=i.keys;for(let e=t.length-1;e>-1;e--)c[t[e]]=n[u][e]}return c.category=(0,r.pick)(s.categories?s.categories[c.x]:c.x,c.x),c.key=c.name??c.category,c.dist=e.dist,c.distX=e.distX,c.plotX=e.plotX,c.plotY=e.plotY,c.percentage=e.percentage,c.isInside=t.isPointInside(c),d&&(c.color=d),c}function q(t){let{options:e,xAxis:i,yAxis:s}=this;if(!this.isDirty&&!i.isDirty&&!s.isDirty&&!t)return!1;this.yAxis.setTickInterval();let o=e.boostThreshold||0,n=e.cropThreshold,a=this.getColumn("x"),l=i.getExtremes(),h=l.max??Number.MAX_VALUE,u=l.min??-Number.MAX_VALUE,d=this.getColumn("y"),c=s.getExtremes(),g=c.max??Number.MAX_VALUE,m=c.min??-Number.MAX_VALUE,p=s.userMin??((0,r.isNumber)(s.options.min)?s.options.min:-Number.MAX_VALUE),f=s.userMax??((0,r.isNumber)(s.options.max)?s.options.max:Number.MAX_VALUE);if(!this.boosted&&i.old&&s.old&&u>=(i.old.min??-Number.MAX_VALUE)&&h<=(i.old.max??Number.MAX_VALUE)&&m>=(s.old.min??-Number.MAX_VALUE)&&g<=(s.old.max??Number.MAX_VALUE))return this.dataTable.getModified().setColumns({x:a,y:d}),!0;let b=this.dataTable.rowCount;if(!o||b<o||n&&!this.forceCrop&&!this.getExtremesFromAll&&!e.getExtremesFromAll&&b<n)return this.dataTable.getModified().setColumns({x:a,y:d}),!0;let x=[],A=[],y=[],v=!((0,r.isNumber)(l.max)||(0,r.isNumber)(l.min)),P=!((0,r.isNumber)(c.max)||(0,r.isNumber)(c.min)),T=!1,C,M=a[0],E=a[0],k,S=d?.[0],w=d?.[0];for(let t=0,e=a.length;t<e;++t)C=a[t],k=d?.[t],C>=u&&C<=h&&k>=p&&k<=f?(x.push(C),A.push(k),y.push(t),v&&(M=Math.max(M,C),E=Math.min(E,C)),P&&(S=Math.max(S,k),w=Math.min(w,k))):T=!0;return v&&(i.dataMax=Math.max(M,i.dataMax||0),i.dataMin=Math.min(E,i.dataMin||0)),P&&(s.dataMax=Math.max(S,s.dataMax||0),s.dataMin=Math.min(w,s.dataMin||0)),this.cropped=T,this.cropStart=0,T&&!this.dataTable.modified&&(this.dataTable.modified=new R,this.hasProcessedDataTable=!0),this.dataTable.getModified().setColumns({x:x,y:A}),!0}function Z(){let e=this.options||{},i=this.chart,s=i.boost,o=this.boost,n=this.xAxis,a=this.yAxis,l=e.xData||this.getColumn("x",!0),h=e.yData||this.getColumn("y",!0),u=this.getColumn("low",!0),d=this.getColumn("high",!0),c=e.data,g=n.getExtremes(),m=g.min-(n.minPointOffset||0),p=g.max+(n.minPointOffset||0),f=a.getExtremes(),b=f.min-(a.minPointOffset||0),x=f.max+(a.minPointOffset||0),A={},y=!!this.sampling,v=e.enableMouseTracking,P=e.threshold,T=this.pointArrayMap&&"low,high"===this.pointArrayMap.join(","),C=!!e.stacking,M=this.cropStart||0,E=this.requireSorting,k=!l,S="x"===e.findNearestPointBy,w=(this.getColumn("x").length?this.getColumn("x"):void 0)||this.options.xData||this.getColumn("x",!0),R=(0,r.pick)(e.lineWidth,1),U=e.nullInteraction&&b,L=i.tooltip,_=!1,z,O=a.getThreshold(P),I,F,j,H;if(!this.boosted||(this.points?.forEach(t=>{t?.destroyElements?.()}),this.points=[],L&&!L.isHidden?(i.hoverPoint?.series===this||i.hoverPoints?.some(t=>t.series===this))&&(i.hoverPoint=i.hoverPoints=void 0,L.hide(0)):i.hoverPoints&&(i.hoverPoints=i.hoverPoints.filter(t=>t.series!==this)),n.isPanning||a.isPanning)||(_=B(i,this),i.boosted=!0,!this.visible))return;(this.points||this.graph)&&V(this),N(i)?(this.markerGroup&&this.markerGroup!==s?.markerGroup&&this.markerGroup.destroy(),this.markerGroup=s?.markerGroup,o&&o.target&&(this.renderTarget=o.target=o.target.destroy())):(this.markerGroup===s?.markerGroup&&(this.markerGroup=void 0),this.markerGroup=this.plotGroup("markerGroup","markers","visible",1,i.seriesGroup).addClass("highcharts-tracker"));let Y=this.points=[],K=(e,s,r,o)=>{let l=!!w&&w[M+r],h=t=>{i.inverted&&(t=n.len-t,s=a.len-s),Y.push({destroy:D,x:l,clientX:t,plotX:t,plotY:s,i:M+r,percentage:o})};e=Math.ceil(e),t=S?e:e+","+s,v&&(A[t]?l===w[w.length-1]&&(Y.length--,h(e)):(A[t]=!0,h(e)))};this.buildKDTree=D,(0,r.fireEvent)(this,"renderCanvas"),s&&R>1&&this.is("line")&&(s.lineWidthFilter?.remove(),s.lineWidthFilter=i.renderer.definition({tagName:"filter",children:[{tagName:"feMorphology",attributes:{operator:"dilate",radius:.25*R}}],attributes:{id:"linewidth"}}),(o?.target||s.target)?.attr({filter:"url(#linewidth)"})),_&&(G(_,this),_.pushSeries(this),W(this));let q=_.settings,Z=(0,r.isNumber)(q.chunkSize)&&q.chunkSize>0?q.chunkSize:3e3,Q=()=>{(0,r.fireEvent)(this,"renderedCanvas"),delete this.buildKDTree,this.options&&this.buildKDTree(),q.debug.timeKDTree&&console.timeEnd("kd tree building")};i.renderer.forExport||(q.debug.timeKDTree&&console.time("kd tree building"),X(C?this.data.slice(M):l||c,function(t,e){let s=void 0===i.index,o,l,c,g,f,A=!1,v=!0;return!(0,r.defined)(t)||(!s&&(k?(o=t[0],l=t[1]):(o=t,l=h[e]??U??null),T?(k&&(l=t.slice(1,3)),A=u[e],l=d[e]):C&&(o=t.x,A=(l=t.stackY)-t.y,f=t.percentage),E||(v=(l||0)>=b&&l<=x),null!==l&&o>=m&&o<=p&&v&&(c=n.toPixels(o,!0),y?((void 0===j||c===z)&&(T||(A=l),(void 0===H||l>F)&&(F=l,H=e),(void 0===j||A<I)&&(I=A,j=e)),S&&c===z||(void 0!==j&&(g=a.toPixels(F,!0),O=a.toPixels(I,!0),K(c,g,H,f),O!==g&&K(c,O,j,f)),j=H=void 0,z=c)):K(c,g=Math.ceil(a.toPixels(l,!0)),e,f))),!s)},Q,Z))}function Q(t){let e=!0;if(this.chart.options&&this.chart.options.boost&&(e=void 0===this.chart.options.boost.enabled||this.chart.options.boost.enabled),!e||!this.boosted)return t.call(this);this.chart.boosted=!0;let i=B(this.chart,this);i&&(G(i,this),i.pushSeries(this)),W(this)}function J(t){if(this.boosted){if(F(this,!0))return{};if(this.xAxis?.isPanning||this.yAxis?.isPanning)return this}return t.apply(this,[].slice.call(arguments,1))}function $(t){let e=this.options.data;if(I(this.chart)&&l[this.type]){let s=this.is("scatter")&&!this.is("bubble")&&!this.is("treemap")&&!this.is("heatmap");if(!j(this,e)||s||this.is("treemap")||this.options.stacking||!F(this,!0)){if(this.boosted&&(this.xAxis?.isPanning||this.yAxis?.isPanning))return;s&&"treegrid"!==this.yAxis.type?q.call(this,arguments[1]):t.apply(this,[].slice.call(arguments,1)),e=this.getColumn("x",!0)}if(this.boosted=j(this,e),this.boosted){let t;this.options.data?.length&&(t=this.getFirstValidPoint(this.options.data),(0,r.isNumber)(t)||(0,r.isArray)(t)||this.is("treemap")||(0,r.error)(12,!1,this.chart));var i=this;i.boost=i.boost||{getPoint:t=>K(i,t)};let e=i.boost.altered=[];if(["allowDG","directTouch","stickyTracking"].forEach(t=>{e.push({prop:t,val:i[t],own:Object.hasOwnProperty.call(i,t)})}),i.allowDG=!1,i.directTouch=!1,i.stickyTracking=!0,i.finishedAnimating=!0,i.labelBySeries&&(i.labelBySeries=i.labelBySeries.destroy()),i.is("scatter")&&!i.is("treemap")&&i.data.length){for(let t of i.data)t?.destroy?.();i.data.length=0,i.points.length=0}}else!function(t){let e=t.boost,i=t.chart,s=i.boost;if(s?.markerGroup)for(let t of(s.markerGroup.destroy(),s.markerGroup=void 0,i.series))t.markerGroup=void 0,t.markerGroup=t.plotGroup("markerGroup","markers","visible",1,i.seriesGroup).addClass("highcharts-tracker");e&&((e.altered||[]).forEach(e=>{e.own?t[e.prop]=e.val:delete t[e.prop]}),e.clear&&e.clear()),(i.seriesGroup||t.group)?.clip()}(this)}else t.apply(this,[].slice.call(arguments,1))}function tt(t){let e=t.apply(this,[].slice.call(arguments,1));return this.boost&&e?this.boost.getPoint(e):e}let te={compose:function(t,e,i,s){if((0,r.pushUnique)(_,"Boost.Series")){let o=L().plotOptions,n=t.prototype;if((0,r.addEvent)(t,"destroy",H),(0,r.addEvent)(t,"hide",Y),s&&(n.renderCanvas=Z),(0,r.wrap)(n,"getExtremes",J),(0,r.wrap)(n,"processData",$),(0,r.wrap)(n,"searchPoint",tt),["translate","generatePoints","drawTracker","drawPoints","render"].forEach(t=>(function(t,e,i){function s(t){let e=this.options.stacking&&("translate"===i||"generatePoints"===i);this.boosted&&!e&&I(this.chart)&&"heatmap"!==this.type&&"treemap"!==this.type&&l[this.type]&&0!==this.options.boostThreshold?"render"===i&&this.renderCanvas&&this.renderCanvas():t.call(this)}if((0,r.wrap)(t,i,s),"translate"===i)for(let t of["column","arearange","columnrange","heatmap","treemap"])e[t]&&(0,r.wrap)(e[t].prototype,i,s)})(n,e,t)),(0,r.wrap)(i.prototype,"firePointEvent",function(t,e,i){if("click"===e&&this.series.boosted){let t=i.point;if((t.dist||t.distX)>=(t.series.options.marker?.radius??10))return}return t.apply(this,[].slice.call(arguments,1))}),a.forEach(t=>{let i=o[t];i&&(i.boostThreshold=5e3,i.boostData=[],e[t].prototype.fillOpacity=!0)}),s){let{area:t,areaspline:i,bubble:s,column:o,heatmap:n,scatter:a,treemap:l}=e;if(t&&(0,r.extend)(t.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),i&&(0,r.extend)(i.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),s){let t=s.prototype;delete t.buildKDTree,(0,r.wrap)(t,"markerAttribs",function(t){return!this.boosted&&t.apply(this,[].slice.call(arguments,1))})}o&&(0,r.extend)(o.prototype,{fill:!0,sampling:!0}),a&&(a.prototype.fill=!0),[n,l].forEach(t=>{t&&(0,r.wrap)(t.prototype,"drawPoints",Q)})}}return t},destroyGraphics:V,eachAsync:X,getPoint:K},{getBoostClipRect:ti,isChartSeriesBoosting:ts}=c,{destroyGraphics:tr}=te,{parse:to}=m(),{doc:tn,noop:ta}=n();!function(t){let e,i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function s(t,e,i,s,r){r&&e!==r.clientX&&(t.moveTo(r.clientX,r.yBottom),t.lineTo(r.clientX,r.plotY),t.lineTo(e,i),t.lineTo(e,s))}function o(t,e,i,s,r){t.moveTo(e,i),t.arc(e,i,this.radii&&this.radii[r],0,2*Math.PI,!1)}function n(t,e,i,s){t.rect(e-1,i,1,s-i)}function a(){this.boost&&this.boost.copy&&this.boost.copy()}function l(){let t=this.boost||{};t.target&&t.target.attr({href:i}),t.canvas&&t.canvas.getContext("2d").clearRect(0,0,t.canvas.width,t.canvas.height)}function h(){ts(this.chart)?this.boost&&this.boost.clear&&this.boost.clear():this.boost&&this.boost.copy?this.boost.copy():this.chart.boost&&this.chart.boost.copy&&this.chart.boost.copy()}function u(t,e,i){t.lineTo(e,i)}function d(){let t,e=this.chart,s=ts(e)?e:this,o=s===e?e.seriesGroup:e.seriesGroup||this.group,n=e.chartWidth,a=e.chartHeight,l=function(t,e,i,s,r,o,n){t.call(this,i,e,s,r,o,n)},h=s.boost=s.boost||{};return t=h.targetCtx,h.canvas||(h.canvas=tn.createElement("canvas"),h.target=e.renderer.image("",0,0,n,a).addClass("highcharts-boost-canvas").add(o),t=h.targetCtx=h.canvas.getContext("2d"),e.inverted&&["moveTo","lineTo","rect","arc"].forEach(e=>{(0,r.wrap)(t,e,l)}),h.copy=function(){h.target.attr({href:h.canvas.toDataURL("image/png")})},h.clear=function(){t.clearRect(0,0,h.canvas.width,h.canvas.height),s===h.target&&h.target.attr({href:i})},h.clipRect=e.renderer.clipRect(),h.target.clip(h.clipRect)),h.canvas.width!==n&&(h.canvas.width=n),h.canvas.height!==a&&(h.canvas.height=a),h.target.attr({x:0,y:0,width:n,height:a,style:"pointer-events: none",href:i}),h.clipRect&&h.clipRect.attr(ti(e,s)),t}function c(){let t=this,s=t.options,o=t.chart,n=t.xAxis,a=t.yAxis,l=o.options.boost||{},h={timeRendering:l.timeRendering||!1,timeSeriesProcessing:l.timeSeriesProcessing||!1,timeSetup:l.timeSetup||!1},u=t.getColumn("x",!0),d=t.getColumn("y",!0),c=s.data||[],g=n.getExtremes(),p=g.min,f=g.max,b=a.getExtremes(),x=b.min,A=b.max,y={},v=!!t.sampling,P=s.marker&&s.marker.radius,T=t.cvsStrokeBatch||1e3,C=s.enableMouseTracking,M=s.threshold,E=(0,r.isNumber)(M),k=a.getThreshold(M),S=t.fill,w=t.pointArrayMap&&"low,high"===t.pointArrayMap.join(","),R=!!s.stacking,U=t.cropStart||0,N=o.options.loading,L=t.requireSorting,_=s.connectNulls,z=!u,D=R?t.data:u||c,O=t.fillOpacity?m().parse(t.color).setOpacity((0,r.pick)(s.fillOpacity,.75)).get():t.color,G="x"===s.findNearestPointBy,I=this.boost||{},B=t.cvsDrawPoint,V=s.lineWidth?t.cvsLineTo:void 0,X=P&&P<=1?t.cvsMarkerSquare:t.cvsMarkerCircle;I.target&&I.target.attr({href:i}),(t.points||t.graph)&&tr(t),t.plotGroup("group","series",t.visible?"visible":"hidden",s.zIndex,o.seriesGroup),t.markerGroup=t.group,(0,r.addEvent)(t,"destroy",function(){t.markerGroup=null});let F=this.points=[],j=this.getContext();if(t.buildKDTree=ta,I.clear&&I.clear(),!t.visible)return;c.length>99999&&(o.options.loading=(0,r.merge)(N,{labelStyle:{backgroundColor:to("var(--highcharts-background-color)").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),(0,r.internalClearTimeout)(e),o.showLoading("Drawing..."),o.options.loading=N),h.timeRendering&&console.time("canvas rendering");let H=0,Y,W,K=k,q,Z,Q,J,$,tt,ti=function(){S?(j.fillStyle=O,j.fill()):(j.strokeStyle=t.color,j.lineWidth=s.lineWidth,j.stroke())},ts=function(e,i,s,r){0===H&&(j.beginPath(),V&&(j.lineJoin="round")),o.scroller&&"highcharts-navigator-series"===t.options.className?(i+=o.scroller.top,s&&(s+=o.scroller.top)):i+=o.plotTop,e+=o.plotLeft,q?j.moveTo(e,i):B?B(j,e,i,s,W):V?V(j,e,i):X&&X.call(t,j,e,i,P,r),(H+=1)===T&&(ti(),H=0),W={clientX:e,plotY:i,yBottom:s}},tn=(this.getColumn("x").length?this.getColumn("x"):void 0)||this.options.xData||!!this.getColumn("x",!0).length&&this.getColumn("x",!0),tl=function(t,e,i){tt=G?t:t+","+e,C&&!y[tt]&&(y[tt]=!0,o.inverted&&(t=n.len-t,e=a.len-e),F.push({x:!!tn&&tn[U+i],clientX:t,plotX:t,plotY:e,i:U+i}))};te.eachAsync(D,(e,i)=>{let s=void 0===o.index,r,l,h,u,c,g,m=!1,b=!1,y=NaN,P=NaN,T=!0;return!s&&(z?(r=e[0],l=e[1],D[i+1]&&(y=D[i+1][0]),D[i-1]&&(P=D[i-1][0])):(r=e,l=d[i],D[i+1]&&(y=D[i+1]),D[i-1]&&(P=D[i-1])),y&&y>=p&&y<=f&&(m=!0),P&&P>=p&&P<=f&&(b=!0),w?(z&&(l=e.slice(1,3)),g=l[0],l=l[1]):R&&(r=e.x,g=(l=e.stackY)-e.y),c=null===l,L||(T=l>=x&&l<=A),!c&&(r>=p&&r<=f&&T||m||b)&&(h=Math.round(n.toPixels(r,!0)),v?((void 0===J||h===Y)&&(w||(g=l),(void 0===$||l>Q)&&(Q=l,$=i),(void 0===J||g<Z)&&(Z=g,J=i)),h!==Y&&(void 0!==J&&(u=a.toPixels(Q,!0),K=a.toPixels(Z,!0),ts(h,E?Math.min(u,k):u,E?Math.max(K,k):K,i),tl(h,u,$),K!==u&&tl(h,K,J)),J=$=void 0,Y=h)):(ts(h,u=Math.round(a.toPixels(l,!0)),K,i),tl(h,u,i))),q=c&&!_,i%5e4==0&&(t.boost&&t.boost.copy?t.boost.copy():t.chart.boost&&t.chart.boost.copy&&t.chart.boost.copy())),!s},function(){let i=o.loadingDiv,s=o.loadingShown;ti(),t.canvasToSVG(),h.timeRendering&&console.timeEnd("canvas rendering"),(0,r.fireEvent)(t,"renderedCanvas"),s&&(i.style.transition="opacity 250ms",i.opacity=0,o.loadingShown=!1,e=setTimeout(function(){i.parentNode&&i.parentNode.removeChild(i),o.loadingDiv=o.loadingSpan=null},250)),delete t.buildKDTree,t.buildKDTree()},o.renderer.forExport?Number.MAX_VALUE:void 0)}function g(t,e,i,s){t.moveTo(e,i),t.arc(e,i,s,0,2*Math.PI,!1)}function p(t,e,i,s){t.rect(e-s,i-s,2*s,2*s)}function f(){let t=this.chart,e=this.getContext(),i=this.chart.inverted,s=this.xAxis,r=this.yAxis;e?(this.points.forEach(o=>{let n=o.plotY;if(void 0!==n&&!isNaN(n)&&null!==o.y&&e){let{x:n=0,y:a=0,width:l=0,height:h=0}=o.shapeArgs||{};e.fillStyle=(t.styledMode?o.series.colorAttribs(o):o.series.pointAttribs(o)).fill,i?e.fillRect(r.len-a+s.left,s.len-n+r.top,-h,-l):e.fillRect(n+s.left,a+r.top,l,h)}}),this.canvasToSVG()):this.chart.showLoading("Your browser doesn't support HTML5 canvas, <br>please use a modern browser")}t.compose=function(t,e,i){let m=e.prototype;if(!m.renderCanvas){let{area:e,bubble:b,column:x,heatmap:A,scatter:y}=i;if(t.prototype.callbacks.push(t=>{(0,r.addEvent)(t,"predraw",l),(0,r.addEvent)(t,"render",a)}),m.canvasToSVG=h,m.cvsLineTo=u,m.getContext=d,m.renderCanvas=c,e){let t=e.prototype;t.cvsDrawPoint=s,t.fill=!0,t.fillOpacity=!0,t.sampling=!0}if(b){let t=b.prototype;t.cvsMarkerCircle=o,t.cvsStrokeBatch=1}if(x){let t=x.prototype;t.cvsDrawPoint=n,t.fill=!0,t.sampling=!0}if(A){let t=A.prototype;(0,r.wrap)(t,"drawPoints",f)}if(y){let t=y.prototype;t.cvsMarkerCircle=g,t.cvsMarkerSquare=p,t.fill=!0}}}}(o||(o={}));let tl=o,th=n();th.initCanvasBoost=function(){tl.compose(th.Chart,th.Series,th.seriesTypes)};let tu=n();export{tu as default};