@backtest-kit/ui 4.0.1 → 5.1.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/build/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import http from 'http';
2
- import { isObject, singleshot, pickDocuments, str, memoize, BehaviorSubject, waitForNext, errorData, getErrorMessage } from 'functools-kit';
2
+ import { isObject, singleshot, pickDocuments, str, memoize, errorData, getErrorMessage } from 'functools-kit';
3
3
  import micro from 'micro';
4
4
  import Router from 'router';
5
5
  import finalhandler from 'finalhandler';
6
6
  import serveHandler from 'serve-handler';
7
7
  import os from 'os';
8
8
  import { createActivator } from 'di-kit';
9
- import { Exchange, Notification, Storage, Log, listenSignal } from 'backtest-kit';
9
+ import { Exchange, Notification, Storage, Log, Live, lib } from 'backtest-kit';
10
10
  import fs, { readdir, readFile } from 'fs/promises';
11
11
  import path, { join, dirname } from 'path';
12
12
  import { createRequire } from 'module';
@@ -65,12 +65,14 @@ const mockServices$1 = {
65
65
  storageMockService: Symbol("storageMockService"),
66
66
  exchangeMockService: Symbol("exchangeMockService"),
67
67
  logMockService: Symbol("logMockService"),
68
+ statusMockService: Symbol("statusMockService"),
68
69
  };
69
70
  const viewServices$1 = {
70
71
  notificationViewService: Symbol("notificationViewService"),
71
72
  storageViewService: Symbol("storageViewService"),
72
73
  exchangeViewService: Symbol("exchangeViewService"),
73
74
  logViewService: Symbol("logViewService"),
75
+ statusViewService: Symbol("statusViewService"),
74
76
  };
75
77
  const TYPES = {
76
78
  ...baseServices$1,
@@ -173,9 +175,9 @@ class LoggerService {
173
175
  }
174
176
  }
175
177
 
176
- const MOCK_PATH$2 = "./mock/notifications.json";
178
+ const MOCK_PATH$3 = "./mock/notifications.json";
177
179
  const READ_NOTIFICATION_LIST_FN = singleshot(async () => {
178
- const data = await fs.readFile(MOCK_PATH$2, "utf-8");
180
+ const data = await fs.readFile(MOCK_PATH$3, "utf-8");
179
181
  return JSON.parse(data);
180
182
  });
181
183
  const DEFAULT_LIMIT$3 = 25;
@@ -235,9 +237,9 @@ class NotificationMockService {
235
237
  }
236
238
  }
237
239
 
238
- const MOCK_PATH$1 = "./mock/db";
240
+ const MOCK_PATH$2 = "./mock/db";
239
241
  const READ_BACKTEST_STORAGE_FN = singleshot(async () => {
240
- const dbPath = join(process.cwd(), MOCK_PATH$1);
242
+ const dbPath = join(process.cwd(), MOCK_PATH$2);
241
243
  const files = await readdir(dbPath);
242
244
  const signals = [];
243
245
  for (const file of files) {
@@ -272,6 +274,7 @@ class StorageMockService {
272
274
  }
273
275
  }
274
276
 
277
+ const MS_PER_MINUTE$1 = 60000;
275
278
  class ExchangeMockService {
276
279
  constructor() {
277
280
  this.loggerService = inject(TYPES.loggerService);
@@ -295,12 +298,31 @@ class ExchangeMockService {
295
298
  interval,
296
299
  });
297
300
  };
301
+ this.getLiveCandles = async (signalId, interval) => {
302
+ this.loggerService.log("exchangeMockService getLiveCandles", {
303
+ signalId,
304
+ interval,
305
+ });
306
+ const signal = await this.storageMockService.findSignalById(signalId);
307
+ if (!signal) {
308
+ throw new Error(`Signal with ID ${signalId} not found`);
309
+ }
310
+ const { pendingAt, scheduledAt, minuteEstimatedTime, } = signal;
311
+ const eventAt = pendingAt || scheduledAt;
312
+ return await this.exchangeService.getRangeCandles({
313
+ symbol: signal.symbol,
314
+ exchangeName: signal.exchangeName,
315
+ signalStartTime: eventAt,
316
+ signalStopTime: eventAt + minuteEstimatedTime * MS_PER_MINUTE$1,
317
+ interval,
318
+ });
319
+ };
298
320
  }
299
321
  }
