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