/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/mouse-wheel-zoom
 * @requires highcharts
 *
 * Non-cartesian series zoom module
 *
 * (c) 2024-2026 Highsoft AS
 * Author: Hubert Kozik
 *
 * 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 o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let o=t.default;var i=e.n(o);let{doc:s,win:a}=i();function r(t,e,o,s={}){let a="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(a,"hcEvents")||(a.hcEvents={});let n=a.hcEvents;i().Point&&t instanceof i().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let l=t.addEventListener;l&&l.call(t,e,o,!!i().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==e.indexOf("touch"):s.passive,capture:!1}),n[e]||(n[e]=[]);let p={fn:o,order:"number"==typeof s.order?s.order:1/0};return n[e].push(p),n[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,o){function i(e,o){let i=t.removeEventListener;i&&i.call(t,e,o,!1)}function s(o){let s,a;if(t.nodeName){e?(s={})[e]=!0:s=o;var r=s,n=function(t,e){if(o[e])for(a=o[e].length;a--;)i(e,o[e][a].fn)};for(let t in r)Object.hasOwnProperty.call(r,t)&&n.call(r[t],r[t],t,r)}}let a="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(a,"hcEvents")){let t=a.hcEvents;if(e){let a=t[e]||[];o?(t[e]=a.filter(function(t){return o!==t.fn}),i(e,o)):(s(t),t[e]=[])}else s(t),delete a.hcEvents}}(t,e,o)}}Array.prototype.find;let{composed:n}=i();function l(t){let e=this,{trigger:o,selection:i,reset:s,from:a={},to:r={}}=t;"xy"===e.zooming.type&&("mousewheel"===o||"pan"===o||i||s)&&e.series.forEach(i=>{if(!i.isCartesian&&!1!==i.options.zoomEnabled){i.isDirty=!0,e.isDirtyBox=!0,t.hasZoomed=!0;let{plotWidth:s=0,plotHeight:n=0}=e;if("pan"===o&&i.zooming)i.zooming.panX-=(r.x||0)/s,i.zooming.panY-=(r.y||0)/n;else if(Object.keys(a).length){let{width:t=1,height:o=1}=r,l=Math.abs(i.group?.scaleX||1),{x:p=0,y:h=0,width:c=1,height:f=1}=a,m=p,d=h,u=i.zooming?.scale||i.group?.scaleX||1,g=(i.zooming?.width||1)*s,z=(i.zooming?.height||1)*n;if(Object.keys(r).length)g=c/t*g,z=c/o*z,p-=e.plotLeft,h-=e.plotTop,m=p-g/2,d=h-z/2,u=Math.min(s/g,n/z);else{c/=l,f/=l,u=Math.min(s/c,n/f);let t=0,o=0;i.zooming&&(t=i.zooming.x*s,o=i.zooming.y*n);let a=(p-e.plotLeft)/(s-c*l||1),r=(h-e.plotTop)/(n-f*l||1);g=c,z=f,p-=e.plotLeft,h-=e.plotTop,p/=l,h/=l,p+=t+c*a,h+=o+f*r,m-=e.plotLeft,d-=e.plotTop,m/=l,d/=l,m+=t,d+=o}i.zooming={x:m/s,y:d/n,zoomX:p/s,zoomY:h/n,width:g/s,height:z/n,scale:u,panX:0,panY:0},u<1&&delete i.zooming}else delete i.zooming}})}function p(t){let{chart:e,group:o,zooming:i}=this,{plotSizeX:s=0,plotSizeY:a=0}=e,{scale:r,translateX:n,translateY:l,name:p}=t,h=0,c=0,f=n,m=l;e.inverted&&([s,a]=[a,s]),o&&i&&(r=i.scale,h=i.zoomX*s*(r-Math.abs(o.scaleX||1)),c=i.zoomY*a*(r-Math.abs(o.scaleY||1)),"series"===p&&(i.x=Math.max(0,Math.min(1-i.width,i.x+i.panX/r)),h+=i.panX*s,i.panX=0,i.y=Math.max(0,Math.min(1-i.height,i.y+i.panY/r)),c+=i.panY*a,i.panY=0),n=(o.translateX||f)-h,(l=(o.translateY||m)-c)>m?l=m:(o.translateY||m)-c<a*(1-r)+m&&(l=a*(1-r)+m),n>f?n=f:n<s*(1-r)+f&&(n=s*(1-r)+f),t.scale=r,t.translateX=n,t.translateY=l)}function h(){let t;this.series.find(t=>!!t.zooming)&&(this.zoomClipRect||(this.zoomClipRect=this.renderer.clipRect()),this.zoomClipRect.attr({x:this.plotLeft,y:this.plotTop,width:this.inverted?this.clipBox.height:this.clipBox.width,height:this.inverted?this.clipBox.width:this.clipBox.height}),t=this.zoomClipRect),this.seriesGroup?.clip(t),this.series.forEach(e=>{e.dataLabelsParentGroups?.forEach(e=>{e.clip(t)})})}function c(t){if(t.point.series&&!t.point.series.isCartesian&&t.point.series.group&&t.point.series.zooming){let e=t.point.series.chart,o=t.point.series.zooming.scale,i=t.point.series.group.translateX||0,s=t.point.series.group.translateY||0;t.ret[0]=t.ret[0]*o+i-e.plotLeft,t.ret[1]=t.ret[1]*o+s-e.plotTop}}function f(t){t.skipAxes&&this.series.forEach(t=>{t.group&&t.zooming&&t.group.attr({translateX:0,translateY:0,scaleX:1,scaleY:1})})}function m({index:t,zIndex:e}){var o;this.hasDataLabels?.()&&(this.dataLabelsParentGroups||(this.dataLabelsParentGroups=[]),(o=this.dataLabelsParentGroups)[t]||(o[t]=this.chart.renderer.g().attr({zIndex:e}).add()))}let d=class{static compose(t,e,o){var i;i="NonCartesianSeriesZoom",0>n.indexOf(i)&&n.push(i)&&(r(t,"afterDrawChartBox",h),r(t,"transform",l),r(t,"afterSetChartSize",f),r(e,"getPlotBox",p),r(e,"initDataLabelsGroup",m),r(o,"getAnchor",c))}},u=i();u.NonCartesianSeriesZoom=u.NonCartesianSeriesZoom||d,u.NonCartesianSeriesZoom.compose(u.Chart,u.Series,u.Tooltip);let g=i();export{g as default};