@tradecanvas/chart 1.46.0 → 1.48.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.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as te, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as ce, x as le, y as ue } from "./LayoutSession-B-avgafz.js";
2
- import { CHART_STYLE_KEYS as de, DARK_TERMINAL as fe, DARK_THEME as pe, DARK_THEME as me, DEFAULT_DRAWING_STYLE as he, DEFAULT_RECONNECT as ge, DEFAULT_SIGNAL_STYLE as _e, DEFAULT_STREAM_CONFIG as ve, DEFAULT_TIMEFRAME_FAVORITES as ye, DEFAULT_TRADE_ZONE_STYLE as be, DEFAULT_TRADING_CONFIG as xe, HNX_SESSIONS as Se, HOSE_SESSIONS as Ce, LIGHT_THEME as d, LIGHT_THEME as f, MARKET_CRYPTO as p, MARKET_HNX as m, MARKET_HOSE as h, MARKET_HOSE_ETF as g, MARKET_NYSE as _, MARKET_UPCOM as v, MARKET_VN30F as y, MS_TIME_THRESHOLD as b, PRICE_SOURCES as x, TC_PALETTE as S, TC_SERIES_COLORS as C, TIMEFRAMES_CRYPTO as w, TIMEFRAMES_FOREX as T, TIMEFRAMES_STOCK as E, UPCOM_SESSIONS as D, VN30F_SESSIONS as O, VN_COLORS as k, VOLUME_ALPHA as A, barTimeUnit as we, barsAreDaily as Te, computePriceLimits as Ee, createVNTheme as De, formatFraction as Oe, formatNumber as ke, formatVND as Ae, formatVolumeLoc as je, fractionTick as Me, getCurrentSession as Ne, getLocale as Pe, indicatorSource as Fe, isPriceSource as Ie, isTimeFrame as Le, isValidTimeZone as Re, marketStatus as ze, normalizeBar as Be, normalizeBarTime as Ve, offsetAt as He, parseIndicatorSource as Ue, parseTimeframe as We, pickBaseTimeframe as Ge, priceFormatterFor as Ke, priceStepAt as qe, rankSymbols as Je, readNews as Ye, readQuote as Xe, registerLocale as Ze, resampleBars as Qe, roundToPriceStep as $e, scaleMarketPrices as et, setLocale as tt, sourcePrice as nt, stepDecimals as rt, t as it, tickBarCount as at, timeframeBucketStart as ot, timeframeToMs as st, vn30fContracts as ct, vn30fLastTradingDay as lt, volumeColor as ut, wallToUtc as dt, zoneOffsetMinutes as ft } from "@tradecanvas/commons";
3
- import { AlertManager as pt, Animator as mt, BarCountdown as ht, BaseFinanceChart as j, BinanceAdapter as gt, BybitAdapter as _t, CANDLE_PATTERNS as vt, ChartLegend as yt, ChartStateManager as bt, CoinbaseAdapter as xt, CompareRenderer as St, CrosshairTooltip as Ct, CurrentPriceLine as wt, DEFAULT_LEGEND_CONFIG as Tt, DEFAULT_MAX_WEBGL_CHARTS as Et, DEFAULT_SESSION_HOURS as Dt, DataExporter as Ot, DrawingBase as kt, Easing as At, FinanceCrosshair as M, GROUP_HEADER as jt, INDICATOR_CATEGORIES as Mt, IndicatorBase as Nt, IndicatorValueMap as Pt, KeyboardHandler as Ft, KrakenAdapter as It, MAX_ALERT_BARS as Lt, MIN_ALERT_BARS as Rt, MockAdapter as zt, PaperExecutionAdapter as Bt, PollingAdapter as Vt, RANGE_PRESETS as Ht, ReplayManager as Ut, ResamplingAdapter as Wt, Screenshot as N, SessionBreaks as Gt, SessionShading as Kt, SignalMarkerManager as qt, StreamManager as Jt, TickAggregator as Yt, TickBarAdapter as Xt, TickBarBuilder as Zt, TradeZoneManager as Qt, UndoRedoManager as $t, VolumeRenderer as en, Watermark as tn, WebSocketAdapter as nn, barIndexToTime as rn, barIndexToX as an, barIndexToX as P, canvasMeasure as on, computeBarLayout as sn, computeCalendarLayout as cn, computeCounterClockLayout as ln, computeDonutLayout as un, computeHistogramLayout as dn, computeMatrixLayout as fn, computeScatterLayout as pn, correlationMatrix as mn, counterClockPhase as hn, counterClockPhase as gn, counterClockPoints as _n, counterClockPoints as vn, detectCandlePatterns as yn, formatTooltipTime as bn, histogramBins as xn, hitBar as F, hitDay as I, hitMatrixCell as L, hitSlice as R, indicatorCategory as Sn, isPriceLevelAlert as Cn, layoutGroupedTreemap as wn, layoutSquarifiedTreemap as Tn, layoutUniformGrid as En, lttbDownsample as Dn, lttbVisibleIndices as On, nearestCounterClockPoint as z, nearestPoint as B, niceScale as kn, priceToY as An, priceToYMapper as jn, priceToYMapper as Mn, rangePresetStart as Nn, renderBarChart as Pn, renderCalendar as Fn, renderCounterClock as In, renderDepthChart as Ln, renderDonut as Rn, renderEquityCurve as zn, renderGauge as Bn, renderHeatmap as Vn, renderHistogram as Hn, renderMatrix as Un, renderScatter as Wn, renderSparkline as Gn, renderWaterfall as Kn, servesTimeframe as qn, setMaxWebGLCharts as Jn, shownCount as Yn, timeToX as Xn, timestampToBarIndex as Zn, timestampToBarIndex as Qn, toHeikinAshi as $n, toKagi as er, toLineBreak as tr, toPointAndFigure as nr, toRangeBars as rr, toRenko as ir, withResampling as ar, withTickBars as or, xToBarIndex as sr, xToBarIndex as V, xToTime as cr, yToPrice as lr, yToPrice as ur } from "@tradecanvas/core";
1
+ import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as ee, m as te, n as ne, o as re, p as ie, r as ae, s as oe, t as se, u as ce, v as le, w as d, x as ue, y as de } from "./LayoutSession-DSoR1CO8.js";
2
+ import { CHART_STYLE_KEYS as fe, DARK_TERMINAL as pe, DARK_THEME as me, DARK_THEME as he, DEFAULT_DRAWING_STYLE as ge, DEFAULT_RECONNECT as _e, DEFAULT_SIGNAL_STYLE as ve, DEFAULT_STREAM_CONFIG as ye, DEFAULT_TIMEFRAME_FAVORITES as be, DEFAULT_TRADE_ZONE_STYLE as xe, DEFAULT_TRADING_CONFIG as Se, HNX_SESSIONS as Ce, HOSE_SESSIONS as we, LIGHT_THEME as Te, LIGHT_THEME as Ee, MARKET_CRYPTO as f, MARKET_HNX as p, MARKET_HOSE as m, MARKET_HOSE_ETF as h, MARKET_NYSE as g, MARKET_UPCOM as _, MARKET_VN30F as v, MS_TIME_THRESHOLD as y, PRICE_SOURCES as b, TC_PALETTE as x, TC_SERIES_COLORS as S, TIMEFRAMES_CRYPTO as C, TIMEFRAMES_FOREX as w, TIMEFRAMES_STOCK as T, UPCOM_SESSIONS as E, VN30F_SESSIONS as D, VN_COLORS as De, VOLUME_ALPHA as Oe, barTimeUnit as ke, barsAreDaily as Ae, computePriceLimits as je, createVNTheme as Me, formatFraction as Ne, formatNumber as Pe, formatVND as Fe, formatVolumeLoc as Ie, fractionTick as Le, getCurrentSession as Re, getLocale as ze, indicatorSource as Be, isPriceSource as Ve, isTimeFrame as He, isValidTimeZone as Ue, marketStatus as We, normalizeBar as Ge, normalizeBarTime as Ke, offsetAt as qe, parseIndicatorSource as Je, parseTimeframe as Ye, pickBaseTimeframe as Xe, priceFormatterFor as Ze, priceStepAt as Qe, rankSymbols as $e, readNews as et, readQuote as tt, registerLocale as nt, resampleBars as rt, roundToPriceStep as it, scaleMarketPrices as at, setLocale as ot, sourcePrice as st, stepDecimals as ct, symbolTimeZone as lt, t as ut, tickBarCount as dt, timeframeBucketStart as ft, timeframeToMs as pt, vn30fContracts as mt, vn30fLastTradingDay as ht, volumeColor as gt, wallToUtc as _t, zoneOffsetMinutes as vt } from "@tradecanvas/commons";
3
+ import { AlertManager as yt, Animator as bt, BarCountdown as xt, BaseFinanceChart as O, BinanceAdapter as St, BybitAdapter as Ct, CANDLE_PATTERNS as wt, ChartLegend as Tt, ChartStateManager as Et, CoinbaseAdapter as Dt, CompareRenderer as Ot, CrosshairTooltip as kt, CurrentPriceLine as At, DEFAULT_LEGEND_CONFIG as jt, DEFAULT_MAX_WEBGL_CHARTS as Mt, DEFAULT_SESSION_HOURS as Nt, DataExporter as Pt, DrawingBase as Ft, Easing as It, FinanceCrosshair as k, GROUP_HEADER as Lt, INDICATOR_CATEGORIES as Rt, IndicatorBase as zt, IndicatorValueMap as Bt, KeyboardHandler as Vt, KrakenAdapter as Ht, MAX_ALERT_BARS as Ut, MIN_ALERT_BARS as Wt, MockAdapter as Gt, PaperExecutionAdapter as Kt, PollingAdapter as qt, RANGE_PRESETS as Jt, ReplayManager as Yt, ResamplingAdapter as Xt, Screenshot as Zt, SessionBreaks as Qt, SessionShading as $t, SignalMarkerManager as en, StreamManager as tn, TickAggregator as nn, TickBarAdapter as rn, TickBarBuilder as an, TradeZoneManager as on, UndoRedoManager as A, VolumeRenderer as sn, Watermark as cn, WebSocketAdapter as ln, barIndexToTime as un, barIndexToX as dn, barIndexToX as j, canvasMeasure as fn, computeBarLayout as pn, computeCalendarLayout as mn, computeCounterClockLayout as hn, computeDonutLayout as gn, computeHistogramLayout as _n, computeMatrixLayout as vn, computeScatterLayout as yn, correlationMatrix as bn, counterClockPhase as xn, counterClockPhase as Sn, counterClockPoints as Cn, counterClockPoints as wn, detectCandlePatterns as Tn, formatTooltipTime as En, histogramBins as Dn, hitBar as M, hitDay as N, hitMatrixCell as P, hitSlice as F, indicatorCategory as On, isPriceLevelAlert as kn, layoutGroupedTreemap as An, layoutSquarifiedTreemap as jn, layoutUniformGrid as Mn, lttbDownsample as Nn, lttbVisibleIndices as Pn, nearestCounterClockPoint as I, nearestPoint as L, niceScale as Fn, priceToY as In, priceToYMapper as Ln, priceToYMapper as Rn, rangePresetStart as zn, renderBarChart as Bn, renderCalendar as Vn, renderCounterClock as Hn, renderDepthChart as Un, renderDonut as Wn, renderEquityCurve as Gn, renderGauge as Kn, renderHeatmap as qn, renderHistogram as Jn, renderMatrix as Yn, renderScatter as Xn, renderSparkline as Zn, renderWaterfall as Qn, servesTimeframe as $n, setMaxWebGLCharts as er, shownCount as tr, timeToX as nr, timestampToBarIndex as rr, timestampToBarIndex as ir, toHeikinAshi as ar, toKagi as or, toLineBreak as sr, toPointAndFigure as cr, toRangeBars as lr, toRenko as ur, withResampling as dr, withTickBars as fr, xToBarIndex as pr, xToBarIndex as R, xToTime as mr, yToPrice as hr, yToPrice as gr } from "@tradecanvas/core";
4
4
  //#region src/frameworks/syncIndicators.ts