300
322
 
301
- const MOCK_PATH = "./mock/logs.json";
323
+ const MOCK_PATH$1 = "./mock/logs.json";
302
324
  const READ_LOG_LIST_FN = singleshot(async () => {
303
- const data = await fs.readFile(MOCK_PATH, "utf-8");
325
+ const data = await fs.readFile(MOCK_PATH$1, "utf-8");
304
326
  return JSON.parse(data);
305
327
  });
306
328
  const DEFAULT_LIMIT$2 = 25;
@@ -348,6 +370,68 @@ class LogMockService {
348
370
  }
349
371
  }
350
372
 
373
+ const MOCK_PATH = "./mock/status.json";
374
+ const READ_STATUS_LIST_FN = singleshot(async () => {
375
+ const data = await fs.readFile(MOCK_PATH, "utf-8");
376
+ return JSON.parse(data);
377
+ });
378
+ class StatusMockService {
379
+ constructor() {
380
+ this.loggerService = inject(TYPES.loggerService);
381
+ this.getStatusList = async () => {
382
+ this.loggerService.log("statusMockService getStatusList");
383
+ const list = await READ_STATUS_LIST_FN();
384
+ return list.map(({ id, symbol, strategyName, exchangeName }) => ({
385
+ id,
386
+ symbol,
387
+ strategyName,
388
+ exchangeName,
389
+ status: "pending",
390
+ }));
391
+ };
392
+ this.getStatusMap = async () => {
393
+ this.loggerService.log("statusMockService getStatusMap");
394
+ const list = await this.getStatusList();
395
+ return list.reduce((acm, cur) => ({ ...acm, [cur.id]: cur }), {});
396
+ };
397
+ this.getStatusOne = async (id) => {
398
+ this.loggerService.log("statusMockService getStatusOne", { id });
399
+ const list = await READ_STATUS_LIST_FN();
400
+ const signal = list.find((s) => s.id === id);
401
+ if (!signal) {
402
+ return null;
403
+ }
404
+ const positionEntries = signal._entry ?? [];
405
+ const positionLevels = positionEntries.map((e) => e.price);
406
+ const positionPartials = signal._partial ?? [];
407
+ return {
408
+ signalId: signal.signalId,
409
+ position: signal.position,
410
+ symbol: signal.symbol,
411
+ exchangeName: signal.exchangeName,
412
+ strategyName: signal.strategyName,
413
+ totalEntries: signal.totalEntries,
414
+ totalPartials: signal.totalPartials,
415
+ originalPriceStopLoss: signal.originalPriceStopLoss,
416
+ originalPriceTakeProfit: signal.originalPriceTakeProfit,
417
+ originalPriceOpen: signal.originalPriceOpen,
418
+ priceOpen: signal.priceOpen,
419
+ priceTakeProfit: signal.priceTakeProfit,
420
+ priceStopLoss: signal.priceStopLoss,
421
+ pnlPercentage: signal.pnl.pnlPercentage,
422
+ pnlCost: signal.pnl.pnlCost,
423
+ pnlEntries: signal.pnl.pnlEntries,
424
+ partialExecuted: signal.partialExecuted,
425
+ minuteEstimatedTime: signal.minuteEstimatedTime,
426
+ pendingAt: signal.pendingAt,
427
+ positionLevels,
428
+ positionEntries,
429
+ positionPartials,
430
+ };
431
+ };
432
+ }
433
+ }
434
+
351
435
  const DEFAULT_LIMIT$1 = 25;
