@agg-market/ui 3.0.0 → 4.0.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/chart.js +18 -5
- package/dist/chart.mjs +2 -2
- package/dist/{chunk-LK5D3ZTK.mjs → chunk-3QLOUBDJ.mjs} +1 -1
- package/dist/{chunk-4KMFDCAH.mjs → chunk-3W7NBJLU.mjs} +2 -2
- package/dist/{chunk-KCPDVBIZ.mjs → chunk-4S3I6X7F.mjs} +14 -13
- package/dist/{chunk-OA2IZ3VW.mjs → chunk-5ADMXO3Y.mjs} +1 -1
- package/dist/{chunk-7NISYVSJ.mjs → chunk-6JG6I5AY.mjs} +1 -1
- package/dist/{chunk-TA7LKYKP.mjs → chunk-DCORNTCY.mjs} +1 -1
- package/dist/{chunk-QYZKC7KG.mjs → chunk-GNSPZ53C.mjs} +87 -86
- package/dist/{chunk-422MCIXV.mjs → chunk-HOXTJ742.mjs} +15 -11
- package/dist/{chunk-KFOATMAE.mjs → chunk-JNH64AKR.mjs} +32 -25
- package/dist/{chunk-DL7STJQ5.mjs → chunk-LA3FBBSJ.mjs} +3 -3
- package/dist/{chunk-CTVMT3VL.mjs → chunk-LCZKSITC.mjs} +2 -2
- package/dist/chunk-M4RJHRFT.mjs +445 -0
- package/dist/{chunk-D5FTFSKL.mjs → chunk-MBHTXNHX.mjs} +4 -4
- package/dist/{chunk-O46OFVH6.mjs → chunk-MJHKBCXQ.mjs} +2 -2
- package/dist/{chunk-2MJY6RVY.mjs → chunk-NH2G3POM.mjs} +1 -1
- package/dist/{chunk-BEDUFOIG.mjs → chunk-OH56VUYK.mjs} +6 -20
- package/dist/{chunk-BN5VVHNV.mjs → chunk-OJVTGNIF.mjs} +17 -4
- package/dist/{chunk-6425RRBI.mjs → chunk-P2PJBO5C.mjs} +1 -1
- package/dist/{chunk-D7JTOGYP.mjs → chunk-PORVP72S.mjs} +22 -2
- package/dist/{chunk-5GDNWQZS.mjs → chunk-QLMVKLNJ.mjs} +1 -1
- package/dist/{chunk-GHB3GOCW.mjs → chunk-QM7CGMFG.mjs} +5 -21
- package/dist/connect-button.js +22 -2
- package/dist/connect-button.mjs +2 -2
- package/dist/deposit-modal.js +22 -2
- package/dist/deposit-modal.mjs +2 -2
- package/dist/event-list-item-details.js +235 -243
- package/dist/event-list-item-details.mjs +7 -7
- package/dist/event-list-item.js +178 -210
- package/dist/event-list-item.mjs +4 -4
- package/dist/event-list.js +181 -225
- package/dist/event-list.mjs +5 -5
- package/dist/event-market-page.d.mts +1 -1
- package/dist/event-market-page.d.ts +1 -1
- package/dist/event-market-page.js +498 -576
- package/dist/event-market-page.mjs +11 -12
- package/dist/home-page.js +181 -225
- package/dist/home-page.mjs +6 -6
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +331 -347
- package/dist/index.mjs +21 -21
- package/dist/market-details.d.mts +1 -1
- package/dist/market-details.d.ts +1 -1
- package/dist/market-details.js +345 -417
- package/dist/market-details.mjs +7 -8
- package/dist/onboarding-modal.js +35 -14
- package/dist/onboarding-modal.mjs +2 -2
- package/dist/place-order.d.mts +1 -1
- package/dist/place-order.d.ts +1 -1
- package/dist/place-order.js +173 -191
- package/dist/place-order.mjs +3 -3
- package/dist/profile-modal.js +22 -2
- package/dist/profile-modal.mjs +2 -2
- package/dist/search.d.mts +1 -1
- package/dist/search.d.ts +1 -1
- package/dist/search.js +22 -2
- package/dist/search.mjs +2 -2
- package/dist/settlement.d.mts +1 -1
- package/dist/settlement.d.ts +1 -1
- package/dist/settlement.js +173 -191
- package/dist/settlement.mjs +3 -3
- package/dist/skeleton.js +151 -189
- package/dist/skeleton.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/switch-button.js +2 -2
- package/dist/switch-button.mjs +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/user-profile-page.d.mts +1 -1
- package/dist/user-profile-page.d.ts +1 -1
- package/dist/user-profile-page.js +22 -2
- package/dist/user-profile-page.mjs +2 -2
- package/dist/venue-logo.d.mts +3 -2
- package/dist/venue-logo.d.ts +3 -2
- package/dist/venue-logo.js +22 -2
- package/dist/venue-logo.mjs +1 -1
- package/dist/{venue-logo.types-HRf1yBLD.d.mts → venue-logo.types-CGUc22ly.d.mts} +3 -1
- package/dist/{venue-logo.types-D8Cu2rAm.d.ts → venue-logo.types-Dqr39S1-.d.ts} +3 -1
- package/dist/withdraw-modal.js +22 -2
- package/dist/withdraw-modal.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-V52WSZHQ.mjs +0 -482
- package/dist/{types-JBf1DZlH.d.ts → types-DkGlbmXq.d.mts} +2 -2
- package/dist/{types-JBf1DZlH.d.mts → types-DkGlbmXq.d.ts} +2 -2
package/dist/market-details.js
CHANGED
|
@@ -63,7 +63,7 @@ __export(market_details_exports, {
|
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(market_details_exports);
|
|
65
65
|
var import_react5 = require("react");
|
|
66
|
-
var
|
|
66
|
+
var import_hooks13 = require("@agg-market/hooks");
|
|
67
67
|
|
|
68
68
|
// src/primitives/card/index.tsx
|
|
69
69
|
var import_hooks = require("@agg-market/hooks");
|
|
@@ -176,10 +176,10 @@ var SwitchButton = ({
|
|
|
176
176
|
return null;
|
|
177
177
|
}
|
|
178
178
|
const handleKeyDown = (event, optionIndex) => {
|
|
179
|
-
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
|
|
179
|
+
if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
event.preventDefault();
|
|
182
|
+
event == null ? void 0 : event.preventDefault();
|
|
183
183
|
const nextOptionIndex = resolveNextEnabledIndex(
|
|
184
184
|
options,
|
|
185
185
|
optionIndex,
|
|
@@ -296,8 +296,18 @@ var normalizeSeries = (series) => {
|
|
|
296
296
|
var defaultValueFormatter = (value) => {
|
|
297
297
|
return `${Math.round(value)}%`;
|
|
298
298
|
};
|
|
299
|
-
var
|
|
300
|
-
return
|
|
299
|
+
var resolveTimeFormatter = (windowSeconds) => {
|
|
300
|
+
return (timestamp) => {
|
|
301
|
+
if (!Number.isFinite(timestamp))
|
|
302
|
+
return "";
|
|
303
|
+
if (windowSeconds <= 48 * 60 * 60) {
|
|
304
|
+
return import_dayjs.default.unix(timestamp).format("HH:mm");
|
|
305
|
+
}
|
|
306
|
+
if (windowSeconds <= 14 * 24 * 60 * 60) {
|
|
307
|
+
return import_dayjs.default.unix(timestamp).format("MMM D HH:mm");
|
|
308
|
+
}
|
|
309
|
+
return import_dayjs.default.unix(timestamp).format("MMM D");
|
|
310
|
+
};
|
|
301
311
|
};
|
|
302
312
|
var toLivelinePoints = (points) => {
|
|
303
313
|
return points.map((point) => ({
|
|
@@ -420,6 +430,9 @@ var LineChart = ({
|
|
|
420
430
|
const windowSeconds = (0, import_react2.useMemo)(() => {
|
|
421
431
|
return resolveWindowSeconds(normalizedSeries);
|
|
422
432
|
}, [normalizedSeries]);
|
|
433
|
+
const timeFormatter = (0, import_react2.useMemo)(() => {
|
|
434
|
+
return resolveTimeFormatter(windowSeconds);
|
|
435
|
+
}, [windowSeconds]);
|
|
423
436
|
const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
|
|
424
437
|
series: normalizedSeries,
|
|
425
438
|
activeSeriesId,
|
|
@@ -458,7 +471,7 @@ var LineChart = ({
|
|
|
458
471
|
pulse: false,
|
|
459
472
|
window: windowSeconds,
|
|
460
473
|
formatValue: defaultValueFormatter,
|
|
461
|
-
formatTime:
|
|
474
|
+
formatTime: timeFormatter,
|
|
462
475
|
padding: {
|
|
463
476
|
top: 12,
|
|
464
477
|
right: 80,
|
|
@@ -510,6 +523,7 @@ var EventListItemSkeletonView = ({
|
|
|
510
523
|
isStandalone = false
|
|
511
524
|
}) => {
|
|
512
525
|
const labels = (0, import_hooks5.useLabels)();
|
|
526
|
+
const outcomeTitleWidths = ["w-40", "w-[200px]"];
|
|
513
527
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
514
528
|
Card,
|
|
515
529
|
{
|
|
@@ -519,35 +533,23 @@ var EventListItemSkeletonView = ({
|
|
|
519
533
|
"aria-busy": isStandalone || void 0,
|
|
520
534
|
"aria-hidden": isStandalone ? void 0 : true,
|
|
521
535
|
children: [
|
|
522
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex w-full items-
|
|
523
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "
|
|
524
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.
|
|
525
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm" }),
|
|
526
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-5 w-[68%] rounded-agg-sm" })
|
|
527
|
-
] })
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
|
|
528
539
|
] }),
|
|
529
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col gap-3", children:
|
|
530
|
-
"
|
|
531
|
-
{
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-9 w-[101px] rounded-agg-full" })
|
|
537
|
-
]
|
|
538
|
-
},
|
|
539
|
-
index
|
|
540
|
-
)) }),
|
|
541
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center justify-between gap-2 text-agg-muted-foreground", children: [
|
|
542
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" }),
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex flex-col gap-3", children: outcomeTitleWidths.map((outcomeTitleWidth, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
541
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: cn("h-5 rounded-agg-sm", outcomeTitleWidth) }),
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
|
|
543
|
+
] }, index)) }),
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center justify-between gap-5 text-agg-muted-foreground", children: [
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" }),
|
|
544
547
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
545
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-
|
|
546
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-
|
|
547
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-3 rounded-agg-full" })
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" }),
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" })
|
|
548
550
|
] })
|
|
549
551
|
] }),
|
|
550
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
551
553
|
] })
|
|
552
554
|
]
|
|
553
555
|
}
|
|
@@ -567,13 +569,9 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
|
|
|
567
569
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
|
|
568
570
|
"aria-busy": true,
|
|
569
571
|
children: [
|
|
570
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "flex w-full flex-col items-start justify-between gap-
|
|
571
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-7 w-
|
|
572
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
573
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
574
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
575
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-10 w-24 rounded-agg-full" })
|
|
576
|
-
] })
|
|
572
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "flex w-full flex-col items-start justify-between gap-3 md:flex-row md:flex-nowrap md:items-center md:gap-5", children: [
|
|
573
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-7 w-[120px] rounded-agg-md" }),
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SkeletonBlock, { className: "h-8 w-full rounded-agg-md md:w-[400px]" })
|
|
577
575
|
] }),
|
|
578
576
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "grid grid-cols-1 gap-5 md:grid-cols-3", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
579
577
|
EventListItemSkeletonView,
|
|
@@ -625,30 +623,26 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
625
623
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
|
|
626
624
|
"aria-busy": true,
|
|
627
625
|
children: [
|
|
628
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full items-
|
|
629
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-10 rounded-agg-lg
|
|
630
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
631
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm md:h-7 md:w-[55%]" }),
|
|
632
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-2 overflow-hidden", children: [
|
|
633
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
634
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
635
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" })
|
|
636
|
-
] })
|
|
637
|
-
] })
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
|
|
638
629
|
] }),
|
|
639
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
640
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full flex-col gap-4 md:gap-6", children: [
|
|
631
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
632
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex max-w-full gap-2 overflow-hidden", children: [
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
|
|
635
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
|
|
636
|
+
] }),
|
|
637
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-full max-w-[221px] rounded-agg-full md:w-[221px]" })
|
|
638
|
+
] }),
|
|
639
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
640
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-[220px] w-full rounded-agg-xl md:h-[240px]" }),
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[59px] rounded-agg-sm" }),
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
|
|
644
|
+
] })
|
|
646
645
|
] })
|
|
647
|
-
] }),
|
|
648
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "h-[300px] w-full rounded-agg-xl", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-full w-full rounded-agg-xl" }) }),
|
|
649
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
650
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
651
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
|
|
652
646
|
] })
|
|
653
647
|
]
|
|
654
648
|
}
|
|
@@ -672,6 +666,77 @@ var orderBookRowLimitDefault = 4;
|
|
|
672
666
|
|
|
673
667
|
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
674
668
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
669
|
+
var orderBookAskBarWidths = [
|
|
670
|
+
"w-[52px] md:w-[240px]",
|
|
671
|
+
"w-[48px] md:w-[200px]",
|
|
672
|
+
"w-[40px] md:w-[120px]",
|
|
673
|
+
"w-[36px] md:w-[60px]"
|
|
674
|
+
];
|
|
675
|
+
var orderBookBidBarWidths = [
|
|
676
|
+
"w-[36px] md:w-[60px]",
|
|
677
|
+
"w-[40px] md:w-[120px]",
|
|
678
|
+
"w-[48px] md:w-[200px]",
|
|
679
|
+
"w-[52px] md:w-[240px]"
|
|
680
|
+
];
|
|
681
|
+
var MarketDetailsHeaderSkeleton = () => {
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3 md:px-5", children: [
|
|
683
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:min-w-52 md:gap-4", children: [
|
|
684
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
686
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-6 w-[132px] rounded-agg-sm" }),
|
|
687
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-[141px] rounded-agg-sm" })
|
|
688
|
+
] })
|
|
689
|
+
] }),
|
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-9 w-[60px] rounded-agg-md" }),
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex w-full gap-2 md:w-auto", children: [
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[135px]" }),
|
|
693
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[131px]" })
|
|
694
|
+
] })
|
|
695
|
+
] });
|
|
696
|
+
};
|
|
697
|
+
var MarketDetailsTabsSkeleton = () => {
|
|
698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex h-14 items-end px-4 md:px-5", children: [
|
|
699
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex h-full flex-col items-end justify-end rounded-t-agg-lg", children: [
|
|
700
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }) }),
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
|
|
702
|
+
] }),
|
|
703
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex h-full flex-col justify-center", children: [
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-6 w-12 rounded-agg-sm" }) }),
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-[3px] w-full" })
|
|
706
|
+
] })
|
|
707
|
+
] });
|
|
708
|
+
};
|
|
709
|
+
var MarketDetailsOrderBookRows = ({
|
|
710
|
+
side,
|
|
711
|
+
barWidths
|
|
712
|
+
}) => {
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col gap-2", children: barWidths.map((barWidthClassName, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
|
|
716
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
718
|
+
] }),
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: cn("h-2 rounded-agg-full", barWidthClassName) }) })
|
|
722
|
+
] }),
|
|
723
|
+
index < barWidths.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
|
|
724
|
+
] }, `${side}-row-${index}`)) });
|
|
725
|
+
};
|
|
726
|
+
var MarketDetailsOderbookSkeleton = ({
|
|
727
|
+
className
|
|
728
|
+
}) => {
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("flex flex-col gap-5", className), children: [
|
|
730
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
731
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarketDetailsOrderBookRows, { side: "ask", barWidths: orderBookAskBarWidths })
|
|
733
|
+
] }),
|
|
734
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
|
|
736
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarketDetailsOrderBookRows, { side: "bid", barWidths: orderBookBidBarWidths })
|
|
737
|
+
] })
|
|
738
|
+
] });
|
|
739
|
+
};
|
|
675
740
|
var MarketDetailsSkeletonView = ({
|
|
676
741
|
className,
|
|
677
742
|
ariaLabel,
|
|
@@ -686,60 +751,12 @@ var MarketDetailsSkeletonView = ({
|
|
|
686
751
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
|
|
687
752
|
"aria-busy": true,
|
|
688
753
|
children: [
|
|
689
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
690
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
691
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
|
|
692
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
|
|
693
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
694
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-6 w-40 rounded-agg-sm" }),
|
|
695
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-28 rounded-agg-sm" })
|
|
696
|
-
] })
|
|
697
|
-
] }),
|
|
698
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-8 w-16 rounded-agg-sm" })
|
|
699
|
-
] }),
|
|
700
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex gap-2", children: [
|
|
701
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" }),
|
|
702
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" })
|
|
703
|
-
] })
|
|
704
|
-
] }),
|
|
754
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarketDetailsHeaderSkeleton, {}),
|
|
705
755
|
isDetailed ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
706
756
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
707
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarketDetailsTabsSkeleton, {}),
|
|
708
758
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
709
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
710
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
711
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
712
|
-
[0, 1, 2, 3].map((index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
713
|
-
"div",
|
|
714
|
-
{
|
|
715
|
-
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
716
|
-
children: [
|
|
717
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
718
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
719
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
720
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
721
|
-
]
|
|
722
|
-
},
|
|
723
|
-
`ask-${index}`
|
|
724
|
-
))
|
|
725
|
-
] }),
|
|
726
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
727
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
728
|
-
[0, 1, 2, 3].map((index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
729
|
-
"div",
|
|
730
|
-
{
|
|
731
|
-
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
732
|
-
children: [
|
|
733
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
734
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
735
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
736
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
737
|
-
]
|
|
738
|
-
},
|
|
739
|
-
`bid-${index}`
|
|
740
|
-
))
|
|
741
|
-
] })
|
|
742
|
-
] })
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarketDetailsOderbookSkeleton, { className: "p-5" })
|
|
743
760
|
] }) : null
|
|
744
761
|
]
|
|
745
762
|
}
|
|
@@ -750,65 +767,46 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
|
|
|
750
767
|
// src/primitives/skeleton/views/place-order-skeleton-view.tsx
|
|
751
768
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
752
769
|
var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
|
|
770
|
+
var TabsSkeletonBar = () => {
|
|
771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full items-end border-b border-agg-border", children: [
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col rounded-t-agg-lg", children: [
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
|
|
774
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
|
|
775
|
+
] }),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col", children: [
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-[3px] w-full" })
|
|
779
|
+
] })
|
|
780
|
+
] });
|
|
781
|
+
};
|
|
753
782
|
var ContentBody = () => {
|
|
754
783
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
|
|
755
784
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
756
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex
|
|
757
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
758
|
-
|
|
759
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
] })
|
|
763
|
-
] }),
|
|
764
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-6 rounded-agg-sm" })
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
786
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "size-12 shrink-0 rounded-agg-lg" }),
|
|
787
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-[92%] max-w-[240px] rounded-agg-sm" }),
|
|
789
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-[64%] max-w-[160px] rounded-agg-sm" })
|
|
790
|
+
] })
|
|
765
791
|
] }),
|
|
766
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-[92px] rounded-agg-sm" }),
|
|
793
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TabsSkeletonBar, {})
|
|
767
794
|
] }),
|
|
768
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-11 items-end border-b border-agg-separator", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-8", children: [
|
|
769
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
770
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" }),
|
|
771
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-[3px] w-12 rounded-t-agg-sm" })
|
|
772
|
-
] }),
|
|
773
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
774
|
-
] }) }),
|
|
775
795
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
776
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-2", children: [
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full gap-2", children: [
|
|
777
797
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" }),
|
|
778
798
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" })
|
|
779
799
|
] }),
|
|
780
800
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
781
801
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
782
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-
|
|
783
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-
|
|
802
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-[63px] rounded-agg-sm" }),
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-[118px] rounded-agg-sm" })
|
|
784
804
|
] }),
|
|
785
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: cn("text-agg-3xl font-agg-bold leading-agg-9 text-agg-separator"), children: "$0" })
|
|
786
806
|
] })
|
|
787
807
|
] }),
|
|
788
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
789
|
-
|
|
790
|
-
[0, 1].map((index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
791
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
792
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
793
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-full" }),
|
|
794
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" })
|
|
795
|
-
] }),
|
|
796
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
797
|
-
] }),
|
|
798
|
-
index === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-px w-full bg-agg-trade-highlight-border" }) : null
|
|
799
|
-
] }, `place-order-route-${index}`)),
|
|
800
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "mx-auto h-5 w-40 rounded-agg-sm" })
|
|
801
|
-
] }) }),
|
|
802
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" })
|
|
803
|
-
] }),
|
|
804
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
805
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
806
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }),
|
|
807
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-24 rounded-agg-sm" })
|
|
808
|
-
] }),
|
|
809
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-36 rounded-agg-sm" })
|
|
810
|
-
] }),
|
|
811
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-[88%] self-center rounded-agg-sm" })
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }),
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[240px] self-center rounded-agg-sm" })
|
|
812
810
|
] });
|
|
813
811
|
};
|
|
814
812
|
var PlaceOrderSkeletonView = ({
|
|
@@ -822,19 +820,7 @@ var PlaceOrderSkeletonView = ({
|
|
|
822
820
|
role: "status",
|
|
823
821
|
"aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
|
|
824
822
|
"aria-busy": true,
|
|
825
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.
|
|
826
|
-
Card,
|
|
827
|
-
{
|
|
828
|
-
className: cn(
|
|
829
|
-
placeOrderCardClassName,
|
|
830
|
-
"w-full max-w-[400px] rounded-t-agg-xl rounded-b-none border-b-0"
|
|
831
|
-
),
|
|
832
|
-
children: [
|
|
833
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ContentBody, {}),
|
|
834
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "border-t border-agg-separator bg-agg-secondary p-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }) })
|
|
835
|
-
]
|
|
836
|
-
}
|
|
837
|
-
) })
|
|
823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Card, { className: cn(placeOrderCardClassName, "w-full"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ContentBody, {}) }) })
|
|
838
824
|
}
|
|
839
825
|
);
|
|
840
826
|
};
|
|
@@ -860,38 +846,27 @@ var SettlementSkeletonView = ({
|
|
|
860
846
|
"aria-label": ariaLabel != null ? ariaLabel : labels.trading.settlementLoading,
|
|
861
847
|
"aria-busy": true,
|
|
862
848
|
children: [
|
|
863
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex
|
|
864
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-
|
|
865
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
850
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[81px] rounded-agg-sm" }),
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[240px] rounded-agg-sm" })
|
|
866
852
|
] }),
|
|
867
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-
|
|
868
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
854
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
|
|
869
855
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
870
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[
|
|
871
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[
|
|
872
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[80%] rounded-agg-sm" }),
|
|
873
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[74%] rounded-agg-sm" })
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[320px] rounded-agg-sm" }),
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[280px] rounded-agg-sm" })
|
|
874
858
|
] })
|
|
875
859
|
] }),
|
|
876
860
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
877
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
878
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex
|
|
879
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
880
|
-
|
|
881
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
882
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-4 rounded-agg-sm" })
|
|
883
|
-
] }),
|
|
884
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2 pl-6", children: [
|
|
885
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-full rounded-agg-sm" }),
|
|
886
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[92%] rounded-agg-sm" }),
|
|
887
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[34%] rounded-agg-sm" })
|
|
888
|
-
] })
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" })
|
|
889
865
|
] }),
|
|
890
|
-
|
|
891
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-
|
|
892
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-
|
|
893
|
-
|
|
894
|
-
] }, `settlement-venue-${index}`))
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
869
|
+
] })
|
|
895
870
|
] })
|
|
896
871
|
]
|
|
897
872
|
}
|
|
@@ -3188,6 +3163,13 @@ var venueLogoRegistry = {
|
|
|
3188
3163
|
opinion: LogoOpinionIcon,
|
|
3189
3164
|
probable: LogoProbableIcon
|
|
3190
3165
|
};
|
|
3166
|
+
var VENUE_LOGO_BASE_URL = "https://assets.snagsolutions.io/public/prediction-markets/logos";
|
|
3167
|
+
var venueLogoUrlRegistry = {
|
|
3168
|
+
kalshi: `${VENUE_LOGO_BASE_URL}/kalshi.png`,
|
|
3169
|
+
polymarket: `${VENUE_LOGO_BASE_URL}/polymarket.png`,
|
|
3170
|
+
opinion: `${VENUE_LOGO_BASE_URL}/opinion.png`,
|
|
3171
|
+
probable: `${VENUE_LOGO_BASE_URL}/probable.png`
|
|
3172
|
+
};
|
|
3191
3173
|
var venueLogoNames = Object.keys(venueLogoRegistry);
|
|
3192
3174
|
var sizeClasses = {
|
|
3193
3175
|
small: "h-4 w-4",
|
|
@@ -3199,6 +3181,7 @@ var sizeClasses = {
|
|
|
3199
3181
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3200
3182
|
var VenueLogo = ({
|
|
3201
3183
|
venue,
|
|
3184
|
+
variant = "icon",
|
|
3202
3185
|
isColor = true,
|
|
3203
3186
|
isMonochromatic = false,
|
|
3204
3187
|
color,
|
|
@@ -3208,8 +3191,20 @@ var VenueLogo = ({
|
|
|
3208
3191
|
title
|
|
3209
3192
|
}) => {
|
|
3210
3193
|
const labels = (0, import_hooks12.useLabels)();
|
|
3211
|
-
const Component = venueLogoRegistry[venue];
|
|
3212
3194
|
const sizeClass = sizeClasses[size];
|
|
3195
|
+
const resolvedLabel = ariaLabel != null ? ariaLabel : labels.venues[venue];
|
|
3196
|
+
if (variant === "logo") {
|
|
3197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3198
|
+
"img",
|
|
3199
|
+
{
|
|
3200
|
+
src: venueLogoUrlRegistry[venue],
|
|
3201
|
+
alt: resolvedLabel,
|
|
3202
|
+
title,
|
|
3203
|
+
className: cn("shrink-0 rounded-agg-lg object-cover", sizeClass, className)
|
|
3204
|
+
}
|
|
3205
|
+
);
|
|
3206
|
+
}
|
|
3207
|
+
const Component = venueLogoRegistry[venue];
|
|
3213
3208
|
const resolvedIsColor = isMonochromatic ? false : isColor;
|
|
3214
3209
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3215
3210
|
Component,
|
|
@@ -3217,86 +3212,13 @@ var VenueLogo = ({
|
|
|
3217
3212
|
className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
|
|
3218
3213
|
isColor: resolvedIsColor,
|
|
3219
3214
|
color,
|
|
3220
|
-
"aria-label":
|
|
3215
|
+
"aria-label": resolvedLabel,
|
|
3221
3216
|
title
|
|
3222
3217
|
}
|
|
3223
3218
|
);
|
|
3224
3219
|
};
|
|
3225
3220
|
VenueLogo.displayName = "VenueLogo";
|
|
3226
3221
|
|
|
3227
|
-
// src/primitives/loading-icon/index.tsx
|
|
3228
|
-
var import_hooks13 = require("@agg-market/hooks");
|
|
3229
|
-
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3230
|
-
var LoadingIcon = ({
|
|
3231
|
-
size = "medium",
|
|
3232
|
-
className,
|
|
3233
|
-
ariaLabel
|
|
3234
|
-
}) => {
|
|
3235
|
-
const labels = (0, import_hooks13.useLabels)();
|
|
3236
|
-
const { enableAnimations } = (0, import_hooks13.useSdkUiConfig)();
|
|
3237
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3238
|
-
"span",
|
|
3239
|
-
{
|
|
3240
|
-
role: "status",
|
|
3241
|
-
"aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
|
|
3242
|
-
className: cn(
|
|
3243
|
-
"group/agg-loading-icon",
|
|
3244
|
-
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
3245
|
-
className
|
|
3246
|
-
),
|
|
3247
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { viewBox: "0 0 44 44", className: cn("block", iconSizeClasses[size]), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("g", { children: [
|
|
3248
|
-
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3249
|
-
"animateTransform",
|
|
3250
|
-
{
|
|
3251
|
-
attributeName: "transform",
|
|
3252
|
-
attributeType: "XML",
|
|
3253
|
-
type: "rotate",
|
|
3254
|
-
from: "0 22 22",
|
|
3255
|
-
to: "360 22 22",
|
|
3256
|
-
dur: "1.4s",
|
|
3257
|
-
repeatCount: "indefinite"
|
|
3258
|
-
}
|
|
3259
|
-
) : null,
|
|
3260
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3261
|
-
"circle",
|
|
3262
|
-
{
|
|
3263
|
-
cx: "22",
|
|
3264
|
-
cy: "22",
|
|
3265
|
-
r: "16",
|
|
3266
|
-
fill: "none",
|
|
3267
|
-
stroke: "currentColor",
|
|
3268
|
-
strokeWidth: "6",
|
|
3269
|
-
strokeLinecap: "round",
|
|
3270
|
-
strokeDasharray: "60 100",
|
|
3271
|
-
strokeDashoffset: "0",
|
|
3272
|
-
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
3273
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3274
|
-
"animate",
|
|
3275
|
-
{
|
|
3276
|
-
attributeName: "stroke-dasharray",
|
|
3277
|
-
values: "1 100;60 100;1 100",
|
|
3278
|
-
dur: "1.2s",
|
|
3279
|
-
repeatCount: "indefinite"
|
|
3280
|
-
}
|
|
3281
|
-
),
|
|
3282
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3283
|
-
"animate",
|
|
3284
|
-
{
|
|
3285
|
-
attributeName: "stroke-dashoffset",
|
|
3286
|
-
values: "0;-25;-100",
|
|
3287
|
-
dur: "1.2s",
|
|
3288
|
-
repeatCount: "indefinite"
|
|
3289
|
-
}
|
|
3290
|
-
)
|
|
3291
|
-
] }) : null
|
|
3292
|
-
}
|
|
3293
|
-
)
|
|
3294
|
-
] }) }) })
|
|
3295
|
-
}
|
|
3296
|
-
);
|
|
3297
|
-
};
|
|
3298
|
-
LoadingIcon.displayName = "LoadingIcon";
|
|
3299
|
-
|
|
3300
3222
|
// src/events/market-details/market-details.utils.ts
|
|
3301
3223
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
3302
3224
|
var import_zod = require("zod");
|
|
@@ -3362,15 +3284,14 @@ var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
|
3362
3284
|
return event.title;
|
|
3363
3285
|
};
|
|
3364
3286
|
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
3365
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3366
3287
|
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
3367
3288
|
return imageOverride;
|
|
3368
3289
|
}
|
|
3369
3290
|
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
3370
3291
|
return primaryVenueMarket.image;
|
|
3371
3292
|
}
|
|
3372
|
-
if (typeof
|
|
3373
|
-
return
|
|
3293
|
+
if (typeof event.image === "string" && event.image.trim()) {
|
|
3294
|
+
return event.image;
|
|
3374
3295
|
}
|
|
3375
3296
|
return void 0;
|
|
3376
3297
|
};
|
|
@@ -3463,18 +3384,22 @@ var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
|
|
|
3463
3384
|
};
|
|
3464
3385
|
}).filter((item) => item != null);
|
|
3465
3386
|
};
|
|
3466
|
-
var buildPriceHistoryGroups = (selectedOutcomes) => {
|
|
3467
|
-
const
|
|
3468
|
-
selectedOutcomes.forEach(({ venue,
|
|
3469
|
-
var _a;
|
|
3470
|
-
|
|
3471
|
-
|
|
3387
|
+
var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
|
|
3388
|
+
const marketIdByVenue = /* @__PURE__ */ new Map();
|
|
3389
|
+
selectedOutcomes.forEach(({ venue, market }) => {
|
|
3390
|
+
var _a, _b;
|
|
3391
|
+
const marketWithCanonicalId = market;
|
|
3392
|
+
const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
|
|
3393
|
+
if (!canonicalMarketId)
|
|
3394
|
+
return;
|
|
3395
|
+
if (!marketIdByVenue.has(venue)) {
|
|
3396
|
+
marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
|
|
3472
3397
|
}
|
|
3473
|
-
(
|
|
3398
|
+
(_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
|
|
3474
3399
|
});
|
|
3475
|
-
return [...
|
|
3400
|
+
return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
|
|
3476
3401
|
venue,
|
|
3477
|
-
venueMarketOutcomeIds
|
|
3402
|
+
venueMarketOutcomeIds: [...marketIds]
|
|
3478
3403
|
})).filter((group) => group.venueMarketOutcomeIds.length > 0);
|
|
3479
3404
|
};
|
|
3480
3405
|
var resolveSeriesColor = (venue, index) => {
|
|
@@ -3607,8 +3532,7 @@ var resolveSubtitle = ({
|
|
|
3607
3532
|
};
|
|
3608
3533
|
var resolveOrderBookRows = ({
|
|
3609
3534
|
data,
|
|
3610
|
-
side
|
|
3611
|
-
depth
|
|
3535
|
+
side
|
|
3612
3536
|
}) => {
|
|
3613
3537
|
if (!(data == null ? void 0 : data.length))
|
|
3614
3538
|
return [];
|
|
@@ -3639,9 +3563,8 @@ var resolveOrderBookRows = ({
|
|
|
3639
3563
|
return left.price - right.price;
|
|
3640
3564
|
return right.price - left.price;
|
|
3641
3565
|
});
|
|
3642
|
-
const
|
|
3643
|
-
|
|
3644
|
-
return limitedRows.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
3566
|
+
const maxTotal = sortedRows.reduce((currentMax, row) => Math.max(currentMax, row.total), 0) || 1;
|
|
3567
|
+
return sortedRows.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
3645
3568
|
barScale: row.total / maxTotal
|
|
3646
3569
|
}));
|
|
3647
3570
|
};
|
|
@@ -3716,14 +3639,14 @@ var buildMarketDetailsModel = ({
|
|
|
3716
3639
|
};
|
|
3717
3640
|
|
|
3718
3641
|
// src/events/market-details/index.tsx
|
|
3719
|
-
var
|
|
3642
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3720
3643
|
var MarketDetailsLoadingState = ({
|
|
3721
3644
|
isOpened = marketDetailsDefaultIsOpened,
|
|
3722
3645
|
ariaLabel,
|
|
3723
3646
|
classNames
|
|
3724
3647
|
}) => {
|
|
3725
|
-
const labels = (0,
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3648
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
3649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3727
3650
|
Skeleton,
|
|
3728
3651
|
{
|
|
3729
3652
|
view: isOpened ? "market-details-detailed" : "market-details-minified",
|
|
@@ -3736,16 +3659,16 @@ var MarketDetailsUnavailableState = ({
|
|
|
3736
3659
|
ariaLabel,
|
|
3737
3660
|
classNames
|
|
3738
3661
|
}) => {
|
|
3739
|
-
const labels = (0,
|
|
3740
|
-
return /* @__PURE__ */ (0,
|
|
3662
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
3663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3741
3664
|
Card,
|
|
3742
3665
|
{
|
|
3743
3666
|
className: cn(marketDetailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
3744
3667
|
role: "status",
|
|
3745
3668
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
3746
|
-
children: /* @__PURE__ */ (0,
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3748
|
-
/* @__PURE__ */ (0,
|
|
3669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
|
|
3749
3672
|
] })
|
|
3750
3673
|
}
|
|
3751
3674
|
);
|
|
@@ -3754,44 +3677,59 @@ var OrderBookRows = ({
|
|
|
3754
3677
|
rows,
|
|
3755
3678
|
title,
|
|
3756
3679
|
formatNumber,
|
|
3757
|
-
formatCurrency
|
|
3680
|
+
formatCurrency,
|
|
3681
|
+
visibleRows
|
|
3758
3682
|
}) => {
|
|
3759
|
-
const labels = (0,
|
|
3683
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
3760
3684
|
const isAsks = title === labels.marketDetails.asks;
|
|
3761
3685
|
const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
|
|
3762
3686
|
const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
)
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3687
|
+
const maxVisibleRows = Math.max(1, visibleRows);
|
|
3688
|
+
const orderBookRowHeightPx = 28;
|
|
3689
|
+
const orderBookDividerHeightPx = 1;
|
|
3690
|
+
const orderBookRowGapPx = 8;
|
|
3691
|
+
const orderBookVisibleHeightPx = maxVisibleRows * orderBookRowHeightPx + Math.max(0, maxVisibleRows - 1) * (orderBookDividerHeightPx + orderBookRowGapPx);
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3693
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "caption-caps", children: title }),
|
|
3694
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3695
|
+
"div",
|
|
3696
|
+
{
|
|
3697
|
+
className: "overflow-y-auto pr-1 flex flex-col gap-2",
|
|
3698
|
+
style: { maxHeight: `${orderBookVisibleHeightPx}px` },
|
|
3699
|
+
role: "region",
|
|
3700
|
+
"aria-label": `${title} order book levels`,
|
|
3701
|
+
children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3702
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VenueLogo, { venue: row.venue, size: "small" }),
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3706
|
+
"span",
|
|
3707
|
+
{
|
|
3708
|
+
className: cn(
|
|
3709
|
+
"text-agg-xs font-agg-bold leading-agg-4 md:text-agg-sm md:leading-agg-5",
|
|
3710
|
+
priceClassName
|
|
3711
|
+
),
|
|
3712
|
+
children: formatProbabilityCents(row.price)
|
|
3713
|
+
}
|
|
3714
|
+
)
|
|
3715
|
+
] }),
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatNumber(row.size) }),
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatCurrency(row.total) }),
|
|
3718
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3719
|
+
"div",
|
|
3720
|
+
{
|
|
3721
|
+
"aria-hidden": "true",
|
|
3722
|
+
className: cn("h-2 rounded-agg-full", barClassName),
|
|
3723
|
+
style: {
|
|
3724
|
+
width: `${Math.max(20, Math.round(row.barScale * 100))}%`
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
) })
|
|
3728
|
+
] }),
|
|
3729
|
+
index < rows.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
|
|
3730
|
+
] }, row.id))
|
|
3731
|
+
}
|
|
3732
|
+
)
|
|
3795
3733
|
] });
|
|
3796
3734
|
};
|
|
3797
3735
|
var getOutcomeButtonClassName = ({
|
|
@@ -3825,8 +3763,8 @@ var MarketDetailsContent = ({
|
|
|
3825
3763
|
classNames,
|
|
3826
3764
|
otherContent
|
|
3827
3765
|
}) => {
|
|
3828
|
-
const config = (0,
|
|
3829
|
-
const labels = (0,
|
|
3766
|
+
const config = (0, import_hooks13.useSdkUiConfig)();
|
|
3767
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
3830
3768
|
const detailsContentId = (0, import_react5.useId)();
|
|
3831
3769
|
const model = (0, import_react5.useMemo)(() => {
|
|
3832
3770
|
return buildMarketDetailsModel({
|
|
@@ -3909,10 +3847,11 @@ var MarketDetailsContent = ({
|
|
|
3909
3847
|
});
|
|
3910
3848
|
return [...uniqueOutcomesByVenueAndId.values()];
|
|
3911
3849
|
}, [outcomesByLabel]);
|
|
3850
|
+
const canonicalMarketIdForHistory = model == null ? void 0 : model.market.id;
|
|
3912
3851
|
const priceHistoryGroups = (0, import_react5.useMemo)(() => {
|
|
3913
|
-
return buildPriceHistoryGroups(graphOutcomes);
|
|
3914
|
-
}, [graphOutcomes]);
|
|
3915
|
-
const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0,
|
|
3852
|
+
return buildPriceHistoryGroups(graphOutcomes, canonicalMarketIdForHistory);
|
|
3853
|
+
}, [canonicalMarketIdForHistory, graphOutcomes]);
|
|
3854
|
+
const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks13.usePriceHistory)(__spreadProps(__spreadValues({
|
|
3916
3855
|
groups: priceHistoryGroups
|
|
3917
3856
|
}, timeWindow), {
|
|
3918
3857
|
enabled: isOpened && selectedTab === "graph" && priceHistoryGroups.length > 0
|
|
@@ -3924,24 +3863,22 @@ var MarketDetailsContent = ({
|
|
|
3924
3863
|
liveUpdate: true
|
|
3925
3864
|
}));
|
|
3926
3865
|
}, [selectedOutcomesByVenue]);
|
|
3927
|
-
const { data: orderBookData, isLoading: isOrderBookLoading } = (0,
|
|
3866
|
+
const { data: orderBookData, isLoading: isOrderBookLoading } = (0, import_hooks13.useOrderBook)({
|
|
3928
3867
|
orderbooks: orderBookInputs,
|
|
3929
3868
|
enabled: isOpened && selectedTab === "order-book" && orderBookInputs.length > 0
|
|
3930
3869
|
});
|
|
3931
3870
|
const askRows = (0, import_react5.useMemo)(() => {
|
|
3932
3871
|
return resolveOrderBookRows({
|
|
3933
3872
|
data: orderBookData,
|
|
3934
|
-
side: "asks"
|
|
3935
|
-
depth: orderBookDepth
|
|
3873
|
+
side: "asks"
|
|
3936
3874
|
});
|
|
3937
|
-
}, [orderBookData
|
|
3875
|
+
}, [orderBookData]);
|
|
3938
3876
|
const bidRows = (0, import_react5.useMemo)(() => {
|
|
3939
3877
|
return resolveOrderBookRows({
|
|
3940
3878
|
data: orderBookData,
|
|
3941
|
-
side: "bids"
|
|
3942
|
-
depth: orderBookDepth
|
|
3879
|
+
side: "bids"
|
|
3943
3880
|
});
|
|
3944
|
-
}, [orderBookData
|
|
3881
|
+
}, [orderBookData]);
|
|
3945
3882
|
const priceHistoryByVenue = (0, import_react5.useMemo)(() => {
|
|
3946
3883
|
const historyByVenue = /* @__PURE__ */ new Map();
|
|
3947
3884
|
if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
|
|
@@ -3961,11 +3898,14 @@ var MarketDetailsContent = ({
|
|
|
3961
3898
|
const graphSeriesByOutcomeLabel = (0, import_react5.useMemo)(() => {
|
|
3962
3899
|
const seriesByOutcomeLabel = /* @__PURE__ */ new Map();
|
|
3963
3900
|
const resolveOutcomeCandidateIds = (outcomeByVenue) => {
|
|
3964
|
-
var _a;
|
|
3901
|
+
var _a, _b;
|
|
3902
|
+
const marketWithCanonicalId = outcomeByVenue.market;
|
|
3965
3903
|
return [
|
|
3966
3904
|
outcomeByVenue.outcome.id,
|
|
3967
3905
|
(_a = outcomeByVenue.outcome.externalIdentifier) != null ? _a : void 0,
|
|
3968
|
-
outcomeByVenue.market.externalIdentifier
|
|
3906
|
+
outcomeByVenue.market.externalIdentifier,
|
|
3907
|
+
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0,
|
|
3908
|
+
canonicalMarketIdForHistory
|
|
3969
3909
|
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
3970
3910
|
};
|
|
3971
3911
|
headerOutcomeItems.forEach((headerOutcomeItem) => {
|
|
@@ -3997,7 +3937,7 @@ var MarketDetailsContent = ({
|
|
|
3997
3937
|
seriesByOutcomeLabel.set(headerOutcomeItem.label, graphSeries2);
|
|
3998
3938
|
});
|
|
3999
3939
|
return seriesByOutcomeLabel;
|
|
4000
|
-
}, [headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
|
|
3940
|
+
}, [canonicalMarketIdForHistory, headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
|
|
4001
3941
|
const graphSeries = (0, import_react5.useMemo)(() => {
|
|
4002
3942
|
var _a;
|
|
4003
3943
|
if (!selectedOutcomeLabel)
|
|
@@ -4055,35 +3995,36 @@ var MarketDetailsContent = ({
|
|
|
4055
3995
|
setSelectedGraphVenue(null);
|
|
4056
3996
|
}, [selectedGraphVenue, selectedOutcomesByVenue]);
|
|
4057
3997
|
if (!model) {
|
|
4058
|
-
return /* @__PURE__ */ (0,
|
|
3998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MarketDetailsUnavailableState, { ariaLabel, classNames });
|
|
4059
3999
|
}
|
|
4060
|
-
return /* @__PURE__ */ (0,
|
|
4000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4061
4001
|
Card,
|
|
4062
4002
|
{
|
|
4063
4003
|
className: cn(
|
|
4064
|
-
"w-full
|
|
4004
|
+
"w-full rounded-agg-2xl text-left outline-none",
|
|
4065
4005
|
marketDetailsBaseCardClassName,
|
|
4066
4006
|
classNames == null ? void 0 : classNames.root
|
|
4067
4007
|
),
|
|
4068
|
-
"aria-expanded": isOpened,
|
|
4069
|
-
"aria-controls": detailsContentId,
|
|
4070
|
-
role: "button",
|
|
4071
|
-
tabIndex: 0,
|
|
4072
|
-
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
4073
|
-
onClick: handleToggleExpanded,
|
|
4074
|
-
onKeyDown: handleToggleExpanded,
|
|
4075
4008
|
children: [
|
|
4076
|
-
/* @__PURE__ */ (0,
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4077
4010
|
"div",
|
|
4078
4011
|
{
|
|
4079
4012
|
className: cn(
|
|
4080
|
-
"
|
|
4013
|
+
"cursor-pointer disabled:cursor-default",
|
|
4014
|
+
"flex flex-wrap flex-row items-center justify-between gap-3 px-5 py-4",
|
|
4081
4015
|
isOpened && "pb-3",
|
|
4082
4016
|
classNames == null ? void 0 : classNames.header
|
|
4083
4017
|
),
|
|
4018
|
+
"aria-expanded": isOpened,
|
|
4019
|
+
"aria-controls": detailsContentId,
|
|
4020
|
+
role: "button",
|
|
4021
|
+
tabIndex: 0,
|
|
4022
|
+
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
4023
|
+
onClick: handleToggleExpanded,
|
|
4024
|
+
onKeyDown: handleToggleExpanded,
|
|
4084
4025
|
children: [
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
model.image ? /* @__PURE__ */ (0,
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-w-52 items-center gap-3 md:gap-4", children: [
|
|
4027
|
+
model.image ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4087
4028
|
"img",
|
|
4088
4029
|
{
|
|
4089
4030
|
src: model.image,
|
|
@@ -4091,13 +4032,13 @@ var MarketDetailsContent = ({
|
|
|
4091
4032
|
className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
4092
4033
|
}
|
|
4093
4034
|
) : null,
|
|
4094
|
-
/* @__PURE__ */ (0,
|
|
4095
|
-
/* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4035
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
|
|
4036
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { as: "h3", variant: "body-large-strong", className: "truncate", children: model.title }),
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "label", className: "truncate text-agg-muted-foreground", children: model.subtitle }) })
|
|
4097
4038
|
] })
|
|
4098
4039
|
] }),
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4100
|
-
/* @__PURE__ */ (0,
|
|
4040
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { as: "div", variant: "heading", className: "shrink-0", children: formatProbabilityPercent(headlineProbability) }),
|
|
4041
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4101
4042
|
"div",
|
|
4102
4043
|
{
|
|
4103
4044
|
className: "flex gap-2",
|
|
@@ -4108,7 +4049,7 @@ var MarketDetailsContent = ({
|
|
|
4108
4049
|
children: headerOutcomeItems.map((item) => {
|
|
4109
4050
|
const isPositive = item.tone === "positive";
|
|
4110
4051
|
const isActiveOutcome = item.label === selectedOutcomeLabel;
|
|
4111
|
-
return /* @__PURE__ */ (0,
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4112
4053
|
"button",
|
|
4113
4054
|
{
|
|
4114
4055
|
type: "button",
|
|
@@ -4125,8 +4066,8 @@ var MarketDetailsContent = ({
|
|
|
4125
4066
|
e.stopPropagation();
|
|
4126
4067
|
setSelectedOutcomeLabel(item.label);
|
|
4127
4068
|
},
|
|
4128
|
-
children: /* @__PURE__ */ (0,
|
|
4129
|
-
/* @__PURE__ */ (0,
|
|
4069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4130
4071
|
VenueLogo,
|
|
4131
4072
|
{
|
|
4132
4073
|
venue: isPositive ? "polymarket" : "probable",
|
|
@@ -4134,7 +4075,7 @@ var MarketDetailsContent = ({
|
|
|
4134
4075
|
color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
|
|
4135
4076
|
}
|
|
4136
4077
|
),
|
|
4137
|
-
/* @__PURE__ */ (0,
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4138
4079
|
Typography,
|
|
4139
4080
|
{
|
|
4140
4081
|
variant: isActiveOutcome ? "body-strong" : "body",
|
|
@@ -4155,28 +4096,25 @@ var MarketDetailsContent = ({
|
|
|
4155
4096
|
]
|
|
4156
4097
|
}
|
|
4157
4098
|
),
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4159
4100
|
"div",
|
|
4160
4101
|
{
|
|
4161
4102
|
id: detailsContentId,
|
|
4162
4103
|
className: cn(
|
|
4163
4104
|
"grid overflow-hidden",
|
|
4164
|
-
getMotionClassName(
|
|
4165
|
-
config.enableAnimations,
|
|
4166
|
-
"transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"
|
|
4167
|
-
),
|
|
4105
|
+
getMotionClassName(config.enableAnimations, "transition-all duration-500 ease-in-out"),
|
|
4168
4106
|
isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
|
|
4169
4107
|
),
|
|
4170
4108
|
"aria-hidden": !isOpened,
|
|
4171
|
-
children: /* @__PURE__ */ (0,
|
|
4172
|
-
/* @__PURE__ */ (0,
|
|
4173
|
-
/* @__PURE__ */ (0,
|
|
4109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "min-h-0", children: [
|
|
4110
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4174
4112
|
"div",
|
|
4175
4113
|
{
|
|
4176
4114
|
className: cn(
|
|
4177
4115
|
getMotionClassName(
|
|
4178
4116
|
config.enableAnimations,
|
|
4179
|
-
"transition-all duration-500 ease-
|
|
4117
|
+
"transition-all duration-500 ease-in-out"
|
|
4180
4118
|
),
|
|
4181
4119
|
isOpened ? cn(
|
|
4182
4120
|
"translate-y-0 opacity-100",
|
|
@@ -4184,7 +4122,7 @@ var MarketDetailsContent = ({
|
|
|
4184
4122
|
) : "translate-y-5 opacity-0"
|
|
4185
4123
|
),
|
|
4186
4124
|
children: [
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4188
4126
|
Tabs,
|
|
4189
4127
|
{
|
|
4190
4128
|
ariaLabel: labels.marketDetails.tabsAria,
|
|
@@ -4195,42 +4133,32 @@ var MarketDetailsContent = ({
|
|
|
4195
4133
|
className: "w-full px-5"
|
|
4196
4134
|
}
|
|
4197
4135
|
) }),
|
|
4198
|
-
/* @__PURE__ */ (0,
|
|
4199
|
-
/* @__PURE__ */ (0,
|
|
4200
|
-
selectedTab === "order-book" ? /* @__PURE__ */ (0,
|
|
4201
|
-
|
|
4202
|
-
{
|
|
4203
|
-
className: "flex flex-col gap-2 min-h-40 items-center justify-center",
|
|
4204
|
-
role: "status",
|
|
4205
|
-
"aria-label": labels.marketDetails.loadingOrderbookAria,
|
|
4206
|
-
"aria-busy": true,
|
|
4207
|
-
children: [
|
|
4208
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LoadingIcon, {}),
|
|
4209
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.loadingOrderbookLabel })
|
|
4210
|
-
]
|
|
4211
|
-
}
|
|
4212
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
4213
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cn("p-5", classNames == null ? void 0 : classNames.content), children: [
|
|
4138
|
+
selectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.orderBook), children: isOrderBookLoading ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MarketDetailsOderbookSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
4139
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4214
4140
|
OrderBookRows,
|
|
4215
4141
|
{
|
|
4216
4142
|
rows: askRows,
|
|
4217
4143
|
title: labels.marketDetails.asks,
|
|
4218
4144
|
formatNumber: config.formatNumber,
|
|
4219
|
-
formatCurrency: config.formatCurrency
|
|
4145
|
+
formatCurrency: config.formatCurrency,
|
|
4146
|
+
visibleRows: orderBookDepth
|
|
4220
4147
|
}
|
|
4221
4148
|
),
|
|
4222
|
-
/* @__PURE__ */ (0,
|
|
4149
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4223
4150
|
OrderBookRows,
|
|
4224
4151
|
{
|
|
4225
4152
|
rows: bidRows,
|
|
4226
4153
|
title: labels.marketDetails.bids,
|
|
4227
4154
|
formatNumber: config.formatNumber,
|
|
4228
|
-
formatCurrency: config.formatCurrency
|
|
4155
|
+
formatCurrency: config.formatCurrency,
|
|
4156
|
+
visibleRows: orderBookDepth
|
|
4229
4157
|
}
|
|
4230
4158
|
)
|
|
4231
4159
|
] }) }) : null,
|
|
4232
|
-
selectedTab === "graph" ? /* @__PURE__ */ (0,
|
|
4233
|
-
/* @__PURE__ */ (0,
|
|
4160
|
+
selectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.graph), children: [
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4234
4162
|
LineChart,
|
|
4235
4163
|
{
|
|
4236
4164
|
series: graphSeries,
|
|
@@ -4239,11 +4167,11 @@ var MarketDetailsContent = ({
|
|
|
4239
4167
|
classNames: { root: "w-full" },
|
|
4240
4168
|
showSeriesControls: selectedOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
4241
4169
|
renderSeriesControls: () => {
|
|
4242
|
-
return /* @__PURE__ */ (0,
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex flex-wrap gap-2", children: selectedOutcomesByVenue.map((item) => {
|
|
4244
4172
|
const probability = formatProbabilityPercent(item.outcome.price);
|
|
4245
4173
|
const isActiveVenue = selectedGraphVenue === item.venue;
|
|
4246
|
-
return /* @__PURE__ */ (0,
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4247
4175
|
"button",
|
|
4248
4176
|
{
|
|
4249
4177
|
type: "button",
|
|
@@ -4260,14 +4188,14 @@ var MarketDetailsContent = ({
|
|
|
4260
4188
|
handleGraphVenueToggle(item.venue);
|
|
4261
4189
|
},
|
|
4262
4190
|
children: [
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
|
|
4265
4193
|
]
|
|
4266
4194
|
},
|
|
4267
4195
|
`${item.market.id}-${item.outcome.id}`
|
|
4268
4196
|
);
|
|
4269
4197
|
}) }),
|
|
4270
|
-
/* @__PURE__ */ (0,
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4271
4199
|
SwitchButton,
|
|
4272
4200
|
{
|
|
4273
4201
|
ariaLabel: labels.marketDetails.outcomeSelectorAria,
|
|
@@ -4285,7 +4213,7 @@ var MarketDetailsContent = ({
|
|
|
4285
4213
|
}
|
|
4286
4214
|
}
|
|
4287
4215
|
),
|
|
4288
|
-
/* @__PURE__ */ (0,
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4289
4217
|
"div",
|
|
4290
4218
|
{
|
|
4291
4219
|
className: cn(
|
|
@@ -4293,10 +4221,10 @@ var MarketDetailsContent = ({
|
|
|
4293
4221
|
classNames == null ? void 0 : classNames.footer
|
|
4294
4222
|
),
|
|
4295
4223
|
children: [
|
|
4296
|
-
/* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: typeof model.market.volume === "number" ? `${config.formatCompactCurrency(model.market.volume)} ${labels.marketDetails.meta.volumeSuffix}` : labels.marketDetails.volumeUnavailable }),
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: eventListItemDetailsTimeRanges.map((timeRange) => {
|
|
4298
4226
|
const isActive = selectedTimeRange === timeRange;
|
|
4299
|
-
return /* @__PURE__ */ (0,
|
|
4227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4300
4228
|
"button",
|
|
4301
4229
|
{
|
|
4302
4230
|
type: "button",
|
|
@@ -4319,13 +4247,13 @@ var MarketDetailsContent = ({
|
|
|
4319
4247
|
}
|
|
4320
4248
|
)
|
|
4321
4249
|
] }) : null,
|
|
4322
|
-
selectedTab === "other" ? /* @__PURE__ */ (0,
|
|
4250
|
+
selectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
4323
4251
|
"div",
|
|
4324
4252
|
{
|
|
4325
4253
|
className: "flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
|
|
4326
4254
|
children: [
|
|
4327
|
-
/* @__PURE__ */ (0,
|
|
4328
|
-
/* @__PURE__ */ (0,
|
|
4255
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
|
|
4256
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
|
|
4329
4257
|
]
|
|
4330
4258
|
},
|
|
4331
4259
|
row.label
|
|
@@ -4360,14 +4288,14 @@ var MarketDetails = (props) => {
|
|
|
4360
4288
|
(_a2 = props.onOpenChange) == null ? void 0 : _a2.call(props, nextIsOpened);
|
|
4361
4289
|
};
|
|
4362
4290
|
const hasEventProp = "event" in props && !!props.event;
|
|
4363
|
-
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0,
|
|
4291
|
+
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks13.useEvent)(
|
|
4364
4292
|
hasEventProp ? void 0 : props.eventId,
|
|
4365
4293
|
{
|
|
4366
4294
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
4367
4295
|
}
|
|
4368
4296
|
);
|
|
4369
4297
|
if (props.isLoading) {
|
|
4370
|
-
return /* @__PURE__ */ (0,
|
|
4298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4371
4299
|
MarketDetailsLoadingState,
|
|
4372
4300
|
{
|
|
4373
4301
|
isOpened: resolvedIsOpened,
|
|
@@ -4377,7 +4305,7 @@ var MarketDetails = (props) => {
|
|
|
4377
4305
|
);
|
|
4378
4306
|
}
|
|
4379
4307
|
if ("event" in props && props.event) {
|
|
4380
|
-
return /* @__PURE__ */ (0,
|
|
4308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4381
4309
|
MarketDetailsContent,
|
|
4382
4310
|
__spreadProps(__spreadValues({}, props), {
|
|
4383
4311
|
isOpened: resolvedIsOpened,
|
|
@@ -4387,7 +4315,7 @@ var MarketDetails = (props) => {
|
|
|
4387
4315
|
);
|
|
4388
4316
|
}
|
|
4389
4317
|
if (isFetchingEvent) {
|
|
4390
|
-
return /* @__PURE__ */ (0,
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4391
4319
|
MarketDetailsLoadingState,
|
|
4392
4320
|
{
|
|
4393
4321
|
isOpened: resolvedIsOpened,
|
|
@@ -4397,9 +4325,9 @@ var MarketDetails = (props) => {
|
|
|
4397
4325
|
);
|
|
4398
4326
|
}
|
|
4399
4327
|
if (!fetchedEvent) {
|
|
4400
|
-
return /* @__PURE__ */ (0,
|
|
4328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MarketDetailsUnavailableState, { ariaLabel: props.ariaLabel, classNames: props.classNames });
|
|
4401
4329
|
}
|
|
4402
|
-
return /* @__PURE__ */ (0,
|
|
4330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4403
4331
|
MarketDetailsContent,
|
|
4404
4332
|
__spreadProps(__spreadValues({}, props), {
|
|
4405
4333
|
isOpened: resolvedIsOpened,
|