@tradecanvas/commons 1.2.0 → 1.3.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/constants/themes.d.ts +29 -0
- package/dist/constants/themes.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +139 -122
- package/dist/index.js.map +1 -1
- package/dist/types/chart.d.ts +13 -2
- package/dist/types/chart.d.ts.map +1 -1
- package/dist/types/finance.d.ts +11 -0
- package/dist/types/finance.d.ts.map +1 -1
- package/dist/types/rendering.d.ts +10 -2
- package/dist/types/rendering.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
//#region src/types/rendering.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e[e.Background = 0] = "Background", e[e.Main = 1] = "Main", e[e.Panel = 2] = "Panel", e[e.Overlay = 3] = "Overlay", e[e.UI = 4] = "UI", e;
|
|
3
|
+
return e[e.Background = 0] = "Background", e[e.Main = 1] = "Main", e[e.Panel = 2] = "Panel", e[e.Overlay = 3] = "Overlay", e[e.UI = 4] = "UI", e[e.Hover = 5] = "Hover", e;
|
|
4
4
|
}({}), t = {
|
|
5
|
-
color: "#
|
|
5
|
+
color: "#4c8dff",
|
|
6
6
|
lineWidth: 1,
|
|
7
7
|
lineStyle: "solid",
|
|
8
|
-
fillColor: "rgba(
|
|
8
|
+
fillColor: "rgba(76, 141, 255, 0.1)",
|
|
9
9
|
fillOpacity: .1,
|
|
10
10
|
fontSize: 12
|
|
11
11
|
}, n = {
|
|
12
12
|
enabled: !0,
|
|
13
13
|
orderColors: {
|
|
14
|
-
buy: "#
|
|
15
|
-
sell: "#
|
|
14
|
+
buy: "#1fa874",
|
|
15
|
+
sell: "#e8505b"
|
|
16
16
|
},
|
|
17
17
|
positionColors: {
|
|
18
|
-
profit: "#
|
|
19
|
-
loss: "#
|
|
20
|
-
entry: "#
|
|
18
|
+
profit: "#1fa874",
|
|
19
|
+
loss: "#e8505b",
|
|
20
|
+
entry: "#4c8dff"
|
|
21
21
|
},
|
|
22
22
|
depthOverlay: {
|
|
23
23
|
enabled: !1,
|
|
24
|
-
bidColor: "rgba(
|
|
25
|
-
askColor: "rgba(
|
|
24
|
+
bidColor: "rgba(31, 168, 116,0.15)",
|
|
25
|
+
askColor: "rgba(232, 80, 91,0.15)",
|
|
26
26
|
maxWidth: 100
|
|
27
27
|
},
|
|
28
28
|
contextMenu: { enabled: !0 },
|
|
29
29
|
pricePrecision: 2,
|
|
30
30
|
dragThreshold: 3
|
|
31
31
|
}, r = {
|
|
32
|
-
longColor: "#
|
|
33
|
-
shortColor: "#
|
|
32
|
+
longColor: "#1fa874",
|
|
33
|
+
shortColor: "#e8505b",
|
|
34
34
|
neutralColor: "#9E9E9E",
|
|
35
35
|
arrowSize: 12,
|
|
36
36
|
showLabel: !0,
|
|
37
37
|
showConfidence: !0
|
|
38
38
|
}, i = {
|
|
39
|
-
profitColor: "#
|
|
40
|
-
lossColor: "#
|
|
41
|
-
activeColor: "#
|
|
39
|
+
profitColor: "#1fa874",
|
|
40
|
+
lossColor: "#e8505b",
|
|
41
|
+
activeColor: "#4c8dff",
|
|
42
42
|
fillOpacity: .12,
|
|
43
43
|
borderWidth: 1,
|
|
44
44
|
showLabel: !0,
|
|
@@ -137,12 +137,12 @@ function g(e, t) {
|
|
|
137
137
|
function _(e, t = 1) {
|
|
138
138
|
return `rgba(${parseInt(e.slice(1, 3), 16)}, ${parseInt(e.slice(3, 5), 16)}, ${parseInt(e.slice(5, 7), 16)}, ${t})`;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function v(e, t) {
|
|
141
141
|
if (e.startsWith("#")) return _(e, t);
|
|
142
142
|
let n = e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
143
143
|
return n ? `rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})` : e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function ne(e, t, n) {
|
|
146
146
|
let r = (e) => (e = e.replace("#", ""), e.length === 3 && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), {
|
|
147
147
|
r: parseInt(e.slice(0, 2), 16),
|
|
148
148
|
g: parseInt(e.slice(2, 4), 16),
|
|
@@ -152,7 +152,7 @@ function re(e, t, n) {
|
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/utils/time.ts
|
|
155
|
-
var
|
|
155
|
+
var y = {
|
|
156
156
|
"1s": 1e3,
|
|
157
157
|
"5s": 5e3,
|
|
158
158
|
"15s": 15e3,
|
|
@@ -180,11 +180,11 @@ var v = {
|
|
|
180
180
|
"6M": 15552e6,
|
|
181
181
|
"12M": 31536e6
|
|
182
182
|
};
|
|
183
|
-
function
|
|
184
|
-
return
|
|
183
|
+
function re(e) {
|
|
184
|
+
return y[e];
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
let n = new Date(e), r =
|
|
186
|
+
function ie(e, t) {
|
|
187
|
+
let n = new Date(e), r = y[t];
|
|
188
188
|
return r >= 864e5 ? n.toLocaleDateString(void 0, {
|
|
189
189
|
month: "short",
|
|
190
190
|
day: "numeric"
|
|
@@ -197,11 +197,11 @@ function ae(e, t) {
|
|
|
197
197
|
second: "2-digit"
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
let n =
|
|
200
|
+
function ae(e, t) {
|
|
201
|
+
let n = y[t];
|
|
202
202
|
return Math.floor(e / n) * n;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function oe(e, t) {
|
|
205
205
|
if (t === null) {
|
|
206
206
|
let t = new Date(e);
|
|
207
207
|
return {
|
|
@@ -221,15 +221,15 @@ function se(e, t) {
|
|
|
221
221
|
minutes: n.getUTCMinutes()
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function se(e) {
|
|
225
225
|
return e.hours === 0 && e.minutes === 0;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ce(e) {
|
|
228
228
|
let t = e === null ? -(/* @__PURE__ */ new Date()).getTimezoneOffset() : e, n = t >= 0 ? "+" : "-", r = Math.abs(t), i = Math.floor(r / 60), a = r % 60;
|
|
229
229
|
return a === 0 ? `UTC${n}${i}` : `UTC${n}${i}:${String(a).padStart(2, "0")}`;
|
|
230
230
|
}
|
|
231
|
-
var
|
|
232
|
-
function
|
|
231
|
+
var b = Date.UTC(1970, 0, 5);
|
|
232
|
+
function le(e) {
|
|
233
233
|
let t = /^(\d+)([smhdwM])$/.exec(e);
|
|
234
234
|
return t ? {
|
|
235
235
|
count: parseInt(t[1], 10),
|
|
@@ -239,54 +239,54 @@ function b(e) {
|
|
|
239
239
|
unit: "m"
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
let { count: r, unit: i } =
|
|
242
|
+
function ue(e, t, n = 1) {
|
|
243
|
+
let { count: r, unit: i } = le(t);
|
|
244
244
|
if (i === "s" || i === "m" || i === "h" || i === "d") {
|
|
245
|
-
let n =
|
|
245
|
+
let n = y[t];
|
|
246
246
|
return Math.floor(e / n) * n;
|
|
247
247
|
}
|
|
248
248
|
let a = new Date(e);
|
|
249
249
|
if (i === "w") {
|
|
250
|
-
let e =
|
|
250
|
+
let e = y["1d"], t = (a.getUTCDay() - n + 7) % 7, i = Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate() - t);
|
|
251
251
|
if (r <= 1) return i;
|
|
252
|
-
let o = Math.floor((i -
|
|
253
|
-
return
|
|
252
|
+
let o = Math.floor((i - b) / (7 * e));
|
|
253
|
+
return b + Math.floor(o / r) * r * 7 * e;
|
|
254
254
|
}
|
|
255
255
|
let o = a.getUTCFullYear() * 12 + a.getUTCMonth(), s = Math.floor(o / r) * r;
|
|
256
256
|
return Date.UTC(Math.floor(s / 12), s % 12, 1);
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/utils/precision.ts
|
|
260
|
-
var
|
|
261
|
-
function
|
|
262
|
-
let n = `${e}|${t}`, r =
|
|
263
|
-
return r || (
|
|
260
|
+
var x = 64, S = /* @__PURE__ */ new Map();
|
|
261
|
+
function C(e, t) {
|
|
262
|
+
let n = `${e}|${t}`, r = S.get(n);
|
|
263
|
+
return r || (S.size >= x && S.clear(), r = new Intl.NumberFormat(e, {
|
|
264
264
|
minimumFractionDigits: t,
|
|
265
265
|
maximumFractionDigits: t
|
|
266
|
-
}),
|
|
266
|
+
}), S.set(n, r)), r;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function w(e, t = 2, n = "en-US") {
|
|
269
|
+
return C(n, t).format(e);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function T(e, t) {
|
|
272
272
|
if (!(t > e) || !Number.isFinite(e) || !Number.isFinite(t)) return 2;
|
|
273
273
|
let n = f(e, t, 8);
|
|
274
274
|
return n > 0 && n < 1 ? Math.ceil(-Math.log10(n)) + 1 : 2;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function E(e, t, n, r = 2, i = "en-US") {
|
|
277
277
|
if ((t === "percentage" || t === "indexedTo100") && n && n !== 0) {
|
|
278
278
|
if (t === "percentage") {
|
|
279
279
|
let t = (e / n - 1) * 100;
|
|
280
280
|
return `${t > 0 ? "+" : ""}${t.toFixed(2)}%`;
|
|
281
281
|
}
|
|
282
|
-
return
|
|
282
|
+
return w(e / n * 100, 2, i);
|
|
283
283
|
}
|
|
284
|
-
return
|
|
284
|
+
return w(e, r, i);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function D(e) {
|
|
287
287
|
return e >= 1e9 ? (e / 1e9).toFixed(2) + "B" : e >= 1e6 ? (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? (e / 1e3).toFixed(2) + "K" : e.toFixed(0);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function O(e) {
|
|
290
290
|
let t = 0;
|
|
291
291
|
for (let n of e) {
|
|
292
292
|
let e = n.toString(), r = e.indexOf(".");
|
|
@@ -296,7 +296,7 @@ function k(e) {
|
|
|
296
296
|
}
|
|
297
297
|
//#endregion
|
|
298
298
|
//#region src/constants/defaults.ts
|
|
299
|
-
var
|
|
299
|
+
var k = {
|
|
300
300
|
autoScale: !0,
|
|
301
301
|
rightMargin: 5,
|
|
302
302
|
minBarSpacing: 2,
|
|
@@ -307,7 +307,7 @@ var A = {
|
|
|
307
307
|
vLineStyle: "solid"
|
|
308
308
|
},
|
|
309
309
|
crosshair: { mode: "magnet" }
|
|
310
|
-
},
|
|
310
|
+
}, A = [
|
|
311
311
|
"1s",
|
|
312
312
|
"1m",
|
|
313
313
|
"3m",
|
|
@@ -324,7 +324,7 @@ var A = {
|
|
|
324
324
|
"3d",
|
|
325
325
|
"1w",
|
|
326
326
|
"1M"
|
|
327
|
-
],
|
|
327
|
+
], j = [
|
|
328
328
|
"1m",
|
|
329
329
|
"5m",
|
|
330
330
|
"15m",
|
|
@@ -338,7 +338,7 @@ var A = {
|
|
|
338
338
|
"3M",
|
|
339
339
|
"6M",
|
|
340
340
|
"12M"
|
|
341
|
-
],
|
|
341
|
+
], M = [
|
|
342
342
|
"1m",
|
|
343
343
|
"5m",
|
|
344
344
|
"15m",
|
|
@@ -348,7 +348,7 @@ var A = {
|
|
|
348
348
|
"1d",
|
|
349
349
|
"1w",
|
|
350
350
|
"1M"
|
|
351
|
-
],
|
|
351
|
+
], N = [
|
|
352
352
|
"1m",
|
|
353
353
|
"5m",
|
|
354
354
|
"15m",
|
|
@@ -356,52 +356,69 @@ var A = {
|
|
|
356
356
|
"4h",
|
|
357
357
|
"1d",
|
|
358
358
|
"1w"
|
|
359
|
-
],
|
|
359
|
+
], P = 8, F = 2, I = 70, L = 30, R = 60, z = 120, B = {
|
|
360
360
|
family: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif",
|
|
361
361
|
sizeSmall: 10,
|
|
362
362
|
sizeMedium: 12,
|
|
363
363
|
sizeLarge: 14
|
|
364
|
-
},
|
|
364
|
+
}, V = {
|
|
365
|
+
amber: "#f2a93b",
|
|
366
|
+
up: "#1fa874",
|
|
367
|
+
down: "#e8505b",
|
|
368
|
+
ochre: "#c98316",
|
|
369
|
+
blue: "#4c8dff",
|
|
370
|
+
violet: "#a57cff",
|
|
371
|
+
cyan: "#1398a8",
|
|
372
|
+
rose: "#e25592",
|
|
373
|
+
neutral: "#7d8696",
|
|
374
|
+
ink: "#0c1016"
|
|
375
|
+
}, H = [
|
|
376
|
+
V.blue,
|
|
377
|
+
V.ochre,
|
|
378
|
+
V.violet,
|
|
379
|
+
V.cyan,
|
|
380
|
+
V.rose
|
|
381
|
+
], U = {
|
|
365
382
|
name: "dark",
|
|
366
|
-
background:
|
|
367
|
-
text: "#
|
|
368
|
-
textSecondary: "#
|
|
369
|
-
grid: "#
|
|
370
|
-
crosshair: "#
|
|
371
|
-
candleUp: "#
|
|
372
|
-
candleDown: "#
|
|
373
|
-
candleUpWick: "#
|
|
374
|
-
candleDownWick: "#
|
|
375
|
-
lineColor:
|
|
376
|
-
areaTopColor: "rgba(
|
|
377
|
-
areaBottomColor: "rgba(
|
|
378
|
-
volumeUp: "rgba(
|
|
379
|
-
volumeDown: "rgba(
|
|
380
|
-
axisLine: "#
|
|
381
|
-
axisLabel: "#
|
|
382
|
-
axisLabelBackground: "#
|
|
383
|
-
font:
|
|
384
|
-
},
|
|
383
|
+
background: V.ink,
|
|
384
|
+
text: "#d9dde4",
|
|
385
|
+
textSecondary: "#7d8696",
|
|
386
|
+
grid: "#161b23",
|
|
387
|
+
crosshair: "#8a93a3",
|
|
388
|
+
candleUp: "#3ccf91",
|
|
389
|
+
candleDown: "#f0616d",
|
|
390
|
+
candleUpWick: "#3ccf91",
|
|
391
|
+
candleDownWick: "#f0616d",
|
|
392
|
+
lineColor: V.amber,
|
|
393
|
+
areaTopColor: "rgba(242, 169, 59, 0.32)",
|
|
394
|
+
areaBottomColor: "rgba(242, 169, 59, 0.0)",
|
|
395
|
+
volumeUp: "rgba(60, 207, 145, 0.28)",
|
|
396
|
+
volumeDown: "rgba(240, 97, 109, 0.28)",
|
|
397
|
+
axisLine: "#1f2630",
|
|
398
|
+
axisLabel: "#c3c9d3",
|
|
399
|
+
axisLabelBackground: "#1f2630",
|
|
400
|
+
font: B
|
|
401
|
+
}, de = {
|
|
385
402
|
name: "light",
|
|
386
|
-
background: "#
|
|
387
|
-
text: "#
|
|
388
|
-
textSecondary: "#
|
|
389
|
-
grid: "#
|
|
390
|
-
crosshair: "#
|
|
391
|
-
candleUp: "#
|
|
392
|
-
candleDown: "#
|
|
393
|
-
candleUpWick: "#
|
|
394
|
-
candleDownWick: "#
|
|
395
|
-
lineColor: "#
|
|
396
|
-
areaTopColor: "rgba(
|
|
397
|
-
areaBottomColor: "rgba(
|
|
398
|
-
volumeUp: "rgba(
|
|
399
|
-
volumeDown: "rgba(
|
|
400
|
-
axisLine: "#
|
|
401
|
-
axisLabel: "#
|
|
402
|
-
axisLabelBackground: "#
|
|
403
|
-
font:
|
|
404
|
-
},
|
|
403
|
+
background: "#ffffff",
|
|
404
|
+
text: "#0f131a",
|
|
405
|
+
textSecondary: "#6b7380",
|
|
406
|
+
grid: "#eef0f3",
|
|
407
|
+
crosshair: "#8a93a3",
|
|
408
|
+
candleUp: "#16a36a",
|
|
409
|
+
candleDown: "#d9414f",
|
|
410
|
+
candleUpWick: "#16a36a",
|
|
411
|
+
candleDownWick: "#d9414f",
|
|
412
|
+
lineColor: "#c77a0a",
|
|
413
|
+
areaTopColor: "rgba(199, 122, 10, 0.24)",
|
|
414
|
+
areaBottomColor: "rgba(199, 122, 10, 0.0)",
|
|
415
|
+
volumeUp: "rgba(22, 163, 106, 0.25)",
|
|
416
|
+
volumeDown: "rgba(217, 65, 79, 0.25)",
|
|
417
|
+
axisLine: "#dde1e7",
|
|
418
|
+
axisLabel: "#3f4754",
|
|
419
|
+
axisLabelBackground: "#eef0f3",
|
|
420
|
+
font: B
|
|
421
|
+
}, fe = {
|
|
405
422
|
name: "terminal",
|
|
406
423
|
background: "#0E0E0E",
|
|
407
424
|
text: "#C0C0C0",
|
|
@@ -633,19 +650,19 @@ var A = {
|
|
|
633
650
|
numberDecimalSeparator: ",",
|
|
634
651
|
numberGroupSeparator: "."
|
|
635
652
|
}, K = new Map([["en", W], ["vi", G]]), q = "en", J = W;
|
|
636
|
-
function
|
|
653
|
+
function pe(e) {
|
|
637
654
|
q = e, J = K.get(e) ?? W;
|
|
638
655
|
}
|
|
639
|
-
function
|
|
656
|
+
function me() {
|
|
640
657
|
return q;
|
|
641
658
|
}
|
|
642
|
-
function
|
|
659
|
+
function he(e) {
|
|
643
660
|
return J[e] ?? W[e] ?? e;
|
|
644
661
|
}
|
|
645
|
-
function
|
|
662
|
+
function ge(e, t) {
|
|
646
663
|
K.set(e, t);
|
|
647
664
|
}
|
|
648
|
-
function
|
|
665
|
+
function _e(e) {
|
|
649
666
|
return K.get(e ?? q) ?? W;
|
|
650
667
|
}
|
|
651
668
|
function Y(e, t = 2, n) {
|
|
@@ -653,22 +670,22 @@ function Y(e, t = 2, n) {
|
|
|
653
670
|
for (let e = l.length - 1, t = 0; e >= 0; e--, t++) t > 0 && t % 3 == 0 && (u = a + u), u = l[e] + u;
|
|
654
671
|
return c && (u = "-" + u), s ? u + i + s : u;
|
|
655
672
|
}
|
|
656
|
-
function
|
|
673
|
+
function ve(e) {
|
|
657
674
|
return Y(e, 0, "vi");
|
|
658
675
|
}
|
|
659
|
-
function
|
|
676
|
+
function ye(e, t) {
|
|
660
677
|
return e >= 1e9 ? Y(e / 1e9, 2, t ?? q) + "B" : e >= 1e6 ? Y(e / 1e6, 2, t ?? q) + "M" : e >= 1e3 ? Y(e / 1e3, 2, t ?? q) + "K" : Y(e, 0, t ?? q);
|
|
661
678
|
}
|
|
662
679
|
//#endregion
|
|
663
680
|
//#region src/market/presets.ts
|
|
664
|
-
var
|
|
681
|
+
var X = {
|
|
665
682
|
up: "#FF0000",
|
|
666
683
|
down: "#0000FF",
|
|
667
684
|
unchanged: "#FFD700",
|
|
668
685
|
ceiling: "#FF00FF",
|
|
669
686
|
floor: "#00FFFF",
|
|
670
687
|
reference: "#FFD700"
|
|
671
|
-
},
|
|
688
|
+
}, Z = [
|
|
672
689
|
{
|
|
673
690
|
name: "ATO",
|
|
674
691
|
startTime: "09:00",
|
|
@@ -699,7 +716,7 @@ var Z = {
|
|
|
699
716
|
endTime: "14:45",
|
|
700
717
|
type: "preClose"
|
|
701
718
|
}
|
|
702
|
-
],
|
|
719
|
+
], Q = [
|
|
703
720
|
{
|
|
704
721
|
name: "Phiên 1",
|
|
705
722
|
startTime: "09:00",
|
|
@@ -724,7 +741,7 @@ var Z = {
|
|
|
724
741
|
endTime: "14:45",
|
|
725
742
|
type: "preClose"
|
|
726
743
|
}
|
|
727
|
-
],
|
|
744
|
+
], be = {
|
|
728
745
|
type: "stock",
|
|
729
746
|
exchange: "HOSE",
|
|
730
747
|
currency: "VND",
|
|
@@ -736,9 +753,9 @@ var Z = {
|
|
|
736
753
|
ceilingPercent: 7,
|
|
737
754
|
floorPercent: 7
|
|
738
755
|
},
|
|
739
|
-
sessions:
|
|
740
|
-
colorScheme:
|
|
741
|
-
},
|
|
756
|
+
sessions: Z,
|
|
757
|
+
colorScheme: X
|
|
758
|
+
}, xe = {
|
|
742
759
|
type: "stock",
|
|
743
760
|
exchange: "HNX",
|
|
744
761
|
currency: "VND",
|
|
@@ -750,9 +767,9 @@ var Z = {
|
|
|
750
767
|
ceilingPercent: 10,
|
|
751
768
|
floorPercent: 10
|
|
752
769
|
},
|
|
753
|
-
sessions:
|
|
754
|
-
colorScheme:
|
|
755
|
-
},
|
|
770
|
+
sessions: Q,
|
|
771
|
+
colorScheme: X
|
|
772
|
+
}, Se = {
|
|
756
773
|
type: "stock",
|
|
757
774
|
exchange: "UPCOM",
|
|
758
775
|
currency: "VND",
|
|
@@ -764,14 +781,14 @@ var Z = {
|
|
|
764
781
|
ceilingPercent: 15,
|
|
765
782
|
floorPercent: 15
|
|
766
783
|
},
|
|
767
|
-
sessions:
|
|
768
|
-
colorScheme:
|
|
769
|
-
},
|
|
784
|
+
sessions: Q,
|
|
785
|
+
colorScheme: X
|
|
786
|
+
}, Ce = {
|
|
770
787
|
type: "crypto",
|
|
771
788
|
currency: "USDT",
|
|
772
789
|
pricePrecision: 2,
|
|
773
790
|
priceLimits: { enabled: !1 }
|
|
774
|
-
},
|
|
791
|
+
}, $ = {
|
|
775
792
|
type: "stock",
|
|
776
793
|
exchange: "NYSE",
|
|
777
794
|
currency: "USD",
|
|
@@ -799,18 +816,18 @@ var Z = {
|
|
|
799
816
|
}
|
|
800
817
|
]
|
|
801
818
|
};
|
|
802
|
-
function
|
|
819
|
+
function we(e) {
|
|
803
820
|
return {
|
|
804
821
|
...e,
|
|
805
|
-
candleUp:
|
|
806
|
-
candleDown:
|
|
807
|
-
candleUpWick:
|
|
808
|
-
candleDownWick:
|
|
822
|
+
candleUp: X.up,
|
|
823
|
+
candleDown: X.down,
|
|
824
|
+
candleUpWick: X.up,
|
|
825
|
+
candleDownWick: X.down,
|
|
809
826
|
volumeUp: "rgba(255, 0, 0, 0.3)",
|
|
810
827
|
volumeDown: "rgba(0, 0, 255, 0.3)"
|
|
811
828
|
};
|
|
812
829
|
}
|
|
813
|
-
function
|
|
830
|
+
function Te(e, t) {
|
|
814
831
|
if (!t.priceLimits?.enabled || !t.priceLimits.ceilingPercent) return null;
|
|
815
832
|
let n = t.priceLimits.ceilingPercent / 100, r = (t.priceLimits.floorPercent ?? t.priceLimits.ceilingPercent) / 100;
|
|
816
833
|
return {
|
|
@@ -819,12 +836,12 @@ function Ce(e, t) {
|
|
|
819
836
|
reference: e
|
|
820
837
|
};
|
|
821
838
|
}
|
|
822
|
-
function
|
|
839
|
+
function Ee(e) {
|
|
823
840
|
let t = /* @__PURE__ */ new Date(), n = `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
824
841
|
for (let t of e) if (n >= t.startTime && n < t.endTime) return t;
|
|
825
842
|
return null;
|
|
826
843
|
}
|
|
827
844
|
//#endregion
|
|
828
|
-
export {
|
|
845
|
+
export { fe as DARK_TERMINAL, U as DARK_THEME, F as DEFAULT_BAR_SPACING, P as DEFAULT_BAR_WIDTH, k as DEFAULT_CHART_OPTIONS, t as DEFAULT_DRAWING_STYLE, z as DEFAULT_PANEL_HEIGHT, a as DEFAULT_RECONNECT, r as DEFAULT_SIGNAL_STYLE, o as DEFAULT_STREAM_CONFIG, N as DEFAULT_TIMEFRAME_FAVORITES, i as DEFAULT_TRADE_ZONE_STYLE, n as DEFAULT_TRADING_CONFIG, Q as HNX_SESSIONS, Z as HOSE_SESSIONS, de as LIGHT_THEME, e as LayerType, Ce as MARKET_CRYPTO, xe as MARKET_HNX, be as MARKET_HOSE, $ as MARKET_NYSE, Se as MARKET_UPCOM, R as MIN_PANEL_HEIGHT, I as PRICE_AXIS_WIDTH, V as TC_PALETTE, H as TC_SERIES_COLORS, A as TIMEFRAMES_CRYPTO, M as TIMEFRAMES_FOREX, j as TIMEFRAMES_STOCK, L as TIME_AXIS_HEIGHT, X as VN_COLORS, ae as alignToTimeframe, T as autoPricePrecision, s as clamp, Te as computePriceLimits, h as computePriceRange, f as computeTickStep, we as createVNTheme, O as detectPrecision, W as en, te as findBarIndex, Y as formatNumber, w as formatPrice, E as formatPriceScaleLabel, ie as formatTimestamp, ve as formatVND, D as formatVolume, ye as formatVolumeLoc, Ee as getCurrentSession, me as getLocale, _e as getLocaleStrings, _ as hexToRgba, l as inverseLerp, se as isDateOnly, c as lerp, ne as lerpColor, g as mergeBar, d as niceNumber, m as normalizeBar, p as normalizeBarTime, ge as registerLocale, u as roundToStep, pe as setLocale, ee as sliceVisibleData, he as t, oe as timeParts, ue as timeframeBucketStart, re as timeframeToMs, ce as tzLabel, G as vi, v as withAlpha };
|
|
829
846
|
|
|
830
847
|
//# sourceMappingURL=index.js.map
|