ml-time-graph 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { u as RenderingContext, F as FlatSeriesStyle } from './marker_renderer-DYSAkVgI.js';
1
+ import { v as RenderingContext, F as FlatSeriesStyle } from './marker_renderer-CSc-t4vB.js';
2
2
  import { Theme, TextMetrics, Marker } from './index.js';
3
- export { v as Layout, w as LayoutConfig, a as LayoutResult, x as LegendConfig, L as LegendItem, e as LegendOrientation, R as Renderer, y as measureLegend, z as renderLegend, B as renderSeriesMarkers, t as slugify } from './marker_renderer-DYSAkVgI.js';
4
- import { a as DrawCommand, L as LinearScale, T as TimeScale, af as LineParams, ag as PathParams, ah as RectParams, ai as CircleParams, aj as TextParams, ak as GapParams, d as DrawGroup, C as AxisOrientation, A as AxisPosition, al as Point, am as BandScale } from './types-RAg4hLZA.js';
3
+ export { w as Layout, x as LayoutConfig, a as LayoutResult, y as LegendConfig, L as LegendItem, e as LegendOrientation, R as Renderer, z as measureLegend, B as renderLegend, C as renderSeriesMarkers, u as slugify } from './marker_renderer-CSc-t4vB.js';
4
+ import { a as DrawCommand, L as LinearScale, T as TimeScale, ag as LineParams, ah as PathParams, ai as RectParams, aj as CircleParams, ak as TextParams, al as GapParams, d as DrawGroup, E as AxisOrientation, A as AxisPosition, am as Point, an as BandScale } from './types-Cei2he4D.js';
5
5
  import { DataPoint, AggregatedPoint, HatchVariant, Threshold, Gap, RangeLabelPosition, GapBand, Highlight, Annotation, MovingAverageType, EnumMap, SmoothingType, PointStyleType, AnnotationBandItem, AnnotationBandLabels, LineVariant, LineShape, FillSpec, GapStyle, TimeSeries } from './index.js';
6
- export { an as BandScaleConfig, ao as Dashstyle_t, ap as DomainScaleConfig, aq as DrawCircle, ar as DrawGap, as as DrawGapType_t, at as DrawLine, au as DrawPath, av as DrawRect, aw as DrawText, r as LabelAnchor, ax as LinearScaleConfig, ay as Scale, az as ScaleConfig, aA as TIME_INTERVALS, aB as TimeScaleConfig, aC as getHatch } from './types-RAg4hLZA.js';
6
+ export { ao as BandScaleConfig, ap as Dashstyle_t, aq as DomainScaleConfig, ar as DrawCircle, as as DrawGap, at as DrawGapType_t, au as DrawLine, av as DrawPath, aw as DrawRect, ax as DrawText, r as LabelAnchor, ay as LinearScaleConfig, az as Scale, aA as ScaleConfig, aB as TIME_INTERVALS, aC as TimeScaleConfig, aD as getHatch } from './types-Cei2he4D.js';
7
7
  import { DataPoint as DataPoint$1 } from './analyze/index.js';
8
8
 