5
- function dr(e) {
5
+ function _r(e) {
6
6
  let { id: t, params: n = {}, position: r = null } = typeof e == "string" ? { id: e } : e;
7
7
  return JSON.stringify([
8
8
  t,
@@ -10,9 +10,9 @@ function dr(e) {
10
10
  r
11
11
  ]);
12
12
  }
13
- function fr(e, t, n) {
13
+ function vr(e, t, n) {
14
14
  let r = /* @__PURE__ */ new Map(), i = t.map((e) => {
15
- let t = dr(e), n = r.get(t) ?? 0;
15
+ let t = _r(e), n = r.get(t) ?? 0;
16
16
  return r.set(t, n + 1), {
17
17
  spec: e,
18
18
  key: `${t}#${n}`
@@ -26,19 +26,65 @@ function fr(e, t, n) {
26
26
  }
27
27
  }
28
28
  //#endregion
29
+ //#region src/frameworks/feedBars.ts
30
+ var z = (e, t) => e === t || e.time === t.time && e.open === t.open && e.high === t.high && e.low === t.low && e.close === t.close && e.volume === t.volume, B = (e) => ({
31
+ time: e.time,
32
+ open: e.open,
33
+ high: e.high,
34
+ low: e.low,
35
+ close: e.close,
36
+ volume: e.volume
37
+ }), V = (e) => e.length > 0 ? e[e.length - 1] : null;
38
+ function yr(e, t, n) {
39
+ for (let r = 0; r < n; r++) if (!z(e[r], t[r])) return !1;
40
+ return !0;
41
+ }
42
+ function br(e, t) {
43
+ if (e.isReplayActive()) return !0;
44
+ let n = V(e.getData());
45
+ return t.inReplay ? n?.time === t.last?.time : n === t.shownBar ? n?.time === t.last?.time || !e.isExtendedHoursVisible() : !1;
46
+ }
47
+ function xr(e, t) {
48
+ let n = [];
49
+ for (let r = t; r < e.length; r++) {
50
+ if (!d(e[r]) || !(e[r].time > e[r - 1].time)) return null;
51
+ n.push(B(e[r]));
52
+ }
53
+ return n;
54
+ }
55
+ function Sr(e, t, n) {
56
+ let r = n.length;
57
+ if (r === 0 || !n.last || !d(n.last) || t.length < r || !br(e, n) || t !== n.source && (n.source.length !== r || !yr(n.source, t, r - 1))) return !1;
58
+ let i = t[r - 1];
59
+ if (i.time !== n.last.time || !d(i)) return !1;
60
+ let a = xr(t, r);
61
+ return a ? (z(i, n.last) || e.updateLastBar(B(i)), a.length === 1 ? e.appendBar(a[0]) : a.length > 1 && e.appendBars(a), !0) : !1;
62
+ }
63
+ function Cr(e, t, n) {
64
+ (!n || !Sr(e, t, n)) && e.setData(t.map(B));
65
+ let r = t.length > 0 ? B(t[t.length - 1]) : null, i = e.isReplayActive();
66
+ return {
67
+ source: t,
68
+ length: t.length,
69
+ last: r,
70
+ shownBar: i ? null : V(e.getData()),
71
+ inReplay: i
72
+ };
73
+ }
74
+ //#endregion
29
75
  //#region src/plugins/overlayScale.ts
30
- function pr(e) {
31
- let { viewport: t, data: n } = e, r = Mn(t), i = n.length - 1, a = Math.max(0, Math.floor(t.visibleRange.from)), o = Math.min(i, Math.ceil(t.visibleRange.to)), s = (e) => n.length > 0 ? Qn(e, n) : e;
76
+ function wr(e) {
77
+ let { viewport: t, data: n } = e, r = Rn(t), i = n.length - 1, a = Math.max(0, Math.floor(t.visibleRange.from)), o = Math.min(i, Math.ceil(t.visibleRange.to)), s = (e) => n.length > 0 ? ir(e, n) : e;
32
78
  return {
33
- timeToX: (e) => P(s(e), t),
79
+ timeToX: (e) => j(s(e), t),
34
80
  xToTime: (e) => {
35
- let r = V(e, t);
36
- return n.length > 0 ? rn(r, n) : r;
81
+ let r = R(e, t);
82
+ return n.length > 0 ? un(r, n) : r;
37
83
  },
38
- indexToX: (e) => P(e, t),
39
- xToIndex: (e) => V(e, t),
84
+ indexToX: (e) => j(e, t),
85
+ xToIndex: (e) => R(e, t),
40
86
  priceToY: r,
41
- yToPrice: (e) => ur(e, t),
87
+ yToPrice: (e) => gr(e, t),
42
88
  barWidth: t.barWidth,
43
89
  visible: o < a ? {
44
90
  from: 0,
@@ -84,7 +130,7 @@ var H = {
84
130
  cols: 2,
85
131
  rows: 3
86
132
  }
87
- }, mr = class {
133
+ }, Tr = class {
88
134
  root;
89
135
  cells = [];
90
136
  layout;
@@ -105,7 +151,7 @@ var H = {
105
151
  createCell(e) {
106
152
  let t = this.options.cells?.[e] ?? {}, n = document.createElement("div");
107
153
  n.style.cssText = "position:relative;overflow:hidden;min-width:0;min-height:0;", this.root.appendChild(n);
108
- let r = new i(n, {
154
+ let r = new a(n, {
109
155
  chartType: "candlestick",
110
156
  autoScale: !0,
111
157
  features: {
@@ -120,7 +166,7 @@ var H = {
120
166
  ...this.options.chartOptions,
121
167
  ...t.chartOptions,
122
168
  theme: this.options.theme
123
- }), a = {
169
+ }), i = {
124
170
  container: n,
125
171
  chart: r,
126
172
  symbol: t.symbol ?? `Chart ${e + 1}`,
@@ -140,7 +186,7 @@ var H = {
140
186
  if (e && a) for (let t of this.cells) t.chart !== r && t.chart.setVisibleRange(e, a);
141
187
  }
142
188
  this.syncing = !1;
143
- }), a;
189
+ }), i;
144
190
  }
145
191
  setLayout(e) {
146
192
  if (e === this.layout) return;
@@ -191,13 +237,13 @@ var H = {
191
237
  this.cells = [], this.root.remove();
192
238
  }
193
239
  }
194
- }, hr = class extends j {
240
+ }, Er = class extends O {
195
241
  options;
196
242
  constructor(e, t) {
197
243
  super(e, t.theme), this.options = t, this.requestRender();
198
244
  }
199
245
  renderChart(e, t, n, r) {
200
- Gn(e, t, n, this.options, r);
246
+ Zn(e, t, n, this.options, r);
201
247
  }
202
248
  update(e) {
203
249
  this.options = {
@@ -211,15 +257,15 @@ var H = {
211
257
  ...e
212
258
  }, this.requestRender();
213
259
  }
214
- }, gr = class extends j {
260
+ }, Dr = class extends O {
215
261
  options;
216
262
  crosshair = null;
217
263
  constructor(e, t) {
218
- super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new M(this.canvas, () => this.requestRender())), this.requestRender();
264
+ super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new k(this.canvas, () => this.requestRender())), this.requestRender();
219
265
  }
220
266
  renderChart(e, t, n, r) {
221
267
  let i = this.crosshair?.getPosition() ?? null;
222
- Ln(e, t, n, this.options, r, i);
268
+ Un(e, t, n, this.options, r, i);
223
269
  }
224
270
  update(e) {
225
271
  this.options = {
@@ -236,15 +282,15 @@ var H = {
236
282
  destroy() {
237
283
  this.crosshair?.destroy(), super.destroy();
238
284
  }
239
- }, U = class extends j {
285
+ }, U = class extends O {
240
286
  options;
241
287
  crosshair = null;
242
288
  constructor(e, t) {
243
- super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new M(this.canvas, () => this.requestRender())), this.requestRender();
289
+ super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new k(this.canvas, () => this.requestRender())), this.requestRender();
244
290
  }
245
291
  renderChart(e, t, n, r) {
246
292
  let i = this.crosshair?.getPosition() ?? null;
247
- zn(e, t, n, this.options, r, i);
293
+ Gn(e, t, n, this.options, r, i);
248
294
  }
249
295
  update(e, t) {
250
296
  this.options = {
@@ -264,7 +310,7 @@ var H = {
264
310
  destroy() {
265
311
  this.crosshair?.destroy(), super.destroy();
266
312
  }
267
- }, W = class extends j {
313
+ }, W = class extends O {
268
314
  options;
269
315
  crosshair = null;
270
316
  cachedRects = [];
@@ -274,7 +320,7 @@ var H = {
274
320
  lastLayoutHeight = 0;
275
321
  handleClick = null;
276
322
  constructor(e, t) {
277
- super(e, t.theme), this.options = t, this.currentData = t.data ?? [], t.crosshair !== !1 && (this.crosshair = new M(this.canvas, () => this.requestRender())), t.onCellClick && (this.handleClick = (e) => {
323
+ super(e, t.theme), this.options = t, this.currentData = t.data ?? [], t.crosshair !== !1 && (this.crosshair = new k(this.canvas, () => this.requestRender())), t.onCellClick && (this.handleClick = (e) => {
278
324
  let t = this.canvas.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
279
325
  this.onCanvasClick(n, r);
280
326
  }, this.canvas.addEventListener("click", this.handleClick)), this.applyLabel(), this.recomputeLayout(), this.requestRender();
@@ -291,20 +337,20 @@ var H = {
291
337
  height: this.height
292
338
  }, t = this.options.cellPadding ?? 2;
293
339
  if (this.lastLayoutWidth = this.width, this.lastLayoutHeight = this.height, this.cachedGroups = [], this.options.grouped) {
294
- let { groups: n, cells: r } = wn(this.currentData.map((e) => ({
340
+ let { groups: n, cells: r } = An(this.currentData.map((e) => ({
295
341
  id: e.id,
296
342
  weight: e.weight ?? (Math.abs(e.value) || 1),
297
343
  group: e.group,
298
344
  value: e.value
299
- })), e, t, jt);
345
+ })), e, t, Lt);
300
346
  this.cachedRects = r, this.cachedGroups = n;
301
347
  } else if (this.options.weighted) {
302
348
  let n = this.currentData.map((e) => ({
303
349
  id: e.id,
304
350
  weight: e.weight ?? (Math.abs(e.value) || 1)
305
351
  }));
306
- this.cachedRects = Tn(n, e, t);
307
- } else this.cachedRects = En(this.currentData.map((e) => ({ id: e.id })), e, t);
352
+ this.cachedRects = jn(n, e, t);
353
+ } else this.cachedRects = Mn(this.currentData.map((e) => ({ id: e.id })), e, t);
308
354
  }
309
355
  onCanvasClick(e, t) {
310
356
  if (this.options.onCellClick) for (let n of this.cachedRects) {
@@ -319,7 +365,7 @@ var H = {
319
365
  renderChart(e, t, n, r) {
320
366
  (t !== this.lastLayoutWidth || n !== this.lastLayoutHeight) && this.recomputeLayout();
321
367
  let i = this.crosshair?.getPosition() ?? null;
322
- Vn(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
368
+ qn(e, t, n, this.currentData, this.cachedRects, this.options, r, i, this.cachedGroups);
323
369
  }
324
370
  update(e) {
325
371
  this.currentData = e, this.options = {
@@ -336,15 +382,15 @@ var H = {
336
382
  destroy() {
337
383
  this.crosshair?.destroy(), this.handleClick && this.canvas.removeEventListener("click", this.handleClick), super.destroy();
338
384
  }
339
- }, _r = class extends j {
385
+ }, Or = class extends O {
340
386
  options;
341
387
  crosshair = null;
342
388
  constructor(e, t) {
343
- super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new M(this.canvas, () => this.requestRender())), this.requestRender();
389
+ super(e, t.theme), this.options = t, t.crosshair !== !1 && (this.crosshair = new k(this.canvas, () => this.requestRender())), this.requestRender();
344
390
  }
345
391
  renderChart(e, t, n, r) {
346
392
  let i = this.crosshair?.getPosition() ?? null;
347
- Kn(e, t, n, this.options, r, i);
393
+ Qn(e, t, n, this.options, r, i);
348
394
  }
349
395
  update(e) {
350
396
  this.options = {
@@ -361,12 +407,12 @@ var H = {
361
407
  destroy() {
362
408
  this.crosshair?.destroy(), super.destroy();
363
409
  }
364
- }, vr = 500;
365
- function yr(e) {
410
+ }, kr = 500;
411
+ function Ar(e) {
366
412
  let t = 1 - e;
367
413
  return 1 - t * t * t;
368
414
  }
369
- var br = class extends j {
415
+ var jr = class extends O {
370
416
  options;
371
417
  currentValue;
372
418
  targetValue;
@@ -377,7 +423,7 @@ var br = class extends j {
377
423
  super(e, t.theme), this.options = t, this.currentValue = t.value, this.targetValue = t.value, this.requestRender();
378
424
  }
379
425
  renderChart(e, t, n, r) {
380
- Bn(e, t, n, this.options, r, this.currentValue);
426
+ Kn(e, t, n, this.options, r, this.currentValue);
381
427
  }
382
428
  setValue(e) {
383
429
  if (this.options.animate === !1) {
@@ -407,7 +453,7 @@ var br = class extends j {
407
453
  if (this.animationFrameId !== null) return;
408
454
  let e = () => {
409
455
  if (this.animationFrameId = null, this.animationStart === null) return;
410
- let t = this.options.animationDuration ?? vr, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = yr(r);
456
+ let t = this.options.animationDuration ?? kr, n = performance.now() - this.animationStart, r = Math.min(1, n / Math.max(1, t)), i = Ar(r);
411
457
  this.currentValue = this.animationFrom + (this.targetValue - this.animationFrom) * i, this.requestRender(), r < 1 ? this.animationFrameId = requestAnimationFrame(e) : (this.currentValue = this.targetValue, this.animationStart = null);
412
458
  };
413
459
  this.animationFrameId = requestAnimationFrame(e);
@@ -418,7 +464,7 @@ var br = class extends j {
418
464
  destroy() {
419
465
  this.cancelAnimation(), super.destroy();
420
466
  }
421
- }, G = class extends j {
467
+ }, G = class extends O {
422
468
  options;
423
469
  layout = null;
424
470
  layoutFor = null;
@@ -433,11 +479,11 @@ var br = class extends j {
433
479
  this.canvas.style.cursor = this.hits(this.layout, e.clientX - t.left, e.clientY - t.top) ? "pointer" : "";
434
480
  };
435
481
  constructor(e, t) {
436
- super(e, t.theme), this.options = t, this.crosshair = new M(this.canvas, () => this.requestRender()), this.canvas.addEventListener("click", this.onClick), this.canvas.addEventListener("pointermove", this.onMove), this.applyLabel(), this.requestRender();
482
+ super(e, t.theme), this.options = t, this.crosshair = new k(this.canvas, () => this.requestRender()), this.canvas.addEventListener("click", this.onClick), this.canvas.addEventListener("pointermove", this.onMove), this.applyLabel(), this.requestRender();
437
483
  }
438
484
  renderChart(e, t, n, r) {
439
485
  let i = this.options.crosshair === !1 ? null : this.crosshair.getPosition(), a = this.layoutFor;
440
- (!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, on(e, r)), this.layoutFor = {
486
+ (!this.layout || !a || a.options !== this.options || a.width !== t || a.height !== n || a.theme !== r) && (this.layout = this.compute(t, n, r, fn(e, r)), this.layoutFor = {
441
487
  options: this.options,
442
488
  width: t,
443
489
  height: n,
@@ -456,12 +502,12 @@ var br = class extends j {
456
502
  destroy() {
457
503
  this.crosshair.destroy(), this.canvas.removeEventListener("click", this.onClick), this.canvas.removeEventListener("pointermove", this.onMove), super.destroy();
458
504
  }
459
- }, xr = class extends G {
505
+ }, Mr = class extends G {
460
506
  compute(e, t, n, r) {
461
- return sn(this.options, e, t, n, r);
507
+ return pn(this.options, e, t, n, r);
462
508
  }
463
509
  draw(e, t, n, r, i, a) {
464
- Pn(e, t, n, this.options, r, i, a);
510
+ Bn(e, t, n, this.options, r, i, a);
465
511
  }
466
512
  describe() {
467
513
  return `Bar chart of ${this.options.series.map((e) => e.name).join(", ")}, ${this.options.categories.length} categories`;
@@ -470,10 +516,10 @@ var br = class extends j {
470
516
  return this.options.onBarClick !== void 0;
471
517
  }
472
518
  hits(e, t, n) {
473
- return F(e, t, n) !== null;
519
+ return M(e, t, n) !== null;
474
520
  }
475
521
  clickAt(e, t, n) {
476
- let r = F(e, t, n);
522
+ let r = M(e, t, n);
477
523
  r && this.options.onBarClick?.({
478
524
  category: r.category,
479
525
  series: r.series,
@@ -487,12 +533,12 @@ var br = class extends j {
487
533
  series: t
488
534
  });
489
535
  }
490
- }, Sr = class extends G {
536
+ }, Nr = class extends G {
491
537
  compute(e, t, n, r) {
492
- return un(this.options, e, t, n, r);
538
+ return gn(this.options, e, t, n, r);
493
539
  }
494
540
  draw(e, t, n, r, i, a) {
495
- Rn(e, t, n, this.options, r, i, a);
541
+ Wn(e, t, n, this.options, r, i, a);
496
542
  }
497
543
  describe() {
498
544
  let e = this.options.data.filter((e) => Number.isFinite(e.value) && e.value > 0).map((e) => e.label).join(", ");
@@ -502,21 +548,21 @@ var br = class extends j {
502
548
  return this.options.onSliceClick !== void 0;
503
549
  }
504
550
  hits(e, t, n) {
505
- return R(e, t, n) !== null;
551
+ return F(e, t, n) !== null;
506
552
  }
507
553
  clickAt(e, t, n) {
508
- let r = R(e, t, n);
554
+ let r = F(e, t, n);
509
555
  r && this.options.onSliceClick?.(r.slice);
510
556
  }
511
557
  update(e) {
512
558
  this.setOptions({ data: e });
513
559
  }
514
- }, Cr = class extends G {
560
+ }, Pr = class extends G {
515
561
  compute(e, t, n, r) {
516
- return pn(this.options, e, t, n, r);
562
+ return yn(this.options, e, t, n, r);
517
563
  }
518
564
  draw(e, t, n, r, i, a) {
519
- Wn(e, t, n, this.options, r, i, a);
565
+ Xn(e, t, n, this.options, r, i, a);
520
566
  }
521
567
  describe() {
522
568
  let e = this.options.series.reduce((e, t) => e + t.points.length, 0);
@@ -526,21 +572,21 @@ var br = class extends j {
526
572
  return this.options.onPointClick !== void 0;
527
573
  }
528
574
  hits(e, t, n) {
529
- return B(e, t, n) !== null;
575
+ return L(e, t, n) !== null;
530
576
  }
531
577
  clickAt(e, t, n) {
532
- let r = B(e, t, n);
578
+ let r = L(e, t, n);
533
579
  r && this.options.onPointClick?.(r.point, r.series);
534
580
  }
535
581
  update(e) {
536
582
  this.setOptions({ series: e });
537
583
  }
538
- }, wr = class extends G {
584
+ }, Fr = class extends G {
539
585
  compute(e, t, n, r) {
540
- return dn(this.options, e, t, n, r);
586
+ return _n(this.options, e, t, n, r);
541
587
  }
542
588
  draw(e, t, n, r, i, a) {
543
- Hn(e, t, n, this.options, r, i, a);
589
+ Jn(e, t, n, this.options, r, i, a);
544
590
  }
545
591
  describe() {
546
592
  return `Histogram of ${this.options.values.length} values`;
@@ -555,12 +601,12 @@ var br = class extends j {
555
601
  update(e) {
556
602
  this.setOptions({ values: e });
557
603
  }
558
- }, Tr = class extends G {
604
+ }, Ir = class extends G {
559
605
  compute(e, t, n, r) {
560
- return cn(this.options, e, t, n, r);
606
+ return mn(this.options, e, t, n, r);
561
607
  }
562
608
  draw(e, t, n, r, i, a) {
563
- Fn(e, t, n, this.options, r, i, a);
609
+ Vn(e, t, n, this.options, r, i, a);
564
610
  }
565
611
  describe() {
566
612
  let e = this.options.data.map((e) => e.date).filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e)).sort(), t = this.options.from ?? e[0], n = this.options.to ?? e[e.length - 1];
@@ -570,21 +616,21 @@ var br = class extends j {
570
616
  return this.options.onDayClick !== void 0;
571
617
  }
572
618
  hits(e, t, n) {
573
- return I(e, t, n)?.day !== void 0;
619
+ return N(e, t, n)?.day !== void 0;
574
620
  }
575
621
  clickAt(e, t, n) {
576
- let r = I(e, t, n)?.day;
622
+ let r = N(e, t, n)?.day;
577
623
  r && this.options.onDayClick?.(r);
578
624
  }
579
625
  update(e) {
580
626
  this.setOptions({ data: e });
581
627
  }
582
- }, K = 12, Er = class extends G {
628
+ }, K = 12, Lr = class extends G {
583
629
  compute(e, t, n, r) {
584
- return fn(this.options, e, t, n, r);
630
+ return vn(this.options, e, t, n, r);
585
631
  }
586
632
  draw(e, t, n, r, i, a) {
587
- Un(e, t, n, this.options, r, i, a);
633
+ Yn(e, t, n, this.options, r, i, a);
588
634
  }
589
635
  describe() {
590
636
  let { rows: e, columns: t } = this.options;
@@ -594,21 +640,21 @@ var br = class extends j {
594
640
  return this.options.onCellClick !== void 0;
595
641
  }
596
642
  hits(e, t, n) {
597
- return L(e, t, n) !== null;
643
+ return P(e, t, n) !== null;
598
644
  }
599
645
  clickAt(e, t, n) {
600
- let r = L(e, t, n);
646
+ let r = P(e, t, n);
601
647
  r && this.options.onCellClick?.(r.cell);
602
648
  }
603
649
  update(e) {
604
650
  this.setOptions({ values: e });
605
651
  }
606
- }, Dr = class extends G {
652
+ }, Rr = class extends G {
607
653
  compute(e, t, n, r) {
608
- return ln(this.options, e, t, n, r);
654
+ return hn(this.options, e, t, n, r);
609
655
  }
610
656
  draw(e, t, n, r, i, a) {
611
- In(e, t, n, this.options, r, i, a);
657
+ Hn(e, t, n, this.options, r, i, a);
612
658
  }
613
659
  describe() {
614
660
  return `Counter-clock chart of price against volume, ${this.options.period ?? 25}-bar averages`;
@@ -617,19 +663,19 @@ var br = class extends j {
617
663
  return this.options.onPointClick !== void 0;
618
664
  }
619
665
  hits(e, t, n) {
620
- return z(e, t, n) !== null;
666
+ return I(e, t, n) !== null;
621
667
  }
622
668
  clickAt(e, t, n) {
623
- let r = z(e, t, n);
669
+ let r = I(e, t, n);
624
670
  r && this.options.onPointClick?.(r.point);
625
671
  }
626
672
  getPhase() {
627
- return gn(vn(this.options.data, this.options.period ?? 25, Yn(this.options)));
673
+ return Sn(wn(this.options.data, this.options.period ?? 25, tr(this.options)));
628
674
  }
629
675
  update(e) {
630
676
  this.setOptions({ data: e });
631
677
  }
632
- }, Or = [
678
+ }, zr = [
633
679
  "Jan",
634
680
  "Feb",
635
681
  "Mar",
@@ -664,7 +710,7 @@ function Y(e) {
664
710
  if (e.length === 0) return [];
665
711
  let t = [];
666
712
  for (let n of e) {
667
- let e = ot(n.time, "1M"), r = t[t.length - 1];
713
+ let e = ft(n.time, "1M"), r = t[t.length - 1];
668
714
  r && r.key === e ? r.close = n.equity : t.push({
669
715
  key: e,
670
716
  close: n.equity
@@ -677,7 +723,7 @@ function Y(e) {
677
723
  let a = new Date(e.key), o = a.getUTCFullYear(), s = a.getUTCMonth();
678
724
  r.push({
679
725
  id: `${o}-${String(s + 1).padStart(2, "0")}`,
680
- label: Or[s],
726
+ label: zr[s],
681
727
  group: String(o),
682
728
  value: i
683
729
  });
@@ -737,9 +783,9 @@ function Q(e) {
737
783
  //#endregion
738
784
  //#region src/finance/PerformanceDashboard.ts
739
785
  function $(e) {
740
- return !e || e === "dark" ? me : e === "light" ? f : e;
786
+ return !e || e === "dark" ? he : e === "light" ? Ee : e;
741
787
  }
742
- var kr = class {
788
+ var Br = class {
743
789
  options;
744
790
  theme;
745
791
  root;
@@ -888,6 +934,6 @@ var kr = class {
888
934
  }
889
935
  };
890
936
  //#endregion
891
- export { pt as AlertManager, mt as Animator, xr as BarChart, ht as BarCountdown, gt as BinanceAdapter, _t as BybitAdapter, vt as CANDLE_PATTERNS, de as CHART_STYLE_KEYS, Tr as CalendarChart, i as Chart, mr as ChartGrid, yt as ChartLegend, bt as ChartStateManager, xt as CoinbaseAdapter, St as CompareRenderer, Dr as CounterClockChart, Ct as CrosshairTooltip, wt as CurrentPriceLine, fe as DARK_TERMINAL, pe as DARK_THEME, he as DEFAULT_DRAWING_STYLE, r as DEFAULT_HISTORY_PAGE_SIZE, Tt as DEFAULT_LEGEND_CONFIG, Et as DEFAULT_MAX_WEBGL_CHARTS, ge as DEFAULT_RECONNECT, Dt as DEFAULT_SESSION_HOURS, _e as DEFAULT_SIGNAL_STYLE, ve as DEFAULT_STREAM_CONFIG, ye as DEFAULT_TIMEFRAME_FAVORITES, be as DEFAULT_TRADE_ZONE_STYLE, xe as DEFAULT_TRADING_CONFIG, Ot as DataExporter, e as DataManager, gr as DepthChart, Sr as DonutChart, ne as DragDropImporter, kt as DrawingBase, u as EXCHANGE_TIMEZONE, At as Easing, U as EquityCurveChart, br as GaugeChart, le as HISTORY_RETRY_MS, Se as HNX_SESSIONS, Ce as HOSE_SESSIONS, W as HeatmapChart, wr as HistogramChart, Mt as INDICATOR_CATEGORIES, Nt as IndicatorBase, Pt as IndicatorValueMap, Ft as KeyboardHandler, It as KrakenAdapter, d as LIGHT_THEME, ce as LayoutManager, oe as LayoutSession, p as MARKET_CRYPTO, m as MARKET_HNX, h as MARKET_HOSE, g as MARKET_HOSE_ETF, _ as MARKET_NYSE, v as MARKET_UPCOM, y as MARKET_VN30F, Lt as MAX_ALERT_BARS, te as MAX_LAYOUT_NAME, Rt as MIN_ALERT_BARS, b as MS_TIME_THRESHOLD, Er as MatrixChart, zt as MockAdapter, c as PLUGIN_API_VERSION, x as PRICE_SOURCES, Bt as PaperExecutionAdapter, kr as PerformanceDashboard, se as PluginManager, Vt as PollingAdapter, Ht as RANGE_PRESETS, Ut as ReplayManager, Wt as ResamplingAdapter, Cr as ScatterChart, N as Screenshot, Gt as SessionBreaks, Kt as SessionShading, qt as SignalMarkerManager, hr as SparklineChart, Jt as StreamManager, S as TC_PALETTE, C as TC_SERIES_COLORS, w as TIMEFRAMES_CRYPTO, T as TIMEFRAMES_FOREX, E as TIMEFRAMES_STOCK, ue as ThemeManager, Yt as TickAggregator, Xt as TickBarAdapter, Zt as TickBarBuilder, Qt as TradeZoneManager, D as UPCOM_SESSIONS, $t as UndoRedoManager, O as VN30F_SESSIONS, k as VN_COLORS, A as VOLUME_ALPHA, en as VolumeRenderer, _r as WaterfallChart, tn as Watermark, nn as WebSocketAdapter, an as barIndexToX, we as barTimeUnit, Te as barsAreDaily, ie as cleanLayoutName, a as clearGlobalPlugins, J as computeDrawdownCurve, Y as computeMonthlyReturns, Ee as computePriceLimits, mn as correlationMatrix, hn as counterClockPhase, _n as counterClockPoints, De as createVNTheme, yn as detectCandlePatterns, Oe as formatFraction, ke as formatNumber, bn as formatTooltipTime, Ae as formatVND, je as formatVolumeLoc, Me as fractionTick, Ne as getCurrentSession, o as getGlobalPlugins, Pe as getLocale, xn as histogramBins, Sn as indicatorCategory, Fe as indicatorSource, Cn as isPriceLevelAlert, Ie as isPriceSource, Le as isTimeFrame, Re as isValidTimeZone, l as localStorageLayouts, Dn as lttbDownsample, On as lttbVisibleIndices, ze as marketStatus, n as memoryLayouts, kn as niceScale, Be as normalizeBar, Ve as normalizeBarTime, He as offsetAt, pr as overlayScale, s as overlaysForLayer, Ue as parseIndicatorSource, ae as parseOHLCV, We as parseTimeframe, Ge as pickBaseTimeframe, t as pluginKey, Ke as priceFormatterFor, qe as priceStepAt, An as priceToY, jn as priceToYMapper, Nn as rangePresetStart, Je as rankSymbols, Ye as readNews, Xe as readQuote, Ze as registerLocale, re as registerPlugin, Qe as resampleBars, $e as roundToPriceStep, et as scaleMarketPrices, Q as selectKeyStats, qn as servesTimeframe, tt as setLocale, Jn as setMaxWebGLCharts, nt as sourcePrice, rt as stepDecimals, fr as syncIndicators, it as t, at as tickBarCount, Xn as timeToX, st as timeframeToMs, Zn as timestampToBarIndex, q as toEquityPoints, $n as toHeikinAshi, er as toKagi, tr as toLineBreak, nr as toPointAndFigure, rr as toRangeBars, ir as toRenko, ee as unregisterPlugin, ct as vn30fContracts, lt as vn30fLastTradingDay, ut as volumeColor, dt as wallToUtc, ar as withResampling, or as withTickBars, sr as xToBarIndex, cr as xToTime, lr as yToPrice, ft as zoneOffsetMinutes };
937
+ export { yt as AlertManager, bt as Animator, Mr as BarChart, xt as BarCountdown, St as BinanceAdapter, Ct as BybitAdapter, wt as CANDLE_PATTERNS, fe as CHART_STYLE_KEYS, Ir as CalendarChart, a as Chart, Tr as ChartGrid, Tt as ChartLegend, Et as ChartStateManager, Dt as CoinbaseAdapter, Ot as CompareRenderer, Rr as CounterClockChart, kt as CrosshairTooltip, At as CurrentPriceLine, pe as DARK_TERMINAL, me as DARK_THEME, ge as DEFAULT_DRAWING_STYLE, ue as DEFAULT_HISTORY_PAGE_SIZE, jt as DEFAULT_LEGEND_CONFIG, Mt as DEFAULT_MAX_WEBGL_CHARTS, _e as DEFAULT_RECONNECT, Nt as DEFAULT_SESSION_HOURS, ve as DEFAULT_SIGNAL_STYLE, ye as DEFAULT_STREAM_CONFIG, be as DEFAULT_TIMEFRAME_FAVORITES, xe as DEFAULT_TRADE_ZONE_STYLE, Se as DEFAULT_TRADING_CONFIG, Pt as DataExporter, e as DataManager, Dr as DepthChart, Nr as DonutChart, re as DragDropImporter, Ft as DrawingBase, ee as EXCHANGE_TIMEZONE, ce as EXCHANGE_TIME_ZONE, It as Easing, U as EquityCurveChart, jr as GaugeChart, t as HISTORY_RETRY_MS, Ce as HNX_SESSIONS, we as HOSE_SESSIONS, W as HeatmapChart, Fr as HistogramChart, Rt as INDICATOR_CATEGORIES, zt as IndicatorBase, Bt as IndicatorValueMap, Vt as KeyboardHandler, Ht as KrakenAdapter, Te as LIGHT_THEME, de as LayoutManager, se as LayoutSession, f as MARKET_CRYPTO, p as MARKET_HNX, m as MARKET_HOSE, h as MARKET_HOSE_ETF, g as MARKET_NYSE, _ as MARKET_UPCOM, v as MARKET_VN30F, Ut as MAX_ALERT_BARS, ne as MAX_LAYOUT_NAME, Wt as MIN_ALERT_BARS, y as MS_TIME_THRESHOLD, Lr as MatrixChart, Gt as MockAdapter, c as PLUGIN_API_VERSION, b as PRICE_SOURCES, Kt as PaperExecutionAdapter, Br as PerformanceDashboard, o as PluginManager, qt as PollingAdapter, Jt as RANGE_PRESETS, Yt as ReplayManager, Xt as ResamplingAdapter, Pr as ScatterChart, Zt as Screenshot, Qt as SessionBreaks, $t as SessionShading, en as SignalMarkerManager, Er as SparklineChart, tn as StreamManager, x as TC_PALETTE, S as TC_SERIES_COLORS, C as TIMEFRAMES_CRYPTO, w as TIMEFRAMES_FOREX, T as TIMEFRAMES_STOCK, i as ThemeManager, nn as TickAggregator, rn as TickBarAdapter, an as TickBarBuilder, on as TradeZoneManager, E as UPCOM_SESSIONS, A as UndoRedoManager, D as VN30F_SESSIONS, De as VN_COLORS, Oe as VOLUME_ALPHA, sn as VolumeRenderer, Or as WaterfallChart, cn as Watermark, ln as WebSocketAdapter, dn as barIndexToX, ke as barTimeUnit, Ae as barsAreDaily, ae as cleanLayoutName, s as clearGlobalPlugins, J as computeDrawdownCurve, Y as computeMonthlyReturns, je as computePriceLimits, bn as correlationMatrix, xn as counterClockPhase, Cn as counterClockPoints, Me as createVNTheme, Tn as detectCandlePatterns, Cr as feedBars, Ne as formatFraction, Pe as formatNumber, En as formatTooltipTime, Fe as formatVND, Ie as formatVolumeLoc, Le as fractionTick, Re as getCurrentSession, ie as getGlobalPlugins, ze as getLocale, Dn as histogramBins, On as indicatorCategory, Be as indicatorSource, kn as isPriceLevelAlert, Ve as isPriceSource, He as isTimeFrame, Ue as isValidTimeZone, u as localStorageLayouts, Nn as lttbDownsample, Pn as lttbVisibleIndices, We as marketStatus, r as memoryLayouts, Fn as niceScale, Ge as normalizeBar, Ke as normalizeBarTime, qe as offsetAt, wr as overlayScale, n as overlaysForLayer, Je as parseIndicatorSource, oe as parseOHLCV, Ye as parseTimeframe, Xe as pickBaseTimeframe, le as pluginKey, Ze as priceFormatterFor, Qe as priceStepAt, In as priceToY, Ln as priceToYMapper, zn as rangePresetStart, $e as rankSymbols, et as readNews, tt as readQuote, nt as registerLocale, te as registerPlugin, rt as resampleBars, it as roundToPriceStep, at as scaleMarketPrices, Q as selectKeyStats, $n as servesTimeframe, ot as setLocale, er as setMaxWebGLCharts, st as sourcePrice, ct as stepDecimals, lt as symbolTimeZone, vr as syncIndicators, ut as t, dt as tickBarCount, nr as timeToX, pt as timeframeToMs, rr as timestampToBarIndex, q as toEquityPoints, ar as toHeikinAshi, or as toKagi, sr as toLineBreak, cr as toPointAndFigure, lr as toRangeBars, ur as toRenko, l as unregisterPlugin, mt as vn30fContracts, ht as vn30fLastTradingDay, gt as volumeColor, _t as wallToUtc, dr as withResampling, fr as withTickBars, pr as xToBarIndex, mr as xToTime, hr as yToPrice, vt as zoneOffsetMinutes };
892
938
 
893
939
  //# sourceMappingURL=index.js.map