!/**
 * Highstock JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/datagrouping
 * @requires highcharts
 *
 * Data grouping module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating):"function"==typeof define&&define.amd?define("highcharts/modules/datagrouping",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.Templating)}):"object"==typeof exports?exports["highcharts/modules/datagrouping"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Templating):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Templating)}("u"<typeof window?this:window,(t,e,i)=>(()=>{"use strict";let o;var a,n,r,s={512:t=>{t.exports=e},944:e=>{e.exports=t},984:t=>{t.exports=i}},l={};function u(t){var e=l[t];if(void 0!==e)return e.exports;var i=l[t]={exports:{}};return s[t](i,i.exports,u),i.exports}u.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return u.d(e,{a:e}),e},u.d=(t,e)=>{for(var i in e)u.o(e,i)&&!u.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},u.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var h={};u.d(h,{default:()=>tG});var p=u(944),d=u.n(p);let g={},{arrayMax:c,arrayMin:m,correctFloat:f,extend:y,isNumber:x}=d();function G(t){let e=t.length,i=b(t);return x(i)&&e&&(i=f(i/e)),i}function b(t){let e=t.length,i;if(!e&&t.hasNulls)i=null;else if(e)for(i=0;e--;)i+=t[e];return i}let M={average:G,averages:function(){let t=[];return[].forEach.call(arguments,function(e){t.push(G(e))}),void 0===t[0]?void 0:t},close:function(t){return t.length?t[t.length-1]:t.hasNulls?null:void 0},high:function(t){return t.length?c(t):t.hasNulls?null:void 0},hlc:function(t,e,i){if(t=g.high(t),e=g.low(e),i=g.close(i),x(t)||x(e)||x(i))return[t,e,i]},low:function(t){return t.length?m(t):t.hasNulls?null:void 0},ohlc:function(t,e,i,o){if(t=g.open(t),e=g.high(e),i=g.low(i),o=g.close(o),x(t)||x(e)||x(i)||x(o))return[t,e,i,o]},open:function(t){return t.length?t[0]:t.hasNulls?null:void 0},range:function(t,e){return(t=g.low(t),e=g.high(e),x(t)||x(e))?[t,e]:null===t&&null===e?null:void 0},sum:b};y(g,M);let v={groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%[AebHMSL]","%[AebHMSL]","-%[HMSL]"],second:["%[AebHMS]","%[AebHMS]","-%[HMS]"],minute:["%[AebHM]","%[AebHM]","-%[HM]"],hour:["%[AebHM]","%[AebHM]","-%[HM]"],day:["%[AebY]","%[Aeb]","-%[AebY]"],week:["%v %[AebY]","%[Aeb]","-%[AebY]"],month:["%[BY]","%[B]","-%[BY]"],year:["%Y","%Y","-%Y"]}},T={line:{},spline:{},area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5},hlc:{groupPixelWidth:5},heikinashi:{groupPixelWidth:10}},A=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]],{addEvent:w,extend:C,merge:D,pick:P}=d();function S(t){let e=this,i=e.series;i.forEach(function(t){t.groupPixelWidth=void 0}),i.forEach(function(i){i.groupPixelWidth=e.getGroupPixelWidth&&e.getGroupPixelWidth(),i.groupPixelWidth&&(i.hasProcessed=!0),i.applyGrouping(!!t.hasExtremesChanged)})}function k(){let t=this.series,e=t.length,i=0,o=!1,a,n;for(;e--;)(n=t[e].options.dataGrouping)&&(i=Math.max(i,P(n.groupPixelWidth,v.groupPixelWidth)),a=(t[e].dataTable.getModified()||t[e].dataTable).rowCount,(t[e].groupPixelWidth||a>this.chart.plotSizeX/i||a&&n.forced)&&(o=!0));return o?i:0}function H(){this.series.forEach(function(t){t.hasProcessed=!1})}function R(t,e){let i;if(e=P(e,!0),t||(t={forced:!1,units:null}),this instanceof o)for(i=this.series.length;i--;)this.series[i].update({dataGrouping:t},!1);else this.chart.options.series.forEach(function(e){e.dataGrouping="boolean"==typeof t?t:D(t,e.dataGrouping)});this.ordinal&&(this.ordinal.slope=void 0),e&&this.chart.redraw()}let O=function(t){o=t;let e=t.prototype;e.applyGrouping||(w(t,"afterSetScale",H),w(t,"postProcessData",S),C(e,{applyGrouping:S,getGroupPixelWidth:k,setDataGrouping:R}))};(a=n||(n={})).setLength=function(t,e,i){return Array.isArray(t)?(t.length=e,t):t[i?"subarray":"slice"](0,e)},a.splice=function(t,e,i,o,a=[]){if(Array.isArray(t))return Array.isArray(a)||(a=Array.from(a)),{removed:t.splice(e,i,...a),array:t};let n=Object.getPrototypeOf(t).constructor,r=t[o?"subarray":"slice"](e,e+i),s=new n(t.length-i+a.length);return s.set(t.subarray(0,e),0),s.set(a,e),s.set(t.subarray(e+i),e+a.length),{removed:r,array:s}},a.convertToNumber=function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??""}`))&&!e?null:t}};let{setLength:F,splice:W}=n,{fireEvent:N,objectEach:E,uniqueKey:j}=d(),I=class{constructor(t={}){this.autoId=!t.id,this.columns={},this.id=t.id||j(),this.rowCount=0,this.versionTag=j();let e=0;E(t.columns||{},(t,i)=>{this.columns[i]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,E(this.columns,(e,i)=>{e.length!==t&&(this.columns[i]=F(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;E(this.columns,(o,a)=>{this.columns[a]=W(o,t,e).array,i=o.length}),this.rowCount=i}N(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=j()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRow(t,e){return(e||Object.keys(this.columns)).map(e=>this.columns[e]?.[t])}setColumn(t,e=[],i=0,o){this.setColumns({[t]:e},i,o)}setColumns(t,e,i){let o=this.rowCount;E(t,(t,e)=>{this.columns[e]=t.slice(),o=t.length}),this.applyRowCount(o),i?.silent||(N(this,"afterSetColumns"),this.versionTag=j())}setRow(t,e=this.rowCount,i,o){let{columns:a}=this,n=i?this.rowCount+1:e+1,r=Object.keys(t);if(o?.addColumns!==!1)for(let t=0,e=r.length;t<e;t++){let e=r[t];a[e]||(a[e]=[])}E(a,(r,s)=>{r||o?.addColumns===!1||(r=Array(n)),r&&(i?r=W(r,e,0,!0,[t[s]??null]).array:r[e]=t[s]??null,a[s]=r)}),n>this.rowCount&&this.applyRowCount(n),o?.silent||(N(this,"afterSetRows"),this.versionTag=j())}getModified(){return this.modified||this}},{addEvent:L,getMagnitude:Y,normalizeTickInterval:_,timeUnits:z}=d();!function(t){function e(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)}function i(){if("datetime"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new o(this))}t.compose=function(t){return t.keepProps.includes("dateTime")||(t.keepProps.push("dateTime"),t.prototype.getTimeTicks=e,L(t,"afterSetType",i)),t};class o{constructor(t){this.axis=t}normalizeTimeTickInterval(t,e){let i=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],o=i[i.length-1],a=z[o[0]],n=o[1],r;for(r=0;r<i.length&&(a=z[(o=i[r])[0]],n=o[1],!i[r+1]||!(t<=(a*n[n.length-1]+z[i[r+1][0]])/2));r++);a===z.year&&t<5*a&&(n=[1,2,5]);let s=_(t/a,n,"year"===o[0]?Math.max(Y(t/a),1):1);return{unitRange:a,count:s,unitName:o[0]}}getXDateFormat(t,e){let{axis:i}=this,o=i.chart.time;return i.closestPointRange?o.getDateFormat(i.closestPointRange,t,i.options.startOfWeek,e)||o.resolveDTLFormat(e.year).main:o.resolveDTLFormat(e.day).main}}t.Additions=o}(r||(r={}));let X=r;var q=u(512);let{series:{prototype:B}}=u.n(q)(),{addEvent:$,defined:J,error:K,extend:Q,isNumber:U,merge:V,pick:Z,splat:tt}=d(),te=B.generatePoints;function ti(t){var e,i,o;let a,n,r=this.chart,s=this.options.dataGrouping,l=!1!==this.allowDG&&s&&Z(s.enabled,r.options.isStock),u=this.reserveSpace(),h=this.currentDataGrouping,p,d,g=!1;l&&!this.requireSorting&&(this.requireSorting=g=!0);let c=!1==(e=this,i=t,!(e.isCartesian&&!e.isDirty&&!e.xAxis.isDirty&&!e.yAxis.isDirty&&!i))||!l;if(g&&(this.requireSorting=!1),c)return;this.destroyGroupedData();let m=s.groupAll?this.dataTable:this.dataTable.getModified()||this.dataTable,f=this.getColumn("x",!s.groupAll),y=r.plotSizeX,x=this.xAxis,G=x.getExtremes(),b=x.options.ordinal,M=this.groupPixelWidth;if(M&&f&&m.rowCount&&y&&U(G.min)){n=!0,this.isDirty=!0,this.points=null;let t=G.min,e=G.max,i=b&&x.ordinal&&x.ordinal.getGroupIntervalFactor(t,e,this)||1,l=M*(e-t)/y*i,h=x.getTimeTicks(X.Additions.prototype.normalizeTimeTickInterval(l,s.units||A),Math.min(t,f[0]),Math.max(e,f[f.length-1]),x.options.startOfWeek,f,this.closestPointRange),g=B.groupData.apply(this,[m,h,s.approximation]),c=g.modified,v=c.getColumn("x",!0),T=0;for(s?.smoothed&&c.rowCount&&(s.firstAnchor="firstPoint",s.anchor="middle",s.lastAnchor="lastPoint",K(32,!1,r,{"dataGrouping.smoothed":"use dataGrouping.anchor"})),a=1;a<h.length;a++)h.info.segmentStarts&&-1!==h.info.segmentStarts.indexOf(a)||(T=Math.max(h[a]-h[a-1],T));(p=h.info).gapSize=T,this.closestPointRange=h.info.totalRange,this.groupMap=g.groupMap,this.currentDataGrouping=p,function(t,e,i){let o=t.options.dataGrouping,a=t.currentDataGrouping&&t.currentDataGrouping.gapSize,n=t.getColumn("x");if(!(o&&n.length&&a&&t.groupMap))return;let r=e.length-1,s=o.anchor,l=o.firstAnchor,u=o.lastAnchor,h=e.length-1,p=0;if(l&&n[0]>=e[0]){let i;p++;let o=t.groupMap[0].start,r=t.groupMap[0].length;U(o)&&U(r)&&(i=o+(r-1)),e[0]=({start:e[0],middle:e[0]+.5*a,end:e[0]+a,firstPoint:n[0],lastPoint:i&&n[i]})[l]}if(r>0&&u&&a&&e[r]>=i-a){h--;let i=t.groupMap[t.groupMap.length-1].start;e[r]=({start:e[r],middle:e[r]+.5*a,end:e[r]+a,firstPoint:i&&n[i],lastPoint:n[n.length-1]})[u]}if(s&&"start"!==s){let t=a*({middle:.5,end:1})[s];for(;h>=p;)e[h]+=t,h--}}(this,v||[],e),u&&v&&(J((o=v)[0])&&U(x.min)&&U(x.dataMin)&&o[0]<x.min&&((!J(x.options.min)&&x.min<=x.dataMin||x.min===x.dataMin)&&(x.min=Math.min(o[0],x.min)),x.dataMin=Math.min(o[0],x.dataMin)),J(o[o.length-1])&&U(x.max)&&U(x.dataMax)&&o[o.length-1]>x.max&&((!J(x.options.max)&&U(x.dataMax)&&x.max>=x.dataMax||x.max===x.dataMax)&&(x.max=Math.max(o[o.length-1],x.max)),x.dataMax=Math.max(o[o.length-1],x.dataMax))),s.groupAll&&(this.allGroupedTable=c,v=(c=(d=this.cropData(c,x.min||0,x.max||0)).modified).getColumn("x"),this.cropStart=d.start),this.dataTable.modified=c}else this.groupMap=void 0,this.currentDataGrouping=void 0;this.hasGroupedData=n,this.preventGraphAnimation=(h&&h.totalRange)!==(p&&p.totalRange)}function to(){this.groupedData&&(this.groupedData.forEach(function(t,e){t&&(this.groupedData[e]=t.destroy?t.destroy():null)},this),this.groupedData.length=0,delete this.allGroupedTable)}function ta(){te.apply(this),this.destroyGroupedData(),this.groupedData=this.hasGroupedData?this.points:null}function tn(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("hlc")?"hlc":this.is("column")||this.options.cumulative?"sum":"average"}function tr(t,e,i){let o=t.getColumn("x",!0)||[],a=t.getColumn("y",!0),n=this,r=n.data,s=n.options&&n.options.data,l=[],u=new I,h=[],p=t.rowCount,d=!!a,c=[],m=n.pointArrayMap,f=m&&m.length,y=["x"].concat(m||["y"]),x=(m||["y"]).map(()=>[]),G=this.options.dataGrouping&&this.options.dataGrouping.groupAll,b,M,v,T=0,A=0,w="function"==typeof i?i:i&&g[i]?g[i]:g[n.getDGApproximation&&n.getDGApproximation()||"average"];if(f){let t=m.length;for(;t--;)c.push([])}else c.push([]);let C=f||1;for(let t=0;t<=p;t++)if(!(o[t]<e[0])){for(;void 0!==e[T+1]&&o[t]>=e[T+1]||t===p;){if(b=e[T],n.dataGroupInfo={start:G?A:n.cropStart+A,length:c[0].length,groupStart:b},v=w.apply(n,c),n.pointClass&&!J(n.dataGroupInfo.options)&&(n.dataGroupInfo.options=V(n.pointClass.prototype.optionsToObject.call({series:n},n.options.data[n.cropStart+A])),y.forEach(function(t){delete n.dataGroupInfo.options[t]})),void 0!==v){l.push(b);let t=tt(v);for(let e=0;e<t.length;e++)x[e].push(t[e]);h.push(n.dataGroupInfo)}A=t;for(let t=0;t<C;t++)c[t].length=0,c[t].hasNulls=!1;if(T+=1,t===p)break}if(t===p)break;if(m){let e,i=G?t:n.cropStart+t,o=r&&r[i]||n.pointClass.prototype.applyOptions.apply({series:n},[s[i]]);for(let t=0;t<f;t++)U(e=o[m[t]])?c[t].push(e):null===e&&(c[t].hasNulls=!0)}else U(M=d?a[t]:null)?c[0].push(M):null===M&&(c[0].hasNulls=!0)}let D={x:l};return(m||["y"]).forEach((t,e)=>{D[t]=x[e]}),u.setColumns(D),{groupMap:h,modified:u}}function ts(t){let e=t.options,i=this.type,o=this.chart.options.plotOptions,a=this.useCommonDataGrouping&&v,n=d().defaultOptions.plotOptions[i].dataGrouping;if(o&&(T[i]||a)){let t=this.chart.rangeSelector;n||(n=V(v,T[i])),e.dataGrouping=V(a,n,o.series&&o.series.dataGrouping,o[i].dataGrouping,this.userOptions.dataGrouping,!e.isInternal&&t&&U(t.selected)&&t.buttonOptions[t.selected].dataGrouping)}}let tl=function(t){let e=t.prototype;e.applyGrouping||($(t.prototype.pointClass,"update",function(){if(this.dataGroup)return K(24,!1,this.series.chart),!1}),$(t,"afterSetOptions",ts),$(t,"destroy",to),Q(e,{applyGrouping:ti,destroyGroupedData:to,generatePoints:ta,getDGApproximation:tn,groupData:tr}))};var tu=u(984);let{format:th}=u.n(tu)(),{composed:tp}=d(),{addEvent:td,extend:tg,isNumber:tc,pick:tm,pushUnique:tf}=d();function ty(t){let e=this.chart,i=e.time,o=t.point,a=o.series,n=a.options,r=a.tooltipOptions,s=n.dataGrouping,l=a.xAxis,u=r.xDateFormat||"",h,p,d,g,c,m=r[t.isFooter?"footerFormat":"headerFormat"];if(l&&"datetime"===l.options.type&&s&&tc(o.key)){p=a.currentDataGrouping,d=s.dateTimeLabelFormats||v.dateTimeLabelFormats,p?(g=d[p.unitName],1===p.count?u=g[0]:(u=g[1],h=g[2])):!u&&d&&l.dateTime&&(u=l.dateTime.getXDateFormat(o.x,r.dateTimeLabelFormats));let n=tm(a.groupMap?.[o.index].groupStart,o.key),f=n+(p?.totalRange||0)-1;c=i.dateFormat(u,n),h&&(c+=i.dateFormat(h,f)),a.chart.styledMode&&(m=this.styledModeFormat(m)),t.text=th(m,{point:tg(o,{key:c}),series:a},e),t.preventDefault()}}let tx=d();tx.dataGrouping=tx.dataGrouping||{},tx.dataGrouping.approximationDefaults=tx.dataGrouping.approximationDefaults||M,tx.dataGrouping.approximations=tx.dataGrouping.approximations||g,({compose:function(t,e,i){O(t),tl(e),i&&tf(tp,"DataGrouping")&&td(i,"headerFormatter",ty)},groupData:tr}).compose(tx.Axis,tx.Series,tx.Tooltip);let tG=d();return h.default})());