9
9
  /*!
package/dist/internals.js CHANGED
@@ -1,4 +1,4 @@
1
- var K=class{};var C=class{static interpolateDataPoint(i,e,t){return {time:i.time+Math.round(t*(e.time-i.time)),value:(i.value??0)+t*((e.value??0)-(i.value??0)),synthetic:true}}static interpolateAggregatedPoint(i,e,t){let n=(o,r)=>o!==null&&r!==null?o+t*(r-o):null;return {time:i.time+t*(e.time-i.time),min:n(i.min,e.min),max:n(i.max,e.max),avg:n(i.avg,e.avg),count:Math.round(i.count+t*(e.count-i.count))}}static getRuns(i,e,t=0){let n=[...i].sort((s,a)=>s.time-a.time),o=[],r=[],l=null;for(let s of n){let a=e(s),m=t>0&&l&&s.time-l.time>t;(a||m)&&r.length&&(o.push(r),r=[]),a||r.push(s),l=s;}return r.length&&o.push(r),o}static splitByBoundaries(i,e,t,n){if(i.length===0)return [];if(e.length===0)return [{data:i,zoneIndex:0,zoneLow:Number.NEGATIVE_INFINITY}];let o=[...e].sort((m,d)=>m-d),r=[],l=m=>m<=0?Number.NEGATIVE_INFINITY:o[m-1],s=m=>{let d=0;for(let c=0;c<o.length&&m>=o[c];c++)d=c+1;return d},a=[i[0]];for(let m=1;m<i.length;m++){let d=i[m-1],c=i[m],p=t(d),h=t(c),u;h>p?u=o.filter(g=>g>p&&g<=h):h<p?u=o.filter(g=>g>=h&&g<p).reverse():u=[];let b=p;for(let g of u){let y=(g-p)/(h-p),x=n(d,c,y);a.push(x);let S=s((b+g)/2);r.push({data:a,zoneIndex:S,zoneLow:l(S)}),a=[x],b=g;}(u.length===0||u[u.length-1]!==h)&&a.push(c);}if(a.length>1||i.length===1){let m=t(a[0]),d=t(a[a.length-1]),c=s((m+d)/2);r.push({data:a,zoneIndex:c,zoneLow:l(c)});}return r}static splitByThreshold(i,e,t,n){let o=this.splitByBoundaries(i,[e],t,n),r={above:[],below:[]};for(let l of o)l.zoneIndex===0?r.below.push(l.data):r.above.push(l.data);return r}};var Se=class{static compute(i){let e=i.map(s=>s.value).filter(s=>s!==null).sort((s,a)=>s-a);if(e.length===0)return {min:NaN,max:NaN,avg:NaN,mean:NaN,median:NaN,stdDev:NaN,count:0};let t=e.length,n=e.reduce((s,a)=>s+a,0)/t,o=t%2===1?e[Math.floor(t/2)]:(e[t/2-1]+e[t/2])/2,r=e.reduce((s,a)=>s+Math.pow(a-n,2),0)/t,l=Math.sqrt(r);return {min:e[0],max:e[t-1],avg:n,mean:n,median:o,stdDev:l,count:t}}static computeInRange(i,e,t){let n=i.filter(o=>o.time>=e&&o.time<=t);return this.compute(n)}};function q(i,e,t,n,o){let r=[...e].sort((s,a)=>s-a);return C.splitByBoundaries(i,r.map(s=>o.zeichenwert(s)),s=>o.zeichenwert(t(s)),n).map(s=>({data:s.data,zoneIndex:s.zoneIndex,zoneLow:s.zoneIndex<=0?Number.NEGATIVE_INFINITY:r[s.zoneIndex-1]}))}function we(i,e,t,n,o){let r={above:[],below:[]};for(let l of q(i,[e],t,n,o))l.zoneIndex===0?r.below.push(l.data):r.above.push(l.data);return r}function Te(i){return (e,t,n)=>{let o=i.zeichenwert(e.value??0),r=i.zeichenwert(t.value??0);return {...C.interpolateDataPoint(e,t,n),value:i.wert(o+n*(r-o))}}}function ke(i){return (e,t,n)=>{let o=(r,l)=>{if(r===null||l===null)return null;let s=i.zeichenwert(r);return i.wert(s+n*(i.zeichenwert(l)-s))};return {...C.interpolateAggregatedPoint(e,t,n),min:o(e.min,t.min),max:o(e.max,t.max),avg:o(e.avg,t.avg)}}}function J(i){let e=[];for(let t of i)e.length===0?e.push(t):e.push({x:t.x,y:e[e.length-1].y},t);return e}function Oe(i){let e=[];for(let t of i)e.length>0&&e.push({...t,value:e[e.length-1].value}),e.push(t);return e}function P(i){return {id:i.id,line:{stroke:i.stroke??f.stroke,strokeWidth:i.strokeWidth??f.strokeWidth,smoothing:i.smoothing??false,smoothingType:i.smoothingType,dashed:i.dashed??false},fill:i.fill??f.areaFillAlpha,markers:{type:i.pointStyle??"none",size:i.pointSize??f.pointSize,stroke:i.stroke??f.stroke,fill:"#ffffff"},shadow:{color:i.shadowColor??"transparent",blur:i.shadowBlur??0,offsetX:i.shadowOffsetX??0,offsetY:i.shadowOffsetY??0}}}function Ee(i,e,t,n){let o=we(i,e,l=>l.value,Te(t.valueScale),t.valueScale),r=[];return n.below&&r.push(...L(o.below.map(l=>({data:l})),t,n.below)),n.above&&r.push(...L(o.above.map(l=>({data:l})),t,n.above)),r}function L(i,e,t){let n=[],o=P(t);for(let r=0;r<i.length;r++){let l=i[r];l.data.length>=2?n.push({type:"path",cssClass:"series-line",id:t.id?`${t.id}-line-${r}`:void 0,points:l.data.map(s=>({x:e.timeScale.map(s.time),y:e.valueScale.map(s.value)})),stroke:l.color??o.line.stroke,strokeWidth:o.line.strokeWidth,smoothing:o.line.smoothing,smoothingType:o.line.smoothingType,dashed:o.line.dashed,shadowColor:o.shadow.color,shadowBlur:o.shadow.blur,shadowOffsetX:o.shadow.offsetX,shadowOffsetY:o.shadow.offsetY,fill:"none"}):l.data.length===1&&n.push({type:"circle",id:t.id?`${t.id}-dot-${r}`:void 0,cx:e.timeScale.map(l.data[0].time),cy:e.valueScale.map(l.data[0].value),r:Math.max(o.markers.size,o.line.strokeWidth),fill:l.color??o.line.stroke,shadowColor:o.shadow.color,shadowBlur:o.shadow.blur});}return n}function Q(i,e,t){let n=[],o=P(t);for(let r=0;r<i.length;r++){let l=i[r];if(l.data.length<2)continue;let s=J(l.data.map(a=>({x:e.timeScale.map(a.time),y:e.valueScale.map(a.value)})));n.push({type:"path",cssClass:"series-line",id:t.id?`${t.id}-line-${r}`:void 0,points:s,stroke:l.color??o.line.stroke,strokeWidth:o.line.strokeWidth,smoothing:false,fill:"none"});}return n}function Ge(i,e,t,n,o){let r=[],l=P(t);for(let s=0;s<i.length;s++){let a=i[s];if(a.data.length<2)continue;let m=a.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(n(c))})),d=a.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(o(c))})).reverse();r.push({type:"path",cssClass:"series-fill",id:t.id?`${t.id}-fill-${s}`:void 0,points:[...m,...d],fill:a.color??l.fill,hatch:t.hatch,stroke:"none"});}return r}function ee(i,e,t,n){if(i.length<2)return [];let o=q(i,t.boundaries,t.getValue,t.interpolate,e.valueScale),r=[];for(let l=0;l<o.length;l++){let s=o[l];if(s.data.length<2)continue;let a=t.getColor(s.zoneIndex);if(!a)continue;let m=s.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(t.yLow(c))})),d=s.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(t.yHigh(c))})).reverse();r.push({type:"path",cssClass:"series-fill",id:n?.id?`${n.id}-fill-${l}`:void 0,points:[...m,...d],fill:a,hatch:t.getHatch?.(s.zoneIndex),stroke:"none",...n?.smoothing?{smoothing:true,smoothingType:n.smoothingType,smoothCount:s.data.length,smoothTail:s.data.length}:{}});}return r}function te(i,e,t,n){let o=P(t);if(!o.markers.type||o.markers.type==="none")return [];let r=[];for(let l=0;l<i.length;l++){let s=i[l],a=e.timeScale.map(s.time),m=e.valueScale.map(s.value),d=n(s),c=t.pointStroke??d,p=t.pointFill??d,h=t.pointStrokeWidth??1.5,u=t.id?`${t.id}-marker-${l}`:void 0;ne(r,u,o.markers.type,a,m,o.markers.size,c,p,h);}return r.length===0?[]:[{type:"group",cssClass:"series-markers",sharedStyles:true,commands:r}]}function ne(i,e,t,n,o,r,l,s,a){let m=d=>e===void 0?void 0:`${e}-${d}`;switch(t){case "circle":i.push({type:"circle",cx:n,cy:o,r,fill:s,stroke:l,strokeWidth:a,id:e});break;case "square":i.push({type:"rect",x:n-r,y:o-r,w:r*2,h:r*2,fill:s,stroke:l,strokeWidth:a,id:e});break;case "cross":i.push({type:"line",x1:n-r,y1:o-r,x2:n+r,y2:o+r,stroke:l,strokeWidth:a,id:e},{type:"line",x1:n-r,y1:o+r,x2:n+r,y2:o-r,stroke:l,strokeWidth:a,id:m(2)});break;case "diamond":i.push({type:"path",points:[{x:n,y:o-r},{x:n+r,y:o},{x:n,y:o+r},{x:n-r,y:o}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "triangle":i.push({type:"path",points:[{x:n,y:o-r},{x:n+r,y:o+r},{x:n-r,y:o+r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "star":{let d=[];for(let c=0;c<10;c++){let p=c%2===0?r:r*.5,h=Math.PI/2*3+c*Math.PI/5;d.push({x:n+p*Math.cos(h),y:o+p*Math.sin(h)});}i.push({type:"path",points:d,closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break}case "arrow":i.push({type:"path",points:[{x:n-r,y:o+r},{x:n,y:o-r},{x:n+r,y:o+r}],stroke:l,strokeWidth:a,fill:"none",id:e});break;case "plus":i.push({type:"line",x1:n-r,y1:o,x2:n+r,y2:o,stroke:l,strokeWidth:a,id:e},{type:"line",x1:n,y1:o-r,x2:n,y2:o+r,stroke:l,strokeWidth:a,id:m(2)});break;case "triangle-down":i.push({type:"path",points:[{x:n,y:o+r},{x:n+r,y:o-r},{x:n-r,y:o-r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "hexagon":{let d=[];for(let c=0;c<6;c++){let p=c*(Math.PI/3);d.push({x:n+r*Math.cos(p),y:o+r*Math.sin(p)});}i.push({type:"path",points:d,closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break}case "hourglass":i.push({type:"path",points:[{x:n-r,y:o-r},{x:n+r,y:o-r},{x:n-r,y:o+r},{x:n+r,y:o+r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "line-horizontal":i.push({type:"line",x1:n-r,y1:o,x2:n+r,y2:o,stroke:l,strokeWidth:a,id:e});break;default:i.push({type:"circle",cx:n,cy:o,r,fill:s,stroke:l,strokeWidth:a,id:e});}}var He=[[32,126,"278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584"],[160,255,"278,333,556,556,556,556,260,556,333,737,370,556,584,333,737,552,400,549,333,333,333,576,537,333,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500"]],ve=.6,Ve=(()=>{let i=new Map;for(let[e,,t]of He){let n=t.split(",");for(let o=0;o<n.length;o++)i.set(e+o,Number(n[o])/1e3);}return i})();function Ce(i){return Ve.get(i)??ve}var A=(i,e)=>{let t=0;for(let n of i)t+=Ce(n.codePointAt(0)??0);return t*e};var Me={fontFamily:"Liberation Sans, Arial, Helvetica, sans-serif",stroke:"#4285f4",strokeWidth:2,pointSize:4,pointThreshold:100,gapThreshold:0,fill:"none",hatch:null,bandFill:"#4285f4",bandOpacity:.6,bandAvgLine:"#e53e3e",minColor:"#3b82f6",maxColor:"#ef4444",avgColor:"#64748b",areaFillAlpha:"4285f433",axisColor:"#ccc",tickColor:"#ddd",textColor:"#777",textSize:11,axisLabelColor:"#444",axisLabelSize:12,gridStroke:"#e2e8f0",gridStrokeWidth:1,gridOpacity:1,legendStroke:"#ccc",legendText:"#333",legendFont:11,annotationColor:"#334155",annotationWidth:1.5,annotationHead:9,annotationRadius:4,annotationFontSize:11,markerFontSize:11,statFontSize:10,tooltipTimeFontSize:10,tooltipValueFontSize:11,thresholdColor:"#666",thresholdLine:"dashed",thresholdFillOpacity:.12,thresholdFontSize:10,highlightColor:"#fbbf24",highlightOpacity:.2,highlightLabelColor:"#92400e",markerColor:"#f59e0b",markerSize:5,gapFill:"#fff",gapStroke:"#ccc",gapStrokeWidth:1,gapFontColor:"#999",gapFontSize:10,gapFillOpacity:.15,tooltipBg:"#fff",tooltipBorder:"#cbd5e1",tooltipText:"#1e293b",tooltipValue:"#3b82f6",tooltipCrosshair:"#94a3b8",tooltipSnapRadius:20,statsLineColor:"#94a3b8",statsLabelColor:"#64748b",minimapStroke:"#94a3b8",minimapBg:"#f8f9fa",minimapBrush:"#3b82f644",palette:["#4285f4","#ea4335","#22c55e","#fbbc05","#9334ea","#12b5e5","#fb923c","#6366f1"]};var Ne={...Me};function D(){return Ne}function Ye(i){let e=i.trim();if(e.startsWith("#"))return e.length===9?e.slice(0,7):e.length===5?e.slice(0,4):e;if(e.toLowerCase().startsWith("rgba(")){let n=e.slice(5,e.lastIndexOf(")")).split(",");if(n.length===4)return `rgb(${n[0].trim()}, ${n[1].trim()}, ${n[2].trim()})`}return e}function Ze(i){let e=i.trim().toLowerCase();return e.startsWith("#")?e.length===9||e.length===5:e.startsWith("rgba(")||e.startsWith("hsla(")}function Le(i,e="classic-diagonal",t="rgba(200, 220, 255, 0.3)",n,o=2){let r=n??Ye(t),l=Ze(t)?"":' fill-opacity="0.3"';if(e==="none")return `
1
+ var K=class{};var C=class{static interpolateDataPoint(i,e,t){return {time:i.time+Math.round(t*(e.time-i.time)),value:(i.value??0)+t*((e.value??0)-(i.value??0)),synthetic:true}}static interpolateAggregatedPoint(i,e,t){let n=(o,r)=>o!==null&&r!==null?o+t*(r-o):null;return {time:i.time+t*(e.time-i.time),min:n(i.min,e.min),max:n(i.max,e.max),avg:n(i.avg,e.avg),count:Math.round(i.count+t*(e.count-i.count))}}static getRuns(i,e,t=0){let n=[...i].sort((s,a)=>s.time-a.time),o=[],r=[],l=null;for(let s of n){let a=e(s),m=t>0&&l&&s.time-l.time>t;(a||m)&&r.length&&(o.push(r),r=[]),a||r.push(s),l=s;}return r.length&&o.push(r),o}static splitByBoundaries(i,e,t,n){if(i.length===0)return [];if(e.length===0)return [{data:i,zoneIndex:0,zoneLow:Number.NEGATIVE_INFINITY}];let o=[...e].sort((m,d)=>m-d),r=[],l=m=>m<=0?Number.NEGATIVE_INFINITY:o[m-1],s=m=>{let d=0;for(let c=0;c<o.length&&m>=o[c];c++)d=c+1;return d},a=[i[0]];for(let m=1;m<i.length;m++){let d=i[m-1],c=i[m],p=t(d),h=t(c),u;h>p?u=o.filter(g=>g>p&&g<=h):h<p?u=o.filter(g=>g>=h&&g<p).reverse():u=[];let b=p;for(let g of u){let y=(g-p)/(h-p),x=n(d,c,y);a.push(x);let S=s((b+g)/2);r.push({data:a,zoneIndex:S,zoneLow:l(S)}),a=[x],b=g;}(u.length===0||u[u.length-1]!==h)&&a.push(c);}if(a.length>1||i.length===1){let m=t(a[0]),d=t(a[a.length-1]),c=s((m+d)/2);r.push({data:a,zoneIndex:c,zoneLow:l(c)});}return r}static splitByThreshold(i,e,t,n){let o=this.splitByBoundaries(i,[e],t,n),r={above:[],below:[]};for(let l of o)l.zoneIndex===0?r.below.push(l.data):r.above.push(l.data);return r}};var Te=class{static compute(i){let e=i.map(s=>s.value).filter(s=>s!==null).sort((s,a)=>s-a);if(e.length===0)return {min:NaN,max:NaN,avg:NaN,mean:NaN,median:NaN,stdDev:NaN,count:0};let t=e.length,n=e.reduce((s,a)=>s+a,0)/t,o=t%2===1?e[Math.floor(t/2)]:(e[t/2-1]+e[t/2])/2,r=e.reduce((s,a)=>s+Math.pow(a-n,2),0)/t,l=Math.sqrt(r);return {min:e[0],max:e[t-1],avg:n,mean:n,median:o,stdDev:l,count:t}}static computeInRange(i,e,t){let n=i.filter(o=>o.time>=e&&o.time<=t);return this.compute(n)}};function q(i,e,t,n,o){let r=[...e].sort((s,a)=>s-a);return C.splitByBoundaries(i,r.map(s=>o.zeichenwert(s)),s=>o.zeichenwert(t(s)),n).map(s=>({data:s.data,zoneIndex:s.zoneIndex,zoneLow:s.zoneIndex<=0?Number.NEGATIVE_INFINITY:r[s.zoneIndex-1]}))}function we(i,e,t,n,o){let r={above:[],below:[]};for(let l of q(i,[e],t,n,o))l.zoneIndex===0?r.below.push(l.data):r.above.push(l.data);return r}function ke(i){return (e,t,n)=>{let o=i.zeichenwert(e.value??0),r=i.zeichenwert(t.value??0);return {...C.interpolateDataPoint(e,t,n),value:i.wert(o+n*(r-o))}}}function ve(i){return (e,t,n)=>{let o=(r,l)=>{if(r===null||l===null)return null;let s=i.zeichenwert(r);return i.wert(s+n*(i.zeichenwert(l)-s))};return {...C.interpolateAggregatedPoint(e,t,n),min:o(e.min,t.min),max:o(e.max,t.max),avg:o(e.avg,t.avg)}}}function J(i){let e=[];for(let t of i)e.length===0?e.push(t):e.push({x:t.x,y:e[e.length-1].y},t);return e}function Ge(i){let e=[];for(let t of i)e.length>0&&e.push({...t,value:e[e.length-1].value}),e.push(t);return e}function P(i){return {id:i.id,line:{stroke:i.stroke??f.stroke,strokeWidth:i.strokeWidth??f.strokeWidth,smoothing:i.smoothing??false,smoothingType:i.smoothingType,dashed:i.dashed??false},fill:i.fill??f.areaFillAlpha,markers:{type:i.pointStyle??"none",size:i.pointSize??f.pointSize,stroke:i.stroke??f.stroke,fill:"#ffffff"},shadow:{color:i.shadowColor??"transparent",blur:i.shadowBlur??0,offsetX:i.shadowOffsetX??0,offsetY:i.shadowOffsetY??0}}}function He(i,e,t,n){let o=we(i,e,l=>l.value,ke(t.valueScale),t.valueScale),r=[];return n.below&&r.push(...L(o.below.map(l=>({data:l})),t,n.below)),n.above&&r.push(...L(o.above.map(l=>({data:l})),t,n.above)),r}function L(i,e,t){let n=[],o=P(t);for(let r=0;r<i.length;r++){let l=i[r];l.data.length>=2?n.push({type:"path",cssClass:"series-line",id:t.id?`${t.id}-line-${r}`:void 0,points:l.data.map(s=>({x:e.timeScale.map(s.time),y:e.valueScale.map(s.value)})),stroke:l.color??o.line.stroke,strokeWidth:o.line.strokeWidth,smoothing:o.line.smoothing,smoothingType:o.line.smoothingType,dashed:o.line.dashed,shadowColor:o.shadow.color,shadowBlur:o.shadow.blur,shadowOffsetX:o.shadow.offsetX,shadowOffsetY:o.shadow.offsetY,fill:"none"}):l.data.length===1&&n.push({type:"circle",id:t.id?`${t.id}-dot-${r}`:void 0,cx:e.timeScale.map(l.data[0].time),cy:e.valueScale.map(l.data[0].value),r:Math.max(o.markers.size,o.line.strokeWidth),fill:l.color??o.line.stroke,shadowColor:o.shadow.color,shadowBlur:o.shadow.blur});}return n}function Q(i,e,t){let n=[],o=P(t);for(let r=0;r<i.length;r++){let l=i[r];if(l.data.length<2)continue;let s=J(l.data.map(a=>({x:e.timeScale.map(a.time),y:e.valueScale.map(a.value)})));n.push({type:"path",cssClass:"series-line",id:t.id?`${t.id}-line-${r}`:void 0,points:s,stroke:l.color??o.line.stroke,strokeWidth:o.line.strokeWidth,smoothing:false,fill:"none"});}return n}function Ve(i,e,t,n,o){let r=[],l=P(t);for(let s=0;s<i.length;s++){let a=i[s];if(a.data.length<2)continue;let m=a.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(n(c))})),d=a.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(o(c))})).reverse();r.push({type:"path",cssClass:"series-fill",id:t.id?`${t.id}-fill-${s}`:void 0,points:[...m,...d],fill:a.color??l.fill,hatch:t.hatch,stroke:"none"});}return r}function ee(i,e,t,n){if(i.length<2)return [];let o=q(i,t.boundaries,t.getValue,t.interpolate,e.valueScale),r=[];for(let l=0;l<o.length;l++){let s=o[l];if(s.data.length<2)continue;let a=t.getColor(s.zoneIndex);if(!a)continue;let m=s.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(t.yLow(c))})),d=s.data.map(c=>({x:e.timeScale.map(c.time),y:e.valueScale.map(t.yHigh(c))})).reverse();r.push({type:"path",cssClass:"series-fill",id:n?.id?`${n.id}-fill-${l}`:void 0,points:[...m,...d],fill:a,hatch:t.getHatch?.(s.zoneIndex),stroke:"none",...n?.smoothing?{smoothing:true,smoothingType:n.smoothingType,smoothCount:s.data.length,smoothTail:s.data.length}:{}});}return r}function te(i,e,t,n){let o=P(t);if(!o.markers.type||o.markers.type==="none")return [];let r=[];for(let l=0;l<i.length;l++){let s=i[l],a=e.timeScale.map(s.time),m=e.valueScale.map(s.value),d=n(s),c=t.pointStroke??d,p=t.pointFill??d,h=t.pointStrokeWidth??1.5,u=t.id?`${t.id}-marker-${l}`:void 0;ne(r,u,o.markers.type,a,m,o.markers.size,c,p,h);}return r.length===0?[]:[{type:"group",cssClass:"series-markers",sharedStyles:true,commands:r}]}function ne(i,e,t,n,o,r,l,s,a){let m=d=>e===void 0?void 0:`${e}-${d}`;switch(t){case "circle":i.push({type:"circle",cx:n,cy:o,r,fill:s,stroke:l,strokeWidth:a,id:e});break;case "square":i.push({type:"rect",x:n-r,y:o-r,w:r*2,h:r*2,fill:s,stroke:l,strokeWidth:a,id:e});break;case "cross":i.push({type:"line",x1:n-r,y1:o-r,x2:n+r,y2:o+r,stroke:l,strokeWidth:a,id:e},{type:"line",x1:n-r,y1:o+r,x2:n+r,y2:o-r,stroke:l,strokeWidth:a,id:m(2)});break;case "diamond":i.push({type:"path",points:[{x:n,y:o-r},{x:n+r,y:o},{x:n,y:o+r},{x:n-r,y:o}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "triangle":i.push({type:"path",points:[{x:n,y:o-r},{x:n+r,y:o+r},{x:n-r,y:o+r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "star":{let d=[];for(let c=0;c<10;c++){let p=c%2===0?r:r*.5,h=Math.PI/2*3+c*Math.PI/5;d.push({x:n+p*Math.cos(h),y:o+p*Math.sin(h)});}i.push({type:"path",points:d,closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break}case "arrow":i.push({type:"path",points:[{x:n-r,y:o+r},{x:n,y:o-r},{x:n+r,y:o+r}],stroke:l,strokeWidth:a,fill:"none",id:e});break;case "plus":i.push({type:"line",x1:n-r,y1:o,x2:n+r,y2:o,stroke:l,strokeWidth:a,id:e},{type:"line",x1:n,y1:o-r,x2:n,y2:o+r,stroke:l,strokeWidth:a,id:m(2)});break;case "triangle-down":i.push({type:"path",points:[{x:n,y:o+r},{x:n+r,y:o-r},{x:n-r,y:o-r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "hexagon":{let d=[];for(let c=0;c<6;c++){let p=c*(Math.PI/3);d.push({x:n+r*Math.cos(p),y:o+r*Math.sin(p)});}i.push({type:"path",points:d,closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break}case "hourglass":i.push({type:"path",points:[{x:n-r,y:o-r},{x:n+r,y:o-r},{x:n-r,y:o+r},{x:n+r,y:o+r}],closed:true,fill:s,stroke:l,strokeWidth:a,id:e});break;case "line-horizontal":i.push({type:"line",x1:n-r,y1:o,x2:n+r,y2:o,stroke:l,strokeWidth:a,id:e});break;default:i.push({type:"circle",cx:n,cy:o,r,fill:s,stroke:l,strokeWidth:a,id:e});}}var Ne=[[32,126,"278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584"],[160,255,"278,333,556,556,556,556,260,556,333,737,370,556,584,333,737,552,400,549,333,333,333,576,537,333,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500"]],Xe=[[32,126,"278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584"],[160,255,"278,333,556,556,556,556,280,556,333,737,370,556,584,333,737,552,400,549,333,333,333,576,556,333,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1000,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556"]],Ce=.6;function Me(i){let e=new Map;for(let[t,,n]of i){let o=n.split(",");for(let r=0;r<o.length;r++)e.set(t+r,Number(o[r])/1e3);}return e}var Ye=Me(Ne),Ze=Me(Xe);function re(i,e=false){return (e?Ze:Ye).get(i)??Ce}var D=(i,e)=>{let t=0;for(let n of i)t+=re(n.codePointAt(0)??0);return t*e},Ue=(i,e)=>{let t=0;for(let n of i)t+=re(n.codePointAt(0)??0,true);return t*e};function Le(i,e){return e==="bold"&&i===D?Ue:i}var De={fontFamily:"Liberation Sans, Arial, Helvetica, sans-serif",stroke:"#4285f4",strokeWidth:2,pointSize:4,pointThreshold:100,gapThreshold:0,fill:"none",hatch:null,bandFill:"#4285f4",bandOpacity:.6,bandAvgLine:"#e53e3e",minColor:"#3b82f6",maxColor:"#ef4444",avgColor:"#64748b",areaFillAlpha:"4285f433",axisColor:"#ccc",tickColor:"#ddd",textColor:"#777",textSize:11,axisLabelColor:"#444",axisLabelSize:12,gridStroke:"#e2e8f0",gridStrokeWidth:1,gridOpacity:1,legendStroke:"#ccc",legendText:"#333",legendFont:11,annotationColor:"#334155",annotationWidth:1.5,annotationHead:9,annotationRadius:4,annotationFontSize:11,markerFontSize:11,statFontSize:10,tooltipTimeFontSize:10,tooltipValueFontSize:11,thresholdColor:"#666",thresholdLine:"dashed",thresholdFillOpacity:.12,thresholdFontSize:10,highlightColor:"#fbbf24",highlightOpacity:.2,highlightLabelColor:"#92400e",markerColor:"#f59e0b",markerSize:5,gapFill:"#fff",gapStroke:"#ccc",gapStrokeWidth:1,gapFontColor:"#999",gapFontSize:10,gapFillOpacity:.15,tooltipBg:"#fff",tooltipBorder:"#cbd5e1",tooltipText:"#1e293b",tooltipValue:"#3b82f6",tooltipCrosshair:"#94a3b8",tooltipSnapRadius:20,statsLineColor:"#94a3b8",statsLabelColor:"#64748b",minimapStroke:"#94a3b8",minimapBg:"#f8f9fa",minimapBrush:"#3b82f644",palette:["#4285f4","#ea4335","#22c55e","#fbbc05","#9334ea","#12b5e5","#fb923c","#6366f1"]};var Ke={...De};function A(){return Ke}function Je(i){let e=i.trim();if(e.startsWith("#"))return e.length===9?e.slice(0,7):e.length===5?e.slice(0,4):e;if(e.toLowerCase().startsWith("rgba(")){let n=e.slice(5,e.lastIndexOf(")")).split(",");if(n.length===4)return `rgb(${n[0].trim()}, ${n[1].trim()}, ${n[2].trim()})`}return e}function Qe(i){let e=i.trim().toLowerCase();return e.startsWith("#")?e.length===9||e.length===5:e.startsWith("rgba(")||e.startsWith("hsla(")}function Ae(i,e="classic-diagonal",t="rgba(200, 220, 255, 0.3)",n,o=2){let r=n??Je(t),l=Qe(t)?"":' fill-opacity="0.3"';if(e==="none")return `
2
2
  <pattern id="${i}" width="10" height="10" patternUnits="userSpaceOnUse">
3
3
  <rect width="10" height="10" fill="${t}" />
4
4
  </pattern>
@@ -21,10 +21,10 @@ var K=class{};var C=class{static interpolateDataPoint(i,e,t){return {time:i.time
21
21
  ${c}
22
22
  ${d}
23
23
  </pattern>
24
- `.trim()}var f=new Proxy({},{get:(i,e)=>D()[e],has:(i,e)=>e in D(),ownKeys:()=>Reflect.ownKeys(D()),getOwnPropertyDescriptor:(i,e)=>Reflect.getOwnPropertyDescriptor(D(),e)});var I=class i{#e=[];get commands(){return [...this.#e]}get length(){return this.#e.length}line(e){return this.#e.push({type:"line",...e}),this}path(e){return this.#e.push({type:"path",...e}),this}rect(e){return this.#e.push({type:"rect",...e}),this}circle(e){return this.#e.push({type:"circle",...e}),this}text(e){return this.#e.push({type:"text",...e}),this}gap(e){return this.#e.push({type:"gap",...e}),this}push(...e){return this.#e.push(...e),this}group(e,t){let n=new i;return t(n),n.length===0?this:(this.#e.push({type:"group",...e,commands:n.commands}),this)}toGroup(e={}){return {type:"group",...e,commands:this.commands}}};var Ue="#ffffff",Ke="#cccccc",qe=6,Je=.85,T=12,N=8,z=20,Qe=11,V=18,re=(i,e)=>e(i,Qe);function De(i,e,t){let n=s=>T+N+re(s.name,e);if(t===void 0){let s=i.reduce((a,m)=>a+n(m)+V,0)-V;return [{items:i,breite:Math.max(0,s)}]}let o=[],r=[],l=0;for(let s of i){let a=n(s),m=r.length===0?a:l+V+a;r.length>0&&m>t?(o.push({items:r,breite:l}),r=[s],l=a):(r=[...r,s],l=m);}return r.length>0&&o.push({items:r,breite:l}),o}function Ae(i,e="vertical",t=A,n){if(e==="horizontal"){let r=De(i,t,n);return {width:r.reduce((l,s)=>Math.max(l,s.breite),0),height:r.length*z}}let o=0;for(let r of i)o=Math.max(o,re(r.name,t));return {width:T+N+o,height:i.length*z}}function et(i){let{items:e,x:t,y:n,orientation:o="vertical",metrics:r=A,maxBreite:l,box:s,itemClass:a}=i,m=new I;if(s&&e.length>0){let h=Ae(e,o,r,l),b=((o==="horizontal"?h.height/z:e.length)-1)*z+T,g=s.padding??qe,y=s.stroke??Ke;m.rect({x:t-g,y:n-g,w:h.width+2*g,h:b+2*g,fill:s.fill??Ue,...y==="none"?{}:{stroke:y,strokeWidth:s.strokeWidth??1},opacity:s.opacity??Je});}let d=o==="horizontal"?De(e,r,l):e.map(h=>({items:[h],breite:0})),c=new Map;d.forEach((h,u)=>{let b=t;for(let g of h.items)c.set(g,{x:b,y:n+u*z}),b+=T+N+re(g.name,r)+V;});let p=e.some(h=>h.line!==void 0&&h.line!=="solid"&&h.line!=="none");return e.forEach(h=>{let u=c.get(h)??{x:t,y:n},b=u.x,g=u.y,y=["legend-item"];h.id&&y.push(`legend-item--${h.id}`),a&&y.push(a),m.group({cssClass:y.join(" "),...h.id?{id:`legend-${h.id}`}:{}},x=>{nt(x,h,b,g,p),x.text({content:h.name,x:b+T+N,y:g+T-2,fontSize:f.legendFont,fill:f.legendText});});}),m.toGroup({cssClass:"chart-legend"})}function tt(i){return Math.min(Math.max(i??2,1.5),3)}function nt(i,e,t,n,o){let r=e.colors&&e.colors.length>=2?e.colors:[e.color],l=T/r.length;if(o){r.forEach((s,a)=>{let m=t+a*l;i.line({x1:m,y1:n+T/2,x2:m+l,y2:n+T/2,stroke:s,strokeWidth:tt(e.width),...e.line&&e.line!=="solid"?{dash:e.line}:{}});});return}if(r.length===1){i.rect({x:t,y:n,w:T,h:T,fill:r[0],stroke:f.legendStroke,strokeWidth:1});return}r.forEach((s,a)=>{i.rect({x:t+a*l,y:n,w:l,h:T,fill:s});}),i.rect({x:t,y:n,w:T,h:T,fill:"none",stroke:f.legendStroke,strokeWidth:1});}function rt(i){let{xTicks:e,yTicks:t,xRange:n,yRange:o,stroke:r=f.gridStroke,strokeWidth:l=f.gridStrokeWidth,dashed:s=false,opacity:a=f.gridOpacity}=i,m=[];if(t)for(let d of t)m.push({type:"line",x1:n[0],y1:d,x2:n[1],y2:d,stroke:r,strokeWidth:l,dashed:s,opacity:a});if(e)for(let d of e)m.push({type:"line",x1:d,y1:o[0],x2:d,y2:o[1],stroke:r,strokeWidth:l,dashed:s,opacity:a});return m}var _e=new Map;function ot(i,e){return `${i}|${JSON.stringify(e??{})}`}function B(i,e){let t=ot(i,e),n=_e.get(t);return n||(n=new Intl.DateTimeFormat(i,e),_e.set(t,n)),n}function X(){return typeof navigator<"u"?navigator.language:void 0}var _=class{#e;#t;constructor(e){this.#e=[...e.domain],this.#t=[...e.range];}zeichenwert(e){return e}wert(e){return e}randZeichenwert(e){return this.zeichenwert(e)}map(e){let t=this.zeichenwert(Number(e)),n=this.randZeichenwert(this.#e[0]),o=this.randZeichenwert(this.#e[1]),[r,l]=this.#t;return o===n?r:r+(t-n)/(o-n)*(l-r)}invert(e){let t=this.randZeichenwert(this.#e[0]),n=this.randZeichenwert(this.#e[1]),[o,r]=this.#t;return r===o?this.#e[0]:this.wert(t+(e-o)/(r-o)*(n-t))}domain(){return [...this.#e]}range(){return [...this.#t]}},Y=class extends _{#e;constructor(e){super(e),this.#e=e.untergrenze??Math.min(e.domain[0],e.domain[1]);}get untergrenze(){return this.#e}zeichenwert(e){return Math.log(Math.max(e,this.#e))/Math.LN10}wert(e){return 10**e}randZeichenwert(e){return Math.log(e)/Math.LN10}},k=[{label:"second",ms:1e3},{label:"2_seconds",ms:2e3},{label:"5_seconds",ms:5e3},{label:"10_seconds",ms:1e4},{label:"30_seconds",ms:3e4},{label:"minute",ms:6e4},{label:"5_minutes",ms:3e5},{label:"15_minutes",ms:9e5},{label:"30_minutes",ms:18e5},{label:"hour",ms:36e5},{label:"3_hours",ms:108e5},{label:"6_hours",ms:216e5},{label:"day",ms:864e5},{label:"week",ms:6048e5},{label:"month",ms:2592e6},{label:"3_months",ms:7776e6},{label:"6_months",ms:15552e6},{label:"year",ms:31536e6},{label:"2_years",ms:63072e6},{label:"5_years",ms:15768e7}],O=class{#e;#t;#n;constructor(e){this.#e=new _({domain:e.domain,range:e.range}),this.#t=e.locale||(X()??"en-US"),this.#n=e.timeZone;}map(e){return this.#e.map(Number(e))}invert(e){return this.#e.invert(e)}domain(){return this.#e.domain()}range(){return this.#e.range()}get timeZone(){return this.#n}get locale(){return this.#t}tickInterval(e,t=3,n=12){let[o,r]=this.#e.domain(),l=r-o;if(l<=0)return {interval:k[0].ms};let s=l/e,a=k[0].ms;for(let c of k)if(c.ms>=s){a=c.ms;break}let m=a,d=Math.round(l/m);for(;d>n&&m<k[k.length-1].ms;){let c=k.findIndex(p=>p.ms===m);m=k[Math.min(c+1,k.length-1)].ms,d=Math.round(l/m);}for(;d<t&&m>k[0].ms;){let c=k.findIndex(p=>p.ms===m);m=k[Math.max(c-1,0)].ms,d=Math.round(l/m);}return {interval:m}}ticks(e){let t=e?.minTicks??5,n=e?.maxTicks??12,{interval:o}=this.tickInterval((t+n)/2,t,n),[r,l]=this.#e.domain(),s=[],a=Math.ceil(r/o)*o;for(let m=a;m<=l;m+=o)s.push(m);return s}format(e,t){let n=this.#n?{...t,timeZone:this.#n}:t;return B(this.#t,n).format(new Date(e))}},E=class{#e;#t;#n;#r;constructor(e){this.#e=[...e.domain],this.#t=[...e.range],this.#n=e.paddingInner??.1,this.#r=e.paddingOuter??.05;}get step(){let[e,t]=this.#t,n=this.#e.length;return n<=1?Math.abs(t-e):Math.abs(t-e)*(1-this.#r*2)/n+Math.abs(t-e)*this.#n*2/n}get bandwidth(){let[e,t]=this.#t,n=this.#e.length;if(n<=1)return Math.abs(t-e)*(1-this.#r*2);let o=this.#r*2*Math.abs(t-e);return (Math.abs(t-e)-o)/n*(1-this.#n)}map(e){let t=this.#e.findIndex(c=>String(c)===String(e));if(t===-1)return this.#t[0];let[n,o]=this.#t,r=this.#e.length;if(r<=1)return (n+o)/2;let l=this.#r*2*Math.abs(o-n),s=Math.abs(o-n)-l,a=o>=n?1:-1,m=s/r;return n+this.#r*Math.abs(o-n)*a+t*m}invert(e){let t=0,n=1/0;for(let o=0;o<this.#e.length;o++){let r=this.map(this.#e[o]),l=Math.abs(e-r);l<n&&(n=l,t=o);}return this.#e[t]}domain(){return this.#e.length===0?["",""]:[this.#e[0],this.#e[this.#e.length-1]]}range(){return [...this.#t]}positions(){let e=new Map;for(let t of this.#e)e.set(t,this.map(t));return e}};function oe(i){return i&&i.toString().normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50)||"unnamed"}function it(i){return i==="dotted"?{dash:"dotted"}:i==="dashed"?{dash:"dashed"}:{}}function at(i){let{thresholds:e,valueScale:t,xRange:n}=i,[o,r]=n,[l,s]=t.range(),a=Math.min(l,s),m=Math.max(l,s),d=[],c=[];for(let p of e){let h=p.color??f.thresholdColor,u=t.map(p.value);p.fill==="above"?d.push({type:"rect",x:o,y:a,w:r-o,h:Math.max(0,u-a),fill:h,hatch:p.fillHatch,opacity:p.fillOpacity??.12,id:p.id?`${p.id}-fill`:void 0}):p.fill==="below"&&d.push({type:"rect",x:o,y:u,w:r-o,h:Math.max(0,m-u),fill:h,hatch:p.fillHatch,opacity:p.fillOpacity??.12,id:p.id?`${p.id}-fill`:void 0});let b=p.line??f.thresholdLine;if(b!=="none"){let S=it(b),w={type:"line",x1:o,y1:u,x2:r,y2:u,stroke:h,strokeWidth:1,...S,id:p.id?`${p.id}-line`:void 0};p.shadowColor&&(w.shadowColor=p.shadowColor,w.shadowBlur=p.shadowBlur??4,w.shadowOffsetX=p.shadowOffsetX??0,w.shadowOffsetY=p.shadowOffsetY??2),d.push(w);}let[g,y]=t.domain();if(p.value>=Math.min(g,y)&&p.value<=Math.max(g,y)&&p.label!==void 0&&p.label!==null&&p.label!==false){let S=typeof p.label=="object"?p.label:void 0,w=typeof p.label=="string"?p.label:S?.text??p.name,v=S?.position??"right",j=mt(w,v,o,r,u,h,S);c.push({...j,y:lt(j.y,Math.min(l,s),Math.max(l,s),f.thresholdFontSize),id:p.id?`${p.id}-label`:void 0});}}return {inside:d,labels:c}}function st(i){let e=at(i);return [...e.inside,...e.labels]}function lt(i,e,t,n){return Math.max(e+n,Math.min(t-n/2,i))}function mt(i,e,t,n,o,r,l){let s=(t+n)/2,a={type:"text",content:i,fontSize:f.thresholdFontSize,fill:r},m=l?{...l.rotate!==void 0&&{rotate:l.rotate},...l.textBaseline!==void 0&&{textBaseline:l.textBaseline}}:{};switch(e){case "left":return {...a,...m,x:t+4,y:o-4,anchor:"start"};case "above":return {...a,...m,x:s,y:o-6,anchor:"middle"};case "below":return {...a,...m,x:s,y:o+14,anchor:"middle"};case "center":return {...a,...m,x:s,y:o-4,anchor:"middle"};case "outside-left":return {...a,...m,x:t-6,y:o+3,anchor:"end",textBaseline:m.textBaseline??"middle"};case "outside-right":return {...a,...m,x:n+6,y:o+3,anchor:"start",textBaseline:m.textBaseline??"middle"};default:return {...a,...m,x:n-4,y:o-4,anchor:"end"}}}function Pe(i,e,t,n){switch(i){case "above":return e-5;case "below":return n!==void 0?n-5:t+14;case "center":case "middle":return (e+t)/2+4;case "bottom":return t-6;default:return e+14}}function Z(i){let{ranges:e,timeScale:t,yRange:n,height:o,metrics:r=A}=i,[l,s]=n,a=[],[m,d]=t.range(),c=Math.min(m,d),p=Math.max(m,d),h=u=>Math.max(c,Math.min(p,u));for(let u of e){let b=h(t.map(u.startTime)),g=h(t.map(u.endTime));if(u.fill!==void 0&&a.push({type:"rect",x:b,y:l,w:g-b,h:s-l,fill:u.fill,hatch:u.hatch,opacity:u.opacity}),u.edges)for(let y of [b,g])a.push({type:"line",x1:y,y1:l,x2:y,y2:s,stroke:u.edges.stroke,strokeWidth:u.edges.strokeWidth,dash:"dashed"});if(u.label){let y=u.labelPosition??"middle",x=u.rotate,S=true;if(x==="auto"){let w=y!=="above"&&y!=="below",v=r(u.label,u.fontSize??11);x=w&&v>Math.abs(g-b)-4?-90:void 0,S=x===void 0||v<=Math.abs(s-l)-4;}S&&a.push({type:"text",content:u.label,x:(b+g)/2,y:Pe(y,l,s,o),anchor:"middle",fontSize:u.fontSize,fill:u.labelColor,rotate:x});}}return a}function ut(i){let{gaps:e,timeScale:t,yRange:n,height:o,fill:r=f.gapFill,hatch:l,fillOpacity:s=f.gapFillOpacity??.15,stroke:a=f.gapStroke,strokeWidth:m=f.gapStrokeWidth,dashed:d=true,fontSize:c=f.gapFontSize,fontFill:p=f.gapFontColor,labelBaseline:h="middle",labelRotate:u,metrics:b,band:g}=i,y=()=>{if(!g)return [];let x=g.height??6,[S,w]=n,v=Math.max(S,w);return e.map(j=>{let ye=t.map(j.startTime),xe=t.map(j.endTime);return {type:"rect",x:Math.min(ye,xe),y:v-x+(g.offset??0),w:Math.abs(xe-ye),h:x,fill:g.fill??a,opacity:g.opacity??.75}})};return Z({timeScale:t,yRange:n,height:o,metrics:b,ranges:e.map(x=>{let S=x.style??"dashed_border",w=S==="filled"||S==="dashed_border",v=S==="dashed_border"&&d!==false;return {startTime:x.startTime,endTime:x.endTime,...w&&{fill:x.fill??r,hatch:x.hatch??l,opacity:x.fillOpacity??s},...v&&{edges:{stroke:a,strokeWidth:m}},label:x.label,labelPosition:x.labelBaseline??h,labelColor:p,fontSize:c,rotate:x.rotate??u}})}).concat(y())}function ct(i){let{markers:e,timeScale:t,valueScale:n,yRange:o=[0,300]}=i,[r,l]=o,s=[];for(let a of e){let m=t.map(a.time),d=a.color??f.markerColor,c=a.pointStyle??(a.value!==void 0?"circle":"none"),p=a.lineStyle??"full";if(a.value!==void 0){let h=n.map(a.value);if(p==="to-value"?s.push({type:"line",x1:m,y1:l,x2:m,y2:h,stroke:d,strokeWidth:1,dashed:true}):p==="to-top"?s.push({type:"line",x1:m,y1:r,x2:m,y2:h,stroke:d,strokeWidth:1,dashed:true}):p==="full"&&s.push({type:"line",x1:m,y1:r,x2:m,y2:l,stroke:d,strokeWidth:1}),c!=="none"&&ne(s,void 0,c,m,h,f.markerSize,d,d,1.5),a.label){let u=p==="to-value"?h-10:r-6;s.push({type:"text",content:a.label,x:m,y:u,anchor:"middle",fontSize:f.markerFontSize,fill:d});}}else p!=="none"&&s.push({type:"line",x1:m,y1:r,x2:m,y2:l,stroke:d,strokeWidth:1}),a.label&&s.push({type:"text",content:a.label,x:m,y:r-6,anchor:"middle",fontSize:f.markerFontSize,fill:d});}return s}function dt(i){let{highlights:e,timeScale:t,yRange:n,height:o}=i;return Z({metrics:i.metrics,timeScale:t,yRange:n,height:o,ranges:e.map(r=>({startTime:r.startTime,endTime:r.endTime,fill:r.color??f.highlightColor,opacity:r.opacity??f.highlightOpacity,label:r.label,labelPosition:r.labelPosition??"top",labelColor:r.color??f.highlightLabelColor,fontSize:f.annotationFontSize,rotate:r.rotate}))})}function ht(i,e,t){let n=(r,[l,s])=>r>=Math.min(l,s)&&r<=Math.max(l,s);if(!n(i.time,e.domain()))return false;if(i.value===void 0||!t)return true;let o=t.get(i.axis??0)??t.values().next().value;return !o||n(i.value,o.domain())}function pt(i){let{annotations:e,timeScale:t,valueScales:n,plot:o}=i,r=[],l=a=>!o||ht(a,t,n),s=a=>{let m=n.get(a.axis??0)??n.values().next().value;return {x:t.map(a.time),y:m?m.map(a.value):0}};for(let a of e){let m=[],d=h=>m.push(h);if((a.type==="point"||a.type==="label")&&!l(a.at))continue;let c=o!==void 0&&(a.type==="line"||a.type==="arrow"||a.type==="rect")&&!(l(a.from)&&l(a.to)),p=c?{clipRect:o}:{};switch(a.type){case "line":{let h=s(a.from),u=s(a.to);d({type:"line",x1:h.x,y1:h.y,x2:u.x,y2:u.y,stroke:a.color??f.annotationColor,strokeWidth:a.width??f.annotationWidth,dash:a.dash});break}case "arrow":{let h=s(a.from),u=s(a.to),b=a.color??f.annotationColor,g=a.headSize??f.annotationHead;d({type:"line",x1:h.x,y1:h.y,x2:u.x,y2:u.y,stroke:b,strokeWidth:a.width??f.annotationWidth});let y=Math.hypot(u.x-h.x,u.y-h.y)||1,x=(u.x-h.x)/y,S=(u.y-h.y)/y,w=u.x-x*g,v=u.y-S*g;d({type:"path",points:[{x:u.x,y:u.y},{x:w-S*g*.5,y:v+x*g*.5},{x:w+S*g*.5,y:v-x*g*.5}],fill:b,stroke:"none"});break}case "rect":{let h=s(a.from),u=s(a.to);d({type:"rect",x:Math.min(h.x,u.x),y:Math.min(h.y,u.y),w:Math.abs(u.x-h.x),h:Math.abs(u.y-h.y),fill:a.fill??"none",hatch:a.hatch,stroke:a.stroke,opacity:a.opacity});break}case "point":{let h=s(a.at),u=a.color??"#334155",b=a.radius??f.annotationRadius,g=a.shape??"circle";g==="circle"?d({type:"circle",cx:h.x,cy:h.y,r:b,fill:u}):g==="square"?d({type:"rect",x:h.x-b,y:h.y-b,w:b*2,h:b*2,fill:u}):(d({type:"line",x1:h.x-b,y1:h.y-b,x2:h.x+b,y2:h.y+b,stroke:u,strokeWidth:1.5}),d({type:"line",x1:h.x-b,y1:h.y+b,x2:h.x+b,y2:h.y-b,stroke:u,strokeWidth:1.5}));break}case "label":{let h=s(a.at);d({type:"text",content:a.text,x:h.x+(a.dx??0),y:h.y+(a.dy??0),anchor:a.anchor??ft(h.x+(a.dx??0),a.text,i),fontSize:f.annotationFontSize,fill:a.color??f.annotationColor,rotate:a.rotate});break}}if(a.id&&m.length>0){let h=oe(a.id);r.push({type:"group",cssClass:`annotation annotation--${h}`,...p,commands:m});}else c&&m.length>0?r.push({type:"group",cssClass:"annotation",...p,commands:m}):r.push(...m);}return r}function ft(i,e,t){let{metrics:n,timeScale:o}=t;if(!n)return "middle";let[r,l]=o.range(),s=n(e,f.annotationFontSize)/2;return i-s<r?"start":i+s>l?"end":"middle"}var ie=class i{_config;constructor(e){this._config=e;}compute(){let{width:e,height:t,margin:n}=this._config;return {totalWidth:e,totalHeight:t,chartWidth:e-n.left-n.right,chartHeight:t-n.top-n.bottom,chartX:n.left,chartY:n.top,margin:n}}static default(e=800,t=400){return new i({width:e,height:t,margin:{top:20,right:20,bottom:40,left:60}})}};var ae=class{#e;constructor(){this.#e=[];}add(e){this.#e.push(e);}clear(){this.#e=[];}isInside(e,t){return this.#e.length===0?true:this.#e.some(n=>e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)}toSVGClipPath(e="clip"){if(this.#e.length===0)return "";let t=this.#e.map(n=>`<rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" />`).join(`
24
+ `.trim()}var f=new Proxy({},{get:(i,e)=>A()[e],has:(i,e)=>e in A(),ownKeys:()=>Reflect.ownKeys(A()),getOwnPropertyDescriptor:(i,e)=>Reflect.getOwnPropertyDescriptor(A(),e)});var I=class i{#e=[];get commands(){return [...this.#e]}get length(){return this.#e.length}line(e){return this.#e.push({type:"line",...e}),this}path(e){return this.#e.push({type:"path",...e}),this}rect(e){return this.#e.push({type:"rect",...e}),this}circle(e){return this.#e.push({type:"circle",...e}),this}text(e){return this.#e.push({type:"text",...e}),this}gap(e){return this.#e.push({type:"gap",...e}),this}push(...e){return this.#e.push(...e),this}group(e,t){let n=new i;return t(n),n.length===0?this:(this.#e.push({type:"group",...e,commands:n.commands}),this)}toGroup(e={}){return {type:"group",...e,commands:this.commands}}};var et="#ffffff",tt="#cccccc",nt=6,rt=.85,w=12,N=8,B=20,ot=11,V=18,oe=(i,e)=>e(i,ot);function _e(i,e,t){let n=s=>w+N+oe(s.name,e);if(t===void 0){let s=i.reduce((a,m)=>a+n(m)+V,0)-V;return [{items:i,breite:Math.max(0,s)}]}let o=[],r=[],l=0;for(let s of i){let a=n(s),m=r.length===0?a:l+V+a;r.length>0&&m>t?(o.push({items:r,breite:l}),r=[s],l=a):(r=[...r,s],l=m);}return r.length>0&&o.push({items:r,breite:l}),o}function Pe(i,e="vertical",t=D,n){if(e==="horizontal"){let r=_e(i,t,n);return {width:r.reduce((l,s)=>Math.max(l,s.breite),0),height:r.length*B}}let o=0;for(let r of i)o=Math.max(o,oe(r.name,t));return {width:w+N+o,height:i.length*B}}function it(i){let{items:e,x:t,y:n,orientation:o="vertical",metrics:r=D,maxBreite:l,box:s,itemClass:a}=i,m=new I;if(s&&e.length>0){let h=Pe(e,o,r,l),b=((o==="horizontal"?h.height/B:e.length)-1)*B+w,g=s.padding??nt,y=s.stroke??tt;m.rect({x:t-g,y:n-g,w:h.width+2*g,h:b+2*g,fill:s.fill??et,...y==="none"?{}:{stroke:y,strokeWidth:s.strokeWidth??1},opacity:s.opacity??rt});}let d=o==="horizontal"?_e(e,r,l):e.map(h=>({items:[h],breite:0})),c=new Map;d.forEach((h,u)=>{let b=t;for(let g of h.items)c.set(g,{x:b,y:n+u*B}),b+=w+N+oe(g.name,r)+V;});let p=e.some(h=>h.line!==void 0&&h.line!=="solid"&&h.line!=="none");return e.forEach(h=>{let u=c.get(h)??{x:t,y:n},b=u.x,g=u.y,y=["legend-item"];h.id&&y.push(`legend-item--${h.id}`),a&&y.push(a),m.group({cssClass:y.join(" "),...h.id?{id:`legend-${h.id}`}:{}},x=>{lt(x,h,b,g,p),x.text({content:h.name,x:b+w+N,y:g+w-2,fontSize:f.legendFont,fill:f.legendText});});}),m.toGroup({cssClass:"chart-legend"})}function at(i){return Math.min(Math.max(i??2,1.5),3)}function st(i,e,t,n){let o=i.colors&&i.colors.length>=2?i.colors:[i.color],r=n/o.length;return o.map((l,s)=>({type:"line",x1:e+s*r,y1:t,x2:e+s*r+r,y2:t,stroke:l,strokeWidth:at(i.width),...i.line&&i.line!=="solid"?{dash:i.line}:{}}))}function lt(i,e,t,n,o){let r=e.colors&&e.colors.length>=2?e.colors:[e.color],l=w/r.length;if(o){i.push(...st(e,t,n+w/2,w));return}if(r.length===1){i.rect({x:t,y:n,w,h:w,fill:r[0],stroke:f.legendStroke,strokeWidth:1});return}r.forEach((s,a)=>{i.rect({x:t+a*l,y:n,w:l,h:w,fill:s});}),i.rect({x:t,y:n,w,h:w,fill:"none",stroke:f.legendStroke,strokeWidth:1});}function mt(i){let{xTicks:e,yTicks:t,xRange:n,yRange:o,stroke:r=f.gridStroke,strokeWidth:l=f.gridStrokeWidth,dashed:s=false,opacity:a=f.gridOpacity}=i,m=[];if(t)for(let d of t)m.push({type:"line",x1:n[0],y1:d,x2:n[1],y2:d,stroke:r,strokeWidth:l,dashed:s,opacity:a});if(e)for(let d of e)m.push({type:"line",x1:d,y1:o[0],x2:d,y2:o[1],stroke:r,strokeWidth:l,dashed:s,opacity:a});return m}var Re=new Map;function ut(i,e){return `${i}|${JSON.stringify(e??{})}`}function z(i,e){let t=ut(i,e),n=Re.get(t);return n||(n=new Intl.DateTimeFormat(i,e),Re.set(t,n)),n}function X(){return typeof navigator<"u"?navigator.language:void 0}var _=class{#e;#t;constructor(e){this.#e=[...e.domain],this.#t=[...e.range];}zeichenwert(e){return e}wert(e){return e}randZeichenwert(e){return this.zeichenwert(e)}map(e){let t=this.zeichenwert(Number(e)),n=this.randZeichenwert(this.#e[0]),o=this.randZeichenwert(this.#e[1]),[r,l]=this.#t;return o===n?r:r+(t-n)/(o-n)*(l-r)}invert(e){let t=this.randZeichenwert(this.#e[0]),n=this.randZeichenwert(this.#e[1]),[o,r]=this.#t;return r===o?this.#e[0]:this.wert(t+(e-o)/(r-o)*(n-t))}domain(){return [...this.#e]}range(){return [...this.#t]}},Y=class extends _{#e;constructor(e){super(e),this.#e=e.untergrenze??Math.min(e.domain[0],e.domain[1]);}get untergrenze(){return this.#e}zeichenwert(e){return Math.log(Math.max(e,this.#e))/Math.LN10}wert(e){return 10**e}randZeichenwert(e){return Math.log(e)/Math.LN10}},k=[{label:"second",ms:1e3},{label:"2_seconds",ms:2e3},{label:"5_seconds",ms:5e3},{label:"10_seconds",ms:1e4},{label:"30_seconds",ms:3e4},{label:"minute",ms:6e4},{label:"5_minutes",ms:3e5},{label:"15_minutes",ms:9e5},{label:"30_minutes",ms:18e5},{label:"hour",ms:36e5},{label:"3_hours",ms:108e5},{label:"6_hours",ms:216e5},{label:"day",ms:864e5},{label:"week",ms:6048e5},{label:"month",ms:2592e6},{label:"3_months",ms:7776e6},{label:"6_months",ms:15552e6},{label:"year",ms:31536e6},{label:"2_years",ms:63072e6},{label:"5_years",ms:15768e7}],O=class{#e;#t;#n;constructor(e){this.#e=new _({domain:e.domain,range:e.range}),this.#t=e.locale||(X()??"en-US"),this.#n=e.timeZone;}map(e){return this.#e.map(Number(e))}invert(e){return this.#e.invert(e)}domain(){return this.#e.domain()}range(){return this.#e.range()}get timeZone(){return this.#n}get locale(){return this.#t}tickInterval(e,t=3,n=12){let[o,r]=this.#e.domain(),l=r-o;if(l<=0)return {interval:k[0].ms};let s=l/e,a=k[0].ms;for(let c of k)if(c.ms>=s){a=c.ms;break}let m=a,d=Math.round(l/m);for(;d>n&&m<k[k.length-1].ms;){let c=k.findIndex(p=>p.ms===m);m=k[Math.min(c+1,k.length-1)].ms,d=Math.round(l/m);}for(;d<t&&m>k[0].ms;){let c=k.findIndex(p=>p.ms===m);m=k[Math.max(c-1,0)].ms,d=Math.round(l/m);}return {interval:m}}ticks(e){let t=e?.minTicks??5,n=e?.maxTicks??12,{interval:o}=this.tickInterval((t+n)/2,t,n),[r,l]=this.#e.domain(),s=[],a=Math.ceil(r/o)*o;for(let m=a;m<=l;m+=o)s.push(m);return s}format(e,t){let n=this.#n?{...t,timeZone:this.#n}:t;return z(this.#t,n).format(new Date(e))}},E=class{#e;#t;#n;#r;constructor(e){this.#e=[...e.domain],this.#t=[...e.range],this.#n=e.paddingInner??.1,this.#r=e.paddingOuter??.05;}get step(){let[e,t]=this.#t,n=this.#e.length;return n<=1?Math.abs(t-e):Math.abs(t-e)*(1-this.#r*2)/n+Math.abs(t-e)*this.#n*2/n}get bandwidth(){let[e,t]=this.#t,n=this.#e.length;if(n<=1)return Math.abs(t-e)*(1-this.#r*2);let o=this.#r*2*Math.abs(t-e);return (Math.abs(t-e)-o)/n*(1-this.#n)}map(e){let t=this.#e.findIndex(c=>String(c)===String(e));if(t===-1)return this.#t[0];let[n,o]=this.#t,r=this.#e.length;if(r<=1)return (n+o)/2;let l=this.#r*2*Math.abs(o-n),s=Math.abs(o-n)-l,a=o>=n?1:-1,m=s/r;return n+this.#r*Math.abs(o-n)*a+t*m}invert(e){let t=0,n=1/0;for(let o=0;o<this.#e.length;o++){let r=this.map(this.#e[o]),l=Math.abs(e-r);l<n&&(n=l,t=o);}return this.#e[t]}domain(){return this.#e.length===0?["",""]:[this.#e[0],this.#e[this.#e.length-1]]}range(){return [...this.#t]}positions(){let e=new Map;for(let t of this.#e)e.set(t,this.map(t));return e}};function ie(i){return i&&i.toString().normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50)||"unnamed"}function ct(i){return i==="dotted"?{dash:"dotted"}:i==="dashed"?{dash:"dashed"}:{}}function dt(i){let{thresholds:e,valueScale:t,xRange:n}=i,[o,r]=n,[l,s]=t.range(),a=Math.min(l,s),m=Math.max(l,s),d=[],c=[];for(let p of e){let h=p.color??f.thresholdColor,u=t.map(p.value);p.fill==="above"?d.push({type:"rect",x:o,y:a,w:r-o,h:Math.max(0,u-a),fill:h,hatch:p.fillHatch,opacity:p.fillOpacity??.12,id:p.id?`${p.id}-fill`:void 0}):p.fill==="below"&&d.push({type:"rect",x:o,y:u,w:r-o,h:Math.max(0,m-u),fill:h,hatch:p.fillHatch,opacity:p.fillOpacity??.12,id:p.id?`${p.id}-fill`:void 0});let b=p.line??f.thresholdLine;if(b!=="none"){let S=ct(b),T={type:"line",x1:o,y1:u,x2:r,y2:u,stroke:h,strokeWidth:1,...S,id:p.id?`${p.id}-line`:void 0};p.shadowColor&&(T.shadowColor=p.shadowColor,T.shadowBlur=p.shadowBlur??4,T.shadowOffsetX=p.shadowOffsetX??0,T.shadowOffsetY=p.shadowOffsetY??2),d.push(T);}let[g,y]=t.domain();if(p.value>=Math.min(g,y)&&p.value<=Math.max(g,y)&&p.label!==void 0&&p.label!==null&&p.label!==false){let S=typeof p.label=="object"?p.label:void 0,T=typeof p.label=="string"?p.label:S?.text??p.name,v=S?.position??"right",j=ft(T,v,o,r,u,h,S);c.push({...j,y:pt(j.y,Math.min(l,s),Math.max(l,s),f.thresholdFontSize),id:p.id?`${p.id}-label`:void 0});}}return {inside:d,labels:c}}function ht(i){let e=dt(i);return [...e.inside,...e.labels]}function pt(i,e,t,n){return Math.max(e+n,Math.min(t-n/2,i))}function ft(i,e,t,n,o,r,l){let s=(t+n)/2,a={type:"text",content:i,fontSize:f.thresholdFontSize,fill:r},m=l?{...l.rotate!==void 0&&{rotate:l.rotate},...l.textBaseline!==void 0&&{textBaseline:l.textBaseline}}:{};switch(e){case "left":return {...a,...m,x:t+4,y:o-4,anchor:"start"};case "above":return {...a,...m,x:s,y:o-6,anchor:"middle"};case "below":return {...a,...m,x:s,y:o+14,anchor:"middle"};case "center":return {...a,...m,x:s,y:o-4,anchor:"middle"};case "outside-left":return {...a,...m,x:t-6,y:o+3,anchor:"end",textBaseline:m.textBaseline??"middle"};case "outside-right":return {...a,...m,x:n+6,y:o+3,anchor:"start",textBaseline:m.textBaseline??"middle"};default:return {...a,...m,x:n-4,y:o-4,anchor:"end"}}}function Fe(i,e,t,n){switch(i){case "above":return e-5;case "below":return n!==void 0?n-5:t+14;case "center":case "middle":return (e+t)/2+4;case "bottom":return t-6;default:return e+14}}function Z(i){let{ranges:e,timeScale:t,yRange:n,height:o,metrics:r=D}=i,[l,s]=n,a=[],[m,d]=t.range(),c=Math.min(m,d),p=Math.max(m,d),h=u=>Math.max(c,Math.min(p,u));for(let u of e){let b=h(t.map(u.startTime)),g=h(t.map(u.endTime));if(u.fill!==void 0&&a.push({type:"rect",x:b,y:l,w:g-b,h:s-l,fill:u.fill,hatch:u.hatch,opacity:u.opacity}),u.edges)for(let y of [b,g])a.push({type:"line",x1:y,y1:l,x2:y,y2:s,stroke:u.edges.stroke,strokeWidth:u.edges.strokeWidth,dash:"dashed"});if(u.label){let y=u.labelPosition??"middle",x=u.rotate,S=true;if(x==="auto"){let T=y!=="above"&&y!=="below",v=r(u.label,u.fontSize??11);x=T&&v>Math.abs(g-b)-4?-90:void 0,S=x===void 0||v<=Math.abs(s-l)-4;}S&&a.push({type:"text",content:u.label,x:(b+g)/2,y:Fe(y,l,s,o),anchor:"middle",fontSize:u.fontSize,fill:u.labelColor,rotate:x});}}return a}function gt(i){let{gaps:e,timeScale:t,yRange:n,height:o,fill:r=f.gapFill,hatch:l,fillOpacity:s=f.gapFillOpacity??.15,stroke:a=f.gapStroke,strokeWidth:m=f.gapStrokeWidth,dashed:d=true,fontSize:c=f.gapFontSize,fontFill:p=f.gapFontColor,labelBaseline:h="middle",labelRotate:u,metrics:b,band:g}=i,y=()=>{if(!g)return [];let x=g.height??6,[S,T]=n,v=Math.max(S,T);return e.map(j=>{let xe=t.map(j.startTime),Se=t.map(j.endTime);return {type:"rect",x:Math.min(xe,Se),y:v-x+(g.offset??0),w:Math.abs(Se-xe),h:x,fill:g.fill??a,opacity:g.opacity??.75}})};return Z({timeScale:t,yRange:n,height:o,metrics:b,ranges:e.map(x=>{let S=x.style??"dashed_border",T=S==="filled"||S==="dashed_border",v=S==="dashed_border"&&d!==false;return {startTime:x.startTime,endTime:x.endTime,...T&&{fill:x.fill??r,hatch:x.hatch??l,opacity:x.fillOpacity??s},...v&&{edges:{stroke:a,strokeWidth:m}},label:x.label,labelPosition:x.labelBaseline??h,labelColor:p,fontSize:c,rotate:x.rotate??u}})}).concat(y())}function bt(i){let{markers:e,timeScale:t,valueScale:n,yRange:o=[0,300]}=i,[r,l]=o,s=[];for(let a of e){let m=t.map(a.time),d=a.color??f.markerColor,c=a.pointStyle??(a.value!==void 0?"circle":"none"),p=a.lineStyle??"full";if(a.value!==void 0){let h=n.map(a.value);if(p==="to-value"?s.push({type:"line",x1:m,y1:l,x2:m,y2:h,stroke:d,strokeWidth:1,dashed:true}):p==="to-top"?s.push({type:"line",x1:m,y1:r,x2:m,y2:h,stroke:d,strokeWidth:1,dashed:true}):p==="full"&&s.push({type:"line",x1:m,y1:r,x2:m,y2:l,stroke:d,strokeWidth:1}),c!=="none"&&ne(s,void 0,c,m,h,f.markerSize,d,d,1.5),a.label){let u=p==="to-value"?h-10:r-6;s.push({type:"text",content:a.label,x:m,y:u,anchor:"middle",fontSize:f.markerFontSize,fill:d});}}else p!=="none"&&s.push({type:"line",x1:m,y1:r,x2:m,y2:l,stroke:d,strokeWidth:1}),a.label&&s.push({type:"text",content:a.label,x:m,y:r-6,anchor:"middle",fontSize:f.markerFontSize,fill:d});}return s}function yt(i){let{highlights:e,timeScale:t,yRange:n,height:o}=i;return Z({metrics:i.metrics,timeScale:t,yRange:n,height:o,ranges:e.map(r=>({startTime:r.startTime,endTime:r.endTime,fill:r.color??f.highlightColor,opacity:r.opacity??f.highlightOpacity,label:r.label,labelPosition:r.labelPosition??"top",labelColor:r.color??f.highlightLabelColor,fontSize:f.annotationFontSize,rotate:r.rotate}))})}function xt(i,e,t){let n=(r,[l,s])=>r>=Math.min(l,s)&&r<=Math.max(l,s);if(!n(i.time,e.domain()))return false;if(i.value===void 0||!t)return true;let o=t.get(i.axis??0)??t.values().next().value;return !o||n(i.value,o.domain())}function St(i){let{annotations:e,timeScale:t,valueScales:n,plot:o}=i,r=[],l=a=>!o||xt(a,t,n),s=a=>{let m=n.get(a.axis??0)??n.values().next().value;return {x:t.map(a.time),y:m?m.map(a.value):0}};for(let a of e){let m=[],d=h=>m.push(h);if((a.type==="point"||a.type==="label")&&!l(a.at))continue;let c=o!==void 0&&(a.type==="line"||a.type==="arrow"||a.type==="rect")&&!(l(a.from)&&l(a.to)),p=c?{clipRect:o}:{};switch(a.type){case "line":{let h=s(a.from),u=s(a.to);d({type:"line",x1:h.x,y1:h.y,x2:u.x,y2:u.y,stroke:a.color??f.annotationColor,strokeWidth:a.width??f.annotationWidth,dash:a.dash});break}case "arrow":{let h=s(a.from),u=s(a.to),b=a.color??f.annotationColor,g=a.headSize??f.annotationHead;d({type:"line",x1:h.x,y1:h.y,x2:u.x,y2:u.y,stroke:b,strokeWidth:a.width??f.annotationWidth});let y=Math.hypot(u.x-h.x,u.y-h.y)||1,x=(u.x-h.x)/y,S=(u.y-h.y)/y,T=u.x-x*g,v=u.y-S*g;d({type:"path",points:[{x:u.x,y:u.y},{x:T-S*g*.5,y:v+x*g*.5},{x:T+S*g*.5,y:v-x*g*.5}],fill:b,stroke:"none"});break}case "rect":{let h=s(a.from),u=s(a.to);d({type:"rect",x:Math.min(h.x,u.x),y:Math.min(h.y,u.y),w:Math.abs(u.x-h.x),h:Math.abs(u.y-h.y),fill:a.fill??"none",hatch:a.hatch,stroke:a.stroke,opacity:a.opacity});break}case "point":{let h=s(a.at),u=a.color??"#334155",b=a.radius??f.annotationRadius,g=a.shape??"circle";g==="circle"?d({type:"circle",cx:h.x,cy:h.y,r:b,fill:u}):g==="square"?d({type:"rect",x:h.x-b,y:h.y-b,w:b*2,h:b*2,fill:u}):(d({type:"line",x1:h.x-b,y1:h.y-b,x2:h.x+b,y2:h.y+b,stroke:u,strokeWidth:1.5}),d({type:"line",x1:h.x-b,y1:h.y+b,x2:h.x+b,y2:h.y-b,stroke:u,strokeWidth:1.5}));break}case "label":{let h=s(a.at);d({type:"text",content:a.text,x:h.x+(a.dx??0),y:h.y+(a.dy??0),anchor:a.anchor??Tt(h.x+(a.dx??0),a.text,i),fontSize:f.annotationFontSize,fill:a.color??f.annotationColor,rotate:a.rotate});break}}if(a.id&&m.length>0){let h=ie(a.id);r.push({type:"group",cssClass:`annotation annotation--${h}`,...p,commands:m});}else c&&m.length>0?r.push({type:"group",cssClass:"annotation",...p,commands:m}):r.push(...m);}return r}function Tt(i,e,t){let{metrics:n,timeScale:o}=t;if(!n)return "middle";let[r,l]=o.range(),s=n(e,f.annotationFontSize)/2;return i-s<r?"start":i+s>l?"end":"middle"}var ae=class i{_config;constructor(e){this._config=e;}compute(){let{width:e,height:t,margin:n}=this._config;return {totalWidth:e,totalHeight:t,chartWidth:e-n.left-n.right,chartHeight:t-n.top-n.bottom,chartX:n.left,chartY:n.top,margin:n}}static default(e=800,t=400){return new i({width:e,height:t,margin:{top:20,right:20,bottom:40,left:60}})}};var se=class{#e;constructor(){this.#e=[];}add(e){this.#e.push(e);}clear(){this.#e=[];}isInside(e,t){return this.#e.length===0?true:this.#e.some(n=>e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)}toSVGClipPath(e="clip"){if(this.#e.length===0)return "";let t=this.#e.map(n=>`<rect x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" />`).join(`
25
25
  `);return `<clipPath id="${e}">
26
26
  ${t}
27
- </clipPath>`}get regions(){return [...this.#e]}};function U(i,e){if(e<=0||i.length<2)return [];let t=[];for(let n=0;n<i.length-1;n++){let o=i[n],r=i[n+1];for(let l=1;l<=e;l++)t.push(o+(r-o)*l/(e+1));}return t}var G={axisColor:f.axisColor,tickColor:f.tickColor,textColor:f.textColor,textSize:f.textSize},H=class{#e;#t;constructor(e){this.#e=new O({domain:e.domain,range:e.xRange,locale:e.locale,timeZone:e.timeZone}),this.#t=e;}get scale(){return this.#e}get axisColor(){return (this.#t.colors??G).axisColor}get tickColor(){return (this.#t.colors??G).tickColor}get textColor(){return (this.#t.colors??G).textColor}get textSize(){return (this.#t.colors??G).textSize}generateTicks(){let e=this.#t.minTicks??5,t=this.#t.maxTicks??12,o=this.#e.ticks({minTicks:e,maxTicks:t}).map(r=>({time:r,x:this.#e.map(r),label:this.tickLabel(r)}));return this.antiOverlap(o)}tickLabel(e){if(this.#t.format)return this.#t.format(new Date(e));let t=this.#t.minTicks??5,n=this.#t.maxTicks??12,{interval:o}=this.#e.tickInterval((t+n)/2,t,n),r={};return o<6e4?(r.hour="2-digit",r.minute="2-digit",r.second="2-digit"):o<36e5||o<864e5?(r.hour="2-digit",r.minute="2-digit"):o<31536e6?(r.day="numeric",r.month="short",o>=2592e6&&(r.day=void 0,r.month="long")):(r.year="numeric",o<2*31536e6&&(r.month="short")),this.#e.format(e,r)}antiOverlap(e){if(e.length<=1)return e;let t=60,n=[e[0]];for(let o=1;o<e.length;o++){let r=n[n.length-1].x;Math.abs(e[o].x-r)>=t&&n.push(e[o]);}return n}render(){let e=this.generateTicks(),t=this.#t.colors??G,n=this.#t.y??0,o=[],[r,l]=this.#e.range();o.push({type:"line",x1:r,y1:n,x2:l,y2:n,stroke:t.axisColor,strokeWidth:t.axisWidth});for(let s of this.generateMinorTicks())o.push({type:"line",x1:s,y1:n,x2:s,y2:n+3,stroke:t.tickColor,strokeWidth:t.axisWidth});for(let s of e)o.push({type:"line",x1:s.x,y1:n,x2:s.x,y2:n+6,stroke:t.tickColor,strokeWidth:t.axisWidth}),o.push({type:"text",content:s.label,x:this.#n(s.x,s.label,t.textSize),y:n+t.textSize+6,anchor:"middle",fontSize:t.textSize,fill:t.textColor});return o}generateMinorTicks(){return U(this.generateTicks().map(e=>e.x),this.#t.minorTicks??0)}#n(e,t,n){let o=this.#t.gesamtbreite,r=this.#t.metrics;if(o===void 0||r===void 0)return e;let l=r(t,n)/2;return Math.max(l+2,Math.min(o-l-2,e))}};var R={axisColor:"#ccc",tickColor:"#ddd",textColor:"#777",textSize:12};function se(i,e){let t=n=>e===void 0||e>=n;return Math.abs(i)>=1e6&&t(1e5)?`${(i/1e6).toFixed(1)}M`:Math.abs(i)>=1e3&&t(100)?`${(i/1e3).toFixed(1)}k`:Number.isInteger(i)?String(i):i.toFixed(1)}function gt(i){return i.map((e,t)=>t+1<i.length&&i[t+1].label===e.label)}var le=class{#e;#t;constructor(e){this.#e=e.untergrenze===void 0?new _({domain:e.domain,range:e.range}):new Y({domain:e.domain,range:e.range,untergrenze:e.untergrenze}),this.#t=e;}get scale(){return this.#e}get axisColor(){return (this.#t.colors??R).axisColor}get tickColor(){return (this.#t.colors??R).tickColor}get textColor(){return (this.#t.colors??R).textColor}get textSize(){return (this.#t.colors??R).textSize}generateTicks(){let e=this.#t.tickValues;if(e&&e.length>0){let b=this.#t.format??se;return e.map(g=>({value:g,position:this.#e.map(g),label:b(g)}))}let t=this.#t.format??se,n=this.#t.ticks&&this.#t.ticks>0?this.#t.ticks:6,[o,r]=this.#e.domain(),l=Math.min(o,r),s=Math.max(o,r),a=s-l;if(a===0)return [{value:o,position:this.#e.map(o),label:t(o)}];let m=a/n,d=Math.pow(10,Math.floor(Math.log10(m))),c=m/d,p;if(c<=1.5?p=d:c<=3?p=2*d:c<=7?p=5*d:p=10*d,p<=0||!Number.isFinite(p))return [{value:o,position:this.#e.map(o),label:t(o)}];this.#t.format||(t=b=>se(b,p));let h=[],u=Math.ceil(l/p)*p;for(let b=u;b<=s;b+=p)h.push({value:b,position:this.#e.map(b),label:t(b)});return h}generateMinorTicks(){let e=this.#t.minorTickValues;return e?e.map(t=>this.#e.map(t)):U(this.generateTicks().map(t=>t.position),this.#t.minorTicks??0)}render(){let e=this.generateTicks(),t=this.#t.colors??R,n=this.#t.x??0,o=this.#t.orientation??"vertical",r=this.#t.position??"left",l=this.#t.suppressLabelsNear??[],s=this.#t.suppressTolerancePx??8,a=c=>l.some(p=>Math.abs(p-c)<=s),m=[];if(o==="vertical"){let[c,p]=this.#e.range();m.push({type:"line",x1:n,y1:c,x2:n,y2:p,stroke:t.axisColor,strokeWidth:t.axisWidth});let h=gt(e);e.forEach((u,b)=>{let g=a(u.position),y=h[b]?{opacity:0}:{};r==="left"?(m.push({type:"line",x1:n-4,y1:u.position,x2:n,y2:u.position,stroke:t.tickColor,strokeWidth:t.axisWidth}),g||m.push({type:"text",content:u.label,x:this.#n(n-8,u.label,"end"),y:u.position+4,anchor:"end",fontSize:t.textSize,fill:t.textColor,...y})):(m.push({type:"line",x1:n,y1:u.position,x2:n+4,y2:u.position,stroke:t.tickColor,strokeWidth:t.axisWidth}),g||m.push({type:"text",content:u.label,x:this.#n(n+8,u.label,"start"),y:u.position+4,anchor:"start",fontSize:t.textSize,fill:t.textColor,...y}));});}else {let[c,p]=this.#e.range();m.push({type:"line",x1:c,y1:n,x2:p,y2:n,stroke:t.axisColor,strokeWidth:t.axisWidth});for(let h of e)m.push({type:"line",x1:h.position,y1:n,x2:h.position,y2:n+6,stroke:t.tickColor,strokeWidth:t.axisWidth}),m.push({type:"text",content:h.label,x:h.position,y:n+18,anchor:"middle",fontSize:t.textSize,fill:t.textColor});}let d=(this.#t.orientation??"vertical")==="vertical";for(let c of this.generateMinorTicks())m.push(d?{type:"line",x1:r==="right"?n:n-2,y1:c,x2:r==="right"?n+2:n,y2:c,stroke:t.tickColor,strokeWidth:t.axisWidth}:{type:"line",x1:c,y1:n,x2:c,y2:n+3,stroke:t.tickColor,strokeWidth:t.axisWidth});return m}#n(e,t,n){let o=this.#t.gesamtbreite,r=this.#t.metrics;if(o===void 0||r===void 0)return e;let l=r(t,(this.#t.colors??R).textSize);return n==="end"?Math.max(l+2,Math.min(o-2,e)):Math.min(o-l-2,Math.max(2,e))}};var me=class i{#e;#t;#n;#r;#a;#o;#i;constructor(e){this.#e=[...e.data].sort((t,n)=>t.time-n.time),this.#t=e.windowSize,this.#n=e.type??"simple",this.#r=e.timeScale,this.#a=e.valueScale,this.#o=e.stroke??"#e53e3e",this.#i=e.strokeWidth??2;}static simple(e,t){let n=[...e].filter(r=>r.value!==null).sort((r,l)=>r.time-l.time),o=[];for(let r=0;r<n.length;r++){let l=Math.max(0,r-t+1),s=n.slice(l,r+1),a=s.reduce((m,d)=>m+d.value,0)/s.length;o.push({time:n[r].time,value:a});}return o}static exponential(e,t){let n=[...e].filter(s=>s.value!==null).sort((s,a)=>s.time-a.time);if(n.length===0)return [];let o=2/(t+1),r=[],l=n[0].value;r.push({time:n[0].time,value:l});for(let s=1;s<n.length;s++)l=n[s].value*o+l*(1-o),r.push({time:n[s].time,value:l});return r}points(){return (this.#n==="exponential"?i.exponential(this.#e,this.#t):i.simple(this.#e,this.#t)).map(t=>({x:this.#r.map(t.time),y:this.#a.map(t.value)}))}render(){let e=this.points();return e.length<2?e.map(t=>({type:"circle",cx:t.x,cy:t.y,r:this.#i,fill:this.#o})):[{type:"path",points:e,smoothing:true,stroke:this.#o,strokeWidth:this.#i}]}};var ue=class{#e;#t;#n;constructor(e){let t=Object.keys(e.enumMap).map(Number).sort((n,o)=>n-o).map(String);this.#t=t,this.#e=new E({domain:t,range:e.range}),this.#n=e;}get scale(){return this.#e}generateTicks(){let{enumMap:e,showLabels:t=true,autoColor:n=true,gapValues:o}=this.#n,r=new Set(o??[]);return this.#t.map((l,s)=>{let a=Number(l),m=t?e[a]??String(a):String(a),d=this.#e.map(a),c=n?f.palette[s%f.palette.length]:void 0;return {value:a,label:m,y:d,color:c,isGap:r.has(a)}})}colorFor(e){let t=this.#t.indexOf(String(e));if(!(t===-1||!(this.#n.autoColor??true)))return f.palette[t%f.palette.length]}render(){let e=this.generateTicks(),t=this.#n.x??0,n=[];for(let o of e)o.isGap||n.push({type:"text",content:o.label,x:t,y:o.y+4,anchor:"end",fontSize:f.textSize,fill:o.color??f.textColor});return n}map(e){return this.#e.map(e)}isGap(e){return new Set(this.#n.gapValues??[]).has(e)}};var M=class i{#e;#t;static uidcnt=0;#n;constructor(e,t=[]){this.#e=e.id??"series-"+ ++i.uidcnt,this.#t=e.timeScale,this.#n=t;}get id(){return this.#e}get timeScale(){return this.#t}get data(){return this.#n}};var ce=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}points(){let e=this.#e.valueScale;return this.data.filter(t=>t.value!==null).map(t=>({x:this.timeScale.map(t.time),y:e.map(t.value),time:t.time})).sort((t,n)=>t.x-n.x)}render(){let e=this.#e,t={smoothing:e.smoothing??false,smoothingType:e.smoothingType,stroke:e.stroke??f.stroke,strokeWidth:e.strokeWidth??f.strokeWidth,dashed:e.dashed??false,pointStyle:e.pointStyle??"none",pointSize:e.pointSize??f.pointSize,shadowColor:e.shadowColor,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY},n=e.pointThreshold??f.pointThreshold,o=e.gapThreshold??f.gapThreshold,r=e.id,l=C.getRuns(this.data,c=>c.value===null,o),s=l.reduce((c,p)=>c+p.length,0);if(s===0)return [];let a={timeScale:this.timeScale,valueScale:e.valueScale},m=l.map(c=>({data:c})),d=[];return d.push(...L(m,a,{...t,id:r?`${r}-line`:void 0})),t.pointStyle&&t.pointStyle!=="none"&&s<=n&&d.push(...te(l.flat(),a,{...t,id:r?`${r}-marker`:void 0},()=>t.stroke)),d}};var de=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}points(){let e=this.#e.valueScale,t=[...this.data].filter(o=>o.value!==null).sort((o,r)=>o.time-r.time),n=[];for(let o=0;o<t.length;o++){let r=this.timeScale.map(t[o].time),l=e.map(t[o].value);o===0?n.push({x:r,y:l}):n.push({x:r,y:n[n.length-1].y},{x:r,y:l});}return n}render(){let e=C.getRuns(this.data,o=>o.value===null);if(e.length===0)return [];let t={timeScale:this.timeScale,valueScale:this.#e.valueScale},n=e.map(o=>({data:o}));return Q(n,t,{stroke:this.#e.stroke??f.stroke,strokeWidth:this.#e.strokeWidth??f.strokeWidth,id:this.id?`${this.id}-line`:void 0})}};var he=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}opacity(e){if(!(this.#e.countOpacity??false))return .6;let t=0;for(let n of this.data)n.count>t&&(t=n.count);return t===0?.2:.2+.8*e/t}render(){let e=this.#e,t=e.fill??f.bandFill,n=e.hatch,o=e.avgLine??false,r=e.avgLineColor??f.bandAvgLine,l=e.bandWidth??10,s=[];for(let a of this.data){if(a.min===null||a.max===null)continue;let m=this.timeScale.map(a.time),d=e.valueScale.map(a.max),c=e.valueScale.map(a.min),p=l,h=this.data.indexOf(a);if(s.push({type:"rect",x:m-p/2,y:d,w:p,h:c-d,fill:t,hatch:n,opacity:this.opacity(a.count),id:this.id?`${this.id}-slot-${h}`:void 0}),o&&a.avg!==null){let u=e.valueScale.map(a.avg);s.push({type:"line",x1:m-p/2,y1:u,x2:m+p/2,y2:u,stroke:r,strokeWidth:1,id:this.id?`${this.id}-avg-${h}`:void 0});}}return s}};function Re(i,e,t,n,o,r,l){return ee(i,e,{boundaries:[],yLow:s=>s.avg,yHigh:t,getValue:s=>s.avg,interpolate:ke(e.valueScale),getColor:()=>n,getHatch:()=>o},{id:r,...l})}var pe=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}render(){let e=this.#e,t=e.minColor??f.minColor,n=e.maxColor??f.maxColor,o=e.avgColor??f.avgColor,r=e.avgDashed??true,l=e.smoothing??false,s=e.smoothingType,a=e.strokeWidth??f.strokeWidth,m=C.getRuns(this.data,u=>u.min===null||u.max===null||u.avg===null);if(m.length===0)return [];let d={timeScale:this.timeScale,valueScale:e.valueScale},c=[];m.forEach((u,b)=>{if(u.length<2)return;let g=y=>this.id?`${this.id}-${y}-${b}`:void 0;if(e.fillToMax){let y=Re(u,d,x=>x.max,e.fillToMax,e.fillToMaxHatch,g("fillToMax"),{smoothing:l,smoothingType:s});c.push(...y);}if(e.fillToMin){let y=Re(u,d,x=>x.min,e.fillToMin,e.fillToMinHatch,g("fillToMin"),{smoothing:l,smoothingType:s});c.push(...y);}});let p=m.filter(u=>u.length>=2),h=(u,b,g,y=false)=>L(p.map(x=>({data:x.map(S=>({time:S.time,value:u(S)}))})),d,{stroke:b,strokeWidth:a,smoothing:l,smoothingType:s,dashed:y,id:this.id?`${this.id}-${g}`:void 0});return c.push(...h(u=>u.max,n,"max"),...h(u=>u.min,t,"min"),...h(u=>u.avg,o,"avg",r)),c}};var $e=1,bt="#6b728044";var Fe=4;function yt(i,e="last"){let t=[...i].sort((r,l)=>r.time-l.time||r.index-l.index),n=[],o=r=>n.every(l=>r.right+Fe<=l.left||l.right+Fe<=r.left);t.length>0&&n.push(e==="first"?t[0]:t[t.length-1]);for(let r of t)r!==n[0]&&o(r)&&n.push(r);return new Set(n.map(r=>r.index))}function xt(i){let e=typeof i=="object"&&i!==null?i.mode:i,t=typeof i=="object"&&i!==null&&i.keep==="first"?"first":"last";return {fit:e==="fit",keep:t}}var fe=class{#e;constructor(e,t,n,o){this.#e={...e,xRange:t,y:n,height:o};}render(){let{items:e,timeScale:t,background:n,hatch:o,showAxis:r,xRange:l,y:s,height:a}=this.#e,m=[];n&&m.push({type:"rect",x:l[0],y:s,w:l[1]-l[0],h:a,fill:n,opacity:.04,stroke:"#ddd",strokeWidth:.25});let d=this.#n();if(e.forEach((c,p)=>{let h=this.#t(c);if(!h)return;let{startX:u,w:b}=h,g=u+b/2;if(m.push({type:"rect",x:u,y:s,w:b,h:a,hatch:c.hatch??o,fill:c.fill??bt,stroke:c.stroke,strokeWidth:c.strokeWidth??0,title:c.title}),c.label&&(!d||d.has(p))){let y=c.labelFontSize??10;m.push({type:"text",content:c.label,x:g,y:this.#r(c.labelBaseline,y),anchor:"middle",fontSize:y,fill:c.labelFill??"#333"});}}),r){let c=new H({domain:t.domain(),xRange:l,y:s+a+4});m.push({type:"group",cssClass:"annotation-band-axis",commands:c.render()});}return m}#t(e){let{timeScale:t,xRange:n,minItemWidth:o=0}=this.#e,r=t.map(e.startTime),l=t.map(e.endTime);if(l<n[0]||r>n[1])return null;let s=Math.max(n[0],Math.min(n[1],r)),a=Math.max(n[0],Math.min(n[1],l)),m=Math.max(a-s,$e);return o>$e&&a-s<o&&(s=(s+a)/2-o/2,m=o),s=Math.max(n[0],s),s+m>n[1]&&(s=Math.max(n[0],n[1]-m)),{startX:s,w:m}}#n(){let{fit:e,keep:t}=xt(this.#e.labels);if(!e)return null;let n=this.#e.metrics??A,o=[];return this.#e.items.forEach((r,l)=>{let s=r.label?this.#t(r):null;if(!s||!r.label)return;let a=s.startX+s.w/2,m=n(r.label,r.labelFontSize??10)/2;o.push({index:l,time:r.startTime,left:a-m,right:a+m});}),yt(o,t)}#r(e,t){let{y:n,height:o}=this.#e;switch(e){case "top":return n+t*.9;case "bottom":return n+o-t*.25;default:return n+o/2+t*.35}}};var ge=class{#e;constructor(e){this.#e=e;}render(){let{data:e,valueScale:t,xRange:n,showMin:o=false,showMax:r=false,showAvg:l=true,showMedian:s=false,labelPosition:a="end",lineColor:m=f.statsLineColor,labelColor:d=f.statsLabelColor}=this.#e,c=Se.compute(e),p=[{name:"min",value:c.min,enabled:o},{name:"max",value:c.max,enabled:r},{name:"avg",value:c.avg,enabled:l},{name:"median",value:c.median,enabled:s}],h=[],[u,b]=n;for(let g of p.filter(y=>y.enabled)){let y=t.map(g.value);h.push({type:"line",x1:u,y1:y,x2:b,y2:y,stroke:m,strokeWidth:1});let x=`${g.name}: ${g.value.toFixed(1)}`;(a==="start"||a==="both")&&h.push({type:"text",content:x,x:u+4,y:y-4,anchor:"start",fontSize:f.statFontSize,fill:d}),(a==="end"||a==="both")&&h.push({type:"text",content:x,x:b-4,y:y-4,anchor:"end",fontSize:f.statFontSize,fill:d}),a==="center"&&h.push({type:"text",content:x,x:(u+b)/2,y:y-4,anchor:"middle",fontSize:f.statFontSize,fill:d});}return h}};var $=class{#e;#t;#n;constructor(e){this.#e=e?.locale||(X()??"en-US"),this.#t=e?.fallbackLocales??["en-US"],this.#n=e?.autoFormat??true;}format(e,t,n){try{let o=this.#n&&n?this.#r(e,n,t):t;return B(this.#e,o).format(new Date(e))}catch{for(let o of this.#t)try{return B(o,t).format(new Date(e))}catch{}return new Date(e).toISOString()}}formatRange(e,t){let n=this.format(e),o=this.format(t);return `${n} \u2014 ${o}`}#r(e,t,n){let o=Math.abs(e-t),r=864e5,l=36e5,s=6e4,a={};return o<s?(a.second="2-digit",a.minute="2-digit",a.hour="2-digit"):o<l?(a.minute="2-digit",a.hour="2-digit"):o<r?(a.hour="2-digit",a.minute="2-digit"):o<7*r?(a.weekday="short",a.day="numeric"):o<365*r?(a.month="short",a.day="numeric"):(a.month="short",a.year="numeric"),{...n,...a}}};var F=class i{#e;#t;_compact;#n;constructor(e){this.#e=e?.unit??"",this.#t=e?.decimals??1,this._compact=e?.compact??false,this.#n=e?.custom;}format(e){if(this.#n)return this.#n(e);let t;return this._compact&&Math.abs(e)>=1e6?t=`${(e/1e6).toFixed(this.#t)}M`:this._compact&&Math.abs(e)>=1e3?t=`${(e/1e3).toFixed(this.#t)}k`:t=e.toFixed(this.#t),this.#e?`${t}${this.#e}`:t}formatRange(e,t){return `${this.format(e)} \u2014 ${this.format(t)}`}static unit(e,t=1){return new i({unit:e,decimals:t})}static temperature(e="\xB0C"){return new i({unit:e,decimals:1})}static percentage(){return new i({unit:"%",decimals:0})}};var W=class i{#e;#t;#n;constructor(e){this.#e=e?.map??{},this.#t=e?.fallback??(t=>String(t)),this.#n=e?.showValue??false;}format(e){let t=this.#e[e]??this.#t(e);return this.#n?`(${e}) ${t}`:t}has(e){return e in this.#e}labels(){return Object.values(this.#e)}values(){return Object.keys(this.#e).map(Number)}static fromLabels(e,t=false){let n={};return e.forEach((o,r)=>{n[r]=o;}),new i({map:n,showValue:t})}};var St={time:new $,value:new F,enum:new W};function be(i,e){let t=D();return {color:i.color??t.stroke,width:i.width??t.strokeWidth,style:i.style??"solid",smoothing:i.smoothing??false,smoothingType:i.smoothingType,shape:i.shape??(e.seriesType==="step"?"step":"line"),gapThreshold:i.gapThreshold??t.gapThreshold,opacity:i.opacity??1}}function We(i){let e=i.style?.line;return e===false?[]:e===void 0?[be({},i)]:Array.isArray(e)?e.map(t=>be(t,i)):[be(e,i)]}function je(i){let e=i.style?.markers;if(!e?.type||e.type==="none")return;let t=D(),o=(i.style?.line&&!Array.isArray(i.style.line)?i.style.line.color:void 0)??t.stroke;return {type:e.type,size:e.size??t.pointSize,stroke:e.stroke??o,fill:e.fill??"#ffffff",strokeWidth:e.strokeWidth??1,threshold:e.threshold}}function Ie(i){let e=i.style?.shadow;if(!(!e?.color||e.color==="transparent"||e.color==="none"))return {color:e.color,blur:e.blur??4,offsetX:e.offsetX??0,offsetY:e.offsetY??0}}function ze(i){return i.style?.gap}function Be(i){return i.style?.fill}function wt(i){return {lines:We(i),fill:Be(i),markers:je(i),shadow:Ie(i),gap:ze(i),id:i.style?.id??i.id}}/*!
27
+ </clipPath>`}get regions(){return [...this.#e]}};function U(i,e){if(e<=0||i.length<2)return [];let t=[];for(let n=0;n<i.length-1;n++){let o=i[n],r=i[n+1];for(let l=1;l<=e;l++)t.push(o+(r-o)*l/(e+1));}return t}var G={axisColor:f.axisColor,tickColor:f.tickColor,textColor:f.textColor,textSize:f.textSize},H=class{#e;#t;constructor(e){this.#e=new O({domain:e.domain,range:e.xRange,locale:e.locale,timeZone:e.timeZone}),this.#t=e;}get scale(){return this.#e}get axisColor(){return (this.#t.colors??G).axisColor}get tickColor(){return (this.#t.colors??G).tickColor}get textColor(){return (this.#t.colors??G).textColor}get textSize(){return (this.#t.colors??G).textSize}generateTicks(){let e=this.#t.minTicks??5,t=this.#t.maxTicks??12,o=this.#e.ticks({minTicks:e,maxTicks:t}).map(r=>({time:r,x:this.#e.map(r),label:this.tickLabel(r)}));return this.antiOverlap(o)}tickLabel(e){if(this.#t.format)return this.#t.format(new Date(e));let t=this.#t.minTicks??5,n=this.#t.maxTicks??12,{interval:o}=this.#e.tickInterval((t+n)/2,t,n),r={};return o<6e4?(r.hour="2-digit",r.minute="2-digit",r.second="2-digit"):o<36e5||o<864e5?(r.hour="2-digit",r.minute="2-digit"):o<31536e6?(r.day="numeric",r.month="short",o>=2592e6&&(r.day=void 0,r.month="long")):(r.year="numeric",o<2*31536e6&&(r.month="short")),this.#e.format(e,r)}antiOverlap(e){if(e.length<=1)return e;let t=60,n=[e[0]];for(let o=1;o<e.length;o++){let r=n[n.length-1].x;Math.abs(e[o].x-r)>=t&&n.push(e[o]);}return n}render(){let e=this.generateTicks(),t=this.#t.colors??G,n=this.#t.y??0,o=[],[r,l]=this.#e.range();o.push({type:"line",x1:r,y1:n,x2:l,y2:n,stroke:t.axisColor,strokeWidth:t.axisWidth});for(let s of this.generateMinorTicks())o.push({type:"line",x1:s,y1:n,x2:s,y2:n+3,stroke:t.tickColor,strokeWidth:t.axisWidth});for(let s of e)o.push({type:"line",x1:s.x,y1:n,x2:s.x,y2:n+6,stroke:t.tickColor,strokeWidth:t.axisWidth}),o.push({type:"text",content:s.label,x:this.#n(s.x,s.label,t.textSize),y:n+t.textSize+6,anchor:"middle",fontSize:t.textSize,fill:t.textColor});return o}generateMinorTicks(){return U(this.generateTicks().map(e=>e.x),this.#t.minorTicks??0)}#n(e,t,n){let o=this.#t.gesamtbreite,r=this.#t.metrics;if(o===void 0||r===void 0)return e;let l=r(t,n)/2;return Math.max(l+2,Math.min(o-l-2,e))}};var R={axisColor:"#ccc",tickColor:"#ddd",textColor:"#777",textSize:12};function le(i,e){let t=n=>e===void 0||e>=n;return Math.abs(i)>=1e6&&t(1e5)?`${(i/1e6).toFixed(1)}M`:Math.abs(i)>=1e3&&t(100)?`${(i/1e3).toFixed(1)}k`:Number.isInteger(i)?String(i):i.toFixed(1)}function wt(i){return i.map((e,t)=>t+1<i.length&&i[t+1].label===e.label)}var me=class{#e;#t;constructor(e){this.#e=e.untergrenze===void 0?new _({domain:e.domain,range:e.range}):new Y({domain:e.domain,range:e.range,untergrenze:e.untergrenze}),this.#t=e;}get scale(){return this.#e}get axisColor(){return (this.#t.colors??R).axisColor}get tickColor(){return (this.#t.colors??R).tickColor}get textColor(){return (this.#t.colors??R).textColor}get textSize(){return (this.#t.colors??R).textSize}generateTicks(){let e=this.#t.tickValues;if(e&&e.length>0){let b=this.#t.format??le;return e.map(g=>({value:g,position:this.#e.map(g),label:b(g)}))}let t=this.#t.format??le,n=this.#t.ticks&&this.#t.ticks>0?this.#t.ticks:6,[o,r]=this.#e.domain(),l=Math.min(o,r),s=Math.max(o,r),a=s-l;if(a===0)return [{value:o,position:this.#e.map(o),label:t(o)}];let m=a/n,d=Math.pow(10,Math.floor(Math.log10(m))),c=m/d,p;if(c<=1.5?p=d:c<=3?p=2*d:c<=7?p=5*d:p=10*d,p<=0||!Number.isFinite(p))return [{value:o,position:this.#e.map(o),label:t(o)}];this.#t.format||(t=b=>le(b,p));let h=[],u=Math.ceil(l/p)*p;for(let b=u;b<=s;b+=p)h.push({value:b,position:this.#e.map(b),label:t(b)});return h}generateMinorTicks(){let e=this.#t.minorTickValues;return e?e.map(t=>this.#e.map(t)):U(this.generateTicks().map(t=>t.position),this.#t.minorTicks??0)}render(){let e=this.generateTicks(),t=this.#t.colors??R,n=this.#t.x??0,o=this.#t.orientation??"vertical",r=this.#t.position??"left",l=this.#t.suppressLabelsNear??[],s=this.#t.suppressTolerancePx??8,a=c=>l.some(p=>Math.abs(p-c)<=s),m=[];if(o==="vertical"){let[c,p]=this.#e.range();m.push({type:"line",x1:n,y1:c,x2:n,y2:p,stroke:t.axisColor,strokeWidth:t.axisWidth});let h=wt(e);e.forEach((u,b)=>{let g=a(u.position),y=h[b]?{opacity:0}:{};r==="left"?(m.push({type:"line",x1:n-4,y1:u.position,x2:n,y2:u.position,stroke:t.tickColor,strokeWidth:t.axisWidth}),g||m.push({type:"text",content:u.label,x:this.#n(n-8,u.label,"end"),y:u.position+4,anchor:"end",fontSize:t.textSize,fill:t.textColor,...y})):(m.push({type:"line",x1:n,y1:u.position,x2:n+4,y2:u.position,stroke:t.tickColor,strokeWidth:t.axisWidth}),g||m.push({type:"text",content:u.label,x:this.#n(n+8,u.label,"start"),y:u.position+4,anchor:"start",fontSize:t.textSize,fill:t.textColor,...y}));});}else {let[c,p]=this.#e.range();m.push({type:"line",x1:c,y1:n,x2:p,y2:n,stroke:t.axisColor,strokeWidth:t.axisWidth});for(let h of e)m.push({type:"line",x1:h.position,y1:n,x2:h.position,y2:n+6,stroke:t.tickColor,strokeWidth:t.axisWidth}),m.push({type:"text",content:h.label,x:h.position,y:n+18,anchor:"middle",fontSize:t.textSize,fill:t.textColor});}let d=(this.#t.orientation??"vertical")==="vertical";for(let c of this.generateMinorTicks())m.push(d?{type:"line",x1:r==="right"?n:n-2,y1:c,x2:r==="right"?n+2:n,y2:c,stroke:t.tickColor,strokeWidth:t.axisWidth}:{type:"line",x1:c,y1:n,x2:c,y2:n+3,stroke:t.tickColor,strokeWidth:t.axisWidth});return m}#n(e,t,n){let o=this.#t.gesamtbreite,r=this.#t.metrics;if(o===void 0||r===void 0)return e;let l=r(t,(this.#t.colors??R).textSize);return n==="end"?Math.max(l+2,Math.min(o-2,e)):Math.min(o-l-2,Math.max(2,e))}};var ue=class i{#e;#t;#n;#r;#a;#o;#i;constructor(e){this.#e=[...e.data].sort((t,n)=>t.time-n.time),this.#t=e.windowSize,this.#n=e.type??"simple",this.#r=e.timeScale,this.#a=e.valueScale,this.#o=e.stroke??"#e53e3e",this.#i=e.strokeWidth??2;}static simple(e,t){let n=[...e].filter(r=>r.value!==null).sort((r,l)=>r.time-l.time),o=[];for(let r=0;r<n.length;r++){let l=Math.max(0,r-t+1),s=n.slice(l,r+1),a=s.reduce((m,d)=>m+d.value,0)/s.length;o.push({time:n[r].time,value:a});}return o}static exponential(e,t){let n=[...e].filter(s=>s.value!==null).sort((s,a)=>s.time-a.time);if(n.length===0)return [];let o=2/(t+1),r=[],l=n[0].value;r.push({time:n[0].time,value:l});for(let s=1;s<n.length;s++)l=n[s].value*o+l*(1-o),r.push({time:n[s].time,value:l});return r}points(){return (this.#n==="exponential"?i.exponential(this.#e,this.#t):i.simple(this.#e,this.#t)).map(t=>({x:this.#r.map(t.time),y:this.#a.map(t.value)}))}render(){let e=this.points();return e.length<2?e.map(t=>({type:"circle",cx:t.x,cy:t.y,r:this.#i,fill:this.#o})):[{type:"path",points:e,smoothing:true,stroke:this.#o,strokeWidth:this.#i}]}};var ce=class{#e;#t;#n;constructor(e){let t=Object.keys(e.enumMap).map(Number).sort((n,o)=>n-o).map(String);this.#t=t,this.#e=new E({domain:t,range:e.range}),this.#n=e;}get scale(){return this.#e}generateTicks(){let{enumMap:e,showLabels:t=true,autoColor:n=true,gapValues:o}=this.#n,r=new Set(o??[]);return this.#t.map((l,s)=>{let a=Number(l),m=t?e[a]??String(a):String(a),d=this.#e.map(a),c=n?f.palette[s%f.palette.length]:void 0;return {value:a,label:m,y:d,color:c,isGap:r.has(a)}})}colorFor(e){let t=this.#t.indexOf(String(e));if(!(t===-1||!(this.#n.autoColor??true)))return f.palette[t%f.palette.length]}render(){let e=this.generateTicks(),t=this.#n.x??0,n=[];for(let o of e)o.isGap||n.push({type:"text",content:o.label,x:t,y:o.y+4,anchor:"end",fontSize:f.textSize,fill:o.color??f.textColor});return n}map(e){return this.#e.map(e)}isGap(e){return new Set(this.#n.gapValues??[]).has(e)}};var M=class i{#e;#t;static uidcnt=0;#n;constructor(e,t=[]){this.#e=e.id??"series-"+ ++i.uidcnt,this.#t=e.timeScale,this.#n=t;}get id(){return this.#e}get timeScale(){return this.#t}get data(){return this.#n}};var de=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}points(){let e=this.#e.valueScale;return this.data.filter(t=>t.value!==null).map(t=>({x:this.timeScale.map(t.time),y:e.map(t.value),time:t.time})).sort((t,n)=>t.x-n.x)}render(){let e=this.#e,t={smoothing:e.smoothing??false,smoothingType:e.smoothingType,stroke:e.stroke??f.stroke,strokeWidth:e.strokeWidth??f.strokeWidth,dashed:e.dashed??false,pointStyle:e.pointStyle??"none",pointSize:e.pointSize??f.pointSize,shadowColor:e.shadowColor,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY},n=e.pointThreshold??f.pointThreshold,o=e.gapThreshold??f.gapThreshold,r=e.id,l=C.getRuns(this.data,c=>c.value===null,o),s=l.reduce((c,p)=>c+p.length,0);if(s===0)return [];let a={timeScale:this.timeScale,valueScale:e.valueScale},m=l.map(c=>({data:c})),d=[];return d.push(...L(m,a,{...t,id:r?`${r}-line`:void 0})),t.pointStyle&&t.pointStyle!=="none"&&s<=n&&d.push(...te(l.flat(),a,{...t,id:r?`${r}-marker`:void 0},()=>t.stroke)),d}};var he=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}points(){let e=this.#e.valueScale,t=[...this.data].filter(o=>o.value!==null).sort((o,r)=>o.time-r.time),n=[];for(let o=0;o<t.length;o++){let r=this.timeScale.map(t[o].time),l=e.map(t[o].value);o===0?n.push({x:r,y:l}):n.push({x:r,y:n[n.length-1].y},{x:r,y:l});}return n}render(){let e=C.getRuns(this.data,o=>o.value===null);if(e.length===0)return [];let t={timeScale:this.timeScale,valueScale:this.#e.valueScale},n=e.map(o=>({data:o}));return Q(n,t,{stroke:this.#e.stroke??f.stroke,strokeWidth:this.#e.strokeWidth??f.strokeWidth,id:this.id?`${this.id}-line`:void 0})}};var pe=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}opacity(e){if(!(this.#e.countOpacity??false))return .6;let t=0;for(let n of this.data)n.count>t&&(t=n.count);return t===0?.2:.2+.8*e/t}render(){let e=this.#e,t=e.fill??f.bandFill,n=e.hatch,o=e.avgLine??false,r=e.avgLineColor??f.bandAvgLine,l=e.bandWidth??10,s=[];for(let a of this.data){if(a.min===null||a.max===null)continue;let m=this.timeScale.map(a.time),d=e.valueScale.map(a.max),c=e.valueScale.map(a.min),p=l,h=this.data.indexOf(a);if(s.push({type:"rect",x:m-p/2,y:d,w:p,h:c-d,fill:t,hatch:n,opacity:this.opacity(a.count),id:this.id?`${this.id}-slot-${h}`:void 0}),o&&a.avg!==null){let u=e.valueScale.map(a.avg);s.push({type:"line",x1:m-p/2,y1:u,x2:m+p/2,y2:u,stroke:r,strokeWidth:1,id:this.id?`${this.id}-avg-${h}`:void 0});}}return s}};function $e(i,e,t,n,o,r,l){return ee(i,e,{boundaries:[],yLow:s=>s.avg,yHigh:t,getValue:s=>s.avg,interpolate:ve(e.valueScale),getColor:()=>n,getHatch:()=>o},{id:r,...l})}var fe=class extends M{#e;constructor(e){super(e,e.data),this.#e=e;}render(){let e=this.#e,t=e.minColor??f.minColor,n=e.maxColor??f.maxColor,o=e.avgColor??f.avgColor,r=e.avgDashed??true,l=e.smoothing??false,s=e.smoothingType,a=e.strokeWidth??f.strokeWidth,m=C.getRuns(this.data,u=>u.min===null||u.max===null||u.avg===null);if(m.length===0)return [];let d={timeScale:this.timeScale,valueScale:e.valueScale},c=[];m.forEach((u,b)=>{if(u.length<2)return;let g=y=>this.id?`${this.id}-${y}-${b}`:void 0;if(e.fillToMax){let y=$e(u,d,x=>x.max,e.fillToMax,e.fillToMaxHatch,g("fillToMax"),{smoothing:l,smoothingType:s});c.push(...y);}if(e.fillToMin){let y=$e(u,d,x=>x.min,e.fillToMin,e.fillToMinHatch,g("fillToMin"),{smoothing:l,smoothingType:s});c.push(...y);}});let p=m.filter(u=>u.length>=2),h=(u,b,g,y=false)=>L(p.map(x=>({data:x.map(S=>({time:S.time,value:u(S)}))})),d,{stroke:b,strokeWidth:a,smoothing:l,smoothingType:s,dashed:y,id:this.id?`${this.id}-${g}`:void 0});return c.push(...h(u=>u.max,n,"max"),...h(u=>u.min,t,"min"),...h(u=>u.avg,o,"avg",r)),c}};var We=1,kt="#6b728044";var je=4;function vt(i,e="last"){let t=[...i].sort((r,l)=>r.time-l.time||r.index-l.index),n=[],o=r=>n.every(l=>r.right+je<=l.left||l.right+je<=r.left);t.length>0&&n.push(e==="first"?t[0]:t[t.length-1]);for(let r of t)r!==n[0]&&o(r)&&n.push(r);return new Set(n.map(r=>r.index))}function Ct(i){let e=typeof i=="object"&&i!==null?i.mode:i,t=typeof i=="object"&&i!==null&&i.keep==="first"?"first":"last";return {fit:e==="fit",keep:t}}var ge=class{#e;constructor(e,t,n,o){this.#e={...e,xRange:t,y:n,height:o};}render(){let{items:e,timeScale:t,background:n,hatch:o,showAxis:r,xRange:l,y:s,height:a}=this.#e,m=[];n&&m.push({type:"rect",x:l[0],y:s,w:l[1]-l[0],h:a,fill:n,opacity:.04,stroke:"#ddd",strokeWidth:.25});let d=this.#n();if(e.forEach((c,p)=>{let h=this.#t(c);if(!h)return;let{startX:u,w:b}=h,g=u+b/2;if(m.push({type:"rect",x:u,y:s,w:b,h:a,hatch:c.hatch??o,fill:c.fill??kt,stroke:c.stroke,strokeWidth:c.strokeWidth??0,title:c.title}),c.label&&(!d||d.has(p))){let y=c.labelFontSize??10;m.push({type:"text",content:c.label,x:g,y:this.#r(c.labelBaseline,y),anchor:"middle",fontSize:y,fontWeight:c.labelFontWeight,fill:c.labelFill??"#333"});}}),r){let c=new H({domain:t.domain(),xRange:l,y:s+a+4});m.push({type:"group",cssClass:"annotation-band-axis",commands:c.render()});}return m}#t(e){let{timeScale:t,xRange:n,minItemWidth:o=0}=this.#e,r=t.map(e.startTime),l=t.map(e.endTime);if(l<n[0]||r>n[1])return null;let s=Math.max(n[0],Math.min(n[1],r)),a=Math.max(n[0],Math.min(n[1],l)),m=Math.max(a-s,We);return o>We&&a-s<o&&(s=(s+a)/2-o/2,m=o),s=Math.max(n[0],s),s+m>n[1]&&(s=Math.max(n[0],n[1]-m)),{startX:s,w:m}}#n(){let{fit:e,keep:t}=Ct(this.#e.labels);if(!e)return null;let n=this.#e.metrics??D,o=[];return this.#e.items.forEach((r,l)=>{let s=r.label?this.#t(r):null;if(!s||!r.label)return;let a=s.startX+s.w/2,m=Le(n,r.labelFontWeight)(r.label,r.labelFontSize??10)/2;o.push({index:l,time:r.startTime,left:a-m,right:a+m});}),vt(o,t)}#r(e,t){let{y:n,height:o}=this.#e;switch(e){case "top":return n+t*.9;case "bottom":return n+o-t*.25;default:return n+o/2+t*.35}}};var be=class{#e;constructor(e){this.#e=e;}render(){let{data:e,valueScale:t,xRange:n,showMin:o=false,showMax:r=false,showAvg:l=true,showMedian:s=false,labelPosition:a="end",lineColor:m=f.statsLineColor,labelColor:d=f.statsLabelColor}=this.#e,c=Te.compute(e),p=[{name:"min",value:c.min,enabled:o},{name:"max",value:c.max,enabled:r},{name:"avg",value:c.avg,enabled:l},{name:"median",value:c.median,enabled:s}],h=[],[u,b]=n;for(let g of p.filter(y=>y.enabled)){let y=t.map(g.value);h.push({type:"line",x1:u,y1:y,x2:b,y2:y,stroke:m,strokeWidth:1});let x=`${g.name}: ${g.value.toFixed(1)}`;(a==="start"||a==="both")&&h.push({type:"text",content:x,x:u+4,y:y-4,anchor:"start",fontSize:f.statFontSize,fill:d}),(a==="end"||a==="both")&&h.push({type:"text",content:x,x:b-4,y:y-4,anchor:"end",fontSize:f.statFontSize,fill:d}),a==="center"&&h.push({type:"text",content:x,x:(u+b)/2,y:y-4,anchor:"middle",fontSize:f.statFontSize,fill:d});}return h}};var F=class{#e;#t;#n;constructor(e){this.#e=e?.locale||(X()??"en-US"),this.#t=e?.fallbackLocales??["en-US"],this.#n=e?.autoFormat??true;}format(e,t,n){try{let o=this.#n&&n?this.#r(e,n,t):t;return z(this.#e,o).format(new Date(e))}catch{for(let o of this.#t)try{return z(o,t).format(new Date(e))}catch{}return new Date(e).toISOString()}}formatRange(e,t){let n=this.format(e),o=this.format(t);return `${n} \u2014 ${o}`}#r(e,t,n){let o=Math.abs(e-t),r=864e5,l=36e5,s=6e4,a={};return o<s?(a.second="2-digit",a.minute="2-digit",a.hour="2-digit"):o<l?(a.minute="2-digit",a.hour="2-digit"):o<r?(a.hour="2-digit",a.minute="2-digit"):o<7*r?(a.weekday="short",a.day="numeric"):o<365*r?(a.month="short",a.day="numeric"):(a.month="short",a.year="numeric"),{...n,...a}}};var $=class i{#e;#t;_compact;#n;constructor(e){this.#e=e?.unit??"",this.#t=e?.decimals??1,this._compact=e?.compact??false,this.#n=e?.custom;}format(e){if(this.#n)return this.#n(e);let t;return this._compact&&Math.abs(e)>=1e6?t=`${(e/1e6).toFixed(this.#t)}M`:this._compact&&Math.abs(e)>=1e3?t=`${(e/1e3).toFixed(this.#t)}k`:t=e.toFixed(this.#t),this.#e?`${t}${this.#e}`:t}formatRange(e,t){return `${this.format(e)} \u2014 ${this.format(t)}`}static unit(e,t=1){return new i({unit:e,decimals:t})}static temperature(e="\xB0C"){return new i({unit:e,decimals:1})}static percentage(){return new i({unit:"%",decimals:0})}};var W=class i{#e;#t;#n;constructor(e){this.#e=e?.map??{},this.#t=e?.fallback??(t=>String(t)),this.#n=e?.showValue??false;}format(e){let t=this.#e[e]??this.#t(e);return this.#n?`(${e}) ${t}`:t}has(e){return e in this.#e}labels(){return Object.values(this.#e)}values(){return Object.keys(this.#e).map(Number)}static fromLabels(e,t=false){let n={};return e.forEach((o,r)=>{n[r]=o;}),new i({map:n,showValue:t})}};var Mt={time:new F,value:new $,enum:new W};function ye(i,e){let t=A();return {color:i.color??t.stroke,width:i.width??t.strokeWidth,style:i.style??"solid",smoothing:i.smoothing??false,smoothingType:i.smoothingType,shape:i.shape??(e.seriesType==="step"?"step":"line"),gapThreshold:i.gapThreshold??t.gapThreshold,opacity:i.opacity??1}}function Ie(i){let e=i.style?.line;return e===false?[]:e===void 0?[ye({},i)]:Array.isArray(e)?e.map(t=>ye(t,i)):[ye(e,i)]}function Be(i){let e=i.style?.markers;if(!e?.type||e.type==="none")return;let t=A(),o=(i.style?.line&&!Array.isArray(i.style.line)?i.style.line.color:void 0)??t.stroke;return {type:e.type,size:e.size??t.pointSize,stroke:e.stroke??o,fill:e.fill??"#ffffff",strokeWidth:e.strokeWidth??1,threshold:e.threshold}}function ze(i){let e=i.style?.shadow;if(!(!e?.color||e.color==="transparent"||e.color==="none"))return {color:e.color,blur:e.blur??4,offsetX:e.offsetX??0,offsetY:e.offsetY??0}}function Oe(i){return i.style?.gap}function Ee(i){return i.style?.fill}function Lt(i){return {lines:Ie(i),fill:Ee(i),markers:Be(i),shadow:ze(i),gap:Oe(i),id:i.style?.id??i.id}}/*!
28
28
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
29
29
  * MIT with Attribution: free use incl. commercial requires visible credit to
30
30
  * "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
@@ -43,4 +43,4 @@ var K=class{};var C=class{static interpolateDataPoint(i,e,t){return {time:i.time
43
43
  * MLTimeGraph — Copyright (c) 2026 Michael Lechner
44
44
  * MIT with Attribution: free use incl. commercial must have visible credit to
45
45
  * "Michael Lechner". Commercial license (no attribution) on request. See LICENSE.
46
- */export{fe as AnnotationBandSeries,E as BandScale,he as BandSeries,ae as Clip,I as CommandBuilder,ue as EnumAxis,W as EnumFormatter,St as Formatters,ie as Layout,ce as LineSeries,_ as LinearScale,pe as MinMaxAvgSeries,me as MovingAvg,K as Renderer,ge as StatsOverlay,de as StepSeries,k as TIME_INTERVALS,H as TimeAxis,$ as TimeFormatter,O as TimeScale,le as ValueAxis,F as ValueFormatter,Le as getHatch,Ae as measureLegend,pt as renderAnnotations,Ge as renderArea,ut as renderGaps,rt as renderGrid,dt as renderHighlights,et as renderLegend,L as renderLine,ct as renderMarkers,te as renderSeriesMarkers,Ee as renderSplitLine,Q as renderStep,st as renderThresholds,ee as renderZonedArea,Be as resolveFill,ze as resolveGap,We as resolveLines,je as resolveMarkers,wt as resolveSeriesStyle,Ie as resolveShadow,oe as slugify,f as theme,Oe as toStepData,J as toStepPoints};
46
+ */export{ge as AnnotationBandSeries,E as BandScale,pe as BandSeries,se as Clip,I as CommandBuilder,ce as EnumAxis,W as EnumFormatter,Mt as Formatters,ae as Layout,de as LineSeries,_ as LinearScale,fe as MinMaxAvgSeries,ue as MovingAvg,K as Renderer,be as StatsOverlay,he as StepSeries,k as TIME_INTERVALS,H as TimeAxis,F as TimeFormatter,O as TimeScale,me as ValueAxis,$ as ValueFormatter,Ae as getHatch,Pe as measureLegend,St as renderAnnotations,Ve as renderArea,gt as renderGaps,mt as renderGrid,yt as renderHighlights,it as renderLegend,L as renderLine,bt as renderMarkers,te as renderSeriesMarkers,He as renderSplitLine,Q as renderStep,ht as renderThresholds,ee as renderZonedArea,Ee as resolveFill,Oe as resolveGap,Ie as resolveLines,Be as resolveMarkers,Lt as resolveSeriesStyle,ze as resolveShadow,ie as slugify,f as theme,Ge as toStepData,J as toStepPoints};
@@ -1,4 +1,4 @@
1
- import { a as DrawCommand, b as LineDashStyle, c as LineVariant, P as PointStyleType, d as DrawGroup, M as MarkerLineStyle, G as GridLayer, A as AxisPosition, e as AxisScale, f as AnySeries, g as Threshold, H as Highlight, h as Gap, i as GapsConfig, j as Annotation, k as AnnotationBandConfig, S as SmoothingType, l as HatchVariant, T as TimeScale, L as LinearScale, D as DataPoint } from './types-RAg4hLZA.js';
1
+ import { a as DrawCommand, b as LineDashStyle, c as LineVariant, P as PointStyleType, d as DrawGroup, M as MarkerLineStyle, G as GridLayer, A as AxisPosition, e as AxisScale, f as AnySeries, g as Threshold, H as Highlight, h as Gap, i as GapsConfig, j as Annotation, k as AnnotationBandConfig, S as SmoothingType, l as HatchVariant, T as TimeScale, L as LinearScale, D as DataPoint } from './types-Cei2he4D.js';
2
2
 
