p1-charts 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +158 -4
  3. package/dist/CategoryBarChart-KYzsjGwg.js +715 -0
  4. package/dist/CategoryBarChart-KYzsjGwg.js.map +1 -0
  5. package/dist/ChartFrame-DOEsou-R.js +403 -0
  6. package/dist/ChartFrame-DOEsou-R.js.map +1 -0
  7. package/dist/ChartLegend-B8ZmIG2y.js +46 -0
  8. package/dist/ChartLegend-B8ZmIG2y.js.map +1 -0
  9. package/dist/{Heatmap-C1XcTUg1.js → Heatmap-Bwhf305C.js} +278 -272
  10. package/dist/Heatmap-Bwhf305C.js.map +1 -0
  11. package/dist/{PieLegend-BZsv9IbF.js → PieLegend-16E6W10x.js} +94 -111
  12. package/dist/PieLegend-16E6W10x.js.map +1 -0
  13. package/dist/PolarChart-C_vPz-3K.js +489 -0
  14. package/dist/PolarChart-C_vPz-3K.js.map +1 -0
  15. package/dist/Sparkline-BApLVWfg.js +110 -0
  16. package/dist/Sparkline-BApLVWfg.js.map +1 -0
  17. package/dist/{TimeSeriesChart-BIwJxgnD.js → TimeSeriesChart-BZMLERDZ.js} +530 -529
  18. package/dist/{TimeSeriesChart-BIwJxgnD.js.map → TimeSeriesChart-BZMLERDZ.js.map} +1 -1
  19. package/dist/category.d.ts +5 -2
  20. package/dist/category.d.ts.map +1 -1
  21. package/dist/category.js +4 -3
  22. package/dist/charts/CategoryBarChart/index.d.ts +3 -1
  23. package/dist/charts/CategoryBarChart/index.d.ts.map +1 -1
  24. package/dist/charts/Heatmap/index.d.ts.map +1 -1
  25. package/dist/charts/PolarChart/index.d.ts.map +1 -1
  26. package/dist/charts/ScatterChart/index.d.ts +1 -1
  27. package/dist/charts/ScatterChart/index.d.ts.map +1 -1
  28. package/dist/charts/Sparkline/index.d.ts +5 -2
  29. package/dist/charts/Sparkline/index.d.ts.map +1 -1
  30. package/dist/components/ChartFrame/index.d.ts +7 -0
  31. package/dist/components/ChartFrame/index.d.ts.map +1 -0
  32. package/dist/components/ChartLegend/index.d.ts +13 -0
  33. package/dist/components/ChartLegend/index.d.ts.map +1 -0
  34. package/dist/components/ChartStory/index.d.ts +7 -0
  35. package/dist/components/ChartStory/index.d.ts.map +1 -0
  36. package/dist/components/HeatmapCells/index.d.ts +1 -1
  37. package/dist/components/HeatmapCells/index.d.ts.map +1 -1
  38. package/dist/{css-C-rsk7-l.js → css-BTZA9hea.js} +2 -2
  39. package/dist/{css-C-rsk7-l.js.map → css-BTZA9hea.js.map} +1 -1
  40. package/dist/heatmap.js +1 -1
  41. package/dist/hooks/useMarkMemory.d.ts +9 -0
  42. package/dist/hooks/useMarkMemory.d.ts.map +1 -0
  43. package/dist/hooks/usePieTween.d.ts.map +1 -1
  44. package/dist/hooks/useSteps.d.ts +4 -0
  45. package/dist/hooks/useSteps.d.ts.map +1 -0
  46. package/dist/hooks/useTween.d.ts +12 -0
  47. package/dist/hooks/useTween.d.ts.map +1 -0
  48. package/dist/index.d.ts +16 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +122 -117
  51. package/dist/index.js.map +1 -1
  52. package/dist/motion.utils-DFoqptDi.js +55 -0
  53. package/dist/motion.utils-DFoqptDi.js.map +1 -0
  54. package/dist/pie.js +1 -1
  55. package/dist/scatter.d.ts +4 -1
  56. package/dist/scatter.d.ts.map +1 -1
  57. package/dist/scatter.js +3 -2
  58. package/dist/series.js +1 -1
  59. package/dist/{tooltip.utils-D7xaBSUK.js → shared-C1pGJV4T.js} +3 -7
  60. package/dist/shared-C1pGJV4T.js.map +1 -0
  61. package/dist/sparkline.d.ts +1 -1
  62. package/dist/sparkline.d.ts.map +1 -1
  63. package/dist/sparkline.js +2 -2
  64. package/dist/standalone/p1-charts.standalone.js +13 -0
  65. package/dist/standalone.d.ts +27 -0
  66. package/dist/standalone.d.ts.map +1 -0
  67. package/dist/story.d.ts +11 -0
  68. package/dist/story.d.ts.map +1 -0
  69. package/dist/story.js +7 -0
  70. package/dist/theme.js +3 -3
  71. package/dist/{theme.utils-CP1XtGIe.js → theme.utils-DF_e8LxQ.js} +132 -113
  72. package/dist/theme.utils-DF_e8LxQ.js.map +1 -0
  73. package/dist/tooltip.utils-CXD_NapA.js +9 -0
  74. package/dist/tooltip.utils-CXD_NapA.js.map +1 -0
  75. package/dist/types/category.d.ts +26 -0
  76. package/dist/types/category.d.ts.map +1 -1
  77. package/dist/types/heatmap.d.ts +3 -0
  78. package/dist/types/heatmap.d.ts.map +1 -1
  79. package/dist/types/heatmapParts.d.ts +2 -0
  80. package/dist/types/heatmapParts.d.ts.map +1 -1
  81. package/dist/types/motion.d.ts +31 -0
  82. package/dist/types/motion.d.ts.map +1 -0
  83. package/dist/types/pie.d.ts +3 -4
  84. package/dist/types/pie.d.ts.map +1 -1
  85. package/dist/types/polar.d.ts +3 -0
  86. package/dist/types/polar.d.ts.map +1 -1
  87. package/dist/types/scatter.d.ts +34 -0
  88. package/dist/types/scatter.d.ts.map +1 -1
  89. package/dist/types/sparkline.d.ts +3 -0
  90. package/dist/types/sparkline.d.ts.map +1 -1
  91. package/dist/types/story.d.ts +73 -0
  92. package/dist/types/story.d.ts.map +1 -0
  93. package/dist/{useChartTheme-B06p_jvu.js → useChartTheme-D0bQ3LQq.js} +2 -2
  94. package/dist/{useChartTheme-B06p_jvu.js.map → useChartTheme-D0bQ3LQq.js.map} +1 -1
  95. package/dist/useControllable-Crsr0byh.js +11 -0
  96. package/dist/useControllable-Crsr0byh.js.map +1 -0
  97. package/dist/useMarkMemory-CLNY6TtT.js +15 -0
  98. package/dist/useMarkMemory-CLNY6TtT.js.map +1 -0
  99. package/dist/useTween-B0G0CcvM.js +46 -0
  100. package/dist/useTween-B0G0CcvM.js.map +1 -0
  101. package/dist/utils/category.utils.d.ts +15 -1
  102. package/dist/utils/category.utils.d.ts.map +1 -1
  103. package/dist/utils/color.utils.d.ts +9 -0
  104. package/dist/utils/color.utils.d.ts.map +1 -1
  105. package/dist/utils/csv.utils.d.ts +6 -0
  106. package/dist/utils/csv.utils.d.ts.map +1 -0
  107. package/dist/utils/motion.utils.d.ts +25 -0
  108. package/dist/utils/motion.utils.d.ts.map +1 -1
  109. package/dist/utils/pieTween.utils.d.ts +1 -1
  110. package/dist/utils/pieTween.utils.d.ts.map +1 -1
  111. package/dist/utils/scatter.utils.d.ts +17 -1
  112. package/dist/utils/scatter.utils.d.ts.map +1 -1
  113. package/dist/utils/sparkline.utils.d.ts +15 -0
  114. package/dist/utils/sparkline.utils.d.ts.map +1 -1
  115. package/dist/utils/theme.utils.d.ts +1 -1
  116. package/dist/utils/theme.utils.d.ts.map +1 -1
  117. package/dist/{visibility.utils-nMI5a_Et.js → visibility.utils-wuc3ZS8D.js} +18 -25
  118. package/dist/visibility.utils-wuc3ZS8D.js.map +1 -0
  119. package/package.json +16 -5
  120. package/src/category.ts +5 -1
  121. package/src/charts/CategoryBarChart/index.tsx +310 -62
  122. package/src/charts/Heatmap/index.tsx +4 -0
  123. package/src/charts/PolarChart/index.tsx +98 -5
  124. package/src/charts/ScatterChart/index.tsx +164 -18
  125. package/src/charts/Sparkline/index.tsx +54 -7
  126. package/src/components/ChartFrame/index.tsx +180 -0
  127. package/src/components/ChartLegend/index.tsx +46 -0
  128. package/src/components/ChartStory/index.tsx +184 -0
  129. package/src/components/HeatmapCells/index.tsx +5 -2
  130. package/src/hooks/useMarkMemory.ts +29 -0
  131. package/src/hooks/usePieTween.ts +9 -44
  132. package/src/hooks/useSteps.ts +77 -0
  133. package/src/hooks/useTween.ts +112 -0
  134. package/src/index.ts +24 -1
  135. package/src/scatter.ts +4 -1
  136. package/src/sparkline.ts +1 -1
  137. package/src/standalone.tsx +68 -0
  138. package/src/story.ts +19 -0
  139. package/src/types/category.ts +27 -0
  140. package/src/types/heatmap.ts +3 -0
  141. package/src/types/heatmapParts.ts +2 -0
  142. package/src/types/motion.ts +35 -0
  143. package/src/types/pie.ts +3 -3
  144. package/src/types/polar.ts +3 -0
  145. package/src/types/scatter.ts +23 -0
  146. package/src/types/sparkline.ts +3 -0
  147. package/src/types/story.ts +103 -0
  148. package/src/utils/category.utils.ts +111 -2
  149. package/src/utils/color.utils.ts +48 -0
  150. package/src/utils/csv.utils.ts +28 -0
  151. package/src/utils/motion.utils.ts +124 -0
  152. package/src/utils/pieTween.utils.ts +1 -2
  153. package/src/utils/scatter.utils.ts +22 -5
  154. package/src/utils/sparkline.utils.ts +69 -0
  155. package/src/utils/theme.utils.ts +18 -15
  156. package/dist/CategoryBarChart-YEJ9VB8h.js +0 -453
  157. package/dist/CategoryBarChart-YEJ9VB8h.js.map +0 -1
  158. package/dist/Heatmap-C1XcTUg1.js.map +0 -1
  159. package/dist/PieLegend-BZsv9IbF.js.map +0 -1
  160. package/dist/PolarChart-BUEhn3CI.js +0 -334
  161. package/dist/PolarChart-BUEhn3CI.js.map +0 -1
  162. package/dist/Sparkline-DtNhxGVo.js +0 -67
  163. package/dist/Sparkline-DtNhxGVo.js.map +0 -1
  164. package/dist/motion.utils-C1eaZJdQ.js +0 -9
  165. package/dist/motion.utils-C1eaZJdQ.js.map +0 -1
  166. package/dist/theme.utils-CP1XtGIe.js.map +0 -1
  167. package/dist/tooltip.utils-D7xaBSUK.js.map +0 -1
  168. package/dist/visibility.utils-nMI5a_Et.js.map +0 -1
@@ -1,31 +1,32 @@
1
1
  "use client";
2
- import { a as e, c as t, f as n, g as r, i, n as a, o, p as s, s as c, t as l, u } from "./theme.utils-CP1XtGIe.js";
3
- import { r as d, t as f } from "./tooltip.utils-D7xaBSUK.js";
4
- import { t as p } from "./useChartTheme-B06p_jvu.js";
5
- import { t as m } from "./motion.utils-C1eaZJdQ.js";
6
- import { AreaSeries as h, BaselineSeries as g, CandlestickSeries as _, ColorType as v, CrosshairMode as y, HistogramSeries as b, LineSeries as x, LineStyle as S, createChart as C, createSeriesMarkers as w } from "lightweight-charts";
7
- import { forwardRef as T, useCallback as E, useEffect as D, useImperativeHandle as ee, useMemo as O, useRef as k, useState as A } from "react";
8
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
2
+ import { a as e, c as t, h as n, i as r, m as i, n as a, o, s, t as c, u as l, v as u } from "./theme.utils-DF_e8LxQ.js";
3
+ import { n as d } from "./shared-C1pGJV4T.js";
4
+ import { o as f } from "./motion.utils-DFoqptDi.js";
5
+ import { t as p } from "./useChartTheme-D0bQ3LQq.js";
6
+ import { t as m } from "./tooltip.utils-CXD_NapA.js";
7
+ import { forwardRef as h, useCallback as g, useEffect as _, useImperativeHandle as v, useMemo as y, useRef as b, useState as x } from "react";
8
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
9
+ import { AreaSeries as T, BaselineSeries as E, CandlestickSeries as D, ColorType as ee, CrosshairMode as O, HistogramSeries as k, LineSeries as A, LineStyle as j, createChart as te, createSeriesMarkers as ne } from "lightweight-charts";
9
10
  //#region src/utils/timeScale.utils.ts
