import{g as t}from"./index-B1MHyEgd.js";function e(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(s){if("default"!==s&&!(s in t)){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}})}),Object.freeze(t)}var s,i={exports:{}};var r,o=s?i.exports:(s=1,r="undefined"==typeof window?i.exports:window,i.exports=((t,e)=>(()=>{var s={512:t=>{t.exports=e},944:e=>{e.exports=t}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return s[t](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var s in e)r.o(e,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};r.d(o,{default:()=>C});var a=r(944),n=r.n(a),l=r(512),h=r.n(l);let{composed:p}=n(),{addEvent:c,pushUnique:d,wrap:x}=n();function u(t){this.variwide&&this.cross&&this.cross.attr("stroke-width",t.point?.crosshairWidth)}function f(){let t=this;this.chart.labelCollectors.push(function(){return t.variwide?t.tickPositions.filter(e=>!!t.ticks[e].label).map((e,s)=>{let i=t.ticks[e].label;return i.labelrank=t.zData?.[s],i}):[]})}function g(t){let e=this.axis,s=e.horiz?"x":"y";e.variwide&&(this[s+"Orig"]=t.pos[s],this.postTranslate(t.pos,s,this.pos))}function y(t,e,s){let i=this.axis,r=t[e]-i.pos;i.horiz||(r=i.len-r),r=i.series[0].postTranslate(s,r),i.horiz||(r=i.len-r),t[e]=i.pos+r}function v(t,e,s,i,r,o,a,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:m}}}=h().seriesTypes,{isNumber:w}=n(),{column:b}=h().seriesTypes,{addEvent:A,arrayMin:O,arrayMax:k,crisp:P,extend:T,merge:z,pick:M}=n();class _ extends b{processData(t){this.totalZ=0,this.relZ=[],h().seriesTypes.column.prototype.processData.call(this,t);let e=this.getColumn("z");(this.xAxis.reversed?e.slice().reverse():e).forEach(function(t,e){this.relZ[e]=this.totalZ,this.totalZ+=t},this),this.xAxis.categories&&(this.xAxis.variwide=!0,this.xAxis.zData=e)}postTranslate(t,e,s){let i=this.xAxis,r=this.relZ,o=i.reversed?r.length-t:t,a=i.reversed?-1:1,n=i.toPixels(i.reversed?(i.dataMax||0)+i.pointRange:i.dataMin||0),l=i.toPixels(i.reversed?i.dataMin||0:(i.dataMax||0)+i.pointRange),h=Math.abs(l-n),p=this.totalZ,c=this.chart.inverted?l-(this.chart.plotTop-a*i.minPixelPadding):n-this.chart.plotLeft-a*i.minPixelPadding,d=o/r.length*h,x=(o+a)/r.length*h,u=M(r[o],p)/p*h,f=M(r[o+a],p)/p*h;return s&&(s.crosshairWidth=f-u),c+u+(e-(c+d))*(f-u)/(x-d)}translate(){this.crispOption=this.options.crisp,this.options.crisp=!1,super.translate(),this.options.crisp=this.crispOption}correctStackLabels(){let t,e,s,i,r=this.options,o=this.yAxis;for(let a of this.points)i=a.x,e=a.shapeArgs.width,(s=o.stacking.stacks[(this.negStacks&&a.y<(r.startFromThreshold?0:r.threshold)?"-":"")+this.stackKey])&&(t=s[i])&&!a.isNull&&t.setOffset(-e/2||0,e||0,void 0,void 0,a.plotX,this.xAxis)}getXExtremes(t){let e=k(t),s=this.getColumn("z")[t.indexOf(e)];return{min:O(t),max:e+(this.xAxis.categories?0:s)}}}_.compose=function(t,e){if(d(p,"Variwide")){let s=e.prototype;c(t,"afterDrawCrosshair",u),c(t,"afterRender",f),c(e,"afterGetPosition",g),s.postTranslate=y,x(s,"getLabelPosition",v)}},_.defaultOptions=z(b.defaultOptions,{pointPadding:0,groupPadding:0}),A(_,"afterColumnTranslate",function(){let t=this.xAxis,e=this.chart.inverted,s=-1;for(let i of this.points){let r,o;++s;let a=i.shapeArgs||{},{x:n=0,width:l=0}=a,{plotX:h=0,tooltipPos:p,z:c=0}=i;t.variwide?(r=this.postTranslate(s,n,i),o=this.postTranslate(s,n+l)):(r=h,o=t.translate(i.x+c,!1,!1,!1,!0)),this.crispOption&&(r=P(r,this.borderWidth),o=P(o,this.borderWidth)),a.x=r,a.width=Math.max(o-r,1),i.plotX=(r+o)/2,p&&(e?p[1]=t.len-a.x-a.width/2:p[0]=a.x+a.width/2)}this.options.stacking&&this.correctStackLabels()},{order:2}),T(_.prototype,{irregularWidths:!0,keysAffectYAxis:["y"],pointArrayMap:["y","z"],parallelArrays:["x","y","z"],pointClass:class extends m{isValid(){return w(this.y)&&w(this.z)}}}),h().registerSeriesType("variwide",_);let j=n();_.compose(j.Axis,j.Tick);let C=n();return o.default})())(r._Highcharts,r._Highcharts.SeriesRegistry)),a=e({__proto__:null,default:t(o)},[o]);export{a as v};
//# sourceMappingURL=variwide-BAs634G3.js.map
