/*
 Highcharts Gantt JS v10.1.0 (2022-04-29)

 GridAxis

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

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