/*
 Highcharts Gantt JS v8.0.4 (2020-03-10)

 Tree Grid

 (c) 2016-2019 Jon Arild Nygard

 License: www.highcharts.com/license
*/
(function(f){"object"===typeof module&&module.exports?(f["default"]=f,module.exports=f):"function"===typeof define&&define.amd?define("highcharts/modules/treegrid",["highcharts"],function(C){f(C);f.Highcharts=C;return f}):f("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(f){function C(f,v,q,x){f.hasOwnProperty(v)||(f[v]=x.apply(null,q))}f=f?f._modules:{};C(f,"mixins/tree-series.js",[f["parts/Color.js"],f["parts/Utilities.js"]],function(f,v){var q=v.extend,x=v.isArray,m=v.isNumber,w=
v.isObject,F=v.merge,A=v.pick;return{getColor:function(h,a){var d=a.index,g=a.mapOptionsToLevel,n=a.parentColor,y=a.parentColorIndex,c=a.series,k=a.colors,e=a.siblings,l=c.points,B=c.chart.options.chart,D;if(h){l=l[h.i];h=g[h.level]||{};if(g=l&&h.colorByPoint){var b=l.index%(k?k.length:B.colorCount);var z=k&&k[b]}if(!c.chart.styledMode){k=l&&l.options.color;B=h&&h.color;if(D=n)D=(D=h&&h.colorVariation)&&"brightness"===D.key?f.parse(n).brighten(d/e*D.to).get():n;D=A(k,B,z,D,c.color)}var r=A(l&&l.options.colorIndex,
h&&h.colorIndex,b,y,a.colorIndex)}return{color:D,colorIndex:r}},getLevelOptions:function(h){var a=null;if(w(h)){a={};var d=m(h.from)?h.from:1;var g=h.levels;var n={};var y=w(h.defaults)?h.defaults:{};x(g)&&(n=g.reduce(function(c,a){if(w(a)&&m(a.level)){var e=F({},a);var l="boolean"===typeof e.levelIsConstant?e.levelIsConstant:y.levelIsConstant;delete e.levelIsConstant;delete e.level;a=a.level+(l?0:d-1);w(c[a])?q(c[a],e):c[a]=e}return c},{}));g=m(h.to)?h.to:1;for(h=0;h<=g;h++)a[h]=F({},y,w(n[h])?n[h]:
{})}return a},setTreeValues:function g(a,d){var n=d.before,y=d.idRoot,c=d.mapIdToNode[y],k=d.points[a.i],e=k&&k.options||{},l=0,B=[];q(a,{levelDynamic:a.level-(("boolean"===typeof d.levelIsConstant?d.levelIsConstant:1)?0:c.level),name:A(k&&k.name,""),visible:y===a.id||("boolean"===typeof d.visible?d.visible:!1)});"function"===typeof n&&(a=n(a,d));a.children.forEach(function(c,b){var z=q({},d);q(z,{index:b,siblings:a.children.length,visible:a.visible});c=g(c,z);B.push(c);c.visible&&(l+=c.val)});a.visible=
0<l||a.visible;n=A(e.value,l);q(a,{children:B,childrenTotal:l,isLeaf:a.visible&&!l,val:n});return a},updateRootId:function(a){if(w(a)){var d=w(a.options)?a.options:{};d=A(a.rootNode,d.rootId,"");w(a.userOptions)&&(a.userOptions.rootId=d);a.rootNode=d}return d}}});C(f,"parts-gantt/Tree.js",[f["parts/Utilities.js"]],function(f){var v=f.extend,q=f.isNumber,x=f.pick,m=function(f,q){var h=f.reduce(function(a,d){var g=x(d.parent,"");"undefined"===typeof a[g]&&(a[g]=[]);a[g].push(d);return a},{});Object.keys(h).forEach(function(a,
d){var g=h[a];""!==a&&-1===q.indexOf(a)&&(g.forEach(function(a){d[""].push(a)}),delete d[a])});return h},w=function(f,m,h,a,d,g){var n=0,y=0,c=g&&g.after,k=g&&g.before;m={data:a,depth:h-1,id:f,level:h,parent:m};var e,l;"function"===typeof k&&k(m,g);k=(d[f]||[]).map(function(c){var a=w(c.id,f,h+1,c,d,g),b=c.start;c=!0===c.milestone?b:c.end;e=!q(e)||b<e?b:e;l=!q(l)||c>l?c:l;n=n+1+a.descendants;y=Math.max(a.height+1,y);return a});a&&(a.start=x(a.start,e),a.end=x(a.end,l));v(m,{children:k,descendants:n,
height:y});"function"===typeof c&&c(m,g);return m};return{getListOfParents:m,getNode:w,getTree:function(f,q){var h=f.map(function(a){return a.id});f=m(f,h);return w("",null,1,null,f,q)}}});C(f,"parts-gantt/GridAxis.js",[f["parts/Globals.js"],f["parts/Tick.js"],f["parts/Utilities.js"]],function(f,v,q){var x=q.addEvent,m=q.defined,w=q.erase,F=q.find,A=q.isArray,h=q.isNumber,a=q.merge,d=q.pick,g=q.timeUnits,n=q.wrap,y=f.dateFormat,c=function(b){return q.isObject(b,!0)},k=f.Chart,e=f.Axis,l=function(b){var c=
b.options;c.labels||(c.labels={});c.labels.align=d(c.labels.align,"center");b.categories||(c.showLastLabel=!1);b.labelRotation=0;c.labels.rotation=0},B={top:0,right:1,bottom:2,left:3,0:"top",1:"right",2:"bottom",3:"left"};e.prototype.isOuterAxis=function(){var b=this,c=b.columnIndex,r=b.linkedParent&&b.linkedParent.columns||b.columns,a=c?b.linkedParent:b,d=-1,e=0;b.chart[b.coll].forEach(function(c,p){c.side!==b.side||c.options.isInternal||(e=p,c===a&&(d=p))});return e===d&&(h(c)?r.length===c:!0)};
e.prototype.getMaxLabelDimensions=function(b,z){var r={width:0,height:0};z.forEach(function(z){z=b[z];if(c(z)){var a=c(z.label)?z.label:{};z=a.getBBox?a.getBBox().height:0;a.textStr&&!h(a.textPxLength)&&(a.textPxLength=a.getBBox().width);a=h(a.textPxLength)?Math.round(a.textPxLength):0;r.height=Math.max(z,r.height);r.width=Math.max(a,r.width)}});return r};f.dateFormats.W=function(b){b=new this.Date(b);var c=(this.get("Day",b)+6)%7,a=new this.Date(b.valueOf());this.set("Date",a,this.get("Date",b)-
c+3);c=new this.Date(this.get("FullYear",a),0,1);4!==this.get("Day",c)&&(this.set("Month",b,0),this.set("Date",b,1+(11-this.get("Day",c))%7));return(1+Math.floor((a.valueOf()-c.valueOf())/6048E5)).toString()};f.dateFormats.E=function(b){return y("%a",b,!0).charAt(0)};x(v,"afterGetLabelPosition",function(b){var a=this.label,r=this.axis,d=r.reversed,e=r.chart,l=r.options,u=l&&c(l.grid)?l.grid:{};l=r.options.labels;var p=l.align,t=B[r.side],E=b.tickmarkOffset,g=r.tickPositions,n=this.pos-E;g=h(g[b.index+
1])?g[b.index+1]-E:r.max+E;var f=r.tickSize("tick",!0);E=A(f)?f[0]:0;f=f&&f[1]/2;if(!0===u.enabled){if("top"===t){u=r.top+r.offset;var k=u-E}else"bottom"===t?(k=e.chartHeight-r.bottom+r.offset,u=k+E):(u=r.top+r.len-r.translate(d?g:n),k=r.top+r.len-r.translate(d?n:g));"right"===t?(t=e.chartWidth-r.right+r.offset,d=t+E):"left"===t?(d=r.left+r.offset,t=d-E):(t=Math.round(r.left+r.translate(d?g:n))-f,d=Math.round(r.left+r.translate(d?n:g))-f);this.slotWidth=d-t;b.pos.x="left"===p?t:"right"===p?d:t+(d-
t)/2;b.pos.y=k+(u-k)/2;e=e.renderer.fontMetrics(l.style.fontSize,a.element);a=a.getBBox().height;l.useHTML?b.pos.y+=e.b+-(a/2):(a=Math.round(a/e.h),b.pos.y+=(e.b-(e.h-e.f))/2+-((a-1)*e.h/2));b.pos.x+=r.horiz&&l.x||0}});x(e,"afterTickSize",function(b){var c=this.defaultLeftAxisOptions,a=this.horiz,d=this.options.grid;d=void 0===d?{}:d;var e=this.maxLabelDimensions;d.enabled&&(c=2*Math.abs(c.labels.x),a=a?d.cellHeight||c+e.height:c+e.width,A(b.tickSize)?b.tickSize[0]=a:b.tickSize=[a])});x(e,"afterGetTitlePosition",
function(b){var a=this.options;if(!0===(a&&c(a.grid)?a.grid:{}).enabled){var e=this.axisTitle,l=e&&e.getBBox().width,g=this.horiz,f=this.left,u=this.top,p=this.width,t=this.height,n=a.title;a=this.opposite;var k=this.offset,h=this.tickSize()||[0],y=n.x||0,m=n.y||0,q=d(n.margin,g?5:10);e=this.chart.renderer.fontMetrics(n.style&&n.style.fontSize,e).f;h=(g?u+t:f)+h[0]/2*(a?-1:1)*(g?1:-1)+(this.side===B.bottom?e:0);b.titlePosition.x=g?f-l/2-q+y:h+(a?p:0)+k+y;b.titlePosition.y=g?h-(a?t:0)+(a?e:-e)/2+k+
m:u-q+m}});n(e.prototype,"unsquish",function(b){var a=this.options;return!0===(a&&c(a.grid)?a.grid:{}).enabled&&this.categories?this.tickInterval:b.apply(this,Array.prototype.slice.call(arguments,1))});x(e,"afterSetOptions",function(b){var e=this.options;b=b.userOptions;var l=e&&c(e.grid)?e.grid:{};if(!0===l.enabled){var n=a(!0,{className:"highcharts-grid-axis "+(b.className||""),dateTimeLabelFormats:{hour:{list:["%H:%M","%H"]},day:{list:["%A, %e. %B","%a, %e. %b","%E"]},week:{list:["Week %W","W%W"]},
month:{list:["%B","%b","%o"]}},grid:{borderWidth:1},labels:{padding:2,style:{fontSize:"13px"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},b);"xAxis"===this.coll&&(m(b.linkedTo)&&!m(b.tickPixelInterval)&&(n.tickPixelInterval=350),m(b.tickPixelInterval)||!m(b.linkedTo)||m(b.tickPositioner)||m(b.tickInterval)||(n.tickPositioner=function(b,c){var a=this.linkedParent&&
this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(a){var p,t=n.units;for(p=0;p<t.length;p++)if(t[p][0]===a.unitName){var e=p;break}if(t[e+1]){var d=t[e+1][0];var l=(t[e+1][1]||[1])[0]}else"year"===a.unitName&&(d="year",l=10*a.count);a=g[d];this.tickInterval=a*l;return this.getTimeTicks({unitRange:a,count:l,unitName:d},b,c,this.options.startOfWeek)}}));a(!0,this.options,n);this.horiz&&(e.minPadding=d(b.minPadding,0),e.maxPadding=d(b.maxPadding,0));h(e.grid.borderWidth)&&(e.tickWidth=
e.lineWidth=l.borderWidth)}});x(e,"afterSetAxisTranslation",function(){var b=this.options,a=b&&c(b.grid)?b.grid:{},e=this.tickPositions&&this.tickPositions.info,d=this.userOptions.labels||{};this.horiz&&(!0===a.enabled&&this.series.forEach(function(b){b.options.pointRange=0}),e&&(!1===b.dateTimeLabelFormats[e.unitName].range||1<e.count)&&!m(d.align)&&(b.labels.align="left",m(d.x)||(b.labels.x=3)))});x(e,"trimTicks",function(){var b=this.options,a=b&&c(b.grid)?b.grid:{},e=this.categories,d=this.tickPositions,
l=d[0],n=d[d.length-1],u=this.linkedParent&&this.linkedParent.min||this.min,p=this.linkedParent&&this.linkedParent.max||this.max,t=this.tickInterval;!0!==a.enabled||e||!this.horiz&&!this.isLinked||(l<u&&l+t>u&&!b.startOnTick&&(d[0]=u),n>p&&n-t<p&&!b.endOnTick&&(d[d.length-1]=p))});x(e,"afterRender",function(){var b=this.options,a=b&&c(b.grid)?b.grid:{},e=this.chart.renderer;if(!0===a.enabled){this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions);this.rightWall&&this.rightWall.destroy();
if(this.isOuterAxis()&&this.axisLine){var d=b.lineWidth;if(d){var l=this.getLinePath(d);var n=l.indexOf("M")+1;var u=l.indexOf("L")+1;a=l.indexOf("M")+2;var p=l.indexOf("L")+2;var t=(this.tickSize("tick")[0]-1)*(this.side===B.top||this.side===B.left?-1:1);this.horiz?(l[a]+=t,l[p]+=t):(l[n]+=t,l[u]+=t);this.axisLineExtra?this.axisLineExtra.animate({d:l}):(this.axisLineExtra=e.path(l).attr({zIndex:7}).addClass("highcharts-axis-line").add(this.axisGroup),e.styledMode||this.axisLineExtra.attr({stroke:b.lineColor,
"stroke-width":d}));this.axisLine[this.showAxis?"show":"hide"](!0)}}(this.columns||[]).forEach(function(b){b.render()})}});var D={afterGetOffset:function(){(this.columns||[]).forEach(function(b){b.getOffset()})},afterInit:function(){var b=this.chart,d=this.userOptions,g=this.options;g=g&&c(g.grid)?g.grid:{};g.enabled&&(l(this),n(this,"labelFormatter",function(b){var a=this.axis,c=a.tickPositions,d=this.value,e=(a.isLinked?a.linkedParent:a).series[0],l=d===c[0];c=d===c[c.length-1];e=e&&F(e.options.data,
function(b){return b[a.isXAxis?"x":"y"]===d});this.isFirst=l;this.isLast=c;this.point=e;return b.call(this)}));if(g.columns)for(var f=this.columns=[],k=this.columnIndex=0;++k<g.columns.length;){var h=a(d,g.columns[g.columns.length-k-1],{linkedTo:0,type:"category"});delete h.grid.columns;h=new e(this.chart,h,!0);h.isColumn=!0;h.columnIndex=k;w(b.axes,h);w(b[this.coll],h);f.push(h)}},afterSetOptions:function(b){b=(b=b.userOptions)&&c(b.grid)?b.grid:{};var d=b.columns;b.enabled&&d&&a(!0,this.options,
d[d.length-1])},afterSetScale:function(){(this.columns||[]).forEach(function(b){b.setScale()})},destroy:function(b){(this.columns||[]).forEach(function(a){a.destroy(b.keepEvents)})},init:function(b){var a=(b=b.userOptions)&&c(b.grid)?b.grid:{};a.enabled&&m(a.borderColor)&&(b.tickColor=b.lineColor=a.borderColor)}};Object.keys(D).forEach(function(b){x(e,b,D[b])});x(k,"afterSetChartSize",function(){this.axes.forEach(function(b){(b.columns||[]).forEach(function(b){b.setAxisSize();b.setAxisTranslation()})})})});
C(f,"modules/broken-axis.btx.js",[f["parts/Globals.js"],f["parts/Utilities.js"]],function(f,v){var q=v.addEvent,x=v.extend,m=v.find,w=v.fireEvent,C=v.isArray,A=v.pick,h=f.Axis;v=f.Series;var a=function(a,g){return m(g,function(d){return d.from<a&&a<d.to})};x(h.prototype,{isInBreak:function(a,g){var d=a.repeat||Infinity,f=a.from,c=a.to-a.from;g=g>=f?(g-f)%d:d-(f-g)%d;return a.inclusive?g<=c:g<c&&0!==g},isInAnyBreak:function(a,g){var d=this.options.breaks,f=d&&d.length,c;if(f){for(;f--;)if(this.isInBreak(d[f],
a)){var k=!0;c||(c=A(d[f].showPoints,!this.isXAxis))}var e=k&&g?k&&!c:k}return e}});q(h,"afterInit",function(){"function"===typeof this.setBreaks&&this.setBreaks(this.options.breaks,!1)});q(h,"afterSetTickPositions",function(){if(this.isBroken){var a=this.tickPositions,f=this.tickPositions.info,n=[],h;for(h=0;h<a.length;h++)this.isInAnyBreak(a[h])||n.push(a[h]);this.tickPositions=n;this.tickPositions.info=f}});q(h,"afterSetOptions",function(){this.isBroken&&(this.options.ordinal=!1)});h.prototype.setBreaks=
function(d,f){function g(a){var d=a,e;for(e=0;e<c.breakArray.length;e++){var f=c.breakArray[e];if(f.to<=a)d-=f.len;else if(f.from>=a)break;else if(c.isInBreak(f,a)){d-=a-f.from;break}}return d}function m(a){var d;for(d=0;d<c.breakArray.length;d++){var e=c.breakArray[d];if(e.from>=a)break;else e.to<a?a+=e.len:c.isInBreak(e,a)&&(a+=e.len)}return a}var c=this,k=C(d)&&!!d.length;c.isDirty=c.isBroken!==k;c.isBroken=k;c.options.breaks=c.userOptions.breaks=d;c.forceRedraw=!0;c.series.forEach(function(a){a.isDirty=
!0});k||c.val2lin!==g||(delete c.val2lin,delete c.lin2val);k&&(c.userOptions.ordinal=!1,c.val2lin=g,c.lin2val=m,c.setExtremes=function(c,d,f,g,b){if(this.isBroken){for(var e,l=this.options.breaks;e=a(c,l);)c=e.to;for(;e=a(d,l);)d=e.from;d<c&&(d=c)}h.prototype.setExtremes.call(this,c,d,f,g,b)},c.setAxisTranslation=function(a){h.prototype.setAxisTranslation.call(this,a);this.unitLength=null;if(this.isBroken){a=c.options.breaks;var d=[],e=[],f=0,b,g=c.userMin||c.min,k=c.userMax||c.max,n=A(c.pointRangePadding,
0),m;a.forEach(function(a){b=a.repeat||Infinity;c.isInBreak(a,g)&&(g+=a.to%b-g%b);c.isInBreak(a,k)&&(k-=k%b-a.from%b)});a.forEach(function(a){u=a.from;for(b=a.repeat||Infinity;u-b>g;)u-=b;for(;u<g;)u+=b;for(m=u;m<k;m+=b)d.push({value:m,move:"in"}),d.push({value:m+(a.to-a.from),move:"out",size:a.breakSize})});d.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});var q=0;var u=g;d.forEach(function(a){q+="in"===a.move?1:-1;1===q&&"in"===a.move&&(u=a.value);
0===q&&(e.push({from:u,to:a.value,len:a.value-u-(a.size||0)}),f+=a.value-u-(a.size||0))});c.breakArray=e;c.unitLength=k-g-f+n;w(c,"afterBreaks");c.staticScale?c.transA=c.staticScale:c.unitLength&&(c.transA*=(k-c.min+n)/c.unitLength);n&&(c.minPixelPadding=c.transA*c.minPointOffset);c.min=g;c.max=k}});A(f,!0)&&this.chart.redraw()};q(v,"afterGeneratePoints",function(){var a=this.options.connectNulls,f=this.points,h=this.xAxis,m=this.yAxis;if(this.isDirty)for(var c=f.length;c--;){var k=f[c],e=!(null===
k.y&&!1===a)&&(h&&h.isInAnyBreak(k.x,!0)||m&&m.isInAnyBreak(k.y,!0));k.visible=e?!1:!1!==k.options.visible}});q(v,"afterRender",function(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,A(this.pointArrayMap,["y"]))});f.Series.prototype.drawBreaks=function(a,f){var d=this,g=d.points,c,k,e,l;a&&f.forEach(function(f){c=a.breakArray||[];k=a.isXAxis?a.min:A(d.options.threshold,a.min);g.forEach(function(d){l=A(d["stack"+f.toUpperCase()],d[f]);c.forEach(function(b){e=!1;if(k<b.from&&l>b.to||
k>b.from&&l<b.from)e="pointBreak";else if(k<b.from&&l>b.from&&l<b.to||k>b.from&&l>b.to&&l<b.from)e="pointInBreak";e&&w(a,e,{point:d,brk:b})})})})};f.Series.prototype.gappedPath=function(){var a=this.currentDataGrouping,g=a&&a.gapSize;a=this.options.gapSize;var h=this.points.slice(),m=h.length-1,c=this.yAxis,k;if(a&&0<m)for("value"!==this.options.gapUnit&&(a*=this.basePointRange),g&&g>a&&g>=this.basePointRange&&(a=g),k=void 0;m--;)k&&!1!==k.visible||(k=h[m+1]),g=h[m],!1!==k.visible&&!1!==g.visible&&
(k.x-g.x>a&&(k=(g.x+k.x)/2,h.splice(m+1,0,{isNull:!0,x:k}),this.options.stacking&&(k=c.stacks[this.stackKey][k]=new f.StackItem(c,c.options.stackLabels,!1,k,this.stack),k.total=0)),k=g);return this.getGraphPath(h)}});C(f,"parts-gantt/TreeGrid.js",[f["parts/Globals.js"],f["mixins/tree-series.js"],f["parts/Tick.js"],f["parts-gantt/Tree.js"],f["parts/Utilities.js"]],function(f,v,q,x,m){var w=m.addEvent,C=m.defined,A=m.fireEvent,h=m.extend,a=m.isNumber,d=m.isString,g=m.merge,n=m.pick,y=m.wrap,c=function(a){return Array.prototype.slice.call(a,
1)},k=m.find,e=v.getLevelOptions,l=function(a){return m.isObject(a,!0)};f=f.Axis;v=function(a,b){var c;for(c in b)if(Object.hasOwnProperty.call(b,c)){var d=b[c];y(a,c,d)}};var B=function(a,b){var c=a.collapseStart;a=a.collapseEnd;a>=b&&(c-=.5);return{from:c,to:a,showPoints:!1}},D=function(a){return Object.keys(a.mapOfPosToGridNode).reduce(function(b,c){c=+c;a.min<=c&&a.max>=c&&!a.isInAnyBreak(c)&&b.push(c);return b},[])},b=function(a,b){var c=a.options.breaks||[],d=B(b,a.max);return c.some(function(a){return a.from===
d.from&&a.to===d.to})},z=function(a,b){var c=a.options.breaks||[];a=B(b,a.max);c.push(a);return c},r=function(a,b){var c=a.options.breaks||[],d=B(b,a.max);return c.reduce(function(a,b){b.to===d.to&&b.from===d.from||a.push(b);return a},[])},F=function(b,c){var d=b.labelIcon,f=!d,e=c.renderer,g=c.xy,p=c.options,l=p.width,h=p.height,k=g.x-l/2-p.padding;g=g.y-h/2;var m=c.collapsed?90:180,u=c.show&&a(g);f&&(b.labelIcon=d=e.path(e.symbols[p.type](p.x,p.y,l,h)).addClass("highcharts-label-icon").add(c.group));
u||d.attr({y:-9999});e.styledMode||d.attr({"stroke-width":1,fill:n(c.color,"#666666")}).css({cursor:"pointer",stroke:p.lineColor,strokeWidth:p.lineWidth});d[f?"attr":"animate"]({translateX:k,translateY:g,rotation:m})},H=function(a,b,c){var f=[],e=[],g={},p={},h=-1,t="boolean"===typeof b?b:!1;a=x.getTree(a,{after:function(a){a=p[a.pos];var b=0,c=0;a.children.forEach(function(a){c+=a.descendants+1;b=Math.max(a.height+1,b)});a.descendants=c;a.height=b;a.collapsed&&e.push(a)},before:function(a){var b=
l(a.data)?a.data:{},c=d(b.name)?b.name:"",e=g[a.parent];e=l(e)?p[e.pos]:null;var m=function(a){return a.name===c},n;t&&l(e)&&(n=k(e.children,m))?(m=n.pos,n.nodes.push(a)):m=h++;p[m]||(p[m]=n={depth:e?e.depth+1:0,name:c,nodes:[a],children:[],pos:m},-1!==m&&f.push(c),l(e)&&e.children.push(n));d(a.id)&&(g[a.id]=a);!0===b.collapsed&&(n.collapsed=!0);a.pos=m}});p=function(a,b){var c=function(a,d,e){var f=d+(-1===d?0:b-1),p=(f-d)/2,g=d+p;a.nodes.forEach(function(a){var b=a.data;l(b)&&(b.y=d+b.seriesIndex,
delete b.seriesIndex);a.pos=g});e[g]=a;a.pos=g;a.tickmarkOffset=p+.5;a.collapseStart=f+.5;a.children.forEach(function(a){c(a,f+1,e);f=a.collapseEnd-.5});a.collapseEnd=f+.5;return e};return c(a["-1"],-1,{})}(p,c);return{categories:f,mapOfIdToNode:g,mapOfPosToGridNode:p,collapsedNodes:e,tree:a}},G=function(a){a.target.axes.filter(function(a){return"treegrid"===a.options.type}).forEach(function(b){var c=b.options||{},d=c.labels,f,p=c.uniqueNames,h=0;if(!b.mapOfPosToGridNode||b.series.some(function(a){return!a.hasRendered||
a.isDirtyData||a.isDirty})){c=b.series.reduce(function(a,b){b.visible&&(b.options.data.forEach(function(b){l(b)&&(b.seriesIndex=h,a.push(b))}),!0===p&&h++);return a},[]);var k=H(c,p,!0===p?h:1);b.categories=k.categories;b.mapOfPosToGridNode=k.mapOfPosToGridNode;b.hasNames=!0;b.tree=k.tree;b.series.forEach(function(a){var b=a.options.data.map(function(a){return l(a)?g(a):a});a.visible&&a.setData(b,!1)});b.mapOptionsToLevel=e({defaults:d,from:1,levels:d.levels,to:b.tree.height});"beforeRender"===a.type&&
(f=w(b,"foundExtremes",function(){k.collapsedNodes.forEach(function(a){a=z(b,a);b.setBreaks(a,!1)});f()}))}})};v(f.prototype,{init:function(a,b,c){var d="treegrid"===c.type;d&&(w(b,"beforeRender",G),w(b,"beforeRedraw",G),c=g({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,padding:5}},uniqueNames:!1},c,{reversed:!0,grid:{columns:void 0}}));a.apply(this,[b,c]);d&&(this.hasNames=!0,this.options.showLastLabel=
!0)},getMaxLabelDimensions:function(b){var d=this.options,e=d&&d.labels;d=e&&a(e.indentation)?d.labels.indentation:0;e=b.apply(this,c(arguments));if("treegrid"===this.options.type&&this.mapOfPosToGridNode){var f=this.mapOfPosToGridNode[-1].height;e.width+=d*(f-1)}return e},generateTick:function(a,b){var d=l(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},e=this.ticks,f=e[b],g;if("treegrid"===this.options.type){var h=this.mapOfPosToGridNode[b];(d=d[h.depth])&&(g={labels:d});f?(f.parameters.category=
h.name,f.options=g,f.addLabel()):e[b]=new q(this,b,null,void 0,{category:h.name,tickmarkOffset:h.tickmarkOffset,options:g})}else a.apply(this,c(arguments))},setTickInterval:function(a){var b=this.options;"treegrid"===b.type?(this.min=n(this.userMin,b.min,this.dataMin),this.max=n(this.userMax,b.max,this.dataMax),A(this,"foundExtremes"),this.setAxisTranslation(!0),this.tickmarkOffset=.5,this.tickInterval=1,this.tickPositions=this.mapOfPosToGridNode?D(this):[]):a.apply(this,c(arguments))}});v(q.prototype,
{getLabelPosition:function(b,c,d,e,f,g,h,k,m){var p=n(this.options&&this.options.labels,g);g=this.pos;var t=this.axis,q="treegrid"===t.options.type;b=b.apply(this,[c,d,e,f,p,h,k,m]);q&&(c=p&&l(p.symbol)?p.symbol:{},p=p&&a(p.indentation)?p.indentation:0,g=(g=(t=t.mapOfPosToGridNode)&&t[g])&&g.depth||1,b.x+=c.width+2*c.padding+(g-1)*p);return b},renderLabel:function(a){var d=this,e=d.pos,f=d.axis,g=d.label,h=f.mapOfPosToGridNode,k=f.options,m=n(d.options&&d.options.labels,k&&k.labels),q=m&&l(m.symbol)?
m.symbol:{},r=(h=h&&h[e])&&h.depth;k="treegrid"===k.type;var u=!(!g||!g.element),v=-1<f.tickPositions.indexOf(e);e=f.chart.styledMode;k&&h&&u&&g.addClass("highcharts-treegrid-node-level-"+r);a.apply(d,c(arguments));k&&h&&u&&0<h.descendants&&(f=b(f,h),F(d,{color:!e&&g.styles.color,collapsed:f,group:g.parentGroup,options:q,renderer:g.renderer,show:v,xy:g.xy}),q="highcharts-treegrid-node-"+(f?"expanded":"collapsed"),g.addClass("highcharts-treegrid-node-"+(f?"collapsed":"expanded")).removeClass(q),e||
g.css({cursor:"pointer"}),[g,d.labelIcon].forEach(function(a){a.attachedTreeGridEvents||(w(a.element,"mouseover",function(){g.addClass("highcharts-treegrid-node-active");g.renderer.styledMode||g.css({textDecoration:"underline"})}),w(a.element,"mouseout",function(){var a=C(m.style)?m.style:{};g.removeClass("highcharts-treegrid-node-active");g.renderer.styledMode||g.css({textDecoration:a.textDecoration})}),w(a.element,"click",function(){d.toggleCollapse()}),a.attachedTreeGridEvents=!0)}))}});h(q.prototype,
{collapse:function(a){var b=this.axis,c=z(b,b.mapOfPosToGridNode[this.pos]);b.setBreaks(c,n(a,!0))},expand:function(a){var b=this.axis,c=r(b,b.mapOfPosToGridNode[this.pos]);b.setBreaks(c,n(a,!0))},toggleCollapse:function(a){var c=this.axis;var d=c.mapOfPosToGridNode[this.pos];d=b(c,d)?r(c,d):z(c,d);c.setBreaks(d,n(a,!0))}});f.prototype.utils={getNode:x.getNode}});C(f,"masters/modules/treegrid.btx.js",[],function(){})});
//# sourceMappingURL=treegrid.js.map