teechart.js 4.0.4 → 5.0.0-beta.1
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.
- package/3D-COMPATIBILITY.md +45 -0
- package/README.md +463 -27
- package/dist/chunks/chart-p639xVyw.js +16 -0
- package/dist/chunks/chart-p639xVyw.js.map +1 -0
- package/dist/chunks/palette-series-DfyYptK1.js +16 -0
- package/dist/chunks/palette-series-DfyYptK1.js.map +1 -0
- package/dist/chunks/series-DeozLXIv.js +16 -0
- package/dist/chunks/series-DeozLXIv.js.map +1 -0
- package/dist/teechart.3d.esm.js +27 -0
- package/dist/teechart.3d.esm.js.map +1 -0
- package/dist/teechart.auto.esm.js +16 -0
- package/dist/teechart.auto.esm.js.map +1 -0
- package/dist/teechart.core.esm.js +16 -0
- package/dist/teechart.core.esm.js.map +1 -0
- package/dist/teechart.esm.js +16 -0
- package/dist/teechart.esm.js.map +1 -0
- package/dist/teechart.js +14 -3
- package/dist/teechart.js.map +1 -1
- package/dist/teechart.maps.esm.js +16 -0
- package/dist/teechart.maps.esm.js.map +1 -0
- package/dist/types/accessibility.d.ts +29 -0
- package/dist/types/accessibility.d.ts.map +1 -0
- package/dist/types/auto.d.ts +4 -0
- package/dist/types/auto.d.ts.map +1 -0
- package/dist/types/chart-options.d.ts +826 -0
- package/dist/types/chart-options.d.ts.map +1 -0
- package/dist/types/chart.d.ts +252 -0
- package/dist/types/chart.d.ts.map +1 -0
- package/dist/types/checkbox.d.ts +12 -0
- package/dist/types/checkbox.d.ts.map +1 -0
- package/dist/types/core/elements/axes.d.ts +17 -0
- package/dist/types/core/elements/axes.d.ts.map +1 -0
- package/dist/types/core/elements/axis-grid.d.ts +20 -0
- package/dist/types/core/elements/axis-grid.d.ts.map +1 -0
- package/dist/types/core/elements/axis-labels.d.ts +54 -0
- package/dist/types/core/elements/axis-labels.d.ts.map +1 -0
- package/dist/types/core/elements/axis-ticks.d.ts +19 -0
- package/dist/types/core/elements/axis-ticks.d.ts.map +1 -0
- package/dist/types/core/elements/axis-title.d.ts +16 -0
- package/dist/types/core/elements/axis-title.d.ts.map +1 -0
- package/dist/types/core/elements/axis.d.ts +125 -0
- package/dist/types/core/elements/axis.d.ts.map +1 -0
- package/dist/types/core/elements/chart-image.d.ts +13 -0
- package/dist/types/core/elements/chart-image.d.ts.map +1 -0
- package/dist/types/core/elements/font.d.ts +28 -0
- package/dist/types/core/elements/font.d.ts.map +1 -0
- package/dist/types/core/elements/format.d.ts +125 -0
- package/dist/types/core/elements/format.d.ts.map +1 -0
- package/dist/types/core/elements/gradient.d.ts +23 -0
- package/dist/types/core/elements/gradient.d.ts.map +1 -0
- package/dist/types/core/elements/legend-symbol.d.ts +49 -0
- package/dist/types/core/elements/legend-symbol.d.ts.map +1 -0
- package/dist/types/core/elements/legend.d.ts +131 -0
- package/dist/types/core/elements/legend.d.ts.map +1 -0
- package/dist/types/core/elements/margins.d.ts +9 -0
- package/dist/types/core/elements/margins.d.ts.map +1 -0
- package/dist/types/core/elements/panel.d.ts +13 -0
- package/dist/types/core/elements/panel.d.ts.map +1 -0
- package/dist/types/core/elements/scroll.d.ts +14 -0
- package/dist/types/core/elements/scroll.d.ts.map +1 -0
- package/dist/types/core/elements/shadow.d.ts +14 -0
- package/dist/types/core/elements/shadow.d.ts.map +1 -0
- package/dist/types/core/elements/stroke.d.ts +19 -0
- package/dist/types/core/elements/stroke.d.ts.map +1 -0
- package/dist/types/core/elements/wall.d.ts +13 -0
- package/dist/types/core/elements/wall.d.ts.map +1 -0
- package/dist/types/core/elements/zoom.d.ts +33 -0
- package/dist/types/core/elements/zoom.d.ts.map +1 -0
- package/dist/types/core/primitives.d.ts +33 -0
- package/dist/types/core/primitives.d.ts.map +1 -0
- package/dist/types/core.d.ts +96 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/data/data-engine.d.ts +245 -0
- package/dist/types/data/data-engine.d.ts.map +1 -0
- package/dist/types/date.format.d.ts +5 -0
- package/dist/types/date.format.d.ts.map +1 -0
- package/dist/types/declarative-tools.d.ts +6 -0
- package/dist/types/declarative-tools.d.ts.map +1 -0
- package/dist/types/do-http-request.d.ts +2 -0
- package/dist/types/do-http-request.d.ts.map +1 -0
- package/dist/types/dom-tip.d.ts +41 -0
- package/dist/types/dom-tip.d.ts.map +1 -0
- package/dist/types/events.d.ts +82 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/extras.d.ts +18 -0
- package/dist/types/extras.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interaction.d.ts +67 -0
- package/dist/types/interaction.d.ts.map +1 -0
- package/dist/types/map-series-definition.d.ts +5 -0
- package/dist/types/map-series-definition.d.ts.map +1 -0
- package/dist/types/maps/africa-map.d.ts +10 -0
- package/dist/types/maps/africa-map.d.ts.map +1 -0
- package/dist/types/maps/asia-map.d.ts +10 -0
- package/dist/types/maps/asia-map.d.ts.map +1 -0
- package/dist/types/maps/australia-map.d.ts +10 -0
- package/dist/types/maps/australia-map.d.ts.map +1 -0
- package/dist/types/maps/europe-map.d.ts +10 -0
- package/dist/types/maps/europe-map.d.ts.map +1 -0
- package/dist/types/maps/europe27-map.d.ts +10 -0
- package/dist/types/maps/europe27-map.d.ts.map +1 -0
- package/dist/types/maps/layout-map.d.ts +51 -0
- package/dist/types/maps/layout-map.d.ts.map +1 -0
- package/dist/types/maps/map-types.d.ts +19 -0
- package/dist/types/maps/map-types.d.ts.map +1 -0
- package/dist/types/maps/south-america-map.d.ts +10 -0
- package/dist/types/maps/south-america-map.d.ts.map +1 -0
- package/dist/types/maps/spain-map.d.ts +11 -0
- package/dist/types/maps/spain-map.d.ts.map +1 -0
- package/dist/types/maps/svg-map.d.ts +37 -0
- package/dist/types/maps/svg-map.d.ts.map +1 -0
- package/dist/types/maps/usa-map.d.ts +12 -0
- package/dist/types/maps/usa-map.d.ts.map +1 -0
- package/dist/types/maps/world-map.d.ts +14 -0
- package/dist/types/maps/world-map.d.ts.map +1 -0
- package/dist/types/maps.d.ts +15 -0
- package/dist/types/maps.d.ts.map +1 -0
- package/dist/types/marks-animation.d.ts +16 -0
- package/dist/types/marks-animation.d.ts.map +1 -0
- package/dist/types/modern-theme.d.ts +14 -0
- package/dist/types/modern-theme.d.ts.map +1 -0
- package/dist/types/optional-options.d.ts +6 -0
- package/dist/types/optional-options.d.ts.map +1 -0
- package/dist/types/palette.d.ts +11 -0
- package/dist/types/palette.d.ts.map +1 -0
- package/dist/types/platform.d.ts +27 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +80 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/quadrants-plugin.d.ts +45 -0
- package/dist/types/quadrants-plugin.d.ts.map +1 -0
- package/dist/types/register-all.d.ts +3 -0
- package/dist/types/register-all.d.ts.map +1 -0
- package/dist/types/rendering/canvas-graphics.d.ts +65 -0
- package/dist/types/rendering/canvas-graphics.d.ts.map +1 -0
- package/dist/types/rendering/graphics.d.ts +59 -0
- package/dist/types/rendering/graphics.d.ts.map +1 -0
- package/dist/types/rendering/renderer.d.ts +58 -0
- package/dist/types/rendering/renderer.d.ts.map +1 -0
- package/dist/types/rendering/three-graphics.d.ts +22 -0
- package/dist/types/rendering/three-graphics.d.ts.map +1 -0
- package/dist/types/responsive.d.ts +8 -0
- package/dist/types/responsive.d.ts.map +1 -0
- package/dist/types/series/activity-gauge.d.ts +18 -0
- package/dist/types/series/activity-gauge.d.ts.map +1 -0
- package/dist/types/series/arc-gauge.d.ts +74 -0
- package/dist/types/series/arc-gauge.d.ts.map +1 -0
- package/dist/types/series/area.d.ts +24 -0
- package/dist/types/series/area.d.ts.map +1 -0
- package/dist/types/series/bar.d.ts +17 -0
- package/dist/types/series/bar.d.ts.map +1 -0
- package/dist/types/series/box-plot.d.ts +140 -0
- package/dist/types/series/box-plot.d.ts.map +1 -0
- package/dist/types/series/bubble.d.ts +25 -0
- package/dist/types/series/bubble.d.ts.map +1 -0
- package/dist/types/series/bullet.d.ts +86 -0
- package/dist/types/series/bullet.d.ts.map +1 -0
- package/dist/types/series/candle.d.ts +27 -0
- package/dist/types/series/candle.d.ts.map +1 -0
- package/dist/types/series/circular-gauge.d.ts +100 -0
- package/dist/types/series/circular-gauge.d.ts.map +1 -0
- package/dist/types/series/color-series.d.ts +59 -0
- package/dist/types/series/color-series.d.ts.map +1 -0
- package/dist/types/series/composed-series.d.ts +76 -0
- package/dist/types/series/composed-series.d.ts.map +1 -0
- package/dist/types/series/custom-bar.d.ts +63 -0
- package/dist/types/series/custom-bar.d.ts.map +1 -0
- package/dist/types/series/custom-series.d.ts +74 -0
- package/dist/types/series/custom-series.d.ts.map +1 -0
- package/dist/types/series/donut.d.ts +17 -0
- package/dist/types/series/donut.d.ts.map +1 -0
- package/dist/types/series/gantt.d.ts +47 -0
- package/dist/types/series/gantt.d.ts.map +1 -0
- package/dist/types/series/high-low-bar.d.ts +24 -0
- package/dist/types/series/high-low-bar.d.ts.map +1 -0
- package/dist/types/series/histogram.d.ts +36 -0
- package/dist/types/series/histogram.d.ts.map +1 -0
- package/dist/types/series/horiz-area.d.ts +11 -0
- package/dist/types/series/horiz-area.d.ts.map +1 -0
- package/dist/types/series/horiz-bar.d.ts +23 -0
- package/dist/types/series/horiz-bar.d.ts.map +1 -0
- package/dist/types/series/line.d.ts +22 -0
- package/dist/types/series/line.d.ts.map +1 -0
- package/dist/types/series/linear-gauge.d.ts +73 -0
- package/dist/types/series/linear-gauge.d.ts.map +1 -0
- package/dist/types/series/map-series.d.ts +82 -0
- package/dist/types/series/map-series.d.ts.map +1 -0
- package/dist/types/series/numeric-gauge.d.ts +96 -0
- package/dist/types/series/numeric-gauge.d.ts.map +1 -0
- package/dist/types/series/palette-series.d.ts +39 -0
- package/dist/types/series/palette-series.d.ts.map +1 -0
- package/dist/types/series/pie.d.ts +81 -0
- package/dist/types/series/pie.d.ts.map +1 -0
- package/dist/types/series/point-xy.d.ts +13 -0
- package/dist/types/series/point-xy.d.ts.map +1 -0
- package/dist/types/series/polar.d.ts +37 -0
- package/dist/types/series/polar.d.ts.map +1 -0
- package/dist/types/series/sankey.d.ts +90 -0
- package/dist/types/series/sankey.d.ts.map +1 -0
- package/dist/types/series/series-list.d.ts +127 -0
- package/dist/types/series/series-list.d.ts.map +1 -0
- package/dist/types/series/series-list.types.d.ts +43 -0
- package/dist/types/series/series-list.types.d.ts.map +1 -0
- package/dist/types/series/sliced.d.ts +13 -0
- package/dist/types/series/sliced.d.ts.map +1 -0
- package/dist/types/series/surface.d.ts +24 -0
- package/dist/types/series/surface.d.ts.map +1 -0
- package/dist/types/series/treemap.d.ts +107 -0
- package/dist/types/series/treemap.d.ts.map +1 -0
- package/dist/types/series/violin.d.ts +105 -0
- package/dist/types/series/violin.d.ts.map +1 -0
- package/dist/types/series/volume.d.ts +11 -0
- package/dist/types/series/volume.d.ts.map +1 -0
- package/dist/types/series-definitions.d.ts +30 -0
- package/dist/types/series-definitions.d.ts.map +1 -0
- package/dist/types/series-registry.d.ts +37 -0
- package/dist/types/series-registry.d.ts.map +1 -0
- package/dist/types/series-utils.d.ts +29 -0
- package/dist/types/series-utils.d.ts.map +1 -0
- package/dist/types/series.d.ts +342 -0
- package/dist/types/series.d.ts.map +1 -0
- package/dist/types/slider.d.ts +49 -0
- package/dist/types/slider.d.ts.map +1 -0
- package/dist/types/spline.d.ts +2 -0
- package/dist/types/spline.d.ts.map +1 -0
- package/dist/types/table/chart-table.d.ts +27 -0
- package/dist/types/table/chart-table.d.ts.map +1 -0
- package/dist/types/teechart-3d.d.ts +4 -0
- package/dist/types/teechart-3d.d.ts.map +1 -0
- package/dist/types/theme.d.ts +41 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/three/chart-3d.d.ts +77 -0
- package/dist/types/three/chart-3d.d.ts.map +1 -0
- package/dist/types/three/chart-options-3d.d.ts +5 -0
- package/dist/types/three/chart-options-3d.d.ts.map +1 -0
- package/dist/types/three/teechart-3d.d.ts +25 -0
- package/dist/types/three/teechart-3d.d.ts.map +1 -0
- package/dist/types/three-context.d.ts +184 -0
- package/dist/types/three-context.d.ts.map +1 -0
- package/dist/types/three-context.types.d.ts +177 -0
- package/dist/types/three-context.types.d.ts.map +1 -0
- package/dist/types/three-parametric-geometry.d.ts +7 -0
- package/dist/types/three-parametric-geometry.d.ts.map +1 -0
- package/dist/types/three.d.ts +6 -0
- package/dist/types/three.d.ts.map +1 -0
- package/dist/types/tools/animate-hover.d.ts +13 -0
- package/dist/types/tools/animate-hover.d.ts.map +1 -0
- package/dist/types/tools/annotation.d.ts +169 -0
- package/dist/types/tools/annotation.d.ts.map +1 -0
- package/dist/types/tools/base-animation.d.ts +83 -0
- package/dist/types/tools/base-animation.d.ts.map +1 -0
- package/dist/types/tools/cursor-tool.d.ts +51 -0
- package/dist/types/tools/cursor-tool.d.ts.map +1 -0
- package/dist/types/tools/drag-tool.d.ts +28 -0
- package/dist/types/tools/drag-tool.d.ts.map +1 -0
- package/dist/types/tools/index.d.ts +8 -0
- package/dist/types/tools/index.d.ts.map +1 -0
- package/dist/types/tools/tool.d.ts +27 -0
- package/dist/types/tools/tool.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +33 -0
- package/dist/types/tools/tools.d.ts.map +1 -0
- package/dist/types/utils.d.ts +23 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/worker.d.ts +92 -0
- package/dist/types/worker.d.ts.map +1 -0
- package/package.json +74 -27
- package/dist/Tween.js +0 -13
- package/dist/date.format.js +0 -145
- package/dist/excanvas/canvas.text.js +0 -489
- package/dist/excanvas/excanvas.compiled.js +0 -35
- package/dist/excanvas/excanvas.js +0 -924
- package/dist/excanvas/excanvas_text.js +0 -1416
- package/dist/three.js +0 -990
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @preserve TeeChart(tm) for JavaScript(tm) * @fileOverview TeeChart for JavaScript(tm)
|
|
3
|
+
* v5.0.0-beta.1 Jun 2026
|
|
4
|
+
* Copyright(c) 2012-2026 by Steema Software SL. All Rights Reserved.
|
|
5
|
+
* https://www.steema.com
|
|
6
|
+
*
|
|
7
|
+
* Licensed with commercial and non-commercial attributes,
|
|
8
|
+
* specifically: https://www.steema.com/licensing/html5
|
|
9
|
+
*
|
|
10
|
+
* JavaScript is a trademark of Oracle Corporation.
|
|
11
|
+
* @author <a href="mailto:david@steema.com">Steema Software</a>
|
|
12
|
+
* @version 5.0.0-beta.1
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import{q as t,S as e,i,r as s,s as o,j as r,g as n,t as a,v as l,u as h,w as c,x as d,o as f,y as u,a as m,m as g,M as b,z as p,H as v,n as w,d as y,I as x,b as k,P as C,T as F,J as z,E as A,K as P,L as S,N as _,O as M}from"./series-DeozLXIv.js";const T="12px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",D={palette:["#3b82f6","#fb923c","#14b8a6","#8b5cf6","#ec4899","#38bdf8","#eab308","#64748b","#84cc16","#f43f5e"],surface:"#ffffff",ink:"#64748b",strong:"#0f172a",grid:"#e2e8f0",axisLine:"#cbd5e1",markBorder:"#e2e8f0"},E={palette:["#60a5fa","#fb923c","#2dd4bf","#a78bfa","#f472b6","#38bdf8","#facc15","#94a3b8","#a3e635","#fb7185"],surface:"#1c1c21",ink:"#a1a1aa",strong:"#f4f4f5",grid:"rgba(255,255,255,0.09)",axisLine:"rgba(255,255,255,0.18)",markBorder:"rgba(255,255,255,0.14)"};function O(t,e){const i=/^#([0-9a-f]{6})$/i.exec(t);if(!i)return t;const s=Number.parseInt(i[1],16);return`rgba(${s>>16&255},${s>>8&255},${255&s},${e})`}function R(t,e){return/^-?\d+\.\d+$/.test(e)?e.replace(/\.?0+$/,""):e}function B(e,i,s){const o=s.palette[i%s.palette.length],r=e.format,n=t(e),a=e.marks;if(a.format.gradient.visible=!1,a.format.shadow.visible=!1,a.format.fill=s.surface,a.format.stroke.fill=s.markBorder,a.format.stroke.size=1,a.format.round.x=6,a.format.round.y=6,a.format.font.style=T,a.format.font.fill=s.strong,Object.assign(a.margins,{left:6,right:6,top:3,bottom:3}),a.arrow.stroke.fill=s.axisLine,a.arrow.stroke.size=1,"hands"in e||(e.marks.visible=!1),e.hover.shadow.visible=!1,r.gradient.visible=!1,r.shadow.visible=!1,r.beveled=!1,r.depth=0,n&&(n.format.gradient.visible=!1,n.format.shadow.visible=!1,n.colorEach=!1),"explode"in e)return r.stroke.fill=s.surface,void(r.stroke.size=2);if(r.fill=o,"hands"in e)!function(t,e,i){const s=t,o=t.format;o.visible=!1,o.font.fill=i.ink,o.font.style=T,s.back.gradient.visible=!1,s.back.shadow.visible=!1,s.back.fill=i.surface,s.back.stroke.fill=i.axisLine,s.back.stroke.size=2,s.ticks.stroke.fill=i.ink,s.minor.stroke.fill=i.axisLine,s.hand.gradient.visible=!1,s.hand.shadow.visible=!1,s.hand.fill=e,s.center.gradient.visible=!1,s.center.shadow.visible=!1,s.center.fill=i.strong,s.center.top&&(s.center.top.visible=!1);const r=t.marks;r.format.gradient.visible=!1,r.format.shadow.visible=!1,r.format.fill=i.surface,r.format.stroke.fill="",r.format.font.fill=i.strong,r.format.font.style=`bold 16px ${T.slice(T.indexOf(" ")+1)}`,s.units.format.font.fill=i.ink,s.formatValue??=t=>String(Math.round(100*t)/100)}(e,o,s);else{if("medianColor"in e){const t=e;return t.medianColor=s.strong,void(t.dotStroke=s.surface)}if("trackColor"in e){const t=e;return t.trackColor=s.grid,t.textColor=s.strong,t.mutedColor=s.ink,void(t.surfaceColor=s.surface)}"barSize"in e?("rebin"in e?(r.stroke.fill=s.surface,r.stroke.size=1,r.round.x=0,r.round.y=0):(r.stroke.fill="",r.round.x=6,r.round.y=6,e.barSize=60),e.colorEach="no"):"closeArea"in e?(r.stroke.fill=o,r.stroke.size=2.5,r.gradient.visible=!0,r.gradient.direction="bottomtop",r.gradient.colors=[O(o,.02),o]):n&&"inflate"in e?(r.stroke.fill=o,r.stroke.size=1.5,n.format.fill=O(o,.65),n.format.stroke.fill=o):(r.stroke.fill=o,r.stroke.size=3,n&&(n.format.fill=o,n.format.stroke.fill=s.surface))}}function W(t,e){const i=t.panel,s=i.format;i.transparent=!0,s.gradient.visible=!1,s.shadow.visible=!1,s.stroke.fill="",s.round.x=0,s.round.y=0,s.fill=e.surface,Object.assign(i.margins,{left:3,right:6,top:5,bottom:3}),t.walls.visible=!1,t.palette.colors=[...e.palette];for(const i of t.axes.items)i.labels.format.font.style=T,i.labels.format.font.fill=e.ink,i.labels.ongetlabel=R,i.title.format.font.style=`bold ${T}`,i.title.format.font.fill=e.ink,i.format.stroke.fill=i.horizontal?e.axisLine:"",i.format.stroke.size=1,i.grid.visible=!i.horizontal,i.grid.format.stroke.fill=e.grid,i.grid.format.stroke.size=1,i.ticks.visible=!1,i.integerSteps=!0,i.horizontal||(i.headroom=8,i.labels.separation=60);t.title.transparent=!0,t.title.format.shadow.visible=!1,t.title.format.font.style="bold 16px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",t.title.format.font.fill=e.strong,t.title.format.font.shadow.visible=!1,t.footer.transparent=!0,t.legend.transparent=!0,t.legend.format.font.style=T,t.legend.format.font.fill=e.ink,t.legend.fontColor=!1,function(t){t.format.shadow.visible=!1,t.itemGap=18,t.edgeInset=10,t.rowGap=4,t.symbolOffsetY=-2,t.hoverBackground="",t.hover.font.fill="",t.dimHidden=!0;const e=t.symbol;e.width=10,e.height=10,e.padding=8,e.format.round.x=3,e.format.round.y=3,e.format.shadow.visible=!1,e.format.stroke.fill=""}(t.legend);for(const[i,s]of t.series.items.entries())B(s,i,e)}const N={apply:t=>W(t,D),styleSeries:(t,e)=>B(t,e,D)},V={apply:t=>W(t,E),styleSeries:(t,e)=>B(t,e,E)},H=new WeakMap;function L(t={},e={}){for(const e of Object.keys(t))if(!e.trim())throw new Error("Theme name cannot be empty");for(const t of Object.keys(e))if(!t.trim())throw new Error("Palette name cannot be empty")}function I(t,e){const i=new Map,s=new Map;for(const t of e){L(t.themes,t.palettes);for(const[e,s]of Object.entries(t.themes??{}))i.set(e,s);for(const[e,i]of Object.entries(t.palettes??{}))s.set(e,Array.isArray(i)?[...i]:[...i.colors])}H.set(t,{themes:i,palettes:s})}function j(e,i,s,o){const r=e.palette.get(s);void 0!==r&&(i.format.fill=r);const n=t(i);n&&(void 0!==r&&(n.format.fill=r),n.format.stroke.fill=o)}function $(t,e,i){for(let s=0;s<t.axes.items.length;s++)s>3&&(t.axes.items[s].labels.format.font.setSize(11),t.axes.items[s].format.stroke.fill=i,t.axes.items[s].labels.format.font.fill=e,t.axes.items[s].title.format.font.fill=e,t.axes.items[s].title.format.font.setSize(20),t.axes.items[s].grid.visible=!1,t.axes.items[s].grid.format.stroke.size=.6,t.axes.items[s].grid.format.stroke.fill="silver")}function Y(t){t.title.transparent=!0,t.walls.visible=!1,t.footer.transparent=!0,t.panel.format.shadow.visible=!1,t.panel.format.stroke.fill="",t.panel.format.round.x=0,t.panel.format.round.y=0,t.panel.format.gradient.visible=!1,t.panel.format.fill="white";const e="rgba(124,124,144,0.9)";U(t,"seaWash");for(const[e,i]of t.series.items.entries())j(t,i,e,"white");for(const i of t.axes.items)i.format.stroke.fill="rgba(39,79,105,0.8)",i.labels.format.font.setSize(14),i.labels.format.font.fill=e,i.title.format.font.setSize(20),i.title.format.font.fill=e;for(const e of t.axes.items)e.horizontal?(e.grid.visible=!1,e.grid.format.stroke.size=.6,e.grid.format.stroke.fill="silver"):(e.grid.visible=!0,e.grid.format.stroke.size=.6,e.grid.format.stroke.fill="silver");t.legend.transparent=!0,t.legend.format.font.setSize(14),t.legend.format.font.fill=e,t.title.format.shadow.visible=!1;const i="18px Arial";t.title.format.font.style=i,t.title.format.font.style=`bold ${i}`,t.title.format.font.fill=e,t.title.format.font.shadow.visible=!1}function U(e,i){let s=["#4466a3","#f39c35","#f14c14","#4e97a8","#2b406b","#1d7b63","#b3080e","#f2c05d","#5db79e","#707070","#f3ea8d","#b4b4b4"];if("castaway"===i?s=["#4466a3","#E8D0A9","#B7AFA3","#C1DAD6","#F5FAFA","#ACD1E9","#6D929B"]:"classic"===i?s=["#0000FF","#00FF00","#00FFFF","#FF0000","#FF00FF","#FFFF00","#000080","#008000","#008080","#800000","#808000","#808080"]:"cool"===i?s=["rgba(43,64,107,1.0)","rgba(59,84,140,1.0)","rgba(68,102,163,1.0)","rgba(78,151,168,1.0)","rgba(93,183,158,1.0)","rgba(65,160,138,1.0)","rgba(43,146,125,1.0)","rgba(29,123,99)"]:"excel"===i?s=["#FF9999","#663399","#CCFFFF","#FFFFCC","#660066","#8080FF","#CC6600","#FFCCCC","#800000","#FF00FF","#00FFFF","#FFFF00","#800080","#000080","#808000","#FF0000","#FFCC00","#FFFFCC","#CCFFCC","#00FFFF","#FFCC99","#CC99FF"]:"grayscale"===i?s=["#F0F0F0","#E0E0E0","#D0D0D0","#C0C0C0","#B0B0B0","#A0A0A0","#909090","#808080","#707070","#606060","#505050","#404040","#303030","#202020","#101010"]:"macOS"===i?s=["#FFFFFF","#FCF305","#FF6402","#DD0806","#F20884","#4600A5","#0000D4","#02ABEA","#1FB714","#006411","#562C05","#90713A","#C0C0C0","#808080","#404040","#000000"]:"modern"===i?s=["#FF9966","#FF6666","#99CCFF","#669966","#CCCC99","#9966CC","#CC6666","#FFCC99","#9966FF","#CCCCCC","#66FFCC","#6699FF","#996699","#CCCCFF"]:"onBlack"===i?s=["rgba(200,230,90,1.0)","rgba(90,150,220,1.0)","rgba(230,90,40,1.0)","rgba(230,160,15)"]:"pastels"===i?s=["#CCFFFF","#FFFFCC","#CCCCFF","#00CCCC","#CCCCCC","#009999","#999999","#DDCCCC","#FFCC66","#CCCCFF","#FF9999","#FFFF99","#99CCFF","#CCFFCC"]:"rainbow"===i?s=["#FF0000","#FF7F00","#FFFF00","#00FF00","#0000FF","#6600FF","#8B00FF"]:"redRiver"===i?s=["#DC5C05","#FFC519","#6EC5B8","#FF9000","#978B7D","#C7BAA7"]:"rust"===i?s=["#CBFFFA","#7F3D17","#7F5E17","#22287F","#DD1E2F","#EBB035","#06A2CB","#218559","#D0C6B1","#B67721","#68819E","#747E80","#D5E1DD","#F7F3E8","#F2583E","#77BED2"]:"seaWash"===i?s=["#DC5C05","#FFAC00","#6EC5B8","#E8D0A9","#978B7D","#C7BAA7","#C1DAD6","#FFC99F","#ACD1E9","#6D929B","#D3E397","#FFF5C3"]:"solid"===i?s=["#0000FF","#FF0000","#00FF00","#FFCC00","#404040","#FFFF00","#FF00C0","#FFFFFF"]:"teechart"===i?s=["rgba(255,0,0,1.0)","rgba(0,128,0,1.0)","rgba(255,255,0,1.0)","rgba(0,0,255,1.0)","rgba(255,255,255,1.0)","rgba(128,128,128,1.0)","rgba(255,0,255,1.0)","rgba(0,128,128,1.0)","rgba(0,0,128,1.0)","rgba(128,0,0,1.0)","rgba(0,255,0,1.0)","rgba(128,128,0,1.0)","rgba(128,0,128,1.0)","rgba(192,192,192,1.0)","rgba(0,255,255,1.0)","rgba(0,0,0,1.0)","rgba(173,255,47,1.0)","rgba(135,206,235,1.0)","rgba(255,228,196,1.0)","rgba(75,0,130,1.0)"]:"warm"===i?s=["rgba(243,234,141,1.0)","rgba(242,192,93,1.0)","rgba(243,156,53,1.0)","rgba(245,129,28,1.0)","rgba(243,107,21,1.0)","rgba(241,76,20,1.0)","rgba(230,24,10,1.0)","rgba(179,8,14)"]:"web"===i?s=["#FFA500","#0000CE","#00CE00","#FFFF40","#40FFFF","#FF40FF","#FF4000","#8080A5","#808040"]:"rainbowWide"===i?s=["#990000","#C30000","#EE0000","#FF1A00","#FF4600","#FF7300","#FF9F00","#FFCB00","#FFF700","#E3F408","#C3E711","#A3DA1B","#83CD25","#63C02E","#42B338","#22A642","#029A4B","#0C876A","#1A758A","#2863AA","#3650CB","#443EEB","#612AFF","#9615FF","#CC00FF"]:"windowsVista"===i?s=["#001FD2","#E00201","#1E6602","#E8CD7E","#AFABAC","#A4D0D9","#3D3B3C","#95DD31","#9E0001","#DCF774","#45FDFD","#D18E74","#A0D891","#D57A65","#9695D9"]:"windowsxp"===i?s=["rgba(130,155,254,1.0)","rgba(252,209,36,1.0)","rgba(124,188,13,1.0)","rgba(253,133,47,1.0)","rgba(253,254,252,1.0)","rgba(226,78,33,1.0)","rgba(41,56,214,1.0)","rgba(183,148,0,1.0)","rgba(90,134,0,1.0)","rgba(210,70,0,1.0)","rgba(211,229,250,1.0)","rgba(216,216,216,1.0)","rgba(95,113,123,1.0)"]:"victorian"===i&&(s=["#5DA5A1","#C45331","#E79609","#F6E84A","#B1A2A7","#C9A784","#8C7951","#D8CDB7","#086553","#F7D87B","#016484"]),e.paletteName=i,e.palette.colors=s,e.series.items.length>0)for(let i=0;i<e.series.items.length;i++){const s=e.palette.get(i);if(void 0===s)continue;e.series.items[i].format.fill=s;const o=t(e.series.items[i]);o&&(o.format.fill=s)}}function q(t,e){if(!t.trim())throw new Error("Theme name cannot be empty");tt[t]=e}function X(t,e){if(!t.trim())throw new Error("Palette name cannot be empty");et[t]=Array.isArray(e)?[...e]:[...e.colors]}function G(t){return!Object.hasOwn(Q,t)&&(!!Object.hasOwn(tt,t)&&delete tt[t])}function Z(t){return!!Object.hasOwn(et,t)&&delete et[t]}const J=new WeakMap,K={modern:N,modernDark:V},Q={default:function(t){const e="rgba(0,0,0,1)",i="rgba(39,79,105,0.8)";if(t.title.format.font.style="18px Verdana",t.walls.visible=!0,t.panel.format.shadow.visible=!1,t.panel.format.round.x=8,t.panel.format.round.y=8,t.panel.format.gradient.visible=!0,t.panel.format.gradient.colors=["rgba(224,224,224,1.0)","white"],t.panel.format.gradient.direction="diagonalup",t.panel.format.stroke.fill="rgba(204,204,204,1.0)",t.panel.format.stroke.size=1,U(t,"opera"),t.series.items.length>0)for(let e=0;e<t.series.items.length;e++)j(t,t.series.items[e],e,"white");t.axes.left.labels.format.font.setSize(11),t.axes.bottom.labels.format.font.setSize(11),t.axes.left.format.stroke.fill=i,t.axes.bottom.format.stroke.fill=i,t.axes.left.labels.format.font.fill=e,t.axes.bottom.labels.format.font.fill=e,t.axes.left.title.format.font.fill=e,t.axes.left.title.format.font.setSize(20),t.axes.bottom.title.format.font.fill=e,t.axes.bottom.title.format.font.setSize(20),t.axes.left.grid.visible=!0,t.axes.bottom.grid.visible=!1,t.axes.left.grid.format.stroke.size=.6,t.axes.bottom.grid.format.stroke.size=.6,t.axes.left.grid.format.stroke.fill="silver",t.axes.bottom.grid.format.stroke.fill="silver",t.axes.left.grid.visible=!0,t.axes.top.grid.visible=!0,t.axes.right.grid.visible=!0,t.axes.bottom.grid.visible=!0,t.axes.items.length>0&&$(t,e,i),t.legend.transparent=!1,t.legend.format.fill="white",t.legend.format.font.setSize(11),t.legend.format.font.fill=e,t.legend.fontColor=!1,t.title.format.font.fill=e,t.walls.visible=!1},modern:N.apply,modernDark:V.apply,minimal:Y,excel:function(t){Y(t);const e="rgba(0,0,0,0.9)";if(U(t,"excel"),t.axes.left.grid.format.stroke.fill=e,t.axes.bottom.grid.format.stroke.fill=e,t.series.items.length>0)for(let e=0;e<t.series.items.length;e++)j(t,t.series.items[e],e,"white")},dark:function(t){U(t,"onBlack");const e="rgba(224,224,224,0.6)";if(t.title.transparent=!0,t.legend.transparent=!0,t.footer.transparent=!0,t.panel.format.shadow.visible=!1,t.panel.format.stroke.fill="",t.panel.format.round.x=0,t.panel.format.round.y=0,t.panel.format.gradient.colors=["rgba(0,0,0,1)","rgba(0,0,0,1)"],t.panel.format.gradient.visible=!0,t.series.items.length>0)for(let e=0;e<t.series.items.length;e++)j(t,t.series.items[e],e,"rgba(82,82,82,1)");t.axes.left.format.stroke.fill=e,t.axes.bottom.format.stroke.fill=e,t.axes.left.labels.format.font.setSize(14),t.axes.bottom.labels.format.font.setSize(14),t.axes.left.labels.format.font.fill=e,t.axes.bottom.labels.format.font.fill=e,t.axes.left.title.format.font.fill=e,t.axes.left.title.format.font.setSize(20),t.axes.bottom.title.format.font.fill=e,t.axes.bottom.title.format.font.setSize(20),t.axes.bottom.grid.visible=!1,t.axes.left.grid.visible=!0,t.axes.left.grid.format.stroke.fill="silver",t.axes.bottom.grid.format.stroke.fill="silver",t.axes.items.length>0&&$(t,e,"rgba(39,79,105,0.8)"),t.walls.visible=!1,t.legend.transparent=!0,t.legend.format.font.setSize(14),t.legend.format.font.fill=e,t.title.format.shadow.visible=!1;const i="18px Arial";t.title.format.font.style=i,t.title.format.font.style=`bold ${i}`,t.title.format.font.fill=e,t.title.format.font.shadow.visible=!1},twilight:function(t){const e="rgba(224,224,224,0.6)";if(t.title.format.font.style="18px Verdana",t.walls.visible=!0,t.panel.format.shadow.visible=!1,t.panel.format.round.x=8,t.panel.format.round.y=8,t.panel.format.gradient.visible=!0,t.panel.format.gradient.colors=["rgba(99,99,99,1.0)","rgba(19,19,19,1.0)"],t.panel.format.gradient.direction="topbottom",t.panel.format.stroke.fill="rgba(204,204,204,1.0)",t.panel.format.stroke.size=1,U(t,"redRiver"),t.series.items.length>0)for(let e=0;e<t.series.items.length;e++)j(t,t.series.items[e],e,"rgba(82,82,82,1)");t.axes.left.format.stroke.fill=e,t.axes.bottom.format.stroke.fill=e,t.axes.left.labels.format.font.setSize(11),t.axes.bottom.labels.format.font.setSize(11),t.axes.left.labels.format.font.fill=e,t.axes.bottom.labels.format.font.fill=e,t.axes.left.title.format.font.fill=e,t.axes.left.title.format.font.setSize(20),t.axes.bottom.title.format.font.fill=e,t.axes.bottom.title.format.font.setSize(20),t.axes.bottom.grid.visible=!1,t.axes.left.grid.visible=!0,t.axes.left.grid.format.stroke.fill="silver",t.axes.bottom.grid.format.stroke.fill="silver",t.axes.items.length>0&&$(t,e,"rgba(39,79,105,0.8)"),t.legend.transparent=!0,t.legend.format.font.setSize(14),t.legend.format.font.fill=e,t.legend.format.fill="rgba(0,0,0,0.1)",t.title.format.shadow.visible=!1;const i="18px Arial";t.title.format.font.style=i,t.title.format.font.style=`bold ${i}`,t.title.format.font.fill=e,t.title.format.font.shadow.visible=!1,t.walls.visible=!1},daybreak:function(t){const e="rgba(14,14,54,0.6)",i="rgba(224,224,224,0.6)";t.title.format.font.style="18px Verdana",t.walls.visible=!0,t.panel.format.shadow.visible=!1,t.panel.format.round.x=8,t.panel.format.round.y=8,t.panel.format.gradient.visible=!0,t.panel.format.gradient.colors=["rgba(201,204,242,1.0)","rgba(255,252,255,1.0)","rgba(21,21,23,1.0)"],t.panel.format.gradient.direction="topbottom",t.panel.format.stroke.fill="rgba(204,204,204,1.0)",t.panel.format.stroke.size=1,U(t,"redRiver");for(const[e,i]of t.series.items.entries())j(t,i,e,"rgba(82,82,82,1)");for(const[s,o]of t.axes.items.entries()){const t=o;t.format.stroke.fill=e,t.labels.format.font.setSize(11),t.labels.format.font.fill=i,t.title.format.font.setSize(20),t.title.format.font.fill=i,t.grid.visible=s<3,t.grid.format.stroke.fill="silver"}t.legend.transparent=!0,t.legend.format.font.setSize(14),t.legend.format.font.fill="silver",t.title.format.shadow.visible=!1;const s="18px Arial";t.title.format.font.style=s,t.title.format.font.style=`bold ${s}`,t.title.format.font.fill=e,t.title.format.font.shadow.visible=!1,t.walls.visible=!1}},tt={...Q},et={},it="rgba(0,0,0,0.55)",st="14px sans-serif";function ot(t,e,i){return"number"==typeof e?e:function(t,e,i){const s=[];for(const i of t.series.items){const t=i.data;if(!t)continue;const o=e?t.x??t.values.map((t,e)=>e):t.values;for(const t of o){const e=t instanceof Date?t.getTime():t;Number.isFinite(e)&&s.push(e)}}if(!s.length)return;if("mean"===i)return s.reduce((t,e)=>t+e,0)/s.length;s.sort((t,e)=>t-e);const o=s.length>>1;return s.length%2?s[o]:(s[o-1]+s[o])/2}(t,i,e)}function rt(t,e){const i=t.axes[e.axes.x],s=t.axes[e.axes.y],o=ot(t,e.split.x,!0),r=ot(t,e.split.y,!1);if(void 0===o||void 0===r)return;const n=Math.min(i.startPos,i.endPos),a=Math.max(i.startPos,i.endPos),l=Math.min(s.startPos,s.endPos),h=Math.max(s.startPos,s.endPos);if(!(a>n&&h>l))return;const c=(t,e,i)=>Math.min(i,Math.max(e,t));return{left:n,right:a,top:l,bottom:h,x:c(i.calc(o),n,a),y:c(s.calc(r),l,h)}}const nt={id:"quadrants",defaults:{split:{x:0,y:0},axes:{x:"bottom",y:"left"},inset:6,divider:{color:"rgba(0,0,0,0.35)",width:1},areas:{topLeft:{},topRight:{},bottomLeft:{},bottomRight:{}}},afterAxesDraw:(t,e,i,s)=>{if(!t.pluginOptions.quadrants)return;const o=rt(t,s);o&&(e.save(),e.beginPath(),e.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),e.clip(),function(t,e,i){const{left:s,right:o,top:r,bottom:n,x:a,y:l}=i,h=[["topLeft",s,r,a-s,l-r],["topRight",a,r,o-a,l-r],["bottomLeft",s,l,a-s,n-l],["bottomRight",a,l,o-a,n-l]];for(const[i,s,o,r,n]of h){const a=e.areas[i]?.backgroundColor;!a||r<=0||n<=0||(t.fillStyle=a,t.fillRect(s,o,r,n))}}(e,s,o),e.restore())},afterAllSeriesDraw:(t,e,i)=>{if(!t.pluginOptions.quadrants)return;const s=rt(t,i);s&&(e.save(),function(t,e,i){if(!e.divider.color||e.divider.width<=0)return;const{left:s,right:o,top:r,bottom:n,x:a,y:l}=i;t.strokeStyle=e.divider.color,t.lineWidth=e.divider.width,t.beginPath(),t.moveTo(a,r),t.lineTo(a,n),t.moveTo(s,l),t.lineTo(o,l),t.stroke()}(e,i,s),function(t,e,i){const{left:s,right:o,top:r,bottom:n,x:a,y:l}=i,h=e.inset,c=[["topLeft",s+h,r+h,"left","top"],["topRight",o-h,r+h,"right","top"],["bottomLeft",s+h,n-h,"left","bottom"],["bottomRight",o-h,n-h,"right","bottom"]],d={topLeft:a>s&&l>r,topRight:a<o&&l>r,bottomLeft:a>s&&l<n,bottomRight:a<o&&l<n};for(const[i,s,o,r,n]of c){const a=e.areas[i];a?.text&&d[i]&&(t.fillStyle=a.color??it??"#000",t.font=a.font??st??"14px sans-serif",t.textAlign=r,t.textBaseline=n,t.fillText(a.text,s,o))}}(e,i,s),e.restore())}};function at(t){if(!t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function lt(t){return Array.isArray(t)?t.map(lt):at(t)?Object.fromEntries(Object.entries(t).map(([t,e])=>[t,lt(e)])):t}function ht(t,e){const i=lt(t??{});if(!e)return i;for(const[t,s]of Object.entries(e)){const e=i[t];at(e)&&at(s)?i[t]=ht(e,s):i[t]=lt(s)}return i}function ct(t,e,i,s=[],o=t.pluginOptions[e.id]){const r=ht(e.defaults,o),n=mt.get(t)?.get(e),a=e[i],l=a?.(t,...s,r,n);if("afterInit"===i&&"function"==typeof l){let i=gt.get(t);i||(i=new Map,gt.set(t,i)),i.set(e,l)}return l}function dt(t,e,i=t.pluginOptions[e.id]){const s=ht(e.defaults,i),o=mt.get(t)?.get(e);let r,n=!1;try{e.destroy?.(t,s,o)}catch(t){r=t,n=!0}try{gt.get(t)?.get(e)?.()}catch(t){n||(r=t),n=!0}if(gt.get(t)?.delete(e),mt.get(t)?.delete(e),n)throw r}const ft=new Map([[nt.id,nt]]),ut=new WeakMap,mt=new WeakMap,gt=new WeakMap;function bt(t){const e=new Map(ft);for(const i of t)vt(i),e.delete(i.id),e.set(i.id,i);const i=[...e.values()].map((t,e)=>({plugin:t,index:e}));return i.sort((t,e)=>(t.plugin.order??0)-(e.plugin.order??0)||t.index-e.index),new Map(i.map(({plugin:t})=>[t.id,t]))}const pt=new WeakMap;function vt(t){if(!t.id.trim())throw new Error("Plugin id cannot be empty");if(void 0!==t.order&&!Number.isFinite(t.order))throw new Error(`Plugin ${JSON.stringify(t.id)} order must be a finite number`);L(t.themes,t.palettes)}function wt(t){vt(t);ft.get(t.id)!==t&&(ft.delete(t.id),ft.set(t.id,t))}function yt(t){ft.get(t.id)===t&&ft.delete(t.id)}function xt(t,e,i,s=[],o,r){return kt(t,e,void 0===r?[i,o]:[i,o,r],s)}function kt(t,e,i=[],s=[]){let o,r=ut.get(t);if(r||(r=bt(s),"beforeInit"===e&&(ut.set(t,r),I(t,r.values()))),"beforeInit"===e){const e=new Map;mt.set(t,e);for(const i of r.values()){const s=t.pluginOptions[i.id];!1!==s&&e.set(i,i.create?.(t,ht(i.defaults,s)))}}let n=!1;for(const s of r.values()){if(!1===t.pluginOptions[s.id])continue;let r;try{r=ct(t,s,e,i)}catch(t){if("afterDestroy"!==e)throw t;n||(o=t),n=!0}if("afterDestroy"===e)try{dt(t,s)}catch(t){n||(o=t),n=!0}if(!1===r&&"afterDestroy"!==e)return!1}if("afterDestroy"===e&&(ut.delete(t),mt.delete(t),gt.delete(t),function(t){H.delete(t)}(t)),n)throw o;return!0}const Ct=new Map,Ft=new Set;function zt(t,e){if(!t.trim())throw new Error("Series type name cannot be empty");Ct.set(t,function(t){if("function"==typeof t){const e=t;return{create:()=>new e}}return t}(e))}function At(t,e){zt(t,e),Ft.add(t)}function Pt(t){return!Ft.has(t)&&Ct.delete(t)}function St(t,e,i,s=!1,o=!1){let r=[];const n=e.length;function a(t,e,i,s,o,r,n){const a=t=>t*t,l=Math.sqrt(a(i-t)+a(s-e)),h=n*l/(l+Math.sqrt(a(o-i)+a(r-s))),c=n-h;return[i+h*(t-o),s+h*(e-r),i-c*(t-o),s-c*(e-r)]}if(o){s&&t.moveTo(e[0],e[1]),e.push(e[0],e[1],e[2],e[3]),e.unshift(e[n-1],e[n-1]);for(let t=0;t<n;t+=2)r=r.concat(a(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],i));r=r.concat(r[0],r[1]);for(let i=2;i<n+2;i+=2)t.bezierCurveTo(r[2*i-2],r[2*i-1],r[2*i],r[2*i+1],e[i+2],e[i+3])}else{for(let t=0;t<n-4;t+=2)r=r.concat(a(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5],i));s&&t.moveTo(e[0],e[1]),t.quadraticCurveTo(r[0],r[1],e[2],e[3]);for(let i=2;i<n-5;i+=2)t.bezierCurveTo(r[2*i-2],r[2*i-1],r[2*i],r[2*i+1],e[i+2],e[i+3]);t.quadraticCurveTo(r[2*n-10],r[2*n-9],e[n-2],e[n-1])}}class _t{chart;series;format;x;y;transform;inflateMargins=!0;visible=!1;colorEach=!1;style="rectangle";width=12;height=12;constructor(t,e){this.series=e,this.chart=t,this.inflateMargins=!0;const i=this.format=new n(t??void 0);i.shadow.visible=!1,i.fill="",i.gradient.colors=["white","white","white"],i.gradient.visible=!0,i.shadow.visible=!0,this.visible=!1,this.colorEach=!1,this.style="rectangle",this.width=12,this.height=12}setChart(t){this.chart=t,this.format.setChart(t)}draw(t,e,s,o){const n=this.chart.drawContext,a=this.series;s.z=a.format.z,this.transform&&(n.save(),this.transform(t.x,t.y,e));const l=.5*this.width,h=.5*this.height;let c;if("cube"===this.style){c=new r(t.x-l,t.y-h,this.width,this.height);const e=Math.max(l,h)/50;s.z=.5*(a.format.z+a.format.depth)-.5*e,s.depth=e,s.cube(c),s.draw(n,null,c)}else if("rectangle"===this.style)s.rectangle(t.x-l,t.y-h,this.width,this.height);else if("ellipse"===this.style)s.ellipse(t.x,t.y,this.width,this.height);else if("sphere"===this.style)s.depth=a.format.depth,s.sphere(t.x,t.y,this.width,this.height);else if("cylinder"===this.style){c=new r(t.x-l,t.y-h,this.width,this.height);const e=s.gradient,i=e.direction,o=e.colors.slice(0);e.direction="leftright",e.colors=[e.colors[1],e.colors[0],e.colors[1]],s.cylinder(c,1,!0,!1),s.draw(n,null,c),e.direction=i,e.colors=o}else"cone"===this.style?(c=new r(t.x-l,t.y-h,this.width,this.height),s.cylinder(c,0,!0,!1),s.draw(n,null,c)):"triangle"===this.style?s.polygon([new i(t.x,t.y-h),new i(t.x-l,t.y+h),new i(t.x+l,t.y+h)]):"downtriangle"===this.style?s.polygon([new i(t.x,t.y+h),new i(t.x-l,t.y-h),new i(t.x+l,t.y-h)]):"diamond"===this.style?s.polygon([new i(t.x,t.y-h),new i(t.x-l,t.y),new i(t.x,t.y+h),new i(t.x+l,t.y)]):(n.beginPath(),"cross"===this.style&&(n.moveTo(t.x-l,t.y),n.lineTo(t.x+l,t.y),n.moveTo(t.x,t.y-h),n.lineTo(t.x,t.y+h)),"x"===this.style&&(n.moveTo(t.x-l,t.y-h),n.lineTo(t.x+l,t.y+h),n.moveTo(t.x-l,t.y+h),n.lineTo(t.x+l,t.y-h)),s.stroke.prepare(o),n.stroke());this.transform&&n.restore()}setSize(t){this.width=t,this.height=t}}class Mt extends e{onbeforedrawpointer;constructor(t,e){super(t,e),this.stacked="no",this.stairs=!1,this.invertedStairs=!1,this.continuous=!0,this.clickTolerance=3,this.hover.enabled=!0,this.hover.line=!1,this.isStacked=!1,this.isStack100=!1,this.smooth=0,this.pointer=new _t(this.chart,this)}maxYValue(){return this.stackMaxValue()}calc(t,e){this.isStacked?this.calcStack(t,e,this.data.values[t]):super.calc(t,e)}calcColorEach(){this.isColorEach="yes"===this.colorEach||this.pointer.colorEach||"yes"===this.colorEachLine||!0===this.colorEachLine}initZ(t,e){let i;const s=this.format;if("no"!==this.stacked){s.z=0,s.depth=1;let e=Number(t);for(;e>1;)if(e--,i=this.chart.series.items[e],i?.visible&&i.constructor===this.constructor){s.z=i.format.z,s.depth=i.format.depth;break}}else super.initZ(t,e);this.marks.z=s.z+.5*s.depth}_traceDecimated(t,e,i,s,o){const r=this.yMandatory;let n=!0,a=Number.NaN;const l=[],h=[],c=[];let d=0,f=0;const u=e=>{n?(t.moveTo(l[e],h[e]),n=!1):t.lineTo(l[e],h[e])},m=()=>{if(0===l.length)return;const t=[0,d,f,l.length-1].sort((t,e)=>t-e);let e=-1;for(const i of t)i!==e&&(u(i),e=i);l.length=h.length=c.length=0,d=f=0};for(let t=i;t<s;t++){if(this.isNull(t)){m(),o&&(n=!0);continue}this.calc(t,e);const i=Math.round(r?e.x:e.y),s=r?e.y:e.x;i!==a?(m(),a=i):(s<c[d]&&(d=l.length),s>c[f]&&(f=l.length)),l.push(e.x),h.push(e.y),c.push(s)}m()}drawPointers(){const t=this.data.values.length,e=this.pointer.format,s="yes"===this.colorEach||this.pointer.colorEach;s||""===e.fill&&(e.fill=this.format.fill);const o=new i,r=e.gradient;let n=e.fill,a=n;!s&&r.visible&&r.setEndColor(n);for(let i=0;i<t;i++)this.isNull(i)||(this.calc(i,o),n=this.getFill(i,e),n!==a&&(r.visible?r.setEndColor(n):e.fill=n,a=n),this.getSize(i),this.onbeforedrawpointer&&this.onbeforedrawpointer(i,this.pointer),this.pointer.draw(o,i,e,n),this.hover.enabled&&this.over===i&&this.pointer.draw(o,i,this.hover,n));s&&(e.fill=a)}setChart(t,e){super.setChart(t,e),t.pointer.setChart(e)}_pointWindow(t,e){const o=this.data.values.length;if(o<64)return null;if(this.data.x&&(this.data.x.length!==o||!s(this.data.x)))return null;const r=new i,n=t=>(this.calc(t,r),this.yMandatory?r.x:r.y),a=n(o-1)>=n(0)?1:-1,l=a*(this.yMandatory?t.x:t.y),h=(t,e)=>{let i=0,s=o;for(;i<s;){const o=i+s>>>1,r=a*n(o);(e?r>t:r>=t)?s=o:i=o+1}return i},c=h(l-e,!1),d=h(l+e,!0);return[Math.max(0,c-1),Math.min(o-1,d)]}clicked(t){const e=new i,s=new i,n=this.data.values.length;let a;if(this.drawLine&&n>0&&(this.hover.line||!this.pointer.visible)){const r=this._pointWindow(t,this.clickTolerance+1),l=r?r[0]:0,h=r?r[1]:n-1;for(this.calc(l,e),a=l+1;a<=h;a++){if(this.calc(a,s),this.stairs){let r;if(r=this.invertedStairs?new i(s.x,e.y):new i(e.x,s.y),o(t,e,r,this.clickTolerance)||o(t,r,s,this.clickTolerance))return a}else if(o(t,e,s,this.clickTolerance))return a;e.x=s.x,e.y=s.y}}if(this.pointer.visible){const e=new r,i=this.pointer,s=this.getSize===Mt.prototype.getSize?this._pointWindow(t,.5*Math.max(i.width,i.height)+1):null,o=s?s[0]:0;for(a=s?s[1]:n-1;a>=o;a--)if(!this.isNull(a)&&(this.calc(a,e),this.getSize(a),e.x-=.5*i.width,e.width=i.width,e.y-=.5*i.height,e.height=i.height,e.contains(t)))return a}return-1}horizMargins(t){if(!t)return;const e=this.pointer,i=e.format.stroke;e.visible&&e.inflateMargins&&(t.x=t.y=(""!==i.fill?i.size:0)+1+.5*e.width)}vertMargins(t){if(!t)return;const e=this.pointer,i=e.format.stroke;e.visible&&e.inflateMargins&&(t.x=t.y=(""!==i.fill?i.size:0)+1+.5*e.height)}getSize(t){}}class Tt extends Mt{constructor(t,e){super(t,e),this.useOrigin=!1,this.origin=0,this.drawLine=!0,this.closeArea=!0;const i=this.format;i.shadow.visible=!0,i.stroke.fill="black",i.fill="",i.beveled=!0,i.depth=1,i.z=.5}draw(){const t=this.data.values.length,e=this.format;if(t>0){const s=this.mandatoryAxis,o=this.notmandatory;let n;const h=this.yMandatory;let c;n=this.useOrigin?s.calc(this.origin):h&&s.inverted||!h&&!s.inverted?s.startPos:s.endPos,this.isStacked="no"!==this.stacked,this.isStack100="100"===this.stacked;const d=new i;let f,u=Number.NaN;const m=this.chart.drawContext,g=new r,b=this.isStacked;let p=0,v=t,w=new i(Number.NaN,Number.NaN),y="";if(!this.smooth)if(this.data.x){const e=l(this.data.x,t,o.minimum,o.maximum);e&&([p,v]=e)}else p=Math.max(0,a(o.minimum)-1),v=Math.min(t,a(o.maximum)+2);if(m.depth=e.depth,m.z=e.z,m.beginPath(),this.smooth>0){f=new Array(2*t);for(let e=0;e<t;e++)this.calc(e,d),f[2*e]=d.x,f[2*e+1]=d.y;if(c=h?f[0]:f[1],m.spline?m.spline(f,!0):St(m,f,this.smooth,!0),b){let e=0;for(let i=t-1;i>=0;i--)this.calcStack(i,d,0),f[e++]=d.x,f[e++]=d.y;m.lineTo(f[0],f[1]),m.spline?m.spline(f,!0):St(m,f,this.smooth,!1)}}else{this.calc(p,d),c=h?d.x:d.y;const t=o.axisSize;if(!this.stairs&&!b&&t>0&&v-p>2*t)this._traceDecimated(m,d,p,v,!1);else if(m.moveTo(d.x,d.y),u=h?d.y:d.x,this.stairs)for(let t=p+1;t<v;t++)this.calc(t,d),m.lineTo(d.x,u),m.lineTo(d.x,d.y),u=h?d.y:d.x;else for(let t=p+1;t<v;t++)this.calc(t,d),m.lineTo(d.x,d.y)}if(b){if(0===this.smooth)for(let t=v-1;t>=p;t--)this.calcStack(t,d,0),this.stairs?(m.lineTo(d.x,u),m.lineTo(d.x,d.y),u=h?d.y:d.x):m.lineTo(d.x,d.y)}else h?this.closeArea?(m.lineTo(d.x,n),m.lineTo(c,n)):w=d:(m.lineTo(n,d.y),m.lineTo(n,c));if(!this.closeArea){const t=e.stroke,i=t.fill;t.prepare(i),m.stroke(),m.lineTo(w.x,n),m.lineTo(c,n),y=e.stroke.fill,e.stroke.fill="#00FF0000"}m.closePath();const x=e.gradient;x.visible&&(x.colors[x.colors.length-1]=e.fill),this.bounds(g),m.__webgl&&(m.beveled=e.beveled),e.draw(m,null,g),this.closeArea||(e.stroke.fill=y),this.pointer.visible&&this.drawPointers()}}minYValue(){const t=this.yMandatory?this._baseMinYValue():this._baseMinXValue();return this.yMandatory&&this.useOrigin?Math.min(t,this.origin):t}minXValue(){const t=this.yMandatory?this._baseMinXValue():this._baseMinYValue();return this.yMandatory?t:this.useOrigin?Math.min(t,this.origin):t}maxYValue(){const t=this.yMandatory?this.stackMaxValue():this._baseMaxXValue();return this.yMandatory&&this.useOrigin?Math.max(t,this.origin):t}maxXValue(){const t=this.yMandatory?this._baseMaxXValue():this.stackMaxValue();return this.yMandatory?t:this.useOrigin?Math.max(t,this.origin):t}vertMargins(t){const e=this.format;this.yMandatory&&""!==e.stroke.fill&&(t.y+=e.stroke.size+2)}horizMargins(t){const e=this.format;this.yMandatory||""===e.stroke.fill||(t.y+=e.stroke.size+2)}}class Dt extends e{sideMargins=100;useOrigin=!0;origin=0;continuous=!1;offset=0;barSize=70;customBarSize=0;barStyle="bar";stacked="no";percent=1;offsetPoint=new i;originPos=void 0;bar=new r;visibleBar={total:0,index:0};_margin=0;hasPaintedOver=!1;constructor(t,e){super(t,e),this.marks.visible=!0,this.marks.location="end",this.hover.enabled=!0;var i=this.format;i.fill="",i.stroke.fill="black",i.shadow.visible=!0,i.round.x=4,i.round.y=4,i.gradient.visible=!0,i.depth=1}drawBar(t,e){const i=this.format;var s=i.depth,o=i.z,r=this.chart.drawContext;if(e||(e=this.barStyle),i.depth=.5*Math.min(this.yMandatory?t.width:t.height,200)/100,t.width>0&&t.height>0){if("side"!==this.stacked&&(i.z=i.z+.5*(1-i.depth)),"bar"===e)i.cube(t);else if("line"===e){var n;r.beginPath(),r.z=i.z+.5*i.depth,this.yMandatory?(n=t.x+.5*t.width,r.moveTo(n,t.y),r.lineTo(n,t.y+t.height)):(n=t.y+.5*t.height,r.moveTo(t.x,n),r.lineTo(t.x+t.width,n))}else"cylinder"===e?i.cylinder(t,1,this.yMandatory,!1):"cone"===e?i.cylinder(t,0,this.yMandatory,!1):"ellipsoid"===e&&this.chart.__webgl?(r.depth=i.depth,r.z=i.z,r.image=this.image,r.ellipsoid?.(t,this.yMandatory)):(i.z+=.5*i.depth,i.ellipsePath(this.chart.drawContext,t.x+.5*t.width,t.y+.5*t.height,t.width,t.height));return i.depth=s,i.z=o,!0}return!1}countAll(t=!1){var e,i,s=this.chart.series.items,o=0,r=s.length;for(e=0;e<r&&((i=s[e])!=this||!t);e++)i.visible&&i.constructor==this.constructor&&(o+=i.data.values.length);return o}calcBarOffset(t){var e=t,i="sideAll"==this.stacked;this.countall=i?this.countAll(!0):0;var s,o=i?this.countAll():this.data.values.length,r=this.offsetPoint,n=this.visibleBar;o>1&&(e/=o),"no"==this.stacked?(e/=n.total,r.x=(this.customBarSize>0?this.customBarSize:e*this.barSize*.01)*(1==n.total?-.5:n.index-.5*n.total),s=n.total):(r.x=.5*-e,s=1),r.y=this.customBarSize>0?this.customBarSize:e*this.barSize*.01,this._margin=.5*s*r.y+this.sideMargins*(s*(e-r.y))*.005,"no"!=this.stacked&&(r.x+=this.offset*e*.01+.5*(e-r.y))}calcStackPos(t,e){var i,s,o;this.isStacked?(this.calcStack(t,e,this.data.values[t]),i=this.pointOrigin(t,!1),o=this.mandatoryAxis,this.isStack100?(s=this.pointOrigin(t,!0),this.originPos=0===s?o.endPos:o.calc(100*i/s)):this.originPos=o.calc(i)):(this.calc(t,e),"sideAll"==this.stacked&&(s=this.notmandatory.calc(this.countall+t),this.yMandatory?e.x=s:e.y=s))}drawSortedValues(t){const e="boolean"==typeof t?t:t.length>0;var i=this.sortedOptions.sortedDrawAnimation;if(this.sortedOptions.sorted!=e&&!this.sortedOptions.sorting&&i&&!i.running){this.sortedOptions.sorted=e,this.sortedOptions.sorted&&this.sortValues();var s=this.sortedOptions.sorted?this.sortedOptions.originalValues.slice():this.sortedOptions.sortedValues.slice(),o=this.data.values,r=this.sortedOptions.sorted?this.sortedOptions.sortedValues.slice():this.sortedOptions.originalValues.slice(),n=this.sortedOptions;i.chart=this.chart,"horizontalchange"==n.sortingAnimationType?(i.doStep=t=>{t<1&&(this.percent=t,this.draw())},i.onstop=()=>{if(this.percent=1,n.sorted)for(var t=0;t<s.length;t++)o[t]=r[t]},i.onstart=()=>{if(!n.sorted)for(var t=0;t<s.length;t++)o[t]=r[t]}):(i.doStep=t=>{if(t<1)for(var e=0;e<s.length;e++)o[e]=s[e]+(r[e]-s[e])*t},i.onstop=()=>{this.percent=1;for(var t=0;t<s.length;t++)o[t]=r[t];i.running=!1},i.onstart=()=>{i.running=!0}),i.animate(),this.data.labels=this.sortedOptions.sorted?this.sortedOptions.sortedLabels.slice():this.sortedOptions.originalLabels.slice(),this.chart.draw()}}draw(){var t=this.data.values.length;const e=this.format;if(t>0){this.initOffsets();var s=new i,o=this.chart.drawContext;this.hover.enabled||(e.stroke.prepare(),e.shadow.prepare(o));var r=this.hover.enabled,n="line"===this.barStyle,a=this.data.styles;r&&null!=this.format.image.url&&(this.hover.image.url=this.format.image.url,this.hover.image.repeat=this.format.image.repeat,this.hover.image.backFill=this.format.image.backFill),e.z=0;for(var l=0;l<t;l++)if(!this.isNull(l)){this.calcStackPos(l,s);var h=new i;this.percent<1&&(this.calcStackPos(this.sortedOptions.sortedValuesIndices.findIndex(t=>t==l),h),this.sortedOptions.sorted?s.x=(-s.x+h.x)*this.percent+s.x:s.x=(s.x-h.x)*this.percent+h.x),this.onbeforedrawPoint&&this.onbeforedrawPoint(l),this.calcBarBounds?.(s,this.bar,this.offsetPoint,Number(this.originPos instanceof Array?this.originPos[l]:this.originPos)),this.barRectangle=this.bar;var c=this.drawBar(this.bar,a?a[l]:void 0),d=r&&this.over==l,f=d?this.hover:e;o.fillStyle=this.getFillStyle(this.bar,this.getFill(l,""===f.fill?e:f)),this.format.gradient.visible||(f.fill=o.fillStyle),r&&f.shadow.prepare(o),d&&(null==this.format.image.url||this.hasPaintedOver?o.fill():(this.hasPaintedOver=!0,e.draw(o,null,this.bar))),c&&(f.draw(o,null,this.bar),(n||""!==f.stroke.fill)&&(r&&f.stroke.prepare(),!d&&n&&(o.strokeStyle=o.fillStyle),o.shadowColor="transparent",o.stroke(),f.shadow.visible&&(o.shadowColor=f.shadow.color)))}}}calcColorEach(){this.chart.series.visibleCount(this,Dt,this.visibleBar),this.isColorEach="yes"==this.colorEach||"auto"==this.colorEach&&1==this.visibleBar.total}initOffsets(){var t=this.notmandatory,e=this.mandatoryAxis,i=this.yMandatory?this.maxXValue()-this.minXValue():this.maxYValue()-this.minYValue();if("sideAll"==this.stacked?this.calcBarOffset(t.axisSize):this.calcBarOffset(0===i?t.axisSize:t.calcSize(i)),this.useOrigin)if(Array.isArray(this.origin)){this.originPos=[];for(var s=0;s<this.origin.length;s++)this.originPos[s]=e.calc(this.origin[s])}else this.originPos=e.calc(this.origin);else this.yMandatory?this.originPos=e.inverted?e.startPos:e.endPos:this.originPos=e.inverted?e.endPos:e.startPos;var o=this.stacked;this.isStacked="no"!==o&&"sideAll"!==o&&"side"!==o,this.isStack100="100"===o}clicked(t){this.initOffsets();var e,s=new i,o=this.data.values.length;for(e=0;e<o;e++)if(!this.isNull(e)&&(this.calcStackPos(e,s),this.calcBarBounds?.(s,this.bar,this.offsetPoint,Number(this.originPos instanceof Array?this.originPos[e]:this.originPos)),this.bar.contains(t)))return e;return-1}markPos(t,e){var i=this.yMandatory,s=this.offsetPoint.x+.5*this.offsetPoint.y,o=this.marks;if(this.calcStackPos(t,e),"sideAll"==this.stacked){var r=this.notmandatory.calc(this.countall+t);i?e.x=r:e.y=r}var n=this.useOrigin&&this.data.values[t]<(Array.isArray(this.origin)?this.origin[t]:this.origin);this.mandatoryAxis.inverted&&(n=!n),"center"==o.location&&(this.calcBarBounds?.(e,this.bar,this.offsetPoint,Number(this.originPos instanceof Array?this.originPos[t]:this.originPos)),o.canDraw(e.x,e.y,t,n)&&(i?e.y=this.bar.y+.5*this.bar.height+.5*o.bounds.height:e.x=this.bar.x+.5*this.bar.width-.5*o.bounds.width));var a=this.chart.aspect,l=a.view3d,h=0,c=0;return l&&a.orthogonal&&(h=.5*a._orthox,c=.5*a._orthoy),i?(e.x+=l?s+h:s,l&&(e.y-=c)):(e.y+=l?s-c:s,l&&(e.x+=h)),n}labelOrTitle(t){var e=this.title,i=this.data.labels[t];return this.visibleBar.total>1?e||i:super.labelOrTitle(t)}initZ(t,e){let i;const s=this.format;if("side"!==this.stacked){for(s.z=0,s.depth=1;t>1;)if(t--,i=this.chart.series.items[t],i.visible&&i.constructor==this.constructor){s.z=i.format.z,s.depth=i.format.depth;break}}else super.initZ(t,e);this.marks.format.z=s.z+.5*s.depth}}class Et extends Dt{calc(t,e){this.isStacked?this.calcStack(t,e,this.data.values[t]):super.calc(t,e)}horizMargins(t){this.initOffsets(),t.x=this._margin,t.y=this._margin}vertMargins(t){const e=this.marks;let i=this.format.stroke;const s=this.minYValue()<(Array.isArray(this.origin)?h(this.origin):this.origin);e.visible&&"center"!==e.location&&(t.y=(e.arrow.length??0)+e.format.textHeight("Wj")+e.margins.top+e.margins.bottom,i=e.format.stroke),""!==i.fill&&(t.y+=2*i.size+1),s&&(t.x=t.y)}maxXValue(){return"sideAll"===this.stacked?this.countAll()-1:super.maxXValue()}minYValue(){const t=super.minYValue();return this.useOrigin?Math.min(Array.isArray(this.origin)?h(this.origin):this.origin,t):t}maxYValue(){let t,e=0;const i=this.chart.series.items,s=i.length;let o,r;if("sideAll"===this.stacked||"side"===this.stacked){for(o=0;o<s;o++)t=i[o],t.visible&&t.constructor===this.constructor&&(r=t._baseMaxYValue(),r>e&&(e=r));return e}return this.stackMaxValue()}calcBarBounds(t,e,i,s){e.x=t.x+i.x,e.width=i.y,this._vertAxis.inverted?(e.y=s,e.height=t.y-e.y):(e.y=t.y,e.height=s-t.y),e.height<0&&(e.y+=e.height,e.height=-e.height)}}class Ot extends Mt{constructor(t,e){super(t,e),this.hover.enabled=!0,this.pointer.visible=!0,this.drawLine=!1,this.continuous=!1}draw(){0!==this.data.values.length&&(this.isStacked="no"!==this.stacked,this.isStack100="100"===this.stacked,this.pointer.visible&&this.drawPointers())}}class Rt extends Ot{inflate=!0;constructor(t,e){super(t,e),this.pointer.colorEach=!0,this.pointer.style="sphere",this.pointer.format.gradient.visible=!0,this.pointer.format.gradient.direction="radial",this.data.radius=[]}addRandom(t=5){if(t||(t=5),this.data.values.length=t,this.data.x=void 0,this.data.radius=[],this.data.radius.length=t,t>0)for(let e=0;e<t;e++)this.data.values[e]=1e3*Math.random(),this.data.radius[e]=50+150*Math.random();return this}initZ(){super.initZ()}getSize(t){const e=this.data.radius?this._vertAxis.calcSize(this.data.radius[t]):0;this.pointer.width=e,this.pointer.height=e}horizMargins(t){this.calcWidth=function(t){this.getSize(t);let e=1+.5*this.pointer.width,i=this.pointer.format.stroke;return""!==i.fill&&(e+=i.size),e},this.pointer.visible&&this.inflate&&(this.pointer.x=this.calcWidth(0),this.pointer.y=this.calcWidth(this.count()-1))}vertMargins(t){if(this.calcHeight=function(t){this.getSize(t);let e=1+.5*this.pointer.height,i=this.pointer.format.stroke;return""!==i.fill&&(e+=i.size),e},this.pointer.visible&&this.inflate){let e,i,s=0,o=0,r=this.count(),n={x:0,y:0};if(r>0){this.calc(0,n),e=i=n.y;for(let t=1;t<r;t++)this.calc(t,n),n.y<e?s=t:n.y>i&&(o=t);t.x=this.calcHeight(o),t.y=this.calcHeight(s)}}}}class Bt extends e{onbeforedrawPoint;donut=0;rotation=0;colorEach="yes";useAxes=!1;continuous=!1;angleWidth=360;maxRadius=100;sort="values";orderAscending=!1;explode=null;concentric=!1;clockwise=!0;total=Number.NaN;piex=Number.NaN;piey=Number.NaN;radius=Number.NaN;donutRadius=Number.NaN;center={x:0,y:0};sorted;angle=Number.NaN;endAngle=Number.NaN;hoverang=Number.NaN;anchorPosition=Number.NaN;hoverExplode=6;hoverDuration=150;hoverProgress=[];hoverFrame=null;hitTesting=!1;r=new r;constructor(t,e){super(t,e),this.marks.style="percent",this.marks.visible=!0;const i=this.format;i.stroke.fill="black",i.shadow.visible=!0,i.gradient.visible=!0,i.gradient.direction="radial",i.gradient.colors=["white","white","white"],this.hover.enabled=!0,this.hover.stroke.fill=""}getValue(t){return this.data.values[t]}calcCenter(t,e,i,s){let o=this.explode?.[t]??0;this.hitTesting||(o+=this.hoverExplode*(this.hoverProgress[t]??0)),o&&(o=e*o*.01,s.x+=o*Math.cos(i),s.y+=o*Math.sin(i))}doHover(t){const e=t!==this.over;super.doHover(t),e&&this.animateHover()}animateHover(){if(null!==this.hoverFrame||this.hoverExplode<=0)return;const t=c()?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1?0:this.hoverDuration;let e=Date.now();const i=()=>{if(this.hoverFrame=null,this.chart.destroyed)return;const s=Date.now(),o=t>0?(s-e)/t:1;e=s;let r=!1;for(let t=0;t<this.data.values.length;t++){const e=t===this.over?1:0,i=this.hoverProgress[t]??0;if(i===e)continue;const s=e>i?Math.min(e,i+o):Math.max(e,i-o);this.hoverProgress[t]=s,s!==e&&(r=!0)}this.chart._scheduleDraw(),r&&(this.hoverFrame=d(i))};this.hoverFrame=d(i)}clicked(t){const e=this.chart.ctx;if(!e)return-1;const i=this.data.values.length;let s;if(e.isPointInPath){this.endAngle=this.angle=Math.PI*this.rotation/180,this.hitTesting=!0;try{for(let o=0;o<i;o++)if(s=this.sorted?this.sorted[o]:o,!this.isNull(s)&&(this.slice(e,s),e.isPointInPath(t.x,t.y)))return s}finally{this.hitTesting=!1}}return-1}calc(t,e){const s=this.data.values.length,o=2*Math.PI/(360/this.angleWidth),r=this.total||this.data.values.reduce((t,e)=>t+Math.abs(e||0),0);let n=Math.PI*this.rotation/180,a=n;for(let e=0;e<s;e++){const i=this.sorted?this.sorted[e]:e;if(this.isNull(i))continue;const s=r?o*(Math.abs(this.data.values[i])/r):0,l=n+(this.clockwise?s:-s);if(i===t){a=.5*(n+l);break}n=l}const l=new i;l.x=this.piex,l.y=this.piey,this.calcCenter(t,this.radius,a,l);const h=Number.isFinite(this.anchorPosition)?this.radius*this.anchorPosition/100:this.radius;e.x=l.x+Math.cos(a)*h,e.y=l.y+Math.sin(a)*h}tooltipSide(t){const e=new i;this.calc(t,e);const s=e.x-this.piex,o=e.y-this.piey;if(0!==s||0!==o)return Math.abs(s)>Math.abs(o)?s>0?"right":"left":o>0?"bottom":"top"}calcPos(t,e){e.x=this.center.x+Math.cos(t)*this.donutRadius,e.y=this.center.y+Math.sin(t)*this.donutRadius}getCenter(t){return t.x=this.center.x,t.y=this.center.y,this.radius}slice(t,e){const s=new i,o=2*Math.PI*(Math.abs(this.data.values[e])/this.total)/(360/this.angleWidth);this.endAngle+=this.clockwise?o:-o,this.center.x=this.piex,this.center.y=this.piey,this.calcCenter(e,this.radius,.5*(this.angle+this.endAngle),this.center),0===this.donut?(s.x=this.center.x,s.y=this.center.y):this.calcPos(this.angle,s);this.chart.__webgl?(this.calcPos(2*Math.PI-this.angle,s),t.slice(s,this.center,this.radius,this.angle,this.endAngle,this.donutRadius,this.format.tube,this.format.beveled)):(t.beginPath(),t.moveTo(s.x,s.y),t.arc(this.center.x,this.center.y,this.radius,this.angle,this.endAngle,!this.clockwise),0!==this.donut&&(this.calcPos(this.endAngle,s),t.lineTo(s.x,s.y),t.arc(this.center.x,this.center.y,this.donutRadius,this.endAngle,this.angle,this.clockwise)),t.closePath()),e===this.over&&(this.hoverang=this.angle),this.angle=this.endAngle}fill(t){return this.getFillStyle(new r(this.center.x-this.radius,this.center.y-this.radius,2*this.radius,2*this.radius),this.getFill(t))}slices(t){const e=this.chart.ctx;if(!e)return;const i=this.data.values.length;this.endAngle=this.angle=Math.PI*this.rotation/180,e.z=.5,e.depth=1;for(let s=0;s<i;s++){const i=this.sorted?this.sorted[s]:s;if(this.onbeforedrawPoint&&this.onbeforedrawPoint(i),!this.isNull(i)&&(this.slice(e,i),t?this.format.shadow.prepare(e):e.fillStyle=this.fill(i),e.fill(),!t)){const t=this.format.stroke;""!==t.fill&&(t.prepare(),e.stroke())}}}draw(){if(this.data.values.length>0){let t=0;const e=this.marks;this.format.shadow.visible&&(t+=2*this.format.shadow.height),e.visible&&(e.format.font.prepare(),t+=e.format.textHeight("Wj")+.5*Math.max(0,e.arrow.length??0)),this.cellRect(this.r,!this.concentric,Bt),this.piex=this.r.x+.5*this.r.width,this.piey=this.r.y+.5*this.r.height,this.radius=.5*this.r.width;let i=.5*(this.r.height-2*t);if(i<0&&(i=0),i<this.radius&&(this.radius=i),this.donutRadius=this.radius*this.donut*.01,this.radius=this.radius/(100/this.maxRadius),this.total=this.data.values.reduce((t,e,i)=>t+(this.isNull(i)?0:Math.abs(e)),0),this.sorted=this.doSort(this.sort,this.orderAscending)??void 0,this.chart.__webgl||this.slices(!0),this.slices(!1),this.hover.enabled&&-1!==this.over){const t=this.hover,e=this.chart.ctx;if(!e||Number.isNaN(this.hoverang))return;this.endAngle=this.angle=this.hoverang,this.slice(e,this.over),this.chart.__webgl||(e.save(),e.fillStyle=""!==t.fill?t.fill:"rgba(255,255,255,0.18)",e.fill(),""!==t.stroke.fill&&(t.stroke.prepare(),e.stroke()),e.restore())}}}drawMarks(){let t,e=Math.PI*this.rotation/180,i=e;const s=this.data.values,o=s.length;this.marks.format.z=.5;for(let r=0;r<o;r+=this.marks.drawEvery){const o=this.sorted?this.sorted[r]:r;if(!this.isNull(o)){const r=2*Math.PI*(Math.abs(s[o])/this.total);e+=this.clockwise?r:-r,t=.5*(i+e),this.center.x=this.piex,this.center.y=this.piey,this.calcCenter(o,this.radius,t,this.center),this.marks.drawPolar(this.center,this.radius,t,o),i=e}}}}class Wt extends Bt{lessDonutWidth=100;donutArray=[];donut=50;constructor(t,e){super(t,e),this.donut=50}refreshWidth(){if(this.concentric){this.donutArray=this.chart.series.items;let t=0,e=0;for(let e=0;e<this.donutArray.length;e++)this.donutArray[e].visible&&t++;100===this.lessDonutWidth&&this.getLessDonutWidth();for(let i=0;i<this.donutArray.length;i++)this.donutArray[i].visible&&(this.donutArray[i].donut=this.lessDonutWidth+e*((100-this.lessDonutWidth)/t),e++)}}getLessDonutWidth(){for(let t=0;t<this.donutArray.length;t++)this.donutArray[t].donut<this.lessDonutWidth&&(this.lessDonutWidth=this.donutArray[t].donut)}}class Nt extends Mt{colorEachLine=void 0;constructor(t,e){super(t,e),this.drawLine=!0,this.treatNulls="dontPaint",this.colorEachLine="no";const i=this.format;i.shadow.visible=!0,i.shadow.blur=10}doDrawLine(t){const e=new i;let s=Number.NaN,o=Number.NaN;const r=this.data.values.length;let n,h,c,d=0,f=r;const u=this.notmandatory,m=this.format;if(!this.smooth)if(this.data.x){const t=l(this.data.x,r,u.minimum,u.maximum);t&&([d,f]=t)}else d=Math.max(0,a(u.minimum)-1),f=Math.min(r,a(u.maximum)+2);const g=this.chart.aspect.view3d,b="yes"===this.colorEachLine||!0===this.colorEachLine;if(m.fill=this.getFill(0,m),b||""===m.fill&&(m.fill=this.format.fill),t.beginPath(),this.smooth>0){for(h=new Array(2*r),n=0;n<r;n++)this.calc(n,e),h[2*n]=e.x,h[2*n+1]=e.y;t.spline?t.spline(h):St(t,h,this.smooth,!0)}else{const i="skip"!==this.treatNulls,r=m.gradient;let a=m.stroke.fill,l=a;!b&&r.visible&&r.setEndColor(m.stroke.fill);const h=m.stroke;h.prepare(h.fill);const c=u.axisSize;if(!b&&!this.stairs&&c>0&&f-d>2*c)this._traceDecimated(t,e,d,f,i);else for(n=d;n<f;n++)this.isNull(n)?i&&(d=-1):(this.calc(n,e),b?(b&&n!==d&&t.beginPath(),a=this.getFill(n,m),a!==l&&(r.visible?r.setEndColor(a):m.fill=a,l=a),n===d||-1===d?(t.moveTo(e.x,e.y),d=0):this.stairs?this.invertedStairs?(t.moveTo(s,o),t.lineTo(e.x,o),t.lineTo(e.x,e.y)):(t.moveTo(s,o),t.lineTo(s,e.y),t.lineTo(e.x,e.y)):(t.moveTo(s,o),t.lineTo(e.x,e.y)),t.strokeStyle=a,t.stroke()):n===d||-1===d?(t.moveTo(e.x,e.y),d=0):this.stairs?(this.invertedStairs?t.lineTo(e.x,o):t.lineTo(s,e.y),t.lineTo(e.x,e.y)):t.lineTo(e.x,e.y),s=e.x,o=e.y,b&&n!==d&&t.closePath())}const p=m.stroke;this.chart.isChrome&&m.shadow.visible&&(p.size=Math.max(1.1,p.size)),t.z=m.z,t.depth=m.depth,c=p.fill,""===c&&(c=m.fill),p.prepare(c),m.shadow.prepare(t),g&&(t.fillStyle=m.fill,t.fill()),b||""!==c&&t.stroke()}draw(){this.data.values.length>0&&(this.isStacked="no"!==this.stacked,this.isStack100="100"===this.stacked,this.drawLine&&this.doDrawLine(this.chart.drawContext),this.pointer.visible&&this.drawPointers())}}const Vt="modern",Ht="line";At("area",Tt),At("bar",Et),At("bubble",Rt),At("donut",Wt),At("line",Nt),At("pie",Bt),At("point",Ot);const Lt=["visible","style","drawEvery","showZero","placement","connector"],It=["visible","style","width","height","colorEach"];function jt(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function $t(t){const e="string"==typeof t?(i=t,Ct.get(i)):void 0;var i;if(!e)throw new Error(`Unknown series type ${JSON.stringify(t)}. Types other than area, bar, bubble, donut, line, pie and point must be registered first with registerSeriesType or registerAllSeriesTypes.`);return e}const Yt={};function Ut(t,e){Yt[t]=e}function qt(t){const e=Yt[t];if(!e)throw new Error(`The "${t}" option requires registerAllOptions() to be called first.`);return e}function Xt(t,e){const i=t.tools.items.find(t=>t instanceof e);if(i)return i;const s=new e(t);return t.tools.add(s),s}function Gt(t,e,i){const s=t.axes[e];void 0!==i.visible&&(s.visible=i.visible),void 0!==i.title&&(s.title.text=i.title),void 0===i.minimum&&void 0===i.maximum||s.setMinMax(i.minimum??s.minimum,i.maximum??s.maximum),void 0!==i.inverted&&(s.inverted=i.inverted),void 0!==i.log&&(s.log=i.log),void 0!==i.headroom&&(s.headroom=i.headroom),void 0!==i.increment&&(s.increment=i.increment),void 0!==i.roundFirst&&(s.labels.roundFirst=i.roundFirst),void 0!==i.titleVisible&&(s.title.visible=i.titleVisible),void 0!==i.titleColor&&(s.title.format.font.fill=i.titleColor),void 0!==i.titleFontSize&&s.title.format.font.setSize(i.titleFontSize),void 0!==i.ticksVisible&&(s.ticks.visible=i.ticksVisible),void 0!==i.position&&(s.position=i.position),void 0!==i.innerTicksVisible&&(s.innerTicks.visible=i.innerTicksVisible),void 0!==i.minorTicksVisible&&(s.minorTicks.visible=i.minorTicksVisible),void 0!==i.lineColor&&(s.format.stroke.fill=i.lineColor),void 0!==i.lineWidth&&(s.format.stroke.size=i.lineWidth),void 0!==i.grid?.visible&&(s.grid.visible=i.grid.visible),void 0!==i.grid?.centered&&(s.grid.centered=i.grid.centered),void 0!==i.grid?.lineDash&&(s.grid.lineDash=i.grid.lineDash),void 0!==i.grid?.lineColor&&(s.grid.format.stroke.fill=i.grid.lineColor),void 0!==i.grid?.lineWidth&&(s.grid.format.stroke.size=i.grid.lineWidth),void 0!==i.grid?.bandColor&&(s.grid.format.fill=i.grid.bandColor);const o=i.labels;o&&(void 0!==o.visible&&(s.labels.visible=o.visible),void 0!==o.decimals&&(s.labels.decimals=o.decimals),void 0!==o.fixedDecimals&&(s.labels.fixedDecimals=o.fixedDecimals),void 0!==o.rotation&&(s.labels.rotation=o.rotation),void 0!==o.labelStyle&&(s.labels.labelStyle=o.labelStyle),void 0!==o.dateFormat&&(s.labels.dateFormat=o.dateFormat),void 0!==o.valueFormat&&(s.labels.valueFormat=o.valueFormat))}function Zt(t,e){throw new Error(`Series type ${JSON.stringify(t)} does not support the "${e}" option`)}function Jt(t,e){void 0!==e.label&&(t.title=e.label),void 0!==e.visible&&(t.visible=e.visible),void 0!==e.borderColor&&(t.format.stroke.fill=e.borderColor),void 0!==e.backgroundColor&&(t.format.fill=e.backgroundColor),void 0!==e.borderWidth&&(t.format.stroke.size=e.borderWidth),void 0!==e.shadow&&(t.format.shadow.visible=e.shadow),void 0!==e.hoverColor&&(t.hover.stroke.fill=e.hoverColor),void 0!==e.hoverEnabled&&(t.hover.enabled=e.hoverEnabled),void 0!==e.gradientVisible&&(t.format.gradient.visible=e.gradientVisible),void 0!==e.gradientColors&&(t.format.gradient.colors=[...e.gradientColors]),void 0!==e.image&&(t.format.image.url=e.image.url),void 0!==e.transparency&&(t.format.transparency=e.transparency),void 0!==e.cursor&&(t.cursor=e.cursor),void 0!==e.maxPoints&&(t.maxPoints=e.maxPoints),void 0!==e.legend?.visible&&(t.legend.visible=e.legend.visible),void 0!==e.legend?.symbol&&(t.legend.symbol={...t.legend.symbol,...e.legend.symbol}),void 0!==e.colorEach&&(t.colorEach=!0===e.colorEach?"yes":!1===e.colorEach?"no":e.colorEach);const i=e.marks;if(i){void 0!==i.backgroundColor&&(t.marks.format.fill=i.backgroundColor),void 0!==i.borderColor&&(t.marks.format.stroke.fill=i.borderColor),void 0!==i.fontColor&&(t.marks.format.font.fill=i.fontColor),void 0!==i.fontSize&&t.marks.format.font.setSize(i.fontSize),void 0!==i.borderRadius&&(t.marks.format.round.x=i.borderRadius,t.marks.format.round.y=i.borderRadius),void 0!==i.margins&&Object.assign(t.marks.margins,i.margins);for(const e of Lt)void 0!==i[e]&&Object.assign(t.marks,{[e]:i[e]})}}function Kt(e,i,s){if(void 0===s.horizAxis&&void 0===s.vertAxis||(!1===e.useAxes&&Zt(i,void 0!==s.horizAxis?"horizAxis":"vertAxis"),void 0!==s.horizAxis&&(e.horizAxis=s.horizAxis),void 0!==s.vertAxis&&(e.vertAxis=s.vertAxis)),void 0!==s.pointer){const o=t(e);o||Zt(i,"pointer");for(const t of It)void 0!==s.pointer[t]&&Object.assign(o,{[t]:s.pointer[t]});void 0!==s.pointer.strokeWidth&&(o.format.stroke.size=s.pointer.strokeWidth),void 0!==s.pointer.strokeColor&&(o.format.stroke.fill=s.pointer.strokeColor),void 0!==s.pointer.shadow&&(o.format.shadow.visible=s.pointer.shadow)}void 0!==s.stacked&&(void 0===e.stacked&&Zt(i,"stacked"),e.stacked=s.stacked);const o=!(e instanceof Ot);if(void 0!==s.smooth){const t=e;o&&"number"==typeof t.smooth||Zt(i,"smooth"),t.smooth=s.smooth}if(void 0!==s.stairs){const t=e;o&&"boolean"==typeof t.stairs||Zt(i,"stairs"),t.stairs=s.stairs}if(void 0!==s.treatNulls&&("treatNulls"in e||Zt(i,"treatNulls"),e.treatNulls=s.treatNulls),void 0!==s.barSize){const t=e;"number"!=typeof t.barSize&&Zt(i,"barSize"),t.barSize=s.barSize}if(void 0!==s.maxRadius){const t=e;"number"!=typeof t.maxRadius&&Zt(i,"maxRadius"),t.maxRadius=s.maxRadius}}const Qt=new Set(["area","bar","bubble","horizArea","horizBar","line","point","volume"]);function te(t,e,i,s,o){const r=function(t,e,i){if(!Qt.has(t)||!Array.isArray(e)||0===e.length)return;if(!e.some(t=>"object"==typeof t&&null!==t))return;if(void 0!==i.x)throw new Error(`The "x" option cannot be combined with object data points in a ${t} series`);const s=i.xKey??"x",o=i.yKey??"y";return e.map(e=>{if("object"!=typeof e||null===e||!(s in e)||!(o in e))throw new TypeError(`The data of a ${t} series must contain the "${s}" and "${o}" properties`);const i=e,r=i[s],n=i[o];if(!("number"==typeof r||r instanceof Date)||"number"!=typeof n)throw new TypeError(`The "${s}" property must be a number or Date and "${o}" must be a number`);return{x:r,y:n}})}(i,s.data,s),n=r?r.map(t=>t.y):s.data;e.setData?e.setData(t,n,o):t.setData(n,o,!1),r?t.data.x=r.map(t=>t.x):function(t,e,i){const s=i.x;if(void 0!==s){if(!1===t.useAxes&&Zt(e,"x"),!Array.isArray(s)||s.length!==t.data.values.length)throw new Error(`The "x" option of a ${e} series needs one value for each of its ${t.data.values.length} points`);t.data.x=[...s]}}(t,i,s),e.configure?.(t,s),Jt(t,s),Kt(t,i,s)}function ee(t,e,i){const s=$t(e),o=s.create();return te(o,s,e,t,i),o}const ie=new WeakMap;function se(t){if("object"!=typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function oe(t){return Array.isArray(t)?t.map(oe):se(t)?Object.fromEntries(Object.entries(t).map(([t,e])=>[t,oe(e)])):t}function re(t,e){if(!se(t)||!se(e))return e;const i={...t};for(const[s,o]of Object.entries(e))void 0!==o&&(i[s]=re(t[s],o));return i}function ne(t,e,i,s){return e.map((e,o)=>{const r=t?.[o],n=void 0===e.id?void 0===r?.id?r:void 0:t?.find(t=>t.id===e.id);if(!n||(n.type??i)!==(e.type??s))return e;const{data:a,...l}=n,{data:h,...c}=e;return{...re(l,c),data:h}})}const ae=new Set(["draw","resize","zoom","zoomreset","scroll","seriesclick","pointfocus","destroy"]);function le(t,e,i){const s=ie.get(t)??{options:{},series:[],listeners:[]};if(!i&&void 0!==e.plugins)throw new Error("The plugins option can only be set when the chart is created");const o=function(t,e){const{data:i,...s}=e,o=re(t,s);if(void 0===i)return o;const r=t.type??Ht,n=o.type??Ht;return{...o,data:{labels:i.labels??t.data?.labels,series:ne(t.data?.series,i.series,r,n)}}}(s.options,e),r=i?null!==o.theme:void 0!==e.theme&&null!==e.theme,n=i||r||void 0!==e.palette,a=n?o:e,l=o.type??Ht;$t(l);const h=void 0!==e.tools?qt("tools"):void 0,c=void 0!==e.animation?qt("animation"):void 0,d=void 0!==e.on?function(t){const e=[];for(const[i,s]of Object.entries(t??{})){if(!ae.has(i))throw new Error(`Unknown chart event ${JSON.stringify(i)}`);if("function"!=typeof s)throw new TypeError(`The "${i}" listener must be a function`);e.push([i,s])}return e}(o.on):void 0,u=void 0!==e.accessibility?qt("accessibility"):void 0,m=e.responsive?qt("responsive"):void 0,g=n||void 0!==e.type?o.data?.series:e.data?.series,b=o.data?.labels;!function(t){const e=new Set;for(const i of t??[])if(void 0!==i.id){if(!i.id.trim())throw new Error("Series id cannot be empty");if(e.has(i.id))throw new Error(`Duplicate series id ${JSON.stringify(i.id)}`);e.add(i.id)}}(g);const p=g?.map((e,i)=>{const o=e.type??l,r=s.series[i],n=void 0===e.id?void 0===r?.id?r:void 0:s.series.find(t=>t.id===e.id);return{type:o,entry:e,created:ee(e,o,b),previous:n,reusable:n?.type===o&&t.series.items.includes(n.series)?n.series:void 0}});if(r&&function(t,e){null!==e.theme&&t.applyTheme(e.theme??Vt)}(t,i?o:{theme:e.theme}),void 0!==o.palette&&n&&t.applyPalette(o.palette),void 0!==a.pixelRatio&&t._applyPixelRatio(a.pixelRatio),"string"==typeof a.title?(t.title.text=a.title,t.title.visible=!0):void 0!==a.title&&(void 0!==a.title.text&&(t.title.text=a.title.text),void 0!==a.title.visible&&(t.title.visible=a.title.visible),void 0!==a.title.fontSize&&t.title.format.font.setSize(a.title.fontSize),void 0!==a.title.fontFamily&&(t.title.format.font.style=`${a.title.fontSize??18}px ${a.title.fontFamily}`),void 0!==a.title.color&&(t.title.format.font.fill=a.title.color),void 0!==a.title.expand&&(t.title.expand=a.title.expand)),void 0!==a.subtitle&&(t.subtitle.text=a.subtitle),void 0!==a.footer&&(t.footer.text=a.footer),void 0!==a.legend&&function(t,e){const i=t.legend;void 0!==e.visible&&(i.visible=e.visible),void 0!==e.position&&(i.position=e.position),void 0!==e.title&&(i.title.text=e.title),void 0!==e.style&&(i.legendStyle=e.style),void 0!==e.valueFormat&&(i.textStyle=e.valueFormat),void 0!==e.interaction&&(i.activeStyle=e.interaction),void 0!==e.inverted&&(i.inverted=e.inverted),void 0!==e.fontColor&&(i.fontColor=e.fontColor),void 0!==e.fontSize&&i.format.font.setSize(e.fontSize),void 0!==e.color&&(i.format.font.fill=e.color),void 0!==e.hoverColor&&(i.hover.font.fill=e.hoverColor),void 0!==e.hoverBackground&&(i.hoverBackground=e.hoverBackground),void 0!==e.itemGap&&(i.itemGap=e.itemGap),void 0!==e.rowGap&&(i.rowGap=e.rowGap),void 0!==e.background&&(i.transparent=null===e.background,null!==e.background&&(i.format.fill=e.background));const s=e.symbol;void 0!==s&&(void 0!==s.style&&(i.symbol.style=s.style),void 0!==s.size&&(i.symbol.width=s.size,i.symbol.height=s.size),void 0!==s.width&&(i.symbol.width=s.width),void 0!==s.height&&(i.symbol.height=s.height),void 0!==s.padding&&(i.symbol.padding=s.padding),void 0!==s.radius&&(i.symbol.format.round.x=s.radius,i.symbol.format.round.y=s.radius),void 0!==s.useSeriesPointer&&(i.symbol.useSeriesPointer=s.useSeriesPointer))}(t,a.legend),void 0!==a.panel&&function(t,e){void 0!==e.backgroundColor&&(t.panel.format.fill=e.backgroundColor),void 0!==e.borderColor&&(t.panel.format.stroke.fill=e.borderColor),void 0!==e.borderWidth&&(t.panel.format.stroke.size=e.borderWidth),void 0!==e.transparent&&(t.panel.transparent=e.transparent),void 0!==e.shadow&&(t.panel.format.shadow.visible=e.shadow),void 0!==e.borderRadius&&(t.panel.format.round.x=e.borderRadius,t.panel.format.round.y=e.borderRadius),void 0!==e.gradientVisible&&(t.panel.format.gradient.visible=e.gradientVisible),void 0!==e.gradientColors&&(t.panel.format.gradient.colors=[...e.gradientColors]),void 0!==e.margins&&Object.assign(t.panel.margins,e.margins)}(t,a.panel),void 0!==a.aspect&&function(t,e){void 0!==e.clip&&(t.aspect.clip=e.clip),void 0!==e.view3d&&(t.aspect.view3d=e.view3d)}(t,a.aspect),void 0!==a.walls?.visible&&(t.walls.visible=a.walls.visible),void 0!==a.domTip?.enabled&&(t.domTip.enabled=a.domTip.enabled),void 0!==a.tooltip&&function(t,e){const i=Xt(t,f);void 0!==e.enabled&&(i.active=e.enabled),void 0!==e.shared&&(i.shared=e.shared),void 0!==e.render&&(i.render=e.render),void 0!==e.autoHide&&(i.autoHide=e.autoHide),void 0!==e.delay&&(i.delay=e.delay),void 0!==e.animated&&(i.animated=e.animated),void 0!==e.autoRedraw&&(i.autoRedraw=e.autoRedraw),void 0!==e.findPoint&&(i.findPoint=e.findPoint),void 0!==e.followCursor&&(i.followCursor=e.followCursor),void 0!==e.realTime&&(i.realTime=e.realTime),void 0!==e.extended&&(i.extended=e.extended),void 0!==e.domStyle&&(i.domStyle=e.domStyle),void 0!==e.format&&(i.ongettext=(t,i,s,o)=>e.format?.(s,o)??""),void 0!==e.pointer&&Object.assign(i.pointer,e.pointer)}(t,a.tooltip),void 0!==a.axes)for(const[e,i]of Object.entries(a.axes))i&&Gt(t,e,i);void 0!==a.zoom&&function(t,e){void 0!==e.enabled&&(t.zoom.enabled=e.enabled),void 0!==e.direction&&(t.zoom.direction=e.direction),void 0!==e.keepAspect&&(t.zoom.keepAspect=e.keepAspect),void 0!==e.mouseButton&&(t.zoom.mouseButton=e.mouseButton),void 0!==e.wheel?.enabled&&(t.zoom.wheel.enabled=e.wheel.enabled),void 0!==e.wheel?.factor&&(t.zoom.wheel.factor=e.wheel.factor)}(t,a.zoom),void 0!==a.scroll&&function(t,e){void 0!==e.enabled&&(t.scroll.enabled=e.enabled),void 0!==e.direction&&(t.scroll.direction=e.direction),void 0!==e.mouseButton&&(t.scroll.mouseButton=e.mouseButton)}(t,a.scroll),void 0!==e.tools&&h?.(t,e.tools);let v=s.series;p&&t.batchUpdate(()=>{v=function(t,e,i,s){const o=[];e.forEach(e=>{if(e.reusable)return te(e.reusable,$t(e.type),e.type,e.entry,s),void o.push({id:e.entry.id,type:e.type,series:e.reusable});const i=e.previous;i?function(t,e,i){const s=t.series.items,o=s.indexOf(e);t.addSeries(i),s.splice(s.indexOf(i),1),s.splice(-1===o?s.length:o,0,i),t.removeSeries(e,!0)}(t,i.series,e.created):t.addSeries(e.created),$t(e.type).configure?.(e.created,e.entry),Jt(e.created,e.entry),Kt(e.created,e.type,e.entry),o.push({id:e.entry.id,type:e.type,series:e.created})});const r=new Set(o.map(t=>t.series));for(const e of i)!r.has(e.series)&&t.series.items.includes(e.series)&&t.removeSeries(e.series,!0);const n=t.series.items.flatMap((t,e)=>r.has(t)?[e]:[]);for(const[e,i]of n.entries())t.series.items[i]=o[e].series;return o}(t,p,s.series,b)});let w=s.listeners;if(d){for(const t of w)t();w=d.map(([e,i])=>t.on(e,i))}let y=s.stopAccessibility;void 0!==e.accessibility&&o.accessibility&&(y?.(),y=u?.(t,o.accessibility));let x=s.stopResponsive;void 0!==e.responsive&&(x?.(),x=o.responsive?m?.(t):void 0);const k=t.pluginOptions;t.pluginOptions=o.pluginOptions??{},ie.set(t,{options:o,series:v,listeners:w,stopAccessibility:y,stopResponsive:x}),i||function(t,e,i){const s=ut.get(t);if(s)for(const o of s.values()){const s=!1!==e[o.id],r=!1!==i[o.id];if(s===r)continue;if(r){let e=mt.get(t);e||(e=new Map,mt.set(t,e)),e.set(o,o.create?.(t,ht(o.defaults,i[o.id]))),pt.get(t)?.delete(o.id),ct(t,o,"beforeInit"),ct(t,o,"afterInit");continue}let n=pt.get(t);n||(n=new Map,pt.set(t,n));const a=e[o.id];let l;a&&n.set(o.id,a);let h=!1;try{ct(t,o,"beforeDestroy",[],a)}catch(t){l=t,h=!0}try{ct(t,o,"afterDestroy",[],a)}catch(t){h||(l=t),h=!0}try{dt(t,o,a)}catch(t){h||(l=t),h=!0}if(h)throw l}}(t,k,t.pluginOptions),void 0!==e.animation&&c?.(t,e.animation)}const he={data:{series:[]},domTip:{enabled:!1},footer:"",legend:{visible:!0,position:"bottom",interaction:"linethrough",symbol:{useSeriesPointer:!1}},on:{},palette:void 0,panel:{backgroundColor:"white",transparent:!0,shadow:!1,borderWidth:0},pluginOptions:{},scroll:{enabled:!1,direction:"both",mouseButton:0},subtitle:"",theme:Vt,title:{text:"TeeChart",visible:!1},tooltip:{enabled:!1,shared:!1,render:"dom",autoHide:!0,delay:1e3,animated:!0,autoRedraw:!0},type:Ht,zoom:{enabled:!1,direction:"both",keepAspect:!1,mouseButton:0,wheel:{enabled:!1,factor:1.1}}};function ce(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every((t,i)=>ce(t,e[i]));if(se(t)&&se(e)){const i=new Set([...Object.keys(t),...Object.keys(e)]);for(const s of i)if(!ce(t[s],e[s]))return!1;return!0}return t instanceof Date&&e instanceof Date&&t.getTime()===e.getTime()}function de(t,e){return void 0===t||void 0!==e&&(Array.isArray(t)&&Array.isArray(e)?t.every((t,i)=>{if(i>=e.length||!se(t))return!0;const s="string"==typeof t.id?e.find(e=>se(e)&&e.id===t.id):e[i];return!se(s)||de(t,s)}):!se(t)||!se(e)||Object.keys(t).every(i=>"pluginOptions"===i&&se(t[i])&&se(e[i])?function(t,e){return Object.keys(t).every(i=>{const s=t[i],o=e[i];return!1===s||!1===o||de(s,o)})}(t[i],e[i]):de(t[i],e[i])))}function fe(t,e){const i=t??{},s=e??{};if(ce(i,s))return{change:"none",patch:{}};if(!ce(i.plugins,s.plugins)||!de(i,s))return{change:"recreate",patch:s};const o={};for(const[t,e]of Object.entries(s))ce(i[t],e)||(o[t]=e);return{change:"patch",patch:o}}class ue{chart;visual;visible=!0;transparency=0;left;top;right;bottom;items;constructor(t){this.chart=t,this.left=new u(t,!1,!1),this.top=new u(t,!0,!0),this.right=new u(t,!1,!0),this.bottom=new u(t,!0,!1),this.items=[this.left,this.top,this.right,this.bottom]}each(t){for(const e of this.items)t.call(e)}add(t=!1,e=!1){const i=new u(this.chart,t,e);return i.custom=!0,this.items.push(i),i}}class me{chart;format;width=8;height=8;padding=8;style="rectangle";visible=!0;useSeriesPointer=!1;ondraw;constructor(t){this.chart=t,this.format=new n(t),this.format.shadow.visible=!0,this.format.shadow.color="silver",this.format.shadow.width=2,this.format.shadow.height=2,this.format.depth=.01}tryHover(t,e){if(t.hover.enabled){const i=this.chart.legend.showValues();if(i&&t.over===e||!i&&t.over>=0)return t.hover}return null}draw(e,s,o,r){const n=this.chart.drawContext,a=this.format,l=this.tryHover(e,s),h=a.fill,c=a.stroke,d=e.legend.symbol,f=d?.style??this.style,u=d?.color??e.legendColor(s);a.fill=u,n.z=-.01;const m=t(e);if(this.ondraw){const t={x:o,y:r-.5*this.height-1,width:this.width,height:this.height};let i=!1;n.save();try{i=!0===this.ondraw({ctx:n,series:e,index:s,...t,color:u,hovered:null!==l||this.chart.legend.over===s})}finally{n.restore(),a.fill=h,a.stroke=c}if(i)return;a.fill=u}if(this.useSeriesPointer&&!d?.style&&m?.visible&&m.format)try{this.drawSeriesPointer(e,s,o,r,m,l)}finally{a.fill=h,a.stroke=c}else{switch(f){case"rectangle":if(l&&(a.stroke=l.stroke),this.chart.aspect.view3d){const t={x:o,y:r-.5*this.height-1,width:this.width,height:this.height},e=a.z,i=n.z;a.z=n.z-a.depth,a.cube(t),a.draw(n,null,t),a.z=e,n.z=i}else a.rectangle(o,r-.5*this.height-1,this.width,this.height);break;case"triangle":l&&(a.stroke=l.stroke),a.polygon([new i(o+.5*this.width,r-.5*this.height),new i(o+this.width,r+.5*this.height),new i(o,r+.5*this.height)]);break;case"ellipse":l&&(a.stroke=l.stroke),a.ellipse(o+.5*this.width,r,this.width,this.height);break;case"diamond":l&&(a.stroke=l.stroke),a.polygon([new i(o+.5*this.width,r-.5*this.height),new i(o+this.width,r),new i(o+.5*this.width,r+.5*this.height),new i(o,r)]);break;case"pill":{l&&(a.stroke=l.stroke);const{x:t,y:e}=a.round,i=.5*Math.min(this.width,this.height);a.round.x=i,a.round.y=i,a.rectangle(o,r-.5*this.height-1,this.width,this.height),a.round.x=t,a.round.y=e;break}default:n.beginPath(),n.moveTo(o,r),n.lineTo(o+this.width,r),l?l.stroke.prepare():a.stroke.prepare(a.fill),n.stroke()}a.fill=h,a.stroke=c}}drawSeriesPointer(t,e,s,o,n,a){const l=this.chart.drawContext,h=n.format;if(!h)return;const c=Math.max(1,n.width||this.width),d=Math.max(1,n.height||this.height),f=Math.min(1,this.width/c,this.height/d),u=Math.max(3,c*f),m=Math.max(3,d*f),g=s+.5*this.width,b=o,p=g-.5*u,v=b-.5*m,w=new r(p,v,u,m);if(!0===t.drawLine){const i=t.format.stroke.fill||t.legendColor(e),r=.5*u+.5*Math.max(0,t.format.stroke.size),n=g-r,h=g+r;l.beginPath(),n>s&&(l.moveTo(s,o),l.lineTo(n,o)),h<s+this.width&&(l.moveTo(h,o),l.lineTo(s+this.width,o)),a?a.stroke.prepare():t.format.stroke.prepare(i),l.stroke()}const y=h.stroke;a&&(h.stroke=a.stroke);try{switch(n.style){case"rectangle":h.rectangle(w);break;case"ellipse":default:h.ellipse(g,b,u,m);break;case"sphere":h.sphere(g,b,u,m);break;case"triangle":h.polygon([new i(g,v),new i(p,v+m),new i(p+u,v+m)]);break;case"downtriangle":h.polygon([new i(g,v+m),new i(p,v),new i(p+u,v)]);break;case"diamond":h.polygon([new i(g,v),new i(p,b),new i(g,v+m),new i(p+u,b)]);break;case"cross":l.beginPath(),l.moveTo(p,b),l.lineTo(p+u,b),l.moveTo(g,v),l.lineTo(g,v+m),h.stroke.prepare(h.fill),l.stroke();break;case"x":l.beginPath(),l.moveTo(p,v),l.lineTo(p+u,v+m),l.moveTo(p,v+m),l.lineTo(p+u,v),h.stroke.prepare(h.fill),l.stroke();break;case"cube":h.cube(w),h.draw(l,null,w);break;case"cylinder":h.cylinder(w,1,!0,!1),h.draw(l,null,w);break;case"cone":h.cylinder(w,0,!0,!1),h.draw(l,null,w)}}finally{h.stroke=y}}}class ge{ongettext;onclick;onhover;onbeforedrawLegendItem;chart;transparent=!1;useStrokeColor=!1;activeStyle="linethrough";format;title;bounds;position="right";visible=!0;inverted=!1;padding=5;margin=5;align=0;fontColor=!1;dividing;over=-1;symbol;itemHeight=10;innerOff=0;legendStyle="auto";textStyle="auto";hover;_titleHeight=0;_itemWidth=0;_itemWidths=[0,0];_itemPos={x:0,y:0};_itemRect=new r;_rMouse=new r;_cellRect=new r;itemGap=8;edgeInset=6;rowGap=0;symbolOffsetY=0;hoverBackground="";dimHidden=!1;_aligns=[!0];showHidden=!1;rows=1;perRow=0;visual=null;constructor(t){this.chart=t;const e=this.format=new n(t);e.fill="white",e.round.x=8,e.round.y=8,e.font.baseLine="top",e.shadow.visible=!0,e.z=0,e.depth=.05,this.title=new m(t),this.title.transparent=!0,this.bounds=new r;const i=this.dividing=new g(t);i.fill="",i.cap="butt",this.symbol=new me(t),this.hover=new n(t),this.hover.enabled=!0,this.hover.font.fill="red"}resetDesign(){const{visible:t,style:e,useSeriesPointer:i}=this.symbol;this.symbol=new me(this.chart),Object.assign(this.symbol,{visible:t,style:e,useSeriesPointer:i}),this.hover=new n(this.chart),this.hover.enabled=!0,this.hover.font.fill="red",this.format.shadow.visible=!0,this.itemGap=8,this.edgeInset=6,this.hoverBackground="",this.dimHidden=!1,this.rowGap=0,this.symbolOffsetY=0}rowPitch(){return this.itemHeight+this.rowGap}seriesCount(){return this.showHidden?this.chart.series.items.length:this.chart.series.visibleCount()}totalWidth(){let t=this._itemWidth+this.itemGap;const e=this.symbol;return e.visible&&(t+=e.width+e.padding),t}_space(){return this.bounds.y+this._titleHeight+this.margin*this.chart.bounds.height*.01}availRows(){let t=this._space()+.5*this.itemHeight;return t||(t=0),a((this.chart.bounds.getBottom()-t)/this.rowPitch())}itemsCount(){const t=this.chart.series;let e=this.seriesCount();const i=this.chart.bounds;if(0===e)return 0;const s=this.legendStyle;if("values"===s&&e>0)e=t.firstVisible()?.legendCount()??0;else if("auto"===s&&e>1||"series"===s)for(let i=0;i<t.items.length;i++)t.items[i].legend.visible||e--;else 1===e&&(e=t.firstVisible()?.legendCount()??0);if(this.isVertical()).5*this.itemHeight+e*this.rowPitch()>i.height-this._space()&&(e=this.availRows());else{this.rows=1;const t=this.totalWidth(),s=this.calcPadding(i),o=i.width-2*s;e*t>o?(this.perRow=a(o/t),e>this.perRow&&(this.rows=1+a(e/this.perRow),this.rows*this.rowPitch()>i.height-this.bounds.y&&(this.rows=this.availRows(),e=this.rows*this.perRow))):this.perRow=e}return e}showValues(){return"values"===this.legendStyle||"auto"===this.legendStyle&&1===this.seriesCount()}itemText(t,e){const i=t.legendText(e,this.textStyle,!1,!0);return this.ongettext?this.ongettext(this,t,e,i):i}calcItemPos(t,e){const i=this._cellRect;this.calcItemRect(t,i),e.x=this.isVertical()?i.x+i.width-this.edgeInset-this.innerOff:i.x+i.width,e.y=i.y+this.innerOff}calcItemRect(t,e){const i=this.itemHeight,s=this.bounds;e.height=i,e.x=s.x,e.y=s.y,this.isVertical()?(e.width=s.width,e.y+=.4*i+t*this.rowPitch()+this._titleHeight):(e.width=this.totalWidth(),e.x+=this.innerOff+t%this.perRow*e.width,e.y+=.25*i+a(t/this.perRow)*this.rowPitch())}mousedown(t){if(-1!==this.over&&"none"!==this.activeStyle)if(this.showValues()){const t=this.chart.series.firstVisible();t&&this.over<t.data.values.length&&(t.setPointVisible(this.over,t.isNull(this.over)),this.chart.draw())}else for(let t=0;t<this.chart.series.items.length;t++){const e=this.chart.series.items[t];if(t===this.over){e.visible=!e.visible,this.chart.draw();break}}if(this.onclick&&-1!==this.over){if(this.showValues()){const t=this.chart.series.firstVisible();t&&this.onclick(t,this.over)}else{const t=this.chart.series.items,e=t.length;let i=0;for(let s=0;s<e;s++)if(this.showHidden||t[s].visible){if(i===this.over){this.onclick(t[s],-1);break}i++}}return!0}return!1}mousemove(t){let e=this.over;if(this.bounds.contains(t)){const i=this.itemsCount();for(let s=0;s<i;s++)if(this.calcItemRect(s,this._rMouse),this._rMouse.contains(t)){e=s;break}}else e=-1;if(e!==this.over){this.onhover&&this.onhover(this.over,e),this.over=e;this.chart._scheduleDraw()}this.onclick&&(this.chart.newCursor=-1===e?"default":"pointer")}drawSymbol(t,e,i){const s=this.chart.drawContext,o=this.dimHidden&&!t.visible,r=s.globalAlpha;o&&(s.globalAlpha=.35*r);try{this.symbol.draw(t,e,i.x-this._itemWidth-this.symbol.width-this.symbol.padding,i.y+.4*this.itemHeight+this.symbolOffsetY)}finally{o&&(s.globalAlpha=r)}}drawHoverBackground(t){if(this.over!==t||!this.hover.enabled||""===this.hoverBackground||this.chart.aspect.view3d)return;const e=this._itemPos;this.calcItemPos(t,e);const i=this.symbol,s=i.visible?i.width+i.padding:0,o=this.itemHeight-2,r=e.x-this._itemWidth-s-8,n=e.y+.4*this.itemHeight-1+this.symbolOffsetY,a=this.hover;a.fill=this.hoverBackground,a.stroke.fill="",a.shadow.visible=!1,a.round.x=.5*o,a.round.y=.5*o,a.rectangle(r,n-.5*o,e.x+8-r,o)}beforeDrawItem(t,e,i){const s={text:t,index:e,r:i,symbolWidth:this.symbol.width,stopLegend:!1};return this.onbeforedrawLegendItem?.(s),s}drawItem(t,e,i,s=!1){let o=!1;const r=this.isVertical(),n=this.format,a=this._itemRect;this.showHidden="none"!==this.activeStyle,this.calcItemPos(i,this._itemPos),a.x=this._itemPos.x,a.y=this._itemPos.y,r?a.y-=this.chart.isMozilla?0:2:this.chart.isMozilla?a.y++:a.y--;const l=n.font.fill;this.drawHoverBackground(i);const h=s?e.visible:!e.isNull(i);h||"opacity"!==this.activeStyle?this.over===i?n.font.fill=this.hover.enabled&&this.hover.font.fill?this.hover.font.fill:l:this.fontColor&&(n.font.fill=this.showValues()?e.legendColor(i):e.format.fill):n.font.fill="silver","linethrough"!==this.activeStyle||h?n.font.lineThrough=!1:n.font.lineThrough=!0;const c=this.chart.graphics||this.chart.ctx;if(c){if(s){n.font.textAlign="start",a.x-=this._itemWidths[0],c.textAlign=n.font.textAlign;const s=this.beforeDrawItem(t,i,a);s.stopLegend&&(o=!0),t=s.text;const r=n.stroke.fill;if(!this.showValues()&&"checkbox"===this.activeStyle){const t=a.x-2,i=a.y+4;c.beginPath(),c.moveTo(t,i),c.lineTo(t+8.5,i),c.lineTo(t+8.5,i+8.5),c.lineTo(t,i+8.5),c.lineTo(t,i),c.strokeStyle="black",c.stroke(),c.closePath(),a.x+=12,e.visible&&(c.beginPath(),c.moveTo(t+2,i+4),c.lineTo(t+4,i+6),c.lineTo(t+7,i+3),c.stroke(),c.closePath())}c.strokeStyle=r,o||n.drawText(a,t)}else if(Array.isArray(t)||(t=[t]),r){let e=t.length;const s=a.width,r=n.textWidth(" ");for(;e--;){n.font.textAlign=this._aligns[e]?"start":"end",a.x-=this._itemWidths[e],c.textAlign=n.font.textAlign;const s=this.beforeDrawItem(t,i,a);s.stopLegend&&(o=!0),t=s.text,o||n.drawText(a,t[e]),a.width-=this._itemWidths[e]+r}a.width=s}else{n.font.textAlign="start",a.x-=this._itemWidth,c.textAlign=n.font.textAlign;const e=this.beforeDrawItem(t,i,a);e.stopLegend&&(o=!0),t=e.text,o||n.drawText(a,t.join(" "))}if(!o){n.font.fill=l;const t=!e.isColorEach||this.showValues();if(this.symbol.visible&&t&&this.drawSymbol(e,i,this._itemPos),i>0&&""!==this.dividing.fill){const t=this.bounds;if(c.beginPath(),this.isVertical())c.moveTo(t.x,a.y-2),c.lineTo(t.getRight(),a.y-2);else{let e=a.x-this._itemWidth-4;const i=this.symbol;i.visible&&(e-=i.width+i.padding),c.moveTo(e,t.y),c.lineTo(e,t.getBottom())}this.dividing.prepare(),c.stroke()}}}}drawSeries(t,e){const i=this.chart.series.items[t];return!(!this.showHidden&&!i.visible||!i.legend.visible)&&(this.drawItem(i.titleText(t),i,e,!0),!0)}draw(){let t=this.itemsCount();const e=this.title,i=this.chart.drawContext,s=this.format,o=this.format.transparency,r=this.isVertical();let n=1;if(t>0){const a=i.beginParent;if(this.visual=i.beginParent?i.beginParent():null,s.cube(this.bounds),this.transparent||s.draw(i,null,this.bounds),o>0&&(n=i.globalAlpha,i.globalAlpha=(1-o)*n),r&&this._titleHeight>0&&(e.bounds.x=this.bounds.x-4,e.bounds.y=this.bounds.y,e.doDraw()),s.font.prepare(),this._itemRect.width=this._itemWidth,this._itemRect.height=this.itemHeight,this.showValues()){const e=this.chart.series.firstVisible();if(!e)return;let i=0,s=t;switch(this.textStyle){case"auto":case"percentlabel":case"valuelabel":this._aligns=[!1,!0];break;case"labelpercent":case"labelvalue":case"valuepercent":this._aligns=[!0,!1];break;case"label":this._aligns=[!0];break;default:this._aligns=[!1]}if(this.inverted)for(;s--;)this.drawItem(this.itemText(e,s),e,i++);else for(let t=0;t<s;t++)this.drawItem(this.itemText(e,t),e,t)}else{let e=this.chart.series.count();if(r&&(e=Math.min(e,this.availRows())),t=0,this._aligns=[!0],this.inverted)for(;e--;)this.drawSeries(e,t)&&t++;else for(let i=0;i<e;i++)this.drawSeries(i,t)&&t++}o>0&&(i.globalAlpha=n),a&&i.endParent?.()}}calcWidths(){const t=this.chart.series,e=this.format;let i,s,o,r,n;if(this._itemWidth=0,this._itemWidths=[0,0],this.showValues()){if(i=t.firstVisible(),!i)return;for(r=this.itemsCount(),s=0;s<r;s++)n=this.itemText(i,s),Array.isArray(n)||(n=[n]),n.length>0&&(o=e.textWidth(n[0]),o>this._itemWidths[0]&&(this._itemWidths[0]=o),n.length>1&&(o=e.textWidth(n[1]),o>this._itemWidths[1]&&(this._itemWidths[1]=o)))}else for(r=t.count(),s=0;s<r;s++)i=t.items[s],(this.showHidden||i.visible)&&(o=e.textWidth(i.titleText(s)),o>this._itemWidths[0]&&(this._itemWidths[0]=o));this._itemWidth=this._itemWidths[0]+this._itemWidths[1]}calcPadding(t){return.01*this.padding*(this.isVertical()?t.width:t.height)}isVertical(){const t=this.position;return"right"===t||"left"===t}calcrect(){let t=0;const e=this.title,i=this.chart.chartRect,s=this.align,o=this.bounds,r=this.isVertical(),n=this.format;e.shouldDraw()?(e.resize(),this._titleHeight=e.bounds.height,t=e.bounds.width):this._titleHeight=0,r?o.y=0===s?i.y:this.chart.bounds.height*s*.01:o.x=0===s?i.x:this.chart.bounds.width*s*.01,n.font.prepare(),this.itemHeight=n.textHeight("Wj"),this.calcWidths();const a=this.calcPadding(i);let l;const h=this.itemsCount();r?(l=this.symbol.visible?this.symbol.width+this.symbol.padding:0,o.width=Math.max(t,2*this.edgeInset+this._itemWidth+l),o.height=.5*this.itemHeight+h*this.rowPitch()-this.rowGap+this._titleHeight,o.width-6>t&&(e.bounds.width=o.width-6)):(o.width=a+this.perRow*this.totalWidth(),o.x+=.5*(i.width-o.width),o.height=this.rows*this.rowPitch()-this.rowGap+.25*this.itemHeight),""!==n.stroke.fill&&(l=+n.stroke.size,l>1&&(o.width+=l,o.height+=l,this.innerOff=.5*l)),0!==h&&("right"===this.position?(o.x=i.getRight()-o.width-this.margin*o.width*.01,i.automatic&&i.setRight(Math.max(i.x,o.x-a))):"left"===this.position?(o.x=i.x,i.automatic&&i.setLeft(o.x+o.width+a)):"top"===this.position?(o.y=i.y+a,i.automatic&&i.setTop(o.getBottom()+a)):(o.y=i.getBottom()-o.height-a,i.automatic&&i.setBottom(o.y-a)))}}class be{chart;format;transparent;margins;constructor(t){this.chart=t,this.format=new n(t),this.format.round.x=12,this.format.round.y=12,this.format.stroke.size=3,this.format.gradient.visible=!0,this.format.gradient.direction="bottomtop",this.format.shadow.visible=!0,this.format.stroke.fill="#606060",this.transparent=!!t.__webgl,this.margins=new b}clear(){const t=this.chart.bounds;this.chart.renderer.clearRect(t.x,t.y,t.width,t.height)}draw(){if(this.transparent||this.chart.__webgl)return void this.clear();const t=this.chart.chartRect,e=this.format,i=e.shadow;i.visible&&(t.width-=.5*Math.abs(i.width)+2,t.height-=.5*Math.abs(i.height)+2,i.width<0&&(t.x-=i.width),i.height<0&&(t.y-=i.height));let s=0;""!==e.stroke.fill&&(s=e.stroke.size,s>1&&(s*=.5,t.x+=s,t.y+=s,t.width-=2*s,t.height-=2*s)),(i.visible||e.round.x>0||e.round.y>0)&&this.clear(),e.rectangle(t),s>0&&(t.x+=s,t.y+=s,t.width-=2*s,t.height-=2*s)}}class pe{chart;active=!1;enabled=!0;done=!1;mouseButton=2;direction="both";position=new i(0,0);constructor(t){this.chart=t}}class ve{chart;format;visible=!0;bounds;size=0;constructor(t){this.chart=t,this.format=new n(t),this.format.fill="#E6E6E6",this.format.stroke.fill="black",this.format.z=0,this.format.depth=0,this.bounds=new r}draw(){this.format.cube(this.bounds),this.format.draw(this.chart.drawContext,null,this.bounds)}}class we{chart;onreset;active=!1;enabled=!0;done=!1;touching=!1;direction="both";keepAspect=!1;mouseButton=0;wheel={enabled:!1,factor:1};old=null;_rect=new r;format;constructor(t){this.chart=t,this.format=new n(t),this.format.fill="rgba(255,255,255,0.5)",this.format.stroke.fill="darkgray",this.format.stroke.size=2}change(t){this.old||(this.old=new i(0,0));const e=this.chart.oldPos;this.old.x=t.x-e.x,this.old.y=this.keepAspect?this.old.x*(this.chart.chartRect.height/this.chart.chartRect.width):t.y-e.y}_check(){const t=this.chart.chartRect,e=this.direction,i="both"===e,s=this._rect;return s.set(t.x,t.y,t.width,t.height),this.old&&((i||"horizontal"===e)&&(this.old.x<0?(s.x=this.chart.oldPos.x+this.old.x,s.width=-this.old.x):(s.x=this.chart.oldPos.x,s.width=this.old.x)),(i||"vertical"===e)&&(this.old.y<0?(s.y=this.chart.oldPos.y+this.old.y,s.height=-this.old.y):(s.y=this.chart.oldPos.y,s.height=this.old.y))),s}draw(){this.format.rectangle(this._check())}apply(){if(!this.old)return!1;if(this.old.x<0||this.old.y<0)this.reset(),this.onreset?.(),this.chart._emit("zoomreset",this.chart);else{const t=this._check();if(t.width>3&&t.height>3){const e=this.direction,i="both"===e;return this.chart.axes.each(function(){this.horizontal?(i||"horizontal"===e)&&this.calcMinMax(t.x,t.x+t.width):(i||"vertical"===e)&&this.calcMinMax(t.y+t.height,t.y)}),!0}}return!1}reset(){this.chart.axes.each(function(){this.automatic=!0})}}const ye=new WeakMap,xe=new WeakMap,ke=new WeakSet;function Ce(t,e,i){if(ke.has(e))return e;let s=xe.get(t);s||(s=new WeakMap,xe.set(t,s));let o=s.get(e);return o||(o=i(),s.set(e,o),ke.add(o)),o}function Fe(t,e,i,s,o){const r="function"==typeof s?Ce(t,s,()=>i=>{const o=i;kt(t,"beforeEvent",[o],t.plugins)&&(s.call(e,i),kt(t,"afterEvent",[o],t.plugins))}):s;for(const e of Object.keys(t)){t[e]===s&&(t[e]=r)}e.addEventListener(i,r,o),t._eventCleanups.push(()=>e.removeEventListener(i,r,o))}function ze(t,e,i,s){const o=Ce(t,s,()=>i=>{const o=i||{};if(!kt(t,"beforeEvent",[o],t.plugins))return!1;const r=s.call(e,i);return kt(t,"afterEvent",[o],t.plugins),r});for(const e of Object.keys(t)){t[e]===s&&(t[e]=o)}let r=ye.get(e);r||(r=new Map,ye.set(e,r));let n=r.get(i);n||(n=[],r.set(i,n));const a={handler:o,previous:e[i]};n.push(a),e[i]=o,t._eventCleanups.push(()=>{e[i]===o&&(e[i]=a.previous||null);for(const t of n)t!==a&&t.previous===a.handler&&(t.previous=a.previous);const t=n.indexOf(a);-1!==t&&n.splice(t,1),0===n.length&&r.delete(i),0===r.size&&ye.delete(e)})}function Ae(t,e){if(t._twoFingersZoomCleanup)return;const i=t.interactionCanvas||t.canvas;let s,o,r,n,a,l,h,c,d=0,f=0,u=0,m=0,g=0,b=0,p=0,v=0,w=0,y=0,x=0,k=0,C=null,F=!1;function z(){if(C&&C.length>1){let A=0;const P=C[0],S=C[1];e.touching=!0,F?(s=P.pageX,r=S.pageX,o=P.pageY,n=S.pageY,s>r&&(A=s,s=r,r=A),o>n&&(A=o,o=n,n=A),g=s-a,p=o-l,b=r-h,v=n-c,f=w-g,m=x-p,d=y-b,u=k-v,w=g,x=p,y=b,k=v):(a=P.pageX,h=S.pageX,l=P.pageY,c=S.pageY,a>h&&(A=a,a=h,h=A),l>c&&(A=l,l=c,c=A),F=!0),"both"!==e.direction&&"horizontal"!==e.direction||(i=t.axes.bottom.startPos+f,z=t.axes.bottom.endPos+d,t.axes.top.calcMinMax(i,z),t.axes.bottom.calcMinMax(i,z),t.draw()),"both"!==e.direction&&"vertical"!==e.direction||function(e,i){t.axes.right.calcMinMax(e,i),t.axes.left.calcMinMax(e,i),t.draw()}(t.axes.left.startPos+m,t.axes.left.endPos+u)}var i,z}const A=()=>{F&&(F=!1),e.touching=!1};Fe(t,i,"touchend",A),Fe(t,i,"touchcancel",A),Fe(t,i,"touchmove",t=>{t.preventDefault(),C=t.touches,z()}),t._twoFingersZoomCleanup=()=>{e.touching=!1,t._twoFingersZoomCleanup=null},t._eventCleanups.push(t._twoFingersZoomCleanup)}function Pe(t){const e=t,i=t.interactionCanvas||t.canvas;e._doWheel=function(t){const e=this.chart;if(!e||e.destroyed)return;if(!e.zoom.wheel.enabled){for(const t of e.tools.items)t instanceof f&&t.active&&t.hide();return}if(!(t=t||c()?.event))return;const i=e.zoom.wheel.factor*(t.wheelDelta?t.wheelDelta/120:t.deltaY?-t.deltaY/(1===t.deltaMode?3:100):t.detail?-t.detail/3:0);if(Math.abs(i)>0){const s={x:0,y:0};e.calcMouse(t,s),e.chartRect.contains(s)&&(e.axes.each(function(){!function(t){const e=t.maximum-t.minimum;if(e>0){const s=i*e*.05;t.setMinMax(t.minimum+s,t.maximum-s)}}(this)}),e.draw(),t.returnValue=!1,t.preventDefault&&t.preventDefault());for(const t of e.tools.items)t instanceof f&&t.active&&t.mousemove(s)}};const s=e._doWheel;"function"==typeof i.addEventListener&&(Fe(t,i,"wheel",s,{passive:!1}),Fe(t,i,"DOMMouseScroll",s,!1)),ze(t,i,"onmousewheel",e._doWheel),e._doMouseOut=function(t){this.chart&&!this.chart.destroyed&&(t?.target?.setCapture||(this.chart.scroll.active=!1),this.chart.domTip.stop(this.chart),this.chart.series.mouseout(),this.chart.tools.mouseout())},ze(t,i,"onmouseout",e._doMouseOut),Fe(t,i,"pointerleave",()=>t.domTip.stop(t))}const Se={move:"onpointermove",down:"onpointerdown",up:"onpointerup",cancel:"onpointercancel",leave:"onmouseout",wheel:"onmousewheel"};function _e(t){return t}function Me(t){if(t.visible&&t.firstSeries){const e=t.format.stroke;return""===e.fill?0:.5*e.size}return 0}class Te{chart;items;constructor(t){this.chart=t,this.items=[]}add(t){return this.items.includes(t)||this.items.push(t),t}remove(t,e=!1){const i=this.items.indexOf(t);return-1!==i&&(this.items.splice(i,1),e&&t.destroy?.(),!0)}clear(t=!1){if(t)for(const t of this.items)t?.destroy?.();return this.items.length=0,this}destroy(){this.clear(!0)}count(){return this.items.length}clicked(t){let e=!1;const i=this.chart._hasListeners("seriesclick");return this.each(s=>{const o=s;if(!o.visible)return;if(!o.onclick&&!i&&!o._hasListeners("click"))return;const r=o.clicked(t);-1!==r&&(o.onclick&&(e=o.onclick(o,r,t.x,t.y)),o._emit("click",o,r,t.x,t.y),this.chart._emit("seriesclick",o,r,t.x,t.y))}),e}mousedown(t){let e=!1;for(let i=0;i<this.items.length;i++){const s=_e(this.items[i]);if(!s)break;s.visible&&s.mousedown(t)&&(e=!0)}return e}mousemove(t){for(let e=0;e<this.items.length;e++){const i=this.items[e];if(!i)break;i.visible&&i.mousemove(t)}}mouseout(){this.each(t=>{t.visible&&t.mouseout()})}visibleCount(t,e,i){let s=0;for(let o=this.items.length-1;o>=0;o--){const r=this.items[o];r.visible&&(!e||r instanceof e)&&(i&&r===t&&(i.index=s),s++)}return i&&(i.total=s,i.index=s-1-i.index),s}beforeDraw(){this.each(t=>{t.useAxes&&t.recalcAxes(),t.calcColorEach()})}anyUsesAxes(){for(let t=this.items.length-1;t>=0;t--){const e=this.items[t];if(e.visible&&e.useAxes)return!0}return!1}firstVisible(){for(const t of this.items)if(t.visible)return t;return null}vertMargins(){if(0===this.items.length)return;const t={x:0,y:0},e={x:0,y:0};this.items[0].vertMargins(t);for(let i=1;i<this.items.length;i++){const s=this.items[i];s.data.values.length>0&&(e.x=0,e.y=0,_e(s).vertMargins(e),e.x>t.x&&(t.x=e.x),e.y>t.y&&(t.y=e.y))}return t}horizMargins(){if(0===this.items.length)return;const t={x:0,y:0},e={x:0,y:0};this.items[0].horizMargins(t);for(let i=1;i<this.items.length;i++){const s=this.items[i];s.data.values.length>0&&(e.x=0,e.y=0,_e(s).horizMargins(e),e.x>t.x&&(t.x=e.x),e.y>t.y&&(t.y=e.y))}return t}minXValue(t){let e=1/0;return this.eachAxis(t,t=>{const i=t.minXValue();i<e&&(e=i)}),e}minYValue(t){let e=1/0;return this.eachAxis(t,t=>{const i=t.minYValue();i<e&&(e=i)}),e}maxXValue(t){let e=-1/0;return this.eachAxis(t,t=>{const i=t.maxXValue();i>e&&(e=i)}),e}maxYValue(t){let e=-1/0;return this.eachAxis(t,t=>{const i=t.maxYValue();i>e&&(e=i)}),e}draw(){if(0===this.items.length||!this.chart.ctx)return;const t=this.chart.ctx,{aspect:e,axes:i,chartRect:s}=this.chart;for(const t of this.items){const e=_e(t);e.visible&&e.beforeDraw&&e.beforeDraw()}const o=e.clip&&this.anyUsesAxes();if(o){const t=new r(s.x+Me(i.left),s.y+Me(i.top),s.width-Me(i.right),s.height-Me(i.bottom));e.clipRect(t)}try{const e=t.beginParent;for(let i=0;i<this.items.length;i++){const s=_e(this.items[i]);if(!s.visible)continue;if(!xt(this.chart,"beforeSeriesDraw",t,this.chart.plugins,s,i))continue;const o=t.globalAlpha;t.globalAlpha=1-s.format.transparency,s.transform&&(t.save(),s.transform()),s.visual=e?e():null,s.onbeforedraw?.(s),s.draw(),e&&t.endParent?.(),s.ondraw?.(s),s._emit("draw",s),s.transform&&t.restore(),t.globalAlpha=o,xt(this.chart,"afterSeriesDraw",t,this.chart.plugins,s,i)}}finally{o&&t.restore()}for(const e of this.items){const i=_e(e);i.visible&&i.marks.visible&&(i.transform&&(t.save(),i.transform()),i.drawMarks(),i.transform&&t.restore())}}each(t){for(const e of this.items)t(e)}eachAxis(t,e){for(let i=this.items.length-1;i>=0;i--){const s=_e(this.items[i]);s.visible&&(!t||s.associatedToAxis(t))&&(s.__alwaysDraw||s.count()>0)&&e(s)}}}class De{chart;items;constructor(t){this.chart=t,this.items=[]}draw(){this.forEachActive(t=>{t instanceof f&&void 0!==t.currP&&t.realTime?t.mousemove(t.currP):t.draw()})}mousemove(t){this.forEachActive(e=>{e instanceof f&&(e.currP=void 0),e.mousemove(t)})}mousedown(t){let e=!1;return this.forEachActive(i=>{i.mousedown(t)&&(e=!0)}),e}mouseout(){this.forEachActive(t=>t.mouseout())}clicked(t){let e=!1;for(let i=this.items.length-1;i>=0;i--){const s=this.items[i];if(s.active&&s.clicked(t)){e=!0;const i=s;i.onclick&&(e=i.onclick(s,t.x,t.y))}}return e}add(t){if(!(t instanceof w))throw new TypeError("Tools.add requires a Tool instance");if(t.chart!==this.chart)throw new Error("A Tool belongs to the Chart it was created with; create a new Tool for another Chart");return this.items.includes(t)||("setChart"in t&&"function"==typeof t.setChart&&t.setChart(this.chart),this.items.push(t)),t}remove(t,e=!1){const i=this.items.indexOf(t);return-1!==i&&(this.items.splice(i,1),e&&t.destroy?.(),!0)}clear(t=!1){if(t)for(const t of this.items)t?.destroy?.();return this.items.length=0,this}destroy(){this.clear(!0)}forEachActive(t){for(const e of this.items)e.active&&t(e)}}class Ee{interactionCanvas;renderer;ctx=null;graphics=null;reflectionColor;ondraw;onhover;_events;_stopWatchingPixelRatio;isNLc=!1;_eventCleanups;_animations;_twoFingersZoomCleanup;_drawFrameHandle;_updateDepth;_updatePending;destroyed;isChrome;isAndroid;isMozilla;language;__webgl;bounds;chartRect;palette;aspect;panel;walls;axes;legend;series;title;subtitle;footer;subfooter;zoom;scroll;tools;domTip;plugins;pluginOptions={};newCursor=null;constructor(t,e,s){this._eventCleanups=[],this._animations=new Set,this._twoFingersZoomCleanup=null,this._drawFrameHandle=null,this.destroyed=!1,this._updateDepth=0,this._updatePending=!1,this.domTip=new y;let o=!1;const n=c(),a=z(),l=M(),h=n,u=l,m=l?.userAgent?.toLowerCase()||"";this.isChrome=m.indexOf("chrome")>-1,this.isAndroid=m.indexOf("android")>-1,this.isMozilla=!!h?.mozRequestAnimationFrame,this.language=u?.userLanguage||l?.language||"";const g=function(t){if(!t||"object"!=typeof t)return!1;const e=t;return"function"==typeof e.isEnabled&&!!e.renderer?.domElement}(t)?t:null;if(g?(this.canvas=t,this.interactionCanvas=g.renderer?.domElement):t&&(x(t)?this.canvas=t:this.canvas="string"==typeof t?a?.getElementById(t):t),!this.canvas){if(!a)throw new Error("Tee.Chart requires a canvas or a document");this.canvas=a.createElement("canvas"),o=!0}const b=this.canvas;this.renderer=g?{getContext:()=>g,setContext:()=>{},clearRect:()=>g.clearRect?.()}:new k(b),o&&this.renderer instanceof k&&this.renderer.resize(600,400),this.__webgl=g?g.isEnabled?.()||!1:b.__webgl??!1;const w=this.renderer instanceof k?this.renderer.getSize():{width:b.width,height:b.height},A=this.renderer instanceof k?this.renderer.getClientSize():{width:b.clientWidth,height:b.clientHeight};b.__webgl||0===A.width?this.bounds=new r(0,0,w.width,w.height):(this.bounds=new r(0,0,A.width,A.height),this.renderer instanceof k?this.renderer.resize(A.width,A.height):(b.width=A.width,b.height=A.height)),this.chartRect=new r,this.chartRect.automatic=!0,this.chartRect.setFrom(this.bounds),this.palette=new C(["#4466a3","#f39c35","#f14c14","#4e97a8","#2b406b","#1d7b63","#b3080e","#f2c05d","#5db79e","#707070","#f3ea8d","#b4b4b4"]),this.aspect={chart:this,view3d:this.__webgl,orthogonal:!this.__webgl,get ortogonal(){return this.orthogonal},set ortogonal(t){this.orthogonal=t},rotation:0,elevation:315,perspective:50,clip:!0,_orthox:10,_orthoy:8,clipRect:function(t){const e=this.chart.drawContext;e.save(),e.beginPath(),this.view3d?e.rect(t.x,t.y-this._orthoy,t.width+this._orthox,t.height+this._orthoy):e.rect(t.x,t.y,t.width,t.height),e.clip()}},this.panel=new be(this),this.walls={chart:this,visible:!0,left:new ve(this),right:new ve(this),bottom:new ve(this),back:new ve(this),draw:function(t,e){const i=this.chart.drawContext,s=this.transparency??0,o=i.beginParent;let r;this.visual=i.beginParent?i.beginParent():null,s>0&&(r=i.globalAlpha,i.globalAlpha=(1-s)*r);const n=this.back.bounds;if(n.setFrom(t),e.view3d){const e=this.bottom.visible?this.bottom.size:0,i=this.left.size;i>0&&(n.x-=i,n.width+=i),e>0&&(n.height+=e),this.left.bounds.set(t.x-i,t.y,i,t.height+e),this.bottom.bounds.set(t.x,t.getBottom(),t.width,e),this.back.format.depth=this.back.size}!this.back.visible||this.back.draw(),this.chart.aspect.view3d&&(this.left.visible&&this.left.draw(),this.bottom.visible&&this.bottom.draw(),this.right.visible&&this.right.draw()),s>0&&void 0!==r&&(i.globalAlpha=r),o&&i.endParent?.()}};const P=this.walls.back.format;P.fill="rgb(240,240,240)",P.shadow.visible=!0,P.z=1;const S=this.walls.left;S.format.fill="#BBAA77",S.format.depth=1,S.size=2;const _=this.walls.bottom;if(_.format.depth=1,_.size=2,this.walls.right.visible=!1,this.axes=new ue(this),this.legend=new ge(this),this.series=new Te(this),this.title=new F(this,"blue"),this.title.text="TeeChart",this.title.visible=!1,this.title.format.z=1,this.subtitle=new F(this,"blue"),this.subtitle.format.z=1,this.footer=new F(this,"red"),this.footer.format.z=0,this.subfooter=new F(this,"red"),this.subfooter.format.z=0,this.zoom=new we(this),this.scroll=new pe(this),g&&(this.zoom.enabled=!1,this.scroll.enabled=!1),this.tools=new De(this),this.tools.add(new f(this)),function(t){const e=t,s=t.interactionCanvas||t.canvas,o=new i(0,0),r=new i(0,0);let n=null,a=0;function l(t){const e=t?.type||"";return e.startsWith("pointer")?(a=Date.now(),!1):(e.startsWith("mouse")||e.startsWith("touch"))&&Date.now()-a<800}function h(t){null===n&&(n=d(()=>{n=null,t.destroyed||t.draw()}))}e.oldPos=new i,e.calcMouse=function(t,e){const{clientX:i,clientY:s}=t;e.x=i,e.y=s;let o=this.interactionCanvas||this.canvas;if(o.getBoundingClientRect){const t=o.getBoundingClientRect();e.x-=t.left,e.y-=t.top}else if(o.offsetParent)do{e.x-=o.offsetLeft,e.y-=o.offsetTop,o=o.offsetParent}while(o)},e.domousemove=function(t){const e=this.chart;if(!e?.ctx||e.destroyed)return!1;if(l(t=t||c()?.event))return!1;if(!t)return!1;if(t.touches&&(t=t.touches[t.touches.length-1]),e.calcMouse(t,o),e.scroll.active){const i=e.scroll.direction,s="both"===i;if(s||"horizontal"===i){const t=e.axes.bottom.fromSize(e.oldPos.x-o.x);e.axes.top.scroll(t),e.axes.bottom.scroll(t)}if(s||"vertical"===i){const t=-e.axes.left.fromSize(e.oldPos.y-o.y);e.axes.left.scroll(t),e.axes.right.scroll(t)}return e.oldPos.x=o.x,e.oldPos.y=o.y,e.scroll.done=!0,e.onscroll&&e.onscroll(t),e._emit("scroll",t),e.scroll.done&&h(e),!1}if(e.zoom.active)return o.x===e.oldPos.x&&o.y===e.oldPos.y||(e.zoom.change(o),h(e),e.zoom.done=!0),!1;e.newCursor=null,e.tools.mousemove(o),e.series.mousemove(o),e.legend.mousemove(o),e.title.mousemove(o),e.mousemove&&e.mousemove(o);const i=(e.interactionCanvas||e.canvas).style;return!i||(e.newCursor?i.cursor!==e.newCursor&&(e.oldCursor=i.cursor,i.cursor=e.newCursor):void 0!==e.oldCursor&&i.cursor!==e.oldCursor&&(i.cursor=e.oldCursor),!0)},e.domousedown=function(t){t=t||c()?.event;const e=this.chart;if(!t||!e||e.destroyed)return!1;if(l(t))return!1;const i=t.touches?t.touches[0]:t;e.calcMouse(i,r);const s=e.series.anyUsesAxes()&&e.chartRect.contains(r);t.touches&&(p(e),e.zoom.enabled&&Ae(e,e.zoom)),t.touches?t.touches.length>1?e.scroll.active=!1:(e.scroll.active=e.scroll.enabled&&s,e.scroll.active&&(e.zoom.active=!1)):(e.zoom.active=t.button===e.zoom.mouseButton&&e.zoom.enabled&&s,e.scroll.active=t.button===e.scroll.mouseButton&&e.scroll.enabled&&s),e.zoom.done=!1,e.scroll.done=!1,e.oldPos=r;let o=!1;if(void 0===t.button||0===t.button?(o=e.tools.mousedown(t),o||(o=e.series.mousedown(t)),o||(o=e.legend.mousedown(t)),!o&&e.mousedown&&(o=e.mousedown(t)),(e.interactionCanvas||e.canvas).oncontextmenu=null):2===t.button&&((e.interactionCanvas||e.canvas).oncontextmenu=()=>!1),o?e.zoom.active=e.scroll.active=!1:o=e.zoom.active||e.scroll.active,t.preventDefault?t.preventDefault():t.cancelBubble=!0,o){const e=t.target||t.fromElement;e?.setPointerCapture&&t.pointerId&&e.setPointerCapture(t.pointerId)}return!o},e.domouseup=function(t){t=t||c()?.event;const e=this.chart;if(!t||!e||e.destroyed)return;if(l(t))return;let i;e.zoom.active=!1,e.scroll.active=!1,e.zoom.done&&!e.zoom.touching?(e.zoom.apply()&&(e.onzoom?.(),e._emit("zoom",e)),e.draw(),i=!0):(i=e.scroll.done,i||(i=e.series.clicked(e.oldPos)),i||(i=e.tools.clicked(e.oldPos)),i||(i=e.title.clicked(e.oldPos),i&&e.title.onclick&&e.title.onclick(e.title)),!i&&e.mouseup&&(i=e.mouseup(t))),e.zoom.old=null,e.zoom.done=!1,e.scroll.done=!1,i&&t.preventDefault?t.preventDefault():i?t.cancelBubble=!0:(e.interactionCanvas||e.canvas).oncontextmenu=null;const s=t.target||t.fromElement;s?.releasePointerCapture&&t.pointerId&&s.releasePointerCapture(t.pointerId)},e.domousecancel=function(t){const e=this.chart;if(!e)return;if(l(t))return;e.zoom.active=!1,e.zoom.done=!1,e.zoom.touching=!1,e.zoom.old=null,e.scroll.active=!1,e.scroll.done=!1;const i=t?.target||t?.fromElement;i?.releasePointerCapture&&t?.pointerId&&i.releasePointerCapture(t.pointerId)},ze(t,s,"onpointerdown",e.domousedown),ze(t,s,"onpointerup",e.domouseup),ze(t,s,"onpointermove",e.domousemove),ze(t,s,"onpointercancel",e.domousecancel),ze(t,s,"onlostpointercapture",e.domousecancel),ze(t,s,"onmousedown",e.domousedown),ze(t,s,"onmouseup",e.domouseup),ze(t,s,"onmousemove",e.domousemove),ze(t,s,"ontouchstart",e.domousedown),ze(t,s,"ontouchend",e.domouseup),ze(t,s,"ontouchmove",e.domousemove),ze(t,s,"ontouchcancel",e.domousecancel),t._eventCleanups.push(()=>{null!==n&&v(n),n=null})}(this),Pe(this),b.chart=this,this.interactionCanvas&&this.interactionCanvas!==b){const t=this.interactionCanvas;t.chart=this,this._eventCleanups.push(()=>{t.chart===this&&delete t.chart})}const T=t=>{const e=s||Et;this.addSeries(new e(this)).data.values=t},D=jt(e)?e:void 0;if(!D&&Array.isArray(e)&&e.length>0)if(Array.isArray(e[0])){const t=e;for(let e=0;e<t.length;e++)T(t[e])}else T(e);this.plugins=D?.plugins??[],function(t,e=[]){if(ut.has(t))return;const i=bt(e);ut.set(t,i),I(t,i.values())}(this,this.plugins),D&&le(this,D,!0),kt(this,"beforeInit",[],this.plugins),kt(this,"afterInit",[],this.plugins)}draw(t){const e=this.series,i=this.chartRect,s=t??this.renderer.getContext();if(!s)throw new Error("Canvas does not provide Context");if(this.ctx=s,this.renderer.setContext(s),!t&&this.renderer instanceof k&&this.renderer.applyTransform(s),this.graphics=this.renderer.getGraphics?this.renderer.getGraphics():null,i.automatic&&i.setFrom(this.bounds),!kt(this,"beforeRender",[s],this.plugins))return;if(!xt(this,"beforeDraw",s,this.plugins))return;let o=!1,r=!1,a=1,l=0;const h=e.visibleCount();for(let t=e.items.length-1;t>=0;t--){const i=e.items[t];i.visible&&(i.initZ(l,h),l++,i._paintAxes&&(o=!0),i._paintWalls&&(r=!0),i.maxZ&&i.maxZ>a&&(a=i.maxZ))}this.walls.left.format.depth=a,this.walls.bottom.format.depth=a,this.walls.back.format.z=a,this.panel.draw(),i.automatic&&this.panel.margins.apply(i),xt(this,"afterPanelDraw",s,this.plugins),this.title.tryDraw(!0),this.subtitle.tryDraw(!0),this.footer.tryDraw(!1),this.subfooter.tryDraw(!1),e.beforeDraw(),this.legend.visible&&(this.legend.calcrect(),this.legend.draw()),this.aspect.view3d&&!this.__webgl&&(i.y+=this.aspect._orthoy,i.height-=this.aspect._orthoy,i.width-=this.aspect._orthox);const c=this.axes;let d=1;if(e.anyUsesAxes()){const t=kt(this,"beforeScaleUpdate",[],this.plugins);if(t&&(c.each(u.adjustRect),c.each(u.calcRect)),this.walls.visible&&r&&this.walls.draw(i,this.aspect),c.visible&&o){c.transparency>0&&(d=s.globalAlpha,s.globalAlpha=(1-c.transparency)*d);const t=s.beginParent;c.visual=s.beginParent?s.beginParent():null,c.each(u.draw),t&&s.endParent?.(),c.transparency>0&&(s.globalAlpha=d)}t&&kt(this,"afterScaleUpdate",[],this.plugins)}if(xt(this,"afterAxesDraw",s,this.plugins),this.series.draw(),kt(this,"afterAllSeriesDraw",[s],this.plugins),this.tools.draw(),this.zoom.active&&!this.zoom.touching&&this.zoom.draw(),xt(this,"afterDraw",s,this.plugins),this.ondraw&&this.ondraw(this),this._emit("draw",this),kt(this,"afterRender",[s],this.plugins),this.isNLc){const t=new n(this),e="TeeChart Evaluation (c)Steema Software 2021",i=this.ctx;i.save(),i.font="13px Courier";const s=t.textWidth(e),o={x:this.chartRect.x+this.chartRect.width/2-s/2,y:this.bounds.height/2,width:s,height:t.textHeight("H")};i.translate(this.chartRect.x+this.chartRect.width/2,this.bounds.height/2),i.rotate(-30*Math.PI/180),i.translate(-(this.chartRect.x+this.chartRect.width/2),-this.bounds.height/2),t.font.fill="rgba(64,108,128, 0.55)",t.drawText(o,e),i.restore()}}batchUpdate(t){if("function"!=typeof t)throw new TypeError("Chart.batchUpdate requires a callback");if(this.destroyed)return t(this);this._updateDepth++;try{return t(this)}finally{this._updateDepth--,0===this._updateDepth&&this._updatePending&&(this._updatePending=!1,this.draw())}}get drawContext(){if(!this.ctx)throw new Error("The chart has no drawing context yet: draw it first");return this.ctx}_requestDraw(){this.destroyed||(this._updateDepth>0?this._updatePending=!0:this.draw())}_scheduleDraw(){this.destroyed||null!==this._drawFrameHandle||(this._drawFrameHandle=d(()=>{this._drawFrameHandle=null,this._requestDraw()}))}addSeries(t){const e=t.chart;e&&e!==this&&e.removeSeries(t),t.setChart(t,this);const i=t;null!=i.donutArray&&"undefined"!==i.donutArray&&i.linkDonutsToChart?.();const s=this.series.items.indexOf(t),o=-1===s?this.series.items.length:s;this.series.add(t),""===t.title&&(t.title=`Series${(1+o).toString()}`);const r=this.palette.get(o);return""===t.format.fill&&void 0!==r&&(t.format.fill=r),function(t,e,i){J.get(t)?.styleSeries(e,i)}(this,t,o),t}removeSeries(t,e=!1){return this.series.remove(t,e)}getSeries(t){return this.series.items[t]}resize(t,e){const i=this.canvas,s=this.renderer instanceof k?this.renderer.getSize():{width:i.width,height:i.height},o=this.renderer instanceof k?this.renderer.getClientSize():{width:i.clientWidth,height:i.clientHeight},r=t||o.width||s.width,n=e||o.height||s.height;if(r>0&&n>0){if(!kt(this,"beforeResize",[r,n],this.plugins))return this;this.renderer instanceof k?this.renderer.resize(r,n):(i.width!==r&&(i.width=r),i.height!==n&&(i.height=n)),this.bounds.set(0,0,r,n),this.chartRect.setFrom(this.bounds),this.draw(),this._emit("resize",r,n),kt(this,"afterResize",[r,n],this.plugins)}return this}get pixelRatio(){return this.renderer instanceof k?this.renderer.pixelRatio:1}setPixelRatio(t){return this._applyPixelRatio(t)&&this._requestDraw(),this}_applyPixelRatio(t){if(!(this.renderer instanceof k)||this.destroyed)return!1;"auto"===t?this._watchDevicePixelRatio():this._unwatchDevicePixelRatio();const e="auto"===t?c()?.devicePixelRatio||1:t;return this.renderer.pixelRatio!==e&&(this.renderer.setPixelRatio(e),this.renderer.resize(this.bounds.width,this.bounds.height),!0)}_watchDevicePixelRatio(){this._unwatchDevicePixelRatio();const t=c();if("function"!=typeof t?.matchMedia)return;const e=t.matchMedia(`(resolution: ${t.devicePixelRatio||1}dppx)`),i=()=>{this._applyPixelRatio("auto")&&this._requestDraw()};e.addEventListener?.("change",i),this._stopWatchingPixelRatio=()=>e.removeEventListener?.("change",i)}_unwatchDevicePixelRatio(){this._stopWatchingPixelRatio?.(),this._stopWatchingPixelRatio=void 0}update(){!this.destroyed&&kt(this,"beforeUpdate",[],this.plugins)&&(this.draw(),kt(this,"afterUpdate",[],this.plugins))}setOptions(t){if(!jt(t))throw new TypeError("Chart.setOptions requires an options object");return this.destroyed||!kt(this,"beforeUpdate",[],this.plugins)||(le(this,t,!1),this._requestDraw(),kt(this,"afterUpdate",[],this.plugins)),this}resetOptions(t){return this.destroyed||!kt(this,"beforeUpdate",[],this.plugins)||(function(t,e){const i=ie.get(t);if(!i)return;const s=e??Object.keys(he),o={};for(const t of s)if(!(t in he))throw new TypeError(`The "${t}" option cannot be reset`);for(const t of s){delete i.options[t];const e=he[t];void 0!==e&&Object.assign(o,{[t]:oe(e)})}s.includes("palette")&&void 0===o.theme&&(o.theme=Vt),le(t,o,!1)}(this,t),this._requestDraw(),kt(this,"afterUpdate",[],this.plugins)),this}setPluginEnabled(t,e){return this.destroyed||function(t,e,i){const s=ut.get(t)?.get(e);if(!s)throw new Error(`Plugin "${e}" is not attached to this chart`);if(!1!==t.pluginOptions[e]===i)return;const o=!!i&&(pt.get(t)?.get(e)??{});t.setOptions({pluginOptions:{[e]:o}})}(this,t,e),this}getOptions(){return function(t){const e=ie.get(t)?.options??{},{plugins:i,...s}=e;return{...oe(s),...i?{plugins:i}:{}}}(this)}toImage(t,e,i){const s=z()?.getElementById(t);if(!s)return;const o=this.renderer instanceof k?""!==e?this.renderer.toDataURL(e,i):this.renderer.toDataURL():void 0;s.src=o||(""!==e?this.canvas.toDataURL(e,i):this.canvas.toDataURL())}toBlob(t,e){return this.renderer instanceof k?this.renderer.toBlob(t,e):Promise.reject(new Error("This chart cannot be encoded as a Blob"))}dispatchPointerEvent(t,e){return function(t,e,i){const s=t.interactionCanvas||t.canvas,o=s[Se[e]];return"function"==typeof o&&!t.destroyed&&(o.call(s,{type:"wheel"===e?"wheel":"leave"===e?"mouseout":`pointer${e}`,clientX:i.x,clientY:i.y,button:i.button??0,pointerId:i.pointerId,deltaY:i.deltaY??0,deltaMode:0,preventDefault:()=>{}}),!0)}(this,t,e)}destroy(){if(this.destroyed)return;let t,e=!1;const i=i=>{try{i()}catch(i){e||(t=i),e=!0}};i(()=>kt(this,"beforeDestroy",[],this.plugins)),i(()=>this._emit("destroy",this)),this._events?.clear(),this.destroyed=!0,null!==this._drawFrameHandle&&i(()=>v(this._drawFrameHandle)),this._drawFrameHandle=null,i(()=>this.tools.destroy()),i(()=>this.series.destroy()),i(()=>this.domTip.stop(this));for(const t of this._animations)i(()=>t.cancel());this._animations.clear(),i(()=>this._unwatchDevicePixelRatio());for(let t=this._eventCleanups.length-1;t>=0;t--)i(()=>this._eventCleanups[t]());if(this._eventCleanups.length=0,i(()=>kt(this,"afterDestroy",[],this.plugins)),e)throw t}on(t,e){return(this._events??=new A).on(t,e)}once(t,e){return(this._events??=new A).on(t,e,!0)}off(t,e){this._events?.off(t,e)}_hasListeners(t){return this._events?.has(t)??!1}_emit(t,...e){this._events?.emit(t,...e)}drawReflection(){const t=this.drawContext,e=this.bounds.height;t.scale(1,-1),t.translate(0,2*-e),this.ondraw=void 0,this.draw(),t.translate(0,2*e),t.scale(1,-1);const i=(this.renderer instanceof k?this.renderer.getSize():{width:this.canvas.width,height:this.canvas.height}).height-e,s=e,o=t.createLinearGradient(0,s,0,s+i),r=this.reflectionColor;o.addColorStop(0,P(r,.5)),o.addColorStop(1,P(r,1)),t.fillStyle=o,t.beginPath(),t.shadowColor="transparent",t.rect(0,s,this.bounds.width,i),t.fill(),this.ondraw=this.drawReflection}fromTable(t,e,i,s,o){function r(t,e){if(e){const i=_(e);""===t.title.text?t.title.text=i:t.footer.text=i}}const n=S(t)?t:z()?.getElementById(t);if(n){if(null===s&&(s=-1),null===o&&(o=-1),this.series.items=[],i){if(s>-1){const t=n.rows[s];if(t){for(let i=o+1;i<t.cells.length;i++){const s=t.cells[i];this.addSeries(new e).title=_(s)}o>-1&&r(this,t.cells[o])}}else{const t=n.rows[0];if(t)for(let i=o+1;i<t.cells.length;i++)this.addSeries(new e).title=`Series ${i.toFixed(0)}`}for(let t=s+1;t<n.rows.length;t++){const e=n.rows[t];for(let t=o+1;t<e.cells.length;t++){const i=e.cells[t],s=_(i),r=""===s?null:parseFloat(s);this.series.items[t-o-1].data.values.push(r)}if(o>-1){const t=_(e.cells[o]);this.series.each(e=>{e.data.labels.push(t)})}}}else{for(let t=s+1;t<n.rows.length;t++){const i=n.rows[t];for(let r=Math.max(o,0);r<i.cells.length;r++){const n=i.cells[r];if(r===o)this.addSeries(new e).title=_(n);else{const e=_(n),i=""===e?null:parseFloat(e);this.series.items[t-s-1].data.values.push(i)}}}if(s>-1){const t=n.rows[s];if(t){for(let e=o+1;e<t.cells.length;e++){const i=t.cells[e];this.series.each(t=>{t.data.labels.push(_(i))})}o>-1&&r(this,t.cells[o])}}}this.draw()}}applyTheme(t){!function(t,e){const i=e||"default",s=H.get(t)?.themes.get(i)??tt[i]??tt.default;t.legend.resetDesign(),s(t),Object.hasOwn(K,i)&&tt[i]===Q[i]?J.set(t,K[i]):J.delete(t),t.themeName=i,t.draw()}(this,t)}applyPalette(t){!function(t,e){if("string"==typeof e){const i=H.get(t)?.palettes.get(e)??et[e];i?t.palette.colors=[...i]:U(t,e)}else t.palette.colors=Array.isArray(e)?e:e.colors;t.draw()}(this,t)}}export{Tt as A,Et as B,Ee as C,Wt as D,ge as L,be as P,pe as S,ve as W,we as Z,ue as a,Rt as b,Dt as c,Mt as d,me as e,Nt as f,Bt as g,Ot as h,Te as i,fe as j,St as k,X as l,wt as m,q as n,yt as o,Pt as p,nt as q,zt as r,G as s,Ut as t,Z as u,Xt as v};
|
|
16
|
+
//# sourceMappingURL=chart-p639xVyw.js.map
|