/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/xrange
 * @requires highcharts
 *
 * X-range series
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi, Lars A. V. Cabrera
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as t from"../highcharts.js";var e={};e.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var s=e.n(i);let o=t.default.Color;var r=e.n(o);let a=t.default.SeriesRegistry;var l=e.n(a);let{column:{prototype:{pointClass:n}}}=l().seriesTypes;class p extends n{static getColorByCategory(t,e){let i=t.chart,s=t.options.colors||i.options.colors,o=s?s.length:i.options.chart.colorCount||1,r=(e.y||0)%o,a=s?.[r];return{colorIndex:r,color:a}}resolveColor(){let t=this.series;if(t.options.colorByPoint&&!this.options.color){let e=p.getColorByCategory(t,this);t.chart.styledMode||(this.color=e.color),(void 0===this.options.colorIndex||null===this.options.colorIndex)&&(this.colorIndex=e.colorIndex)}else this.color=this.options.color||t.color}constructor(t,e,i){super(t,e,i),this.y||(this.y=0)}applyOptions(t,e){return super.applyOptions(t,e),this.x2=this.series.chart.time.parse(this.x2),this.isNull=!this.isValid?.(),this.formatPrefix=this.isNull?"null":"point",this}setState(){super.setState.apply(this,arguments),this.series.drawPoint(this,this.series.getAnimationVerb())}isValid(){return"number"==typeof this.x&&"number"==typeof this.x2}}(0,i.extend)(p.prototype,{ttBelow:!1,tooltipDateKeys:["x","x2"]});let{composed:h,noop:c}=s(),{parse:d}=r(),{column:u}=l().seriesTypes;function m(){let t,e,s=this.chart.time;if(this.isXAxis){for(let o of(t=(0,i.pick)(this.dataMax,-Number.MAX_VALUE),this.series))for(let r of o.dataTable.getColumn("x2",!0)||o.dataTable.getColumn("end",!0)||[])"string"==typeof r&&(r=s.parse(r)),(0,i.isNumber)(r)&&r>t&&(t=r,e=!0);e&&(this.dataMax=t)}}class g extends u{static compose(t){(0,i.pushUnique)(h,"Series.XRange")&&(0,i.addEvent)(t,"afterGetSeriesExtremes",m)}init(){super.init.apply(this,arguments),this.options.stacking=void 0}getColumnMetrics(){let t=()=>{for(let t of this.chart.series){let e=t.xAxis;t.xAxis=t.yAxis,t.yAxis=e}};t();let e=super.getColumnMetrics();return t(),e}cropData(t,e,i){let s=t.getColumn("x")||[],o=t.getColumn("x2");t.setColumn("x",o,void 0,{silent:!0});let r=super.cropData(t,e,i);return t.setColumn("x",s.slice(r.start,r.end),void 0,{silent:!0}),r}findPointIndex(t){let e,{cropStart:s,points:o}=this,{id:r}=t;if(r){let t=(0,i.find)(o,t=>t.id===r);e=t?t.index:void 0}if(void 0===e){let s=(0,i.find)(o,e=>e.x===t.x&&e.x2===t.x2&&!e.touched);e=s?s.index:void 0}return this.cropped&&(0,i.isNumber)(e)&&(0,i.isNumber)(s)&&e>=s&&(e-=s),e}alignDataLabel(t){let e=t.plotX;t.plotX=(0,i.pick)(t.dlBox?.centerX,t.plotX),t.dataLabel&&t.shapeArgs?.width&&t.dataLabel.css({width:`${t.shapeArgs.width}px`}),super.alignDataLabel.apply(this,arguments),t.plotX=e}translatePoint(t){let e=this.xAxis,s=this.yAxis,o=this.columnMetrics,r=this.options,a=r.minPointLength||0,l=(t.shapeArgs?.width||0)/2,n=this.pointXOffset=o.offset,p=(0,i.pick)(t.x2,t.x+(t.len||0)),h=r.borderRadius,c=this.chart.plotTop,d=this.chart.plotLeft,u=t.plotX,m=e.translate(p,0,0,0,1),g=Math.abs(m-u),x=this.chart.inverted,y=(0,i.pick)(r.borderWidth,1),f,b,A=o.offset,C=Math.round(o.width),w,v,M,P;a&&((f=a-g)<0&&(f=0),u-=f/2,m+=f/2),u=Math.max(u,-10),m=(0,i.clamp)(m,-10,e.len+10),(0,i.defined)(t.options.pointWidth)&&(A-=(Math.ceil(t.options.pointWidth)-C)/2,C=Math.ceil(t.options.pointWidth)),r.pointPlacement&&(0,i.isNumber)(t.plotY)&&s.categories&&(t.plotY=s.translate(t.y,0,1,0,1,r.pointPlacement));let R=(0,i.crisp)(Math.min(u,m),y),X=(0,i.crisp)(Math.max(u,m),y)-R,O=Math.min((0,i.relativeLength)("object"==typeof h?h.radius:h||0,C),Math.min(X,C)/2),N={x:R,y:(0,i.crisp)((t.plotY||0)+A,y),width:X,height:C,r:O};t.shapeArgs=N,x?t.tooltipPos[1]+=n+l:t.tooltipPos[0]-=l+n-N.width/2,v=(w=N.x)+N.width,w<0||v>e.len?(w=(0,i.clamp)(w,0,e.len),M=(v=(0,i.clamp)(v,0,e.len))-w,t.dlBox=(0,i.merge)(N,{x:w,width:v-w,centerX:M?M/2:null})):t.dlBox=null;let L=t.tooltipPos,S=+!!x,F=+!x,I=this.columnMetrics?this.columnMetrics.offset:-o.width/2;x?L[S]+=N.width/2:L[S]=(0,i.clamp)(L[S]+(e.reversed?-1:0)*N.width,e.left-d,e.left+e.len-d-1),L[F]=(0,i.clamp)(L[F]+(x?-1:1)*I,s.top-c,s.top+s.len-c-1),(b=t.partialFill??0)&&((0,i.isObject)(b)&&(b=b.amount||0),(0,i.isNumber)(b)||(b=0),t.partShapeArgs=(0,i.merge)(N),P=Math.max(Math.round(g*b+t.plotX-u),0),t.clipRectArgs={x:e.reversed?N.x+g-P:N.x,y:N.y,width:P,height:N.height}),t.key=t.category||t.name,t.yCategory=s.categories?.[t.y??-1]}translate(){for(let t of(super.translate.apply(this,arguments),this.points))this.translatePoint(t)}drawPoint(t,e){let s=this.options,o=this.chart.renderer,r=t.shapeType,a=t.shapeArgs,l=t.partShapeArgs,n=t.clipRectArgs,p=t.state,h=s.states[p||"normal"]||{},c=void 0===p?"attr":e,u=this.pointAttribs(t,p),m=(0,i.pick)(this.chart.options.chart.animation,h.animation),g=t.graphic,x=t.partialFill;if(t.isNull||!1===t.visible)g&&(t.graphic=g.destroy());else{let h=t.getClassName();if(g?g.rect[e](a):(t.graphic=g=o.g("point").add(t.group||this.group),g.rect=o[r]((0,i.merge)(a)).add(g)),g.addClass(h+(p&&"select"!==p?" highcharts-point-"+p:""),!0),g.rect.addClass(h+" highcharts-partfill-original",!0),l&&(g.partRect?(g.partRect[e]((0,i.merge)(l)),g.partialClipRect[e]((0,i.merge)(n))):(g.partialClipRect=o.clipRect(n.x,n.y,n.width,n.height),g.partRect=o[r](l).addClass("highcharts-partfill-overlay").add(g).clip(g.partialClipRect))),!this.chart.styledMode&&(g.rect[e](u,m).shadow(s.shadow),l)){(0,i.isObject)(x)||(x={}),(0,i.isObject)(s.partialFill)&&(x=(0,i.merge)(s.partialFill,x));let e=x.fill||d(u.fill).brighten(-.3).get()||d(t.color||this.color).brighten(-.3).get();u.fill=e,g.partRect[c](u,m).shadow(s.shadow)}}}drawPoints(){let t=this.getAnimationVerb();for(let e of this.points)this.drawPoint(e,t)}getAnimationVerb(){return this.chart.pointCount<(this.options.animationLimit||250)?"animate":"attr"}isPointInside(t){let e=t.shapeArgs,i=t.plotX,s=t.plotY;return e?void 0!==i&&void 0!==s&&s>=0&&s<=this.yAxis.len&&(e.x||0)+(e.width||0)>=0&&i<=this.xAxis.len:super.isPointInside.apply(this,arguments)}}g.defaultOptions=(0,i.merge)(u.defaultOptions,{colorByPoint:!0,dataLabels:{formatter:function(){let t=this.partialFill;if((0,i.isObject)(t)&&(t=t.amount),(0,i.isNumber)(t)&&t>0)return(0,i.correctFloat)(100*t)+"%"},inside:!0,verticalAlign:"middle",style:{whiteSpace:"nowrap"}},tooltip:{headerFormat:'<span style="font-size: 0.8em">{ucfirst point.x} - {point.x2}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.yCategory}</b><br/>'},borderRadius:3,pointRange:0}),(0,i.extend)(g.prototype,{pointClass:p,pointArrayMap:["x2","y"],getExtremesFromAll:!0,keysAffectYAxis:["y"],parallelArrays:["x","x2","y"],requireSorting:!1,type:"xrange",animate:l().series.prototype.animate,autoIncrement:c,buildKDTree:c}),l().registerSeriesType("xrange",g);let x=s();g.compose(x.Axis);let y=s();export{y as default};