!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/series-label
 * @requires highcharts
 *
 * (c) 2009-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Templating):"function"==typeof define&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(t){return e(t,t.Templating)}):"object"==typeof exports?exports["highcharts/modules/series-label"]=e(t._Highcharts,t._Highcharts.Templating):t.Highcharts=e(t.Highcharts,t.Highcharts.Templating)}("u"<typeof window?this:window,(t,e)=>(()=>{"use strict";var r={944:e=>{e.exports=t},984:t=>{t.exports=e}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var a=o[t]={exports:{}};return r[t](a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};i.d(a,{default:()=>Y});var h=i(944),n=i.n(h),l=i(984),s=i.n(l);let c={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:[]};function p(t,e,r,o,i,a){let h=(a-e)*(r-t)-(o-e)*(i-t);return h>0||!(h<0)}function d(t,e,r,o,i,a,h,n){return p(t,e,i,a,h,n)!==p(r,o,i,a,h,n)&&p(t,e,r,o,i,a)!==p(t,e,r,o,h,n)}let{animObject:u}=n(),{format:f}=s(),{setOptions:x}=n(),{composed:g}=n(),{boxIntersectLine:b,intersectRect:m}={boxIntersectLine:function(t,e,r,o,i,a,h,n){return d(t,e,t+r,e,i,a,h,n)||d(t+r,e,t+r,e+o,i,a,h,n)||d(t,e+o,t+r,e+o,i,a,h,n)||d(t,e,t,e+o,i,a,h,n)},intersectRect:function(t,e){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}};function y(t,e,r,o,i){let a=t.chart,n=t.options.label||{},l=(0,h.pick)(n.onArea,!!t.area),s=l||n.connectorAllowed,c=a.boxesToAvoid,p=Number.MAX_VALUE,d=Number.MAX_VALUE,u,f,x,g,y,X,w;for(X=0;c&&X<c.length;X+=1)if(m(c[X],{left:e,right:e+o.width,top:r,bottom:r+o.height}))return!1;for(X=0;X<a.series.length;X+=1){let h=a.series[X],c=h.interpolatedPoints&&[...h.interpolatedPoints];if(h.visible&&c){let m=a.plotHeight/10;for(let t=a.plotTop;t<=a.plotTop+a.plotHeight;t+=m)c.unshift({chartX:a.plotLeft,chartY:t}),c.push({chartX:a.plotLeft+a.plotWidth,chartY:t});for(w=1;w<c.length;w+=1){if(c[w].chartX>=e-16&&c[w-1].chartX<=e+o.width+16){if(b(e,r,o.width,o.height,c[w-1].chartX,c[w-1].chartY,c[w].chartX,c[w].chartY))return!1;t===h&&!x&&i&&(x=b(e-16,r-16,o.width+32,o.height+32,c[w-1].chartX,c[w-1].chartY,c[w].chartX,c[w].chartY))}(s||x)&&(t!==h||l)&&(p=Math.min(p,(g=e+o.width/2-c[w].chartX)*g+(y=r+o.height/2-c[w].chartY)*y))}if(!l&&s&&t===h&&(i&&!x||p<Math.pow(n.connectorNeighbourDistance||1,2))){for(w=1;w<c.length;w+=1)(u=Math.min(Math.pow(e+o.width/2-c[w].chartX,2)+Math.pow(r+o.height/2-c[w].chartY,2),Math.pow(e-c[w].chartX,2)+Math.pow(r-c[w].chartY,2),Math.pow(e+o.width-c[w].chartX,2)+Math.pow(r-c[w].chartY,2),Math.pow(e+o.width-c[w].chartX,2)+Math.pow(r+o.height-c[w].chartY,2),Math.pow(e-c[w].chartX,2)+Math.pow(r+o.height-c[w].chartY,2)))<d&&(d=u,f=c[w]);x=!0}}}return(!i||!!x)&&{x:e,y:r,weight:p-(f?d:0),connectorPoint:f}}function X(t){if(this.renderer){let e=this,r=u(e.renderer.globalAnimation).duration;e.labelSeries=[],e.labelSeriesMaxSum=0,e.seriesLabelTimer&&(0,h.internalClearTimeout)(e.seriesLabelTimer),e.series.forEach(function(o){let i=o.options.label||{},a=o.labelBySeries,h=a&&a.closest,n=o.getColumn("y");i.enabled&&o.visible&&(o.graph||o.area)&&!o.boosted&&e.labelSeries&&(e.labelSeries.push(o),i.minFontSize&&i.maxFontSize&&n.length&&(o.sum=n.reduce((t,e)=>(t||0)+(e||0),0),e.labelSeriesMaxSum=Math.max(e.labelSeriesMaxSum||0,o.sum||0)),"load"===t.type&&(r=Math.max(r,u(o.options.animation).duration)),h&&(void 0!==h[0].plotX?a.animate({x:h[0].plotX+h[1],y:h[0].plotY+h[2]}):a.attr({opacity:0})))}),e.seriesLabelTimer=(0,h.syncTimeout)(function(){let t,r;e.series&&e.labelSeries&&(e.boxesToAvoid=[],t=e.labelSeries||[],r=e.boxesToAvoid,e.series.forEach(t=>(t.points||[]).forEach(e=>(e.dataLabels||[]).forEach(e=>{let{width:o,height:i}=e.getBBox(),a=(e.translateX||0)+(t.xAxis?t.xAxis.pos:t.chart.plotLeft),h=(e.translateY||0)+(t.yAxis?t.yAxis.pos:t.chart.plotTop);r.push({left:a,top:h,right:a+o,bottom:h+i})}))),t.forEach(function(t){let e=t.options.label||{};t.interpolatedPoints=function(t){let e,r,o,i,a;if(!t.xAxis&&!t.yAxis)return;let n=t.points,l=[],s=t.graph||t.area,c=s&&s.element,p=t.chart.inverted,d=t.xAxis,u=t.yAxis,f=p?u.pos:d.pos,x=p?d.pos:u.pos,g=p?d.len:u.len,b=p?u.len:d.len,m=t.options.label||{},y=(0,h.pick)(m.onArea,!!t.area),X=u.getThreshold(t.options.threshold),w={},M=p?"chartCenterX":"chartCenterY";function Y(t){let e=Math.round((t.plotX||0)/8)+","+Math.round((t.plotY||0)/8);w[e]||(w[e]=1,l.push(t))}if(t.getPointSpline&&c&&c.getPointAtLength&&!y&&n.length<(t.chart.plotSizeX||0)/16){let t=s.toD&&s.attr("d");for(s.toD&&s.attr({d:s.toD}),o=c.getTotalLength(),e=0;e<o;e+=16){let t=c.getPointAtLength(e),r=p?b-t.y:t.x,o=p?g-t.x:t.y;Y({chartX:f+r,chartY:x+o,plotX:r,plotY:o})}t&&s.attr({d:t});let r=n[n.length-1].pos();Y({chartX:f+(r?.[0]||0),chartY:x+(r?.[1]||0)})}else{let t;for(e=0,o=n.length;e<o;e+=1){let o=n[e],[l,s]=o.pos()||[],{plotHigh:c}=o;if((0,h.isNumber)(l)&&(0,h.isNumber)(s)){let e={plotX:l,plotY:s,chartX:f+l,chartY:x+s};if(y&&(c&&(e.plotY=c,e.chartY=x+c),p?e.chartCenterX=f+b-((c||o.plotY||0)+(0,h.pick)(o.yBottom,X))/2:e.chartCenterY=x+((c||s)+(0,h.pick)(o.yBottom,X))/2),t&&(r=Math.max(Math.abs(e.chartX-t.chartX),Math.abs(e.chartY-t.chartY)))>16&&r<999)for(a=1,i=Math.ceil(r/16);a<i;a+=1)Y({chartX:t.chartX+(e.chartX-t.chartX)*(a/i),chartY:t.chartY+(e.chartY-t.chartY)*(a/i),[M]:(t[M]||0)+((e[M]||0)-(t[M]||0))*(a/i),plotX:(t.plotX||0)+(l-(t.plotX||0))*(a/i),plotY:(t.plotY||0)+(s-(t.plotY||0))*(a/i)});Y(e),t=e}}}return l}(t),r.push(...e.boxesToAvoid||[])}),e.series.forEach(function(t){let r=t.options.label;if(!r||!t.xAxis&&!t.yAxis)return;let o="highcharts-color-"+(0,h.pick)(t.colorIndex,"none"),i=!t.labelBySeries,a=r.minFontSize,n=r.maxFontSize,l=e.inverted,s=l?t.yAxis.pos:t.xAxis.pos,c=l?t.xAxis.pos:t.yAxis.pos,p=e.inverted?t.yAxis.len:t.xAxis.len,d=e.inverted?t.xAxis.len:t.yAxis.len,x=t.interpolatedPoints,g=(0,h.pick)(r.onArea,!!t.area),b=[],m=t.getColumn("x"),X,w,M,Y,A,S,v=t.labelBySeries,T,L,P;function E(t,e,r){let o=Math.max(s,(0,h.pick)(L,-1/0)),i=Math.min(s+p,(0,h.pick)(P,1/0));return t>o&&t<=i-r.width&&e>=c&&e<=c+d-r.height}function B(){v&&(t.labelBySeries=v.destroy())}if(g&&!l&&(T=[t.xAxis.toPixels(m[0]),t.xAxis.toPixels(m[m.length-1])],L=Math.min.apply(Math,T),P=Math.max.apply(Math,T)),t.visible&&!t.boosted&&x){if(!v){var C,k,H;let i=t.name;if("string"==typeof r.format?i=f(r.format,t,e):r.formatter&&(i=r.formatter.call(t,t)),t.labelBySeries=v=e.renderer.label(i,0,0,"connector",0,0,r.useHTML).addClass("highcharts-series-label highcharts-series-label-"+t.index+" "+(t.options.className||"")+" "+o),!e.renderer.styledMode){let o="string"==typeof t.color?t.color:"var(--highcharts-neutral-color-60)";v.css((0,h.extend)({color:g?e.renderer.getContrast(o):o},r.style||{})),v.attr({opacity:+!!e.renderer.forExport,stroke:t.color,"stroke-width":1})}a&&n&&v.css({fontSize:(C=t,k=a,H=n,k+(C.sum||0)/(C.chart.labelSeriesMaxSum||0)*(H-k)+"px")}),v.attr({padding:0,zIndex:3}).add()}for((X=v.getBBox()).width=Math.round(X.width),A=x.length-1;A>0;A-=1)g?E(w=(x[A].chartCenterX??x[A].chartX)-X.width/2,M=(x[A].chartCenterY??x[A].chartY)-X.height/2,X)&&(S=y(t,w,M,X)):(E(w=x[A].chartX+3,M=x[A].chartY-X.height-3,X)&&(S=y(t,w,M,X,!0)),S&&b.push(S),E(w=x[A].chartX+3,M=x[A].chartY+3,X)&&(S=y(t,w,M,X,!0)),S&&b.push(S),E(w=x[A].chartX-X.width-3,M=x[A].chartY+3,X)&&(S=y(t,w,M,X,!0)),S&&b.push(S),E(w=x[A].chartX-X.width-3,M=x[A].chartY-X.height-3,X)&&(S=y(t,w,M,X,!0))),S&&b.push(S);if(r.connectorAllowed&&!b.length&&!g)for(w=s+p-X.width;w>=s;w-=16)for(M=c;M<c+d-X.height;M+=16)(Y=y(t,w,M,X,!0))&&b.push(Y);if(b.length){b.sort((t,e)=>e.weight-t.weight),S=b[0],(e.boxesToAvoid||[]).push({left:S.x,right:S.x+X.width,top:S.y,bottom:S.y+X.height});let r=Math.sqrt(Math.pow(Math.abs(S.x-(v.x||0)),2)+Math.pow(Math.abs(S.y-(v.y||0)),2));if(r&&t.labelBySeries){let o,a={opacity:+!!e.renderer.forExport,x:S.x,y:S.y},n={opacity:1};r<=10&&(n={x:a.x,y:a.y},a={}),i&&(o=u(t.options.animation),o.duration*=.2),t.labelBySeries.attr((0,h.extend)(a,{anchorX:S.connectorPoint&&(S.connectorPoint.plotX||0)+s,anchorY:S.connectorPoint&&(S.connectorPoint.plotY||0)+c})).animate(n,o),t.options.kdNow=!0,t.buildKDTree();let l=t.searchPoint({chartX:S.x,chartY:S.y},!0);l&&(v.closest=[l,S.x-(l.plotX||0),S.y-(l.plotY||0)])}}else B()}else B()}),(0,h.fireEvent)(e,"afterDrawSeriesLabels"))},e.renderer.forExport||!r?0:r)}}function w(t,e,r,o,i){let a=i&&i.anchorX,n=i&&i.anchorY,l,s,c=r/2;return(0,h.isNumber)(a)&&(0,h.isNumber)(n)&&(l=[["M",a,n]],(s=e-n)<0&&(s=-o-s),s<r&&(c=a<t+r/2?s:r-s),n>e+o?l.push(["L",t+c,e+o]):n<e?l.push(["L",t+c,e]):a<t?l.push(["L",t,e+o/2]):a>t+r&&l.push(["L",t+r,e+o/2])),l||[]}let M=n();({compose:function(t,e){(0,h.pushUnique)(g,"SeriesLabel")&&((0,h.addEvent)(t,"load",X),(0,h.addEvent)(t,"redraw",X),e.prototype.symbols.connector=w,x({plotOptions:{series:{label:c}}}))}}).compose(M.Chart,M.SVGRenderer);let Y=n();return a.default})());