3
3
  /** Output format type for the renderer (SVG string, Canvas, or nothing). */
4
4
  type RenderType = "svg" | "canvas" | "none";
@@ -253,6 +253,13 @@ type TextMetrics = (text: string, fontSize: number) => number;
253
253
  * Schaetzung, die bis 1.10.0 fuer alles galt.
254
254
  */
255
255
  declare const liberationMetrics: TextMetrics;
256
+ /**
257
+ * Dieselbe Metrik im fetten Schnitt (Liberation Sans Bold, 1.27.0).
258
+ *
259
+ * Fett ist breiter -- "i" 0,278 em statt 0,222, "Temperature (°C)" gut 4 %.
260
+ * Gerechnet wird mit ihr dort, wo ein Text `fontWeight: "bold"` traegt.
261
+ */
262
+ declare const liberationBoldMetrics: TextMetrics;
256
263
  /**
257
264
  * Die alte Schaetzung: 0,6 em je Zeichen.
258
265
  *
@@ -496,6 +503,14 @@ interface YAxisConfig {
496
503
  * library finds the place itself.
497
504
  */
498
505
  labelOffset?: number;
506
+ /**
507
+ * Axis key: a short line sample of every series on this axis -- colour, dash
508
+ * and marker -- stacked in the lane of the rotated title, above the title or,
509
+ * without one, on its own. Tells which series an axis belongs to when several
510
+ * share it, also on paper. When they do not all fit next to the title, the
511
+ * last line reads "+n" and `warnings()` says so. Default off.
512
+ */
513
+ key?: boolean;
499
514
  /** Override the value domain. `'auto'` lets the chart compute it from data. */
