@nabeeltahirdeveloper/chart-sdk 2.3.6-beta → 2.3.6-beta-v2

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.
@@ -7823,8 +7823,8 @@ const vu = (i) => {
7823
7823
  const pe = c && (j === "stream" || j === "response");
7824
7824
  if (c && (L || pe && te)) {
7825
7825
  const Te = {};
7826
- ["status", "statusText", "headers"].forEach((be) => {
7827
- Te[be] = he[be];
7826
+ ["status", "statusText", "headers"].forEach((Qe) => {
7827
+ Te[Qe] = he[Qe];
7828
7828
  });
7829
7829
  const Ue = fe.toFiniteNumber(he.headers.get("content-length")), [ye, ve] = L && ql(
7830
7830
  Ue,
@@ -10759,14 +10759,14 @@ const Wn = {
10759
10759
  symbols: "/symbols",
10760
10760
  trades: "/trades",
10761
10761
  account: "/api/user/account"
10762
- }, ...t }, l = t?.params || {}, [c, m] = Ne(r || "BTC/USD"), [C, T] = Ne(n || "M1"), [b, v] = Ne([]), [U, F] = Ne(!0), [M, N] = Ne([]), [W, L] = Ne(!1), [V, j] = Ne(1e5), [X, K] = Ne(null), [ee, Ae] = Ne([]), [ce, Z] = Ne(!0), [te, se] = Ne(!1), [le, ne] = Ne(!0), [he, pe] = Ne("candles"), [we, Te] = Ne(!1), [Ue, ye] = Ne("dark"), [ve, be] = Ne(!1), [Se, Ie] = Ne([]), Ze = et(null);
10762
+ }, ...t }, l = t?.params || {}, [c, m] = Ne(r || "BTC/USD"), [C, T] = Ne(n || "M1"), [b, v] = Ne([]), [U, F] = Ne(!0), [M, N] = Ne([]), [W, L] = Ne(!1), [V, j] = Ne(1e5), [X, K] = Ne(null), [ee, Ae] = Ne([]), [ce, Z] = Ne(!0), [te, se] = Ne(!1), [le, ne] = Ne(!0), [he, pe] = Ne("candles"), [we, Te] = Ne(!1), [Ue, ye] = Ne("dark"), [ve, Qe] = Ne(!1), [Se, Ie] = Ne([]), Ze = et(null);
10763
10763
  it(() => {
10764
10764
  Wn.setBaseUrl(s);
10765
10765
  }, [s]);
10766
10766
  const ze = et(/* @__PURE__ */ new Map()), Ce = et(null), ke = 1e3, Ee = vt(async () => {
10767
10767
  if (A)
10768
10768
  try {
10769
- const ge = localStorage.getItem("token");
10769
+ const ge = localStorage.getItem("token") ?? localStorage.getItem("authToken");
10770
10770
  if (!ge)
10771
10771
  return;
10772
10772
  L(!0);
@@ -10775,25 +10775,25 @@ const Wn = {
10775
10775
  });
10776
10776
  let Me = [];
10777
10777
  Array.isArray(me.data) ? Me = me.data : me.data?.data && Array.isArray(me.data.data) && (Me = me.data.data);
10778
- const Re = Me.filter((Qe) => Qe.closePrice === null || Qe.closePrice === void 0).map((Qe) => ({
10779
- id: Qe.id,
10778
+ const Re = Me.filter((be) => be.closePrice === null || be.closePrice === void 0).map((be) => ({
10779
+ id: be.id,
10780
10780
  ticket: 23,
10781
- symbol: Qe.symbol,
10782
- type: Qe.type,
10783
- volume: Qe.volume,
10784
- openPrice: Qe.openPrice ?? Qe.price,
10785
- stopLoss: Qe.stopLoss,
10786
- takeProfit: Qe.takeProfit,
10787
- comment: Qe.comment || "",
10781
+ symbol: be.symbol,
10782
+ type: be.type,
10783
+ volume: be.volume,
10784
+ openPrice: be.openPrice ?? be.price,
10785
+ stopLoss: be.stopLoss,
10786
+ takeProfit: be.takeProfit,
10787
+ comment: be.comment || "",
10788
10788
  status: "OPEN",
10789
10789
  swap: 0,
10790
- profit: Qe.profit || 0,
10790
+ profit: be.profit || 0,
10791
10791
  profitCurrency: "USD",
10792
10792
  time: new Date(
10793
- Qe.openedAt || Qe.openAt || Date.now()
10793
+ be.openedAt || be.openAt || Date.now()
10794
10794
  ).toLocaleTimeString(),
10795
- openAt: Qe.openedAt || Qe.openAt,
10796
- closeAt: Qe.closedAt || Qe.closeAt
10795
+ openAt: be.openedAt || be.openAt,
10796
+ closeAt: be.closedAt || be.closeAt
10797
10797
  }));
10798
10798
  N(Re);
10799
10799
  } catch (ge) {
@@ -10803,7 +10803,7 @@ const Wn = {
10803
10803
  }
10804
10804
  }, [s, A]), de = vt((ge, me) => !me || !ge.price || isNaN(me) || isNaN(ge.price) ? ge.profit || 0 : (ge?.type?.toUpperCase() === "BUY" ? me - ge.price : ge.price - me) * ge.volume, []), _e = vt(async () => {
10805
10805
  try {
10806
- const ge = localStorage.getItem("token");
10806
+ const ge = localStorage.getItem("token") ?? localStorage.getItem("authToken");
10807
10807
  if (!ge)
10808
10808
  return;
10809
10809
  const me = await dt.get(`${s}${a.account}`, {
@@ -10819,28 +10819,28 @@ const Wn = {
10819
10819
  }, [s]), Ye = vt(async () => {
10820
10820
  if (A)
10821
10821
  try {
10822
- const ge = localStorage.getItem("token");
10822
+ const ge = localStorage.getItem("token") ?? localStorage.getItem("authToken");
10823
10823
  if (!ge) return;
10824
10824
  const me = await dt.get(`${s}/trades/account/${A}`, {
10825
10825
  headers: { Authorization: `Bearer ${ge}` }
10826
10826
  });
10827
10827
  let Me = [];
10828
10828
  Array.isArray(me.data) ? Me = me.data : me.data?.data && Array.isArray(me.data.data) && (Me = me.data.data);
10829
- const Re = Me.filter((Qe) => Qe.closePrice !== null && Qe.closePrice !== void 0).map((Qe) => ({
10830
- id: Qe.id,
10829
+ const Re = Me.filter((be) => be.closePrice !== null && be.closePrice !== void 0).map((be) => ({
10830
+ id: be.id,
10831
10831
  ticket: 23,
10832
- symbol: Qe.symbol,
10833
- type: Qe.type,
10834
- volume: Qe.volume,
10835
- openPrice: Qe.openPrice ?? Qe.price,
10836
- closePrice: Qe.closePrice,
10837
- stopLoss: Qe.stopLoss,
10838
- takeProfit: Qe.takeProfit,
10839
- profit: Qe.profit || 0,
10832
+ symbol: be.symbol,
10833
+ type: be.type,
10834
+ volume: be.volume,
10835
+ openPrice: be.openPrice ?? be.price,
10836
+ closePrice: be.closePrice,
10837
+ stopLoss: be.stopLoss,
10838
+ takeProfit: be.takeProfit,
10839
+ profit: be.profit ?? be.profitLoss ?? 0,
10840
10840
  profitCurrency: "USD",
10841
- openAt: Qe.openedAt || Qe.openAt,
10842
- closeAt: Qe.closedAt || Qe.closeAt,
10843
- closeReason: Qe.closeReason || "",
10841
+ openAt: be.openedAt || be.openAt,
10842
+ closeAt: be.closedAt || be.closeAt,
10843
+ closeReason: be.closeReason || "",
10844
10844
  status: "CLOSED"
10845
10845
  }));
10846
10846
  Ie(Re);
@@ -10851,22 +10851,22 @@ const Wn = {
10851
10851
  const ge = V, me = M.reduce((Ve, ft) => Ve + ft.volume * ft.price * 0.01, 0), Me = M.reduce((Ve, ft) => {
10852
10852
  const yt = b.find((It) => It.symbol === ft.symbol);
10853
10853
  if (yt) {
10854
- const It = ft.type === "BUY" ? parseFloat(yt.bid || 0) : parseFloat(yt.ask || 0);
10854
+ const It = ft.type?.toUpperCase() === "BUY" ? parseFloat(yt.bid || 0) : parseFloat(yt.ask || 0);
10855
10855
  if (It && It > 0 && !isNaN(It))
10856
10856
  return Ve + de(ft, It);
10857
10857
  }
10858
10858
  return Ve + (ft.profit || 0);
10859
- }, 0), Re = ge + Me, Qe = Re - me, Ke = me > 0 ? Re / me * 100 : 0;
10859
+ }, 0), Re = ge + Me, be = Re - me, Ke = me > 0 ? Re / me * 100 : 0;
10860
10860
  return {
10861
10861
  balance: ge,
10862
10862
  equity: Re,
10863
10863
  margin: me,
10864
- freeMargin: Qe,
10864
+ freeMargin: be,
10865
10865
  level: Ke.toFixed(2)
10866
10866
  };
10867
10867
  }, [M, b, V, de]);
10868
10868
  it(() => {
10869
- localStorage.getItem("token") && A && (Ee(), _e(), Ye());
10869
+ (localStorage.getItem("token") ?? localStorage.getItem("authToken")) && A && (Ee(), _e(), Ye());
10870
10870
  }, [Ee, _e, Ye, A]), it(() => {
10871
10871
  (async () => {
10872
10872
  try {
@@ -10874,14 +10874,14 @@ const Wn = {
10874
10874
  const me = a.symbols.includes("?") ? `${s}${a.symbols}` : `${s}${a.symbols}`, Me = await dt.get(me);
10875
10875
  let Re = [];
10876
10876
  Array.isArray(Me.data) ? Re = Me.data : Me.data && Me.data.data && Array.isArray(Me.data.data) ? Re = Me.data.data : Me.data && Me.data.prices && Array.isArray(Me.data.prices) ? Re = Me.data.prices : Me.data && Array.isArray(Me.data) && (Re = Me.data);
10877
- const Qe = Re.map((Ke) => Ke.symbol && (Ke.bid !== void 0 || Ke.price !== void 0) ? {
10877
+ const be = Re.map((Ke) => Ke.symbol && (Ke.bid !== void 0 || Ke.price !== void 0) ? {
10878
10878
  symbol: Ke.symbol,
10879
10879
  bid: Ke.bid ?? Ke.price ?? 0,
10880
10880
  ask: Ke.ask ?? Ke.price ?? 0,
10881
10881
  change: Ke.change ?? 0
10882
10882
  // Default to 0 if not provided
10883
10883
  } : Ke);
10884
- Qe.length > 0 ? (v(Qe), Qe.find((Ve) => Ve.symbol === c) || m(Qe[0].symbol)) : v([]);
10884
+ be.length > 0 ? (v(be), be.find((Ve) => Ve.symbol === c) || m(be[0].symbol)) : v([]);
10885
10885
  } catch (me) {
10886
10886
  console.error("❌ Error fetching symbols:", me.response?.data || me.message), v([]);
10887
10887
  } finally {
@@ -10895,20 +10895,20 @@ const Wn = {
10895
10895
  const me = new Map(ge);
10896
10896
  ge.clear(), v(
10897
10897
  (Me) => Me.map((Re) => {
10898
- const Qe = me.get(Re.symbol);
10899
- return Qe ? { ...Re, ...Qe } : Re;
10898
+ const be = me.get(Re.symbol);
10899
+ return be ? { ...Re, ...be } : Re;
10900
10900
  })
10901
10901
  ), N((Me) => {
10902
10902
  let Re = !1;
10903
- const Qe = Me.map((Ke) => {
10903
+ const be = Me.map((Ke) => {
10904
10904
  const Ve = me.get(Ke.symbol);
10905
- if (console.log("UASDSAD", Ve), !Ve) return Ke;
10905
+ if (!Ve) return Ke;
10906
10906
  const ft = Ke.type?.toUpperCase() === "BUY" ? parseFloat(Ve.bid || 0) : parseFloat(Ve.ask || 0);
10907
10907
  if (!ft || isNaN(ft) || ft <= 0) return Ke;
10908
10908
  const yt = de(Ke, ft);
10909
10909
  return yt === Ke.profit ? Ke : (Re = !0, { ...Ke, profit: yt });
10910
10910
  });
10911
- return Re ? Qe : Me;
10911
+ return Re ? be : Me;
10912
10912
  });
10913
10913
  }, [de]);
10914
10914
  it(() => {
@@ -10917,7 +10917,7 @@ const Wn = {
10917
10917
  Ke?.symbol && (ze.current.set(Ke.symbol, Ke), Ce.current || (Ce.current = setTimeout(() => {
10918
10918
  Ce.current = null, nt();
10919
10919
  }, ke)));
10920
- }, Qe = async (Ke) => {
10920
+ }, be = async (Ke) => {
10921
10921
  if (Ke) {
10922
10922
  if (Ke.newBalance !== void 0) {
10923
10923
  const Ve = parseFloat(Ke.newBalance);
@@ -10933,8 +10933,8 @@ const Wn = {
10933
10933
  Ke.tradeId && N((Ve) => Ve.filter((ft) => ft.id !== Ke.tradeId)), await Ee(), await _e();
10934
10934
  }
10935
10935
  };
10936
- return ge.on("connect", me), ge.on("disconnect", Me), ge.on("priceUpdate", Re), ge.on("tradeClosed", Qe), () => {
10937
- ge.off("connect", me), ge.off("disconnect", Me), ge.off("priceUpdate", Re), ge.off("tradeClosed", Qe), Ce.current && (clearTimeout(Ce.current), Ce.current = null), ze.current.clear();
10936
+ return ge.on("connect", me), ge.on("disconnect", Me), ge.on("priceUpdate", Re), ge.on("tradeClosed", be), () => {
10937
+ ge.off("connect", me), ge.off("disconnect", Me), ge.off("priceUpdate", Re), ge.off("tradeClosed", be), Ce.current && (clearTimeout(Ce.current), Ce.current = null), ze.current.clear();
10938
10938
  };
10939
10939
  }, [nt, Ee, _e]), it(() => {
10940
10940
  try {
@@ -10987,7 +10987,7 @@ const Wn = {
10987
10987
  endpointParams: l,
10988
10988
  accountId: A,
10989
10989
  isShow: ve,
10990
- setIsShow: be,
10990
+ setIsShow: Qe,
10991
10991
  historyOrders: Se,
10992
10992
  setHistoryOrders: Ie,
10993
10993
  fetchHistoryOrders: Ye
@@ -11179,7 +11179,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11179
11179
  C("Invalid price. Please refresh and try again.");
11180
11180
  return;
11181
11181
  }
11182
- const X = localStorage.getItem("token");
11182
+ const X = localStorage.getItem("token") ?? localStorage.getItem("authToken");
11183
11183
  if (!X) {
11184
11184
  C("Please login to place trades");
11185
11185
  return;
@@ -11312,20 +11312,20 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11312
11312
  const Me = W.getContractSpec(ge);
11313
11313
  return (parseFloat(me) || 0) * (Me.contractSize || 1);
11314
11314
  }
11315
- }, L = c || W, [V, j] = Ne("0.01"), [X, K] = Ne(""), [ee, Ae] = Ne(""), [ce, Z] = Ne(""), [te, se] = Ne(!1), [le, ne] = Ne(null), [he, pe] = Ne(""), [we, Te] = Ne(t || "BUY"), [Ue, ye] = Ne(parseFloat(A) || 0), [ve, be] = Ne(parseFloat(r) || 0), [Se, Ie] = Ne("text-white"), [Ze, ze] = Ne("text-white"), Ce = et(parseFloat(A) || 0), ke = et(parseFloat(r) || 0);
11315
+ }, L = c || W, [V, j] = Ne("0.01"), [X, K] = Ne(""), [ee, Ae] = Ne(""), [ce, Z] = Ne(""), [te, se] = Ne(!1), [le, ne] = Ne(null), [he, pe] = Ne(""), [we, Te] = Ne(t || "BUY"), [Ue, ye] = Ne(parseFloat(A) || 0), [ve, Qe] = Ne(parseFloat(r) || 0), [Se, Ie] = Ne("text-white"), [Ze, ze] = Ne("text-white"), Ce = et(parseFloat(A) || 0), ke = et(parseFloat(r) || 0);
11316
11316
  it(() => {
11317
11317
  if (!i) return;
11318
11318
  const ge = Wn.getSocket(), me = (Re) => {
11319
11319
  if (!(!Re || !Re.symbol) && Re.symbol.toUpperCase() === m?.toUpperCase()) {
11320
- const Qe = parseFloat(Re.bid) || 0, Ke = parseFloat(Re.ask) || 0;
11321
- Qe > 0 && (Qe > Ce.current ? (Ie("text-green-400"), setTimeout(() => Ie("text-white"), 500)) : Qe < Ce.current && Ce.current > 0 && (Ie("text-red-400"), setTimeout(() => Ie("text-white"), 500)), ye(Qe), Ce.current = Qe), Ke > 0 && (Ke > ke.current ? (ze("text-green-400"), setTimeout(() => ze("text-white"), 500)) : Ke < ke.current && ke.current > 0 && (ze("text-red-400"), setTimeout(() => ze("text-white"), 500)), be(Ke), ke.current = Ke);
11320
+ const be = parseFloat(Re.bid) || 0, Ke = parseFloat(Re.ask) || 0;
11321
+ be > 0 && (be > Ce.current ? (Ie("text-green-400"), setTimeout(() => Ie("text-white"), 500)) : be < Ce.current && Ce.current > 0 && (Ie("text-red-400"), setTimeout(() => Ie("text-white"), 500)), ye(be), Ce.current = be), Ke > 0 && (Ke > ke.current ? (ze("text-green-400"), setTimeout(() => ze("text-white"), 500)) : Ke < ke.current && ke.current > 0 && (ze("text-red-400"), setTimeout(() => ze("text-white"), 500)), Qe(Ke), ke.current = Ke);
11322
11322
  }
11323
11323
  };
11324
11324
  ge.on("priceUpdate", me);
11325
11325
  const Me = b.find((Re) => Re.symbol === m);
11326
11326
  if (Me) {
11327
- const Re = parseFloat(Me.bid) || 0, Qe = parseFloat(Me.ask) || 0;
11328
- Re > 0 && (ye(Re), Ce.current = Re), Qe > 0 && (be(Qe), ke.current = Qe);
11327
+ const Re = parseFloat(Me.bid) || 0, be = parseFloat(Me.ask) || 0;
11328
+ Re > 0 && (ye(Re), Ce.current = Re), be > 0 && (Qe(be), ke.current = be);
11329
11329
  }
11330
11330
  return () => {
11331
11331
  ge.off("priceUpdate", me);
@@ -11334,7 +11334,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11334
11334
  if (i) {
11335
11335
  j(o ? String(o) : "0.01"), K(""), Ae(""), Z(""), pe(""), Te(t || "BUY");
11336
11336
  const ge = parseFloat(A) || 0, me = parseFloat(r) || 0;
11337
- ge > 0 && (ye(ge), Ce.current = ge), me > 0 && (be(me), ke.current = me);
11337
+ ge > 0 && (ye(ge), Ce.current = ge), me > 0 && (Qe(me), ke.current = me);
11338
11338
  }
11339
11339
  }, [i, t, A, r, o]);
11340
11340
  const Ee = Ue || 0, de = ve || 0, _e = (ge) => {
@@ -11358,7 +11358,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11358
11358
  we === "BUY" ? Re = Math.max(Me + 1e-5, Re) : Re = Math.max(1e-5, Math.min(Re, Me - 1e-5)), Ae(Re > 0 ? Re.toFixed(5) : ""), pe("");
11359
11359
  }, nt = async (ge) => {
11360
11360
  pe("");
11361
- const me = ge || we, Me = parseFloat(me === "BUY" ? ve : Ue), Re = parseFloat(V), Qe = X ? parseFloat(X) : null, Ke = ee ? parseFloat(ee) : null;
11361
+ const me = ge || we, Me = parseFloat(me === "BUY" ? ve : Ue), Re = parseFloat(V), be = X ? parseFloat(X) : null, Ke = ee ? parseFloat(ee) : null;
11362
11362
  if (!Re || Re <= 0 || isNaN(Re)) {
11363
11363
  pe("Please enter a valid volume (minimum 0.01)");
11364
11364
  return;
@@ -11371,16 +11371,16 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11371
11371
  pe("Invalid price. Please refresh and try again.");
11372
11372
  return;
11373
11373
  }
11374
- if (Qe !== null && Qe !== "") {
11375
- if (isNaN(Qe) || Qe <= 0) {
11374
+ if (be !== null && be !== "") {
11375
+ if (isNaN(be) || be <= 0) {
11376
11376
  pe("Stop Loss must be a valid positive number");
11377
11377
  return;
11378
11378
  }
11379
- if (me === "BUY" && Qe >= Me) {
11379
+ if (me === "BUY" && be >= Me) {
11380
11380
  pe("Stop Loss must be below the current price for BUY orders");
11381
11381
  return;
11382
11382
  }
11383
- if (me === "SELL" && Qe <= Me) {
11383
+ if (me === "SELL" && be <= Me) {
11384
11384
  pe("Stop Loss must be above the current price for SELL orders");
11385
11385
  return;
11386
11386
  }
@@ -11405,7 +11405,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11405
11405
  }
11406
11406
  }
11407
11407
  Te(me), ne(me), se(!0);
11408
- const Ve = /* @__PURE__ */ new Date(), ft = Ve.toLocaleTimeString(), yt = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, It = localStorage.getItem("token");
11408
+ const Ve = /* @__PURE__ */ new Date(), ft = Ve.toLocaleTimeString(), yt = `temp_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, It = localStorage.getItem("token") ?? localStorage.getItem("authToken");
11409
11409
  if (!It) {
11410
11410
  pe("Please login to place trades"), se(!1), ne(null);
11411
11411
  return;
@@ -11417,7 +11417,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11417
11417
  volume: Re,
11418
11418
  price: Me,
11419
11419
  takeProfit: Ke,
11420
- stopLoss: Qe,
11420
+ stopLoss: be,
11421
11421
  comment: ce.trim() || null
11422
11422
  }, kr = {
11423
11423
  ticket: yt.substring(0, 8),
@@ -11427,7 +11427,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11427
11427
  price: parseFloat(Me),
11428
11428
  time: ft,
11429
11429
  // REAL-TIME: Exact click time
11430
- stopLoss: Qe ? parseFloat(Qe) : null,
11430
+ stopLoss: be ? parseFloat(be) : null,
11431
11431
  takeProfit: Ke ? parseFloat(Ke) : null,
11432
11432
  swap: 0,
11433
11433
  profit: 0,
@@ -11450,7 +11450,7 @@ const Ng = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, kg
11450
11450
  // Use lotSize for prop-capitals backend
11451
11451
  entryPrice: Me,
11452
11452
  // Use entryPrice for prop-capitals backend
11453
- stopLoss: Qe,
11453
+ stopLoss: be,
11454
11454
  takeProfit: Ke,
11455
11455
  comment: ce.trim() || null
11456
11456
  };
@@ -18775,7 +18775,7 @@ var wt = function(i, e, t, A, r) {
18775
18775
  switch (l.label) {
18776
18776
  case 0:
18777
18777
  A = t.styles.backgroundImage.length - 1, r = function(c) {
18778
- var m, C, T, ee, le, ne, Z, te, X, b, ee, le, ne, Z, te, v, U, F, M, N, W, L, V, j, X, K, ee, Ae, ce, Z, te, se, le, ne, he, pe, we, Te, Ue, ye, ve, be;
18778
+ var m, C, T, ee, le, ne, Z, te, X, b, ee, le, ne, Z, te, v, U, F, M, N, W, L, V, j, X, K, ee, Ae, ce, Z, te, se, le, ne, he, pe, we, Te, Ue, ye, ve, Qe;
18779
18779
  return Kt(this, function(Se) {
18780
18780
  switch (Se.label) {
18781
18781
  case 0:
@@ -18802,7 +18802,7 @@ var wt = function(i, e, t, A, r) {
18802
18802
  null
18803
18803
  ]), ee = K[0], Ae = K[1], ce = K[2], Z = K[3], te = K[4], se = c.position.length === 0 ? [Pa] : c.position, le = mt(se[0], Z), ne = mt(se[se.length - 1], te), he = a2(c, le, ne, Z, te), pe = he[0], we = he[1], pe > 0 && we > 0 && (Te = n.ctx.createRadialGradient(Ae + le, ce + ne, 0, Ae + le, ce + ne, pe), Nc(c.stops, pe * 2).forEach(function(Ie) {
18804
18804
  return Te.addColorStop(Ie.stop, Mt(Ie.color));
18805
- }), n.path(ee), n.ctx.fillStyle = Te, pe !== we ? (Ue = t.bounds.left + 0.5 * t.bounds.width, ye = t.bounds.top + 0.5 * t.bounds.height, ve = we / pe, be = 1 / ve, n.ctx.save(), n.ctx.translate(Ue, ye), n.ctx.transform(1, 0, 0, ve, 0, 0), n.ctx.translate(-Ue, -ye), n.ctx.fillRect(Ae, be * (ce - ye) + ye, Z, te * be), n.ctx.restore()) : n.ctx.fill())), Se.label = 6;
18805
+ }), n.path(ee), n.ctx.fillStyle = Te, pe !== we ? (Ue = t.bounds.left + 0.5 * t.bounds.width, ye = t.bounds.top + 0.5 * t.bounds.height, ve = we / pe, Qe = 1 / ve, n.ctx.save(), n.ctx.translate(Ue, ye), n.ctx.transform(1, 0, 0, ve, 0, 0), n.ctx.translate(-Ue, -ye), n.ctx.fillRect(Ae, Qe * (ce - ye) + ye, Z, te * Qe), n.ctx.restore()) : n.ctx.fill())), Se.label = 6;
18806
18806
  case 6:
18807
18807
  return A--, [
18808
18808
  2
@@ -19039,8 +19039,8 @@ typeof window < "u" && Kp.setContext(window);
19039
19039
  var _v = function(i, e) {
19040
19040
  return Xt(void 0, void 0, void 0, function() {
19041
19041
  var t, A, r, n, s, o, a, l, c, m, C, T, b, v, U, F, M, N, W, L, j, V, j, X, K, ee, Ae, ce, Z, te, se, le, ne, he, pe, we, Te, Ue, ye, ve;
19042
- return Kt(this, function(be) {
19043
- switch (be.label) {
19042
+ return Kt(this, function(Qe) {
19043
+ switch (Qe.label) {
19044
19044
  case 0:
19045
19045
  if (!i || typeof i != "object")
19046
19046
  return [2, Promise.reject("Invalid element provided as first argument")];
@@ -19066,7 +19066,7 @@ var _v = function(i, e) {
19066
19066
  copyStyles: l
19067
19067
  }, a.logger.debug("Starting document clone with size " + o.width + "x" + o.height + " scrolled to " + -o.left + "," + -o.top), m = new ph(a, i, c), C = m.clonedReferenceElement, C ? [4, m.toIFrame(t, o)] : [2, Promise.reject("Unable to find element in cloned iframe")];
19068
19068
  case 1:
19069
- return T = be.sent(), b = Va(C) || PC(C) ? dw(C.ownerDocument) : ws(a, C), v = b.width, U = b.height, F = b.left, M = b.top, N = Pv(a, C, e.backgroundColor), W = {
19069
+ return T = Qe.sent(), b = Va(C) || PC(C) ? dw(C.ownerDocument) : ws(a, C), v = b.width, U = b.height, F = b.left, M = b.top, N = Pv(a, C, e.backgroundColor), W = {
19070
19070
  canvas: e.canvas,
19071
19071
  backgroundColor: N,
19072
19072
  scale: (pe = (he = e.scale) !== null && he !== void 0 ? he : A.devicePixelRatio) !== null && pe !== void 0 ? pe : 1,
@@ -19076,11 +19076,11 @@ var _v = function(i, e) {
19076
19076
  height: (ye = e.height) !== null && ye !== void 0 ? ye : Math.ceil(U)
19077
19077
  }, l ? (a.logger.debug("Document cloned, using foreign object rendering"), j = new Mv(a, W), [4, j.render(C)]) : [3, 3];
19078
19078
  case 2:
19079
- return L = be.sent(), [3, 5];
19079
+ return L = Qe.sent(), [3, 5];
19080
19080
  case 3:
19081
19081
  return a.logger.debug("Document cloned, element located at " + F + "," + M + " with size " + v + "x" + U + " using computed rendering"), a.logger.debug("Starting DOM parsing"), V = Ip(a, C), N === V.styles.backgroundColor && (V.styles.backgroundColor = OA.TRANSPARENT), a.logger.debug("Starting renderer for element at " + W.x + "," + W.y + " with size " + W.width + "x" + W.height), j = new Qv(a, W), [4, j.render(V)];
19082
19082
  case 4:
19083
- L = be.sent(), be.label = 5;
19083
+ L = Qe.sent(), Qe.label = 5;
19084
19084
  case 5:
19085
19085
  return (!((ve = e.removeContainer) !== null && ve !== void 0) || ve) && (ph.destroy(T) || a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")), a.logger.debug("Finished rendering"), [2, L];
19086
19086
  }
@@ -19199,16 +19199,16 @@ class Ov {
19199
19199
  he === "left" ? (pe = F, we = M) : he === "center" ? (pe = Math.round((F + N) / 2), we = Math.round((M + W) / 2)) : (pe = N, we = W);
19200
19200
  let Te, Ue;
19201
19201
  he === "left" ? (Te = pe - le - 10 * m, Ue = we - ne - 4 * C) : he === "center" ? (Te = pe - le / 2, Ue = we - ne - 8 * C) : (Te = pe + 10 * m, Ue = we - ne - 4 * C);
19202
- const ye = a.bitmapSize.width, ve = a.bitmapSize.height, be = Math.min(Math.max(0, Te), ye - le - 4 * m), Se = Math.min(Math.max(4 * C, Ue), ve - ne - 4 * C), Ie = 4 * C;
19203
- L.beginPath(), L.moveTo(be + Ie, Se), L.lineTo(be + le - Ie, Se), L.quadraticCurveTo(be + le, Se, be + le, Se + Ie), L.lineTo(be + le, Se + ne - Ie), L.quadraticCurveTo(
19204
- be + le,
19202
+ const ye = a.bitmapSize.width, ve = a.bitmapSize.height, Qe = Math.min(Math.max(0, Te), ye - le - 4 * m), Se = Math.min(Math.max(4 * C, Ue), ve - ne - 4 * C), Ie = 4 * C;
19203
+ L.beginPath(), L.moveTo(Qe + Ie, Se), L.lineTo(Qe + le - Ie, Se), L.quadraticCurveTo(Qe + le, Se, Qe + le, Se + Ie), L.lineTo(Qe + le, Se + ne - Ie), L.quadraticCurveTo(
19204
+ Qe + le,
19205
19205
  Se + ne,
19206
- be + le - Ie,
19206
+ Qe + le - Ie,
19207
19207
  Se + ne
19208
- ), L.lineTo(be + Ie, Se + ne), L.quadraticCurveTo(be, Se + ne, be, Se + ne - Ie), L.lineTo(be, Se + Ie), L.quadraticCurveTo(be, Se, be + Ie, Se), L.closePath(), L.fillStyle = "rgba(30, 41, 59, 0.92)", L.fill(), L.strokeStyle = s.statsColor || s.color, L.lineWidth = 1 * C, L.stroke(), L.fillStyle = "#e2e8f0", L.textAlign = "left", ce.forEach((Ze, ze) => {
19208
+ ), L.lineTo(Qe + Ie, Se + ne), L.quadraticCurveTo(Qe, Se + ne, Qe, Se + ne - Ie), L.lineTo(Qe, Se + Ie), L.quadraticCurveTo(Qe, Se, Qe + Ie, Se), L.closePath(), L.fillStyle = "rgba(30, 41, 59, 0.92)", L.fill(), L.strokeStyle = s.statsColor || s.color, L.lineWidth = 1 * C, L.stroke(), L.fillStyle = "#e2e8f0", L.textAlign = "left", ce.forEach((Ze, ze) => {
19209
19209
  L.fillText(
19210
19210
  Ze,
19211
- be + se,
19211
+ Qe + se,
19212
19212
  Se + se + Z + ze * te
19213
19213
  );
19214
19214
  }), L.restore();
@@ -19266,13 +19266,13 @@ class Bh {
19266
19266
  }
19267
19267
  const Z = Math.round(11 * C);
19268
19268
  V.font = Z + "px sans-serif";
19269
- const te = Z * 1.6, se = 8 * C, le = Math.max(...ce.map((be) => V.measureText(be).width)) + se * 2, ne = ce.length * te + se * 2, he = a.bitmapSize.width, pe = a.bitmapSize.height;
19269
+ const te = Z * 1.6, se = 8 * C, le = Math.max(...ce.map((Qe) => V.measureText(Qe).width)) + se * 2, ne = ce.length * te + se * 2, he = a.bitmapSize.width, pe = a.bitmapSize.height;
19270
19270
  let we, Te;
19271
19271
  if (s.statsPosition === "left")
19272
19272
  we = F - le - 10 * m, Te = M - ne - 4 * C;
19273
19273
  else if (s.statsPosition === "center") {
19274
- const be = (F + N) / 2, Se = (M + W) / 2;
19275
- we = be - le / 2, Te = Se - ne - 4 * C;
19274
+ const Qe = (F + N) / 2, Se = (M + W) / 2;
19275
+ we = Qe - le / 2, Te = Se - ne - 4 * C;
19276
19276
  } else
19277
19277
  we = N + 10 * m, Te = W - ne - 4 * C;
19278
19278
  const Ue = Math.min(Math.max(0, we), he - le - 4 * m), ye = Math.min(Math.max(4 * C, Te), pe - ne - 4 * C), ve = 4 * C;
@@ -19281,9 +19281,9 @@ class Bh {
19281
19281
  ye + ne,
19282
19282
  Ue + le - ve,
19283
19283
  ye + ne
19284
- ), V.lineTo(Ue + ve, ye + ne), V.quadraticCurveTo(Ue, ye + ne, Ue, ye + ne - ve), V.lineTo(Ue, ye + ve), V.quadraticCurveTo(Ue, ye, Ue + ve, ye), V.closePath(), V.fillStyle = "rgba(30, 41, 59, 0.92)", V.fill(), V.strokeStyle = s.statsColor || L, V.lineWidth = 1 * C, V.stroke(), V.fillStyle = "#e2e8f0", V.textAlign = "left", ce.forEach((be, Se) => {
19284
+ ), V.lineTo(Ue + ve, ye + ne), V.quadraticCurveTo(Ue, ye + ne, Ue, ye + ne - ve), V.lineTo(Ue, ye + ve), V.quadraticCurveTo(Ue, ye, Ue + ve, ye), V.closePath(), V.fillStyle = "rgba(30, 41, 59, 0.92)", V.fill(), V.strokeStyle = s.statsColor || L, V.lineWidth = 1 * C, V.stroke(), V.fillStyle = "#e2e8f0", V.textAlign = "left", ce.forEach((Qe, Se) => {
19285
19285
  V.fillText(
19286
- be,
19286
+ Qe,
19287
19287
  Ue + se,
19288
19288
  ye + se + Z + Se * te
19289
19289
  );
@@ -19512,9 +19512,9 @@ class yh {
19512
19512
  if (se.length > 0) {
19513
19513
  const ne = Math.min(l, c), he = 11 * ne, pe = he * 1.5, we = 5 * ne;
19514
19514
  L.font = he + "px sans-serif";
19515
- const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, be, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19515
+ const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, Qe, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19516
19516
  let Ze, ze;
19517
- r.statsPosition === "left" ? (Ze = ve, ze = be) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (be + Ie) / 2) : (Ze = Se, ze = Ie);
19517
+ r.statsPosition === "left" ? (Ze = ve, ze = Qe) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (Qe + Ie) / 2) : (Ze = Se, ze = Ie);
19518
19518
  const Ce = Ze - Ue / 2, ke = ze - ye - 12 * ne;
19519
19519
  L.fillStyle = "rgba(20, 20, 30, 0.72)", L.fillRect(Ce, ke, Ue, ye), L.strokeStyle = r.statsColor, L.lineWidth = 1 * ne, L.strokeRect(Ce, ke, Ue, ye), L.fillStyle = r.statsColor, L.textBaseline = "top", L.textAlign = "left", se.forEach((Ee, de) => {
19520
19520
  L.fillText(Ee, Ce + we, ke + we + de * pe);
@@ -19605,9 +19605,9 @@ class Gv {
19605
19605
  if (se.length > 0) {
19606
19606
  const ne = Math.min(l, c), he = 11 * ne, pe = he * 1.5, we = 5 * ne;
19607
19607
  L.font = he + "px sans-serif";
19608
- const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, be, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19608
+ const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, Qe, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19609
19609
  let Ze, ze;
19610
- r.statsPosition === "left" ? (Ze = ve, ze = be) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (be + Ie) / 2) : (Ze = Se, ze = Ie);
19610
+ r.statsPosition === "left" ? (Ze = ve, ze = Qe) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (Qe + Ie) / 2) : (Ze = Se, ze = Ie);
19611
19611
  const Ce = Ze - Ue / 2, ke = ze - ye - 12 * ne;
19612
19612
  L.fillStyle = "rgba(20, 20, 30, 0.72)", L.fillRect(Ce, ke, Ue, ye), L.strokeStyle = r.statsColor, L.lineWidth = 1 * ne, L.strokeRect(Ce, ke, Ue, ye), L.fillStyle = r.statsColor, L.textBaseline = "top", L.textAlign = "left", se.forEach((Ee, de) => {
19613
19613
  L.fillText(Ee, Ce + we, ke + we + de * pe);
@@ -19698,9 +19698,9 @@ class $v {
19698
19698
  if (se.length > 0) {
19699
19699
  const ne = Math.min(l, c), he = 11 * ne, pe = he * 1.5, we = 5 * ne;
19700
19700
  L.font = he + "px sans-serif";
19701
- const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, be, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19701
+ const Ue = se.reduce((Ee, de) => Math.max(Ee, L.measureText(de).width), 0) + we * 2, ye = se.length * pe + we * 2, [ve, Qe, Se, Ie] = v <= F ? [v, U, F, M] : [F, M, v, U];
19702
19702
  let Ze, ze;
19703
- r.statsPosition === "left" ? (Ze = ve, ze = be) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (be + Ie) / 2) : (Ze = Se, ze = Ie);
19703
+ r.statsPosition === "left" ? (Ze = ve, ze = Qe) : r.statsPosition === "center" ? (Ze = (ve + Se) / 2, ze = (Qe + Ie) / 2) : (Ze = Se, ze = Ie);
19704
19704
  const Ce = Ze - Ue / 2, ke = ze - ye - 12 * ne;
19705
19705
  L.fillStyle = "rgba(20, 20, 30, 0.72)", L.fillRect(Ce, ke, Ue, ye), L.strokeStyle = r.statsColor, L.lineWidth = 1 * ne, L.strokeRect(Ce, ke, Ue, ye), L.fillStyle = r.statsColor, L.textBaseline = "top", L.textAlign = "left", se.forEach((Ee, de) => {
19706
19706
  L.fillText(Ee, Ce + we, ke + we + de * pe);
@@ -19764,44 +19764,44 @@ class Xv {
19764
19764
  if (l) {
19765
19765
  const ne = n.p1.rawTime ?? n.p1.time, he = n.p2.rawTime ?? n.p2.time, pe = n.p1.price, we = n.p2.price, Te = [];
19766
19766
  if (n.statsPriceRange) {
19767
- const ye = Math.abs(we - pe), ve = pe !== 0 ? Math.abs((we - pe) / pe * 100) : 0, be = ye < 1e-4 ? 6 : ye < 0.01 ? 5 : ye < 1 ? 4 : 2;
19768
- Te.push("↕ " + ye.toFixed(be) + " (" + ve.toFixed(2) + "%)");
19767
+ const ye = Math.abs(we - pe), ve = pe !== 0 ? Math.abs((we - pe) / pe * 100) : 0, Qe = ye < 1e-4 ? 6 : ye < 0.01 ? 5 : ye < 1 ? 4 : 2;
19768
+ Te.push("↕ " + ye.toFixed(Qe) + " (" + ve.toFixed(2) + "%)");
19769
19769
  }
19770
19770
  const Ue = [];
19771
19771
  if (n.statsBarsRange)
19772
19772
  try {
19773
19773
  const ye = c.timeScale().timeToCoordinate(ne), ve = c.timeScale().timeToCoordinate(he);
19774
19774
  if (ye != null && ve != null) {
19775
- const be = c.timeScale().coordinateToLogical(ye), Se = c.timeScale().coordinateToLogical(ve);
19776
- be != null && Se != null && Ue.push("↔ " + Math.abs(Math.round(Se - be)) + " bars");
19775
+ const Qe = c.timeScale().coordinateToLogical(ye), Se = c.timeScale().coordinateToLogical(ve);
19776
+ Qe != null && Se != null && Ue.push("↔ " + Math.abs(Math.round(Se - Qe)) + " bars");
19777
19777
  }
19778
19778
  } catch {
19779
19779
  }
19780
19780
  if (n.statsDateRange) {
19781
- const ye = Math.abs(he - ne), ve = Math.floor(ye / 86400), be = Math.floor(ye % 86400 / 3600), Se = Math.floor(ye % 3600 / 60);
19781
+ const ye = Math.abs(he - ne), ve = Math.floor(ye / 86400), Qe = Math.floor(ye % 86400 / 3600), Se = Math.floor(ye % 3600 / 60);
19782
19782
  let Ie = ve > 0 ? ve + " day" + (ve !== 1 ? "s" : "") : "";
19783
- be > 0 && (Ie += (Ie ? " " : "") + be + " hour" + (be !== 1 ? "s" : "")), !ve && !be && (Ie = Se + " min" + (Se !== 1 ? "s" : "")), n.statsBarsRange && Ue.length > 0 ? Ue[Ue.length - 1] += " (" + Ie + ")" : Ue.push(Ie);
19783
+ Qe > 0 && (Ie += (Ie ? " " : "") + Qe + " hour" + (Qe !== 1 ? "s" : "")), !ve && !Qe && (Ie = Se + " min" + (Se !== 1 ? "s" : "")), n.statsBarsRange && Ue.length > 0 ? Ue[Ue.length - 1] += " (" + Ie + ")" : Ue.push(Ie);
19784
19784
  }
19785
19785
  if (n.statsDistance) {
19786
19786
  const ye = (W - M) / C, ve = (L - N) / T;
19787
19787
  Ue.push("distance: " + Math.sqrt(ye * ye + ve * ve).toFixed(2));
19788
19788
  }
19789
19789
  if (Ue.length > 0 && Te.push(Ue.join(", ")), n.statsAngle) {
19790
- const ye = ee / C, ve = Ae / T, be = Math.atan2(ve, ye) * 180 / Math.PI;
19791
- Te.push("∠ " + be.toFixed(0) + "°");
19790
+ const ye = ee / C, ve = Ae / T, Qe = Math.atan2(ve, ye) * 180 / Math.PI;
19791
+ Te.push("∠ " + Qe.toFixed(0) + "°");
19792
19792
  }
19793
19793
  if (Te.length > 0) {
19794
- const ye = Math.min(C, T), ve = 11 * ye, be = ve * 1.5, Se = 5 * ye;
19794
+ const ye = Math.min(C, T), ve = 11 * ye, Qe = ve * 1.5, Se = 5 * ye;
19795
19795
  Z.font = ve + "px sans-serif";
19796
19796
  const Ze = Te.reduce(
19797
19797
  (_e, Ye) => Math.max(_e, Z.measureText(Ye).width),
19798
19798
  0
19799
- ) + Se * 2, ze = Te.length * be + Se * 2;
19799
+ ) + Se * 2, ze = Te.length * Qe + Se * 2;
19800
19800
  let Ce, ke;
19801
19801
  n.statsPosition === "left" ? (Ce = V, ke = j) : n.statsPosition === "center" ? (Ce = (V + X) / 2, ke = (j + K) / 2) : (Ce = X, ke = K);
19802
19802
  const Ee = Ce - Ze / 2, de = ke - ze - 12 * ye;
19803
19803
  Z.fillStyle = "rgba(20, 20, 30, 0.72)", Z.fillRect(Ee, de, Ze, ze), Z.strokeStyle = n.statsColor, Z.lineWidth = 1 * ye, Z.strokeRect(Ee, de, Ze, ze), Z.fillStyle = n.statsColor, Z.textBaseline = "top", Z.textAlign = "left", Te.forEach((_e, Ye) => {
19804
- Z.fillText(_e, Ee + Se, de + Se + Ye * be);
19804
+ Z.fillText(_e, Ee + Se, de + Se + Ye * Qe);
19805
19805
  });
19806
19806
  }
19807
19807
  }
@@ -19909,8 +19909,8 @@ class Jv {
19909
19909
  if (ee.fillText(`${K}°`, le, ne), (r.statsShowAlways || r.isActive) && (r.statsPriceRange || r.statsDistance)) {
19910
19910
  const pe = r.p1.price, we = r.p2.price, Te = [];
19911
19911
  if (r.statsPriceRange) {
19912
- const ye = Math.abs(we - pe), ve = pe !== 0 ? Math.abs((we - pe) / pe * 100) : 0, be = ye < 1e-4 ? 6 : ye < 0.01 ? 5 : ye < 1 ? 4 : 2;
19913
- Te.push("↕ " + ye.toFixed(be) + " (" + ve.toFixed(2) + "%)");
19912
+ const ye = Math.abs(we - pe), ve = pe !== 0 ? Math.abs((we - pe) / pe * 100) : 0, Qe = ye < 1e-4 ? 6 : ye < 0.01 ? 5 : ye < 1 ? 4 : 2;
19913
+ Te.push("↕ " + ye.toFixed(Qe) + " (" + ve.toFixed(2) + "%)");
19914
19914
  }
19915
19915
  const Ue = [];
19916
19916
  if (r.statsDistance) {
@@ -19918,14 +19918,14 @@ class Jv {
19918
19918
  Ue.push("distance: " + Math.sqrt(ye * ye + ve * ve).toFixed(2));
19919
19919
  }
19920
19920
  if (Ue.length > 0 && Te.push(Ue.join(", ")), Te.length > 0) {
19921
- const ye = Math.min(l, c), ve = 11 * ye, be = ve * 1.5, Se = 5 * ye;
19921
+ const ye = Math.min(l, c), ve = 11 * ye, Qe = ve * 1.5, Se = 5 * ye;
19922
19922
  ee.font = ve + "px sans-serif";
19923
- const Ze = Te.reduce(($e, Pe) => Math.max($e, ee.measureText(Pe).width), 0) + Se * 2, ze = Te.length * be + Se * 2, [Ce, ke, Ee, de] = v <= F ? [v, U, F, M] : [F, M, v, U];
19923
+ const Ze = Te.reduce(($e, Pe) => Math.max($e, ee.measureText(Pe).width), 0) + Se * 2, ze = Te.length * Qe + Se * 2, [Ce, ke, Ee, de] = v <= F ? [v, U, F, M] : [F, M, v, U];
19924
19924
  let _e, Ye;
19925
19925
  r.statsPosition === "left" ? (_e = Ce, Ye = ke) : r.statsPosition === "center" ? (_e = (Ce + Ee) / 2, Ye = (ke + de) / 2) : (_e = Ee, Ye = de);
19926
19926
  const rt = _e - Ze / 2, nt = Ye - ze - 12 * ye;
19927
19927
  ee.fillStyle = "rgba(20, 20, 30, 0.72)", ee.fillRect(rt, nt, Ze, ze), ee.strokeStyle = r.statsColor, ee.lineWidth = 1 * ye, ee.strokeRect(rt, nt, Ze, ze), ee.fillStyle = r.statsColor, ee.textBaseline = "top", ee.textAlign = "left", Te.forEach(($e, Pe) => {
19928
- ee.fillText($e, rt + Se, nt + Se + Pe * be);
19928
+ ee.fillText($e, rt + Se, nt + Se + Pe * Qe);
19929
19929
  });
19930
19930
  }
19931
19931
  }
@@ -19983,8 +19983,8 @@ class Yv {
19983
19983
  y: ve + ce * (Z - ye)
19984
19984
  }), he = le(1), pe = le(-1), we = ne(he.x, he.y), Te = ne(pe.x, pe.y);
19985
19985
  m.save(), m.beginPath(), m.moveTo(he.x, he.y), m.lineTo(we.x, we.y), m.lineTo(Te.x, Te.y), m.lineTo(pe.x, pe.y), m.closePath(), m.fillStyle = "rgba(148, 163, 184, 0.2)", m.fill(), m.beginPath(), m.strokeStyle = "rgba(148, 163, 184, 0.9)", m.lineWidth = 1 * c, m.moveTo(W, L), m.lineTo(V, j), m.stroke(), r._levels.forEach((ye) => {
19986
- const ve = le(ye.k), be = ne(ve.x, ve.y);
19987
- m.beginPath(), m.strokeStyle = ye.color, m.lineWidth = ye.width * c, m.moveTo(ve.x, ve.y), m.lineTo(be.x, be.y), m.stroke();
19986
+ const ve = le(ye.k), Qe = ne(ve.x, ve.y);
19987
+ m.beginPath(), m.strokeStyle = ye.color, m.lineWidth = ye.width * c, m.moveTo(ve.x, ve.y), m.lineTo(Qe.x, Qe.y), m.stroke();
19988
19988
  });
19989
19989
  const Ue = ne(M, N);
19990
19990
  m.beginPath(), m.strokeStyle = "rgba(161, 98, 7, 0.9)", m.lineWidth = 1.1 * c, m.moveTo(M, N), m.lineTo(Ue.x, Ue.y), m.stroke(), m.restore();
@@ -20148,16 +20148,16 @@ class ha {
20148
20148
  if (X.length !== 4) return;
20149
20149
  const [K, ee, Ae, ce] = X, Z = N.context;
20150
20150
  Z.save();
20151
- const te = ee.x - K.x, se = ee.y - K.y, le = Math.sqrt(te * te + se * se) || 1, ne = te / le, he = se / le, pe = Ae.x - ce.x, we = Ae.y - ce.y, Te = Math.sqrt(pe * pe + we * we) || 1, Ue = pe / Te, ye = we / Te, ve = 1e5, be = F.rayLeft ? { x: K.x - ne * ve, y: K.y - he * ve } : K, Se = F.rayRight ? { x: ee.x + ne * ve, y: ee.y + he * ve } : ee, Ie = F.rayLeft ? { x: ce.x - Ue * ve, y: ce.y - ye * ve } : ce, Ze = F.rayRight ? { x: Ae.x + Ue * ve, y: Ae.y + ye * ve } : Ae;
20151
+ const te = ee.x - K.x, se = ee.y - K.y, le = Math.sqrt(te * te + se * se) || 1, ne = te / le, he = se / le, pe = Ae.x - ce.x, we = Ae.y - ce.y, Te = Math.sqrt(pe * pe + we * we) || 1, Ue = pe / Te, ye = we / Te, ve = 1e5, Qe = F.rayLeft ? { x: K.x - ne * ve, y: K.y - he * ve } : K, Se = F.rayRight ? { x: ee.x + ne * ve, y: ee.y + he * ve } : ee, Ie = F.rayLeft ? { x: ce.x - Ue * ve, y: ce.y - ye * ve } : ce, Ze = F.rayRight ? { x: Ae.x + Ue * ve, y: Ae.y + ye * ve } : Ae;
20152
20152
  if (F.showBackground) {
20153
20153
  const ze = F.fillColor || "#6aa84f", Ce = parseInt(ze.slice(1, 3), 16), ke = parseInt(ze.slice(3, 5), 16), Ee = parseInt(ze.slice(5, 7), 16);
20154
20154
  Z.beginPath(), Z.moveTo(K.x, K.y), Z.lineTo(ee.x, ee.y), Z.lineTo(Ae.x, Ae.y), Z.lineTo(ce.x, ce.y), Z.closePath(), Z.fillStyle = `rgba(${Ce},${ke},${Ee},${F.fillOpacity ?? 0.1})`, Z.fill();
20155
20155
  }
20156
- if (Z.strokeStyle = F.lineColor, Z.lineWidth = F.lineWidth * j, Z.setLineDash([]), Z.beginPath(), Z.moveTo(be.x, be.y), Z.lineTo(Se.x, Se.y), Z.moveTo(Ie.x, Ie.y), Z.lineTo(Ze.x, Ze.y), Z.moveTo(K.x, K.y), Z.lineTo(ce.x, ce.y), Z.moveTo(ee.x, ee.y), Z.lineTo(Ae.x, Ae.y), Z.stroke(), F.arrowLeft || F.arrowRight) {
20156
+ if (Z.strokeStyle = F.lineColor, Z.lineWidth = F.lineWidth * j, Z.setLineDash([]), Z.beginPath(), Z.moveTo(Qe.x, Qe.y), Z.lineTo(Se.x, Se.y), Z.moveTo(Ie.x, Ie.y), Z.lineTo(Ze.x, Ze.y), Z.moveTo(K.x, K.y), Z.lineTo(ce.x, ce.y), Z.moveTo(ee.x, ee.y), Z.lineTo(Ae.x, Ae.y), Z.stroke(), F.arrowLeft || F.arrowRight) {
20157
20157
  const ze = 8 * j, Ce = (ke, Ee, de) => {
20158
20158
  Z.save(), Z.translate(ke, Ee), Z.rotate(de), Z.beginPath(), Z.moveTo(0, 0), Z.lineTo(-ze, -ze / 2), Z.lineTo(-ze, ze / 2), Z.closePath(), Z.fillStyle = F.lineColor, Z.fill(), Z.restore();
20159
20159
  };
20160
- F.arrowLeft && (Ce(be.x, be.y, Math.atan2(-he, -ne)), Ce(Ie.x, Ie.y, Math.atan2(-ye, -Ue))), F.arrowRight && (Ce(Se.x, Se.y, Math.atan2(he, ne)), Ce(Ze.x, Ze.y, Math.atan2(ye, Ue)));
20160
+ F.arrowLeft && (Ce(Qe.x, Qe.y, Math.atan2(-he, -ne)), Ce(Ie.x, Ie.y, Math.atan2(-ye, -Ue))), F.arrowRight && (Ce(Se.x, Se.y, Math.atan2(he, ne)), Ce(Ze.x, Ze.y, Math.atan2(ye, Ue)));
20161
20161
  }
20162
20162
  if (Z.fillStyle = "#ffffff", Z.strokeStyle = "#3b82f6", Z.lineWidth = 2 * j, [K, ee, Ae, ce].forEach((ze) => {
20163
20163
  Z.beginPath(), Z.arc(ze.x, ze.y, 6 * j, 0, Math.PI * 2), Z.fill(), Z.stroke();
@@ -20810,7 +20810,7 @@ const nT = cd(function({
20810
20810
  const d = Ue(Ee, de);
20811
20811
  pe.current.set(d, p);
20812
20812
  }, {
20813
- activeTool: be,
20813
+ activeTool: Qe,
20814
20814
  setActiveTool: Se,
20815
20815
  showGrid: Ie,
20816
20816
  snapToGrid: Ze,
@@ -20826,7 +20826,7 @@ const nT = cd(function({
20826
20826
  baseUrl: $e,
20827
20827
  endpoints: Pe,
20828
20828
  endpointParams: ge
20829
- } = Wt(), me = et([]), [Me, Re] = Ne(!1), [Qe, Ke] = Ne(null), [Ve, ft] = Ne([]), [yt, It] = Ne(!0), [Gi, kr] = Ne(null), [ri, Or] = Ne(0), Rt = Di(() => {
20829
+ } = Wt(), me = et([]), [Me, Re] = Ne(!1), [be, Ke] = Ne(null), [Ve, ft] = Ne([]), [yt, It] = Ne(!0), [Gi, kr] = Ne(null), [ri, Or] = Ne(0), Rt = Di(() => {
20830
20830
  const p = Ve.map((d) => q(d?.time)).filter((d) => Number.isFinite(d));
20831
20831
  return p.sort((d, k) => d - k), p;
20832
20832
  }, [Ve]), xt = et(null), Lt = et(/* @__PURE__ */ new Map());
@@ -21423,7 +21423,7 @@ const nT = cd(function({
21423
21423
  allowShiftVisibleRangeOnWhitespaceClick: !0
21424
21424
  },
21425
21425
  crosshair: {
21426
- mode: be === 1 ? 1 : 0,
21426
+ mode: Qe === 1 ? 1 : 0,
21427
21427
  vertLine: {
21428
21428
  width: 1,
21429
21429
  color: xe ? "#3b82f6" : "#58a6ff",
@@ -21439,12 +21439,12 @@ const nT = cd(function({
21439
21439
  labelBackgroundColor: xe ? "#eff6ff" : "#161b22",
21440
21440
  labelVisible: !0
21441
21441
  },
21442
- vertLineVisible: be === 1,
21443
- horzLineVisible: be === 1
21442
+ vertLineVisible: Qe === 1,
21443
+ horzLineVisible: Qe === 1
21444
21444
  },
21445
21445
  handleScroll: {
21446
21446
  mouseWheel: !0,
21447
- pressedMouseMove: be === null || be === 1,
21447
+ pressedMouseMove: Qe === null || Qe === 1,
21448
21448
  horzTouchDrag: !0,
21449
21449
  vertTouchDrag: !0
21450
21450
  },
@@ -21564,13 +21564,13 @@ const nT = cd(function({
21564
21564
  });
21565
21565
  }, [nt, Ie]), it(() => {
21566
21566
  if (!l.current) return;
21567
- const d = !rt && !(be !== null && be !== 1 && be !== 0), k = !rt;
21567
+ const d = !rt && !(Qe !== null && Qe !== 1 && Qe !== 0), k = !rt;
21568
21568
  l.current.applyOptions({
21569
21569
  crosshair: {
21570
- mode: be === 1 ? 1 : 0,
21570
+ mode: Qe === 1 ? 1 : 0,
21571
21571
  // 1 = Normal (always visible when tool active), 0 = Hidden
21572
21572
  vertLine: {
21573
- visible: be === 1,
21573
+ visible: Qe === 1,
21574
21574
  width: 1,
21575
21575
  color: nt === "light" ? "#94a3b8" : "#64748b",
21576
21576
  style: 0,
@@ -21578,7 +21578,7 @@ const nT = cd(function({
21578
21578
  labelBackgroundColor: nt === "light" ? "#e5e7eb" : "#1e293b"
21579
21579
  },
21580
21580
  horzLine: {
21581
- visible: be === 1,
21581
+ visible: Qe === 1,
21582
21582
  width: 1,
21583
21583
  color: nt === "light" ? "#94a3b8" : "#64748b",
21584
21584
  style: 0,
@@ -21609,7 +21609,7 @@ const nT = cd(function({
21609
21609
  pinch: k
21610
21610
  }
21611
21611
  });
21612
- }, [be, rt]);
21612
+ }, [Qe, rt]);
21613
21613
  const ed = () => {
21614
21614
  const p = c.current;
21615
21615
  T.current.forEach((d) => {
@@ -22321,7 +22321,7 @@ const nT = cd(function({
22321
22321
  }, [Ve, Ye]), it(() => {
22322
22322
  const p = l.current, d = c.current, k = o.current;
22323
22323
  if (!p || !d || !k) return;
22324
- const E = be !== null ? [
22324
+ const E = Qe !== null ? [
22325
22325
  null,
22326
22326
  // 0: Menu
22327
22327
  null,
@@ -22418,7 +22418,7 @@ const nT = cd(function({
22418
22418
  // 47: Triangle (shape tools submenu)
22419
22419
  "ellipse"
22420
22420
  // 48: Ellipse (shape tools submenu)
22421
- ][be] : null, y = (S, O) => {
22421
+ ][Qe] : null, y = (S, O) => {
22422
22422
  const ae = Math.min(S.time, O.time), re = Math.max(S.time, O.time), f = S.time <= O.time ? S.rawTime : O.rawTime, B = S.time <= O.time ? O.rawTime : S.rawTime, Q = Math.max(S.price, O.price), w = Math.min(S.price, O.price), u = q(Math.round((ae + re) / 2));
22423
22423
  return u == null ? null : {
22424
22424
  p1: { rawTime: u, normalizedTime: u, price: Q },
@@ -23872,8 +23872,8 @@ const nT = cd(function({
23872
23872
  F.current = null, b.current = !1, v.current = null, U.current = null, k.removeEventListener("mousedown", Y, S), k.removeEventListener("mousemove", x, S), k.removeEventListener("mousemove", O, S), k.removeEventListener("mouseup", oe, S);
23873
23873
  };
23874
23874
  }
23875
- }, [be, Ve, Ce, Se]), it(() => {
23876
- const p = l.current, d = c.current, k = o.current, xe = be === null || be === 1;
23875
+ }, [Qe, Ve, Ce, Se]), it(() => {
23876
+ const p = l.current, d = c.current, k = o.current, xe = Qe === null || Qe === 1;
23877
23877
  if (!xe || !p || !d || !k) {
23878
23878
  xe || (L(null), K([]), Ae(null), Z([]));
23879
23879
  return;
@@ -25976,7 +25976,7 @@ const nT = cd(function({
25976
25976
  return k.addEventListener("mousedown", oe, re), k.addEventListener("mousemove", S, re), k.addEventListener("mouseup", O, re), k.addEventListener("mouseleave", ae, re), () => {
25977
25977
  k.removeEventListener("mousedown", oe, re), k.removeEventListener("mousemove", S, re), k.removeEventListener("mouseup", O, re), k.removeEventListener("mouseleave", ae, re);
25978
25978
  };
25979
- }, [be, Ve, ze, Ce]), it(() => {
25979
+ }, [Qe, Ve, ze, Ce]), it(() => {
25980
25980
  const p = l.current, d = c.current;
25981
25981
  if (!p || !d) return;
25982
25982
  const k = () => {
@@ -26423,7 +26423,7 @@ const nT = cd(function({
26423
26423
  }), me.current = [], ke.filter((k) => k.symbol === Ee).forEach((k) => {
26424
26424
  const xe = parseFloat(k.price);
26425
26425
  if (isNaN(xe)) return;
26426
- const y = k.type === "BUY" ? "#26A69A" : "#EF5350", Y = p.createPriceLine({
26426
+ const y = k.type?.toUpperCase() === "BUY" ? "#26A69A" : "#EF5350", Y = p.createPriceLine({
26427
26427
  price: xe,
26428
26428
  color: y,
26429
26429
  lineWidth: 2,
@@ -26573,7 +26573,7 @@ const nT = cd(function({
26573
26573
  ref: o,
26574
26574
  className: "relative h-full w-full flex-1",
26575
26575
  style: {
26576
- cursor: be === 1 || be !== null ? "crosshair" : "default",
26576
+ cursor: Qe === 1 || Qe !== null ? "crosshair" : "default",
26577
26577
  minHeight: 0,
26578
26578
  minWidth: 0
26579
26579
  },
@@ -26608,7 +26608,7 @@ const nT = cd(function({
26608
26608
  {
26609
26609
  isOpen: Me,
26610
26610
  onClose: qp,
26611
- orderType: Qe,
26611
+ orderType: be,
26612
26612
  bidPrice: e,
26613
26613
  askPrice: t
26614
26614
  }
@@ -28142,14 +28142,14 @@ function cT({ style: i, className: e, maxHeight: t = 200 }) {
28142
28142
  const { orders: A, setOrders: r, symbols: n, accountSummary: s, setUserBalance: o } = Wt(), [a, l] = Ne(null), c = A.filter((v) => v.status === "OPEN" || !v.closeAt), m = vt(
28143
28143
  (v, U) => {
28144
28144
  const F = n.find((M) => M.symbol === v);
28145
- return F ? parseFloat(U === "BUY" ? F.bid || 0 : F.ask || 0) : 0;
28145
+ return F ? U?.toUpperCase() === "BUY" ? parseFloat(F.bid || 0) : parseFloat(F.ask || 0) : 0;
28146
28146
  },
28147
28147
  [n]
28148
28148
  ), C = vt(
28149
28149
  (v) => {
28150
28150
  if (a) return;
28151
28151
  l(v.id);
28152
- const U = m(v.symbol, v.type), M = (v.type === "BUY" ? U - v.price : v.price - U) * v.volume, N = v.volume * v.price * 0.01;
28152
+ const U = m(v.symbol, v.type), M = (v.type?.toUpperCase() === "BUY" ? U - v.price : v.price - U) * v.volume, N = v.volume * v.price * 0.01;
28153
28153
  r((W) => W.filter((L) => L.id !== v.id)), o((W) => W + N + M), l(null);
28154
28154
  },
28155
28155
  [a, m, r, o]
@@ -28231,7 +28231,7 @@ function cT({ style: i, className: e, maxHeight: t = 200 }) {
28231
28231
  {
28232
28232
  style: {
28233
28233
  ...tt.td,
28234
- ...v.type === "BUY" ? tt.typeBuy : tt.typeSell
28234
+ ...v.type?.toUpperCase() === "BUY" ? tt.typeBuy : tt.typeSell
28235
28235
  },
28236
28236
  children: v.type
28237
28237
  }
@@ -29147,7 +29147,7 @@ const hT = ({
29147
29147
  theme: v,
29148
29148
  setTheme: U,
29149
29149
  setIsShow: F
29150
- } = Wt(), [M, N] = Ne(!1), [W, L] = Ne(null), [V, j] = Ne(null), [X, K] = Ne(0), [ee, Ae] = Ne(!1), [ce, Z] = Ne(0), [te, se] = Ne(!1), [le, ne] = Ne(0), [he, pe] = Ne(!1), [we, Te] = Ne(0), [Ue, ye] = Ne(!1), [ve, be] = Ne({
29150
+ } = Wt(), [M, N] = Ne(!1), [W, L] = Ne(null), [V, j] = Ne(null), [X, K] = Ne(0), [ee, Ae] = Ne(!1), [ce, Z] = Ne(0), [te, se] = Ne(!1), [le, ne] = Ne(0), [he, pe] = Ne(!1), [we, Te] = Ne(0), [Ue, ye] = Ne(!1), [ve, Qe] = Ne({
29151
29151
  chart: "Grid",
29152
29152
  colors: "Green & Red",
29153
29153
  lang: "English"
@@ -29160,8 +29160,8 @@ const hT = ({
29160
29160
  V === "line" && Me && !Me.contains(ge.target) && j(null);
29161
29161
  const Re = Ze.current;
29162
29162
  V === "channel" && Re && !Re.contains(ge.target) && j(null);
29163
- const Qe = ze.current;
29164
- V === "gann" && Qe && !Qe.contains(ge.target) && j(null);
29163
+ const be = ze.current;
29164
+ V === "gann" && be && !be.contains(ge.target) && j(null);
29165
29165
  const Ke = Ce.current;
29166
29166
  V === "shape" && Ke && !Ke.contains(ge.target) && j(null);
29167
29167
  };
@@ -30616,8 +30616,8 @@ const hT = ({
30616
30616
  {
30617
30617
  type: "button",
30618
30618
  onClick: () => {
30619
- be((Qe) => ({
30620
- ...Qe,
30619
+ Qe((be) => ({
30620
+ ...be,
30621
30621
  [Pe.key]: me.label
30622
30622
  }));
30623
30623
  },
@@ -30680,8 +30680,8 @@ const hT = ({
30680
30680
  "button",
30681
30681
  {
30682
30682
  onClick: () => {
30683
- const Qe = Ar[X].toolId;
30684
- r(A === Qe ? null : Qe);
30683
+ const be = Ar[X].toolId;
30684
+ r(A === be ? null : be);
30685
30685
  },
30686
30686
  className: `relative w-10 h-10 flex items-center justify-center transition-colors duration-150
30687
30687
  ${A === Ar[X].toolId ? $e ? "text-sky-600 hover:bg-sky-100" : "text-sky-300 hover:bg-slate-700" : $e ? "text-slate-600 hover:bg-sky-100" : "text-slate-400 hover:bg-slate-700"}`,
@@ -30694,8 +30694,8 @@ const hT = ({
30694
30694
  {
30695
30695
  onMouseEnter: () => Ae(!0),
30696
30696
  onMouseLeave: () => Ae(!1),
30697
- onMouseDown: (Qe) => {
30698
- Qe.stopPropagation(), j(
30697
+ onMouseDown: (be) => {
30698
+ be.stopPropagation(), j(
30699
30699
  (Ke) => Ke === "line" ? null : "line"
30700
30700
  );
30701
30701
  },
@@ -30738,8 +30738,8 @@ const hT = ({
30738
30738
  "button",
30739
30739
  {
30740
30740
  onClick: () => {
30741
- const Qe = ir[ce].toolId;
30742
- r(A === Qe ? null : Qe);
30741
+ const be = ir[ce].toolId;
30742
+ r(A === be ? null : be);
30743
30743
  },
30744
30744
  className: `relative w-10 h-10 flex items-center justify-center transition-colors duration-150
30745
30745
  ${A === ir[ce].toolId ? $e ? "text-sky-600 hover:bg-sky-100" : "text-sky-300 hover:bg-slate-700" : $e ? "text-slate-600 hover:bg-sky-100" : "text-slate-400 hover:bg-slate-700"}`,
@@ -30752,8 +30752,8 @@ const hT = ({
30752
30752
  {
30753
30753
  onMouseEnter: () => se(!0),
30754
30754
  onMouseLeave: () => se(!1),
30755
- onMouseDown: (Qe) => {
30756
- Qe.stopPropagation(), j(
30755
+ onMouseDown: (be) => {
30756
+ be.stopPropagation(), j(
30757
30757
  (Ke) => Ke === "channel" ? null : "channel"
30758
30758
  );
30759
30759
  },
@@ -30796,8 +30796,8 @@ const hT = ({
30796
30796
  "button",
30797
30797
  {
30798
30798
  onClick: () => {
30799
- const Qe = rr[le].toolId;
30800
- r(A === Qe ? null : Qe);
30799
+ const be = rr[le].toolId;
30800
+ r(A === be ? null : be);
30801
30801
  },
30802
30802
  className: `relative w-10 h-10 flex items-center justify-center transition-colors duration-150
30803
30803
  ${A === rr[le].toolId ? $e ? "text-sky-600 hover:bg-sky-100" : "text-sky-300 hover:bg-slate-700" : $e ? "text-slate-600 hover:bg-sky-100" : "text-slate-400 hover:bg-slate-700"}`,
@@ -30810,8 +30810,8 @@ const hT = ({
30810
30810
  {
30811
30811
  onMouseEnter: () => pe(!0),
30812
30812
  onMouseLeave: () => pe(!1),
30813
- onMouseDown: (Qe) => {
30814
- Qe.stopPropagation(), j(
30813
+ onMouseDown: (be) => {
30814
+ be.stopPropagation(), j(
30815
30815
  (Ke) => Ke === "gann" ? null : "gann"
30816
30816
  );
30817
30817
  },
@@ -30854,8 +30854,8 @@ const hT = ({
30854
30854
  "button",
30855
30855
  {
30856
30856
  onClick: () => {
30857
- const Qe = nr[we].toolId;
30858
- r(A === Qe ? null : Qe);
30857
+ const be = nr[we].toolId;
30858
+ r(A === be ? null : be);
30859
30859
  },
30860
30860
  className: `relative w-10 h-10 flex items-center justify-center transition-colors duration-150
30861
30861
  ${A === nr[we].toolId ? $e ? "text-sky-600 hover:bg-sky-100" : "text-sky-300 hover:bg-slate-700" : $e ? "text-slate-600 hover:bg-sky-100" : "text-slate-400 hover:bg-slate-700"}`,
@@ -30868,8 +30868,8 @@ const hT = ({
30868
30868
  {
30869
30869
  onMouseEnter: () => ye(!0),
30870
30870
  onMouseLeave: () => ye(!1),
30871
- onMouseDown: (Qe) => {
30872
- Qe.stopPropagation(), j(
30871
+ onMouseDown: (be) => {
30872
+ be.stopPropagation(), j(
30873
30873
  (Ke) => Ke === "shape" ? null : "shape"
30874
30874
  );
30875
30875
  },
@@ -31415,7 +31415,7 @@ const pT = ({
31415
31415
  setIsShow: l,
31416
31416
  historyOrders: c,
31417
31417
  fetchHistoryOrders: m
31418
- } = Wt(), C = i || n, T = e?.length > 0 ? e : s, b = c || [], v = o === "light", U = a ? "history" : "trade";
31418
+ } = Wt(), C = i || n, T = e || s, b = c || [], v = o === "light", U = a ? "history" : "trade";
31419
31419
  it(() => {
31420
31420
  a && m && m();
31421
31421
  }, [a, m]);
@@ -31455,7 +31455,7 @@ const pT = ({
31455
31455
  overflow: "hidden",
31456
31456
  fontSize: "11px",
31457
31457
  color: X
31458
- }, be = {
31458
+ }, Qe = {
31459
31459
  display: "flex",
31460
31460
  alignItems: "center",
31461
31461
  gap: "0",
@@ -31522,7 +31522,7 @@ const pT = ({
31522
31522
  color: X
31523
31523
  };
31524
31524
  return /* @__PURE__ */ G("div", { style: ve, children: [
31525
- /* @__PURE__ */ G("div", { style: be, children: [
31525
+ /* @__PURE__ */ G("div", { style: Qe, children: [
31526
31526
  /* @__PURE__ */ G("div", { style: Se, children: [
31527
31527
  /* @__PURE__ */ h("span", { style: Ie, children: "Balance:" }),
31528
31528
  /* @__PURE__ */ G("span", { style: { ...Ze, color: X }, children: [
@@ -31679,9 +31679,9 @@ const pT = ({
31679
31679
  style: {
31680
31680
  ...Ee,
31681
31681
  fontWeight: 700,
31682
- color: de.type === "BUY" ? F : M
31682
+ color: de.type?.toUpperCase() === "BUY" ? F : M
31683
31683
  },
31684
- children: de.type
31684
+ children: de.type?.toUpperCase()
31685
31685
  }
31686
31686
  ),
31687
31687
  /* @__PURE__ */ h("td", { style: { ...Ee, textAlign: "right" }, children: we(de.volume) }),
@@ -31715,7 +31715,8 @@ const pT = ({
31715
31715
  ...Ee,
31716
31716
  textAlign: "right",
31717
31717
  color: K
31718
- }
31718
+ },
31719
+ children: de.currentPrice ? he(de.currentPrice) : "—"
31719
31720
  }
31720
31721
  ),
31721
31722
  /* @__PURE__ */ h(
@@ -31852,9 +31853,9 @@ const pT = ({
31852
31853
  style: {
31853
31854
  ...Ee,
31854
31855
  fontWeight: 700,
31855
- color: de.type === "BUY" ? F : M
31856
+ color: de.type?.toUpperCase() === "BUY" ? F : M
31856
31857
  },
31857
- children: de.type
31858
+ children: de.type?.toUpperCase()
31858
31859
  }
31859
31860
  ),
31860
31861
  /* @__PURE__ */ h("td", { style: { ...Ee, textAlign: "right" }, children: we(de.volume) }),