352
436
  const DEFAULT_OFFSET$1 = 0;
353
437
  const CREATE_FILTER_LIST_FN$1 = (filterData) => Object.keys(filterData).map((key) => (row) => new RegExp(filterData[key], "i").test(row[key]));
@@ -492,6 +576,7 @@ class StorageViewService {
492
576
  }
493
577
  }
494
578
 
579
+ const MS_PER_MINUTE = 60000;
495
580
  class ExchangeViewService {
496
581
  constructor() {
497
582
  this.loggerService = inject(TYPES.loggerService);
@@ -519,6 +604,28 @@ class ExchangeViewService {
519
604
  interval,
520
605
  });
521
606
  };
607
+ this.getLiveCandles = async (signalId, interval) => {
608
+ this.loggerService.log("exchangeViewService getLiveCandles", {
609
+ signalId,
610
+ interval,
611
+ });
612
+ if (CC_ENABLE_MOCK) {
613
+ return await this.exchangeMockService.getLiveCandles(signalId, interval);
614
+ }
615
+ const signal = await this.storageViewService.findSignalById(signalId);
616
+ if (!signal) {
617
+ throw new Error(`Signal with ID ${signalId} not found`);
618
+ }
619
+ const { pendingAt, scheduledAt, minuteEstimatedTime, } = signal;
620
+ const eventAt = pendingAt || scheduledAt;
621
+ return await this.exchangeService.getRangeCandles({
622
+ symbol: signal.symbol,
623
+ exchangeName: signal.exchangeName,
624
+ signalStartTime: eventAt,
625
+ signalStopTime: eventAt + minuteEstimatedTime * MS_PER_MINUTE,
626
+ interval,
627
+ });
628
+ };
522
629
  }
523
630
  }
524
631
 
@@ -577,6 +684,100 @@ class LogViewService {
577
684
  }
578
685
  }
579
686
 
