/*
 Highcharts Gantt JS v8.0.0 (2019-12-10)

 Tree Grid

 (c) 2016-2019 Jon Arild Nygard

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