/*
 Highcharts Gantt JS v9.1.0 (2021-05-03)

 GridAxis

 (c) 2016-2021 Lars A. V. Cabrera

 License: www.highcharts.com/license
*/
(function(e){"object"===typeof module&&module.exports?(e["default"]=e,module.exports=e):"function"===typeof define&&define.amd?define("highcharts/modules/grid-axis",["highcharts"],function(k){e(k);e.Highcharts=k;return e}):e("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(e){function k(e,r,k,f){e.hasOwnProperty(r)||(e[r]=f.apply(null,k))}e=e?e._modules:{};k(e,"Core/Axis/GridAxis.js",[e["Core/Axis/Axis.js"],e["Core/Globals.js"],e["Core/Axis/Tick.js"],e["Core/Utilities.js"]],function(e,
k,y,f){var h=f.addEvent,n=f.defined,r=f.erase,z=f.find,A=f.isArray,t=f.isNumber,u=f.merge,x=f.pick,B=f.timeUnits,C=f.wrap,D=k.Chart;"";e.prototype.getMaxLabelDimensions=function(c,a){var b={width:0,height:0};a.forEach(function(a){a=c[a];if(f.isObject(a,!0)){var d=f.isObject(a.label,!0)?a.label:{};a=d.getBBox?d.getBBox().height:0;d.textStr&&!t(d.textPxLength)&&(d.textPxLength=d.getBBox().width);var g=t(d.textPxLength)?Math.round(d.textPxLength):0;d.textStr&&(g=Math.round(d.getBBox().width));b.height=
Math.max(a,b.height);b.width=Math.max(g,b.width)}});return b};k.dateFormats.W=function(c){c=new this.Date(c);var a=(this.get("Day",c)+6)%7,b=new this.Date(c.valueOf());this.set("Date",b,this.get("Date",c)-a+3);a=new this.Date(this.get("FullYear",b),0,1);4!==this.get("Day",a)&&(this.set("Month",c,0),this.set("Date",c,1+(11-this.get("Day",a))%7));return(1+Math.floor((b.valueOf()-a.valueOf())/6048E5)).toString()};k.dateFormats.E=function(c){return this.dateFormat("%a",c,!0).charAt(0)};h(D,"afterSetChartSize",
function(){this.axes.forEach(function(c){(c.grid&&c.grid.columns||[]).forEach(function(a){a.setAxisSize();a.setAxisTranslation()})})});h(y,"afterGetLabelPosition",function(c){var a=this.label,b=this.axis,g=b.reversed,d=b.chart,l=b.options.grid||{},p=b.options.labels,v=p.align,m=w.Side[b.side],e=c.tickmarkOffset,f=b.tickPositions,q=this.pos-e;f=t(f[c.index+1])?f[c.index+1]-e:b.max+e;var h=b.tickSize("tick");e=h?h[0]:0;h=h?h[1]/2:0;if(!0===l.enabled){if("top"===m){l=b.top+b.offset;var k=l-e}else"bottom"===
m?(k=d.chartHeight-b.bottom+b.offset,l=k+e):(l=b.top+b.len-b.translate(g?f:q),k=b.top+b.len-b.translate(g?q:f));"right"===m?(m=d.chartWidth-b.right+b.offset,g=m+e):"left"===m?(g=b.left+b.offset,m=g-e):(m=Math.round(b.left+b.translate(g?f:q))-h,g=Math.round(b.left+b.translate(g?q:f))-h);this.slotWidth=g-m;c.pos.x="left"===v?m:"right"===v?g:m+(g-m)/2;c.pos.y=k+(l-k)/2;d=d.renderer.fontMetrics(p.style.fontSize,a.element);a=a.getBBox().height;p.useHTML?c.pos.y+=d.b+-(a/2):(a=Math.round(a/d.h),c.pos.y+=
(d.b-(d.h-d.f))/2+-((a-1)*d.h/2));c.pos.x+=b.horiz&&p.x||0}});h(y,"labelFormat",function(c){var a=c.axis,b=c.value;if(a.options.grid&&a.options.grid.enabled){var g=a.tickPositions,d=(a.linkedParent||a).series[0],l=b===g[0];g=b===g[g.length-1];var e=d&&z(d.options.data,function(c){return c[a.isXAxis?"x":"y"]===b}),v=void 0;e&&d.is("gantt")&&(v=u(e),k.seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(v));c.isFirst=l;c.isLast=g;c.point=v}});var E=function(){function c(a){this.axis=a}c.prototype.isOuterAxis=
function(){var a=this.axis,b=a.grid.columnIndex,c=a.linkedParent&&a.linkedParent.grid.columns||a.grid.columns,d=b?a.linkedParent:a,e=-1,p=0;a.chart[a.coll].forEach(function(b,c){b.side!==a.side||b.options.isInternal||(p=c,b===d&&(e=c))});return p===e&&(t(b)?c.length===b:!0)};c.prototype.renderBorder=function(a){var b=this.axis,c=b.chart.renderer,d=b.options;a=c.path(a).addClass("highcharts-axis-line").add(b.axisBorder);c.styledMode||a.attr({stroke:d.lineColor,"stroke-width":d.lineWidth,zIndex:7});
return a};return c}(),w=function(){function c(){}c.compose=function(a){e.keepProps.push("grid");C(a.prototype,"unsquish",c.wrapUnsquish);h(a,"init",c.onInit);h(a,"afterGetOffset",c.onAfterGetOffset);h(a,"afterGetTitlePosition",c.onAfterGetTitlePosition);h(a,"afterInit",c.onAfterInit);h(a,"afterRender",c.onAfterRender);h(a,"afterSetAxisTranslation",c.onAfterSetAxisTranslation);h(a,"afterSetOptions",c.onAfterSetOptions);h(a,"afterSetOptions",c.onAfterSetOptions2);h(a,"afterSetScale",c.onAfterSetScale);
h(a,"afterTickSize",c.onAfterTickSize);h(a,"trimTicks",c.onTrimTicks);h(a,"destroy",c.onDestroy)};c.onAfterGetOffset=function(){var a=this.grid;(a&&a.columns||[]).forEach(function(a){a.getOffset()})};c.onAfterGetTitlePosition=function(a){if(!0===(this.options.grid||{}).enabled){var b=this.axisTitle,g=this.height,d=this.horiz,e=this.left,p=this.offset,f=this.opposite,m=this.options,h=this.top,k=this.width,q=this.tickSize(),n=b&&b.getBBox().width,r=m.title.x,t=m.title.y,u=x(m.title.margin,d?5:10);b=
this.chart.renderer.fontMetrics(m.title.style.fontSize,b).f;q=(d?h+g:e)+(d?1:-1)*(f?-1:1)*(q?q[0]/2:0)+(this.side===c.Side.bottom?b:0);a.titlePosition.x=d?e-(n||0)/2-u+r:q+(f?k:0)+p+r;a.titlePosition.y=d?q-(f?g:0)+(f?b:-b)/2+p+t:h-u+t}};c.onAfterInit=function(){var a=this.chart,b=this.options.grid;b=void 0===b?{}:b;var c=this.userOptions;if(b.enabled){var d=this.options;d.labels.align=x(d.labels.align,"center");this.categories||(d.showLastLabel=!1);this.labelRotation=0;d.labels.rotation=0}if(b.columns){d=
this.grid.columns=[];for(var l=this.grid.columnIndex=0;++l<b.columns.length;){var f=u(c,b.columns[b.columns.length-l-1],{linkedTo:0,type:"category",scrollbar:{enabled:!1}});delete f.grid.columns;f=new e(this.chart,f);f.grid.isColumn=!0;f.grid.columnIndex=l;r(a.axes,f);r(a[this.coll],f);d.push(f)}}};c.onAfterRender=function(){var a=this.grid,b=this.options;if(!0===(b.grid||{}).enabled){this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,this.tickPositions);this.rightWall&&this.rightWall.destroy();
if(this.grid&&this.grid.isOuterAxis()&&this.axisLine&&(b=b.lineWidth)){b=this.getLinePath(b);var g=b[0],d=b[1],e=((this.tickSize("tick")||[1])[0]-1)*(this.side===c.Side.top||this.side===c.Side.left?-1:1);"M"===g[0]&&"L"===d[0]&&(this.horiz?(g[2]+=e,d[2]+=e):(g[1]+=e,d[1]+=e));!this.horiz&&this.chart.marginRight&&(g=[g,["L",this.left,g[2]]],e=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(this.max+this.tickmarkOffset)],d=[["M",d[1],this.toPixels(this.max+this.tickmarkOffset)],e],this.grid.upperBorder||
0===this.min%1||(this.grid.upperBorder=this.grid.renderBorder(g)),this.grid.upperBorder&&this.grid.upperBorder.animate({d:g}),this.grid.lowerBorder||0===this.max%1||(this.grid.lowerBorder=this.grid.renderBorder(d)),this.grid.lowerBorder&&this.grid.lowerBorder.animate({d:d}));this.grid.axisLineExtra?this.grid.axisLineExtra.animate({d:b}):this.grid.axisLineExtra=this.grid.renderBorder(b);this.axisLine[this.showAxis?"show":"hide"](!0)}(a&&a.columns||[]).forEach(function(a){a.render()});!this.horiz&&
this.chart.hasRendered&&(this.scrollbar||this.linkedParent&&this.linkedParent.scrollbar)&&(a=this.max,b=this.tickmarkOffset,d=this.tickPositions[this.tickPositions.length-1],g=this.tickPositions[0],this.min-g>b?this.ticks[g].label.hide():this.ticks[g].label.show(),d-a>b?this.ticks[d].label.hide():this.ticks[d].label.show(),d-a<b&&0<d-a&&this.ticks[d].isLast?this.ticks[d].mark.hide():this.ticks[d-1]&&this.ticks[d-1].mark.show())}};c.onAfterSetAxisTranslation=function(){var a=this.tickPositions&&this.tickPositions.info,
b=this.options,c=this.userOptions.labels||{};(b.grid||{}).enabled&&(this.horiz?(this.series.forEach(function(a){a.options.pointRange=0}),a&&b.dateTimeLabelFormats&&b.labels&&!n(c.align)&&(!1===b.dateTimeLabelFormats[a.unitName].range||1<a.count)&&(b.labels.align="left",n(c.x)||(b.labels.x=3))):"treegrid"!==this.options.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))};c.onAfterSetOptions=function(a){var b=this.options;a=a.userOptions;var c=b&&f.isObject(b.grid,!0)?b.grid:
{};if(!0===c.enabled){var d=u(!0,{className:"highcharts-grid-axis "+(a.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]]},a);
"xAxis"===this.coll&&(n(a.linkedTo)&&!n(a.tickPixelInterval)&&(d.tickPixelInterval=350),n(a.tickPixelInterval)||!n(a.linkedTo)||n(a.tickPositioner)||n(a.tickInterval)||(d.tickPositioner=function(a,b){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(c){var g=void 0,e=void 0,f=void 0,h,l=d.units;for(h=0;h<l.length;h++)if(l[h][0]===c.unitName){g=h;break}l[g+1]?(f=l[g+1][0],e=(l[g+1][1]||[1])[0]):"year"===c.unitName&&(f="year",e=10*c.count);c=B[f];this.tickInterval=
c*e;return this.getTimeTicks({unitRange:c,count:e,unitName:f},a,b,this.options.startOfWeek)}}));u(!0,this.options,d);this.horiz&&(b.minPadding=x(a.minPadding,0),b.maxPadding=x(a.maxPadding,0));t(b.grid.borderWidth)&&(b.tickWidth=b.lineWidth=c.borderWidth)}};c.onAfterSetOptions2=function(a){a=(a=a.userOptions)&&a.grid||{};var b=a.columns;a.enabled&&b&&u(!0,this.options,b[b.length-1])};c.onAfterSetScale=function(){(this.grid.columns||[]).forEach(function(a){a.setScale()})};c.onAfterTickSize=function(a){var b=
e.defaultLeftAxisOptions,c=this.horiz,d=this.maxLabelDimensions,f=this.options.grid;f=void 0===f?{}:f;f.enabled&&d&&(b=2*Math.abs(b.labels.x),c=c?f.cellHeight||b+d.height:b+d.width,A(a.tickSize)?a.tickSize[0]=c:a.tickSize=[c,0])};c.onDestroy=function(a){var b=this.grid;(b.columns||[]).forEach(function(b){b.destroy(a.keepEvents)});b.columns=void 0};c.onInit=function(a){a=a.userOptions||{};var b=a.grid||{};b.enabled&&n(b.borderColor)&&(a.tickColor=a.lineColor=b.borderColor);this.grid||(this.grid=new E(this))};
c.onTrimTicks=function(){var a=this.options,b=this.categories,c=this.tickPositions,d=c[0],e=c[c.length-1],f=this.linkedParent&&this.linkedParent.min||this.min,h=this.linkedParent&&this.linkedParent.max||this.max,k=this.tickInterval;!0!==(a.grid||{}).enabled||b||!this.horiz&&!this.isLinked||(d<f&&d+k>f&&!a.startOnTick&&(c[0]=f),e>h&&e-k<h&&!a.endOnTick&&(c[c.length-1]=h))};c.wrapUnsquish=function(a){var b=this.options.grid;return!0===(void 0===b?{}:b).enabled&&this.categories?this.tickInterval:a.apply(this,
Array.prototype.slice.call(arguments,1))};return c}();(function(c){c=c.Side||(c.Side={});c[c.top=0]="top";c[c.right=1]="right";c[c.bottom=2]="bottom";c[c.left=3]="left"})(w||(w={}));w.compose(e);return w});k(e,"masters/modules/grid-axis.src.js",[],function(){})});
//# sourceMappingURL=grid-axis.js.map