687
+ class StatusViewService {
688
+ constructor() {
689
+ this.loggerService = inject(TYPES.loggerService);
690
+ this.statusMockService = inject(TYPES.statusMockService);
691
+ this.getStatusList = async () => {
692
+ this.loggerService.log("statusViewService getStatusList");
693
+ if (CC_ENABLE_MOCK) {
694
+ const liveList = await this.statusMockService.getStatusList();
695
+ return liveList.filter(({ status }) => status === "pending");
696
+ }
697
+ return await Live.list();
698
+ };
699
+ this.getStatusMap = async () => {
700
+ this.loggerService.log("statusViewService getStatusMap");
701
+ if (CC_ENABLE_MOCK) {
702
+ return await this.statusMockService.getStatusMap();
703
+ }
704
+ const liveList = await Live.list();
705
+ return liveList
706
+ .filter(({ status }) => status === "pending")
707
+ .reduce((acm, cur) => ({ ...acm, [cur.id]: cur }), {});
708
+ };
709
+ this.getStatusOne = async (id) => {
710
+ this.loggerService.log("statusViewService getStatusOne", {
711
+ id,
712
+ });
713
+ if (CC_ENABLE_MOCK) {
714
+ return await this.statusMockService.getStatusOne(id);
715
+ }
716
+ const liveList = await Live.list();
717
+ const liveOne = liveList.find((live) => live.id === id);
718
+ if (!liveOne) {
719
+ throw new Error(`Live with id ${id} not found`);
720
+ }
721
+ const { symbol, strategyName, exchangeName } = liveOne;
722
+ const currentPrice = await Exchange.getAveragePrice(symbol, {
723
+ exchangeName,
724
+ });
725
+ const pendingSignal = await Live.getPendingSignal(symbol, currentPrice, {
726
+ strategyName,
727
+ exchangeName,
728
+ });
729
+ if (!pendingSignal) {
730
+ return null;
731
+ }
732
+ const positionLevels = await Live.getPositionLevels(symbol, {
733
+ strategyName,
734
+ exchangeName,
735
+ });
736
+ if (!positionLevels) {
737
+ return null;
738
+ }
739
+ const positionEntries = await Live.getPositionEntries(symbol, {
740
+ strategyName,
741
+ exchangeName,
742
+ });
743
+ if (!positionEntries) {
744
+ return null;
745
+ }
746
+ const positionPartials = await Live.getPositionPartials(symbol, {
747
+ strategyName,
748
+ exchangeName,
749
+ });
750
+ if (!positionPartials) {
751
+ return null;
752
+ }
753
+ return {
754
+ signalId: pendingSignal.id,
755
+ position: pendingSignal.position,
756
+ symbol: pendingSignal.symbol,
757
+ exchangeName: pendingSignal.exchangeName,
758
+ strategyName: pendingSignal.strategyName,
759
+ totalEntries: pendingSignal.totalEntries,
760
+ totalPartials: pendingSignal.totalPartials,
761
+ originalPriceStopLoss: pendingSignal.originalPriceStopLoss,
762
+ originalPriceTakeProfit: pendingSignal.originalPriceTakeProfit,
763
+ originalPriceOpen: pendingSignal.originalPriceOpen,
764
+ priceOpen: pendingSignal.priceOpen,
765
+ priceTakeProfit: pendingSignal.priceTakeProfit,
766
+ priceStopLoss: pendingSignal.priceStopLoss,
767
+ pnlPercentage: pendingSignal.pnl.pnlPercentage,
768
+ pnlCost: pendingSignal.pnl.pnlCost,
769
+ pnlEntries: pendingSignal.pnl.pnlEntries,
770
+ partialExecuted: pendingSignal.partialExecuted,
771
+ pendingAt: pendingSignal.pendingAt,
772
+ minuteEstimatedTime: pendingSignal.minuteEstimatedTime,
773
+ positionEntries,
774
+ positionLevels,
775
+ positionPartials,
776
+ };
777
+ };
778
+ }
779
+ }
780
+
580
781
  const symbol_list = [
581
782
  {
582
783
  icon: "/icon/btc.png",
@@ -702,22 +903,6 @@ class SymbolMetaService {
702
903
  }
703
904
  }
704
905
 
705
- const PRICE_TIMEOUT = 120000;
706
- const CREATE_KEY_FN = (symbol, strategyName, exchangeName, frameName, backtest) => {
707
- const parts = [symbol, strategyName, exchangeName];
708
- if (frameName)
709
- parts.push(frameName);
710
- parts.push(backtest ? "backtest" : "live");
711
- return parts.join(":");
712
- };
713
- const GET_SUBJECT_FN = memoize(([symbol, strategyName, exchangeName, frameName, backtest]) => CREATE_KEY_FN(symbol, strategyName, exchangeName, frameName, backtest), () => new BehaviorSubject());
714
- const GET_PRICE_FN = async (symbol, strategyName, exchangeName, frameName, backtest) => {
715
- const priceSubject = GET_SUBJECT_FN(symbol, strategyName, exchangeName, frameName, backtest);
716
- if (priceSubject.data) {
717
- return priceSubject.data;
718
- }
719
- return await waitForNext(priceSubject, (data) => !!data, PRICE_TIMEOUT);
720
- };
721
906
  class PriceConnectionService {
722
907
  constructor() {
723
908
  this.loggerService = inject(TYPES.loggerService);
@@ -729,19 +914,8 @@ class PriceConnectionService {
729
914
  frameName,
730
915
  backtest,
731
916
  });
732
- const currentPrice = await GET_PRICE_FN(symbol, strategyName, exchangeName, frameName, backtest);
733
- if (typeof currentPrice === "symbol") {
734
- throw new Error(`Price for ${CREATE_KEY_FN(symbol, strategyName, exchangeName, frameName, backtest)} not received within timeout`);
735
- }
736
- return currentPrice;
917
+ return await lib.priceMetaService.getCurrentPrice(symbol, { strategyName, exchangeName, frameName }, backtest);
737
918
  };
738
- this.init = singleshot(async () => {
739
- this.loggerService.log("priceConnectionService init");
740
- listenSignal((event) => {
741
- const priceSubject = GET_SUBJECT_FN(event.symbol, event.strategyName, event.exchangeName, event.frameName, event.backtest);
742
- event.currentPrice && priceSubject.next(event.currentPrice);
743
- });
744
- });
745
919
  }
