/** * Highcharts JS v11.2.0 (2023-10-30) * * (c) 2009-2021 Torstein Honsi * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function o(t,e,o,r){t.hasOwnProperty(e)||(t[e]=r.apply(null,o),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}o(e,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]}}),o(e,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function t(t,e,o,r,i,a){let n=(a-e)*(o-t)-(r-e)*(i-t);return n>0||!(n<0)}function e(e,o,r,i,a,n,s,h){return t(e,o,a,n,s,h)!==t(r,i,a,n,s,h)&&t(e,o,r,i,a,n)!==t(e,o,r,i,s,h)}return{boxIntersectLine:function(t,o,r,i,a,n,s,h){return e(t,o,t+r,o,a,n,s,h)||e(t+r,o,t+r,o+i,a,n,s,h)||e(t,o+i,t+r,o+i,a,n,s,h)||e(t,o,t,o+i,a,n,s,h)},intersectRect:function(t,e){return!(e.left>t.right||e.rightt.bottom||e.bottom=e-16&&p[M-1].chartX<=e+r.width+16){if(c(e,o,r.width,r.height,p[M-1].chartX,p[M-1].chartY,p[M].chartX,p[M].chartY))return!1;t===l&&!m&&i&&(m=c(e-16,o-16,r.width+32,r.height+32,p[M-1].chartX,p[M-1].chartY,p[M].chartX,p[M].chartY))}(h||m)&&(t!==l||s)&&(u=Math.min(u,(g=e+r.width/2-p[M].chartX)*g+(y=o+r.height/2-p[M].chartY)*y))}if(!s&&h&&t===l&&(i&&!m||u(t||0)+(e||0),0),e.labelSeriesMaxSum=Math.max(e.labelSeriesMaxSum||0,r.sum||0)),"load"===t.type&&(o=Math.max(o,s(r.options.animation).duration)),n&&(void 0!==n[0].plotX?a.animate({x:n[0].plotX+n[1],y:n[0].plotY+n[2]}):a.attr({opacity:0})))}),e.seriesLabelTimer=m(function(){e.series&&e.labelSeries&&function(t){t.boxesToAvoid=[];let e=t.labelSeries||[],o=t.boxesToAvoid;t.series.forEach(t=>(t.points||[]).forEach(e=>(e.dataLabels||[]).forEach(e=>{let{width:r,height:i}=e.getBBox(),a=(e.translateX||0)+(t.xAxis?t.xAxis.pos:t.chart.plotLeft),n=(e.translateY||0)+(t.yAxis?t.yAxis.pos:t.chart.plotTop);o.push({left:a,top:n,right:a+r,bottom:n+i})}))),e.forEach(function(t){let e=t.options.label||{};t.interpolatedPoints=function(t){let e,o,r,i,a;if(!t.xAxis&&!t.yAxis)return;let n=t.points,s=[],h=t.graph||t.area,l=h&&h.element,c=t.chart.inverted,p=t.xAxis,u=t.yAxis,d=c?u.pos:p.pos,f=c?p.pos:u.pos,m=t.options.label||{},g=b(m.onArea,!!t.area),y=u.getThreshold(t.options.threshold),X={};function M(t){let e=Math.round((t.plotX||0)/8)+","+Math.round((t.plotY||0)/8);X[e]||(X[e]=1,s.push(t))}if(t.getPointSpline&&l&&l.getPointAtLength&&!g&&n.length<(t.chart.plotSizeX||0)/16){let t=h.toD&&h.attr("d");for(h.toD&&h.attr({d:h.toD}),r=l.getTotalLength(),e=0;e16)for(a=1,i=Math.ceil(o/16);ar&&t<=i-o.width&&e>=p&&e<=p+f-o.height}function j(){v&&(e.labelBySeries=v.destroy())}if(m&&!l&&(E=[e.xAxis.toPixels(X[0]),e.xAxis.toPixels(X[X.length-1])],C=Math.min.apply(Math,E),T=Math.max.apply(Math,E)),e.visible&&!e.boosted&&x){if(!v){let i=e.name;if("string"==typeof o.format?i=h(o.format,e,t):o.formatter&&(i=o.formatter.call(e)),e.labelBySeries=v=t.renderer.label(i,0,0,"connector",0,0,o.useHTML).addClass("highcharts-series-label highcharts-series-label-"+e.index+" "+(e.options.className||"")+" "+r),!t.renderer.styledMode){let r="string"==typeof e.color?e.color:"#666666";v.css(d({color:m?t.renderer.getContrast(r):r},o.style||{})),v.attr({opacity:t.renderer.forExport?1:0,stroke:e.color,"stroke-width":1})}a&&n&&v.css({fontSize:a+(e.sum||0)/(e.chart.labelSeriesMaxSum||0)*(n-a)+"px"}),v.attr({padding:0,zIndex:3}).add()}for((M=v.getBBox()).width=Math.round(M.width),A=x.length-1;A>0;A-=1)m?P(S=x[A].chartX-M.width/2,Y=(x[A].chartCenterY||0)-M.height/2,M)&&(L=y(e,S,Y,M)):(P(S=x[A].chartX+3,Y=x[A].chartY-M.height-3,M)&&(L=y(e,S,Y,M,!0)),L&&g.push(L),P(S=x[A].chartX+3,Y=x[A].chartY+3,M)&&(L=y(e,S,Y,M,!0)),L&&g.push(L),P(S=x[A].chartX-M.width-3,Y=x[A].chartY+3,M)&&(L=y(e,S,Y,M,!0)),L&&g.push(L),P(S=x[A].chartX-M.width-3,Y=x[A].chartY-M.height-3,M)&&(L=y(e,S,Y,M,!0))),L&&g.push(L);if(o.connectorAllowed&&!g.length&&!m)for(S=c+u-M.width;S>=c;S-=16)for(Y=p;Ye.weight-t.weight),L=g[0],(t.boxesToAvoid||[]).push({left:L.x,right:L.x+M.width,top:L.y,bottom:L.y+M.height});let o=Math.sqrt(Math.pow(Math.abs(L.x-(v.x||0)),2)+Math.pow(Math.abs(L.y-(v.y||0)),2));if(o&&e.labelBySeries){let r,a={opacity:t.renderer.forExport?1:0,x:L.x,y:L.y},n={opacity:1};o<=10&&(n={x:a.x,y:a.y},a={}),i&&(r=s(e.options.animation),r.duration*=.2),e.labelBySeries.attr(d(a,{anchorX:L.connectorPoint&&(L.connectorPoint.plotX||0)+c,anchorY:L.connectorPoint&&(L.connectorPoint.plotY||0)+p})).animate(n,r),e.options.kdNow=!0,e.buildKDTree();let h=e.searchPoint({chartX:L.x,chartY:L.y},!0);h&&(v.closest=[h,L.x-(h.plotX||0),L.y-(h.plotY||0)])}}else j()}else j()}),f(t,"afterDrawSeriesLabels")}(e)},e.renderer.forExport||!o?0:o)}}function M(t,e,o,r,i){let a=i&&i.anchorX,n=i&&i.anchorY,s,h,l=o/2;return x(a)&&x(n)&&(s=[["M",a,n]],(h=e-n)<0&&(h=-r-h),he+r?s.push(["L",t+l,e+r]):nt+o&&s.push(["L",t+o,e+r/2])),s||[]}return{compose:function(t,o){n.pushUnique(g,t)&&(u(e,"load",X),u(e,"redraw",X)),n.pushUnique(g,o)&&(o.prototype.symbols.connector=M),n.pushUnique(g,l)&&l({plotOptions:{series:{label:i}}})}}}),o(e,"masters/modules/series-label.src.js",[e["Core/Globals.js"],e["Extensions/SeriesLabel/SeriesLabel.js"]],function(t,e){e.compose(t.Chart,t.SVGRenderer)})});//# sourceMappingURL=series-label.js.map