/**
 * Highcharts JS v11.2.0 (2023-10-30)
 *
 * Mousewheel zoom module
 *
 * (c) 2023 Askel Eirik Johansson
 *
 * License: www.highcharts.com/license
 */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/mouse-wheel-zoom",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function n(t,e,n,i){t.hasOwnProperty(e)||(t[e]=i.apply(null,n),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}n(e,"Extensions/Annotations/NavigationBindingsUtilities.js",[e["Core/Utilities.js"]],function(t){let{defined:e,isNumber:n,pick:i}=t,o={backgroundColor:"string",borderColor:"string",borderRadius:"string",color:"string",fill:"string",fontSize:"string",labels:"string",name:"string",stroke:"string",title:"string"};return{annotationsFieldsTypes:o,getAssignedAxis:function(t){return t.filter(t=>{let e=t.axis.getExtremes(),o=e.min,s=e.max,r=i(t.axis.minPointOffset,0);return n(o)&&n(s)&&t.value>=o-r&&t.value<=s+r&&!t.axis.options.isInternal})[0]},getFieldType:function(t,n){let i=o[t],s=typeof n;return e(i)&&(s=i),({string:"text",number:"number",boolean:"checkbox"})[s]}}}),n(e,"Extensions/MouseWheelZoom/MouseWheelZoom.js",[e["Core/Utilities.js"],e["Extensions/Annotations/NavigationBindingsUtilities.js"]],function(t,e){let n,i,o;let{addEvent:s,isObject:r,pick:a,defined:l,merge:u,isNumber:d}=t,{getAssignedAxis:m}=e,c=[],h={enabled:!0,sensitivity:1.1},g=t=>r(t)?u(h,t):u(h,{enabled:!l(t)||t}),f=(t,e,n,i)=>(n+i>t+e&&(i>e?(i=e,n=t):n=t+e-i),i>e&&(i=e),n<t&&(n=t),{rangeStart:n,rangeWidth:i}),p=function(t){let e=t.options;l(n)&&clearTimeout(n),l(i)||(i=e.startOnTick,o=e.endOnTick),(i||o)&&(e.startOnTick=!1,e.endOnTick=!1),n=setTimeout(()=>{if(l(i)&&l(o)){e.startOnTick=i,e.endOnTick=o;let{min:n,max:s}=t.getExtremes();t.forceRedraw=!0,t.setExtremes(n,s),i=o=void 0}},400)},x=function(t,e,n){if(!l(n))return .5;let i=(n-e.pos)/e.len,o=e.isXAxis;return o&&!e.reversed!=!t.inverted||!o&&e.reversed?1-i:i},v=function(t,e,n,i,o){let s=e.isXAxis,r=!1;if(l(e.max)&&l(e.min)&&l(e.dataMax)&&l(e.dataMin)){s||p(e);let u=e.max-e.min,m=d(o)?o:e.min+u/2,c=x(t,e,n),h=u*i,g=m-h*c,v=a(e.options.max,e.dataMax)-a(e.options.min,e.dataMin),y=e.options.min?0:v*e.options.minPadding,b=e.options.max?0:v*e.options.maxPadding,E=a(e.options.min,e.dataMin)-y,C=v+b+y,M=f(E,C,g,h),w=M.rangeStart<a(e.options.min,E)||M.rangeStart===e.min&&M.rangeWidth>C&&M.rangeStart+M.rangeWidth<a(e.options.max,Number.MIN_VALUE)||M.rangeWidth===e.max-e.min;l(i)&&!w?(e.setExtremes(M.rangeStart,M.rangeStart+M.rangeWidth,!1),r=!0):e.setExtremes(void 0,void 0,!1)}return r},y=function(t,e,n,i,o,s,r){let l=a(r.type,t.zooming.type,""),u=/x/.test(l),d=/y/.test(l),m=n.toValue(o),c=i.toValue(s);if(t.inverted){let t=i.pos+i.len;m=n.toValue(s),c=i.toValue(o);let e=o;o=s,s=t-e+i.pos}let h=u&&v(t,n,o,e,m),g=d&&v(t,i,s,e,c),f=h||g;return f&&t.redraw(!1),f};function b(){let t=this,e=g(t.zooming.mouseWheel);e.enabled&&s(this.container,"wheel",n=>{n=this.pointer.normalize(n);let i=!t.pointer.inClass(n.target,"highcharts-no-mousewheel");if(t.isInsidePlot(n.chartX-t.plotLeft,n.chartY-t.plotTop)&&i){let i=e.sensitivity||1.1,o=n.detail||(n.deltaY||0)/120,s=m(this.pointer.getCoordinates(n).xAxis),r=m(this.pointer.getCoordinates(n).yAxis),a=y(t,Math.pow(i,o),s?s.axis:t.xAxis[0],r?r.axis:t.yAxis[0],n.chartX,n.chartY,e);a&&n.preventDefault&&n.preventDefault()}})}return{compose:function(t){-1===c.indexOf(t)&&(c.push(t),s(t,"afterGetContainer",b))}}}),n(e,"masters/modules/mouse-wheel-zoom.src.js",[e["Core/Globals.js"],e["Extensions/MouseWheelZoom/MouseWheelZoom.js"]],function(t,e){e.compose(t.Chart)})});//# sourceMappingURL=mouse-wheel-zoom.js.map