746
920
  }
747
921
 
@@ -761,12 +935,14 @@ class PriceConnectionService {
761
935
  provide(TYPES.storageMockService, () => new StorageMockService());
762
936
  provide(TYPES.exchangeMockService, () => new ExchangeMockService());
763
937
  provide(TYPES.logMockService, () => new LogMockService());
938
+ provide(TYPES.statusMockService, () => new StatusMockService());
764
939
  }
765
940
  {
766
941
  provide(TYPES.notificationViewService, () => new NotificationViewService());
767
942
  provide(TYPES.storageViewService, () => new StorageViewService());
768
943
  provide(TYPES.exchangeViewService, () => new ExchangeViewService());
769
944
  provide(TYPES.logViewService, () => new LogViewService());
945
+ provide(TYPES.statusViewService, () => new StatusViewService());
770
946
  }
771
947
 
772
948
  const baseServices = {
@@ -785,12 +961,14 @@ const mockServices = {
785
961
  storageMockService: inject(TYPES.storageMockService),
786
962
  exchangeMockService: inject(TYPES.exchangeMockService),
787
963
  logMockService: inject(TYPES.logMockService),
964
+ statusMockService: inject(TYPES.statusMockService),
788
965
  };
789
966
  const viewServices = {
790
967
  notificationViewService: inject(TYPES.notificationViewService),
791
968
  storageViewService: inject(TYPES.storageViewService),
792
969
  exchangeViewService: inject(TYPES.exchangeViewService),
793
970
  logViewService: inject(TYPES.logViewService),
971
+ statusViewService: inject(TYPES.statusViewService),
794
972
  };
795
973
  const ioc = {
796
974
  ...baseServices,
@@ -1124,6 +1302,92 @@ router$6.post("/api/v1/mock/log_filter", async (req, res) => {
1124
1302
  });
1125
1303
  }
1126
1304
  });