500
515
  domain?: [number, number] | "auto";
501
516
  /**
@@ -897,5 +912,5 @@ interface RenderingContext {
897
912
  declare function renderMarkers(points: DataPoint[], ctx: RenderingContext, style: FlatSeriesStyle, getColor: (p: DataPoint) => string): DrawCommand[];
898
913
  declare function drawMarker(commands: DrawCommand[], id: string | undefined, shape: Exclude<PointStyleType, "none">, x: number, y: number, size: number, stroke: string, fill: string, sw: number): void;
899
914
 
900
- export { renderMarkers as B, Renderer as R, drawMarker as n, estimateMetrics as o, getDefaultTheme as p, liberationMetrics as q, resetDefaultTheme as r, setDefaultTheme as s, slugify as t, Layout as v, measureLegend as y, renderLegend as z };
901
- export type { AxesConfig as A, FlatSeriesStyle as F, GridLineStyle as G, LegendItem as L, MLTimeGraphOptions as M, TextMetrics as T, XAxisConfig as X, YAxisConfig as Y, LayoutResult as a, Margin as b, LegendOptions as c, LegendPosition as d, LegendOrientation as e, Marker as f, RenderOutput as g, AxisLabelsStyle as h, AxisStyle as i, GridStyle as j, Theme as k, TickConfig as l, TickFormat as m, RenderingContext as u, LayoutConfig as w, LegendConfig as x };
915
+ export { renderLegend as B, renderMarkers as C, Renderer as R, drawMarker as n, estimateMetrics as o, getDefaultTheme as p, liberationBoldMetrics as q, liberationMetrics as r, resetDefaultTheme as s, setDefaultTheme as t, slugify as u, Layout as w, measureLegend as z };
916
+ export type { AxesConfig as A, FlatSeriesStyle as F, GridLineStyle as G, LegendItem as L, MLTimeGraphOptions as M, TextMetrics as T, XAxisConfig as X, YAxisConfig as Y, LayoutResult as a, Margin as b, LegendOptions as c, LegendPosition as d, LegendOrientation as e, Marker as f, RenderOutput as g, AxisLabelsStyle as h, AxisStyle as i, GridStyle as j, Theme as k, TickConfig as l, TickFormat as m, RenderingContext as v, LayoutConfig as x, LegendConfig as y };
@@ -46,6 +46,14 @@ type LabelAnchor = "start" | "middle" | "end";
46
46
  * "bottom" darueber.
47
47
  */
