highcharts
Version:
JavaScript charting framework
1 lines • 45.7 kB
JavaScript
let t,e;import*as i from"../highcharts.js";var s,r,o,n={};n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let a=i.default;var l=n.n(a);let h=["area","areaspline","arearange","column","columnrange","bar","line","scatter","heatmap","bubble","treemap"],d={};h.forEach(t=>{d[t]=!0});let{composed:u}=l(),{addEvent:c,pick:g,pushUnique:m}=l();function p(t){let e=t.series,i=t.boost=t.boost||{},s=t.options.boost||{},r=g(s.seriesThreshold,50);if(e.length>=r)return!0;if(1===e.length)return!1;let o=s.allowForce;if(void 0===o){for(let e of(o=!0,t.xAxis))if(g(e.min,-1/0)>g(e.dataMin,-1/0)||g(e.max,1/0)<g(e.dataMax,1/0)){o=!1;break}}if(void 0!==i.forceChartBoost){if(o)return i.forceChartBoost;i.forceChartBoost=void 0}let n=0,a=0,l;for(let t of e)0!==(l=t.options).boostThreshold&&!1!==t.visible&&"heatmap"!==t.type&&(d[t.type]&&++n,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),l.data,t.points)>=(l.boostThreshold||Number.MAX_VALUE)&&++a);return i.forceChartBoost=o&&(n===e.length&&a===n||a>5),i.forceChartBoost}function f(t){function e(){t.boost&&t.boost.wgl&&p(t)&&t.boost.wgl.render(t)}c(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&&p(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)}),c(t,"load",e,{order:-1}),c(t,"redraw",e);let i=-1,s=-1;c(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 b={compose:function(t,e){return e&&m(u,"Boost.Chart")&&t.prototype.callbacks.push(f),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:p},x=i.default.Color;var A=n.n(x);let y={area:"LINES",arearange:"LINES",areaspline:"LINES",column:"LINES",columnrange:"LINES",bar:"LINES",line:"LINE_STRIP",scatter:"POINTS",heatmap:"TRIANGLES",treemap:"TRIANGLES",bubble:"POINTS"},{clamp:v,error:P,pick:T}=l(),C=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 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 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 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 checkTreshold) {\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 (checkTreshold > 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 && 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&&P("[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 r=t.options,o=Number.MAX_VALUE,n=-Number.MAX_VALUE;if(this.gl&&this.shaderProgram&&t.is("bubble")){let a=t.getPxExtremes();o=T(r.zMin,v(e,!1===r.displayNegative?r.zThreshold:-Number.MAX_VALUE,o)),n=T(r.zMax,Math.max(n,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",a.minPxSize*s),this.setUniform("bubbleMaxSize",a.maxPxSize*s),this.setUniform("bubbleZMin",o),this.setUniform("bubbleZMax",n),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)}}},S=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;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))}},{parse:M}=A(),{doc:E,win:k}=l(),{isNumber:w,isObject:R,merge:U,objectEach:L,pick:N}=l(),_={column:!0,columnrange:!0,bar:!0,area:!0,areaspline:!0,arearange:!0},D={scatter:!0,bubble:!0},z=["webgl","experimental-webgl","moz-webgl","webkit-3d"];class G{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:_[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||k.devicePixelRatio||1}setOptions(t){"pixelRatio"in t||(t.pixelRatio=1),U(!0,this.settings,t)}allocateBuffer(t){let e=this.vbuffer,i=0;this.settings.usePreallocated&&(t.series.forEach(t=>{t.boosted&&(i+=G.seriesPointCount(t))}),e&&e.allocate(i))}allocateBufferForSingleSeries(t){let e=this.vbuffer,i=0;this.settings.usePreallocated&&(t.boosted&&(i=G.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,r=this.vbuffer,o=t.pointArrayMap&&"low,high"===t.pointArrayMap.join(","),{chart:n,options:a,sorted:l,xAxis:h,yAxis:d}=t,u=!!a.stacking,c=a.data,g=t.xAxis.getExtremes(),m=g.min-(t.xAxis.minPointOffset||0),p=g.max+(t.xAxis.minPointOffset||0),f=t.yAxis.getExtremes(),b=f.min-(t.yAxis.minPointOffset||0),x=f.max+(t.yAxis.minPointOffset||0),A=(t.getColumn("x").length?t.getColumn("x"):void 0)||a.xData||t.getColumn("x",!0),y=(t.getColumn("y").length?t.getColumn("y"):void 0)||a.yData||t.getColumn("y",!0),v=(t.getColumn("z").length?t.getColumn("z"):void 0)||a.zData||t.getColumn("z",!0),P=!A||0===A.length,T=a.connectNulls,C=t.points||!1,S=u?t.data:A||c,E={x:Number.MAX_VALUE,y:0},k={x:-Number.MAX_VALUE,y:0},w=void 0===n.index,U=_[t.type],L=a.zoneAxis||"y",N=a.zones||!1,D=a.threshold,z=this.getPixelRatio(),G=t.chart.plotWidth,I=!1,B=!1,O,V,X=0,F=!1,H,Y,W,j,K=-1,Z=!1,q=!1,Q,J=!1,$=!1,tt=!1,te=!1,ti=!0,ts=!0,tr,to=!1,tn=!1,ta=0;if(a.boostData&&a.boostData.length>0)return;a.gapSize&&(tn="value"!==a.gapUnit?a.gapSize*t.closestPointRange:a.gapSize),N&&(tr=[],N.forEach((t,e)=>{if(t.color){let i=M(t.color).rgba;i[0]/=255,i[1]/=255,i[2]/=255,tr[e]=i,to||void 0!==t.value||(to=i)}}),to||(to=M(t.pointAttribs&&t.pointAttribs().fill||t.color).rgba,to[0]/=255,to[1]/=255,to[2]/=255)),n.inverted&&(G=t.chart.plotHeight),t.closestPointRangePx=Number.MAX_VALUE;let tl=t=>{t&&(e.colorData.push(t[0]),e.colorData.push(t[1]),e.colorData.push(t[2]),e.colorData.push(t[3]))},th=(t,o,n,a=1,l)=>{tl(l),1!==z&&(!s.useGPUTranslations||e.skipTranslation)&&(t*=z,o*=z,a*=z),s.usePreallocated&&r?(r.push(t,o,+!!n,a),ta+=4):(i.push(t),i.push(o),i.push(n?z:0),i.push(a))},td=()=>{e.segments.length&&(e.segments[e.segments.length-1].to=i.length||ta)},tu=()=>{(!e.segments.length||e.segments[e.segments.length-1].from!==(i.length||ta))&&(td(),e.segments.push({from:i.length||ta}))},tc=(t,e,i,s,r)=>{tl(r),th(t+i,e),tl(r),th(t,e),tl(r),th(t,e+s),tl(r),th(t,e+s),tl(r),th(t+i,e+s),tl(r),th(t+i,e)};if(tu(),C&&C.length>0){e.skipTranslation=!0,e.drawMode="TRIANGLES",C[0].node&&C[0].node.levelDynamic&&C.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}),C.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:a=0,height:l=0}=e.shapeArgs;i=(s=n.styledMode?e.series.colorAttribs(e):s=e.series.pointAttribs(e))["stroke-width"]||0,tt=M(s.fill).rgba,tt[0]/=255,tt[1]/=255,tt[2]/=255,t.is("treemap")&&(i=i||1,V=M(s.stroke).rgba,V[0]/=255,V[1]/=255,V[2]/=255,tc(r,o,a,l,V),i/=2),t.is("heatmap")&&n.inverted&&(r=h.len-r,o=d.len-o,a=-a,l=-l),tc(r+i,o+i,a-2*i,l-2*i,tt)}}),td();return}for(;K<S.length-1;){if(void 0===(W=S[++K]))continue;if(w)break;let i=c&&c[K];if(!P&&R(i,!0)&&i.color&&(tt=M(i.color).rgba,tt[0]/=255,tt[1]/=255,tt[2]/=255),P?(H=W[0],Y=W[1],S[K+1]&&(q=S[K+1][0]),S[K-1]&&(Z=S[K-1][0]),W.length>=3&&(j=W[2],W[2]>e.zMax&&(e.zMax=W[2]),W[2]<e.zMin&&(e.zMin=W[2]))):(H=W,Y=y?.[K],S[K+1]&&(q=S[K+1]),S[K-1]&&(Z=S[K-1]),v&&v.length&&(j=v[K],v[K]>e.zMax&&(e.zMax=v[K]),v[K]<e.zMin&&(e.zMin=v[K]))),!T&&(null===H||null===Y)){tu();continue}if(q&&q>=m&&q<=p&&(J=!0),Z&&Z>=m&&Z<=p&&($=!0),o?(P&&(Y=W.slice(1,3)),Q=t.getColumn("low",!0)?.[K],Y=t.getColumn("high",!0)?.[K]||0):u&&(H=W.x,Q=(Y=W.stackY)-W.y),null!=b&&null!=x&&(ti=Y>=b&&Y<=x),!l&&!ti||(H>p&&k.x<p&&(k.x=H,k.y=Y),H<m&&E.x>m&&(E.x=H,E.y=Y),null===Y&&T))continue;if(null===Y||!ti&&S.length>1&&!J&&!$){tu();continue}if((l&&(q>=m||H>=m)&&(Z<=p||H<=p)||!l&&H>=m&&H<=p)&&(te=!0),te||J||$){if(tn&&H-Z>tn&&tu(),N){let t;N.some((e,i)=>{let s=N[i-1];return"x"===L?void 0!==e.value&&H<=e.value&&(tr[i]&&(!s||H>=s.value)&&(t=tr[i]),!0):void 0!==e.value&&Y<=e.value&&(tr[i]&&(!s||Y>=s.value)&&(t=tr[i]),!0)}),tt=t||to||tt}if(s.useGPUTranslations||(e.skipTranslation=!0,H=h.toPixels(H,!0),Y=d.toPixels(Y,!0),!(H>G)||"POINTS"!==e.drawMode)){if(e.hasMarkers&&te&&!1!==I&&(t.closestPointRangePx=Math.min(t.closestPointRangePx,Math.abs(H-I))),!s.useGPUTranslations&&!s.usePreallocated&&I&&1>Math.abs(H-I)&&B&&1>Math.abs(Y-B)){s.debug.showSkipSummary&&++X;continue}U&&(O=Q||0,(!1===Q||void 0===Q)&&(O=Y<0?Y:0),(o||u)&&!d.logarithmic||(O=Math.max(null===D?b:D,b)),s.useGPUTranslations||(O=d.toPixels(O,!0)),th(H,O,0,0,tt)),a.step&&!ts&&th(H,B,0,2,tt),th(H,Y,0,"bubble"===t.type?j||1:2,tt),I=H,B=Y,F=!0,ts=!1}}}s.debug.showSkipSummary&&console.log("skipped points:",X);let tg=(t,i)=>{if(s.useGPUTranslations||(e.skipTranslation=!0,t.x=h.toPixels(t.x,!0),t.y=d.toPixels(t.y,!0)),i){this.data=[t.x,t.y,0,2].concat(this.data);return}th(t.x,t.y,0,2)};!F&&!1!==T&&"line_strip"===t.drawMode&&(E.x<Number.MAX_VALUE&&tg(E,!0),k.x>-Number.MAX_VALUE&&tg(k)),td()}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:y[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("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("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,r=this.vbuffer,o=this.getPixelRatio();if(!t)return!1;this.width=t.chartWidth*o,this.height=t.chartHeight*o;let n=this.height,a=this.width;if(!e||!s||!a||!n)return!1;i.debug.timeRendering&&console.time("gl rendering"),e.canvas.width=a,e.canvas.height=n,s.bind(),e.viewport(0,0,a,n),s.setPMatrix(G.orthoMatrix(a,n)),i.lineWidth>1&&!l().isMS&&e.lineWidth(i.lineWidth),r&&(r.build(this.data,"aVertexPosition",4),r.bind()),s.setInverted(t.inverted),this.series.forEach((n,a)=>{let l=n.series.options,h=l.marker,d=void 0!==l.lineWidth?l.lineWidth:1,u=l.threshold,c=w(u),g=n.series.yAxis.getThreshold(u),m=N(l.marker?l.marker.enabled:null,!!n.series.xAxis.isRadial||null,n.series.closestPointRangePx>2*((l.marker?l.marker.radius:10)||10)),p=this.textureHandles[h&&h.symbol||n.series.symbol]||this.textureHandles.circle,f,b,x,y=[];if(0!==n.segments.length&&n.segments[0].from!==n.segments[0].to){if(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"),x=n.series.markerGroup.getStyle("fill"),n.series.markerGroup.destroy(),n.series.markerGroup=n.series.chart.boost?.markerGroup):x=n.series.markerGroup?.getStyle("fill"):(x="POINTS"===n.drawMode&&n.series.pointAttribs&&n.series.pointAttribs().fill||n.series.color,l.colorByPoint&&(x=n.series.chart.options.colors[a])),n.series.fillOpacity&&l.fillOpacity&&(x=new(A())(x).setOpacity(N(l.fillOpacity,1)).get()),y=M(x).rgba,i.useAlpha||(y[3]=1),"add"===l.boostBlending?(e.blendFunc(e.SRC_ALPHA,e.ONE),e.blendEquation(e.FUNC_ADD)):"mult"===l.boostBlending||"multiply"===l.boostBlending?e.blendFunc(e.DST_COLOR,e.ZERO):"darken"===l.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),(b=new S(e,s)).build(Array(n.segments[0].from).concat(n.colorData),"aColor",4),b.bind()):(s.setUniform("hasColor",0),e.disableVertexAttribArray(e.getAttribLocation(s.getProgram(),"aColor"))),s.setColor(y),this.setXAxis(n.series.xAxis),this.setYAxis(n.series.yAxis),this.setThreshold(c,g),"POINTS"===n.drawMode&&s.setPointSize(2*N(l.marker&&l.marker.radius,.5)*o),s.setSkipTranslation(n.skipTranslation),"bubble"===n.series.type&&s.setBubbleUniforms(n.series,n.zMin,n.zMax,o),s.setDrawAsCircle(D[n.series.type]||!1),r){if(d>0||"LINE_STRIP"!==n.drawMode)for(f=0;f<n.segments.length;f++)r.render(n.segments[f].from,n.segments[f].to,n.drawMode);if(n.hasMarkers&&m)for(s.setPointSize(2*N(l.marker&&l.marker.radius,5)*o),s.setDrawAsCircle(!0),f=0;f<n.segments.length;f++)r.render(n.segments[f].from,n.segments[f].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(G.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<z.length&&(this.gl=t.getContext(z[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 C(s);if(!r)return!1;this.vbuffer=new S(s,r);let o=(t,e)=>{let i={isReady:!1,texture:E.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(t){}};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&&(L(this.textureHandles,e=>{e.handle&&t.deleteTexture(e.handle)}),t.canvas.width=1,t.canvas.height=1)}}(s=r||(r={})).setLength=function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},s.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}};let{setLength:I,splice:B}=r,{fireEvent:O,objectEach:V,uniqueKey:X}=l(),F=class{constructor(t={}){this.autoId=!t.id,this.columns={},this.id=t.id||X(),this.modified=this,this.rowCount=0,this.versionTag=X();let e=0;V(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,V(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=I(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;V(this.columns,(s,r)=>{this.columns[r]=B(s,t,e).array,i=s.length}),this.rowCount=i}O(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=X()}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),{})}getRow(t,e){return(e||Object.keys(this.columns)).map(e=>this.columns[e]?.[t])}setColumn(t,e=[],i=0,s){this.setColumns({[t]:e},i,s)}setColumns(t,e,i){let s=this.rowCount;V(t,(t,e)=>{this.columns[e]=t.slice(),s=t.length}),this.applyRowCount(s),i?.silent||(O(this,"afterSetColumns"),this.versionTag=X())}setRow(t,e=this.rowCount,i,s){let{columns:r}=this,o=i?this.rowCount+1:e+1;V(t,(t,n)=>{let a=r[n]||s?.addColumns!==!1&&Array(o);a&&(i?a=B(a,e,0,!0,[t]).array:a[e]=t,r[n]=a)}),o>this.rowCount&&this.applyRowCount(o),s?.silent||(O(this,"afterSetRows"),this.versionTag=X())}},{getBoostClipRect:H,isChartSeriesBoosting:Y}=b,{getOptions:W}=l(),{composed:j,doc:K,noop:Z,win:q}=l(),{addEvent:Q,destroyObjectProperties:J,error:$,extend:tt,fireEvent:te,isArray:ti,isNumber:ts,pick:tr,pushUnique:to,wrap:tn,defined:ta}=l();function tl(t,e){let i=e.boost;t&&i&&i.target&&i.canvas&&!Y(e.chart)&&t.allocateBufferForSingleSeries(e)}function th(t){return tr(t&&t.options&&t.options.boost&&t.options.boost.enabled,!0)}function td(t,i){let s=t.constructor,r=t.seriesGroup||i.group,o=t.chartWidth,n=t.chartHeight,a=t,l="undefined"!=typeof SVGForeignObjectElement,h=!1;Y(t)?a=t:(a=i,h=!!(i.options.events?.click||i.options.point?.events?.click));let d=a.boost=a.boost||{};if(l=!1,e||(e=K.createElement("canvas")),!d.target&&(d.canvas=e,t.renderer.forExport||!l?(a.renderTarget=d.target=t.renderer.image("",0,0,o,n).addClass("highcharts-boost-canvas").add(r),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(r),a.renderTarget=d.target=K.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(){o=t.chartWidth,n=t.chartHeight,(d.targetFo||d.target).attr({x:0,y:0,width:o,height:n}).css({pointerEvents:h?void 0:"none",mixedBlendMode:"normal",opacity:1}).addClass(h?"highcharts-tracker":""),a instanceof s&&a.boost?.markerGroup?.translate(t.plotLeft,t.plotTop)},d.clipRect=t.renderer.clipRect(),(d.targetFo||d.target).attr({zIndex:i.options.zIndex}),a instanceof s&&(a.boost.markerGroup=a.renderer.g().add(r).translate(i.xAxis.pos,i.yAxis.pos))),d.canvas.width=o,d.canvas.height=n,d.clipRect){let e=H(t,a),i=e.width===t.clipBox.width&&e.height===t.clipBox.height?r:d.targetFo||d.target;d.clipRect.attr(e),i?.clip(d.clipRect)}return d.resize(),d.clear(),!d.wgl&&(d.wgl=new G(t=>{t.settings.debug.timeBufferCopy&&console.time("buffer copy"),d.copy(),t.settings.debug.timeBufferCopy&&console.timeEnd("buffer copy")}),d.wgl.init(d.canvas)||$("[highcharts boost] - unable to init WebGL renderer"),d.wgl.setOptions(t.options.boost||{}),a instanceof s&&d.wgl.allocateBuffer(t)),d.wgl.setSize(o,n),d.wgl}function tu(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))J(e,void 0,!0)}function tc(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?tc(t,e,i,s,r,o):q.requestAnimationFrame?q.requestAnimationFrame(function(){tc(t,e,i,s,r)}):setTimeout(tc,0,t,e,i,s,r):i&&i())}function tg(t,e){let i=t.options,s=t.dataTable.modified.rowCount,r=t.xAxis&&t.xAxis.options,o=t.yAxis&&t.yAxis.options,n=t.colorAxis&&t.colorAxis.options;return s>(i.boostThreshold||Number.MAX_VALUE)&&ts(o.min)&&ts(o.max)&&(!e||ts(r.min)&&ts(r.max))&&(!n||ts(n.min)&&ts(n.max))}let tm=(t,e)=>!t.forceCrop&&(Y(t.chart)||(e?e.length:0)>=(t.options.boostThreshold||Number.MAX_VALUE));function tp(){let t=this,e=t.chart;e.boost&&e.boost.markerGroup===t.markerGroup&&(t.markerGroup=null),e.hoverPoints&&(e.hoverPoints=e.hoverPoints.filter(function(e){return e.series===t})),e.hoverPoint&&e.hoverPoint.series===t&&(e.hoverPoint=null)}function tf(){let t=this.boost;t&&t.canvas&&t.target&&(t.wgl&&t.wgl.clear(),t.clear&&t.clear())}function tb(t){let e=t.boost;e&&e.canvas&&e.target&&e.wgl&&!Y(t.chart)&&e.wgl.render(t.chart)}function tx(t,e){let i=t.options,s=t.xAxis,r=t.pointClass;if(e instanceof r)return e;let o=t.is("scatter"),n=(o&&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,a=t.getColumn("y",!0)||i.yData||!1,l=new r(t,o&&n&&a?[n[e.i],a[e.i]]:(ti(t.options.data)?t.options.data:[])[e.i],n?n[e.i]:void 0);return l.category=tr(s.categories?s.categories[l.x]:l.x,l.x),l.key=l.name??l.category,l.dist=e.dist,l.distX=e.distX,l.plotX=e.plotX,l.plotY=e.plotY,l.index=e.i,l.percentage=e.percentage,l.isInside=t.isPointInside(l),l}function tA(t){let{options:e,xAxis:i,yAxis:s}=this;if(!this.isDirty&&!i.isDirty&&!s.isDirty&&!t)return!1;this.yAxis.setTickInterval();let r=e.boostThreshold||0,o=e.cropThreshold,n=this.getColumn("x"),a=i.getExtremes(),l=a.max??Number.MAX_VALUE,h=a.min??-Number.MAX_VALUE,d=this.getColumn("y"),u=s.getExtremes(),c=u.max??Number.MAX_VALUE,g=u.min??-Number.MAX_VALUE;if(!this.boosted&&i.old&&s.old&&h>=(i.old.min??-Number.MAX_VALUE)&&l<=(i.old.max??Number.MAX_VALUE)&&g>=(s.old.min??-Number.MAX_VALUE)&&c<=(s.old.max??Number.MAX_VALUE))return this.dataTable.modified.setColumns({x:n,y:d}),!0;let m=this.dataTable.rowCount;if(!r||m<r||o&&!this.forceCrop&&!this.getExtremesFromAll&&!e.getExtremesFromAll&&m<o)return this.dataTable.modified.setColumns({x:n,y:d}),!0;let p=[],f=[],b=[],x=!(ts(a.max)||ts(a.min)),A=!(ts(u.max)||ts(u.min)),y=!1,v,P=n[0],T=n[0],C,S=d?.[0],M=d?.[0];for(let t=0,e=n.length;t<e;++t)v=n[t],C=d?.[t],v>=h&&v<=l&&C>=g&&C<=c?(p.push({x:v,y:C}),f.push(v),b.push(C),x&&(P=Math.max(P,v),T=Math.min(T,v)),A&&(S=Math.max(S,C),M=Math.min(M,C))):y=!0;return x&&(i.dataMax=Math.max(P,i.dataMax||0),i.dataMin=Math.min(T,i.dataMin||0)),A&&(s.dataMax=Math.max(S,s.dataMax||0),s.dataMin=Math.min(M,s.dataMin||0)),this.cropped=y,this.cropStart=0,y&&this.dataTable.modified===this.dataTable&&(this.dataTable.modified=new F),this.dataTable.modified.setColumns({x:f,y:b}),tm(this,f)||(this.processedData=p),!0}function ty(){let e=this.options||{},i=this.chart,s=i.boost,r=this.boost,o=this.xAxis,n=this.yAxis,a=e.xData||this.getColumn("x",!0),l=e.yData||this.getColumn("y",!0),h=this.getColumn("low",!0),d=this.getColumn("high",!0),u=this.processedData||e.data,c=o.getExtremes(),g=c.min-(o.minPointOffset||0),m=c.max+(o.minPointOffset||0),p=n.getExtremes(),f=p.min-(n.minPointOffset||0),b=p.max+(n.minPointOffset||0),x={},A=!!this.sampling,y=e.enableMouseTracking,v=e.threshold,P=this.pointArrayMap&&"low,high"===this.pointArrayMap.join(","),T=!!e.stacking,C=this.cropStart||0,S=this.requireSorting,M=!a,E="x"===e.findNearestPointBy,k=(this.getColumn("x").length?this.getColumn("x"):void 0)||this.options.xData||this.getColumn("x",!0),w=tr(e.lineWidth,1),R=e.nullInteraction&&f,U=!1,L,N=n.getThreshold(v),_,D,z,G;if(o.isPanning||n.isPanning||(U=td(i,this),i.boosted=!0,!this.visible))return;(this.points||this.graph)&&tu(this),Y(i)?(this.markerGroup&&this.markerGroup!==s?.markerGroup&&this.markerGroup.destroy(),this.markerGroup=s?.markerGroup,r&&r.target&&(this.renderTarget=r.target=r.target.destroy())):(this.markerGroup===s?.markerGroup&&(this.markerGroup=void 0),this.markerGroup=this.plotGroup("markerGroup","markers","visible",1,i.seriesGroup).addClass("highcharts-tracker"));let I=this.points=[],B=(e,s,r,a)=>{let l=!!k&&k[C+r],h=t=>{i.inverted&&(t=o.len-t,s=n.len-s),I.push({destroy:Z,x:l,clientX:t,plotX:t,plotY:s,i:C+r,percentage:a})};e=Math.ceil(e),t=E?e:e+","+s,y&&(x[t]?l===k[k.length-1]&&(I.length--,h(e)):(x[t]=!0,h(e)))};this.buildKDTree=Z,te(this,"renderCanvas"),this.is("line")&&w>1&&r?.target&&s&&!s.lineWidthFilter&&(s.lineWidthFilter=i.renderer.definition({tagName:"filter",children:[{tagName:"feMorphology",attributes:{operator:"dilate",radius:.25*w}}],attributes:{id:"linewidth"}}),r.target.attr({filter:"url(#linewidth)"})),U&&(tl(U,this),U.pushSeries(this),tb(this));let O=U.settings;i.renderer.forExport||(O.debug.timeKDTree&&console.time("kd tree building"),tc(T?this.data.slice(C):a||u,function(t,e){let s=void 0===i.index,r,a,u,c,p,x=!1,y=!0;return!ta(t)||(!s&&(M?(r=t[0],a=t[1]):(r=t,a=l[e]??R??null),P?(M&&(a=t.slice(1,3)),x=h[e],a=d[e]):T&&(r=t.x,x=(a=t.stackY)-t.y,p=t.percentage),S||(y=(a||0)>=f&&a<=b),null!==a&&r>=g&&r<=m&&y&&(u=o.toPixels(r,!0),A?((void 0===z||u===L)&&(P||(x=a),(void 0===G||a>D)&&(D=a,G=e),(void 0===z||x<_)&&(_=x,z=e)),E&&u===L||(void 0!==z&&(c=n.toPixels(D,!0),N=n.toPixels(_,!0),B(u,c,G,p),N!==c&&B(u,N,z,p)),z=G=void 0,L=u)):B(u,c=Math.ceil(n.toPixels(a,!0)),e,p))),!s)},()=>{te(this,"renderedCanvas"),delete this.buildKDTree,this.options&&this.buildKDTree(),O.debug.timeKDTree&&console.timeEnd("kd tree building")}))}function tv(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=td(this.chart,this);i&&(tl(i,this),i.pushSeries(this)),tb(this)}function tP(t){if(this.boosted){if(tg(this))return{};if(this.xAxis.isPanning||this.yAxis.isPanning)return this}return t.apply(this,[].slice.call(arguments,1))}function tT(t){let e=this.options.data;if(th(this.chart)&&d[this.type]){let i=this.is("scatter")&&!this.is("bubble")&&!this.is("treemap")&&!this.is("heatmap");if(!tm(this,e)||i||this.is("treemap")||this.options.stacking||!tg(this,!0)){if(this.boosted&&(this.xAxis?.isPanning||this.yAxis?.isPanning))return;i&&"treegrid"!==this.yAxis.type?tA.call(this,arguments[1]):t.apply(this,[].slice.call(arguments,1)),e=this.getColumn("x",!0)}if(this.boosted=tm(this,e),this.boosted){let t;!this.options.data?.length||ts(t=this.getFirstValidPoint(this.options.data))||ti(t)||this.is("treemap")||$(12,!1,this.chart),function(t){t.boost=t.boost||{getPoint:e=>tx(t,e)};let e=t.boost.altered=[];if(["allowDG","directTouch","stickyTracking"].forEach(i=>{e.push({prop:i,val:t[i],own:Object.hasOwnProperty.call(t,i)})}),t.allowDG=!1,t.directTouch=!1,t.stickyTracking=!0,t.finishedAnimating=!0,t.labelBySeries&&(t.labelBySeries=t.labelBySeries.destroy()),t.is("scatter")&&!t.is("treemap")&&t.data.length){for(let e of t.data)e?.destroy?.();t.data.length=0,t.points.length=0,delete t.processedData}}(this)}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 tC(t){let e=t.apply(this,[].slice.call(arguments,1));return this.boost&&e?this.boost.getPoint(e):e}let tS={compose:function(t,e,i,s){if(to(j,"Boost.Series")){let r=W().plotOptions,o=t.prototype;if(Q(t,"destroy",tp),Q(t,"hide",tf),s&&(o.renderCanvas=ty),tn(o,"getExtremes",tP),tn(o,"processData",tT),tn(o,"searchPoint",tC),["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&&th(this.chart)&&"heatmap"!==this.type&&"treemap"!==this.type&&d[this.type]&&0!==this.options.boostThreshold?"render"===i&&this.renderCanvas&&this.renderCanvas():t.call(this)}if(tn(t,i,s),"translate"===i)for(let t of["column","arearange","columnrange","heatmap","treemap"])e[t]&&tn(e[t].prototype,i,s)})(o,e,t)),tn(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))}),h.forEach(t=>{let i=r[t];i&&(i.boostThreshold=5e3,i.boostData=[],e[t].prototype.fillOpacity=!0)}),s){let{area:t,areaspline:i,bubble:s,column:r,heatmap:o,scatter:n,treemap:a}=e;if(t&&tt(t.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),i&&tt(i.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),s){let t=s.prototype;delete t.buildKDTree,tn(t,"markerAttribs",function(t){return!this.boosted&&t.apply(this,[].slice.call(arguments,1))})}r&&tt(r.prototype,{fill:!0,sampling:!0}),n&&(n.prototype.fill=!0),[o,a].forEach(t=>{t&&tn(t.prototype,"drawPoints",tv)})}}return t},destroyGraphics:tu,eachAsync:tc,getPoint:tx},{getBoostClipRect:tM,isChartSeriesBoosting:tE}=b,{destroyGraphics:tk}=tS,{parse:tw}=A(),{doc:tR,noop:tU}=l(),{addEvent:tL,fireEvent:tN,isNumber:t_,merge:tD,pick:tz,wrap:tG}=l();!function(t){let e,i,s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function r(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 h(){let t=this.boost||{};t.target&&t.target.attr({href:s}),t.canvas&&t.canvas.getContext("2d").clearRect(0,0,t.canvas.width,t.canvas.height)}function d(){tE(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 c(){let t,e=this.chart,i=tE(e)?e:this,r=i===e?e.seriesGroup:e.seriesGroup||this.group,o=e.chartWidth,n=e.chartHeight,a=function(t,e,i,s,r,o,n){t.call(this,i,e,s,r,o,n)},l=i.boost=i.boost||{};return t=l.targetCtx,l.canvas||(l.canvas=tR.createElement("canvas"),l.target=e.renderer.image("",0,0,o,n).addClass("highcharts-boost-canvas").add(r),t=l.targetCtx=l.canvas.getContext("2d"),e.inverted&&["moveTo","lineTo","rect","arc"].forEach(e=>{tG(t,e,a)}),l.copy=function(){l.target.attr({href:l.canvas.toDataURL("image/png")})},l.clear=function(){t.clearRect(0,0,l.canvas.width,l.canvas.height),i===l.target&&l.target.attr({href:s})},l.clipRect=e.renderer.clipRect(),l.target.clip(l.clipRect)),l.canvas.width!==o&&(l.canvas.width=o),l.canvas.height!==n&&(l.canvas.height=n),l.target.attr({x:0,y:0,width:o,height:n,style:"pointer-events: none",href:s}),l.clipRect&&l.clipRect.attr(tM(e,i)),t}function g(){let t=this,e=t.options,r=t.chart,o=t.xAxis,n=t.yAxis,a=r.options.boost||{},h={timeRendering:a.timeRendering||!1,timeSeriesProcessing:a.timeSeriesProcessing||!1,timeSetup:a.timeSetup||!1},d=t.getColumn("x",!0),u=t.getColumn("y",!0),c=e.data,g=o.getExtremes(),m=g.min,p=g.max,f=n.getExtremes(),b=f.min,x=f.max,y={},v=!!t.sampling,P=e.marker&&e.marker.radius,T=t.cvsStrokeBatch||1e3,C=e.enableMouseTracking,S=e.threshold,M=t_(S),E=n.getThreshold(S),k=t.fill,w=t.pointArrayMap&&"low,high"===t.pointArrayMap.join(","),R=!!e.stacking,U=t.cropStart||0,L=r.options.loading,N=t.requireSorting,_=e.connectNulls,D=!d,z=R?t.data:d||c,G=t.fillOpacity?A().parse(t.color).setOpacity(tz(e.fillOpacity,.75)).get():t.color,I="x"===e.findNearestPointBy,B=this.boost||{},O=t.cvsDrawPoint,V=e.lineWidth?t.cvsLineTo:void 0,X=P&&P<=1?t.cvsMarkerSquare:t.cvsMarkerCircle;B.target&&B.target.attr({href:s}),(t.points||t.graph)&&tk(t),t.plotGroup("group","series",t.visible?"visible":"hidden",e.zIndex,r.seriesGroup),t.markerGroup=t.group,tL(t,"destroy",function(){t.markerGroup=null});let F=this.points=[],H=this.getContext();if(t.buildKDTree=tU,B.clear&&B.clear(),!t.visible)return;c.length>99999&&(r.options.loading=tD(L,{labelStyle:{backgroundColor:tw("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),l().clearTimeout(i),r.showLoading("Drawing..."),r.options.loading=L),h.timeRendering&&console.time("canvas rendering");let Y=0,W,j,K=E,Z,q,Q,J,$,tt,te=function(){k?(H.fillStyle=G,H.fill()):(H.strokeStyle=t.color,H.lineWidth=e.lineWidth,H.stroke())},ti=function(e,i,s,o){0===Y&&(H.beginPath(),V&&(H.lineJoin="round")),r.scroller&&"highcharts-navigator-series"===t.options.className?(i+=r.scroller.top,s&&(s+=r.scroller.top)):i+=r.plotTop,e+=r.plotLeft,Z?H.moveTo(e,i):O?O(H,e,i,s,j):V?V(H,e,i):X&&X.call(t,H,e,i,P,o),(Y+=1)===T&&(te(),Y=0),j={clientX:e,plotY:i,yBottom:s}},ts=(this.getColumn("x").length?this.getColumn("x"):void 0)||this.options.xData||!!this.getColumn("x",!0).length&&this.getColumn("x",!0),tr=function(t,e,i){tt=I?t:t+","+e,C&&!y[tt]&&(y[tt]=!0,r.inverted&&(t=o.len-t,e=n.len-e),F.push({x:!!ts&&ts[U+i],clientX:t,plotX:t,plotY:e,i:U+i}))};tS.eachAsync(z,(e,i)=>{let s=void 0===r.index,a,l,h,d,c,g,f=!1,A=!1,y=NaN,P=NaN,T=!0;return!s&&(D?(a=e[0],l=e[1],z[i+1]&&(y=z[i+1][0]),z[i-1]&&(P=z[i-1][0])):(a=e,l=u[i],z[i+1]&&(y=z[i+1]),z[i-1]&&(P=z[i-1])),y&&y>=m&&y<=p&&(f=!0),P&&P>=m&&P<=p&&(A=!0),w?(D&&(l=e.slice(1,3)),g=l[0],l=l[1]):R&&(a=e.x,g=(l=e.stackY)-e.y),c=null===l,N||(T=l>=b&&l<=x),!c&&(a>=m&&a<=p&&T||f||A)&&(h=Math.round(o.toPixels(a,!0)),v?((void 0===J||h===W)&&(w||(g=l),(void 0===$||l>Q)&&(Q=l,$=i),(void 0===J||g<q)&&(q=g,J=i)),h!==W&&(void 0!==J&&(d=n.toPixels(Q,!0),K=n.toPixels(q,!0),ti(h,M?Math.min(d,E):d,M?Math.max(K,E):K,i),tr(h,d,$),K!==d&&tr(h,K,J)),J=$=void 0,W=h)):(ti(h,d=Math.round(n.toPixels(l,!0)),K,i),tr(h,d,i))),Z=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 e=r.loadingDiv,s=r.loadingShown;te(),t.canvasToSVG(),h.timeRendering&&console.timeEnd("canvas rendering"),tN(t,"renderedCanvas"),s&&(e.style.transition="opacity 250ms",e.opacity=0,r.loadingShown=!1,i=setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e),r.loadingDiv=r.loadingSpan=null},250)),delete t.buildKDTree,t.buildKDTree()},r.renderer.forExport?Number.MAX_VALUE:void 0)}function m(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,a=o.plotY;if(void 0!==a&&!isNaN(a)&&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 s=e.prototype;if(!s.renderCanvas){let{area:e,bubble:l,column:b,heatmap:x,scatter:A}=i;if(t.prototype.callbacks.push(t=>{tL(t,"predraw",h),tL(t,"render",a)}),s.canvasToSVG=d,s.cvsLineTo=u,s.getContext=c,s.renderCanvas=g,e){let t=e.prototype;t.cvsDrawPoint=r,t.fill=!0,t.fillOpacity=!0,t.sampling=!0}if(l){let t=l.prototype;t.cvsMarkerCircle=o,t.cvsStrokeBatch=1}if(b){let t=b.prototype;t.cvsDrawPoint=n,t.fill=!0,t.sampling=!0}if(x&&tG(x.prototype,"drawPoints",f),A){let t=A.prototype;t.cvsMarkerCircle=m,t.cvsMarkerSquare=p,t.fill=!0}}}}(o||(o={}));let tI=o,tB=l();tB.initCanvasBoost=function(){tI.compose(tB.Chart,tB.Series,tB.seriesTypes)};let tO=l();export{tO as default};