1305
+ router$6.post("/api/v1/mock/candles_live", async (req, res) => {
1306
+ try {
1307
+ const request = await micro.json(req);
1308
+ const { signalId, interval, requestId, serviceName } = request;
1309
+ const data = await ioc.exchangeMockService.getLiveCandles(signalId, interval);
1310
+ const result = {
1311
+ data,
1312
+ status: "ok",
1313
+ error: "",
1314
+ requestId,
1315
+ serviceName,
1316
+ };
1317
+ ioc.loggerService.log("/api/v1/mock/candles_live ok", {
1318
+ request,
1319
+ result: omit(result, "data"),
1320
+ });
1321
+ return await micro.send(res, 200, result);
1322
+ }
1323
+ catch (error) {
1324
+ ioc.loggerService.log("/api/v1/mock/candles_live error", {
1325
+ error: errorData(error),
1326
+ });
1327
+ return await micro.send(res, 200, {
1328
+ status: "error",
1329
+ error: getErrorMessage(error),
1330
+ });
1331
+ }
1332
+ });
1333
+ // StatusMockService endpoints
1334
+ router$6.post("/api/v1/mock/status_list", async (req, res) => {
1335
+ try {
1336
+ const request = await micro.json(req);
1337
+ const { requestId, serviceName } = request;
1338
+ const data = await ioc.statusMockService.getStatusList();
1339
+ const result = {
1340
+ data,
1341
+ status: "ok",
1342
+ error: "",
1343
+ requestId,
1344
+ serviceName,
1345
+ };
1346
+ ioc.loggerService.log("/api/v1/mock/status_list ok", {
1347
+ request,
1348
+ result: omit(result, "data"),
1349
+ });
1350
+ return await micro.send(res, 200, result);
1351
+ }
1352
+ catch (error) {
1353
+ ioc.loggerService.log("/api/v1/mock/status_list error", {
1354
+ error: errorData(error),
1355
+ });
1356
+ return await micro.send(res, 200, {
1357
+ status: "error",
1358
+ error: getErrorMessage(error),
1359
+ });
1360
+ }
1361
+ });
1362
+ router$6.post("/api/v1/mock/status_one/:id", async (req, res) => {
1363
+ try {
1364
+ const request = await micro.json(req);
1365
+ const { requestId, serviceName } = request;
1366
+ const id = req.params.id;
1367
+ const data = await ioc.statusMockService.getStatusOne(id);
1368
+ const result = {
1369
+ data,
1370
+ status: "ok",
1371
+ error: "",
1372
+ requestId,
1373
+ serviceName,
1374
+ };
1375
+ ioc.loggerService.log("/api/v1/mock/status_one/:id ok", {
1376
+ request,
1377
+ result: omit(result, "data"),
1378
+ });
1379
+ return await micro.send(res, 200, result);
1380
+ }
1381
+ catch (error) {
1382
+ ioc.loggerService.log("/api/v1/mock/status_one/:id error", {
1383
+ error: errorData(error),
1384
+ });
1385
+ return await micro.send(res, 200, {
1386
+ status: "error",
1387
+ error: getErrorMessage(error),
1388
+ });
1389
+ }
1390
+ });
1127
1391
 
1128
1392
  const router$5 = Router({
1129
1393
  params: true,
@@ -1190,6 +1454,34 @@ router$5.post("/api/v1/view/candles_point", async (req, res) => {
1190
1454
  });
1191
1455
  }
1192
1456
  });
1457
+ router$5.post("/api/v1/view/candles_live", async (req, res) => {
1458
+ try {
1459
+ const request = await micro.json(req);
1460
+ const { signalId, interval, requestId, serviceName } = request;
1461
+ const data = await ioc.exchangeViewService.getLiveCandles(signalId, interval);
1462
+ const result = {
1463
+ data,
1464
+ status: "ok",
1465
+ error: "",
1466
+ requestId,
1467
+ serviceName,
1468
+ };
1469
+ ioc.loggerService.log("/api/v1/view/candles_live ok", {
1470
+ request,
1471
+ result: omit(result, "data"),
1472
+ });
1473
+ return await micro.send(res, 200, result);
1474
+ }
1475
+ catch (error) {
1476
+ ioc.loggerService.log("/api/v1/view/candles_live error", {
1477
+ error: errorData(error),
1478
+ });
1479
+ return await micro.send(res, 200, {
1480
+ status: "error",
1481
+ error: getErrorMessage(error),
1482
+ });
1483
+ }
1484
+ });
1193
1485
  // NotificationViewService endpoints
1194
1486
  router$5.post("/api/v1/view/notification_list", async (req, res) => {
1195
1487
  try {
@@ -1448,6 +1740,64 @@ router$5.post("/api/v1/view/log_filter", async (req, res) => {
1448
1740
  });
1449
1741
  }
1450
1742
  });
