/* Highcharts JS v7.0.3 (2019-02-06) Tree Grid (c) 2016-2019 Jon Arild Nygard License: www.highcharts.com/license */ (function(y){"object"===typeof module&&module.exports?(y["default"]=y,module.exports=y):"function"===typeof define&&define.amd?define(function(){return y}):y("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(y){(function(b){var p=b.addEvent,t=b.dateFormat,m=b.defined,v=b.isArray,w=b.isNumber,q=function(c){return b.isObject(c,!0)},n=b.merge,k=b.pick,d=b.wrap,e=b.Axis,l=b.Tick,h={top:0,right:1,bottom:2,left:3,0:"top",1:"right",2:"bottom",3:"left"};e.prototype.isNavigatorAxis=function(){return/highcharts-navigator-[xy]axis/.test(this.options.className)}; e.prototype.isOuterAxis=function(){var c=this,a=-1,f=!0;c.chart.axes.forEach(function(g,h){g.side!==c.side||g.isNavigatorAxis()||(g===c?a=h:0<=a&&h>a&&(f=!1))});return f};e.prototype.getMaxLabelDimensions=function(c,a){var f={width:0,height:0};a.forEach(function(a){a=c[a];var g;q(a)&&(g=q(a.label)?a.label:{},a=g.getBBox?g.getBBox().height:0,g=w(g.textPxLength)?g.textPxLength:0,f.height=Math.max(a,f.height),f.width=Math.max(g,f.width))});return f};b.dateFormats={W:function(c){c=new Date(c);var a;c.setHours(0, 0,0,0);c.setDate(c.getDate()-(c.getDay()||7));a=new Date(c.getFullYear(),0,1);return Math.ceil(((c-a)/864E5+1)/7)},E:function(c){return t("%a",c,!0).charAt(0)}};p(l,"afterGetLabelPosition",function(c){var a=this.label,f=this.axis,g=f.reversed,d=f.chart,k=f.options,e=k&&q(k.grid)?k.grid:{},k=f.options.labels,l=k.align,b=h[f.side],n=c.tickmarkOffset,z=f.tickPositions,u=this.pos-n,z=w(z[c.index+1])?z[c.index+1]-n:f.max+n,A=f.tickSize("tick",!0),n=v(A)?A[0]:0,A=A&&A[1]/2,r;!0===e.enabled&&("top"===b? (e=f.top+f.offset,r=e-n):"bottom"===b?(r=d.chartHeight-f.bottom+f.offset,e=r+n):(e=f.top+f.len-f.translate(g?z:u),r=f.top+f.len-f.translate(g?u:z)),"right"===b?(b=d.chartWidth-f.right+f.offset,g=b+n):"left"===b?(g=f.left+f.offset,b=g-n):(b=Math.round(f.left+f.translate(g?z:u))-A,g=Math.round(f.left+f.translate(g?u:z))-A),this.slotWidth=g-b,c.pos.x="left"===l?b:"right"===l?g:b+(g-b)/2,c.pos.y=r+(e-r)/2,d=d.renderer.fontMetrics(k.style.fontSize,a.element),a=a.getBBox().height,k.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+=f.horiz&&k.x||0)});p(e,"afterTickSize",function(c){var a=this.maxLabelDimensions,f=this.options;!0===(f&&q(f.grid)?f.grid:{}).enabled&&(f=2*Math.abs(this.defaultLeftAxisOptions.labels.x),a=f+(this.horiz?a.height:a.width),v(c.tickSize)?c.tickSize[0]=a:c.tickSize=[a])});p(e,"afterGetTitlePosition",function(c){var a=this.options;if(!0===(a&&q(a.grid)?a.grid:{}).enabled){var f=this.axisTitle,g=f&&f.getBBox().width,d=this.horiz, e=this.left,b=this.top,l=this.width,n=this.height,p=a.title,a=this.opposite,z=this.offset,u=this.tickSize()||[0],A=p.x||0,r=p.y||0,B=k(p.margin,d?5:10),f=this.chart.renderer.fontMetrics(p.style&&p.style.fontSize,f).f,u=(d?b+n:e)+u[0]/2*(a?-1:1)*(d?1:-1)+(this.side===h.bottom?f:0);c.titlePosition.x=d?e-g/2-B+A:u+(a?l:0)+z+A;c.titlePosition.y=d?u-(a?n:0)+(a?f:-f)/2+z+r:b-B+r}});d(e.prototype,"unsquish",function(c){var a=this.options;return!0===(a&&q(a.grid)?a.grid:{}).enabled&&this.categories?this.tickInterval: c.apply(this,Array.prototype.slice.call(arguments,1))});p(e,"afterSetOptions",function(c){var a=this.options;c=c.userOptions;var f,g=a&&q(a.grid)?a.grid:{};!0===g.enabled&&(f=n(!0,{className:"highcharts-grid-axis "+(c.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]]},c),"xAxis"===this.coll&&(m(c.linkedTo)&&!m(c.tickPixelInterval)&&(f.tickPixelInterval=350),m(c.tickPixelInterval)||!m(c.linkedTo)||m(c.tickPositioner)||m(c.tickInterval)||(f.tickPositioner=function(a,c){var g=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(g){var h,d,k,e,l=f.units;for(e=0;ek||hk)&&!c.startOnTick&&(g[0]=k),(de&&d-bq?a:q;h=h+1+f.descendants;c=Math.max(f.height+1,c);return f});d&&(d.start=m(d.start,g),d.end=m(d.end,q));p(n,{children:f,descendants:h,height:c});"function"===typeof a&&a(n,l);return n};return{getListOfParents:v,getNode:w,getTree:function(b,n){var k=b.map(function(d){return d.id});b=v(b,k);return w("",null,1,null,b,n)}}}(y),H=function(b){var p=b.extend,t=b.isArray,m=b.isObject,v=b.isNumber,w=b.merge,q=b.pick;return{getColor:function(n,k){var d=k.index,e=k.mapOptionsToLevel, l=k.parentColor,h=k.parentColorIndex,c=k.series,a=k.colors,f=k.siblings,g=c.points,p=c.chart.options.chart,C,m,x,t;if(n){g=g[n.i];n=e[n.level]||{};if(e=g&&n.colorByPoint)m=g.index%(a?a.length:p.colorCount),C=a&&a[m];if(!c.chart.styledMode){a=g&&g.options.color;p=n&&n.color;if(x=l)x=(x=n&&n.colorVariation)&&"brightness"===x.key?b.color(l).brighten(d/f*x.to).get():l;x=q(a,p,C,x,c.color)}t=q(g&&g.options.colorIndex,n&&n.colorIndex,m,h,k.colorIndex)}return{color:x,colorIndex:t}},getLevelOptions:function(b){var k= null,d,e,l,h;if(m(b))for(k={},l=v(b.from)?b.from:1,h=b.levels,e={},d=m(b.defaults)?b.defaults:{},t(h)&&(e=h.reduce(function(c,a){var f,g;m(a)&&v(a.level)&&(g=w({},a),f="boolean"===typeof g.levelIsConstant?g.levelIsConstant:d.levelIsConstant,delete g.levelIsConstant,delete g.level,a=a.level+(f?0:l-1),m(c[a])?p(c[a],g):c[a]=g);return c},{})),h=v(b.to)?b.to:1,b=0;b<=h;b++)k[b]=w({},d,m(e[b])?e[b]:{});return k},setTreeValues:function k(d,b){var e=b.before,h=b.idRoot,c=b.mapIdToNode[h],a=b.points[d.i], f=a&&a.options||{},g=0,m=[];p(d,{levelDynamic:d.level-(("boolean"===typeof b.levelIsConstant?b.levelIsConstant:1)?0:c.level),name:q(a&&a.name,""),visible:h===d.id||("boolean"===typeof b.visible?b.visible:!1)});"function"===typeof e&&(d=e(d,b));d.children.forEach(function(a,c){var f=p({},b);p(f,{index:c,siblings:d.children.length,visible:d.visible});a=k(a,f);m.push(a);a.visible&&(g+=a.val)});d.visible=0=k?(d-k)%e:e-(k-d)%e;return b.inclusive?d<=h:d=a)break;else if(h.isInBreak(c,a)){b-=a-c.from;break}return b}function k(a){var b,c;for(c=0;c=a);c++)b.tol;)m-=k;for(;md.to||c>d.from&&fd.from&&fd.from&&f>d.to&&fk&&(k=d);l--;)e[l+1].x-e[l].x>k&&(d=(e[l].x+e[l+1].x)/2,e.splice(l+1,0,{isNull:!0,x:d}),this.options.stacking&& (d=h.stacks[this.stackKey][d]=new b.StackItem(h,h.options.stackLabels,!1,d,this.stack),d.total=0));return this.getGraphPath(e)}})(y);(function(b,p,t){var m=b.addEvent,v=function(a){return Array.prototype.slice.call(a,1)},w=b.defined,q=b.extend,n=b.find,k=b.fireEvent,d=t.getLevelOptions,e=b.merge,l=b.isNumber,h=function(a){return b.isObject(a,!0)},c=b.isString,a=b.pick,f=b.wrap;t=b.Axis;var g=b.Tick,y=function(a,b){var c,d;for(c in b)b.hasOwnProperty(c)&&(d=b[c],f(a,c,d))},C=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},[])},x=function(a,b){var c=a.options.breaks||[],d=C(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=C(b,a.max);c.push(a);return c},F=function(a,b){var c=a.options.breaks||[],d=C(b,a.max);return c.reduce(function(a,b){b.to=== d.to&&b.from===d.from||a.push(b);return a},[])},z=function(c,d){var h=c.labelIcon,g=!h,f=d.renderer,e=d.xy,k=d.options,B=k.width,l=k.height,n=e.x-B/2-k.padding,e=e.y-l/2,r=d.collapsed?90:180,m=d.show&&b.isNumber(e);g&&(c.labelIcon=h=f.path(f.symbols[k.type](k.x,k.y,B,l)).addClass("highcharts-label-icon").add(d.group));m||h.attr({y:-9999});f.styledMode||h.attr({"stroke-width":1,fill:a(d.color,"#666666")}).css({cursor:"pointer",stroke:k.lineColor,strokeWidth:k.lineWidth});h[g?"attr":"animate"]({translateX:n, translateY:e,rotation:r})},u=function(a){a.target.axes.filter(function(a){return"treegrid"===a.options.type}).forEach(function(a){var c=a.options&&a.options.labels,h;a.updateYNames();a.series.forEach(function(a){a.yData=a.options.data.map(function(a){return a.y})});a.mapOptionsToLevel=d({defaults:c,from:1,levels:c.levels,to:a.tree.height});h=b.addEvent(a,"foundExtremes",function(){a.collapsedNodes.forEach(function(b){b=E(a,b);a.setBreaks(b,!1)});h()})})},A=function(a,b,d){var f=[],g=[],e={},k={}, l=-1,B="boolean"===typeof b?b:!1;a=p.getTree(a,{after:function(a){a=k[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&&g.push(a)},before:function(a){var b=h(a.data)?a.data:{},d=c(b.name)?b.name:"",g=e[a.parent],g=h(g)?k[g.pos]:null,m=function(a){return a.name===d},r;B&&h(g)&&(r=n(g.children,m))?(m=r.pos,r.nodes.push(a)):m=l++;k[m]||(k[m]=r={depth:g?g.depth+1:0,name:d,nodes:[a],children:[],pos:m},-1!==m&&f.push(d), h(g)&&g.children.push(r));c(a.id)&&(e[a.id]=a);!0===b.collapsed&&(r.collapsed=!0);a.pos=m}});k=function(a,b){var c=function(a,d,g){var f=d+(-1===d?0:b-1),e=(f-d)/2,k=d+e;a.nodes.forEach(function(a){var b=a.data;h(b)&&(b.y=d+b.seriesIndex,delete b.seriesIndex);a.pos=k});g[k]=a;a.pos=k;a.tickmarkOffset=e+.5;a.collapseStart=f+.5;a.children.forEach(function(a){c(a,f+1,g);f=a.collapseEnd-.5});a.collapseEnd=f+.5;return g};return c(a["-1"],-1,{})}(k,d);return{categories:f,mapOfIdToNode:e,mapOfPosToGridNode:k, collapsedNodes:g,tree:a}};y(t.prototype,{init:function(a,b,c){var d="treegrid"===c.type;d&&(m(b,"beforeRender",u),m(b,"beforeRedraw",u),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,c=b&&b.labels, b=c&&l(c.indentation)?b.labels.indentation:0,c=a.apply(this,v(arguments)),d;"treegrid"===this.options.type&&this.mapOfPosToGridNode&&(d=this.mapOfPosToGridNode[-1].height,c.width+=b*(d-1));return c},generateTick:function(a,b){var c=h(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},d=this.ticks,f=d[b],k,e;"treegrid"===this.options.type?(e=this.mapOfPosToGridNode[b],(c=c[e.depth])&&(k={labels:c}),f?(f.parameters.category=e.name,f.options=k,f.addLabel()):d[b]=new g(this,b,null,void 0,{category:e.name, tickmarkOffset:e.tickmarkOffset,options:k})):a.apply(this,v(arguments))},setTickInterval:function(b){var c=this.options;"treegrid"===c.type?(this.min=a(this.userMin,c.min,this.dataMin),this.max=a(this.userMax,c.max,this.dataMax),k(this,"foundExtremes"),this.setAxisTranslation(!0),this.tickmarkOffset=.5,this.tickInterval=1,this.tickPositions=this.mapOfPosToGridNode?D(this):[]):b.apply(this,v(arguments))}});y(g.prototype,{getLabelPosition:function(b,c,d,g,f,e,k,m,n){var p=a(this.options&&this.options.labels, e);e=this.pos;var r=this.axis,B="treegrid"===r.options.type;b=b.apply(this,[c,d,g,f,p,k,m,n]);B&&(c=p&&h(p.symbol)?p.symbol:{},p=p&&l(p.indentation)?p.indentation:0,e=(e=(r=r.mapOfPosToGridNode)&&r[e])&&e.depth||1,b.x+=c.width+2*c.padding+(e-1)*p);return b},renderLabel:function(c){var d=this,g=d.pos,f=d.axis,e=d.label,k=f.mapOfPosToGridNode,l=f.options,m=a(d.options&&d.options.labels,l&&l.labels),n=m&&h(m.symbol)?m.symbol:{},p=(k=k&&k[g])&&k.depth,l="treegrid"===l.type,r=!(!e||!e.element),q=-1