10
- function P(e, t) {
11
+ function M(e, t) {
11
12
  let n = e.logicalToCoordinate(t), r = n === null ? null : e.coordinateToTime(n);
12
13
  return r === null ? null : Number(r);
13
14
  }
14
- function F(e, t) {
15
+ function N(e, t) {
15
16
  let n = e.timeToCoordinate(t);
16
17
  if (n !== null) return n;
17
18
  let r = e.timeToIndex(t, !0);
18
19
  if (r === null) return null;
19
- let i = Math.max(0, r - 1), a = P(e, i), o = P(e, i + 1), s = e.logicalToCoordinate(i), c = e.logicalToCoordinate(i + 1);
20
+ let i = Math.max(0, r - 1), a = M(e, i), o = M(e, i + 1), s = e.logicalToCoordinate(i), c = e.logicalToCoordinate(i + 1);
20
21
  return a === null || o === null || s === null || c === null || !(o > a) ? null : s + (t - a) / (o - a) * (c - s);
21
22
  }
22
- function I(e, t, n) {
23
+ function P(e, t, n) {
23
24
  let r = (t) => {
24
25
  let n = e.timeToIndex(t, !0);
25
26
  return n === null ? null : Number(n);
26
27
  }, i = r(t), a = r(n);
27
28
  if (i === null || a === null) return null;
28
- let o = P(e, i), s = P(e, a);
29
+ let o = M(e, i), s = M(e, a);
29
30
  if (o === null || s === null || o < t) return null;
30
31
  let c = s < n ? a : a - 1, l = e.logicalToCoordinate(i), u = e.logicalToCoordinate(c);
31
32
  if (c < i || l === null || u === null) return null;
@@ -34,30 +35,30 @@ function I(e, t, n) {
34
35
  }
35
36
  //#endregion
36
37
  //#region src/styles/seriesChart.ts
37
- var te = { position: "relative" }, ne = {
38
+ var re = { position: "relative" }, ie = {
38
39
  position: "absolute",
39
40
  inset: 0,
40
41
  zIndex: 0
41
- }, re = {
42
+ }, ae = {
42
43
  position: "absolute",
43
44
  top: 0,
44
45
  left: 0,
45
46
  display: "none",
46
47
  opacity: .15,
47
48
  pointerEvents: "none"
48
- }, L = {
49
+ }, F = {
49
50
  position: "absolute",
50
51
  top: 0,
51
52
  right: 0,
52
53
  opacity: 0,
53
54
  pointerEvents: "none"
54
- }, R = {
55
+ }, I = {
55
56
  position: "absolute",
56
57
  bottom: 40,
57
58
  left: "50%",
58
59
  transform: "translateX(-50%)"
59
- }, z = {
60
- ...R,
60
+ }, L = {
61
+ ...I,
61
62
  minHeight: 28,
62
63
  padding: "4px 12px",
63
64
  borderRadius: 999,
@@ -68,7 +69,7 @@ var te = { position: "relative" }, ne = {
68
69
  fontSize: 12,
69
70
  cursor: "pointer",
70
71
  touchAction: "manipulation"
71
- }, B = {
72
+ }, R = {
72
73
  position: "absolute",
73
74
  top: 8,
74
75
  right: 8,
@@ -80,16 +81,16 @@ var te = { position: "relative" }, ne = {
80
81
  padding: 0,
81
82
  listStyle: "none",
82
83
  pointerEvents: "none"
83
- }, V = {
84
+ }, z = {
84
85
  display: "flex",
85
86
  alignItems: "center",
86
87
  gap: 6
87
- }, H = {
88
+ }, B = {
88
89
  flex: "none",
89
90
  width: 10,
90
91
  height: 10,
91
92
  boxSizing: "border-box"
92
- }, ie = {
93
+ }, oe = {
93
94
  position: "absolute",
94
95
  top: 0,
95
96
  left: 0,
@@ -98,7 +99,7 @@ var te = { position: "relative" }, ne = {
98
99
  };
99
100
  //#endregion
100
101
  //#region src/hooks/useChart.ts
101
- function U(e = {}) {
102
+ function V(e = {}) {
102
103
  if (!e.layout) return e;
103
104
  let { colorSpace: t, colorParsers: n, ...r } = e.layout;
104
105
  return {
@@ -106,67 +107,67 @@ function U(e = {}) {
106
107
  layout: r
107
108
  };
108
109
  }
109
- function ae(e, t, n, i) {
110
- let a = e.current.owner === t ? e.current.options : {}, o = r(n, a, i);
111
- return o && (e.current = {
110
+ function se(e, t, n, r) {
111
+ let i = e.current.owner === t ? e.current.options : {}, a = u(n, i, r);
112
+ return a && (e.current = {
112
113
  owner: t,
113
- options: i
114
- }), o;
114
+ options: r
115
+ }), a;
115
116
  }
116
- function oe(e, t, n, r) {
117
- let [i, a] = A(null), [o, c] = A(0), l = k(n), u = k({
117
+ function ce(e, t, r, i) {
118
+ let [a, o] = x(null), [s, c] = x(0), l = b(r), u = b({
118
119
  owner: null,
119
120
  options: {}
120
- }), d = k({
121
+ }), d = b({
121
122
  owner: null,
122
123
  options: {}
123
124
  });
124
- return l.current = n, D(() => {
125
- let n = e.current;
126
- if (!n) return;
127
- let r = l.current?.layout, i = C(n, s({ autoSize: !0 }, { layout: {
128
- colorSpace: r?.colorSpace,
129
- colorParsers: r?.colorParsers
130
- } })), o = i.addSeries(t);
131
- return a({
132
- chart: i,
133
- series: o,
134
- chartDefaults: U(s(i.options())),
135
- seriesDefaults: s(o.options())
125
+ return l.current = r, _(() => {
126
+ let r = e.current;
127
+ if (!r) return;
128
+ let i = l.current?.layout, a = te(r, n({ autoSize: !0 }, { layout: {
129
+ colorSpace: i?.colorSpace,
130
+ colorParsers: i?.colorParsers
131
+ } })), s = a.addSeries(t);
132
+ return o({
133
+ chart: a,
134
+ series: s,
135
+ chartDefaults: V(n(a.options())),
136
+ seriesDefaults: n(s.options())
136
137
  }), () => {
137
- a(null), i.remove();
138
+ o(null), a.remove();
138
139
  };
139
140
  }, [
140
141
  e,
141
142
  t,
142
- o
143
- ]), D(() => {
144
- if (!i) return;
145
- let e = U(n), t = ae(u, i, i.chartDefaults, e);
146
- t ? i.chart.applyOptions(t) : c((e) => e + 1);
147
- }, [i, n]), D(() => {
148
- if (!i) return;
149
- let e = r ?? {}, t = ae(d, i, i.seriesDefaults, e);
150
- t ? i.series.applyOptions(t) : c((e) => e + 1);
151
- }, [i, r]), i;
143
+ s
144
+ ]), _(() => {
145
+ if (!a) return;
146
+ let e = V(r), t = se(u, a, a.chartDefaults, e);
147
+ t ? a.chart.applyOptions(t) : c((e) => e + 1);
148
+ }, [a, r]), _(() => {
149
+ if (!a) return;
150
+ let e = i ?? {}, t = se(d, a, a.seriesDefaults, e);
151
+ t ? a.series.applyOptions(t) : c((e) => e + 1);
152
+ }, [a, i]), a;
152
153
  }
153
154
  //#endregion
154
155
  //#region src/utils/time.utils.ts
155
- var se = 1e11;
156
- function W(e) {
156
+ var le = 1e11;
157
+ function H(e) {
157
158
  let t, n;
158
159
  if (e instanceof Date) t = e.getTime(), n = !0;
159
160
  else if (typeof e == "string") {
160
161
  if (t = Date.parse(e), n = !0, !Number.isFinite(t)) {
161
162
  let r = e.trim();
162
- t = r === "" ? NaN : Number(r), n = Math.abs(t) > se;
163
+ t = r === "" ? NaN : Number(r), n = Math.abs(t) > le;
163
164
  }
164
- } else t = e, n = Math.abs(t) > se;
165
+ } else t = e, n = Math.abs(t) > le;
165
166
  return Number.isFinite(t) ? Math.floor(n ? t / 1e3 : t) : null;
166
167
  }
167
168
  //#endregion
168
169
  //#region src/utils/data.utils.ts
169
- function ce(e, t) {
170
+ function ue(e, t) {
170
171
  let n = /* @__PURE__ */ new Map();
171
172
  for (let r of e) {
172
173
  let e = t.time(r);
@@ -183,7 +184,7 @@ function ce(e, t) {
183
184
  indexByTime: s
184
185
  };
185
186
  }
186
- function le(e) {
187
+ function de(e) {
187
188
  return [
188
189
  e.open,
189
190
  e.high,
@@ -191,10 +192,10 @@ function le(e) {
191
192
  e.close
192
193
  ].every(Number.isFinite);
193
194
  }
194
- function ue(e) {
195
- return ce(e, {
196
- time: (e) => W(e.time),
197
- valid: le,
195
+ function fe(e) {
196
+ return ue(e, {
197
+ time: (e) => H(e.time),
198
+ valid: de,
198
199
  row: (e) => e,
199
200
  data: (e, t) => {
200
201
  let { open: n, high: r, low: i, close: a, color: o, borderColor: s, wickColor: c } = e;
@@ -211,9 +212,9 @@ function ue(e) {
211
212
  }
212
213
  });
213
214
  }
214
- function G(e) {
215
- return ce(e, {
216
- time: (e) => W(e.time),
215
+ function U(e) {
216
+ return ue(e, {
217
+ time: (e) => H(e.time),
217
218
  valid: (e) => Number.isFinite(e.value),
218
219
  row: (e) => ({
219
220
  time: e.time,
@@ -229,23 +230,23 @@ function G(e) {
229
230
  })
230
231
  });
231
232
  }
232
- function de(e) {
233
- return typeof e == "number" || typeof e == "string" || e instanceof Date ? W(e) : null;
233
+ function pe(e) {
234
+ return typeof e == "number" || typeof e == "string" || e instanceof Date ? H(e) : null;
234
235
  }
235
- function K(e, t) {
236
+ function W(e, t) {
236
237
  let n = 0, r = e.length - 1, i = null;
237
238
  for (; n <= r;) {
238
- let a = n + r >> 1, o = de(e[a].time);
239
+ let a = n + r >> 1, o = pe(e[a].time);
239
240
  o !== null && o <= t ? (i = a, n = a + 1) : r = a - 1;
240
241
  }
241
242
  return i;
242
243
  }
243
244
  //#endregion
244
245
  //#region src/utils/bands.utils.ts
245
- var fe = "rgba(128,128,128,0.15)";
246
- function q(e) {
246
+ var me = "rgba(128,128,128,0.15)";
247
+ function G(e) {
247
248
  return e.flatMap((e) => {
248
- let t = W(e.from), n = W(e.to);
249
+ let t = H(e.from), n = H(e.to);
249
250
  return t === null || n === null || n < t ? [] : [{
250
251
  ...e,
251
252
  start: t,
@@ -253,23 +254,23 @@ function q(e) {
253
254
  }];
254
255
  }).sort((e, t) => e.start - t.start);
255
256
  }
256
- function pe(e) {
257
+ function he(e) {
257
258
  return [...new Set(e.map((e) => e.key))];
258
259
  }
259
- function me(e, t, r = {}) {
260
- let i = t?.palette.categorical ?? [];
261
- return Object.fromEntries(e.map((e, a) => {
262
- let o = i[a % i.length], c = t && (n(o, t.bands.opacity) ?? o) || fe, l = r[e];
263
- return [e, s({
260
+ function ge(e, t, r = {}) {
261
+ let a = t?.palette.categorical ?? [];
262
+ return Object.fromEntries(e.map((e, o) => {
263
+ let s = a[o % a.length], c = t && (i(s, t.bands.opacity) ?? s) || me, l = r[e];
264
+ return [e, n({
264
265
  fill: c,
265
266
  label: e
266
267
  }, t?.bands.styles?.[e], typeof l == "string" ? { fill: l } : l)];
267
268
  }));
268
269
  }
269
- function he(e, t, n, r = {}) {
270
- let i = q(e).filter(({ start: e, end: n }) => e <= t && t < n).pop();
270
+ function _e(e, t, n, r = {}) {
271
+ let i = G(e).filter(({ start: e, end: n }) => e <= t && t < n).pop();
271
272
  if (!i) return null;
272
- let a = K(n, t), o = K(n, i.start - 1), s = a === null ? 0 : a - (o ?? -1);
273
+ let a = W(n, t), o = W(n, i.start - 1), s = a === null ? 0 : a - (o ?? -1);
273
274
  return {
274
275
  key: i.key,
275
276
  label: r[i.key]?.label ?? i.key,
@@ -280,11 +281,11 @@ function he(e, t, n, r = {}) {
280
281
  }
281
282
  //#endregion
282
283
  //#region src/primitives/TimeRangePrimitive.ts
283
- var J = 8;
284
- function Y(e, t) {
284
+ var K = 8;
285
+ function q(e, t) {
285
286
  return e === "dashed" ? [4 * t, 3 * t] : e === "dotted" ? [t, 2 * t] : [];
286
287
  }
287
- function ge(e, t, n) {
288
+ function ve(e, t, n) {
288
289
  let { style: r } = n, { x: i, y: a, width: o, height: s } = t, c = n.color ?? r.fill, { stroke: l, hatch: u, text: d } = r;
289
290
  if (e.save(), e.beginPath(), e.rect(i, a, o, s), e.clip(), c && (e.fillStyle = c, e.fillRect(i, a, o, s)), u && u.color) {
290
291
  let t = Math.max(1, u.spacing ?? 6);
@@ -294,11 +295,11 @@ function ge(e, t, n) {
294
295
  }
295
296
  if (l?.color) {
296
297
  let t = l.width ?? 1;
297
- e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash(Y(l.style, t)), e.strokeRect(i + t / 2, a + t / 2, o - t, s - t), e.setLineDash([]);
298
+ e.strokeStyle = l.color, e.lineWidth = t, e.setLineDash(q(l.style, t)), e.strokeRect(i + t / 2, a + t / 2, o - t, s - t), e.setLineDash([]);
298
299
  }
299
- n.label && d?.color && (e.fillStyle = d.color, e.font = `${d.weight ?? 400} ${d.size ?? 12}px ${d.family ?? "sans-serif"}`, e.textBaseline = "middle", e.fillText(n.label, i + (r.inset ?? J), a + s / 2)), e.restore();
300
+ n.label && d?.color && (e.fillStyle = d.color, e.font = `${d.weight ?? 400} ${d.size ?? 12}px ${d.family ?? "sans-serif"}`, e.textBaseline = "middle", e.fillText(n.label, i + (r.inset ?? K), a + s / 2)), e.restore();
300
301
  }
301
- var X = class {
302
+ var J = class {
302
303
  zOrder = "normal";
303
304
  edges = "time";
304
305
  items = [];
@@ -313,7 +314,7 @@ var X = class {
313
314
  }
314
315
  applyOptions(e) {
315
316
  this.zOrder = e.zOrder ?? "normal", this.edges = e.edges ?? "time", this.items = e.items.flatMap((t) => {
316
- let n = W(t.from), r = W(t.to);
317
+ let n = H(t.from), r = H(t.to);
317
318
  return n === null || r === null ? [] : [{
318
319
  ...t,
319
320
  from: Math.min(n, r),
@@ -337,12 +338,12 @@ var X = class {
337
338
  let n = t.timeScale();
338
339
  e.useMediaCoordinateSpace(({ context: e, mediaSize: t }) => {
339
340
  for (let r of this.items) {
340
- let [i = null, a = null] = this.edges === "between-bars" ? I(n, r.from, r.to) ?? [] : [F(n, r.from), F(n, r.to)];
341
+ let [i = null, a = null] = this.edges === "between-bars" ? P(n, r.from, r.to) ?? [] : [N(n, r.from), N(n, r.to)];
341
342
  if (i === null || a === null) continue;
342
343
  let o = Math.max(0, i), s = Math.min(t.width, a);
343
344
  if (s <= o) continue;
344
345
  let c = Math.min(t.height, r.style.height ?? Infinity);
345
- ge(e, {
346
+ ve(e, {
346
347
  x: o,
347
348
  y: (t.height - c) / 2,
348
349
  width: s - o,
@@ -354,12 +355,12 @@ var X = class {
354
355
  };
355
356
  //#endregion
356
357
  //#region src/hooks/useBands.ts
357
- function _e(e, t, n, r, i) {
358
- let a = O(() => n ? q(n) : null, [n]), o = O(() => a ? me(pe(a), i, r) : {}, [
358
+ function ye(e, t, n, r, i) {
359
+ let a = y(() => n ? G(n) : null, [n]), o = y(() => a ? ge(he(a), i, r) : {}, [
359
360
  a,
360
361
  i,
361
362
  r
362
- ]), s = O(() => a && {
363
+ ]), s = y(() => a && {
363
364
  items: a.map(({ from: e, to: t, key: n }) => ({
364
365
  from: e,
365
366
  to: t,
@@ -368,25 +369,25 @@ function _e(e, t, n, r, i) {
368
369
  style: (e) => o[e] ?? {},
369
370
  zOrder: "bottom",
370
371
  edges: "between-bars"
371
- }, [a, o]), c = k(null), l = k(null), u = k(s), d = s !== null;
372
- u.current = s, D(() => {
372
+ }, [a, o]), c = b(null), l = b(null), u = b(s), d = s !== null;
373
+ u.current = s, _(() => {
373
374
  let t = e?.chart.panes()[0];
374
375
  if (!t || !u.current) return;
375
- let n = new X(u.current);
376
+ let n = new J(u.current);
376
377
  return t.attachPrimitive(n), c.current = n, l.current = u.current, () => {
377
378
  t.detachPrimitive(n), c.current = null;
378
379
  };
379
- }, [e, d]), D(() => {
380
+ }, [e, d]), _(() => {
380
381
  s && c.current && l.current !== s && (c.current.applyOptions(s), l.current = s);
381
382
  }, [s]);
382
- let f = O(() => Object.entries(o).map(([e, t]) => ({
383
+ let f = y(() => Object.entries(o).map(([e, t]) => ({
383
384
  key: e,
384
385
  label: t.label ?? e,
385
386
  fill: t.fill ?? "",
386
387
  legendColor: t.legendColor
387
- })), [o]), p = E((e) => {
388
+ })), [o]), p = g((e) => {
388
389
  let n = t.data[e]?.time;
389
- return a && typeof n == "number" ? he(a, n, t.data, o) : null;
390
+ return a && typeof n == "number" ? _e(a, n, t.data, o) : null;
390
391
  }, [
391
392
  a,
392
393
  t,
@@ -399,41 +400,41 @@ function _e(e, t, n, r, i) {
399
400
  }
400
401
  //#endregion
401
402
  //#region src/hooks/useOverlays.ts
402
- function ve(e, t = []) {
403
- let n = k([]);
404
- return D(() => {
405
- n.current = [];
406
- }, [e]), D(() => {
403
+ function be(e, t = []) {
404
+ let r = b([]);
405
+ return _(() => {
406
+ r.current = [];
407
+ }, [e]), _(() => {
407
408
  if (!e) return;
408
- let { chart: i } = e, a = n.current, o = (e) => {
409
- let t = i.addSeries(x, e);
409
+ let { chart: i } = e, a = r.current, o = (e) => {
410
+ let t = i.addSeries(A, e);
410
411
  return {
411
412
  series: t,
412
- defaults: s(t.options()),
413
+ defaults: n(t.options()),
413
414
  options: e
414
415
  };
415
416
  };
416
417
  t.forEach((e, t) => {
417
- let n = e.seriesOptions ?? {}, s = a[t];
418
- if (s && s.options !== n) {
419
- let e = r(s.defaults, s.options, n);
420
- e ? (s.series.applyOptions(e), s.options = n) : (i.removeSeries(s.series), s = void 0);
418
+ let n = e.seriesOptions ?? {}, r = a[t];
419
+ if (r && r.options !== n) {
420
+ let e = u(r.defaults, r.options, n);
421
+ e ? (r.series.applyOptions(e), r.options = n) : (i.removeSeries(r.series), r = void 0);
421
422
  }
422
- s || (a[t] = s = o(n)), s.series.setData(G(e.data).data);
423
+ r || (a[t] = r = o(n)), r.series.setData(U(e.data).data);
423
424
  }), a.splice(t.length).forEach((e) => i.removeSeries(e.series));
424
- }, [e, t]), n;
425
+ }, [e, t]), r;
425
426
  }
426
427
  //#endregion
427
428
  //#region src/utils/live.utils.ts
428
- var ye = 2, be = .002, xe = .5;
429
- function Se(e, t) {
429
+ var xe = 2, Se = .002, Ce = .5;
430
+ function we(e, t) {
430
431
  if (!e) return null;
431
432
  let n = e.rows[e.rows.length - 1], r = t.rows[t.rows.length - 1];
432
433
  if (!n || !r) return null;
433
- let i = W(n.time), a = W(r.time), o = t.rows[t.rows.length - 2], s = t.rows.length === e.rows.length && a === i, c = t.rows.length === e.rows.length + 1 && o !== void 0 && W(o.time) === i;
434
+ let i = H(n.time), a = H(r.time), o = t.rows[t.rows.length - 2], s = t.rows.length === e.rows.length && a === i, c = t.rows.length === e.rows.length + 1 && o !== void 0 && H(o.time) === i;
434
435
  return !s && !c || r.close === n.close ? null : r.close > n.close ? "up" : "down";
435
436
  }
436
- function Ce(e) {
437
+ function Te(e) {
437
438
  if (typeof e != "object" || !e) return null;
438
439
  let t = e, n = t.upColor, r = t.downColor;
439
440
  if (typeof n == "string" && typeof r == "string") return {
@@ -451,30 +452,30 @@ function Ce(e) {
451
452
  down: o
452
453
  } : null;
453
454
  }
454
- function we(e, t, n) {
455
- let r = Math.exp(n * be);
455
+ function Ee(e, t, n) {
456
+ let r = Math.exp(n * Se);
456
457
  if (!Number.isFinite(r)) return null;
457
458
  let i = {
458
459
  from: t - (t - e.from) * r,
459
460
  to: t + (e.to - t) * r
460
461
  };
461
- return i.to - i.from < ye ? null : i;
462
+ return i.to - i.from < xe ? null : i;
462
463
  }
463
- function Te(e) {
464
+ function De(e) {
464
465
  let t = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY, n = e.deltaMode === 1 ? t * 16 : t;
465
466
  return Number.isFinite(n) ? n : 0;
466
467
  }
467
- function Ee(e, t) {
468
+ function Oe(e, t) {
468
469
  return e === null || t < 0 || e.to >= t - .5;
469
470
  }
470
471
  //#endregion
471
472
  //#region src/hooks/useWheelZoom.ts
472
- function De(e, t, n) {
473
- D(() => {
473
+ function ke(e, t, n) {
474
+ _(() => {
474
475
  let r = t.current;
475
476
  if (!e || !r || !n) return;
476
477
  let { chart: i } = e, a = i.timeScale(), o = (e) => {
477
- let t = Te(e);
478
+ let t = De(e);
478
479
  if (t === 0) return;
479
480
  if (e.preventDefault(), !e.ctrlKey) {
480
481
  let e = a.options().barSpacing;
@@ -483,7 +484,7 @@ function De(e, t, n) {
483
484
  }
484
485
  let n = r.getBoundingClientRect(), o = e.clientX - n.left - i.priceScale("left").width(), s = a.coordinateToLogical(o), c = a.getVisibleLogicalRange();
485
486
  if (s === null || c === null) return;
486
- let l = we(c, s, t);
487
+ let l = Ee(c, s, t);
487
488
  l && a.setVisibleLogicalRange(l);
488
489
  };
489
490
  return r.addEventListener("wheel", o, { passive: !1 }), () => r.removeEventListener("wheel", o);
@@ -495,7 +496,7 @@ function De(e, t, n) {
495
496
  }
496
497
  //#endregion
497
498
  //#region src/utils/bucket.utils.ts
498
- function Oe(e, t, n, r) {
499
+ function Ae(e, t, n, r) {
499
500
  if (!(t > 0) || !Number.isFinite(t)) return e;
500
501
  let i = e;
501
502
  if (!Number.isFinite(i) || i <= 0) return e;
@@ -503,7 +504,7 @@ function Oe(e, t, n, r) {
503
504
  for (; i > 1 && i / 2 * t >= n * 1.5;) i /= 2;
504
505
  return i;
505
506
  }
506
- function ke(e, t) {
507
+ function je(e, t) {
507
508
  if (!Number.isInteger(t) || t <= 0) throw Error("bucketSize must be a positive integer");
508
509
  let n = [];
509
510
  for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
@@ -511,13 +512,13 @@ function ke(e, t) {
511
512
  }
512
513
  //#endregion
513
514
  //#region src/hooks/useAutoBucket.ts
514
- var Ae = 150, je = 6;
515
- function Me(e) {
516
- return e ? e === !0 ? je : e.minBarWidth ?? je : null;
515
+ var Me = 150, Ne = 6;
516
+ function Pe(e) {
517
+ return e ? e === !0 ? Ne : e.minBarWidth ?? Ne : null;
517
518
  }
518
- function Ne(e, t, n) {
519
- let [r, i] = A(1), a = Me(n), o = k(r), s = k(t.points.length);
520
- return o.current = r, s.current = t.points.length, D(() => {
519
+ function Fe(e, t, n) {
520
+ let [r, i] = x(1), a = Pe(n), o = b(r), s = b(t.points.length);
521
+ return o.current = r, s.current = t.points.length, _(() => {
521
522
  if (!e || a === null) {
522
523
  i(1);
523
524
  return;
@@ -526,11 +527,11 @@ function Ne(e, t, n) {
526
527
  let e = t.getVisibleLogicalRange(), n = e ? e.to - e.from : 0;
527
528
  if (n <= 0) return;
528
529
  let r = t.width() / (n * o.current);
529
- i(Oe(o.current, r, a, s.current));
530
+ i(Ae(o.current, r, a, s.current));
530
531
  }, l = () => {
531
532
  clearTimeout(n), cancelAnimationFrame(r), n = setTimeout(() => {
532
533
  r = requestAnimationFrame(c);
533
- }, Ae);
534
+ }, Me);
534
535
  };
535
536
  return t.subscribeVisibleLogicalRangeChange(l), l(), () => {
536
537
  t.unsubscribeVisibleLogicalRangeChange(l), clearTimeout(n), cancelAnimationFrame(r);
@@ -539,14 +540,14 @@ function Ne(e, t, n) {
539
540
  }
540
541
  //#endregion
541
542
  //#region src/hooks/useSeriesData.ts
542
- function Pe(e, t, n, r, i) {
543
- let a = O(() => n(t), [t, n]), o = Ne(e, a, i), s = O(() => o > 1 && r ? n(r(a.points, o)) : a, [
543
+ function Ie(e, t, n, r, i) {
544
+ let a = y(() => n(t), [t, n]), o = Fe(e, a, i), s = y(() => o > 1 && r ? n(r(a.points, o)) : a, [
544
545
  a,
545
546
  o,
546
547
  n,
547
548
  r
548
- ]), c = k(o);
549
- return D(() => {
549
+ ]), c = b(o);
550
+ return _(() => {
550
551
  if (!e) return;
551
552
  let t = e.chart.timeScale(), n = c.current / o, r = n === 1 ? null : t.getVisibleLogicalRange();
552
553
  c.current = o, e.series.setData(s.data), r && t.setVisibleLogicalRange({
@@ -561,48 +562,48 @@ function Pe(e, t, n, r, i) {
561
562
  }
562
563
  //#endregion
563
564
  //#region src/hooks/useLiveFollow.ts
564
- var Fe = 3e3, Ie = [
565
+ var Le = 3e3, Re = [
565
566
  "pointermove",
566
567
  "pointerdown",
567
568
  "wheel",
568
569
  "keydown"
569
570
  ];
570
- function Le(e, t) {
571
+ function ze(e, t) {
571
572
  return e === null || t === null ? e === t : Math.abs(e.from - t.from) < .5 && Math.abs(e.to - t.to) < .5;
572
573
  }
573
- function Re(e, t, n, r) {
574
- let [i, a] = A(!1), o = k(n);
575
- return o.current = n, D(() => {
574
+ function Be(e, t, n, r) {
575
+ let [i, a] = x(!1), o = b(n);
576
+ return o.current = n, _(() => {
576
577
  if (!e || !r) {
577
578
  a(!1);
578
579
  return;
579
580
  }
580
- let t = e.chart.timeScale(), i = () => a(!Ee(t.getVisibleLogicalRange(), n));
581
+ let t = e.chart.timeScale(), i = () => a(!Oe(t.getVisibleLogicalRange(), n));
581
582
  return i(), t.subscribeVisibleLogicalRangeChange(i), () => t.unsubscribeVisibleLogicalRangeChange(i);
582
583
  }, [
583
584
  e,
584
585
  r,
585
586
  n
586
- ]), D(() => {
587
+ ]), _(() => {
587
588
  let n = t.current;
588
589
  if (!e || !n || !r) return;
589
590
  let i = e.chart.timeScale(), a, s = null, c = () => {
590
591
  if (!s) return;
591
592
  let { range: e, wasLive: t, shift: n } = s;
592
- s = null, i.applyOptions({ shiftVisibleRangeOnNewBar: n }), t && n && Le(e, i.getVisibleLogicalRange()) && i.scrollToRealTime();
593
+ s = null, i.applyOptions({ shiftVisibleRangeOnNewBar: n }), t && n && ze(e, i.getVisibleLogicalRange()) && i.scrollToRealTime();
593
594
  }, l = () => {
594
595
  if (!s) {
595
596
  let e = i.getVisibleLogicalRange();
596
597
  s = {
597
598
  range: e,
598
- wasLive: Ee(e, o.current),
599
+ wasLive: Oe(e, o.current),
599
600
  shift: i.options().shiftVisibleRangeOnNewBar
600
601
  }, i.applyOptions({ shiftVisibleRangeOnNewBar: !1 });
601
602
  }
602
- clearTimeout(a), a = setTimeout(c, Fe);
603
+ clearTimeout(a), a = setTimeout(c, Le);
603
604
  };
604
- return Ie.forEach((e) => n.addEventListener(e, l, { passive: !0 })), () => {
605
- clearTimeout(a), Ie.forEach((e) => n.removeEventListener(e, l)), s && i.applyOptions({ shiftVisibleRangeOnNewBar: s.shift });
605
+ return Re.forEach((e) => n.addEventListener(e, l, { passive: !0 })), () => {
606
+ clearTimeout(a), Re.forEach((e) => n.removeEventListener(e, l)), s && i.applyOptions({ shiftVisibleRangeOnNewBar: s.shift });
606
607
  };
607
608
  }, [
608
609
  e,
@@ -615,20 +616,20 @@ function Re(e, t, n, r) {
615
616
  }
616
617
  //#endregion
617
618
  //#region src/hooks/usePriceFlash.ts
618
- var ze = 600, Be = 8;
619
- function Ve(e, t, n, r) {
620
- let i = k(null);
621
- D(() => {
619
+ var Ve = 600, He = 8;
620
+ function Ue(e, t, n, r) {
621
+ let i = b(null);
622
+ _(() => {
622
623
  let a = i.current;
623
624
  i.current = t;
624
- let o = n.current, s = Se(a, t), c = t.rows[t.rows.length - 1];
625
- if (!e || !o || !r || !s || !c || typeof o.animate != "function" || m()) return;
625
+ let o = n.current, s = we(a, t), c = t.rows[t.rows.length - 1];
626
+ if (!e || !o || !r || !s || !c || typeof o.animate != "function" || f()) return;
626
627
  let { chart: l, series: u } = e, d = requestAnimationFrame(() => {
627
- let e = u.priceToCoordinate(c.close), t = l.priceScale("right").width(), n = Ce(u.options());
628
+ let e = u.priceToCoordinate(c.close), t = l.priceScale("right").width(), n = Te(u.options());
628
629
  if (e === null || t === 0 || n === null) return;
629
- let r = l.options().layout.fontSize + Be;
630
+ let r = l.options().layout.fontSize + He;
630
631
  o.style.width = `${t}px`, o.style.height = `${r}px`, o.style.transform = `translateY(${e - r / 2}px)`, o.style.background = s === "up" ? n.up : n.down, o.animate([{ opacity: .9 }, { opacity: 0 }], {
631
- duration: ze,
632
+ duration: Ve,
632
633
  easing: "ease-out"
633
634
  });
634
635
  });
@@ -642,9 +643,9 @@ function Ve(e, t, n, r) {
642
643
  }
643
644
  //#endregion
644
645
  //#region src/hooks/usePriceLines.ts
645
- var He = [];
646
- function Ue(e, t = He) {
647
- D(() => {
646
+ var We = [];
647
+ function Ge(e, t = We) {
648
+ _(() => {
648
649
  if (!e) return;
649
650
  let { series: n } = e, r = t.map((e) => n.createPriceLine(e));
650
651
  return () => r.forEach((e) => n.removePriceLine(e));
@@ -652,50 +653,50 @@ function Ue(e, t = He) {
652
653
  }
653
654
  //#endregion
654
655
  //#region src/hooks/useSeriesTheme.ts
655
- function We(e, { magnet: t, magnetMode: n, ctrlWheelZoom: r, chartOptions: i, anchorLine: o, overlays: l }) {
656
+ function Ke(e, { magnet: t, magnetMode: r, ctrlWheelZoom: i, chartOptions: o, anchorLine: c, overlays: u }) {
656
657
  return {
657
- options: O(() => s(a(e), t && { crosshair: { mode: n } }, r && {
658
+ options: y(() => n(a(e), t && { crosshair: { mode: r } }, i && {
658
659
  handleScale: { mouseWheel: !1 },
659
660
  handleScroll: { mouseWheel: !1 }
660
- }, i), [
661
+ }, o), [
661
662
  e,
662
663
  t,
663
- n,
664
664
  r,
665
- i
665
+ i,
666
+ o
666
667
  ]),
667
- themedAnchorLine: O(() => u(c(e, e?.anchor, void 0), o), [e, o]),
668
- themedOverlays: O(() => {
668
+ themedAnchorLine: y(() => l(s(e, e?.anchor, void 0), c), [e, c]),
669
+ themedOverlays: y(() => {
669
670
  let t = e?.line.overlays;
670
- return t?.length && l ? l.map((e, n) => ({
671
+ return t?.length && u ? u.map((e, r) => ({
671
672
  ...e,
672
- seriesOptions: s({ color: t[n % t.length] }, e.seriesOptions)
673
- })) : l;
674
- }, [e, l])
673
+ seriesOptions: n({ color: t[r % t.length] }, e.seriesOptions)
674
+ })) : u;
675
+ }, [e, u])
675
676
  };
676
677
  }
677
678
  //#endregion
678
679
  //#region src/utils/range.utils.ts
679
- var Ge = 86400;
680
- function Z(e, t) {
680
+ var qe = 86400;
681
+ function Y(e, t) {
681
682
  let n = /* @__PURE__ */ new Date(e * 1e3), r = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth() - t + 1, 0));
682
683
  return r.setUTCDate(Math.min(n.getUTCDate(), r.getUTCDate())), r.setUTCHours(n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds()), r.getTime() / 1e3;
683
684
  }
684
- function Ke(e, t) {
685
+ function Je(e, t) {
685
686
  switch (e) {
686
- case "1D": return t - Ge;
687
- case "1W": return t - 7 * Ge;
688
- case "1M": return Z(t, 1);
689
- case "3M": return Z(t, 3);
690
- case "1Y": return Z(t, 12);
691
- case "3Y": return Z(t, 36);
692
- case "5Y": return Z(t, 60);
687
+ case "1D": return t - qe;
688
+ case "1W": return t - 7 * qe;
689
+ case "1M": return Y(t, 1);
690
+ case "3M": return Y(t, 3);
691
+ case "1Y": return Y(t, 12);
692
+ case "3Y": return Y(t, 36);
693
+ case "5Y": return Y(t, 60);
693
694
  case "YTD": return Date.UTC((/* @__PURE__ */ new Date(t * 1e3)).getUTCFullYear(), 0, 1) / 1e3;
694
695
  case "All": return null;
695
696
  }
696
697
  }
697
- function qe(e, t, n) {
698
- let r = Ke(n, t);
698
+ function Ye(e, t, n) {
699
+ let r = Je(n, t);
699
700
  return r === null || r <= e ? null : {
700
701
  from: r,
701
702
  to: t
@@ -703,15 +704,15 @@ function qe(e, t, n) {
703
704
  }
704
705
  //#endregion
705
706
  //#region src/hooks/useRangePreset.ts
706
- function Je(e, t, n) {
707
- let r = k(t), i = t.data.length > 0;
708
- r.current = t, D(() => {
707
+ function Xe(e, t, n) {
708
+ let r = b(t), i = t.data.length > 0;
709
+ r.current = t, _(() => {
709
710
  if (!e || !n || !i) return;
710
711
  let t = r.current.rows, a = e.chart.timeScale(), o = t[0], s = t[t.length - 1];
711
712
  if (!o || !s) return;
712
- let c = W(o.time), l = W(s.time);
713
+ let c = H(o.time), l = H(s.time);
713
714
  if (c === null || l === null) return;
714
- let u = qe(c, l, n);
715
+ let u = Ye(c, l, n);
715
716
  if (!u) {
716
717
  a.fitContent();
717
718
  return;
@@ -728,10 +729,10 @@ function Je(e, t, n) {
728
729
  }
729
730
  //#endregion
730
731
  //#region src/utils/stats.utils.ts
731
- function Ye(e, t) {
732
+ function Ze(e, t) {
732
733
  return e === 0 ? null : (t - e) / e * 100;
733
734
  }
734
- function Xe(e) {
735
+ function Qe(e) {
735
736
  let { high: t, low: n } = e[0];
736
737
  for (let r of e) r.high > t && (t = r.high), r.low < n && (n = r.low);
737
738
  return {
@@ -739,30 +740,30 @@ function Xe(e) {
739
740
  low: n
740
741
  };
741
742
  }
742
- function Ze(e, t, n) {
743
+ function $e(e, t, n) {
743
744
  let r = Math.max(0, Math.ceil(t)), i = Math.min(e.length - 1, Math.floor(n)), a = e[r], o = e[i];
744
745
  return r > i || !a || !o ? null : {
745
746
  from: a.time,
746
747
  to: o.time,
747
748
  open: a.open,
748
- ...Xe(e.slice(r, i + 1)),
749
+ ...Qe(e.slice(r, i + 1)),
749
750
  close: o.close,
750
- change: Ye(a.open, o.close),
751
+ change: Ze(a.open, o.close),
751
752
  bars: i - r + 1
752
753
  };
753
754
  }
754
755
  //#endregion
755
756
  //#region src/hooks/useRangeSelect.ts
756
- var Qe = 3;
757
- function $e(e, t, n, r, i) {
758
- let [a, o] = A(!1), s = k({
757
+ var et = 3;
758
+ function tt(e, t, n, r, i) {
759
+ let [a, o] = x(!1), s = b({
759
760
  normalized: r,
760
761
  options: i
761
762
  });
762
763
  return s.current = {
763
764
  normalized: r,
764
765
  options: i
765
- }, D(() => {
766
+ }, _(() => {
766
767
  let r = t.current;
767
768
  if (!e || !r) return;
768
769
  let { chart: i } = e, a = i.timeScale(), c = null, l = 0, u = (e) => e.clientX - r.getBoundingClientRect().left - i.priceScale("left").width(), d = () => {
@@ -776,8 +777,8 @@ function $e(e, t, n, r, i) {
776
777
  e.key === "Escape" && f();
777
778
  }, h = (e) => {
778
779
  let t = Math.min(c ?? 0, u(e)), n = Math.max(c ?? 0, u(e));
779
- if (f(), n - t < Qe) return;
780
- let r = a.coordinateToLogical(t), i = a.coordinateToLogical(n), o = r === null || i === null ? null : Ze(s.current.normalized.rows, r, i);
780
+ if (f(), n - t < et) return;
781
+ let r = a.coordinateToLogical(t), i = a.coordinateToLogical(n), o = r === null || i === null ? null : $e(s.current.normalized.rows, r, i);
781
782
  o && r !== null && i !== null && (a.setVisibleLogicalRange({
782
783
  from: r - .5,
783
784
  to: i + .5
@@ -798,34 +799,34 @@ function $e(e, t, n, r, i) {
798
799
  }
799
800
  //#endregion
800
801
  //#region src/utils/interaction.utils.ts
801
- function et({ points: e, rows: t }, n, r, i) {
802
+ function nt({ points: e, rows: t }, n, r, i) {
802
803
  let a = e[n], o = t[n];
803
804
  if (a === void 0 || !o) return null;
804
805
  let s = t[n - 1], c = r === null ? void 0 : t[r], l = i?.(n);
805
806
  return {
806
807
  point: a,
807
808
  index: n,
808
- change: s ? Ye(s.close, o.close) : null,
809
+ change: s ? Ze(s.close, o.close) : null,
809
810
  fromAnchor: c && r !== null ? {
810
- change: Ye(c.close, o.close),
811
+ change: Ze(c.close, o.close),
811
812
  bars: n - r
812
813
  } : null,
813
814
  ...l && { band: l }
814
815
  };
815
816
  }
816
- function tt({ x: e, y: t, gap: n, offset: r, width: i, height: a }) {
817
+ function rt({ x: e, y: t, gap: n, offset: r, width: i, height: a }) {
817
818
  let o = e > i / 2;
818
819
  return `translate(calc(${r + e + (o ? -n : n)}px - ${o ? 100 : 0}%), calc(${t}px - ${t > a / 2 ? 100 : 0}%))`;
819
820
  }
820
821
  //#endregion
821
822
  //#region src/hooks/useAnchor.ts
822
- var nt = { title: "Anchor" };
823
- function rt(e, t, n, r = nt) {
824
- let i = n == null ? null : W(n), a = O(() => i === null ? null : K(t.rows, i), [t, i]), o = a === null ? null : t.rows[a]?.close ?? null;
825
- return D(() => {
823
+ var it = { title: "Anchor" };
824
+ function at(e, t, n, r = it) {
825
+ let i = n == null ? null : H(n), a = y(() => i === null ? null : W(t.rows, i), [t, i]), o = a === null ? null : t.rows[a]?.close ?? null;
826
+ return _(() => {
826
827
  if (!e || o === null || r === !1) return;
827
828
  let { series: t } = e, n = t.createPriceLine({
828
- ...nt,
829
+ ...it,
829
830
  ...r,
830
831
  price: o
831
832
  });
@@ -838,16 +839,16 @@ function rt(e, t, n, r = nt) {
838
839
  }
839
840
  //#endregion
840
841
  //#region src/hooks/useChartEvents.ts
841
- function it(e, t, n, r, i, a) {
842
- let o = k(n), s = k(a), c = k(null), l = k(!1), [u, d] = A(null);
843
- D(() => {
842
+ function ot(e, t, n, r, i, a) {
843
+ let o = b(n), s = b(a), c = b(null), l = b(!1), [u, d] = x(null);
844
+ _(() => {
844
845
  o.current = n, s.current = a;
845
846
  });
846
- let f = E((e, t = null) => {
847
+ let f = g((e, t = null) => {
847
848
  (e !== c.current || e !== null && l.current) && (c.current = e, l.current = !1, i && d(e), e === null ? o.current.onPointLeave?.() : t && o.current.onPointHover?.(t));
848
- }, [i]), p = E((e) => {
849
+ }, [i]), p = g((e) => {
849
850
  e && (o.current.onPointClick?.(e), s.current?.(e.index));
850
- }, []), m = E((n) => {
851
+ }, []), m = g((n) => {
851
852
  let i = t.data[n], a = t.rows[n];
852
853
  if (!e || !i || !a) return null;
853
854
  let o = e.chart.timeScale().timeToCoordinate(i.time), s = e.series.priceToCoordinate(a.close);
@@ -860,7 +861,7 @@ function it(e, t, n, r, i, a) {
860
861
  t,
861
862
  r
862
863
  ]);
863
- return D(() => {
864
+ return _(() => {
864
865
  if (!e) return;
865
866
  let { chart: n, series: i } = e;
866
867
  l.current = !0;
@@ -894,17 +895,17 @@ function it(e, t, n, r, i, a) {
894
895
  }
895
896
  //#endregion
896
897
  //#region src/hooks/useKeyboardNav.ts
897
- function at(e, t, n, r, i) {
898
- let a = k(i);
899
- D(() => {
898
+ function st(e, t, n, r, i) {
899
+ let a = b(i);
900
+ _(() => {
900
901
  a.current = i;
901
- }), D(() => {
902
+ }), _(() => {
902
903
  let i = t.current;
903
904
  if (!e || !i || !r) return;
904
905
  let { chart: o, series: s } = e, c = n.data.length - 1, l = !1, u = (e) => {
905
906
  let t = o.timeScale(), n = t.getVisibleLogicalRange();
906
907
  if (!n) return;
907
- let r = e - .5 < n.from ? e - xe - n.from : e + .5 > n.to ? e + xe - n.to : 0;
908
+ let r = e - .5 < n.from ? e - Ce - n.from : e + .5 > n.to ? e + Ce - n.to : 0;
908
909
  r !== 0 && t.setVisibleLogicalRange({
909
910
  from: n.from + r,
910
911
  to: n.to + r
@@ -958,8 +959,8 @@ function at(e, t, n, r, i) {
958
959
  }
959
960
  //#endregion
960
961
  //#region src/hooks/useCrosshairBand.ts
961
- function ot(e, t, n) {
962
- let r = E((r) => {
962
+ function ct(e, t, n) {
963
+ let r = g((r) => {
963
964
  let i = t.current;
964
965
  if (!e || !i || !n) return;
965
966
  let { chart: a } = e, o = r === null ? null : a.timeScale().timeToCoordinate(r);
@@ -974,7 +975,7 @@ function ot(e, t, n) {
974
975
  t,
975
976
  n
976
977
  ]);
977
- return D(() => {
978
+ return _(() => {
978
979
  if (!e || !n) return;
979
980
  let { chart: t } = e, i = (e) => r(e.time === void 0 || !e.point ? null : e.time);
980
981
  return t.subscribeCrosshairMove(i), () => {
@@ -988,22 +989,22 @@ function ot(e, t, n) {
988
989
  }
989
990
  //#endregion
990
991
  //#region src/hooks/useInteractions.ts
991
- var st = "ArrowLeft ArrowRight Home End Enter Escape Space", ct = 8;
992
- function lt({ chart: e, series: t }, n, r) {
992
+ var lt = "ArrowLeft ArrowRight Home End Enter Escape Space", ut = 8;
993
+ function dt({ chart: e, series: t }, n, r) {
993
994
  let i = n.data[r], a = n.rows[r];
994
995
  if (!i || !a) return null;
995
996
  let o = e.timeScale(), s = o.timeToCoordinate(i.time), c = t.priceToCoordinate(a.high);
996
- return s === null || c === null ? null : tt({
997
+ return s === null || c === null ? null : rt({
997
998
  x: s,
998
999
  y: c,
999
- gap: o.options().barSpacing / 2 + ct,
1000
+ gap: o.options().barSpacing / 2 + ut,
1000
1001
  offset: e.priceScale("left").width(),
1001
1002
  ...e.paneSize()
1002
1003
  });
1003
1004
  }
1004
- function ut(e, t, n, r, i) {
1005
- let { anchor: a, anchorLine: o, magnet: s, pinOnClick: c, keyboard: l } = i, { legend: u, tooltip: d, handlers: f, bandOf: p } = i, [m, h] = A(null), g = c ? m : null, _ = O(() => g === null ? null : K(r.data, g), [r, g]), v = rt(e, r, a === void 0 ? g : a, o), y = it(e, r, f, E((e, t, n) => {
1006
- let i = et(r, e, v, p);
1005
+ function ft(e, t, n, r, i) {
1006
+ let { anchor: a, anchorLine: o, magnet: s, pinOnClick: c, keyboard: l } = i, { legend: u, tooltip: d, handlers: f, bandOf: p } = i, [m, h] = x(null), _ = c ? m : null, v = y(() => _ === null ? null : W(r.data, _), [r, _]), b = at(e, r, a === void 0 ? _ : a, o), S = ot(e, r, f, g((e, t, n) => {
1007
+ let i = nt(r, e, b, p);
1007
1008
  return i && {
1008
1009
  ...i,
1009
1010
  price: n,
@@ -1011,44 +1012,44 @@ function ut(e, t, n, r, i) {
1011
1012
  };
1012
1013
  }, [
1013
1014
  r,
1014
- v,
1015
+ b,
1015
1016
  p
1016
- ]), u || d, c ? (e) => h(e === _ ? null : r.data[e]?.time ?? null) : void 0), b = ot(e, n, s);
1017
- at(e, t, r, l, {
1018
- current: () => y.hovered.current ?? _,
1017
+ ]), u || d, c ? (e) => h(e === v ? null : r.data[e]?.time ?? null) : void 0), C = ct(e, n, s);
1018
+ st(e, t, r, l, {
1019
+ current: () => S.hovered.current ?? v,
1019
1020
  move: (e) => {
1020
- b(e === null ? null : r.data[e]?.time ?? null), y.activate(e, e === null ? null : y.eventAt(e));
1021
+ C(e === null ? null : r.data[e]?.time ?? null), S.activate(e, e === null ? null : S.eventAt(e));
1021
1022
  },
1022
- select: (e) => y.select(y.eventAt(e)),
1023
+ select: (e) => S.select(S.eventAt(e)),
1023
1024
  clear: () => h(null)
1024
1025
  });
1025
- let { active: x } = y, S = u ? et(r, x ?? _ ?? r.data.length - 1, v, p) : null, C = d && x !== null ? et(r, x, v, p) : null, w = C !== null && e && x !== null ? lt(e, r, x) : null;
1026
+ let { active: w } = S, T = u ? nt(r, w ?? v ?? r.data.length - 1, b, p) : null, E = d && w !== null ? nt(r, w, b, p) : null, D = E !== null && e && w !== null ? dt(e, r, w) : null;
1026
1027
  return {
1027
1028
  container: l ? {
1028
1029
  role: "application",
1029
1030
  tabIndex: 0,
1030
- "aria-keyshortcuts": st
1031
+ "aria-keyshortcuts": lt
1031
1032
  } : { role: "img" },
1032
- legend: S === null ? null : {
1033
- summary: S,
1034
- source: x === null ? _ === null ? "last" : "pinned" : "hover"
1033
+ legend: T === null ? null : {
1034
+ summary: T,
1035
+ source: w === null ? v === null ? "last" : "pinned" : "hover"
1035
1036
  },
1036
- tooltip: C === null || w === null ? null : {
1037
- summary: C,
1038
- transform: w
1037
+ tooltip: E === null || D === null ? null : {
1038
+ summary: E,
1039
+ transform: D
1039
1040
  }
1040
1041
  };
1041
1042
  }
1042
1043
  //#endregion
1043
1044
  //#region src/hooks/useVisibleStats.ts
1044
- function dt(e, t, n) {
1045
- let r = k(n), i = n !== void 0;
1046
- r.current = n, D(() => {
1045
+ function pt(e, t, n) {
1046
+ let r = b(n), i = n !== void 0;
1047
+ r.current = n, _(() => {
1047
1048
  if (!e || !i) return;
1048
1049
  let n = e.chart.timeScale(), a = 0, o = () => {
1049
1050
  a = 0;
1050
1051
  let e = n.getVisibleLogicalRange();
1051
- r.current?.(e ? Ze(t.rows, e.from, e.to) : null);
1052
+ r.current?.(e ? $e(t.rows, e.from, e.to) : null);
1052
1053
  }, s = () => {
1053
1054
  a ||= requestAnimationFrame(o);
1054
1055
  };
@@ -1063,25 +1064,25 @@ function dt(e, t, n) {
1063
1064
  }
1064
1065
  //#endregion
1065
1066
  //#region src/components/BandLegend/index.tsx
1066
- function ft({ entries: e, render: n, theme: r, className: i, style: a }) {
1067
+ function mt({ entries: e, render: n, theme: r, className: i, style: a }) {
1067
1068
  if (n === null || e.length === 0) return null;
1068
- if (n) return /* @__PURE__ */ M(j, { children: n([...e]) });
1069
+ if (n) return /* @__PURE__ */ C(S, { children: n([...e]) });
1069
1070
  let o = r ? `1px solid ${r.palette.border}` : "1px solid";
1070
- return /* @__PURE__ */ M("ul", {
1071
+ return /* @__PURE__ */ C("ul", {
1071
1072
  "data-part": "band-legend",
1072
1073
  className: i,
1073
1074
  style: {
1074
- ...B,
1075
+ ...R,
1075
1076
  ...t(r?.typography.label),
1076
1077
  ...a
1077
1078
  },
1078
- children: e.map(({ key: e, label: t, fill: n, legendColor: r }) => /* @__PURE__ */ N("li", {
1079
+ children: e.map(({ key: e, label: t, fill: n, legendColor: r }) => /* @__PURE__ */ w("li", {
1079
1080
  "data-part": "band-legend-item",
1080
- style: V,
1081
- children: [/* @__PURE__ */ M("span", {
1081
+ style: z,
1082
+ children: [/* @__PURE__ */ C("span", {
1082
1083
  "aria-hidden": "true",
1083
1084
  style: {
1084
- ...H,
1085
+ ...B,
1085
1086
  background: r ?? n,
1086
1087
  border: r ? "none" : o
1087
1088
  }
@@ -1091,18 +1092,18 @@ function ft({ entries: e, render: n, theme: r, className: i, style: a }) {
1091
1092
  }
1092
1093
  //#endregion
1093
1094
  //#region src/components/InteractionSlots/index.tsx
1094
- var pt = {
1095
+ var ht = {
1095
1096
  position: "absolute",
1096
1097
  inset: 0,
1097
1098
  pointerEvents: "none"
1098
1099
  };
1099
- function mt({ interactions: { legend: e, tooltip: t }, renderLegend: n, renderTooltip: r }) {
1100
- return /* @__PURE__ */ N(j, { children: [e && n && /* @__PURE__ */ M("div", {
1101
- style: pt,
1100
+ function gt({ interactions: { legend: e, tooltip: t }, renderLegend: n, renderTooltip: r }) {
1101
+ return /* @__PURE__ */ w(S, { children: [e && n && /* @__PURE__ */ C("div", {
1102
+ style: ht,
1102
1103
  "aria-live": "polite",
1103
1104
  "aria-atomic": "true",
1104
1105
  children: n(e)
1105
- }), t && r && /* @__PURE__ */ M("div", {
1106
+ }), t && r && /* @__PURE__ */ C("div", {
1106
1107
  style: {
1107
1108
  ...d,
1108
1109
  transform: t.transform
@@ -1115,119 +1116,119 @@ function mt({ interactions: { legend: e, tooltip: t }, renderLegend: n, renderTo
1115
1116
  }
1116
1117
  //#endregion
1117
1118
  //#region src/charts/SeriesChart/index.tsx
1118
- function ht({ data: e, definition: t, normalize: r, aggregate: i, magnetMode: a = y.MagnetOHLC, chartOptions: o, seriesOptions: s, className: c, ariaLabel: l = "Chart", liveButtonClassName: u, liveButtonLabel: d = "Jump to live", magnet: f = !0, flashLastPrice: m = !0, followLive: h = !0, ctrlWheelZoom: g = !0, renderLegend: _, renderTooltip: v, pinOnClick: b = !1, keyboard: x = !1, range: S, anchor: C, anchorLine: w, autoBucket: T, onVisibleStatsChange: E, onPointClick: D, onPointHover: O, onPointLeave: A, overlays: j, priceLines: P, bands: F, bandStyles: I, renderBandLegend: B, classNames: V = {}, styles: H = {}, rangeSelect: U = !0, doubleClickReset: ae = !0, onRangeSelect: se, onReset: W, theme: ce, unstyled: le }, ue) {
1119
- let G = k(null), de = k(null), K = k(null), fe = k(null), q = p({
1120
- theme: ce,
1121
- unstyled: le
1122
- }), { options: pe, themedAnchorLine: me, themedOverlays: he } = We(q, {
1119
+ function _t({ data: e, definition: t, normalize: n, aggregate: r, magnetMode: a = O.MagnetOHLC, chartOptions: o, seriesOptions: s, className: c, ariaLabel: l = "Chart", liveButtonClassName: u, liveButtonLabel: d = "Jump to live", magnet: f = !0, flashLastPrice: m = !0, followLive: h = !0, ctrlWheelZoom: g = !0, renderLegend: _, renderTooltip: y, pinOnClick: x = !1, keyboard: S = !1, range: T, anchor: E, anchorLine: D, autoBucket: ee, onVisibleStatsChange: k, onPointClick: A, onPointHover: j, onPointLeave: te, overlays: ne, priceLines: M, bands: N, bandStyles: P, renderBandLegend: R, classNames: z = {}, styles: B = {}, rangeSelect: V = !0, doubleClickReset: se = !0, onRangeSelect: le, onReset: H, theme: ue, unstyled: de }, fe) {
1120
+ let U = b(null), pe = b(null), W = b(null), me = b(null), G = p({
1121
+ theme: ue,
1122
+ unstyled: de
1123
+ }), { options: he, themedAnchorLine: ge, themedOverlays: _e } = Ke(G, {
1123
1124
  magnet: f,
1124
1125
  magnetMode: a,
1125
1126
  ctrlWheelZoom: g,
1126
1127
  chartOptions: o,
1127
- anchorLine: w,
1128
- overlays: j
1129
- }), J = oe(G, t, pe, s), Y = Pe(J, e, r, i, T), ge = ve(J, he), { entries: X, bandOf: ye } = _e(J, Y, F, I, q);
1130
- Ue(J, P), Je(J, Y, S), dt(J, Y, E);
1131
- let be = ut(J, G, de, Y, {
1132
- anchor: C,
1133
- anchorLine: me,
1128
+ anchorLine: D,
1129
+ overlays: ne
1130
+ }), K = ce(U, t, he, s), q = Ie(K, e, n, r, ee), ve = be(K, _e), { entries: J, bandOf: xe } = ye(K, q, N, P, G);
1131
+ Ge(K, M), Xe(K, q, T), pt(K, q, k);
1132
+ let Se = ft(K, U, pe, q, {
1133
+ anchor: E,
1134
+ anchorLine: ge,
1134
1135
  magnet: f,
1135
- pinOnClick: b,
1136
- keyboard: x,
1136
+ pinOnClick: x,
1137
+ keyboard: S,
1137
1138
  legend: _ !== void 0,
1138
- tooltip: v !== void 0,
1139
+ tooltip: y !== void 0,
1139
1140
  handlers: {
1140
- onPointClick: D,
1141
- onPointHover: O,
1142
- onPointLeave: A
1141
+ onPointClick: A,
1142
+ onPointHover: j,
1143
+ onPointLeave: te
1143
1144
  },
1144
- bandOf: ye
1145
+ bandOf: xe
1145
1146
  });
1146
- Ve(J, Y, K, m);
1147
- let xe = $e(J, G, fe, Y, {
1148
- enabled: U,
1149
- reset: ae,
1150
- onRangeSelect: se,
1151
- onReset: W
1147
+ Ue(K, q, W, m);
1148
+ let Ce = tt(K, U, me, q, {
1149
+ enabled: V,
1150
+ reset: se,
1151
+ onRangeSelect: le,
1152
+ onReset: H
1152
1153
  });
1153
- De(J, G, g);
1154
- let { away: Se, jumpToLive: Ce } = Re(J, G, Y.rows.length - 1, h);
1155
- return ee(ue, () => J ? {
1156
- chart: J.chart,
1157
- series: J.series,
1154
+ ke(K, U, g);
1155
+ let { away: we, jumpToLive: Te } = Be(K, U, q.rows.length - 1, h);
1156
+ return v(fe, () => K ? {
1157
+ chart: K.chart,
1158
+ series: K.series,
1158
1159
  get overlays() {
1159
- return ge.current.map((e) => e.series);
1160
+ return ve.current.map((e) => e.series);
1160
1161
  }
1161
- } : null, [J, ge]), /* @__PURE__ */ N("div", {
1162
+ } : null, [K, ve]), /* @__PURE__ */ w("div", {
1162
1163
  className: c,
1163
- style: te,
1164
+ style: re,
1164
1165
  children: [
1165
- /* @__PURE__ */ M("div", {
1166
- ref: G,
1167
- style: ne,
1166
+ /* @__PURE__ */ C("div", {
1167
+ ref: U,
1168
+ style: ie,
1168
1169
  "aria-label": l,
1169
- ...be.container
1170
+ ...Se.container
1170
1171
  }),
1171
- /* @__PURE__ */ M("div", {
1172
- ref: de,
1173
- style: re,
1172
+ /* @__PURE__ */ C("div", {
1173
+ ref: pe,
1174
+ style: ae,
1174
1175
  "aria-hidden": "true"
1175
1176
  }),
1176
- /* @__PURE__ */ M(ft, {
1177
- entries: X,
1178
- render: B,
1179
- theme: q,
1180
- className: V.bandLegend,
1181
- style: H.bandLegend
1177
+ /* @__PURE__ */ C(mt, {
1178
+ entries: J,
1179
+ render: R,
1180
+ theme: G,
1181
+ className: z.bandLegend,
1182
+ style: B.bandLegend
1182
1183
  }),
1183
- /* @__PURE__ */ M(mt, {
1184
- interactions: be,
1184
+ /* @__PURE__ */ C(gt, {
1185
+ interactions: Se,
1185
1186
  renderLegend: _,
1186
- renderTooltip: v
1187
+ renderTooltip: y
1187
1188
  }),
1188
- /* @__PURE__ */ M("div", {
1189
- ref: K,
1190
- style: L,
1189
+ /* @__PURE__ */ C("div", {
1190
+ ref: W,
1191
+ style: F,
1191
1192
  "aria-hidden": "true"
1192
1193
  }),
1193
- xe && /* @__PURE__ */ M("div", {
1194
- ref: fe,
1194
+ Ce && /* @__PURE__ */ C("div", {
1195
+ ref: me,
1195
1196
  "data-part": "range-select",
1196
- className: V.rangeSelect,
1197
+ className: z.rangeSelect,
1197
1198
  style: {
1198
- ...ie,
1199
- background: n(q?.palette.crosshair, .1),
1200
- ...H.rangeSelect
1199
+ ...oe,
1200
+ background: i(G?.palette.crosshair, .1),
1201
+ ...B.rangeSelect
1201
1202
  },
1202
1203
  "aria-hidden": "true"
1203
1204
  }),
1204
- Se && /* @__PURE__ */ M("button", {
1205
+ we && /* @__PURE__ */ C("button", {
1205
1206
  type: "button",
1206
1207
  className: u,
1207
- style: u || le ? R : z,
1208
- onClick: Ce,
1208
+ style: u || de ? I : L,
1209
+ onClick: Te,
1209
1210
  children: d
1210
1211
  })
1211
1212
  ]
1212
1213
  });
1213
1214
  }
1214
- var Q = T(ht);
1215
+ var X = h(_t);
1215
1216
  //#endregion
1216
1217
  //#region src/utils/histogram.utils.ts
1217
- function gt(e, t, n, r) {
1218
+ function vt(e, t, n, r) {
1218
1219
  return t === "diverging" ? e < 0 ? r.negative : r.positive : t === "threshold" && n !== void 0 && e > n ? r.over : r.bar;
1219
1220
  }
1220
- function _t(e, t, n, r) {
1221
+ function yt(e, t, n, r) {
1221
1222
  return e.map((e) => {
1222
1223
  if (e.color !== void 0) return e;
1223
- let i = gt(e.value, t, n, r);
1224
+ let i = vt(e.value, t, n, r);
1224
1225
  return i === void 0 ? e : {
1225
1226
  ...e,
1226
1227
  color: i
1227
1228
  };
1228
1229
  });
1229
1230
  }
1230
- var vt = (e) => e(), yt = (e) => {
1231
+ var bt = (e) => e(), xt = (e) => {
1231
1232
  let t = e();
1232
1233
  if (!t?.priceRange) return t;
1233
1234
  let { minValue: n, maxValue: r } = t.priceRange, i = Math.max(Math.abs(n), Math.abs(r));
@@ -1239,10 +1240,10 @@ var vt = (e) => e(), yt = (e) => {
1239
1240
  }
1240
1241
  };
1241
1242
  };
1242
- function bt(e, t) {
1243
- return s({ autoscaleInfoProvider: e === "diverging" ? yt : vt }, t);
1243
+ function St(e, t) {
1244
+ return n({ autoscaleInfoProvider: e === "diverging" ? xt : bt }, t);
1244
1245
  }
1245
- function xt(e, t, n, r) {
1246
+ function Ct(e, t, n, r) {
1246
1247
  let i = [];
1247
1248
  return e === "threshold" && t !== void 0 && n !== !1 && i.push({
1248
1249
  ...n,
@@ -1255,20 +1256,20 @@ function xt(e, t, n, r) {
1255
1256
  }
1256
1257
  //#endregion
1257
1258
  //#region src/utils/line.utils.ts
1258
- function St(e, t) {
1259
- return ke(e, t).map((e) => ({
1259
+ function Z(e, t) {
1260
+ return je(e, t).map((e) => ({
1260
1261
  ...e[e.length - 1],
1261
1262
  time: e[0].time
1262
1263
  }));
1263
1264
  }
1264
- function Ct(e) {
1265
+ function wt(e) {
1265
1266
  return e.map((e) => ({
1266
1267
  time: e.time,
1267
1268
  value: e.close,
1268
1269
  ...e.color !== void 0 && { color: e.color }
1269
1270
  }));
1270
1271
  }
1271
- function wt(e, t, n) {
1272
+ function Tt(e, t, n) {
1272
1273
  return e.data.map(({ color: r, ...i }, a) => {
1273
1274
  let o = { ...e.points[a] }, s = { ...i };
1274
1275
  return r !== void 0 && t.forEach((e) => s[e] = r), n.forEach((e) => {
@@ -1278,19 +1279,19 @@ function wt(e, t, n) {
1278
1279
  }
1279
1280
  //#endregion
1280
1281
  //#region src/charts/BarChart/index.tsx
1281
- var Tt = T(function({ seriesOptions: e, ariaLabel: t = "Bar chart", ...n }, r) {
1282
- let i = p(n), { upColor: a, downColor: o, options: s } = O(() => {
1282
+ var Et = h(function({ seriesOptions: e, ariaLabel: t = "Bar chart", ...n }, r) {
1283
+ let i = p(n), { upColor: a, downColor: o, options: s } = y(() => {
1283
1284
  let { upColor: t = i?.palette.up, downColor: n = i?.palette.down, ...r } = e ?? {};
1284
1285
  return {
1285
1286
  upColor: t,
1286
1287
  downColor: n,
1287
1288
  options: r
1288
1289
  };
1289
- }, [i, e]), { base: c = 0, color: l } = s, u = E((e) => {
1290
- let t = G(e);
1290
+ }, [i, e]), { base: c = 0, color: l } = s, u = g((e) => {
1291
+ let t = U(e);
1291
1292
  return l !== void 0 || !a || !o ? t : {
1292
1293
  ...t,
1293
- data: _t(t.data, "threshold", c, {
1294
+ data: yt(t.data, "threshold", c, {
1294
1295
  over: a,
1295
1296
  bar: o
1296
1297
  })
@@ -1301,25 +1302,25 @@ var Tt = T(function({ seriesOptions: e, ariaLabel: t = "Bar chart", ...n }, r) {
1301
1302
  o,
1302
1303
  l
1303
1304
  ]);
1304
- return /* @__PURE__ */ M(Q, {
1305
+ return /* @__PURE__ */ C(X, {
1305
1306
  ...n,
1306
1307
  ref: r,
1307
1308
  ariaLabel: t,
1308
1309
  seriesOptions: s,
1309
- definition: b,
1310
+ definition: k,
1310
1311
  normalize: u,
1311
- aggregate: St,
1312
- magnetMode: y.Magnet
1312
+ aggregate: Z,
1313
+ magnetMode: O.Magnet
1313
1314
  });
1314
- }), Et = {
1315
+ }), Dt = {
1315
1316
  line: {
1316
- definition: x,
1317
+ definition: A,
1317
1318
  label: "Line chart",
1318
1319
  colorKeys: ["color"],
1319
1320
  styleKeys: []
1320
1321
  },
1321
1322
  area: {
1322
- definition: h,
1323
+ definition: T,
1323
1324
  label: "Area chart",
1324
1325
  colorKeys: ["lineColor"],
1325
1326
  styleKeys: [
@@ -1329,7 +1330,7 @@ var Tt = T(function({ seriesOptions: e, ariaLabel: t = "Bar chart", ...n }, r) {
1329
1330
  ]
1330
1331
  },
1331
1332
  baseline: {
1332
- definition: g,
1333
+ definition: E,
1333
1334
  label: "Baseline chart",
1334
1335
  colorKeys: ["topLineColor", "bottomLineColor"],
1335
1336
  styleKeys: [
@@ -1341,97 +1342,97 @@ var Tt = T(function({ seriesOptions: e, ariaLabel: t = "Bar chart", ...n }, r) {
1341
1342
  "bottomFillColor2"
1342
1343
  ]
1343
1344
  }
1344
- }, Dt = T(function({ variant: e = "line", seriesOptions: t, baseValue: n, ariaLabel: r = Et[e].label, ...i }, a) {
1345
- let c = p(i), l = O(() => s(o(c, e), n !== void 0 && { baseValue: {
1345
+ }, Ot = h(function({ variant: e = "line", seriesOptions: t, baseValue: r, ariaLabel: i = Dt[e].label, ...a }, s) {
1346
+ let c = p(a), l = y(() => n(o(c, e), r !== void 0 && { baseValue: {
1346
1347
  type: "price",
1347
- price: n
1348
+ price: r
1348
1349
  } }, t), [
1349
1350
  c,
1350
1351
  e,
1351
- n,
1352
+ r,
1352
1353
  t
1353
- ]), u = E((t) => {
1354
- let n = G(t), { colorKeys: r, styleKeys: i } = Et[e];
1354
+ ]), u = g((t) => {
1355
+ let n = U(t), { colorKeys: r, styleKeys: i } = Dt[e];
1355
1356
  return {
1356
1357
  ...n,
1357
- data: wt(n, r, i)
1358
+ data: Tt(n, r, i)
1358
1359
  };
1359
1360
  }, [e]);
1360
- return /* @__PURE__ */ M(Q, {
1361
- ...i,
1362
- ref: a,
1363
- ariaLabel: r,
1361
+ return /* @__PURE__ */ C(X, {
1362
+ ...a,
1363
+ ref: s,
1364
+ ariaLabel: i,
1364
1365
  seriesOptions: l,
1365
- definition: Et[e].definition,
1366
- magnetMode: y.Magnet,
1366
+ definition: Dt[e].definition,
1367
+ magnetMode: O.Magnet,
1367
1368
  normalize: u,
1368
- aggregate: St
1369
+ aggregate: Z
1369
1370
  });
1370
1371
  });
1371
1372
  //#endregion
1372
1373
  //#region src/utils/candlestick.utils.ts
1373
- function Ot(e) {
1374
+ function kt(e) {
1374
1375
  return e.close >= e.open;
1375
1376
  }
1376
- function kt(e, t) {
1377
- return ke(e, t).map((e) => ({
1377
+ function At(e, t) {
1378
+ return je(e, t).map((e) => ({
1378
1379
  time: e[0].time,
1379
1380
  open: e[0].open,
1380
- ...Xe(e),
1381
+ ...Qe(e),
1381
1382
  close: e[e.length - 1].close
1382
1383
  }));
1383
1384
  }
1384
1385
  //#endregion
1385
1386
  //#region src/charts/HistogramChart/index.tsx
1386
- var At = T(function({ mode: t = "plain", threshold: n, thresholdLine: r, zeroLine: i, colors: a, seriesOptions: o, ariaLabel: l = "Histogram chart", ...d }, f) {
1387
- let m = O(() => bt(t, o), [t, o]), h = p(d), g = O(() => xt(t, n, u(c(h, h?.histogram.threshold, "dashed"), r), u(c(h, h?.histogram.zero, "solid"), i)), [
1387
+ var jt = h(function({ mode: t = "plain", threshold: r, thresholdLine: i, zeroLine: a, colors: o, seriesOptions: c, ariaLabel: u = "Histogram chart", ...d }, f) {
1388
+ let m = y(() => St(t, c), [t, c]), h = p(d), _ = y(() => Ct(t, r, l(s(h, h?.histogram.threshold, "dashed"), i), l(s(h, h?.histogram.zero, "solid"), a)), [
1388
1389
  h,
1389
1390
  t,
1390
- n,
1391
1391
  r,
1392
- i
1393
- ]), { bar: _, over: v, positive: x, negative: S } = O(() => s(e(h), a), [h, a]), C = E((e) => {
1394
- let r = G(e);
1392
+ i,
1393
+ a
1394
+ ]), { bar: v, over: b, positive: x, negative: S } = y(() => n(e(h), o), [h, o]), w = g((e) => {
1395
+ let n = U(e);
1395
1396
  return {
1396
- ...r,
1397
- data: _t(r.data, t, n, {
1398
- bar: _,
1399
- over: v,
1397
+ ...n,
1398
+ data: yt(n.data, t, r, {
1399
+ bar: v,
1400
+ over: b,
1400
1401
  positive: x,
1401
1402
  negative: S
1402
1403
  })
1403
1404
  };
1404
1405
  }, [
1405
1406
  t,
1406
- n,
1407
- _,
1407
+ r,
1408
1408
  v,
1409
+ b,
1409
1410
  x,
1410
1411
  S
1411
1412
  ]);
1412
- return /* @__PURE__ */ M(Q, {
1413
+ return /* @__PURE__ */ C(X, {
1413
1414
  ...d,
1414
1415
  ref: f,
1415
- ariaLabel: l,
1416
+ ariaLabel: u,
1416
1417
  seriesOptions: m,
1417
- priceLines: g,
1418
- definition: b,
1419
- normalize: C,
1420
- aggregate: St,
1421
- magnetMode: y.Magnet
1418
+ priceLines: _,
1419
+ definition: k,
1420
+ normalize: w,
1421
+ aggregate: Z,
1422
+ magnetMode: O.Magnet
1422
1423
  });
1423
- }), jt = T(function({ ariaLabel: e = "Candlestick chart", seriesOptions: t, ...n }, r) {
1424
- let i = p(n), a = O(() => s(l(i), t), [i, t]);
1425
- return /* @__PURE__ */ M(Q, {
1426
- ...n,
1427
- ref: r,
1424
+ }), Mt = h(function({ ariaLabel: e = "Candlestick chart", seriesOptions: t, ...r }, i) {
1425
+ let a = p(r), o = y(() => n(c(a), t), [a, t]);
1426
+ return /* @__PURE__ */ C(X, {
1427
+ ...r,
1428
+ ref: i,
1428
1429
  ariaLabel: e,
1429
- seriesOptions: a,
1430
- definition: _,
1431
- normalize: ue,
1432
- aggregate: kt
1430
+ seriesOptions: o,
1431
+ definition: D,
1432
+ normalize: fe,
1433
+ aggregate: At
1433
1434
  });
1434
- }), Mt = class {
1435
+ }), Nt = class {
1435
1436
  points = [];
1436
1437
  color = "#000000";
1437
1438
  opacity = .16;
@@ -1466,13 +1467,13 @@ var At = T(function({ mode: t = "plain", threshold: n, thresholdLine: r, zeroLin
1466
1467
  } } : null;
1467
1468
  }
1468
1469
  draw(e) {
1469
- let t = this.chart, r = this.series;
1470
- if (!t || !r || this.points.length < 2) return;
1471
- let i = t.timeScale(), a = this.points.flatMap((e) => {
1472
- let t = F(i, e.time), n = r.priceToCoordinate(e.upper), a = r.priceToCoordinate(e.lower);
1473
- return t === null || n === null || a === null ? [] : [{
1470
+ let t = this.chart, n = this.series;
1471
+ if (!t || !n || this.points.length < 2) return;
1472
+ let r = t.timeScale(), a = this.points.flatMap((e) => {
1473
+ let t = N(r, e.time), i = n.priceToCoordinate(e.upper), a = n.priceToCoordinate(e.lower);
1474
+ return t === null || i === null || a === null ? [] : [{
1474
1475
  x: t,
1475
- upper: n,
1476
+ upper: i,
1476
1477
  lower: a
1477
1478
  }];
1478
1479
  }), o = a[0];
@@ -1483,17 +1484,17 @@ var At = T(function({ mode: t = "plain", threshold: n, thresholdLine: r, zeroLin
1483
1484
  let n = a[t];
1484
1485
  e.lineTo(n.x, n.lower);
1485
1486
  }
1486
- e.closePath(), e.fillStyle = n(this.color, this.opacity) ?? this.color, e.fill();
1487
+ e.closePath(), e.fillStyle = i(this.color, this.opacity) ?? this.color, e.fill();
1487
1488
  });
1488
1489
  }
1489
- }, Nt = /* @__PURE__ */ new Set(), Pt = !1, $;
1490
+ }, Q = /* @__PURE__ */ new Set(), Pt = !1, $;
1490
1491
  function Ft(e) {
1491
1492
  let t = globalThis.CanvasRenderingContext2D?.prototype;
1492
- return t?.roundRect ? (Nt.add(e), Pt ||= ($ = t.roundRect, t.roundRect = function(e, t, n, r, i) {
1493
- for (let i of Nt) if (i.contains(this.canvas)) return $.call(this, e, t, n, r, 0);
1493
+ return t?.roundRect ? (Q.add(e), Pt ||= ($ = t.roundRect, t.roundRect = function(e, t, n, r, i) {
1494
+ for (let i of Q) if (i.contains(this.canvas)) return $.call(this, e, t, n, r, 0);
1494
1495
  return $.call(this, e, t, n, r, i);
1495
1496
  }, !0), () => {
1496
- Nt.delete(e), Nt.size === 0 && Pt && $ && (t.roundRect = $, Pt = !1, $ = void 0);
1497
+ Q.delete(e), Q.size === 0 && Pt && $ && (t.roundRect = $, Pt = !1, $ = void 0);
1497
1498
  }) : () => {};
1498
1499
  }
1499
1500
  //#endregion
@@ -1509,14 +1510,14 @@ function Lt(e, { height: t = 340, timeVisible: n = !1, rightOffset: r = 2, leftP
1509
1510
  }, d = {
1510
1511
  color: c.crosshair,
1511
1512
  width: 1,
1512
- style: S.Dashed,
1513
+ style: j.Dashed,
1513
1514
  labelBackgroundColor: c.crosshairLabel
1514
1515
  };
1515
1516
  return {
1516
1517
  height: t,
1517
1518
  layout: {
1518
1519
  background: {
1519
- type: v.Solid,
1520
+ type: ee.Solid,
1520
1521
  color: "transparent"
1521
1522
  },
1522
1523
  textColor: c.text,
@@ -1527,15 +1528,15 @@ function Lt(e, { height: t = 340, timeVisible: n = !1, rightOffset: r = 2, leftP
1527
1528
  grid: {
1528
1529
  vertLines: {
1529
1530
  color: c.grid,
1530
- style: S.Solid
1531
+ style: j.Solid
1531
1532
  },
1532
1533
  horzLines: {
1533
1534
  color: c.grid,
1534
- style: S.Solid
1535
+ style: j.Solid
1535
1536
  }
1536
1537
  },
1537
1538
  crosshair: {
1538
- mode: y.Normal,
1539
+ mode: O.Normal,
1539
1540
  vertLine: d,
1540
1541
  horzLine: d
1541
1542
  },
@@ -1585,7 +1586,7 @@ function Vt(e, t) {
1585
1586
  //#region src/utils/timeSeries.utils.ts
1586
1587
  function Ht(e, t) {
1587
1588
  if (t) return Bt(e, t);
1588
- let n = W(e);
1589
+ let n = H(e);
1589
1590
  return n === null ? null : n;
1590
1591
  }
1591
1592
  function Ut(e, t) {
@@ -1628,19 +1629,19 @@ function Wt(e, t, n) {
1628
1629
  return i.sort((e, t) => e.time - t.time), i;
1629
1630
  }
1630
1631
  function Gt(e) {
1631
- let t = W(e);
1632
+ let t = H(e);
1632
1633
  return t === null ? String(e) : (/* @__PURE__ */ new Date(t * 1e3)).toISOString().slice(0, 10);
1633
1634
  }
1634
1635
  //#endregion
1635
1636
  //#region src/charts/TimeSeriesChart/index.tsx
1636
1637
  var Kt = {
1637
- solid: S.Solid,
1638
- dotted: S.Dotted,
1639
- dashed: S.Dashed
1638
+ solid: j.Solid,
1639
+ dotted: j.Dotted,
1640
+ dashed: j.Dashed
1640
1641
  }, qt = {
1641
- line: x,
1642
- area: h,
1643
- histogram: b
1642
+ line: A,
1643
+ area: T,
1644
+ histogram: k
1644
1645
  }, Jt = [], Yt = [], Xt = [], Zt = [], Qt = [], $t = {
1645
1646
  ...d,
1646
1647
  minWidth: 140,
@@ -1655,107 +1656,107 @@ function en(e) {
1655
1656
  function tn(e, t, n) {
1656
1657
  return e.color ?? n[t % Math.max(1, n.length)] ?? "#191919";
1657
1658
  }
1658
- function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, markers: c = Qt, onPointClick: l, height: u = 340, className: d, ariaLabel: m = "Time series chart", profile: h = "editorial", axis: g = "time", categories: _, timeVisible: v = !1, formatTime: b, formatValue: x, extraTooltipRows: T, renderTooltip: E, chartOptions: ee, theme: O, unstyled: j }) {
1659
- let P = k(null), F = p({
1660
- theme: O,
1661
- unstyled: j
1662
- }), [I, re] = A(null), [L, R] = A(null), z = k({
1663
- formatTime: b,
1664
- formatValue: x,
1665
- extraTooltipRows: T,
1666
- renderTooltip: E,
1659
+ function nn({ series: e, ribbons: t = Yt, ranges: o = Xt, guides: s = Zt, markers: c = Qt, onPointClick: l, height: u = 340, className: d, ariaLabel: f = "Time series chart", profile: h = "editorial", axis: g = "time", categories: v, timeVisible: y = !1, formatTime: S, formatValue: T, extraTooltipRows: E, renderTooltip: D, chartOptions: ee, theme: k, unstyled: A }) {
1660
+ let M = b(null), N = p({
1661
+ theme: k,
1662
+ unstyled: A
1663
+ }), [P, ae] = x(null), [F, I] = x(null), L = b({
1664
+ formatTime: S,
1665
+ formatValue: T,
1666
+ extraTooltipRows: E,
1667
+ renderTooltip: D,
1667
1668
  onPointClick: l
1668
1669
  });
1669
- z.current = {
1670
- formatTime: b,
1671
- formatValue: x,
1672
- extraTooltipRows: T,
1673
- renderTooltip: E,
1670
+ L.current = {
1671
+ formatTime: S,
1672
+ formatValue: T,
1673
+ extraTooltipRows: E,
1674
+ renderTooltip: D,
1674
1675
  onPointClick: l
1675
1676
  };
1676
- let B = h === "editorial", V = g === "ordinal" ? _ ?? Jt : null, H = F ?? i;
1677
- D(() => {
1678
- let e = P.current;
1679
- if (e && B) return Ft(e);
1680
- }, [B]), D(() => {
1681
- let i = P.current;
1682
- if (!i) return;
1683
- let l = H.palette, d = l.categorical, f = e.some((e) => en(e) === "left") || t.some((e) => e.priceScale === "left"), p = e.length === 0 || e.some((e) => en(e) === "right") || t.some((e) => (e.priceScale ?? "right") === "right"), m = (e) => {
1684
- let t = typeof e == "number" ? e : W(e);
1685
- return t === null ? "" : V ? Vt(t, V) : z.current.formatTime?.(t) ?? Gt(t);
1686
- }, h = B ? Lt(H, {
1677
+ let R = h === "editorial", z = g === "ordinal" ? v ?? Jt : null, B = N ?? r;
1678
+ _(() => {
1679
+ let e = M.current;
1680
+ if (e && R) return Ft(e);
1681
+ }, [R]), _(() => {
1682
+ let r = M.current;
1683
+ if (!r) return;
1684
+ let l = B.palette, d = l.categorical, f = e.some((e) => en(e) === "left") || t.some((e) => e.priceScale === "left"), p = e.length === 0 || e.some((e) => en(e) === "right") || t.some((e) => (e.priceScale ?? "right") === "right"), m = (e) => {
1685
+ let t = typeof e == "number" ? e : H(e);
1686
+ return t === null ? "" : z ? Vt(t, z) : L.current.formatTime?.(t) ?? Gt(t);
1687
+ }, h = R ? Lt(B, {
1687
1688
  height: u,
1688
- timeVisible: v,
1689
+ timeVisible: y,
1689
1690
  leftPriceScale: f,
1690
1691
  rightPriceScale: p,
1691
1692
  tickMarkFormatter: m,
1692
1693
  timeFormatter: m
1693
- }) : s(a(H), {
1694
+ }) : n(a(B), {
1694
1695
  height: u,
1695
- crosshair: { mode: y.Magnet },
1696
+ crosshair: { mode: O.Magnet },
1696
1697
  handleScale: { mouseWheel: !1 },
1697
1698
  handleScroll: { mouseWheel: !1 },
1698
1699
  leftPriceScale: { visible: f },
1699
1700
  rightPriceScale: { visible: p },
1700
1701
  timeScale: {
1701
- timeVisible: v,
1702
+ timeVisible: y,
1702
1703
  tickMarkFormatter: m
1703
1704
  },
1704
1705
  localization: { timeFormatter: m }
1705
- }), g = C(i, s({ autoSize: !0 }, h, ee)), _ = /* @__PURE__ */ new Map(), b = e.map((e, t) => {
1706
- let r = tn(e, t, d), i = e.kind ?? "line", a = e.lineWidth ?? (i === "line" ? 2 : 1), o = {
1706
+ }), g = te(r, n({ autoSize: !0 }, h, ee)), _ = /* @__PURE__ */ new Map(), v = e.map((e, t) => {
1707
+ let n = tn(e, t, d), r = e.kind ?? "line", a = e.lineWidth ?? (r === "line" ? 2 : 1), o = {
1707
1708
  priceScaleId: en(e),
1708
1709
  priceLineVisible: !1,
1709
1710
  lastValueVisible: e.lastValueVisible ?? !1
1710
- }, s = i === "area" ? {
1711
+ }, s = r === "area" ? {
1711
1712
  ...o,
1712
- lineColor: r,
1713
+ lineColor: n,
1713
1714
  lineWidth: a,
1714
1715
  lineStyle: Kt[e.lineStyle ?? "solid"],
1715
- topColor: n(r, .2) ?? r,
1716
- bottomColor: n(r, 0) ?? r
1717
- } : i === "histogram" ? {
1716
+ topColor: i(n, .2) ?? n,
1717
+ bottomColor: i(n, 0) ?? n
1718
+ } : r === "histogram" ? {
1718
1719
  ...o,
1719
- color: r
1720
+ color: n
1720
1721
  } : {
1721
1722
  ...o,
1722
- color: r,
1723
+ color: n,
1723
1724
  lineWidth: a,
1724
1725
  lineStyle: Kt[e.lineStyle ?? "solid"],
1725
1726
  crosshairMarkerVisible: !0
1726
- }, l = g.addSeries(qt[i], s), u = Ut(e.data, V);
1727
+ }, l = g.addSeries(qt[r], s), u = Ut(e.data, z);
1727
1728
  l.setData(u), _.set(en(e), l);
1728
1729
  let f = c.flatMap((t) => {
1729
1730
  if (t.seriesId !== e.id) return [];
1730
- let n = Ht(t.time, V);
1731
- return n === null ? [] : [{
1732
- time: n,
1731
+ let r = Ht(t.time, z);
1732
+ return r === null ? [] : [{
1733
+ time: r,
1733
1734
  position: t.position ?? "inBar",
1734
1735
  shape: t.shape ?? "circle",
1735
- color: t.color ?? r,
1736
+ color: t.color ?? n,
1736
1737
  text: t.text
1737
1738
  }];
1738
1739
  });
1739
- return f.length > 0 && w(l, f), {
1740
+ return f.length > 0 && ne(l, f), {
1740
1741
  spec: e,
1741
- color: r,
1742
+ color: n,
1742
1743
  rows: u,
1743
1744
  apiSeries: l
1744
1745
  };
1745
1746
  });
1746
1747
  for (let e of t) {
1747
- let t = e.priceScale ?? "right", n = _.get(t) ?? b[0]?.apiSeries;
1748
+ let t = e.priceScale ?? "right", n = _.get(t) ?? v[0]?.apiSeries;
1748
1749
  if (!n) continue;
1749
1750
  let r = e.color ?? d[0] ?? l.down;
1750
- n.attachPrimitive(new Mt({
1751
- points: Wt(e.upper, e.lower, V),
1751
+ n.attachPrimitive(new Nt({
1752
+ points: Wt(e.upper, e.lower, z),
1752
1753
  color: r,
1753
1754
  opacity: e.opacity
1754
1755
  }));
1755
1756
  }
1756
- let x = b[0]?.apiSeries;
1757
- x && r.length > 0 && x.attachPrimitive(new X({
1758
- items: r.map((e) => ({
1757
+ let b = v[0]?.apiSeries;
1758
+ b && o.length > 0 && b.attachPrimitive(new J({
1759
+ items: o.map((e) => ({
1759
1760
  from: e.from,
1760
1761
  to: e.to,
1761
1762
  key: e.id,
@@ -1763,7 +1764,7 @@ function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, marker
1763
1764
  color: e.fill
1764
1765
  })),
1765
1766
  style: (e) => {
1766
- let t = r.find((t) => t.id === e), n = t?.hatch;
1767
+ let t = o.find((t) => t.id === e), n = t?.hatch;
1767
1768
  return {
1768
1769
  fill: t?.fill,
1769
1770
  hatch: n !== !1 && {
@@ -1775,21 +1776,21 @@ function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, marker
1775
1776
  };
1776
1777
  }
1777
1778
  }));
1778
- let T = /* @__PURE__ */ new Map();
1779
- for (let e of o) {
1780
- let t = _.get(e.scale ?? "right") ?? b[0]?.apiSeries;
1779
+ let x = /* @__PURE__ */ new Map();
1780
+ for (let e of s) {
1781
+ let t = _.get(e.scale ?? "right") ?? v[0]?.apiSeries;
1781
1782
  if (!t || (t.createPriceLine({
1782
1783
  price: e.value,
1783
1784
  color: e.color ?? l.down,
1784
1785
  lineWidth: 1,
1785
- lineStyle: S.Dashed,
1786
+ lineStyle: j.Dashed,
1786
1787
  axisLabelVisible: !!e.label,
1787
1788
  title: e.label ?? ""
1788
1789
  }), !Number.isFinite(e.value))) continue;
1789
- let n = T.get(t) ?? [];
1790
- n.push(e.value), T.set(t, n);
1790
+ let n = x.get(t) ?? [];
1791
+ n.push(e.value), x.set(t, n);
1791
1792
  }
1792
- for (let [e, t] of T) e.applyOptions({ autoscaleInfoProvider: ((e) => {
1793
+ for (let [e, t] of x) e.applyOptions({ autoscaleInfoProvider: ((e) => {
1793
1794
  let n = e();
1794
1795
  return n?.priceRange ? {
1795
1796
  ...n,
@@ -1800,33 +1801,33 @@ function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, marker
1800
1801
  } : n;
1801
1802
  }) });
1802
1803
  g.timeScale().fitContent();
1803
- let E = (e) => {
1804
+ let S = (e) => {
1804
1805
  let t = typeof e.time == "number" ? e.time : null, n = e.point;
1805
1806
  if (t === null || !n) {
1806
- R(null);
1807
+ I(null);
1807
1808
  return;
1808
1809
  }
1809
- let r = b.flatMap(({ spec: e, color: n, rows: r }) => {
1810
+ let r = v.flatMap(({ spec: e, color: n, rows: r }) => {
1810
1811
  if (e.includeInTooltip === !1) return [];
1811
1812
  let i = r.find((e) => e.time === t);
1812
1813
  return i ? [{
1813
1814
  label: e.name,
1814
- value: z.current.formatValue?.(e.id, i.value) ?? String(i.value),
1815
+ value: L.current.formatValue?.(e.id, i.value) ?? String(i.value),
1815
1816
  color: n,
1816
1817
  swatch: e.kind === "histogram" ? "bar" : "line"
1817
1818
  }] : [];
1818
- }), i = z.current.extraTooltipRows?.(t) ?? [], a = V ? Vt(t, V) : z.current.formatTime?.(t) ?? Gt(t);
1819
- R({
1819
+ }), i = L.current.extraTooltipRows?.(t) ?? [], a = z ? Vt(t, z) : L.current.formatTime?.(t) ?? Gt(t);
1820
+ I({
1820
1821
  label: a,
1821
1822
  rows: [...r, ...i],
1822
1823
  x: n.x,
1823
1824
  y: n.y,
1824
1825
  time: t
1825
1826
  });
1826
- }, D = (e) => {
1827
- let t = z.current.onPointClick, n = typeof e.time == "number" ? e.time : null;
1827
+ }, C = (e) => {
1828
+ let t = L.current.onPointClick, n = typeof e.time == "number" ? e.time : null;
1828
1829
  if (!t || n === null) return;
1829
- let r = b.flatMap(({ spec: e, rows: t }) => {
1830
+ let r = v.flatMap(({ spec: e, rows: t }) => {
1830
1831
  let r = t.find((e) => e.time === n);
1831
1832
  return r ? [{
1832
1833
  seriesId: e.id,
@@ -1838,61 +1839,61 @@ function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, marker
1838
1839
  points: r
1839
1840
  });
1840
1841
  };
1841
- return g.subscribeCrosshairMove(E), g.subscribeClick(D), re(g), () => {
1842
- re(null), R(null), g.unsubscribeCrosshairMove(E), g.unsubscribeClick(D), g.remove();
1842
+ return g.subscribeCrosshairMove(S), g.subscribeClick(C), ae(g), () => {
1843
+ ae(null), I(null), g.unsubscribeCrosshairMove(S), g.unsubscribeClick(C), g.remove();
1843
1844
  };
1844
1845
  }, [
1845
1846
  e,
1846
1847
  t,
1847
- r,
1848
1848
  o,
1849
+ s,
1849
1850
  c,
1850
- F,
1851
+ N,
1851
1852
  u,
1852
- B,
1853
- V,
1854
- v,
1853
+ R,
1854
+ z,
1855
+ y,
1855
1856
  ee,
1856
- H
1857
- ]), De(I ? {
1858
- chart: I,
1857
+ B
1858
+ ]), ke(P ? {
1859
+ chart: P,
1859
1860
  series: null
1860
- } : null, P, !B);
1861
- let ie = P.current?.getBoundingClientRect(), U = L ? f([L.x, L.y], 12, [180, 56], [ie?.width || u, ie?.height || u]) : null;
1862
- return /* @__PURE__ */ N("div", {
1861
+ } : null, M, !R);
1862
+ let oe = M.current?.getBoundingClientRect(), V = F ? m([F.x, F.y], 12, [180, 56], [oe?.width || u, oe?.height || u]) : null;
1863
+ return /* @__PURE__ */ w("div", {
1863
1864
  className: d,
1864
1865
  "data-profile": h,
1865
1866
  "data-axis": g,
1866
1867
  style: {
1867
- ...te,
1868
+ ...re,
1868
1869
  height: u
1869
1870
  },
1870
- children: [/* @__PURE__ */ M("div", {
1871
- ref: P,
1872
- style: ne,
1871
+ children: [/* @__PURE__ */ C("div", {
1872
+ ref: M,
1873
+ style: ie,
1873
1874
  role: "img",
1874
- "aria-label": m
1875
- }), L && U && /* @__PURE__ */ N("div", {
1875
+ "aria-label": f
1876
+ }), F && V && /* @__PURE__ */ w("div", {
1876
1877
  "data-part": "tooltip",
1877
1878
  style: {
1878
1879
  ...$t,
1879
- left: U[0],
1880
- top: U[1],
1881
- background: F?.palette.background ?? "#fff",
1882
- color: F?.palette.text ?? "#191919",
1883
- border: `1px solid ${F?.palette.border ?? "#2B2B43"}`
1880
+ left: V[0],
1881
+ top: V[1],
1882
+ background: N?.palette.background ?? "#fff",
1883
+ color: N?.palette.text ?? "#191919",
1884
+ border: `1px solid ${N?.palette.border ?? "#2B2B43"}`
1884
1885
  },
1885
- children: [/* @__PURE__ */ M("div", {
1886
+ children: [/* @__PURE__ */ C("div", {
1886
1887
  "data-part": "tooltip-time",
1887
- children: L.label
1888
- }), z.current.renderTooltip ? z.current.renderTooltip(L.rows, {
1889
- time: L.time,
1890
- x: L.x,
1891
- y: L.y
1892
- }) : L.rows.map((e) => /* @__PURE__ */ N("div", {
1888
+ children: F.label
1889
+ }), L.current.renderTooltip ? L.current.renderTooltip(F.rows, {
1890
+ time: F.time,
1891
+ x: F.x,
1892
+ y: F.y
1893
+ }) : F.rows.map((e) => /* @__PURE__ */ w("div", {
1893
1894
  "data-part": "tooltip-row",
1894
1895
  children: [
1895
- /* @__PURE__ */ M("span", {
1896
+ /* @__PURE__ */ C("span", {
1896
1897
  "data-part": "swatch",
1897
1898
  "data-swatch": e.swatch,
1898
1899
  style: {
@@ -1903,15 +1904,15 @@ function nn({ series: e, ribbons: t = Yt, ranges: r = Xt, guides: o = Zt, marker
1903
1904
  background: e.color
1904
1905
  }
1905
1906
  }),
1906
- /* @__PURE__ */ M("span", { children: e.label }),
1907
+ /* @__PURE__ */ C("span", { children: e.label }),
1907
1908
  " ",
1908
- /* @__PURE__ */ M("span", { children: e.value })
1909
+ /* @__PURE__ */ C("span", { children: e.value })
1909
1910
  ]
1910
1911
  }, `${e.label}:${e.value}`))]
1911
1912
  })]
1912
1913
  });
1913
1914
  }
1914
1915
  //#endregion
1915
- export { oe as C, W as S, De as _, jt as a, me as b, Ot as c, St as d, Ct as f, Q as g, xt as h, Mt as i, Dt as l, bt as m, Lt as n, At as o, _t as p, Ft as r, kt as s, nn as t, Tt as u, X as v, F as w, G as x, he as y };
1916
+ export { ce as C, H as S, ke as _, Mt as a, ge as b, kt as c, Z as d, wt as f, X as g, Ct as h, Nt as i, Ot as l, St as m, Lt as n, jt as o, yt as p, Ft as r, At as s, nn as t, Et as u, J as v, N as w, U as x, _e as y };
1916
1917
 
1917
- //# sourceMappingURL=TimeSeriesChart-BIwJxgnD.js.map
1918
+ //# sourceMappingURL=TimeSeriesChart-BZMLERDZ.js.map