1743
+ // StatusViewService endpoints
1744
+ router$5.post("/api/v1/view/status_list", async (req, res) => {
1745
+ try {
1746
+ const request = await micro.json(req);
1747
+ const { requestId, serviceName } = request;
1748
+ const data = await ioc.statusViewService.getStatusList();
1749
+ const result = {
1750
+ data,
1751
+ status: "ok",
1752
+ error: "",
1753
+ requestId,
1754
+ serviceName,
1755
+ };
1756
+ ioc.loggerService.log("/api/v1/view/status_list ok", {
1757
+ request,
1758
+ result: omit(result, "data"),
1759
+ });
1760
+ return await micro.send(res, 200, result);
1761
+ }
1762
+ catch (error) {
1763
+ ioc.loggerService.log("/api/v1/view/status_list error", {
1764
+ error: errorData(error),
1765
+ });
1766
+ return await micro.send(res, 200, {
1767
+ status: "error",
1768
+ error: getErrorMessage(error),
1769
+ });
1770
+ }
1771
+ });
1772
+ router$5.post("/api/v1/view/status_one/:id", async (req, res) => {
1773
+ try {
1774
+ const request = await micro.json(req);
1775
+ const { requestId, serviceName } = request;
1776
+ const id = req.params.id;
1777
+ const data = await ioc.statusViewService.getStatusOne(id);
1778
+ const result = {
1779
+ data,
1780
+ status: "ok",
1781
+ error: "",
1782
+ requestId,
1783
+ serviceName,
1784
+ };
1785
+ ioc.loggerService.log("/api/v1/view/status_one/:id ok", {
1786
+ request,
1787
+ result: omit(result, "data"),
1788
+ });
1789
+ return await micro.send(res, 200, result);
1790
+ }
1791
+ catch (error) {
1792
+ ioc.loggerService.log("/api/v1/view/status_one/:id error", {
1793
+ error: errorData(error),
1794
+ });
1795
+ return await micro.send(res, 200, {
1796
+ status: "error",
1797
+ error: getErrorMessage(error),
1798
+ });
1799
+ }
1800
+ });
1451
1801
 
1452
1802
  const require$1 = createRequire(import.meta.url);
1453
1803
  function getModulesPath() {
@@ -0,0 +1 @@
1
+ import{f as n,az as o}from"./index-B6tX14ok.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
@@ -1 +1 @@
1
- import{f as e,i as t,B as r,J as s}from"./index-Bdi8Xt6Q.js";const a=({className:a,symbol:i,style:o,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[i],l=null==s?void 0:s.icon,c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:a,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:o,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:i,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:a,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:o,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{a as I};
1
+ import{f as e,i as t,B as r,J as s}from"./index-B6tX14ok.js";const a=({className:a,symbol:i,style:o,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[i],l=null==s?void 0:s.icon,c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:a,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:o,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:i,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:a,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:o,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{a as I};
@@ -1 +1 @@
1
- import{c as o,f as r}from"./index-Bdi8Xt6Q.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
1
+ import{c as o,f as r}from"./index-B6tX14ok.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
@@ -1 +1 @@
1
- import{ar as e,as as t,K as a,at as s,f as i,au as n,av as o,aw as r,ax as d,ay as m,az as u,aA as p,aB as x,c}from"./index-Bdi8Xt6Q.js";const h=e(),l=["className","component","disableGutters","fixed","maxWidth","classes"],b=m(),f=h("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>r({props:e,name:"MuiContainer",defaultTheme:b});const W=function(e={}){const{createStyledComponent:r=f,useThemeProps:m=g,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:c,component:h="div",disableGutters:b=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,l),k=t({},r,{component:h,disableGutters:b,fixed:f,maxWidth:g}),v=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:h,ownerState:k,className:n(v.root,c),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})}),k=c(i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{W as C,k as R};
1
+ import{aA as e,aB as t,r as a,aC as s,f as i,aD as n,aE as o,aF as r,aG as d,aH as m,aI as u,aJ as p,aK as x,c}from"./index-B6tX14ok.js";const h=e(),l=["className","component","disableGutters","fixed","maxWidth","classes"],b=m(),f=h("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>r({props:e,name:"MuiContainer",defaultTheme:b});const W=function(e={}){const{createStyledComponent:r=f,useThemeProps:m=g,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:c,component:h="div",disableGutters:b=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,l),k=t({},r,{component:h,disableGutters:b,fixed:f,maxWidth:g}),S=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:h,ownerState:k,className:n(S.root,c),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})}),k=c(i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{W as C,k as R};