let e;/**
 * Highcharts Gantt JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/treegrid
 * @requires highcharts
 *
 * Tree Grid
 *
 * (c) 2016-2026 Highsoft AS
 * Author: Jon Arild Nygard
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as t from"../highcharts.js";var i,s,o,r={};r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n=t.default;var a=r.n(n);let l=t.default.StackItem;var d=r.n(l);let{addEvent:h,find:c,fireEvent:f,isArray:p,isNumber:u,pick:m}=a();!function(e){function t(){void 0!==this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)}function i(){Object.keys(this.options.breaks?.[0]||{}).length&&(this.options.ordinal=!1)}function s(){let e=this.brokenAxis;if(e?.hasBreaks){let t=this.tickPositions,i=this.tickPositions.info,s=[];for(let i=0;i<t.length;i++)e.isInAnyBreak(t[i])||s.push(t[i]);this.tickPositions=s,this.tickPositions.info=i}}function o(){this.brokenAxis||(this.brokenAxis=new k(this))}function r(){let{isDirty:e,options:{connectNulls:t},points:i,xAxis:s,yAxis:o}=this;if(e){let e=i.length;for(;e--;){let r=i[e],n=(null!==r.y||!1!==t)&&(s?.brokenAxis?.isInAnyBreak(r.x,!0)||o?.brokenAxis?.isInAnyBreak(r.y,!0));r.visible=!n&&!1!==r.options.visible}}}function n(){this.drawBreaks(this.xAxis,["x"]),this.drawBreaks(this.yAxis,m(this.pointArrayMap,["y"]))}function a(e,t){let i,s,o,r=this,n=r.points;if(e?.brokenAxis?.hasBreaks){let a=e.brokenAxis;t.forEach(function(t){i=a?.breakArray||[],s=e.isXAxis?e.min:m(r.options.threshold,e.min),n.forEach(function(r){o=r["stack"+t.toUpperCase()]??r[t],i.forEach(function(t){if(u(s)&&u(o)){let i="";s<t.from&&o>t.to||s>t.from&&o<t.from?i="pointBreak":(s<t.from&&o>t.from&&o<t.to||s>t.from&&o>t.to&&o<t.from)&&(i="pointInBreak"),i&&f(e,i,{point:r,brk:t})}})})})}}function l(){let e=this.currentDataGrouping,t=e?.gapSize,i=this.points.slice(),s=this.yAxis,o=this.options.gapSize,r=i.length-1;if(o&&r>0){let e,n;for("value"!==this.options.gapUnit&&(o*=this.basePointRange),t&&t>o&&t>=this.basePointRange&&(o=t);r--;)if(n&&!1!==n.visible||(n=i[r+1]),e=i[r],!1!==n.visible&&!1!==e.visible){if(n.x-e.x>o){let t=(e.x+n.x)/2;i.splice(r+1,0,{isNull:!0,x:t}),s.stacking&&this.options.stacking&&((s.stacking.stacks[this.stackKey][t]=new(d())(s,s.options.stackLabels,!1,t,this.stack??"")).total=0)}n=e}}return this.getGraphPath(i)}e.compose=function(e,d){if(!e.keepProps.includes("brokenAxis")){e.keepProps.push("brokenAxis"),h(e,"init",o),h(e,"afterInit",t),h(e,"afterSetTickPositions",s),h(e,"afterSetOptions",i);let c=d.prototype;c.drawBreaks=a,c.gappedPath=l,h(d,"afterGeneratePoints",r),h(d,"afterRender",n)}return e};class k{static isInBreak(e,t){let i=e.repeat||1/0,s=e.from,o=e.to-e.from,r=t>=s?(t-s)%i:i-(s-t)%i;return e.inclusive?r<=o:r<o&&0!==r}static lin2Val(e){let t=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!u(e))return e;let o=e;if(e>t)for(let e of s)if(e.from>o)break;else e.to<=o&&e.to>t?o+=e.len:k.isInBreak(e,o)&&(o+=e.len);else if(e<t)for(let e of s)if(e.from>t)break;else e.from>=o&&e.from<t?o-=e.len:k.isInBreak(e,o)&&(o-=e.len);return o}static val2Lin(e){let t=this.min||0,i=this.brokenAxis,s=i?.breakArray;if(!s?.length||!u(e))return e;let o=e;if(e>t){for(let i of s)if(i.to<=e&&i.to>t)o-=i.len;else if(i.from>e)break;else if(k.isInBreak(i,e)){o-=e-i.from;break}}else if(e<t){for(let i of s)if(i.from>=e&&i.from<t)o+=i.len;else if(i.from>t)break;else if(k.isInBreak(i,e)){o+=i.to-e;break}}return o}constructor(e){this.axis=e}findBreakAt(e,t){return c(t,function(t){return t.from<e&&e<t.to})}isInAnyBreak(e,t){let i=this.axis,s=i.options.breaks||[],o=s.length,r,n,a;if(o&&u(e)){for(;o--;)k.isInBreak(s[o],e)&&(r=!0,n||(n=m(s[o].showPoints,!i.isXAxis)));a=r&&t?r&&!n:r}return a}setBreaks(e,t){let i=this,s=i.axis,o=s.chart.time,r=p(e)&&!!Object.keys(e?.[0]||{}).length;s.isDirty=(i.hasBreaks??!1)!==r,i.hasBreaks=r,e?.forEach(e=>{e.from=o.parse(e.from)||0,e.to=o.parse(e.to)||0}),e!==s.options.breaks&&(s.options.breaks=s.userOptions.breaks=e),s.forceRedraw=!0,s.series.forEach(function(e){e.isDirty=!0}),r||s.val2lin!==k.val2Lin||(delete s.val2lin,delete s.lin2val),r&&(s.userOptions.ordinal=!1,s.lin2val=k.lin2Val,s.val2lin=k.val2Lin,s.setExtremes=function(e,t,o,r,n){if(i.hasBreaks&&!s.treeGrid?.tree){let s,o=this.brokenAxis.breakArray||[];for(;s=i.findBreakAt(e,o);)e=s.to;for(;s=i.findBreakAt(t,o);)t=s.from;t<e&&(t=e)}s.constructor.prototype.setExtremes.call(this,e,t,o,r,n)},s.setAxisTranslation=function(){if(s.constructor.prototype.setAxisTranslation.call(this),i.unitLength=void 0,i.hasBreaks){let e=s.options.breaks||[],t=[],o=[],r=s.pointRangePadding??0,n=0,a,l,d=s.userMin??s.min,h=s.userMax??s.max,c=s.dataMin??d,p=s.dataMax??h,m,g;u(s.threshold)&&(c=Math.min(c??s.threshold,s.threshold),p=Math.max(p??s.threshold,s.threshold)),s.treeGrid?.tree||e.forEach(function(e){l=e.repeat||1/0,u(d)&&u(h)&&(k.isInBreak(e,d)&&(d+=e.to%l-d%l),k.isInBreak(e,h)&&(h-=h%l-e.from%l))}),u(c)&&u(p)&&e.forEach(function(e){for(m=e.from,l=e.repeat||1/0;m-l>c;)m-=l;for(;m<c;)m+=l;for(g=m;g<p;g+=l)t.push({value:g,move:"in"}),t.push({value:g+e.to-e.from,move:"out",size:e.breakSize})}),t.sort(function(e,t){return e.value===t.value?("in"!==e.move)-("in"!==t.move):e.value-t.value}),a=0,m=c,t.forEach(e=>{1===(a+="in"===e.move?1:-1)&&"in"===e.move&&(m=e.value),0===a&&u(m)&&(o.push({from:m,to:e.value,len:e.value-m-(e.size||0)}),u(d)&&u(h)&&m<h&&e.value>d&&(n+=e.value-m-(e.size||0)))}),i.breakArray=o,u(d)&&u(h)&&u(s.min)&&(i.unitLength=h-d-n+r,f(s,"afterBreaks"),s.staticScale?s.transA=s.staticScale:i.unitLength&&(s.transA*=(h-s.min+r)/i.unitLength),r&&(s.minPixelPadding=s.transA*(s.minPointOffset||0)),s.min=d,s.max=h)}}),m(t,!0)&&s.chart.redraw()}}e.Additions=k}(s||(s={}));let k=s,g=t.default.Axis;var x=r.n(g);let{dateFormats:b}=a(),{addEvent:y,defined:v,erase:P,find:A,isArray:O,isNumber:G,merge:B,pick:I,timeUnits:T,wrap:E}=a();function w(e){return a().isObject(e,!0)}function M(e,t){let i={width:0,height:0};if(t.forEach(function(t){let s=e[t],o=0,r=0,n;w(s)&&(o=(n=w(s.label)?s.label:{}).getBBox?n.getBBox().height:0,n.textStr&&!G(n.textPxLength)&&(n.textPxLength=n.getBBox().width),r=G(n.textPxLength)?Math.round(n.textPxLength):0,n.textStr&&(r=Math.round(n.getBBox().width)),i.height=Math.max(o,i.height),i.width=Math.max(r,i.width))}),"treegrid"===this.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode){let e=this.treeGrid.mapOfPosToGridNode[-1].height||0;i.width+=this.options.labels.indentation*(e-1)}return i}function N(e){let{grid:t}=this,i=3===this.side;if(i||e.apply(this),!t?.isColumn){let e=t?.columns||[];i&&(e=e.slice().reverse()),e.forEach(e=>{e.getOffset()})}i&&e.apply(this)}function L(e){if(!0===(this.options.grid||{}).enabled){let{axisTitle:t,height:i,horiz:s,left:r,offset:n,opposite:a,options:l,top:d,width:h}=this,c=this.tickSize(),f=t?.getBBox().width,p=l.title.x,u=l.title.y,m=I(l.title.margin,s?5:10),k=t?this.chart.renderer.fontMetrics(t).f:0,g=(s?d+i:r)+(s?1:-1)*(a?-1:1)*(c?c[0]/2:0)+(this.side===o.bottom?k:0);e.titlePosition.x=s?r-(f||0)/2-m+p:g+(a?h:0)+n+p,e.titlePosition.y=s?g-(a?i:0)+(a?k:-k)/2+n+u:d-m+u}}function C(){let e,{chart:t,options:{grid:i={}},userOptions:s}=this;if(i.enabled&&((e=this.options).labels.align=I(e.labels.align,"center"),this.categories||(e.showLastLabel=!1),this.labelRotation=0,e.labels.rotation=0,e.minTickInterval=1),i.columns){let e=this.grid.columns=[],o=this.grid.columnIndex=0;for(;++o<i.columns.length;){let r=B(s,i.columns[o],{isInternal:!0,linkedTo:0,scrollbar:{enabled:!1}},{grid:{columns:void 0}}),n=new(x())(this.chart,r,"yAxis");n.grid.isColumn=!0,n.grid.columnIndex=o,P(t.axes,n),P(t[this.coll]||[],n),e.push(n)}}}function S(){let{axisTitle:e,grid:t,options:i}=this;if(!0===(i.grid||{}).enabled){let s=this.min||0,r=this.max||0,n=this.ticks[this.tickPositions[0]];if(e&&!this.chart.styledMode&&n?.slotWidth&&!this.options.title.style.width&&e.css({width:`${n.slotWidth}px`}),this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions),this.rightWall&&this.rightWall.destroy(),this.grid?.isOuterAxis()&&this.axisLine){let e=i.lineWidth;if(e){let t=this.getLinePath(e),n=t[0],a=t[1],l=(this.tickSize("tick")||[1])[0]*(this.side===o.top||this.side===o.left?-1:1);if("M"===n[0]&&"L"===a[0]&&(this.horiz?(n[2]+=l,a[2]+=l):(n[1]+=l,a[1]+=l)),!this.horiz&&this.chart.marginRight){let e=["L",this.left,n[2]||0],t=[n,e],o=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(r+this.tickmarkOffset)],l=[["M",a[1]||0,this.toPixels(r+this.tickmarkOffset)],o];this.grid.upperBorder||s%1==0||(this.grid.upperBorder=this.grid.renderBorder(t)),this.grid.upperBorder&&(this.grid.upperBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.upperBorder.animate({d:t})),this.grid.lowerBorder||r%1==0||(this.grid.lowerBorder=this.grid.renderBorder(l)),this.grid.lowerBorder&&(this.grid.lowerBorder.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.lowerBorder.animate({d:l}))}this.grid.axisLineExtra?(this.grid.axisLineExtra.attr({stroke:i.lineColor,"stroke-width":i.lineWidth}),this.grid.axisLineExtra.animate({d:t})):this.grid.axisLineExtra=this.grid.renderBorder(t),this.axisLine[this.showAxis?"show":"hide"]()}}if((t?.columns||[]).forEach(e=>e.render()),!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent?.scrollbar)&&this.tickPositions.length){let e,t,i=this.tickmarkOffset,o=this.tickPositions[this.tickPositions.length-1],n=this.tickPositions[0];for(;(e=this.hiddenLabels.pop())&&e.element;)e.show();for(;(t=this.hiddenMarks.pop())&&t.element;)t.show();(e=this.ticks[n].label)&&(s-n>i?this.hiddenLabels.push(e.hide()):e.show()),(e=this.ticks[o].label)&&(o-r>i?this.hiddenLabels.push(e.hide()):e.show());let a=this.ticks[o].mark;a&&o-r<i&&o-r>0&&this.ticks[o].isLast&&this.hiddenMarks.push(a.hide())}}}function z(){let e=this.tickPositions?.info,t=this.options,i=t.grid||{},s=this.userOptions.labels||{};i.enabled&&(this.horiz?(this.series.forEach(e=>{e.options.pointRange=0}),e&&t.dateTimeLabelFormats&&t.labels&&!v(s.align)&&(!1===t.dateTimeLabelFormats[e.unitName].range||e.count>1)&&(t.labels.align="left",v(s.x)||(t.labels.x=3))):"treegrid"!==this.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function W(e){let t,i=this.options,s=e.userOptions,o=i&&w(i.grid)?i.grid:{};!0===o.enabled&&(t=B(!0,{className:"highcharts-grid-axis "+(s.className||""),dateTimeLabelFormats:{hour:{list:["%[HM]","%[H]"]},day:{list:["%[AeB]","%[aeb]","%[E]"]},week:{list:["Week %W","W%W"]},month:{list:["%[B]","%[b]","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"0.9em"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0,style:{textOverflow:"ellipsis"}},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},s),"xAxis"===this.coll&&(v(s.linkedTo)&&!v(s.tickPixelInterval)&&(t.tickPixelInterval=350),!(!v(s.tickPixelInterval)&&v(s.linkedTo))||v(s.tickPositioner)||v(s.tickInterval)||v(s.units)||(t.tickPositioner=function(e,i){let s=this.linkedParent?.tickPositions?.info;if(s){let o=t.units||[],r,n=1,a="year";for(let e=0;e<o.length;e++){let t=o[e];if(t&&t[0]===s.unitName){r=e;break}}let l=G(r)&&o[r+1];if(l){a=l[0]||"year";let e=l[1];n=e?.[0]||1}else"year"===s.unitName&&(n=10*s.count);let d=T[a];return this.tickInterval=d*n,this.chart.time.getTimeTicks({unitRange:d,count:n,unitName:a},e,i,this.options.startOfWeek)}})),B(!0,this.options,t),this.horiz&&(i.minPadding=I(s.minPadding,0),i.maxPadding=I(s.maxPadding,0)),G(i.grid.borderWidth)&&(i.tickWidth=i.lineWidth=o.borderWidth))}function j(e){let t=e.userOptions,i=t?.grid||{},s=i.columns;i.enabled&&s&&B(!0,this.options,s[0])}function R(){(this.grid.columns||[]).forEach(e=>e.setScale())}function D(e){let{horiz:t,maxLabelDimensions:i,options:{grid:s={}}}=this;if(s.enabled&&i){let o=2*this.options.labels.distance,r=t?s.cellHeight||o+i.height:o+i.width;O(e.tickSize)?e.tickSize[0]=r:e.tickSize=[r,0]}}function F(){this.axes.forEach(e=>{(e.grid?.columns||[]).forEach(e=>{e.setAxisSize(),e.setAxisTranslation()})})}function V(e){let{grid:t}=this;(t.columns||[]).forEach(t=>t.destroy(e.keepEvents)),t.columns=void 0}function H(e){let t=e.userOptions||{},i=t.grid||{};i.enabled&&v(i.borderColor)&&(t.tickColor=t.lineColor=i.borderColor),this.grid||(this.grid=new $(this)),this.hiddenLabels=[],this.hiddenMarks=[]}function X(e){let t=this.label,i=this.axis,s=i.reversed,r=i.chart,n=i.options.grid||{},a=i.options.labels,l=a.align,d=o[i.side],h=e.tickmarkOffset,c=i.tickPositions,f=this.pos-h,p=G(c[e.index+1])?c[e.index+1]-h:(i.max||0)+h,u=i.tickSize("tick"),m=u?u[0]:0,k=u?u[1]/2:0;if(!0===n.enabled){let o,n,h,c;if("top"===d?n=(o=i.top+i.offset)-m:"bottom"===d?o=(n=r.chartHeight-i.bottom+i.offset)+m:(o=i.top+i.len-(i.translate(s?p:f)||0),n=i.top+i.len-(i.translate(s?f:p)||0)),"right"===d?c=(h=r.chartWidth-i.right+i.offset)+m:"left"===d?h=(c=i.left+i.offset)-m:(h=Math.round(i.left+(i.translate(s?p:f)||0))-k,c=Math.min(Math.round(i.left+(i.translate(s?f:p)||0))-k,i.left+i.len)),this.slotWidth=c-h,e.pos.x="left"===l?h:"right"===l?c:h+(c-h)/2,e.pos.y=n+(o-n)/2,t){let i=r.renderer.fontMetrics(t),s=t.getBBox().height;if(a.useHTML)e.pos.y+=i.b+-(s/2);else{let t=Math.round(s/i.h);e.pos.y+=(i.b-(i.h-i.f))/2+-((t-1)*i.h/2)}}e.pos.x+=i.horiz&&a.x||0}}function q(e){let{axis:t,value:i}=e;if(t.options.grid?.enabled){let s,o=t.tickPositions,r=(t.linkedParent||t).series[0],n=i===o[0],l=i===o[o.length-1],d=r&&A(r.options.data,function(e){return e[t.isXAxis?"x":"y"]===i});d&&r.is("gantt")&&(s=B(d),a().seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(s,t.chart)),e.isFirst=n,e.isLast=l,e.point=s}}function _(){let e=this.options,t=e.grid||{},i=this.categories,s=this.tickPositions,o=s[0],r=s[1],n=s[s.length-1],a=s[s.length-2],l=this.linkedParent?.min,d=this.linkedParent?.max,h=l||this.min,c=d||this.max,f=this.tickInterval,p=G(h)&&h>=o+f&&h<r,u=G(h)&&o<h&&o+f>h,m=G(c)&&n>c&&n-f<c,k=G(c)&&c<=n-f&&c>a;!0===t.enabled&&!i&&(this.isXAxis||this.isLinked)&&((u||p)&&!e.startOnTick&&(s[0]=h),(m||k)&&!e.endOnTick&&(s[s.length-1]=c))}function U(e){var t;let{options:{grid:i={}}}=this;return!0===i.enabled&&this.categories?this.tickInterval:e.apply(this,(t=arguments,Array.prototype.slice.call(t,1)))}(i=o||(o={}))[i.top=0]="top",i[i.right=1]="right",i[i.bottom=2]="bottom",i[i.left=3]="left";class ${constructor(e){this.axis=e}isOuterAxis(){let e=this.axis,t=e.chart,i=e.grid.columnIndex,s=e.linkedParent?.grid.columns||e.grid.columns||[],o=i?e.linkedParent:e,r=-1,n=0;return 3===e.side&&!t.inverted&&s.length?!e.linkedParent:((t[e.coll]||[]).forEach((t,i)=>{t.side!==e.side||t.options.isInternal||(n=i,t===o&&(r=i))}),n===r&&(!G(i)||s.length===i))}renderBorder(e){let t=this.axis,i=t.chart.renderer,s=t.options,o=i.path(e).addClass("highcharts-axis-line").add(t.axisGroup);return i.styledMode||o.attr({stroke:s.lineColor,"stroke-width":s.lineWidth,zIndex:7}),o}}b.E=function(e){return this.dateFormat("%a",e,!0).charAt(0)},b.W=function(e){let t=this.toParts(e),i=(t[7]+6)%7,s=t.slice(0);s[2]=t[2]-i+3;let o=this.toParts(this.makeTime(s[0],0,1));return 4!==o[7]&&(t[1]=0,t[2]=1+(11-o[7])%7),(1+Math.floor((this.makeTime(s[0],s[1],s[2])-this.makeTime(o[0],o[1],o[2]))/6048e5)).toString()};let{extend:K,isNumber:Y,pick:J}=a();function Q(e,t,i,s,o,r){let n=r&&r.after,a=r&&r.before,l={data:s,depth:i-1,id:e,level:i,parent:t||""},d=0,h=0,c,f;"function"==typeof a&&a(l,r);let p=(o[e]||[]).map(t=>{let s=Q(t.id,e,i+1,t,o,r),n=t.start||NaN,a=!0===t.milestone?n:t.end||NaN;return c=!Y(c)||n<c?n:c,f=!Y(f)||a>f?a:f,d=d+1+s.descendants,h=Math.max(s.height+1,h),s});return s&&(s.start=J(s.start,c),s.end=J(s.end,f)),K(l,{children:p,descendants:d,height:h}),"function"==typeof n&&n(l,r),l}let Z=function(e,t){let i,s;return Q("",null,1,null,(i=[],Object.keys(s=e.reduce((e,t)=>{let{parent:s="",id:o}=t;return void 0===e[s]&&(e[s]=[]),e[s].push(t),o&&i.push(o),e},{})).forEach(e=>{if(""!==e&&-1===i.indexOf(e)){let t=s[e].map(function(e){let{...t}=e;return t});s[""].push(...t),delete s[e]}}),s),t)},{addEvent:ee,correctFloat:et,removeEvent:ei,isObject:es,isNumber:eo,pick:er,wrap:en}=a();function ea(){this.treeGrid||(this.treeGrid=new eh(this))}function el(e,t,i,s,o,r,n,a,l){let d,h,c,f=er(this.options?.labels,r),p=this.pos,u=this.axis,m="treegrid"===u.type,k=e.apply(this,[t,i,s,o,f,n,a,l]);if(m){let{width:e=0,padding:t=5*!u.linkedParent}=f&&es(f.symbol,!0)?f.symbol:{},i=f&&eo(f.indentation)?f.indentation:0;d=u.treeGrid.mapOfPosToGridNode,h=d?.[p],c=h?.depth||1,k.x+=e+2*t+(c-1)*i}return k}function ed(e){let t,{pos:i,axis:s,label:o,treeGrid:r,options:n}=this,a=r?.labelIcon,l=o?.element,{treeGrid:d,options:h,chart:c,tickPositions:f}=s,p=d.mapOfPosToGridNode,u=er(n?.labels,h?.labels),m=u&&es(u.symbol,!0)?u.symbol:{},k=p?.[i],{descendants:g,depth:x}=k||{},b=k&&g&&g>0,y="treegrid"===s.type&&l,v=f.indexOf(i)>-1,P="highcharts-treegrid-node-",A=P+"level-",O=c.styledMode;if(y&&k&&o.removeClass(RegExp(A+".*")).addClass(A+x),e.apply(this,Array.prototype.slice.call(arguments,1)),y&&b){var G;let e,i,s,n,l,h,c,f,p,g,x,b;t=d.isCollapsed(k),G={color:!O&&o.styles.color||"",collapsed:t,group:o.parentGroup,options:m,renderer:o.renderer,show:v,xy:o.xy},i=!(e=this.treeGrid).labelIcon,s=G.renderer,n=G.xy,h=(l=G.options).width||0,c=l.height||0,f=l.padding??this.axis.linkedParent?0:5,p={x:n.x-h/2-f,y:n.y-c/2},g=G.collapsed?90:180,x=G.show&&eo(p.y),(b=e.labelIcon)||(e.labelIcon=b=s.path(s.symbols[l.type](l.x||0,l.y||0,h,c)).addClass("highcharts-label-icon").add(G.group)),b[x?"show":"hide"](),s.styledMode||b.attr({cursor:"pointer",fill:er(G.color,"#666666"),"stroke-width":1,stroke:l.lineColor,strokeWidth:l.lineWidth||0}),b[i?"attr":"animate"]({translateX:p.x,translateY:p.y,rotation:g}),o.addClass(P+(t?"collapsed":"expanded")).removeClass(P+(t?"expanded":"collapsed")),O||o.css({cursor:"pointer"}),[o,a].forEach(e=>{e&&!e.attachedTreeGridEvents&&(ee(e.element,"mouseover",function(){o.addClass("highcharts-treegrid-node-active"),o.renderer.styledMode||o.css({textDecoration:"underline"})}),ee(e.element,"mouseout",function(){let e;e=es(u.style)?u.style:{},o.removeClass("highcharts-treegrid-node-active"),o.renderer.styledMode||o.css({textDecoration:e.textDecoration||"none"})}),ee(e.element,"click",function(){r.toggleCollapse()}),e.attachedTreeGridEvents=!0)})}else a&&(ei(l),o?.css({cursor:"default"}),a.destroy(),r.labelIcon=void 0)}class eh{static compose(e){let t=e.prototype;t.toggleCollapse||(ee(e,"init",ea),en(t,"getLabelPosition",el),en(t,"renderLabel",ed),t.collapse=function(e){this.treeGrid.collapse(e)},t.expand=function(e){this.treeGrid.expand(e)},t.toggleCollapse=function(e){this.treeGrid.toggleCollapse(e)})}constructor(e){this.tick=e}collapse(e){let{pos:t,axis:i}=this.tick,{treeGrid:s,brokenAxis:o}=i,r=s.mapOfPosToGridNode;o&&r&&o.setBreaks(s.collapse(r[t]),e??!0)}destroy(){this.labelIcon?.destroy()}expand(e){let{pos:t,axis:i}=this.tick,{treeGrid:s,brokenAxis:o}=i,r=s.mapOfPosToGridNode;o&&r&&o.setBreaks(s.expand(r[t]),e??!0)}toggleCollapse(e=!0){let{axis:t,pos:i}=this.tick,{brokenAxis:s,treeGrid:o}=t;if(s&&o.mapOfPosToGridNode){let r=!!(t.scrollbar&&t.staticScale),n=t.pos+t.len+(o.pendingSizeAdjustment||0);if(o.pendingSizeAdjustment=0,s.setBreaks(o.toggleCollapse(o.mapOfPosToGridNode[i]),r&&e),r){let e=t.toValue(t.toPixels(t.dataMax)),i=t.toValue(n)-t.tickmarkOffset,s=t.userMin??t.min;if(o.adjustedMax=e!==t.dataMax?e-t.tickmarkOffset:void 0,i>t.dataMax){let e=n-t.toPixels(t.dataMax+t.tickmarkOffset);i=o.adjustedMax??t.dataMax,(s=t.toValue(t.toPixels(s-t.tickmarkOffset)-e)+t.tickmarkOffset)<t.dataMin&&(e=t.toPixels(t.dataMin)-t.toPixels(s),s=t.dataMin,o.pendingSizeAdjustment=e)}t.setExtremes(et(s),et(i),!1,!1,{trigger:"toggleCollapse"})}e&&t.chart.redraw()}}}let ec=t.default.Color;var ef=r.n(ec);let{extend:ep,isArray:eu,isNumber:em,isObject:ek,merge:eg,pick:ex,relativeLength:eb}=a(),{getLevelOptions:ey}={getColor:function(e,t){let i,s,o,r,n,a,l=t.index,d=t.mapOptionsToLevel,h=t.parentColor,c=t.parentColorIndex,f=t.series,p=t.colors,u=t.siblings,m=f.points,k=f.chart.options.chart;if(e){let g;i=m[e.i],s=d[e.level]||{},i&&s.colorByPoint&&(r=i.index%(p?p.length:k.colorCount),o=p&&p[r]),f.chart.styledMode||(n=ex(i&&i.options.color,s&&s.color,o,h&&((g=s&&s.colorVariation)&&"brightness"===g.key&&l&&u?ef().parse(h).brighten(g.to*(l/u)).get():h),f.color)),a=ex(i&&i.options.colorIndex,s&&s.colorIndex,r,c,t.colorIndex)}return{color:n,colorIndex:a}},getLevelOptions:function(e){let t,i,s,o,r,n,a={};if(ek(e))for(o=em(e.from)?e.from:1,n=e.levels,i={},t=ek(e.defaults)?e.defaults:{},eu(n)&&(i=n.reduce((e,i)=>{let s,r,n;return ek(i)&&em(i.level)&&(r=ex((n=eg({},i)).levelIsConstant,t.levelIsConstant),delete n.levelIsConstant,delete n.level,ek(e[s=i.level+(r?0:o-1)])?eg(!0,e[s],n):e[s]=n),e},{})),r=em(e.to)?e.to:1,s=0;s<=r;s++)a[s]=eg({},t,ek(i[s])?i[s]:{});return a},getNodeWidth:function(e,t){let{chart:i,options:s}=e,{nodeDistance:o=0,nodeWidth:r=0}=s,{plotSizeX:n=1}=i;if("auto"===r){if("string"==typeof o&&/%$/.test(o))return n/(t+parseFloat(o)/100*(t-1));let e=Number(o);return(n+e)/(t||1)-e}return eb(r,n)},setTreeValues:function e(t,i){let s=i.before,o=i.idRoot,r=i.mapIdToNode[o],n=!1!==i.levelIsConstant,a=i.points[t.i],l=a&&a.options||{},d=[],h=0;t.levelDynamic=t.level-(n?0:r.level),t.name=ex(a&&a.name,""),t.visible=o===t.id||!0===i.visible,"function"==typeof s&&(t=s(t,i)),t.children.forEach((s,o)=>{let r=ep({},i);ep(r,{index:o,siblings:t.children.length,visible:t.visible}),s=e(s,r),d.push(s),s.visible&&(h+=s.val)});let c=ex(l.value,h);return t.visible=c>=0&&(h>0||t.visible),t.children=d,t.childrenTotal=h,t.isLeaf=t.visible&&!h,t.val=c,t},updateRootId:function(e){let t,i;return ek(e)&&(i=ek(e.options)?e.options:{},t=ex(e.rootNode,i.rootId,""),ek(e.userOptions)&&(e.userOptions.rootId=t),e.rootNode=t),t}},{addEvent:ev,isArray:eP,splat:eA,find:eO,fireEvent:eG,isObject:eB,isString:eI,merge:eT,removeEvent:eE,wrap:ew}=a();function eM(e){return{from:e.collapseStart||0,to:e.collapseEnd||0,showPoints:!1}}function eN(e,t,i){var s;let o,r=[],n=[],a={},l=t||!1,d={},h=-1,c=Z(e,{after:function(e){let t=d[e.pos],i=0,s=0;t.children.forEach(function(e){s+=(e.descendants||0)+1,i=Math.max((e.height||0)+1,i)}),t.descendants=s,t.height=i,t.collapsed&&n.push(t)},before:function(e){let t,i,s=eB(e.data,!0)?e.data:{},o=eI(s.name)?s.name:"",n=a[e.parent],c=eB(n,!0)?d[n.pos]:null;l&&eB(c,!0)&&(t=eO(c.children,function(e){return e.name===o}))?(i=t.pos,t.nodes.push(e)):i=h++,!d[i]&&(d[i]=t={depth:c?c.depth+1:0,name:o,id:s.id,nodes:[e],children:[],pos:i},-1!==i&&r.push(o),eB(c,!0)&&c.children.push(t)),eI(e.id)&&(a[e.id]=e),t&&!0===s.collapsed&&(t.collapsed=!0),e.pos=i}});return s=d,{categories:r,mapOfIdToNode:a,mapOfPosToGridNode:d=(o=function(e,t,s){let r=e.nodes,n=t+(-1===t?0:i-1),a=(n-t)/2,l=t+a;return r.forEach(function(e){let i=e.data;eB(i,!0)&&(i.y=t+(i.seriesIndex||0),delete i.seriesIndex),e.pos=l}),s[l]=e,e.pos=l,e.tickmarkOffset=a+.5,e.collapseStart=n+.5,e.children.forEach(function(e){o(e,n+1,s),n=(e.collapseEnd||0)-.5}),e.collapseEnd=n+.5,s})(s["-1"],-1,{}),collapsedNodes:n,tree:c}}function eL(e){let t=e.target;t.axes.filter(e=>"treegrid"===e.type).forEach(function(i){let s=i.options,o=s.labels,r=i.uniqueNames,n=t.time.parse(s.max),a=!i.treeGrid.mapOfPosToGridNode||i.series.some(function(e){return!e.hasRendered||e.isDirtyData||e.isDirty}),l=0,d,h;if(a){let s=[];if(d=i.series.reduce(function(e,i){let o=i.options.data||[],n=o[0],a=Array.isArray(n)&&!n.find(e=>"object"==typeof e);return s.push(a),i.visible&&(o.forEach(function(s){(a||i.options.keys?.length)&&(s=i.pointClass.prototype.optionsToObject.call({series:i},s),i.pointClass.setGanttPointAliases(s,t)),eB(s,!0)&&(s.seriesIndex=l,e.push(s))}),!0===r&&l++),e},[]),n&&d.length<n)for(let e=d.length;e<=n;e++)d.push({name:e+"​"});i.categories=(h=eN(d,r||!1,!0===r?l:1)).categories,i.treeGrid.mapOfPosToGridNode=h.mapOfPosToGridNode,i.hasNames=!0,i.treeGrid.tree=h.tree,i.series.forEach(function(e,t){let i=(e.options.data||[]).map(function(i){return(s[t]||eP(i)&&e.options.keys?.length)&&d.forEach(function(e){let t=eA(i);t.indexOf(e.x||0)>=0&&t.indexOf(e.x2||0)>=0&&(i=e)}),eB(i,!0)?eT(i):i});e.visible&&e.setData(i,!1)}),i.treeGrid.mapOptionsToLevel=ey({defaults:o,from:1,levels:o?.levels,to:i.treeGrid.tree?.height}),"beforeRender"===e.type&&(i.treeGrid.collapsedNodes=h.collapsedNodes)}})}function eC(t,i){let s=this.treeGrid.mapOptionsToLevel||{},o="treegrid"===this.type,r=this.ticks,n=r[i],a,l,d;o&&this.treeGrid.mapOfPosToGridNode?((a=s[(d=this.treeGrid.mapOfPosToGridNode[i]).depth])&&(l={labels:a}),!n&&e?r[i]=n=new e(this,i,void 0,void 0,{category:d.name,tickmarkOffset:d.tickmarkOffset,options:l}):(n.parameters.category=d.name,n.options=l,n.addLabel())):t.apply(this,Array.prototype.slice.call(arguments,1))}function eS(e,t,i,s){let o=this,r="treegrid"===i.type;o.treeGrid||(o.treeGrid=new ej(o)),r&&(ev(t,"beforeRender",eL),ev(t,"beforeRedraw",eL),ev(t,"addSeries",function(e){if(e.options.data){let t=eN(e.options.data,i.uniqueNames||!1,1);o.treeGrid.collapsedNodes=(o.treeGrid.collapsedNodes||[]).concat(t.collapsedNodes)}}),ev(o,"foundExtremes",function(){o.treeGrid.collapsedNodes?.forEach(function(e){let t=o.treeGrid.collapse(e);o.brokenAxis&&(o.brokenAxis.setBreaks(t,!1),o.treeGrid.collapsedNodes&&(o.treeGrid.collapsedNodes=o.treeGrid.collapsedNodes.filter(t=>e.collapseStart!==t.collapseStart||e.collapseEnd!==t.collapseEnd)))})}),ev(o,"afterBreaks",function(){"yAxis"===o.coll&&!o.staticScale&&o.chart.options.chart.height&&(o.isDirty=!0)}),i=eT({grid:{enabled:!0},labels:{align:"left",levels:[{level:void 0},{level:1,style:{fontWeight:"bold"}}],symbol:{type:"triangle",x:-5,y:-5,height:10,width:10}},uniqueNames:!1},i,{reversed:!0})),e.apply(o,[t,i,s]),r&&(o.hasNames=!0,o.options.showLastLabel=!0)}function ez(e){let t=this.options,i=this.chart.time,s="number"==typeof t.linkedTo?this.chart[this.coll]?.[t.linkedTo]:void 0;if("treegrid"===this.type){if(this.min=this.userMin??i.parse(t.min)??this.dataMin,this.max=this.userMax??i.parse(t.max)??this.dataMax,eG(this,"foundExtremes"),this.setAxisTranslation(),this.tickInterval=1,this.tickmarkOffset=.5,this.tickPositions=this.treeGrid.mapOfPosToGridNode?this.treeGrid.getTickPositions():[],s){let e=s.getExtremes();this.min=e.min??e.dataMin,this.max=e.max??e.dataMax,this.tickPositions=s.tickPositions}this.linkedParent=s}else e.apply(this,Array.prototype.slice.call(arguments,1))}function eW(e){let t=this;"treegrid"===this.type&&t.visible&&t.tickPositions.forEach(function(e){let i=t.ticks[e];i.label?.attachedTreeGridEvents&&(eE(i.label.element),i.label.attachedTreeGridEvents=!1)}),e.apply(t,Array.prototype.slice.call(arguments,1))}class ej{static compose(t,i,s,o){var r,n,a;if(!t.keepProps.includes("treeGrid")){let i=t.prototype;t.keepProps.push("treeGrid"),ew(i,"generateTick",eC),ew(i,"init",eS),ew(i,"setTickInterval",ez),ew(i,"redraw",eW),i.utils={getNode:Q},e||(e=o)}return r=t,n=i,a=o,r.keepProps.includes("grid")||(r.keepProps.push("grid"),r.prototype.getMaxLabelDimensions=M,E(r.prototype,"unsquish",U),E(r.prototype,"getOffset",N),y(r,"init",H),y(r,"afterGetTitlePosition",L),y(r,"afterInit",C),y(r,"afterRender",S),y(r,"afterSetAxisTranslation",z),y(r,"afterSetOptions",W),y(r,"afterSetOptions",j),y(r,"afterSetScale",R),y(r,"afterTickSize",D),y(r,"trimTicks",_),y(r,"destroy",V),y(n,"afterSetChartSize",F),y(a,"afterGetLabelPosition",X),y(a,"labelFormat",q)),k.compose(t,s),eh.compose(o),t}constructor(e){this.pendingSizeAdjustment=0,this.axis=e}setCollapsedStatus(e){let t=this.axis,i=t.chart;t.series.forEach(function(t){let s=t.options.data;if(e.id&&s){let o=i.get(e.id),r=s[t.data.indexOf(o)];o&&r&&(o.collapsed=e.collapsed,r.collapsed=e.collapsed)}})}collapse(e){let t=this.axis,i=t.options.breaks||[],s=eM(e);return i.push(s),e.collapsed=!0,t.treeGrid.setCollapsedStatus(e),i}expand(e){let t=this.axis,i=eM(e);return e.collapsed=!1,t.treeGrid.setCollapsedStatus(e),t.options.breaks?.reduce(function(e,t){return(t.to!==i.to||t.from!==i.from)&&e.push(t),e},[])||[]}getTickPositions(){let e=this.axis,t=Math.floor(e.min/e.tickInterval)*e.tickInterval,i=Math.ceil(e.max/e.tickInterval)*e.tickInterval;return Object.keys(e.treeGrid.mapOfPosToGridNode||{}).reduce(function(s,o){let r=+o;return r>=t&&r<=i&&!e.brokenAxis?.isInAnyBreak(r)&&s.push(r),s},[])}isCollapsed(e){let t=this.axis.options.breaks||[],i=eM(e);return t.some(function(e){return e.from===i.from&&e.to===i.to})}toggleCollapse(e){return this.isCollapsed(e)?this.expand(e):this.collapse(e)}}let eR=a();ej.compose(eR.Axis,eR.Chart,eR.Series,eR.Tick);let eD=a();export{eD as default};