/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/variwide
 * @requires highcharts
 *
 * Highcharts variwide module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as t from"../highcharts.js";var s={};s.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return s.d(i,{a:i}),i},s.d=(t,i)=>{for(var e in i)s.o(i,e)&&!s.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},s.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);let i=t.default;var e=s.n(i);let r=t.default.SeriesRegistry;var a=s.n(r);let{composed:o}=e();function n(t){this.variwide&&this.cross&&this.cross.attr("stroke-width",t.point?.crosshairWidth)}function l(){let t=this;this.chart.labelCollectors.push(function(){return t.variwide?t.tickPositions.filter(s=>!!t.ticks[s].label).map((s,i)=>{let e=t.ticks[s].label;return e.labelrank=t.zData?.[i],e}):[]})}function h(t){let s=this.axis,i=s.horiz?"x":"y";s.variwide&&(this[i+"Orig"]=t.pos[i],this.postTranslate(t.pos,i,this.pos))}function p(t,s,i){let e=this.axis,r=t[s]-e.pos;e.horiz||(r=e.len-r),r=e.series[0].postTranslate(i,r),e.horiz||(r=e.len-r),t[s]=e.pos+r}function d(t,s,i,e,r,a,o,n){let l=Array.prototype.slice.call(arguments,1),h=r?"x":"y";this.axis.variwide&&"number"==typeof this[h+"Orig"]&&(l[+!r]=this[h+"Orig"]);let p=t.apply(this,l);return this.axis.variwide&&this.axis.categories&&this.postTranslate(p,h,this.pos),p}let{column:{prototype:{pointClass:c}}}=a().seriesTypes,x=class extends c{isValid(){return(0,i.isNumber)(this.y)&&(0,i.isNumber)(this.z)}},{column:u}=a().seriesTypes;class f extends u{processData(t){this.totalZ=0,this.relZ=[],a().seriesTypes.column.prototype.processData.call(this,t);let s=this.getColumn("z");(this.xAxis.reversed?s.slice().reverse():s).forEach(function(t,s){this.relZ[s]=this.totalZ,this.totalZ+=t},this),this.xAxis.categories&&(this.xAxis.variwide=!0,this.xAxis.zData=s)}postTranslate(t,s,e){let r=this.xAxis,a=this.relZ,o=r.reversed?a.length-t:t,n=r.reversed?-1:1,l=r.toPixels(r.reversed?(r.dataMax||0)+r.pointRange:r.dataMin||0),h=r.toPixels(r.reversed?r.dataMin||0:(r.dataMax||0)+r.pointRange),p=Math.abs(h-l),d=this.totalZ,c=this.chart.inverted?h-(this.chart.plotTop-n*r.minPixelPadding):l-this.chart.plotLeft-n*r.minPixelPadding,x=o/a.length*p,u=(o+n)/a.length*p,f=(0,i.pick)(a[o],d)/d*p,g=(0,i.pick)(a[o+n],d)/d*p;return e&&(e.crosshairWidth=g-f),c+f+(s-(c+x))*(g-f)/(u-x)}translate(){this.crispOption=this.options.crisp,this.options.crisp=!1,super.translate(),this.options.crisp=this.crispOption}correctStackLabels(){let t,s,i,e,r=this.options,a=this.yAxis;for(let o of this.points)e=o.x,s=o.shapeArgs.width,(i=a.stacking.stacks[(this.negStacks&&o.y<(r.startFromThreshold?0:r.threshold)?"-":"")+this.stackKey])&&(t=i[e])&&!o.isNull&&t.setOffset(-(s/2)||0,s||0,void 0,void 0,o.plotX,this.xAxis)}getXExtremes(t){let s=(0,i.arrayMax)(t),e=this.getColumn("z")[t.indexOf(s)];return{min:(0,i.arrayMin)(t),max:s+(this.xAxis.categories?0:e)}}}f.compose=function(t,s){if((0,i.pushUnique)(o,"Variwide")){let e=s.prototype;(0,i.addEvent)(t,"afterDrawCrosshair",n),(0,i.addEvent)(t,"afterRender",l),(0,i.addEvent)(s,"afterGetPosition",h),e.postTranslate=p,(0,i.wrap)(e,"getLabelPosition",d)}},f.defaultOptions=(0,i.merge)(u.defaultOptions,{pointPadding:0,groupPadding:0}),(0,i.addEvent)(f,"afterColumnTranslate",function(){let t=this.xAxis,s=this.chart.inverted,e=-1;for(let r of this.points){let a,o;++e;let n=r.shapeArgs||{},{x:l=0,width:h=0}=n,{plotX:p=0,tooltipPos:d,z:c=0}=r;t.variwide?(a=this.postTranslate(e,l,r),o=this.postTranslate(e,l+h)):(a=p,o=t.translate(r.x+c,!1,!1,!1,!0)),this.crispOption&&(a=(0,i.crisp)(a,this.borderWidth),o=(0,i.crisp)(o,this.borderWidth)),n.x=a,n.width=Math.max(o-a,1),r.plotX=(a+o)/2,d&&(s?d[1]=t.len-n.x-n.width/2:d[0]=n.x+n.width/2)}this.options.stacking&&this.correctStackLabels()},{order:2}),(0,i.extend)(f.prototype,{irregularWidths:!0,keysAffectYAxis:["y"],pointArrayMap:["y","z"],parallelArrays:["x","y","z"],pointClass:x}),a().registerSeriesType("variwide",f);let g=e();f.compose(g.Axis,g.Tick);let y=e();export{y as default};