@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
|
@@ -63,7 +63,7 @@ __export(event_market_exports, {
|
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(event_market_exports);
|
|
65
65
|
var import_react9 = require("react");
|
|
66
|
-
var
|
|
66
|
+
var import_hooks20 = require("@agg-market/hooks");
|
|
67
67
|
var import_dayjs5 = __toESM(require("dayjs"));
|
|
68
68
|
|
|
69
69
|
// src/events/item-details/index.tsx
|
|
@@ -328,10 +328,10 @@ var SwitchButton = ({
|
|
|
328
328
|
return null;
|
|
329
329
|
}
|
|
330
330
|
const handleKeyDown = (event, optionIndex) => {
|
|
331
|
-
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
|
|
331
|
+
if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
event.preventDefault();
|
|
334
|
+
event == null ? void 0 : event.preventDefault();
|
|
335
335
|
const nextOptionIndex = resolveNextEnabledIndex(
|
|
336
336
|
options,
|
|
337
337
|
optionIndex,
|
|
@@ -448,8 +448,18 @@ var normalizeSeries = (series) => {
|
|
|
448
448
|
var defaultValueFormatter = (value) => {
|
|
449
449
|
return `${Math.round(value)}%`;
|
|
450
450
|
};
|
|
451
|
-
var
|
|
452
|
-
return
|
|
451
|
+
var resolveTimeFormatter = (windowSeconds) => {
|
|
452
|
+
return (timestamp) => {
|
|
453
|
+
if (!Number.isFinite(timestamp))
|
|
454
|
+
return "";
|
|
455
|
+
if (windowSeconds <= 48 * 60 * 60) {
|
|
456
|
+
return import_dayjs.default.unix(timestamp).format("HH:mm");
|
|
457
|
+
}
|
|
458
|
+
if (windowSeconds <= 14 * 24 * 60 * 60) {
|
|
459
|
+
return import_dayjs.default.unix(timestamp).format("MMM D HH:mm");
|
|
460
|
+
}
|
|
461
|
+
return import_dayjs.default.unix(timestamp).format("MMM D");
|
|
462
|
+
};
|
|
453
463
|
};
|
|
454
464
|
var toLivelinePoints = (points) => {
|
|
455
465
|
return points.map((point) => ({
|
|
@@ -572,6 +582,9 @@ var LineChart = ({
|
|
|
572
582
|
const windowSeconds = (0, import_react2.useMemo)(() => {
|
|
573
583
|
return resolveWindowSeconds(normalizedSeries);
|
|
574
584
|
}, [normalizedSeries]);
|
|
585
|
+
const timeFormatter = (0, import_react2.useMemo)(() => {
|
|
586
|
+
return resolveTimeFormatter(windowSeconds);
|
|
587
|
+
}, [windowSeconds]);
|
|
575
588
|
const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
|
|
576
589
|
series: normalizedSeries,
|
|
577
590
|
activeSeriesId,
|
|
@@ -610,7 +623,7 @@ var LineChart = ({
|
|
|
610
623
|
pulse: false,
|
|
611
624
|
window: windowSeconds,
|
|
612
625
|
formatValue: defaultValueFormatter,
|
|
613
|
-
formatTime:
|
|
626
|
+
formatTime: timeFormatter,
|
|
614
627
|
padding: {
|
|
615
628
|
top: 12,
|
|
616
629
|
right: 80,
|
|
@@ -687,6 +700,7 @@ var EventListItemSkeletonView = ({
|
|
|
687
700
|
isStandalone = false
|
|
688
701
|
}) => {
|
|
689
702
|
const labels = (0, import_hooks7.useLabels)();
|
|
703
|
+
const outcomeTitleWidths = ["w-40", "w-[200px]"];
|
|
690
704
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
691
705
|
Card,
|
|
692
706
|
{
|
|
@@ -696,35 +710,23 @@ var EventListItemSkeletonView = ({
|
|
|
696
710
|
"aria-busy": isStandalone || void 0,
|
|
697
711
|
"aria-hidden": isStandalone ? void 0 : true,
|
|
698
712
|
children: [
|
|
699
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full items-
|
|
700
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "
|
|
701
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
702
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm" }),
|
|
703
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[68%] rounded-agg-sm" })
|
|
704
|
-
] })
|
|
713
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
|
|
715
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
|
|
705
716
|
] }),
|
|
706
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-col gap-3", children:
|
|
707
|
-
"
|
|
708
|
-
{
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[101px] rounded-agg-full" })
|
|
714
|
-
]
|
|
715
|
-
},
|
|
716
|
-
index
|
|
717
|
-
)) }),
|
|
718
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between gap-2 text-agg-muted-foreground", children: [
|
|
719
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
720
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" }),
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex flex-col gap-3", children: outcomeTitleWidths.map((outcomeTitleWidth, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex w-full items-center justify-between gap-3", children: [
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: cn("h-5 rounded-agg-sm", outcomeTitleWidth) }),
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
|
|
720
|
+
] }, index)) }),
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between gap-5 text-agg-muted-foreground", children: [
|
|
722
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" }),
|
|
721
724
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
722
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-
|
|
723
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-
|
|
724
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-3 rounded-agg-full" })
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" }),
|
|
726
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "size-[14px] rounded-agg-sm" })
|
|
725
727
|
] })
|
|
726
728
|
] }),
|
|
727
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-
|
|
729
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
728
730
|
] })
|
|
729
731
|
]
|
|
730
732
|
}
|
|
@@ -744,13 +746,9 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
|
|
|
744
746
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
|
|
745
747
|
"aria-busy": true,
|
|
746
748
|
children: [
|
|
747
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "flex w-full flex-col items-start justify-between gap-
|
|
748
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-7 w-
|
|
749
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
750
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
751
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-10 w-20 rounded-agg-full" }),
|
|
752
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-10 w-24 rounded-agg-full" })
|
|
753
|
-
] })
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.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: [
|
|
750
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-7 w-[120px] rounded-agg-md" }),
|
|
751
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SkeletonBlock, { className: "h-8 w-full rounded-agg-md md:w-[400px]" })
|
|
754
752
|
] }),
|
|
755
753
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "grid grid-cols-1 gap-5 md:grid-cols-3", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
756
754
|
EventListItemSkeletonView,
|
|
@@ -802,30 +800,26 @@ var EventListItemDetailsSkeletonView = ({
|
|
|
802
800
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
|
|
803
801
|
"aria-busy": true,
|
|
804
802
|
children: [
|
|
805
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full items-
|
|
806
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "size-10 rounded-agg-lg
|
|
807
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
808
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-[82%] rounded-agg-sm md:h-7 md:w-[55%]" }),
|
|
809
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-2 overflow-hidden", children: [
|
|
810
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
811
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" }),
|
|
812
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-8 w-28 rounded-agg-full" })
|
|
813
|
-
] })
|
|
814
|
-
] })
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex h-14 w-full items-center gap-3 justify-stretch", children: [
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "size-10! rounded-agg-lg" }),
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-6 w-fit flex-1 rounded-agg-sm" })
|
|
815
806
|
] }),
|
|
816
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
817
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
807
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-4 md:gap-6", children: [
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex max-w-full gap-2 overflow-hidden", children: [
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" }),
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-[100px] rounded-agg-full" })
|
|
813
|
+
] }),
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-9 w-full max-w-[221px] rounded-agg-full md:w-[221px]" })
|
|
815
|
+
] }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
817
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-[220px] w-full rounded-agg-xl md:h-[240px]" }),
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-[59px] rounded-agg-sm" }),
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
|
|
821
|
+
] })
|
|
823
822
|
] })
|
|
824
|
-
] }),
|
|
825
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-[300px] w-full rounded-agg-xl", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-full w-full rounded-agg-xl" }) }),
|
|
826
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
827
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
828
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SkeletonBlock, { className: "h-5 w-40 rounded-agg-sm" })
|
|
829
823
|
] })
|
|
830
824
|
]
|
|
831
825
|
}
|
|
@@ -849,6 +843,77 @@ var orderBookRowLimitDefault = 4;
|
|
|
849
843
|
|
|
850
844
|
// src/primitives/skeleton/views/market-details-skeleton-view.tsx
|
|
851
845
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
846
|
+
var orderBookAskBarWidths = [
|
|
847
|
+
"w-[52px] md:w-[240px]",
|
|
848
|
+
"w-[48px] md:w-[200px]",
|
|
849
|
+
"w-[40px] md:w-[120px]",
|
|
850
|
+
"w-[36px] md:w-[60px]"
|
|
851
|
+
];
|
|
852
|
+
var orderBookBidBarWidths = [
|
|
853
|
+
"w-[36px] md:w-[60px]",
|
|
854
|
+
"w-[40px] md:w-[120px]",
|
|
855
|
+
"w-[48px] md:w-[200px]",
|
|
856
|
+
"w-[52px] md:w-[240px]"
|
|
857
|
+
];
|
|
858
|
+
var MarketDetailsHeaderSkeleton = () => {
|
|
859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3 md:px-5", children: [
|
|
860
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:min-w-52 md:gap-4", children: [
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
|
|
862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-[132px] rounded-agg-sm" }),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-[141px] rounded-agg-sm" })
|
|
865
|
+
] })
|
|
866
|
+
] }),
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-[60px] rounded-agg-md" }),
|
|
868
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex w-full gap-2 md:w-auto", children: [
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[135px]" }),
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-9 w-full rounded-agg-full md:w-[131px]" })
|
|
871
|
+
] })
|
|
872
|
+
] });
|
|
873
|
+
};
|
|
874
|
+
var MarketDetailsTabsSkeleton = () => {
|
|
875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-14 items-end px-4 md:px-5", children: [
|
|
876
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-full flex-col items-end justify-end rounded-t-agg-lg", children: [
|
|
877
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }) }),
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
|
|
879
|
+
] }),
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex h-full flex-col justify-center", children: [
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-12 rounded-agg-sm" }) }),
|
|
882
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-[3px] w-full" })
|
|
883
|
+
] })
|
|
884
|
+
] });
|
|
885
|
+
};
|
|
886
|
+
var MarketDetailsOrderBookRows = ({
|
|
887
|
+
side,
|
|
888
|
+
barWidths
|
|
889
|
+
}) => {
|
|
890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-2", children: barWidths.map((barWidthClassName, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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: [
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
895
|
+
] }),
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-5 rounded-agg-sm" }),
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: cn("h-2 rounded-agg-full", barWidthClassName) }) })
|
|
899
|
+
] }),
|
|
900
|
+
index < barWidths.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
|
|
901
|
+
] }, `${side}-row-${index}`)) });
|
|
902
|
+
};
|
|
903
|
+
var MarketDetailsOderbookSkeleton = ({
|
|
904
|
+
className
|
|
905
|
+
}) => {
|
|
906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex flex-col gap-5", className), children: [
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOrderBookRows, { side: "ask", barWidths: orderBookAskBarWidths })
|
|
910
|
+
] }),
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-10 rounded-agg-sm" }),
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOrderBookRows, { side: "bid", barWidths: orderBookBidBarWidths })
|
|
914
|
+
] })
|
|
915
|
+
] });
|
|
916
|
+
};
|
|
852
917
|
var MarketDetailsSkeletonView = ({
|
|
853
918
|
className,
|
|
854
919
|
ariaLabel,
|
|
@@ -863,60 +928,12 @@ var MarketDetailsSkeletonView = ({
|
|
|
863
928
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
|
|
864
929
|
"aria-busy": true,
|
|
865
930
|
children: [
|
|
866
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
867
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
868
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
|
|
869
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "size-12 rounded-agg-lg md:size-[60px]" }),
|
|
870
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
871
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-6 w-40 rounded-agg-sm" }),
|
|
872
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-28 rounded-agg-sm" })
|
|
873
|
-
] })
|
|
874
|
-
] }),
|
|
875
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-8 w-16 rounded-agg-sm" })
|
|
876
|
-
] }),
|
|
877
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex gap-2", children: [
|
|
878
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" }),
|
|
879
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-10 flex-1 rounded-agg-full" })
|
|
880
|
-
] })
|
|
881
|
-
] }),
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsHeaderSkeleton, {}),
|
|
882
932
|
isDetailed ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
883
933
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
884
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsTabsSkeleton, {}),
|
|
885
935
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
886
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
887
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
888
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
889
|
-
[0, 1, 2, 3].map((index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
890
|
-
"div",
|
|
891
|
-
{
|
|
892
|
-
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
893
|
-
children: [
|
|
894
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
895
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
896
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
897
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
898
|
-
]
|
|
899
|
-
},
|
|
900
|
-
`ask-${index}`
|
|
901
|
-
))
|
|
902
|
-
] }),
|
|
903
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
904
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 w-12 rounded-agg-sm" }),
|
|
905
|
-
[0, 1, 2, 3].map((index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
906
|
-
"div",
|
|
907
|
-
{
|
|
908
|
-
className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2",
|
|
909
|
-
children: [
|
|
910
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
911
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
912
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-4 rounded-agg-sm" }),
|
|
913
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkeletonBlock, { className: "h-2 rounded-agg-full" })
|
|
914
|
-
]
|
|
915
|
-
},
|
|
916
|
-
`bid-${index}`
|
|
917
|
-
))
|
|
918
|
-
] })
|
|
919
|
-
] })
|
|
936
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MarketDetailsOderbookSkeleton, { className: "p-5" })
|
|
920
937
|
] }) : null
|
|
921
938
|
]
|
|
922
939
|
}
|
|
@@ -927,65 +944,46 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
|
|
|
927
944
|
// src/primitives/skeleton/views/place-order-skeleton-view.tsx
|
|
928
945
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
929
946
|
var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
|
|
947
|
+
var TabsSkeletonBar = () => {
|
|
948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full items-end border-b border-agg-border", children: [
|
|
949
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col rounded-t-agg-lg", children: [
|
|
950
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-[3px] w-full rounded-t-agg-sm" })
|
|
952
|
+
] }),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col", children: [
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-5 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-10 rounded-agg-sm" }) }),
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-[3px] w-full" })
|
|
956
|
+
] })
|
|
957
|
+
] });
|
|
958
|
+
};
|
|
930
959
|
var ContentBody = () => {
|
|
931
960
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
|
|
932
961
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
933
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex
|
|
934
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
935
|
-
|
|
936
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
] })
|
|
940
|
-
] }),
|
|
941
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-6 rounded-agg-sm" })
|
|
962
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
963
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "size-12 shrink-0 rounded-agg-lg" }),
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
965
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[92%] max-w-[240px] rounded-agg-sm" }),
|
|
966
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[64%] max-w-[160px] rounded-agg-sm" })
|
|
967
|
+
] })
|
|
942
968
|
] }),
|
|
943
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-[92px] rounded-agg-sm" }),
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TabsSkeletonBar, {})
|
|
944
971
|
] }),
|
|
945
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex h-11 items-end border-b border-agg-separator", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-8", children: [
|
|
946
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
947
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" }),
|
|
948
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-[3px] w-12 rounded-t-agg-sm" })
|
|
949
|
-
] }),
|
|
950
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
951
|
-
] }) }),
|
|
952
972
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
953
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex gap-2", children: [
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full gap-2", children: [
|
|
954
974
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" }),
|
|
955
975
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-11 flex-1 rounded-agg-full" })
|
|
956
976
|
] }),
|
|
957
977
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
958
978
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
959
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-
|
|
960
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-[63px] rounded-agg-sm" }),
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[118px] rounded-agg-sm" })
|
|
961
981
|
] }),
|
|
962
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
982
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: cn("text-agg-3xl font-agg-bold leading-agg-9 text-agg-separator"), children: "$0" })
|
|
963
983
|
] })
|
|
964
984
|
] }),
|
|
965
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
966
|
-
|
|
967
|
-
[0, 1].map((index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
968
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
969
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
970
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-full" }),
|
|
971
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" })
|
|
972
|
-
] }),
|
|
973
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-5 w-10 rounded-agg-sm" })
|
|
974
|
-
] }),
|
|
975
|
-
index === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-px w-full bg-agg-trade-highlight-border" }) : null
|
|
976
|
-
] }, `place-order-route-${index}`)),
|
|
977
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "mx-auto h-5 w-40 rounded-agg-sm" })
|
|
978
|
-
] }) }),
|
|
979
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-36 rounded-agg-sm" })
|
|
980
|
-
] }),
|
|
981
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
982
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
983
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-6 w-20 rounded-agg-sm" }),
|
|
984
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-24 rounded-agg-sm" })
|
|
985
|
-
] }),
|
|
986
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-9 w-36 rounded-agg-sm" })
|
|
987
|
-
] }),
|
|
988
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-[88%] self-center rounded-agg-sm" })
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }),
|
|
986
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[240px] self-center rounded-agg-sm" })
|
|
989
987
|
] });
|
|
990
988
|
};
|
|
991
989
|
var PlaceOrderSkeletonView = ({
|
|
@@ -999,19 +997,7 @@ var PlaceOrderSkeletonView = ({
|
|
|
999
997
|
role: "status",
|
|
1000
998
|
"aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
|
|
1001
999
|
"aria-busy": true,
|
|
1002
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1003
|
-
Card,
|
|
1004
|
-
{
|
|
1005
|
-
className: cn(
|
|
1006
|
-
placeOrderCardClassName,
|
|
1007
|
-
"w-full max-w-[400px] rounded-t-agg-xl rounded-b-none border-b-0"
|
|
1008
|
-
),
|
|
1009
|
-
children: [
|
|
1010
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContentBody, {}),
|
|
1011
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "border-t border-agg-separator bg-agg-secondary p-4", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SkeletonBlock, { className: "h-12 w-full rounded-agg-full" }) })
|
|
1012
|
-
]
|
|
1013
|
-
}
|
|
1014
|
-
) })
|
|
1000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex w-full items-end justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Card, { className: cn(placeOrderCardClassName, "w-full"), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContentBody, {}) }) })
|
|
1015
1001
|
}
|
|
1016
1002
|
);
|
|
1017
1003
|
};
|
|
@@ -1037,38 +1023,27 @@ var SettlementSkeletonView = ({
|
|
|
1037
1023
|
"aria-label": ariaLabel != null ? ariaLabel : labels.trading.settlementLoading,
|
|
1038
1024
|
"aria-busy": true,
|
|
1039
1025
|
children: [
|
|
1040
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex
|
|
1041
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-
|
|
1042
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[81px] rounded-agg-sm" }),
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[240px] rounded-agg-sm" })
|
|
1043
1029
|
] }),
|
|
1044
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-
|
|
1045
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-
|
|
1030
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
|
|
1046
1032
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
1047
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[
|
|
1048
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[
|
|
1049
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[80%] rounded-agg-sm" }),
|
|
1050
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[74%] rounded-agg-sm" })
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[320px] rounded-agg-sm" }),
|
|
1034
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[280px] rounded-agg-sm" })
|
|
1051
1035
|
] })
|
|
1052
1036
|
] }),
|
|
1053
1037
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
1054
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
1055
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex
|
|
1056
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
1057
|
-
|
|
1058
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-24 rounded-agg-sm" }),
|
|
1059
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-4 rounded-agg-sm" })
|
|
1060
|
-
] }),
|
|
1061
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-col gap-2 pl-6", children: [
|
|
1062
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-full rounded-agg-sm" }),
|
|
1063
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[92%] rounded-agg-sm" }),
|
|
1064
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-4 w-[34%] rounded-agg-sm" })
|
|
1065
|
-
] })
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" })
|
|
1066
1042
|
] }),
|
|
1067
|
-
|
|
1068
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-
|
|
1069
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-
|
|
1070
|
-
|
|
1071
|
-
] }, `settlement-venue-${index}`))
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SkeletonBlock, { className: "h-5 w-[60px] rounded-agg-sm" })
|
|
1046
|
+
] })
|
|
1072
1047
|
] })
|
|
1073
1048
|
]
|
|
1074
1049
|
}
|
|
@@ -1360,6 +1335,13 @@ var venueLogoRegistry = {
|
|
|
1360
1335
|
opinion: LogoOpinionIcon,
|
|
1361
1336
|
probable: LogoProbableIcon
|
|
1362
1337
|
};
|
|
1338
|
+
var VENUE_LOGO_BASE_URL = "https://assets.snagsolutions.io/public/prediction-markets/logos";
|
|
1339
|
+
var venueLogoUrlRegistry = {
|
|
1340
|
+
kalshi: `${VENUE_LOGO_BASE_URL}/kalshi.png`,
|
|
1341
|
+
polymarket: `${VENUE_LOGO_BASE_URL}/polymarket.png`,
|
|
1342
|
+
opinion: `${VENUE_LOGO_BASE_URL}/opinion.png`,
|
|
1343
|
+
probable: `${VENUE_LOGO_BASE_URL}/probable.png`
|
|
1344
|
+
};
|
|
1363
1345
|
var venueLogoNames = Object.keys(venueLogoRegistry);
|
|
1364
1346
|
var sizeClasses2 = {
|
|
1365
1347
|
small: "h-4 w-4",
|
|
@@ -1371,6 +1353,7 @@ var sizeClasses2 = {
|
|
|
1371
1353
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1372
1354
|
var VenueLogo = ({
|
|
1373
1355
|
venue,
|
|
1356
|
+
variant = "icon",
|
|
1374
1357
|
isColor = true,
|
|
1375
1358
|
isMonochromatic = false,
|
|
1376
1359
|
color,
|
|
@@ -1380,8 +1363,20 @@ var VenueLogo = ({
|
|
|
1380
1363
|
title
|
|
1381
1364
|
}) => {
|
|
1382
1365
|
const labels = (0, import_hooks12.useLabels)();
|
|
1383
|
-
const Component = venueLogoRegistry[venue];
|
|
1384
1366
|
const sizeClass = sizeClasses2[size];
|
|
1367
|
+
const resolvedLabel = ariaLabel != null ? ariaLabel : labels.venues[venue];
|
|
1368
|
+
if (variant === "logo") {
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1370
|
+
"img",
|
|
1371
|
+
{
|
|
1372
|
+
src: venueLogoUrlRegistry[venue],
|
|
1373
|
+
alt: resolvedLabel,
|
|
1374
|
+
title,
|
|
1375
|
+
className: cn("shrink-0 rounded-agg-lg object-cover", sizeClass, className)
|
|
1376
|
+
}
|
|
1377
|
+
);
|
|
1378
|
+
}
|
|
1379
|
+
const Component = venueLogoRegistry[venue];
|
|
1385
1380
|
const resolvedIsColor = isMonochromatic ? false : isColor;
|
|
1386
1381
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1387
1382
|
Component,
|
|
@@ -1389,7 +1384,7 @@ var VenueLogo = ({
|
|
|
1389
1384
|
className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
|
|
1390
1385
|
isColor: resolvedIsColor,
|
|
1391
1386
|
color,
|
|
1392
|
-
"aria-label":
|
|
1387
|
+
"aria-label": resolvedLabel,
|
|
1393
1388
|
title
|
|
1394
1389
|
}
|
|
1395
1390
|
);
|
|
@@ -1398,27 +1393,14 @@ VenueLogo.displayName = "VenueLogo";
|
|
|
1398
1393
|
|
|
1399
1394
|
// src/events/item/event-list-item.utils.ts
|
|
1400
1395
|
var resolveEventListItemEvent = (fetchedEvent) => {
|
|
1401
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1402
1396
|
if (!fetchedEvent)
|
|
1403
1397
|
return void 0;
|
|
1404
|
-
const fallbackVenueEvent = fetchedEvent.venueEvents[0];
|
|
1405
|
-
if (!fallbackVenueEvent)
|
|
1406
|
-
return void 0;
|
|
1407
1398
|
const mergedVenueMarkets = fetchedEvent.markets.flatMap(
|
|
1408
|
-
(
|
|
1399
|
+
(market) => market.venueMarkets
|
|
1409
1400
|
);
|
|
1410
|
-
|
|
1411
|
-
if ((venueMarkets == null ? void 0 : venueMarkets.length) === 0)
|
|
1401
|
+
if (mergedVenueMarkets.length === 0)
|
|
1412
1402
|
return void 0;
|
|
1413
|
-
return
|
|
1414
|
-
id: fetchedEvent.id,
|
|
1415
|
-
title: fetchedEvent.title || fallbackVenueEvent.title,
|
|
1416
|
-
description: (_b = (_a = fetchedEvent.description) != null ? _a : fallbackVenueEvent.description) != null ? _b : null,
|
|
1417
|
-
volume: (_d = (_c = fetchedEvent.volume) != null ? _c : fallbackVenueEvent.volume) != null ? _d : null,
|
|
1418
|
-
startDate: (_f = (_e = fetchedEvent.startDate) != null ? _e : fallbackVenueEvent.startDate) != null ? _f : null,
|
|
1419
|
-
endDate: (_h = (_g = fetchedEvent.endDate) != null ? _g : fallbackVenueEvent.endDate) != null ? _h : null,
|
|
1420
|
-
creationDate: (_j = (_i = fetchedEvent.creationDate) != null ? _i : fallbackVenueEvent.creationDate) != null ? _j : null
|
|
1421
|
-
});
|
|
1403
|
+
return fetchedEvent;
|
|
1422
1404
|
};
|
|
1423
1405
|
var normalizeProbability = (value) => {
|
|
1424
1406
|
if (typeof value !== "number" || !Number.isFinite(value))
|
|
@@ -1477,15 +1459,14 @@ var resolveTileTitle = (event, primaryVenueMarket, titleOverride) => {
|
|
|
1477
1459
|
return event.title;
|
|
1478
1460
|
};
|
|
1479
1461
|
var resolveTileImage = (event, primaryVenueMarket, imageOverride) => {
|
|
1480
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1481
1462
|
if (typeof imageOverride === "string" && imageOverride.trim()) {
|
|
1482
1463
|
return imageOverride;
|
|
1483
1464
|
}
|
|
1484
1465
|
if (typeof (primaryVenueMarket == null ? void 0 : primaryVenueMarket.image) === "string" && primaryVenueMarket.image.trim()) {
|
|
1485
1466
|
return primaryVenueMarket.image;
|
|
1486
1467
|
}
|
|
1487
|
-
if (typeof
|
|
1488
|
-
return
|
|
1468
|
+
if (typeof event.image === "string" && event.image.trim()) {
|
|
1469
|
+
return event.image;
|
|
1489
1470
|
}
|
|
1490
1471
|
return void 0;
|
|
1491
1472
|
};
|
|
@@ -1603,18 +1584,22 @@ var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
|
|
|
1603
1584
|
};
|
|
1604
1585
|
}).filter((item) => item != null);
|
|
1605
1586
|
};
|
|
1606
|
-
var buildPriceHistoryGroups = (selectedOutcomes) => {
|
|
1607
|
-
const
|
|
1608
|
-
selectedOutcomes.forEach(({ venue,
|
|
1609
|
-
var _a;
|
|
1610
|
-
|
|
1611
|
-
|
|
1587
|
+
var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
|
|
1588
|
+
const marketIdByVenue = /* @__PURE__ */ new Map();
|
|
1589
|
+
selectedOutcomes.forEach(({ venue, market }) => {
|
|
1590
|
+
var _a, _b;
|
|
1591
|
+
const marketWithCanonicalId = market;
|
|
1592
|
+
const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
|
|
1593
|
+
if (!canonicalMarketId)
|
|
1594
|
+
return;
|
|
1595
|
+
if (!marketIdByVenue.has(venue)) {
|
|
1596
|
+
marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
|
|
1612
1597
|
}
|
|
1613
|
-
(
|
|
1598
|
+
(_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
|
|
1614
1599
|
});
|
|
1615
|
-
return [...
|
|
1600
|
+
return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
|
|
1616
1601
|
venue,
|
|
1617
|
-
venueMarketOutcomeIds
|
|
1602
|
+
venueMarketOutcomeIds: [...marketIds]
|
|
1618
1603
|
})).filter((group) => group.venueMarketOutcomeIds.length > 0);
|
|
1619
1604
|
};
|
|
1620
1605
|
var resolveSeriesColor = (venue, index) => {
|
|
@@ -1674,13 +1659,18 @@ var resolveAverageProbability = (values) => {
|
|
|
1674
1659
|
return validValues.reduce((sum, value) => sum + value, 0) / validValues.length;
|
|
1675
1660
|
};
|
|
1676
1661
|
var resolveOutcomeCandidateIds = (market, outcome) => {
|
|
1677
|
-
var _a;
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1662
|
+
var _a, _b;
|
|
1663
|
+
const marketWithCanonicalId = market;
|
|
1664
|
+
return [
|
|
1665
|
+
outcome.id,
|
|
1666
|
+
(_a = outcome.externalIdentifier) != null ? _a : void 0,
|
|
1667
|
+
market.externalIdentifier,
|
|
1668
|
+
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0
|
|
1669
|
+
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
1681
1670
|
};
|
|
1682
1671
|
var EventListItemDetailsGraphSection = ({
|
|
1683
1672
|
venueMarkets,
|
|
1673
|
+
canonicalMarketId,
|
|
1684
1674
|
selectedOutcomeLabel,
|
|
1685
1675
|
onSelectedOutcomeLabelChange,
|
|
1686
1676
|
switchLabels,
|
|
@@ -1773,8 +1763,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
1773
1763
|
return [...outcomeByModeAndId.values()];
|
|
1774
1764
|
}, [selectedOutcomesByMode]);
|
|
1775
1765
|
const priceHistoryGroups = (0, import_react3.useMemo)(() => {
|
|
1776
|
-
return buildPriceHistoryGroups(allOutcomesForHistory);
|
|
1777
|
-
}, [allOutcomesForHistory]);
|
|
1766
|
+
return buildPriceHistoryGroups(allOutcomesForHistory, canonicalMarketId);
|
|
1767
|
+
}, [allOutcomesForHistory, canonicalMarketId]);
|
|
1778
1768
|
const timeWindow = (0, import_react3.useMemo)(() => {
|
|
1779
1769
|
return getTimeWindowByRange(selectedTimeRange);
|
|
1780
1770
|
}, [selectedTimeRange]);
|
|
@@ -1978,11 +1968,12 @@ var EventListItemDetailsContent = ({
|
|
|
1978
1968
|
ariaLabel,
|
|
1979
1969
|
defaultTimeRange
|
|
1980
1970
|
}) => {
|
|
1971
|
+
var _a, _b;
|
|
1981
1972
|
const config = (0, import_hooks13.useSdkUiConfig)();
|
|
1982
1973
|
const labels = (0, import_hooks13.useLabels)();
|
|
1983
1974
|
const venueMarkets = (0, import_react3.useMemo)(() => {
|
|
1984
|
-
var
|
|
1985
|
-
return (_c = (
|
|
1975
|
+
var _a2, _b2, _c;
|
|
1976
|
+
return (_c = (_b2 = (_a2 = event.markets) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.venueMarkets) != null ? _c : [];
|
|
1986
1977
|
}, [event.markets]);
|
|
1987
1978
|
const primaryVenueMarket = (0, import_react3.useMemo)(() => {
|
|
1988
1979
|
return selectPrimaryVenueMarket(venueMarkets);
|
|
@@ -2020,9 +2011,9 @@ var EventListItemDetailsContent = ({
|
|
|
2020
2011
|
if (outcomeLabels.length === 0)
|
|
2021
2012
|
return void 0;
|
|
2022
2013
|
return [...outcomeLabels].sort((left, right) => {
|
|
2023
|
-
var
|
|
2024
|
-
const leftProbability = (
|
|
2025
|
-
const rightProbability = (
|
|
2014
|
+
var _a2, _b2;
|
|
2015
|
+
const leftProbability = (_a2 = probabilityByLabel.get(left)) != null ? _a2 : -1;
|
|
2016
|
+
const rightProbability = (_b2 = probabilityByLabel.get(right)) != null ? _b2 : -1;
|
|
2026
2017
|
return rightProbability - leftProbability;
|
|
2027
2018
|
})[0];
|
|
2028
2019
|
}, [outcomeLabels, probabilityByLabel]);
|
|
@@ -2038,18 +2029,18 @@ var EventListItemDetailsContent = ({
|
|
|
2038
2029
|
setSelectedOutcomeLabel(fallbackOutcomeLabel);
|
|
2039
2030
|
}, [isDateOutcomeMarket, mainOutcomeLabel, outcomeLabels, selectedOutcomeLabel]);
|
|
2040
2031
|
const switchLabels = (0, import_react3.useMemo)(() => {
|
|
2041
|
-
var
|
|
2032
|
+
var _a2, _b2;
|
|
2042
2033
|
if (isDateOutcomeMarket) {
|
|
2043
2034
|
return [labels.eventItemDetails.yes, labels.eventItemDetails.no];
|
|
2044
2035
|
}
|
|
2045
2036
|
const sortedOutcomeLabels = [...outcomeLabels].sort((left, right) => {
|
|
2046
|
-
var
|
|
2047
|
-
const leftProbability = (
|
|
2048
|
-
const rightProbability = (
|
|
2037
|
+
var _a3, _b3;
|
|
2038
|
+
const leftProbability = (_a3 = probabilityByLabel.get(left)) != null ? _a3 : -1;
|
|
2039
|
+
const rightProbability = (_b3 = probabilityByLabel.get(right)) != null ? _b3 : -1;
|
|
2049
2040
|
return rightProbability - leftProbability;
|
|
2050
2041
|
});
|
|
2051
|
-
const firstLabel = (
|
|
2052
|
-
const secondLabel = (
|
|
2042
|
+
const firstLabel = (_a2 = sortedOutcomeLabels[0]) != null ? _a2 : labels.eventItemDetails.yes;
|
|
2043
|
+
const secondLabel = (_b2 = sortedOutcomeLabels.find((label) => label !== firstLabel)) != null ? _b2 : firstLabel;
|
|
2053
2044
|
return [firstLabel, secondLabel];
|
|
2054
2045
|
}, [
|
|
2055
2046
|
isDateOutcomeMarket,
|
|
@@ -2059,8 +2050,8 @@ var EventListItemDetailsContent = ({
|
|
|
2059
2050
|
probabilityByLabel
|
|
2060
2051
|
]);
|
|
2061
2052
|
const volumeLabel = (0, import_react3.useMemo)(() => {
|
|
2062
|
-
var
|
|
2063
|
-
const resolvedVolume = typeof event.volume === "number" ? event.volume : (
|
|
2053
|
+
var _a2;
|
|
2054
|
+
const resolvedVolume = typeof event.volume === "number" ? event.volume : (_a2 = primaryVenueMarket == null ? void 0 : primaryVenueMarket.volume) != null ? _a2 : void 0;
|
|
2064
2055
|
if (typeof resolvedVolume !== "number")
|
|
2065
2056
|
return "";
|
|
2066
2057
|
return `${config.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
@@ -2158,6 +2149,7 @@ var EventListItemDetailsContent = ({
|
|
|
2158
2149
|
EventListItemDetailsGraphSection,
|
|
2159
2150
|
{
|
|
2160
2151
|
venueMarkets,
|
|
2152
|
+
canonicalMarketId: (_b = (_a = event.markets) == null ? void 0 : _a[0]) == null ? void 0 : _b.id,
|
|
2161
2153
|
selectedOutcomeLabel,
|
|
2162
2154
|
onSelectedOutcomeLabelChange: setSelectedOutcomeLabel,
|
|
2163
2155
|
switchLabels,
|
|
@@ -2283,7 +2275,7 @@ EventListItemDetails.displayName = "EventListItemDetails";
|
|
|
2283
2275
|
|
|
2284
2276
|
// src/events/market-details/index.tsx
|
|
2285
2277
|
var import_react6 = require("react");
|
|
2286
|
-
var
|
|
2278
|
+
var import_hooks16 = require("@agg-market/hooks");
|
|
2287
2279
|
|
|
2288
2280
|
// src/primitives/tabs/index.tsx
|
|
2289
2281
|
var import_react5 = require("react");
|
|
@@ -4283,79 +4275,6 @@ var Tabs = ({
|
|
|
4283
4275
|
};
|
|
4284
4276
|
Tabs.displayName = "Tabs";
|
|
4285
4277
|
|
|
4286
|
-
// src/primitives/loading-icon/index.tsx
|
|
4287
|
-
var import_hooks16 = require("@agg-market/hooks");
|
|
4288
|
-
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4289
|
-
var LoadingIcon = ({
|
|
4290
|
-
size = "medium",
|
|
4291
|
-
className,
|
|
4292
|
-
ariaLabel
|
|
4293
|
-
}) => {
|
|
4294
|
-
const labels = (0, import_hooks16.useLabels)();
|
|
4295
|
-
const { enableAnimations } = (0, import_hooks16.useSdkUiConfig)();
|
|
4296
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4297
|
-
"span",
|
|
4298
|
-
{
|
|
4299
|
-
role: "status",
|
|
4300
|
-
"aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
|
|
4301
|
-
className: cn(
|
|
4302
|
-
"group/agg-loading-icon",
|
|
4303
|
-
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
4304
|
-
className
|
|
4305
|
-
),
|
|
4306
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("svg", { viewBox: "0 0 44 44", className: cn("block", iconSizeClasses[size]), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("g", { children: [
|
|
4307
|
-
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4308
|
-
"animateTransform",
|
|
4309
|
-
{
|
|
4310
|
-
attributeName: "transform",
|
|
4311
|
-
attributeType: "XML",
|
|
4312
|
-
type: "rotate",
|
|
4313
|
-
from: "0 22 22",
|
|
4314
|
-
to: "360 22 22",
|
|
4315
|
-
dur: "1.4s",
|
|
4316
|
-
repeatCount: "indefinite"
|
|
4317
|
-
}
|
|
4318
|
-
) : null,
|
|
4319
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4320
|
-
"circle",
|
|
4321
|
-
{
|
|
4322
|
-
cx: "22",
|
|
4323
|
-
cy: "22",
|
|
4324
|
-
r: "16",
|
|
4325
|
-
fill: "none",
|
|
4326
|
-
stroke: "currentColor",
|
|
4327
|
-
strokeWidth: "6",
|
|
4328
|
-
strokeLinecap: "round",
|
|
4329
|
-
strokeDasharray: "60 100",
|
|
4330
|
-
strokeDashoffset: "0",
|
|
4331
|
-
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
4332
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4333
|
-
"animate",
|
|
4334
|
-
{
|
|
4335
|
-
attributeName: "stroke-dasharray",
|
|
4336
|
-
values: "1 100;60 100;1 100",
|
|
4337
|
-
dur: "1.2s",
|
|
4338
|
-
repeatCount: "indefinite"
|
|
4339
|
-
}
|
|
4340
|
-
),
|
|
4341
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4342
|
-
"animate",
|
|
4343
|
-
{
|
|
4344
|
-
attributeName: "stroke-dashoffset",
|
|
4345
|
-
values: "0;-25;-100",
|
|
4346
|
-
dur: "1.2s",
|
|
4347
|
-
repeatCount: "indefinite"
|
|
4348
|
-
}
|
|
4349
|
-
)
|
|
4350
|
-
] }) : null
|
|
4351
|
-
}
|
|
4352
|
-
)
|
|
4353
|
-
] }) }) })
|
|
4354
|
-
}
|
|
4355
|
-
);
|
|
4356
|
-
};
|
|
4357
|
-
LoadingIcon.displayName = "LoadingIcon";
|
|
4358
|
-
|
|
4359
4278
|
// src/events/market-details/market-details.utils.ts
|
|
4360
4279
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
4361
4280
|
var import_zod = require("zod");
|
|
@@ -4480,8 +4399,7 @@ var resolveSubtitle = ({
|
|
|
4480
4399
|
};
|
|
4481
4400
|
var resolveOrderBookRows = ({
|
|
4482
4401
|
data,
|
|
4483
|
-
side
|
|
4484
|
-
depth
|
|
4402
|
+
side
|
|
4485
4403
|
}) => {
|
|
4486
4404
|
if (!(data == null ? void 0 : data.length))
|
|
4487
4405
|
return [];
|
|
@@ -4512,9 +4430,8 @@ var resolveOrderBookRows = ({
|
|
|
4512
4430
|
return left.price - right.price;
|
|
4513
4431
|
return right.price - left.price;
|
|
4514
4432
|
});
|
|
4515
|
-
const
|
|
4516
|
-
|
|
4517
|
-
return limitedRows.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
4433
|
+
const maxTotal = sortedRows.reduce((currentMax, row) => Math.max(currentMax, row.total), 0) || 1;
|
|
4434
|
+
return sortedRows.map((row) => __spreadProps(__spreadValues({}, row), {
|
|
4518
4435
|
barScale: row.total / maxTotal
|
|
4519
4436
|
}));
|
|
4520
4437
|
};
|
|
@@ -4589,14 +4506,14 @@ var buildMarketDetailsModel = ({
|
|
|
4589
4506
|
};
|
|
4590
4507
|
|
|
4591
4508
|
// src/events/market-details/index.tsx
|
|
4592
|
-
var
|
|
4509
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4593
4510
|
var MarketDetailsLoadingState = ({
|
|
4594
4511
|
isOpened = marketDetailsDefaultIsOpened,
|
|
4595
4512
|
ariaLabel,
|
|
4596
4513
|
classNames
|
|
4597
4514
|
}) => {
|
|
4598
|
-
const labels = (0,
|
|
4599
|
-
return /* @__PURE__ */ (0,
|
|
4515
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4600
4517
|
Skeleton,
|
|
4601
4518
|
{
|
|
4602
4519
|
view: isOpened ? "market-details-detailed" : "market-details-minified",
|
|
@@ -4609,16 +4526,16 @@ var MarketDetailsUnavailableState = ({
|
|
|
4609
4526
|
ariaLabel,
|
|
4610
4527
|
classNames
|
|
4611
4528
|
}) => {
|
|
4612
|
-
const labels = (0,
|
|
4613
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4614
4531
|
Card,
|
|
4615
4532
|
{
|
|
4616
4533
|
className: cn(marketDetailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
4617
4534
|
role: "status",
|
|
4618
4535
|
"aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
|
|
4619
|
-
children: /* @__PURE__ */ (0,
|
|
4620
|
-
/* @__PURE__ */ (0,
|
|
4621
|
-
/* @__PURE__ */ (0,
|
|
4536
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
|
|
4537
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
|
|
4538
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
|
|
4622
4539
|
] })
|
|
4623
4540
|
}
|
|
4624
4541
|
);
|
|
@@ -4627,44 +4544,59 @@ var OrderBookRows = ({
|
|
|
4627
4544
|
rows,
|
|
4628
4545
|
title,
|
|
4629
4546
|
formatNumber,
|
|
4630
|
-
formatCurrency
|
|
4547
|
+
formatCurrency,
|
|
4548
|
+
visibleRows
|
|
4631
4549
|
}) => {
|
|
4632
|
-
const labels = (0,
|
|
4550
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4633
4551
|
const isAsks = title === labels.marketDetails.asks;
|
|
4634
4552
|
const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
|
|
4635
4553
|
const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
)
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4554
|
+
const maxVisibleRows = Math.max(1, visibleRows);
|
|
4555
|
+
const orderBookRowHeightPx = 28;
|
|
4556
|
+
const orderBookDividerHeightPx = 1;
|
|
4557
|
+
const orderBookRowGapPx = 8;
|
|
4558
|
+
const orderBookVisibleHeightPx = maxVisibleRows * orderBookRowHeightPx + Math.max(0, maxVisibleRows - 1) * (orderBookDividerHeightPx + orderBookRowGapPx);
|
|
4559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
4560
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "caption-caps", children: title }),
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4562
|
+
"div",
|
|
4563
|
+
{
|
|
4564
|
+
className: "overflow-y-auto pr-1 flex flex-col gap-2",
|
|
4565
|
+
style: { maxHeight: `${orderBookVisibleHeightPx}px` },
|
|
4566
|
+
role: "region",
|
|
4567
|
+
"aria-label": `${title} order book levels`,
|
|
4568
|
+
children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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: [
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(VenueLogo, { venue: row.venue, size: "small" }),
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4573
|
+
"span",
|
|
4574
|
+
{
|
|
4575
|
+
className: cn(
|
|
4576
|
+
"text-agg-xs font-agg-bold leading-agg-4 md:text-agg-sm md:leading-agg-5",
|
|
4577
|
+
priceClassName
|
|
4578
|
+
),
|
|
4579
|
+
children: formatProbabilityCents(row.price)
|
|
4580
|
+
}
|
|
4581
|
+
)
|
|
4582
|
+
] }),
|
|
4583
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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) }),
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.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) }),
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4586
|
+
"div",
|
|
4587
|
+
{
|
|
4588
|
+
"aria-hidden": "true",
|
|
4589
|
+
className: cn("h-2 rounded-agg-full", barClassName),
|
|
4590
|
+
style: {
|
|
4591
|
+
width: `${Math.max(20, Math.round(row.barScale * 100))}%`
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
) })
|
|
4595
|
+
] }),
|
|
4596
|
+
index < rows.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "h-px w-full bg-agg-separator" }) : null
|
|
4597
|
+
] }, row.id))
|
|
4598
|
+
}
|
|
4599
|
+
)
|
|
4668
4600
|
] });
|
|
4669
4601
|
};
|
|
4670
4602
|
var getOutcomeButtonClassName = ({
|
|
@@ -4698,8 +4630,8 @@ var MarketDetailsContent = ({
|
|
|
4698
4630
|
classNames,
|
|
4699
4631
|
otherContent
|
|
4700
4632
|
}) => {
|
|
4701
|
-
const config = (0,
|
|
4702
|
-
const labels = (0,
|
|
4633
|
+
const config = (0, import_hooks16.useSdkUiConfig)();
|
|
4634
|
+
const labels = (0, import_hooks16.useLabels)();
|
|
4703
4635
|
const detailsContentId = (0, import_react6.useId)();
|
|
4704
4636
|
const model = (0, import_react6.useMemo)(() => {
|
|
4705
4637
|
return buildMarketDetailsModel({
|
|
@@ -4782,10 +4714,11 @@ var MarketDetailsContent = ({
|
|
|
4782
4714
|
});
|
|
4783
4715
|
return [...uniqueOutcomesByVenueAndId.values()];
|
|
4784
4716
|
}, [outcomesByLabel]);
|
|
4717
|
+
const canonicalMarketIdForHistory = model == null ? void 0 : model.market.id;
|
|
4785
4718
|
const priceHistoryGroups = (0, import_react6.useMemo)(() => {
|
|
4786
|
-
return buildPriceHistoryGroups(graphOutcomes);
|
|
4787
|
-
}, [graphOutcomes]);
|
|
4788
|
-
const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0,
|
|
4719
|
+
return buildPriceHistoryGroups(graphOutcomes, canonicalMarketIdForHistory);
|
|
4720
|
+
}, [canonicalMarketIdForHistory, graphOutcomes]);
|
|
4721
|
+
const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks16.usePriceHistory)(__spreadProps(__spreadValues({
|
|
4789
4722
|
groups: priceHistoryGroups
|
|
4790
4723
|
}, timeWindow), {
|
|
4791
4724
|
enabled: isOpened && selectedTab === "graph" && priceHistoryGroups.length > 0
|
|
@@ -4797,24 +4730,22 @@ var MarketDetailsContent = ({
|
|
|
4797
4730
|
liveUpdate: true
|
|
4798
4731
|
}));
|
|
4799
4732
|
}, [selectedOutcomesByVenue]);
|
|
4800
|
-
const { data: orderBookData, isLoading: isOrderBookLoading } = (0,
|
|
4733
|
+
const { data: orderBookData, isLoading: isOrderBookLoading } = (0, import_hooks16.useOrderBook)({
|
|
4801
4734
|
orderbooks: orderBookInputs,
|
|
4802
4735
|
enabled: isOpened && selectedTab === "order-book" && orderBookInputs.length > 0
|
|
4803
4736
|
});
|
|
4804
4737
|
const askRows = (0, import_react6.useMemo)(() => {
|
|
4805
4738
|
return resolveOrderBookRows({
|
|
4806
4739
|
data: orderBookData,
|
|
4807
|
-
side: "asks"
|
|
4808
|
-
depth: orderBookDepth
|
|
4740
|
+
side: "asks"
|
|
4809
4741
|
});
|
|
4810
|
-
}, [orderBookData
|
|
4742
|
+
}, [orderBookData]);
|
|
4811
4743
|
const bidRows = (0, import_react6.useMemo)(() => {
|
|
4812
4744
|
return resolveOrderBookRows({
|
|
4813
4745
|
data: orderBookData,
|
|
4814
|
-
side: "bids"
|
|
4815
|
-
depth: orderBookDepth
|
|
4746
|
+
side: "bids"
|
|
4816
4747
|
});
|
|
4817
|
-
}, [orderBookData
|
|
4748
|
+
}, [orderBookData]);
|
|
4818
4749
|
const priceHistoryByVenue = (0, import_react6.useMemo)(() => {
|
|
4819
4750
|
const historyByVenue = /* @__PURE__ */ new Map();
|
|
4820
4751
|
if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
|
|
@@ -4834,11 +4765,14 @@ var MarketDetailsContent = ({
|
|
|
4834
4765
|
const graphSeriesByOutcomeLabel = (0, import_react6.useMemo)(() => {
|
|
4835
4766
|
const seriesByOutcomeLabel = /* @__PURE__ */ new Map();
|
|
4836
4767
|
const resolveOutcomeCandidateIds2 = (outcomeByVenue) => {
|
|
4837
|
-
var _a;
|
|
4768
|
+
var _a, _b;
|
|
4769
|
+
const marketWithCanonicalId = outcomeByVenue.market;
|
|
4838
4770
|
return [
|
|
4839
4771
|
outcomeByVenue.outcome.id,
|
|
4840
4772
|
(_a = outcomeByVenue.outcome.externalIdentifier) != null ? _a : void 0,
|
|
4841
|
-
outcomeByVenue.market.externalIdentifier
|
|
4773
|
+
outcomeByVenue.market.externalIdentifier,
|
|
4774
|
+
(_b = marketWithCanonicalId.marketId) != null ? _b : void 0,
|
|
4775
|
+
canonicalMarketIdForHistory
|
|
4842
4776
|
].filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
4843
4777
|
};
|
|
4844
4778
|
headerOutcomeItems.forEach((headerOutcomeItem) => {
|
|
@@ -4870,7 +4804,7 @@ var MarketDetailsContent = ({
|
|
|
4870
4804
|
seriesByOutcomeLabel.set(headerOutcomeItem.label, graphSeries2);
|
|
4871
4805
|
});
|
|
4872
4806
|
return seriesByOutcomeLabel;
|
|
4873
|
-
}, [headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
|
|
4807
|
+
}, [canonicalMarketIdForHistory, headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
|
|
4874
4808
|
const graphSeries = (0, import_react6.useMemo)(() => {
|
|
4875
4809
|
var _a;
|
|
4876
4810
|
if (!selectedOutcomeLabel)
|
|
@@ -4928,35 +4862,36 @@ var MarketDetailsContent = ({
|
|
|
4928
4862
|
setSelectedGraphVenue(null);
|
|
4929
4863
|
}, [selectedGraphVenue, selectedOutcomesByVenue]);
|
|
4930
4864
|
if (!model) {
|
|
4931
|
-
return /* @__PURE__ */ (0,
|
|
4865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MarketDetailsUnavailableState, { ariaLabel, classNames });
|
|
4932
4866
|
}
|
|
4933
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4934
4868
|
Card,
|
|
4935
4869
|
{
|
|
4936
4870
|
className: cn(
|
|
4937
|
-
"w-full
|
|
4871
|
+
"w-full rounded-agg-2xl text-left outline-none",
|
|
4938
4872
|
marketDetailsBaseCardClassName,
|
|
4939
4873
|
classNames == null ? void 0 : classNames.root
|
|
4940
4874
|
),
|
|
4941
|
-
"aria-expanded": isOpened,
|
|
4942
|
-
"aria-controls": detailsContentId,
|
|
4943
|
-
role: "button",
|
|
4944
|
-
tabIndex: 0,
|
|
4945
|
-
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
4946
|
-
onClick: handleToggleExpanded,
|
|
4947
|
-
onKeyDown: handleToggleExpanded,
|
|
4948
4875
|
children: [
|
|
4949
|
-
/* @__PURE__ */ (0,
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4950
4877
|
"div",
|
|
4951
4878
|
{
|
|
4952
4879
|
className: cn(
|
|
4953
|
-
"
|
|
4880
|
+
"cursor-pointer disabled:cursor-default",
|
|
4881
|
+
"flex flex-wrap flex-row items-center justify-between gap-3 px-5 py-4",
|
|
4954
4882
|
isOpened && "pb-3",
|
|
4955
4883
|
classNames == null ? void 0 : classNames.header
|
|
4956
4884
|
),
|
|
4885
|
+
"aria-expanded": isOpened,
|
|
4886
|
+
"aria-controls": detailsContentId,
|
|
4887
|
+
role: "button",
|
|
4888
|
+
tabIndex: 0,
|
|
4889
|
+
"aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
|
|
4890
|
+
onClick: handleToggleExpanded,
|
|
4891
|
+
onKeyDown: handleToggleExpanded,
|
|
4957
4892
|
children: [
|
|
4958
|
-
/* @__PURE__ */ (0,
|
|
4959
|
-
model.image ? /* @__PURE__ */ (0,
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex min-w-52 items-center gap-3 md:gap-4", children: [
|
|
4894
|
+
model.image ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4960
4895
|
"img",
|
|
4961
4896
|
{
|
|
4962
4897
|
src: model.image,
|
|
@@ -4964,13 +4899,13 @@ var MarketDetailsContent = ({
|
|
|
4964
4899
|
className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
4965
4900
|
}
|
|
4966
4901
|
) : null,
|
|
4967
|
-
/* @__PURE__ */ (0,
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4969
|
-
/* @__PURE__ */ (0,
|
|
4902
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { as: "h3", variant: "body-large-strong", className: "truncate", children: model.title }),
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "label", className: "truncate text-agg-muted-foreground", children: model.subtitle }) })
|
|
4970
4905
|
] })
|
|
4971
4906
|
] }),
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
4973
|
-
/* @__PURE__ */ (0,
|
|
4907
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { as: "div", variant: "heading", className: "shrink-0", children: formatProbabilityPercent(headlineProbability) }),
|
|
4908
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4974
4909
|
"div",
|
|
4975
4910
|
{
|
|
4976
4911
|
className: "flex gap-2",
|
|
@@ -4981,7 +4916,7 @@ var MarketDetailsContent = ({
|
|
|
4981
4916
|
children: headerOutcomeItems.map((item) => {
|
|
4982
4917
|
const isPositive = item.tone === "positive";
|
|
4983
4918
|
const isActiveOutcome = item.label === selectedOutcomeLabel;
|
|
4984
|
-
return /* @__PURE__ */ (0,
|
|
4919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4985
4920
|
"button",
|
|
4986
4921
|
{
|
|
4987
4922
|
type: "button",
|
|
@@ -4998,8 +4933,8 @@ var MarketDetailsContent = ({
|
|
|
4998
4933
|
e.stopPropagation();
|
|
4999
4934
|
setSelectedOutcomeLabel(item.label);
|
|
5000
4935
|
},
|
|
5001
|
-
children: /* @__PURE__ */ (0,
|
|
5002
|
-
/* @__PURE__ */ (0,
|
|
4936
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
4937
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5003
4938
|
VenueLogo,
|
|
5004
4939
|
{
|
|
5005
4940
|
venue: isPositive ? "polymarket" : "probable",
|
|
@@ -5007,7 +4942,7 @@ var MarketDetailsContent = ({
|
|
|
5007
4942
|
color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
|
|
5008
4943
|
}
|
|
5009
4944
|
),
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
4945
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5011
4946
|
Typography,
|
|
5012
4947
|
{
|
|
5013
4948
|
variant: isActiveOutcome ? "body-strong" : "body",
|
|
@@ -5028,28 +4963,25 @@ var MarketDetailsContent = ({
|
|
|
5028
4963
|
]
|
|
5029
4964
|
}
|
|
5030
4965
|
),
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
4966
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5032
4967
|
"div",
|
|
5033
4968
|
{
|
|
5034
4969
|
id: detailsContentId,
|
|
5035
4970
|
className: cn(
|
|
5036
4971
|
"grid overflow-hidden",
|
|
5037
|
-
getMotionClassName(
|
|
5038
|
-
config.enableAnimations,
|
|
5039
|
-
"transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"
|
|
5040
|
-
),
|
|
4972
|
+
getMotionClassName(config.enableAnimations, "transition-all duration-500 ease-in-out"),
|
|
5041
4973
|
isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
|
|
5042
4974
|
),
|
|
5043
4975
|
"aria-hidden": !isOpened,
|
|
5044
|
-
children: /* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
4976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "min-h-0", children: [
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5047
4979
|
"div",
|
|
5048
4980
|
{
|
|
5049
4981
|
className: cn(
|
|
5050
4982
|
getMotionClassName(
|
|
5051
4983
|
config.enableAnimations,
|
|
5052
|
-
"transition-all duration-500 ease-
|
|
4984
|
+
"transition-all duration-500 ease-in-out"
|
|
5053
4985
|
),
|
|
5054
4986
|
isOpened ? cn(
|
|
5055
4987
|
"translate-y-0 opacity-100",
|
|
@@ -5057,7 +4989,7 @@ var MarketDetailsContent = ({
|
|
|
5057
4989
|
) : "translate-y-5 opacity-0"
|
|
5058
4990
|
),
|
|
5059
4991
|
children: [
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: cn("block", classNames == null ? void 0 : classNames.tabs), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5061
4993
|
Tabs,
|
|
5062
4994
|
{
|
|
5063
4995
|
ariaLabel: labels.marketDetails.tabsAria,
|
|
@@ -5068,42 +5000,32 @@ var MarketDetailsContent = ({
|
|
|
5068
5000
|
className: "w-full px-5"
|
|
5069
5001
|
}
|
|
5070
5002
|
) }),
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5073
|
-
selectedTab === "order-book" ? /* @__PURE__ */ (0,
|
|
5074
|
-
|
|
5075
|
-
{
|
|
5076
|
-
className: "flex flex-col gap-2 min-h-40 items-center justify-center",
|
|
5077
|
-
role: "status",
|
|
5078
|
-
"aria-label": labels.marketDetails.loadingOrderbookAria,
|
|
5079
|
-
"aria-busy": true,
|
|
5080
|
-
children: [
|
|
5081
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LoadingIcon, {}),
|
|
5082
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.loadingOrderbookLabel })
|
|
5083
|
-
]
|
|
5084
|
-
}
|
|
5085
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
5086
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
5004
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: cn("p-5", classNames == null ? void 0 : classNames.content), children: [
|
|
5005
|
+
selectedTab === "order-book" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.orderBook), children: isOrderBookLoading ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MarketDetailsOderbookSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5087
5007
|
OrderBookRows,
|
|
5088
5008
|
{
|
|
5089
5009
|
rows: askRows,
|
|
5090
5010
|
title: labels.marketDetails.asks,
|
|
5091
5011
|
formatNumber: config.formatNumber,
|
|
5092
|
-
formatCurrency: config.formatCurrency
|
|
5012
|
+
formatCurrency: config.formatCurrency,
|
|
5013
|
+
visibleRows: orderBookDepth
|
|
5093
5014
|
}
|
|
5094
5015
|
),
|
|
5095
|
-
/* @__PURE__ */ (0,
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5096
5017
|
OrderBookRows,
|
|
5097
5018
|
{
|
|
5098
5019
|
rows: bidRows,
|
|
5099
5020
|
title: labels.marketDetails.bids,
|
|
5100
5021
|
formatNumber: config.formatNumber,
|
|
5101
|
-
formatCurrency: config.formatCurrency
|
|
5022
|
+
formatCurrency: config.formatCurrency,
|
|
5023
|
+
visibleRows: orderBookDepth
|
|
5102
5024
|
}
|
|
5103
5025
|
)
|
|
5104
5026
|
] }) }) : null,
|
|
5105
|
-
selectedTab === "graph" ? /* @__PURE__ */ (0,
|
|
5106
|
-
/* @__PURE__ */ (0,
|
|
5027
|
+
selectedTab === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.graph), children: [
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5107
5029
|
LineChart,
|
|
5108
5030
|
{
|
|
5109
5031
|
series: graphSeries,
|
|
@@ -5112,11 +5034,11 @@ var MarketDetailsContent = ({
|
|
|
5112
5034
|
classNames: { root: "w-full" },
|
|
5113
5035
|
showSeriesControls: selectedOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
|
5114
5036
|
renderSeriesControls: () => {
|
|
5115
|
-
return /* @__PURE__ */ (0,
|
|
5116
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap gap-2", children: selectedOutcomesByVenue.map((item) => {
|
|
5117
5039
|
const probability = formatProbabilityPercent(item.outcome.price);
|
|
5118
5040
|
const isActiveVenue = selectedGraphVenue === item.venue;
|
|
5119
|
-
return /* @__PURE__ */ (0,
|
|
5041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5120
5042
|
"button",
|
|
5121
5043
|
{
|
|
5122
5044
|
type: "button",
|
|
@@ -5133,14 +5055,14 @@ var MarketDetailsContent = ({
|
|
|
5133
5055
|
handleGraphVenueToggle(item.venue);
|
|
5134
5056
|
},
|
|
5135
5057
|
children: [
|
|
5136
|
-
/* @__PURE__ */ (0,
|
|
5137
|
-
/* @__PURE__ */ (0,
|
|
5058
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
|
|
5059
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
|
|
5138
5060
|
]
|
|
5139
5061
|
},
|
|
5140
5062
|
`${item.market.id}-${item.outcome.id}`
|
|
5141
5063
|
);
|
|
5142
5064
|
}) }),
|
|
5143
|
-
/* @__PURE__ */ (0,
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5144
5066
|
SwitchButton,
|
|
5145
5067
|
{
|
|
5146
5068
|
ariaLabel: labels.marketDetails.outcomeSelectorAria,
|
|
@@ -5158,7 +5080,7 @@ var MarketDetailsContent = ({
|
|
|
5158
5080
|
}
|
|
5159
5081
|
}
|
|
5160
5082
|
),
|
|
5161
|
-
/* @__PURE__ */ (0,
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5162
5084
|
"div",
|
|
5163
5085
|
{
|
|
5164
5086
|
className: cn(
|
|
@@ -5166,10 +5088,10 @@ var MarketDetailsContent = ({
|
|
|
5166
5088
|
classNames == null ? void 0 : classNames.footer
|
|
5167
5089
|
),
|
|
5168
5090
|
children: [
|
|
5169
|
-
/* @__PURE__ */ (0,
|
|
5170
|
-
/* @__PURE__ */ (0,
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: typeof model.market.volume === "number" ? `${config.formatCompactCurrency(model.market.volume)} ${labels.marketDetails.meta.volumeSuffix}` : labels.marketDetails.volumeUnavailable }),
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap items-center gap-3 md:gap-4", children: eventListItemDetailsTimeRanges.map((timeRange) => {
|
|
5171
5093
|
const isActive = selectedTimeRange === timeRange;
|
|
5172
|
-
return /* @__PURE__ */ (0,
|
|
5094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5173
5095
|
"button",
|
|
5174
5096
|
{
|
|
5175
5097
|
type: "button",
|
|
@@ -5192,13 +5114,13 @@ var MarketDetailsContent = ({
|
|
|
5192
5114
|
}
|
|
5193
5115
|
)
|
|
5194
5116
|
] }) : null,
|
|
5195
|
-
selectedTab === "other" ? /* @__PURE__ */ (0,
|
|
5117
|
+
selectedTab === "other" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-col gap-4", children: otherContent != null ? otherContent : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "grid grid-cols-1 gap-3", children: otherRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5196
5118
|
"div",
|
|
5197
5119
|
{
|
|
5198
5120
|
className: "flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
|
|
5199
5121
|
children: [
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5201
|
-
/* @__PURE__ */ (0,
|
|
5122
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
|
|
5123
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
|
|
5202
5124
|
]
|
|
5203
5125
|
},
|
|
5204
5126
|
row.label
|
|
@@ -5233,14 +5155,14 @@ var MarketDetails = (props) => {
|
|
|
5233
5155
|
(_a2 = props.onOpenChange) == null ? void 0 : _a2.call(props, nextIsOpened);
|
|
5234
5156
|
};
|
|
5235
5157
|
const hasEventProp = "event" in props && !!props.event;
|
|
5236
|
-
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0,
|
|
5158
|
+
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks16.useEvent)(
|
|
5237
5159
|
hasEventProp ? void 0 : props.eventId,
|
|
5238
5160
|
{
|
|
5239
5161
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
5240
5162
|
}
|
|
5241
5163
|
);
|
|
5242
5164
|
if (props.isLoading) {
|
|
5243
|
-
return /* @__PURE__ */ (0,
|
|
5165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5244
5166
|
MarketDetailsLoadingState,
|
|
5245
5167
|
{
|
|
5246
5168
|
isOpened: resolvedIsOpened,
|
|
@@ -5250,7 +5172,7 @@ var MarketDetails = (props) => {
|
|
|
5250
5172
|
);
|
|
5251
5173
|
}
|
|
5252
5174
|
if ("event" in props && props.event) {
|
|
5253
|
-
return /* @__PURE__ */ (0,
|
|
5175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5254
5176
|
MarketDetailsContent,
|
|
5255
5177
|
__spreadProps(__spreadValues({}, props), {
|
|
5256
5178
|
isOpened: resolvedIsOpened,
|
|
@@ -5260,7 +5182,7 @@ var MarketDetails = (props) => {
|
|
|
5260
5182
|
);
|
|
5261
5183
|
}
|
|
5262
5184
|
if (isFetchingEvent) {
|
|
5263
|
-
return /* @__PURE__ */ (0,
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5264
5186
|
MarketDetailsLoadingState,
|
|
5265
5187
|
{
|
|
5266
5188
|
isOpened: resolvedIsOpened,
|
|
@@ -5270,9 +5192,9 @@ var MarketDetails = (props) => {
|
|
|
5270
5192
|
);
|
|
5271
5193
|
}
|
|
5272
5194
|
if (!fetchedEvent) {
|
|
5273
|
-
return /* @__PURE__ */ (0,
|
|
5195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MarketDetailsUnavailableState, { ariaLabel: props.ariaLabel, classNames: props.classNames });
|
|
5274
5196
|
}
|
|
5275
|
-
return /* @__PURE__ */ (0,
|
|
5197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5276
5198
|
MarketDetailsContent,
|
|
5277
5199
|
__spreadProps(__spreadValues({}, props), {
|
|
5278
5200
|
isOpened: resolvedIsOpened,
|
|
@@ -5285,12 +5207,12 @@ MarketDetails.displayName = "MarketDetails";
|
|
|
5285
5207
|
|
|
5286
5208
|
// src/trading/place-order/index.tsx
|
|
5287
5209
|
var import_react7 = require("react");
|
|
5288
|
-
var
|
|
5210
|
+
var import_hooks18 = require("@agg-market/hooks");
|
|
5289
5211
|
|
|
5290
5212
|
// src/trading/utils.ts
|
|
5291
|
-
var
|
|
5213
|
+
var import_hooks17 = require("@agg-market/hooks");
|
|
5292
5214
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
5293
|
-
var defaultLabels = (0,
|
|
5215
|
+
var defaultLabels = (0, import_hooks17.resolveAggUiLabels)("en-US");
|
|
5294
5216
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
5295
5217
|
var defaultSettlementDifferencesTitle = defaultLabels.trading.settlementDifferencesTitle;
|
|
5296
5218
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
@@ -5308,9 +5230,9 @@ var getTradingVenueLabel = (venue, label) => {
|
|
|
5308
5230
|
};
|
|
5309
5231
|
|
|
5310
5232
|
// src/trading/place-order/index.tsx
|
|
5311
|
-
var
|
|
5233
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5312
5234
|
var WarningFilledIcon2 = ({ className }) => {
|
|
5313
|
-
return /* @__PURE__ */ (0,
|
|
5235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5314
5236
|
"svg",
|
|
5315
5237
|
{
|
|
5316
5238
|
viewBox: "0 0 16 16",
|
|
@@ -5318,15 +5240,15 @@ var WarningFilledIcon2 = ({ className }) => {
|
|
|
5318
5240
|
className: cn("text-agg-warning", className),
|
|
5319
5241
|
"aria-hidden": "true",
|
|
5320
5242
|
children: [
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5323
|
-
/* @__PURE__ */ (0,
|
|
5243
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: "M8 1.33301L15.3333 14.6663H0.666656L8 1.33301Z", fill: "currentColor" }),
|
|
5244
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: "M8 5.33301V8.66634", stroke: "white", strokeWidth: "1.4", strokeLinecap: "round" }),
|
|
5245
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("circle", { cx: "8", cy: "11.1667", r: "0.833333", fill: "white" })
|
|
5324
5246
|
]
|
|
5325
5247
|
}
|
|
5326
5248
|
);
|
|
5327
5249
|
};
|
|
5328
5250
|
var ErrorFilledIcon = ({ className }) => {
|
|
5329
|
-
return /* @__PURE__ */ (0,
|
|
5251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5330
5252
|
"svg",
|
|
5331
5253
|
{
|
|
5332
5254
|
viewBox: "0 0 16 16",
|
|
@@ -5334,9 +5256,9 @@ var ErrorFilledIcon = ({ className }) => {
|
|
|
5334
5256
|
className: cn("text-agg-error", className),
|
|
5335
5257
|
"aria-hidden": "true",
|
|
5336
5258
|
children: [
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5338
|
-
/* @__PURE__ */ (0,
|
|
5339
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" }),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { d: "M8 4.16699V8.50033", stroke: "white", strokeWidth: "1.4", strokeLinecap: "round" }),
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("circle", { cx: "8", cy: "11.167", r: "0.833333", fill: "white" })
|
|
5340
5262
|
]
|
|
5341
5263
|
}
|
|
5342
5264
|
);
|
|
@@ -5383,17 +5305,17 @@ var getStatusContent = ({
|
|
|
5383
5305
|
if (!status || status.placement !== placement)
|
|
5384
5306
|
return null;
|
|
5385
5307
|
if (status.tone === "warning") {
|
|
5386
|
-
return /* @__PURE__ */ (0,
|
|
5387
|
-
/* @__PURE__ */ (0,
|
|
5388
|
-
/* @__PURE__ */ (0,
|
|
5308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-center gap-2", children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(WarningFilledIcon2, { className: "h-4 w-4 shrink-0" }),
|
|
5310
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: status.message })
|
|
5389
5311
|
] });
|
|
5390
5312
|
}
|
|
5391
|
-
return /* @__PURE__ */ (0,
|
|
5392
|
-
/* @__PURE__ */ (0,
|
|
5393
|
-
/* @__PURE__ */ (0,
|
|
5394
|
-
/* @__PURE__ */ (0,
|
|
5313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-3 rounded-agg-lg bg-agg-status-error-surface px-3 py-2.5", children: [
|
|
5314
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
5315
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ErrorFilledIcon, { className: "h-4 w-4 shrink-0" }),
|
|
5316
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "min-w-0 flex-1 text-agg-sm leading-agg-5 text-agg-foreground", children: status.message })
|
|
5395
5317
|
] }),
|
|
5396
|
-
status.actionLabel ? /* @__PURE__ */ (0,
|
|
5318
|
+
status.actionLabel ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5397
5319
|
"button",
|
|
5398
5320
|
{
|
|
5399
5321
|
type: "button",
|
|
@@ -5431,11 +5353,11 @@ var PlaceOrder = ({
|
|
|
5431
5353
|
onStatusAction,
|
|
5432
5354
|
onTabChange
|
|
5433
5355
|
}) => {
|
|
5434
|
-
const { enableAnimations } = (0,
|
|
5435
|
-
const labels = (0,
|
|
5356
|
+
const { enableAnimations } = (0, import_hooks18.useSdkUiConfig)();
|
|
5357
|
+
const labels = (0, import_hooks18.useLabels)();
|
|
5436
5358
|
const resolvedDisclaimer = disclaimer === defaultTradingDisclaimer ? labels.trading.disclaimer : disclaimer;
|
|
5437
5359
|
if (isLoading) {
|
|
5438
|
-
return /* @__PURE__ */ (0,
|
|
5360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5439
5361
|
Skeleton,
|
|
5440
5362
|
{
|
|
5441
5363
|
ariaLabel: labels.common.loading,
|
|
@@ -5474,7 +5396,7 @@ var PlaceOrder = ({
|
|
|
5474
5396
|
}
|
|
5475
5397
|
onOutcomeChange == null ? void 0 : onOutcomeChange(nextOutcomeId);
|
|
5476
5398
|
};
|
|
5477
|
-
const actionButton = /* @__PURE__ */ (0,
|
|
5399
|
+
const actionButton = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5478
5400
|
Button,
|
|
5479
5401
|
{
|
|
5480
5402
|
size: "large",
|
|
@@ -5486,11 +5408,11 @@ var PlaceOrder = ({
|
|
|
5486
5408
|
children: actionLabel
|
|
5487
5409
|
}
|
|
5488
5410
|
);
|
|
5489
|
-
const contentBody = /* @__PURE__ */ (0,
|
|
5490
|
-
/* @__PURE__ */ (0,
|
|
5491
|
-
/* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
marketImageUrl ? /* @__PURE__ */ (0,
|
|
5411
|
+
const contentBody = /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
|
|
5412
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
5415
|
+
marketImageUrl ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5494
5416
|
"img",
|
|
5495
5417
|
{
|
|
5496
5418
|
src: marketImageUrl,
|
|
@@ -5498,16 +5420,16 @@ var PlaceOrder = ({
|
|
|
5498
5420
|
className: "h-12 w-12 shrink-0 rounded-agg-lg object-cover"
|
|
5499
5421
|
}
|
|
5500
5422
|
) : null,
|
|
5501
|
-
/* @__PURE__ */ (0,
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "min-w-0 text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: title })
|
|
5502
5424
|
] }),
|
|
5503
|
-
isDismissible ? /* @__PURE__ */ (0,
|
|
5425
|
+
isDismissible ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5504
5426
|
"button",
|
|
5505
5427
|
{
|
|
5506
5428
|
type: "button",
|
|
5507
5429
|
"aria-label": labels.common.close,
|
|
5508
5430
|
className: "shrink-0 text-agg-foreground",
|
|
5509
5431
|
onClick: onClose,
|
|
5510
|
-
children: /* @__PURE__ */ (0,
|
|
5432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5511
5433
|
Icon,
|
|
5512
5434
|
{
|
|
5513
5435
|
name: "close",
|
|
@@ -5519,9 +5441,9 @@ var PlaceOrder = ({
|
|
|
5519
5441
|
}
|
|
5520
5442
|
) : null
|
|
5521
5443
|
] }),
|
|
5522
|
-
/* @__PURE__ */ (0,
|
|
5444
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: dateLabel })
|
|
5523
5445
|
] }),
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5446
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5525
5447
|
Tabs,
|
|
5526
5448
|
{
|
|
5527
5449
|
ariaLabel: labels.common.tabsAria,
|
|
@@ -5537,11 +5459,11 @@ var PlaceOrder = ({
|
|
|
5537
5459
|
}
|
|
5538
5460
|
}
|
|
5539
5461
|
),
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5541
|
-
/* @__PURE__ */ (0,
|
|
5462
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
5463
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome, index) => {
|
|
5542
5464
|
const isActive = outcome.id === resolvedOutcomeId;
|
|
5543
5465
|
const isPositive = resolveIsPositiveOutcome(outcome, index);
|
|
5544
|
-
return /* @__PURE__ */ (0,
|
|
5466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5545
5467
|
"button",
|
|
5546
5468
|
{
|
|
5547
5469
|
type: "button",
|
|
@@ -5558,16 +5480,16 @@ var PlaceOrder = ({
|
|
|
5558
5480
|
outcome.id
|
|
5559
5481
|
);
|
|
5560
5482
|
}) }),
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
5562
|
-
/* @__PURE__ */ (0,
|
|
5563
|
-
/* @__PURE__ */ (0,
|
|
5564
|
-
/* @__PURE__ */ (0,
|
|
5483
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col", children: [
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: primaryMetric.label }),
|
|
5486
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: primaryMetric.hint })
|
|
5565
5487
|
] }),
|
|
5566
|
-
/* @__PURE__ */ (0,
|
|
5488
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-3xl font-agg-bold leading-agg-9 text-agg-foreground", children: primaryMetric.value })
|
|
5567
5489
|
] })
|
|
5568
5490
|
] }),
|
|
5569
|
-
/* @__PURE__ */ (0,
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
5491
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5492
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5571
5493
|
"div",
|
|
5572
5494
|
{
|
|
5573
5495
|
className: cn(
|
|
@@ -5575,7 +5497,7 @@ var PlaceOrder = ({
|
|
|
5575
5497
|
getRoutingCardClassName(hasHighlightedRouting)
|
|
5576
5498
|
),
|
|
5577
5499
|
children: [
|
|
5578
|
-
/* @__PURE__ */ (0,
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5579
5501
|
"div",
|
|
5580
5502
|
{
|
|
5581
5503
|
className: cn(
|
|
@@ -5584,11 +5506,11 @@ var PlaceOrder = ({
|
|
|
5584
5506
|
)
|
|
5585
5507
|
}
|
|
5586
5508
|
),
|
|
5587
|
-
/* @__PURE__ */ (0,
|
|
5588
|
-
routing.rows.map((row, index) => /* @__PURE__ */ (0,
|
|
5589
|
-
/* @__PURE__ */ (0,
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5509
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "relative flex flex-col gap-3", children: [
|
|
5510
|
+
routing.rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
5511
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
5512
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5592
5514
|
VenueLogo,
|
|
5593
5515
|
{
|
|
5594
5516
|
venue: row.venue,
|
|
@@ -5596,11 +5518,11 @@ var PlaceOrder = ({
|
|
|
5596
5518
|
ariaLabel: getTradingVenueLabel(row.venue)
|
|
5597
5519
|
}
|
|
5598
5520
|
),
|
|
5599
|
-
/* @__PURE__ */ (0,
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "truncate text-agg-base leading-agg-6 text-agg-foreground", children: row.label })
|
|
5600
5522
|
] }),
|
|
5601
|
-
/* @__PURE__ */ (0,
|
|
5523
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "shrink-0 text-agg-base leading-agg-6 text-agg-foreground", children: row.priceLabel })
|
|
5602
5524
|
] }),
|
|
5603
|
-
index < routing.rows.length - 1 ? /* @__PURE__ */ (0,
|
|
5525
|
+
index < routing.rows.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5604
5526
|
"div",
|
|
5605
5527
|
{
|
|
5606
5528
|
className: cn(
|
|
@@ -5610,19 +5532,19 @@ var PlaceOrder = ({
|
|
|
5610
5532
|
}
|
|
5611
5533
|
) : null
|
|
5612
5534
|
] }, `${row.venue}-${row.label}`)),
|
|
5613
|
-
routing.highlightLabel ? /* @__PURE__ */ (0,
|
|
5535
|
+
routing.highlightLabel ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-center text-agg-sm font-agg-bold leading-agg-5 uppercase text-agg-trade-highlight-accent", children: routing.highlightLabel }) : null
|
|
5614
5536
|
] })
|
|
5615
5537
|
]
|
|
5616
5538
|
}
|
|
5617
5539
|
),
|
|
5618
|
-
/* @__PURE__ */ (0,
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: routing.helperLabel })
|
|
5619
5541
|
] }),
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
/* @__PURE__ */ (0,
|
|
5622
|
-
/* @__PURE__ */ (0,
|
|
5623
|
-
/* @__PURE__ */ (0,
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
5543
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col", children: [
|
|
5544
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: result.label }),
|
|
5545
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: result.hint })
|
|
5624
5546
|
] }),
|
|
5625
|
-
/* @__PURE__ */ (0,
|
|
5547
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5626
5548
|
"p",
|
|
5627
5549
|
{
|
|
5628
5550
|
className: cn(
|
|
@@ -5633,7 +5555,7 @@ var PlaceOrder = ({
|
|
|
5633
5555
|
}
|
|
5634
5556
|
)
|
|
5635
5557
|
] }),
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5558
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
5637
5559
|
getStatusContent({
|
|
5638
5560
|
placement: "above-action",
|
|
5639
5561
|
status,
|
|
@@ -5646,16 +5568,16 @@ var PlaceOrder = ({
|
|
|
5646
5568
|
onStatusAction
|
|
5647
5569
|
})
|
|
5648
5570
|
] }),
|
|
5649
|
-
/* @__PURE__ */ (0,
|
|
5571
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: resolvedDisclaimer })
|
|
5650
5572
|
] });
|
|
5651
|
-
return /* @__PURE__ */ (0,
|
|
5573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Card, { className: cn(getPlaceOrderContainerClassName(), className), children: contentBody });
|
|
5652
5574
|
};
|
|
5653
5575
|
PlaceOrder.displayName = "PlaceOrder";
|
|
5654
5576
|
|
|
5655
5577
|
// src/trading/settlement/index.tsx
|
|
5656
5578
|
var import_react8 = require("react");
|
|
5657
|
-
var
|
|
5658
|
-
var
|
|
5579
|
+
var import_hooks19 = require("@agg-market/hooks");
|
|
5580
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5659
5581
|
var getSettlementHeaderClassName = () => {
|
|
5660
5582
|
return "flex items-center justify-between gap-4";
|
|
5661
5583
|
};
|
|
@@ -5673,8 +5595,8 @@ var Settlement = ({
|
|
|
5673
5595
|
className
|
|
5674
5596
|
}) => {
|
|
5675
5597
|
var _a, _b;
|
|
5676
|
-
const labels = (0,
|
|
5677
|
-
const { enableAnimations } = (0,
|
|
5598
|
+
const labels = (0, import_hooks19.useLabels)();
|
|
5599
|
+
const { enableAnimations } = (0, import_hooks19.useSdkUiConfig)();
|
|
5678
5600
|
const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
|
|
5679
5601
|
const resolvedDifferencesTitle = differencesTitle === defaultSettlementDifferencesTitle ? labels.trading.settlementDifferencesTitle : differencesTitle;
|
|
5680
5602
|
const [internalExpandedVenue, setInternalExpandedVenue] = (0, import_react8.useState)(
|
|
@@ -5847,7 +5769,7 @@ var Settlement = ({
|
|
|
5847
5769
|
onShowMore == null ? void 0 : onShowMore(venue);
|
|
5848
5770
|
};
|
|
5849
5771
|
if (isLoading) {
|
|
5850
|
-
return /* @__PURE__ */ (0,
|
|
5772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5851
5773
|
Skeleton,
|
|
5852
5774
|
{
|
|
5853
5775
|
ariaLabel: labels.trading.settlementLoading,
|
|
@@ -5856,7 +5778,7 @@ var Settlement = ({
|
|
|
5856
5778
|
}
|
|
5857
5779
|
);
|
|
5858
5780
|
}
|
|
5859
|
-
return /* @__PURE__ */ (0,
|
|
5781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5860
5782
|
Card,
|
|
5861
5783
|
{
|
|
5862
5784
|
className: cn(
|
|
@@ -5864,16 +5786,16 @@ var Settlement = ({
|
|
|
5864
5786
|
className
|
|
5865
5787
|
),
|
|
5866
5788
|
children: [
|
|
5867
|
-
/* @__PURE__ */ (0,
|
|
5868
|
-
/* @__PURE__ */ (0,
|
|
5869
|
-
/* @__PURE__ */ (0,
|
|
5789
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: getSettlementHeaderClassName(), children: [
|
|
5790
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-agg-xs font-agg-bold leading-agg-4 uppercase text-agg-muted-foreground", children: resolvedSectionLabel }),
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: question })
|
|
5870
5792
|
] }),
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
5872
|
-
/* @__PURE__ */ (0,
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5793
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: resolvedDifferencesTitle }),
|
|
5795
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("ul", { className: "list-disc pl-5 text-agg-sm leading-agg-5 text-agg-foreground", children: differences.map((difference) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("li", { children: difference }, difference)) })
|
|
5874
5796
|
] }),
|
|
5875
|
-
/* @__PURE__ */ (0,
|
|
5876
|
-
/* @__PURE__ */ (0,
|
|
5797
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex flex-col gap-3", children: venues.map((venue) => {
|
|
5877
5799
|
var _a2, _b2;
|
|
5878
5800
|
const venueLabel = getTradingVenueLabel(venue.venue, venue.label);
|
|
5879
5801
|
const isExpanded = resolvedExpandedVenue === venue.venue;
|
|
@@ -5881,8 +5803,8 @@ var Settlement = ({
|
|
|
5881
5803
|
const isDescriptionOverflowing = !!overflowingDescriptionByVenue[venue.venue];
|
|
5882
5804
|
const shouldShowDescriptionCta = isExpanded && isDescriptionOverflowing && !isDescriptionExpanded;
|
|
5883
5805
|
const resolvedShowMoreLabel = (_a2 = venue.showMoreLabel) != null ? _a2 : "Show more";
|
|
5884
|
-
return /* @__PURE__ */ (0,
|
|
5885
|
-
/* @__PURE__ */ (0,
|
|
5806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col", children: [
|
|
5807
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5886
5808
|
"button",
|
|
5887
5809
|
{
|
|
5888
5810
|
type: "button",
|
|
@@ -5898,7 +5820,7 @@ var Settlement = ({
|
|
|
5898
5820
|
"aria-label": labels.trading.settlementDetailsAria(venueLabel),
|
|
5899
5821
|
onClick: () => handleVenueClick(venue.venue),
|
|
5900
5822
|
children: [
|
|
5901
|
-
/* @__PURE__ */ (0,
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5902
5824
|
VenueLogo,
|
|
5903
5825
|
{
|
|
5904
5826
|
venue: venue.venue,
|
|
@@ -5906,7 +5828,7 @@ var Settlement = ({
|
|
|
5906
5828
|
ariaLabel: venueLabel
|
|
5907
5829
|
}
|
|
5908
5830
|
),
|
|
5909
|
-
/* @__PURE__ */ (0,
|
|
5831
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5910
5832
|
"span",
|
|
5911
5833
|
{
|
|
5912
5834
|
className: cn(
|
|
@@ -5916,7 +5838,7 @@ var Settlement = ({
|
|
|
5916
5838
|
children: venueLabel
|
|
5917
5839
|
}
|
|
5918
5840
|
),
|
|
5919
|
-
/* @__PURE__ */ (0,
|
|
5841
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5920
5842
|
Icon,
|
|
5921
5843
|
{
|
|
5922
5844
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -5928,7 +5850,7 @@ var Settlement = ({
|
|
|
5928
5850
|
]
|
|
5929
5851
|
}
|
|
5930
5852
|
),
|
|
5931
|
-
/* @__PURE__ */ (0,
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5932
5854
|
"div",
|
|
5933
5855
|
{
|
|
5934
5856
|
"aria-hidden": !isExpanded,
|
|
@@ -5941,17 +5863,17 @@ var Settlement = ({
|
|
|
5941
5863
|
"transition-[grid-template-rows,opacity,margin-top] duration-300 ease-in-out"
|
|
5942
5864
|
)
|
|
5943
5865
|
),
|
|
5944
|
-
children: /* @__PURE__ */ (0,
|
|
5866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5945
5867
|
"div",
|
|
5946
5868
|
{
|
|
5947
5869
|
ref: (element) => handleDescriptionWrapperRef(venue.venue, element),
|
|
5948
5870
|
className: "relative min-h-0",
|
|
5949
5871
|
children: [
|
|
5950
|
-
/* @__PURE__ */ (0,
|
|
5872
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("p", { className: "min-h-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
5951
5873
|
isDescriptionExpanded || !isDescriptionOverflowing ? venue.description : (_b2 = collapsedDescriptionByVenue[venue.venue]) != null ? _b2 : venue.description,
|
|
5952
|
-
shouldShowDescriptionCta ? /* @__PURE__ */ (0,
|
|
5874
|
+
shouldShowDescriptionCta ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
5953
5875
|
"... ",
|
|
5954
|
-
/* @__PURE__ */ (0,
|
|
5876
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5955
5877
|
"button",
|
|
5956
5878
|
{
|
|
5957
5879
|
type: "button",
|
|
@@ -5974,7 +5896,7 @@ var Settlement = ({
|
|
|
5974
5896
|
)
|
|
5975
5897
|
] }) : null
|
|
5976
5898
|
] }),
|
|
5977
|
-
/* @__PURE__ */ (0,
|
|
5899
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5978
5900
|
"p",
|
|
5979
5901
|
{
|
|
5980
5902
|
ref: (element) => handleDescriptionMeasureRef(venue.venue, element),
|
|
@@ -5996,7 +5918,7 @@ var Settlement = ({
|
|
|
5996
5918
|
Settlement.displayName = "Settlement";
|
|
5997
5919
|
|
|
5998
5920
|
// src/pages/event-market/index.tsx
|
|
5999
|
-
var
|
|
5921
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6000
5922
|
var getMarketDateValue = (market, fallbackIndex) => {
|
|
6001
5923
|
var _a, _b, _c;
|
|
6002
5924
|
const candidateDate = (_c = (_b = (_a = market.endDate) != null ? _a : market.startDate) != null ? _b : market.creationDate) != null ? _c : null;
|
|
@@ -6055,16 +5977,16 @@ var resolveInitialExpandedMarketId = (detailedMarkets, defaultExpandedMarketId)
|
|
|
6055
5977
|
var EventMarketPageUnavailableState = ({
|
|
6056
5978
|
ariaLabel
|
|
6057
5979
|
}) => {
|
|
6058
|
-
const labels = (0,
|
|
6059
|
-
return /* @__PURE__ */ (0,
|
|
5980
|
+
const labels = (0, import_hooks20.useLabels)();
|
|
5981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6060
5982
|
Card,
|
|
6061
5983
|
{
|
|
6062
5984
|
className: "rounded-agg-xl border border-agg-separator bg-agg-secondary p-6 shadow-none hover:shadow-none",
|
|
6063
5985
|
role: "status",
|
|
6064
5986
|
"aria-label": ariaLabel != null ? ariaLabel : labels.eventMarketPage.unavailableAria,
|
|
6065
|
-
children: /* @__PURE__ */ (0,
|
|
6066
|
-
/* @__PURE__ */ (0,
|
|
6067
|
-
/* @__PURE__ */ (0,
|
|
5987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5988
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Typography, { variant: "body-large-strong", children: labels.eventMarketPage.unavailableTitle }),
|
|
5989
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.eventMarketPage.unavailableDescription })
|
|
6068
5990
|
] })
|
|
6069
5991
|
}
|
|
6070
5992
|
);
|
|
@@ -6074,7 +5996,7 @@ var EventMarketPageLoadingState = ({
|
|
|
6074
5996
|
settlement,
|
|
6075
5997
|
classNames
|
|
6076
5998
|
}) => {
|
|
6077
|
-
const labels = (0,
|
|
5999
|
+
const labels = (0, import_hooks20.useLabels)();
|
|
6078
6000
|
const fallbackSettlement = settlement != null ? settlement : {
|
|
6079
6001
|
sectionLabel: labels.trading.settlementSection,
|
|
6080
6002
|
question: labels.eventMarketPage.loadingSettlementQuestion,
|
|
@@ -6087,7 +6009,7 @@ var EventMarketPageLoadingState = ({
|
|
|
6087
6009
|
}
|
|
6088
6010
|
]
|
|
6089
6011
|
};
|
|
6090
|
-
return /* @__PURE__ */ (0,
|
|
6012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("section", { className: cn("w-full", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
6091
6013
|
"div",
|
|
6092
6014
|
{
|
|
6093
6015
|
className: cn(
|
|
@@ -6095,8 +6017,8 @@ var EventMarketPageLoadingState = ({
|
|
|
6095
6017
|
classNames == null ? void 0 : classNames.content
|
|
6096
6018
|
),
|
|
6097
6019
|
children: [
|
|
6098
|
-
/* @__PURE__ */ (0,
|
|
6099
|
-
/* @__PURE__ */ (0,
|
|
6020
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-6", classNames == null ? void 0 : classNames.main), children: [
|
|
6021
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6100
6022
|
EventListItemDetails,
|
|
6101
6023
|
{
|
|
6102
6024
|
isLoading: true,
|
|
@@ -6105,23 +6027,23 @@ var EventMarketPageLoadingState = ({
|
|
|
6105
6027
|
}
|
|
6106
6028
|
}
|
|
6107
6029
|
),
|
|
6108
|
-
/* @__PURE__ */ (0,
|
|
6109
|
-
/* @__PURE__ */ (0,
|
|
6110
|
-
/* @__PURE__ */ (0,
|
|
6111
|
-
/* @__PURE__ */ (0,
|
|
6030
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.markets), children: [
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(MarketDetails, { isLoading: true, isOpened: true, classNames: { root: "w-full" } }),
|
|
6032
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(MarketDetails, { isLoading: true, isOpened: false, classNames: { root: "w-full" } }),
|
|
6033
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(MarketDetails, { isLoading: true, isOpened: false, classNames: { root: "w-full" } })
|
|
6112
6034
|
] }),
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
6114
|
-
/* @__PURE__ */ (0,
|
|
6115
|
-
placeOrder ? /* @__PURE__ */ (0,
|
|
6035
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Settlement, __spreadProps(__spreadValues({}, fallbackSettlement), { isLoading: true, className: classNames == null ? void 0 : classNames.settlement })) }),
|
|
6036
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Settlement, __spreadProps(__spreadValues({}, fallbackSettlement), { isLoading: true, className: classNames == null ? void 0 : classNames.settlement })) }),
|
|
6037
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PlaceOrder, __spreadProps(__spreadValues({}, placeOrder), { isLoading: true, className: classNames == null ? void 0 : classNames.mobileTrade })) }) : null
|
|
6116
6038
|
] }),
|
|
6117
|
-
placeOrder ? /* @__PURE__ */ (0,
|
|
6039
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6118
6040
|
"aside",
|
|
6119
6041
|
{
|
|
6120
6042
|
className: cn(
|
|
6121
6043
|
"hidden w-full shrink-0 lg:sticky lg:top-6 lg:block lg:w-[343px]",
|
|
6122
6044
|
classNames == null ? void 0 : classNames.sidebar
|
|
6123
6045
|
),
|
|
6124
|
-
children: /* @__PURE__ */ (0,
|
|
6046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PlaceOrder, __spreadProps(__spreadValues({}, placeOrder), { isLoading: true, className: classNames == null ? void 0 : classNames.trade }))
|
|
6125
6047
|
}
|
|
6126
6048
|
) : null
|
|
6127
6049
|
]
|
|
@@ -6140,7 +6062,7 @@ var EventMarketPageContent = ({
|
|
|
6140
6062
|
classNames,
|
|
6141
6063
|
ariaLabel
|
|
6142
6064
|
}) => {
|
|
6143
|
-
const labels = (0,
|
|
6065
|
+
const labels = (0, import_hooks20.useLabels)();
|
|
6144
6066
|
const resolvedHeroMarketId = (0, import_react9.useMemo)(() => {
|
|
6145
6067
|
return resolveHeroMarketId(event, heroMarketId);
|
|
6146
6068
|
}, [event, heroMarketId]);
|
|
@@ -6177,9 +6099,9 @@ var EventMarketPageContent = ({
|
|
|
6177
6099
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(nextExpandedMarketId);
|
|
6178
6100
|
};
|
|
6179
6101
|
if (!heroEvent || !event.markets.length) {
|
|
6180
|
-
return /* @__PURE__ */ (0,
|
|
6102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventMarketPageUnavailableState, { ariaLabel });
|
|
6181
6103
|
}
|
|
6182
|
-
return /* @__PURE__ */ (0,
|
|
6104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("section", { className: cn("w-full", classNames == null ? void 0 : classNames.root), "aria-label": ariaLabel != null ? ariaLabel : event.title, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
6183
6105
|
"div",
|
|
6184
6106
|
{
|
|
6185
6107
|
className: cn(
|
|
@@ -6187,8 +6109,8 @@ var EventMarketPageContent = ({
|
|
|
6187
6109
|
classNames == null ? void 0 : classNames.content
|
|
6188
6110
|
),
|
|
6189
6111
|
children: [
|
|
6190
|
-
/* @__PURE__ */ (0,
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: cn("flex min-w-0 flex-1 flex-col gap-6", classNames == null ? void 0 : classNames.main), children: [
|
|
6113
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6192
6114
|
EventListItemDetails,
|
|
6193
6115
|
{
|
|
6194
6116
|
event: heroEvent,
|
|
@@ -6198,9 +6120,9 @@ var EventMarketPageContent = ({
|
|
|
6198
6120
|
}
|
|
6199
6121
|
}
|
|
6200
6122
|
),
|
|
6201
|
-
detailedMarkets.length > 0 ? /* @__PURE__ */ (0,
|
|
6123
|
+
detailedMarkets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: cn("flex flex-col gap-3", classNames == null ? void 0 : classNames.markets), children: detailedMarkets.map((market) => {
|
|
6202
6124
|
const isOpened = resolvedExpandedMarketId === market.id;
|
|
6203
|
-
return /* @__PURE__ */ (0,
|
|
6125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6204
6126
|
MarketDetails,
|
|
6205
6127
|
{
|
|
6206
6128
|
event,
|
|
@@ -6215,30 +6137,30 @@ var EventMarketPageContent = ({
|
|
|
6215
6137
|
market.id
|
|
6216
6138
|
);
|
|
6217
6139
|
}) }) : null,
|
|
6218
|
-
settlement ? /* @__PURE__ */ (0,
|
|
6219
|
-
settlement ? /* @__PURE__ */ (0,
|
|
6140
|
+
settlement ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Settlement, __spreadProps(__spreadValues({}, settlement), { className: classNames == null ? void 0 : classNames.settlement })) }) : null,
|
|
6141
|
+
settlement ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Settlement, __spreadProps(__spreadValues({}, settlement), { className: classNames == null ? void 0 : classNames.settlement })) }) : null
|
|
6220
6142
|
] }),
|
|
6221
|
-
placeOrder ? /* @__PURE__ */ (0,
|
|
6143
|
+
placeOrder ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("aside", { className: cn("w-full lg:block lg:max-w-[360px]", classNames == null ? void 0 : classNames.sidebar), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PlaceOrder, __spreadProps(__spreadValues({}, placeOrder), { className: classNames == null ? void 0 : classNames.trade })) }) : null
|
|
6222
6144
|
]
|
|
6223
6145
|
}
|
|
6224
6146
|
) });
|
|
6225
6147
|
};
|
|
6226
6148
|
var EventMarketPage = (props) => {
|
|
6227
6149
|
const hasEventProp = "event" in props && !!props.event;
|
|
6228
|
-
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0,
|
|
6150
|
+
const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks20.useEvent)(
|
|
6229
6151
|
hasEventProp ? void 0 : props.eventId,
|
|
6230
6152
|
{
|
|
6231
6153
|
enabled: !props.isLoading && !hasEventProp && !!props.eventId
|
|
6232
6154
|
}
|
|
6233
6155
|
);
|
|
6234
6156
|
if (props.isLoading) {
|
|
6235
|
-
return /* @__PURE__ */ (0,
|
|
6157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventMarketPageLoadingState, { placeOrder: props.placeOrder, settlement: props.settlement });
|
|
6236
6158
|
}
|
|
6237
6159
|
if ("event" in props && props.event) {
|
|
6238
|
-
return /* @__PURE__ */ (0,
|
|
6160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventMarketPageContent, __spreadProps(__spreadValues({}, props), { event: props.event }));
|
|
6239
6161
|
}
|
|
6240
6162
|
if (isFetchingEvent) {
|
|
6241
|
-
return /* @__PURE__ */ (0,
|
|
6163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6242
6164
|
EventMarketPageLoadingState,
|
|
6243
6165
|
{
|
|
6244
6166
|
placeOrder: props.placeOrder,
|
|
@@ -6248,9 +6170,9 @@ var EventMarketPage = (props) => {
|
|
|
6248
6170
|
);
|
|
6249
6171
|
}
|
|
6250
6172
|
if (!fetchedEvent) {
|
|
6251
|
-
return /* @__PURE__ */ (0,
|
|
6173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventMarketPageUnavailableState, { ariaLabel: props.ariaLabel });
|
|
6252
6174
|
}
|
|
6253
|
-
return /* @__PURE__ */ (0,
|
|
6175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventMarketPageContent, __spreadProps(__spreadValues({}, props), { event: fetchedEvent }));
|
|
6254
6176
|
};
|
|
6255
6177
|
EventMarketPage.displayName = "EventMarketPage";
|
|
6256
6178
|
// Annotate the CommonJS export names for ESM import in node:
|