48
48
  type TextBaseline = "top" | "middle" | "bottom";
49
+ /**
50
+ * Schriftschnitt einer Beschriftung.
51
+ *
52
+ * Nur zwei Werte, keine Zahlen 100–900: Das PDF (mltimegraphpdf) hat genau
53
+ * diese zwei Schnitte, und ein Wert wie 500 saehe im Browser anders aus als
54
+ * im PDF. Gemessen wird fett mit einer eigenen Vorschubtabelle.
55
+ */
56
+ type FontWeight = "normal" | "bold";
49
57
  /**
50
58
  * Wie weit die senkrechte Linie eines Markers reicht.
51
59
  *
@@ -298,6 +306,8 @@ interface DrawText {
298
306
  anchor?: LabelAnchor;
299
307
  fontSize?: number;
300
308
  fontFamily?: string;
309
+ /** `"bold"` setzt `font-weight="bold"`; `"normal"` und nichts schreiben kein Attribut. */
310
+ fontWeight?: FontWeight;
301
311
  fill?: string;
302
312
  /** Element opacity (0–1). Used to keep an element in the SVG but invisible,
303
313
  * e.g. de-duplicated axis tick labels. */
@@ -1254,6 +1264,12 @@ interface AnnotationBandItem {
1254
1264
  label?: string;
1255
1265
  /** Label font size in px (default: 10). */
1256
1266
  labelFontSize?: number;
1267
+ /**
1268
+ * Label weight: `"normal"` (default) or `"bold"`. For short marks (stage numbers,
1269
+ * ①②③, "Datenausfall") that must stand out from the axis text. `labels: "fit"`
1270
+ * measures bold labels with the bold width table.
1271
+ */
1272
+ labelFontWeight?: FontWeight;
1257
1273
  /** Label fill color (default: inherit from theme). */
1258
1274
  labelFill?: string;
1259
1275
  /**
@@ -1322,5 +1338,5 @@ interface AnnotationBandConfig {
1322
1338
  labels?: AnnotationBandLabels;
1323
1339
  }
1324
1340
 
1325
- export { LinearScale as L, TimeScale as T, TIME_INTERVALS as aA, getHatch as aC, getLineStyle as ad, resolveDash as ae, BandScale as am };
1326
- export type { LineStyle as $, AxisPosition as A, AnnotationKind as B, AxisOrientation as C, DataPoint as D, DataPointRef as E, FillSpec as F, GridLayer as G, Highlight as H, EnumMap as I, FillBound as J, FillRegion as K, MarkerLineStyle as M, FillSide as N, FillStyle as O, PointStyleType as P, FillWhere as Q, RangeLabelPosition as R, SmoothingType as S, GapBand as U, GapConfig as V, GapLabel as W, GapRegion as X, GapStyle as Y, GapsAtEnd as Z, LineShape as _, DrawCommand as a, MarkerStyle as a0, MovingAverageType as a1, SVGLineStyle as a2, SensorType as a3, SeriesGapStyle as a4, SeriesGaps as a5, SeriesLegend as a6, SeriesOverlay as a7, SeriesOverlayKind as a8, SeriesType as a9, TimeScaleConfig as aB, ShadowStyle as aa, SolidDashStyle as ab, ThresholdLabelConfig as ac, LineParams as af, PathParams as ag, RectParams as ah, CircleParams as ai, TextParams as aj, GapParams as ak, Point as al, BandScaleConfig as an, Dashstyle_t as ao, DomainScaleConfig as ap, DrawCircle as aq, DrawGap as ar, DrawGapType_t$1 as as, DrawLine as at, DrawPath as au, DrawRect as av, DrawText as aw, LinearScaleConfig as ax, Scale as ay, ScaleConfig as az, LineDashStyle as b, LineVariant as c, DrawGroup as d, AxisScale as e, AnySeries as f, Threshold as g, Gap as h, GapsConfig as i, Annotation as j, AnnotationBandConfig as k, HatchVariant as l, SeriesStyle as m, TimeSeries as n, ThresholdFill as o, ThresholdLabelPosition as p, AnnotationPointShape as q, LabelAnchor as r, AnnotationBandItem as s, TextBaseline as t, AggregatedPoint as u, AggregatedSeries as v, AggregatedShowAs as w, AggregationConfig as x, AggregationMode as y, AnnotationBandLabels as z };
1341
+ export { LinearScale as L, TimeScale as T, TIME_INTERVALS as aB, getHatch as aD, getLineStyle as ae, resolveDash as af, BandScale as an };
1342
+ export type { LineShape as $, AxisPosition as A, AnnotationBandLabels as B, AnnotationKind as C, DataPoint as D, AxisOrientation as E, FillSpec as F, GridLayer as G, Highlight as H, DataPointRef as I, EnumMap as J, FillBound as K, MarkerLineStyle as M, FillRegion as N, FillSide as O, PointStyleType as P, FillStyle as Q, RangeLabelPosition as R, SmoothingType as S, FillWhere as U, GapBand as V, GapConfig as W, GapLabel as X, GapRegion as Y, GapStyle as Z, GapsAtEnd as _, DrawCommand as a, LineStyle as a0, MarkerStyle as a1, MovingAverageType as a2, SVGLineStyle as a3, SensorType as a4, SeriesGapStyle as a5, SeriesGaps as a6, SeriesLegend as a7, SeriesOverlay as a8, SeriesOverlayKind as a9, ScaleConfig as aA, TimeScaleConfig as aC, SeriesType as aa, ShadowStyle as ab, SolidDashStyle as ac, ThresholdLabelConfig as ad, LineParams as ag, PathParams as ah, RectParams as ai, CircleParams as aj, TextParams as ak, GapParams as al, Point as am, BandScaleConfig as ao, Dashstyle_t as ap, DomainScaleConfig as aq, DrawCircle as ar, DrawGap as as, DrawGapType_t$1 as at, DrawLine as au, DrawPath as av, DrawRect as aw, DrawText as ax, LinearScaleConfig as ay, Scale as az, LineDashStyle as b, LineVariant as c, DrawGroup as d, AxisScale as e, AnySeries as f, Threshold as g, Gap as h, GapsConfig as i, Annotation as j, AnnotationBandConfig as k, HatchVariant as l, SeriesStyle as m, TimeSeries as n, ThresholdFill as o, ThresholdLabelPosition as p, AnnotationPointShape as q, LabelAnchor as r, AnnotationBandItem as s, TextBaseline as t, FontWeight as u, AggregatedPoint as v, AggregatedSeries as w, AggregatedShowAs as x, AggregationConfig as y, AggregationMode as z };
@@ -487,6 +487,14 @@
487
487
  "null"
488
488
  ]
489
489
  },
490
+ "labelFontWeight": {
491
+ "description": "The label weight: \"normal\" (default) or \"bold\". For short marks that must stand out from the axis text. Labels \"fit\" measures bold labels with the bold width table.",
492
+ "enum": [
493
+ "normal",
494
+ "bold"
495
+ ],
496
+ "type": "string"
497
+ },
490
498
  "startTime": {
491
499
  "description": "The beginning of the event in Unix milliseconds.",
492
500
  "type": "integer"
@@ -2835,6 +2843,13 @@
2835
2843
  "description": "Widens an automatic domain to the thresholds drawn on this axis (Line other than \"none\"), so a limit line shows even when no reading comes near it. Same option as `includeThresholds` in TS.",
2836
2844
  "type": "boolean"
2837
2845
  },
2846
+ "key": {
2847
+ "description": "Draws the axis key: a short line sample of every series on this axis -- colour, dash and marker -- stacked in the lane of the rotated title, above the title or, without one, on its own. When they do not all fit next to the title, the last line reads \"+n\" and Warnings() says so. Default off. Gegenstueck: key in packages/ml-time-graph/src/style/axes.ts.",
2848
+ "type": [
2849
+ "boolean",
2850
+ "null"
2851
+ ]
2852
+ },
2838
2853
  "label": {
2839
2854
  "description": "The human-readable axis title.",
2840
2855
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ml-time-graph",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "TypeScript library for time-series charts with rich contextual annotation — telemetry, sensors, metrics, logs, finance. DOM-free SVG output, identical in the browser and on the server.",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -28,6 +28,12 @@ same unit and nearby ranges together, a gap larger than the larger range apart.
28
28
  the middle of the title; the others avoid it. `labels.color` / `labels.fontSize` style the tick
29
29
  numbers and the title alike.
30
30
 
31
+ **Which series belongs to which axis** — when several share one, colour no longer tells.
32
+ `axes.y[i].key: true` (or `axes.left/right.key`) draws a line sample of every series on that
33
+ axis (colour, dash, marker) in the title's lane, above the title; without a title on its own.
34
+ It is drawn, so it survives PDF and print. Too many for the room: the last line reads "+n" and
35
+ `warnings()` reports it — make the chart taller.
36
+
31
37
  ## Axes & Margins
32
38
  The layout engine does not call into the DOM, but it does know how wide text is: the advance
33
39
  widths of the default font stack (`Liberation Sans, Arial, Helvetica` — the three are