@agg-build/ui 2.7.3 → 2.8.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/{chunk-MZBYIXYA.mjs → chunk-2QCNDFNC.mjs} +193 -103
- package/dist/{chunk-EDQ64EKO.mjs → chunk-AKLGQ6AB.mjs} +254 -53
- package/dist/{chunk-FMYYPNZZ.mjs → chunk-KO6VTRV6.mjs} +101 -27
- package/dist/{chunk-AHQA3B7D.mjs → chunk-KX3TQ7WC.mjs} +1 -1
- package/dist/{chunk-7DM45TMO.mjs → chunk-MKU5Q6PN.mjs} +21 -13
- package/dist/{chunk-O27JUYCF.mjs → chunk-R5S2QOYL.mjs} +495 -289
- package/dist/{chunk-JQKJDSTW.mjs → chunk-VR5ZRDQT.mjs} +3 -2
- package/dist/events.js +168 -91
- package/dist/events.mjs +3 -3
- package/dist/index.js +1315 -746
- package/dist/index.mjs +7 -7
- package/dist/modals.js +941 -418
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +978 -609
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +94 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1403 -902
- package/dist/trading.mjs +4 -4
- package/dist/types/events/orderbook/orderbook.utils.d.mts +1 -1
- package/dist/types/events/orderbook/orderbook.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +15 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +15 -4
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +8 -0
- package/dist/types/primitives/select/select.types.d.ts +8 -0
- package/dist/types/profile/profile-modal.constants.d.mts +2 -1
- package/dist/types/profile/profile-modal.constants.d.ts +2 -1
- package/dist/types/profile/tabs/balance-management-tab.d.mts +3 -0
- package/dist/types/profile/tabs/balance-management-tab.d.ts +3 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +10 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +10 -2
- package/package.json +3 -3
package/dist/events.js
CHANGED
|
@@ -6321,7 +6321,11 @@ var Select = ({
|
|
|
6321
6321
|
triggerClassName,
|
|
6322
6322
|
contentClassName,
|
|
6323
6323
|
itemClassName,
|
|
6324
|
-
disabled = SELECT_DEFAULT_IS_DISABLED
|
|
6324
|
+
disabled = SELECT_DEFAULT_IS_DISABLED,
|
|
6325
|
+
variant = "default",
|
|
6326
|
+
openOnHover = false,
|
|
6327
|
+
contentAlign = "start",
|
|
6328
|
+
contentSideOffset = 8
|
|
6325
6329
|
}) => {
|
|
6326
6330
|
var _a;
|
|
6327
6331
|
const labels = (0, import_hooks27.useLabels)();
|
|
@@ -6332,17 +6336,30 @@ var Select = ({
|
|
|
6332
6336
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
6333
6337
|
const selectedItem = resolveSelectedItem(items, value);
|
|
6334
6338
|
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
6335
|
-
const [menuRect, setMenuRect] = (0, import_react5.useState)(
|
|
6336
|
-
null
|
|
6337
|
-
);
|
|
6339
|
+
const [menuRect, setMenuRect] = (0, import_react5.useState)(null);
|
|
6338
6340
|
const containerRef = (0, import_react5.useRef)(null);
|
|
6339
6341
|
const portalRef = (0, import_react5.useRef)(null);
|
|
6340
|
-
const
|
|
6342
|
+
const closeTimerRef = (0, import_react5.useRef)(null);
|
|
6343
|
+
const openedByHoverRef = (0, import_react5.useRef)(false);
|
|
6344
|
+
const handleClose = (0, import_react5.useCallback)(() => {
|
|
6345
|
+
setIsOpen(false);
|
|
6346
|
+
openedByHoverRef.current = false;
|
|
6347
|
+
}, []);
|
|
6341
6348
|
const updateMenuRect = (0, import_react5.useCallback)(() => {
|
|
6342
6349
|
const el = containerRef.current;
|
|
6343
6350
|
if (!el) return;
|
|
6344
6351
|
const r = el.getBoundingClientRect();
|
|
6345
|
-
setMenuRect({
|
|
6352
|
+
setMenuRect({
|
|
6353
|
+
top: r.bottom + contentSideOffset,
|
|
6354
|
+
left: r.left,
|
|
6355
|
+
right: r.right,
|
|
6356
|
+
width: r.width
|
|
6357
|
+
});
|
|
6358
|
+
}, [contentSideOffset]);
|
|
6359
|
+
(0, import_react5.useEffect)(() => {
|
|
6360
|
+
return () => {
|
|
6361
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6362
|
+
};
|
|
6346
6363
|
}, []);
|
|
6347
6364
|
(0, import_react5.useLayoutEffect)(() => {
|
|
6348
6365
|
if (!isOpen) {
|
|
@@ -6380,7 +6397,33 @@ var Select = ({
|
|
|
6380
6397
|
document.addEventListener("keydown", handleKeyDown);
|
|
6381
6398
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
6382
6399
|
}, [isOpen, handleClose]);
|
|
6383
|
-
const
|
|
6400
|
+
const handlePointerEnter = (event) => {
|
|
6401
|
+
if (!openOnHover || isDisabled || event.pointerType === "touch") return;
|
|
6402
|
+
if (closeTimerRef.current) {
|
|
6403
|
+
clearTimeout(closeTimerRef.current);
|
|
6404
|
+
closeTimerRef.current = null;
|
|
6405
|
+
}
|
|
6406
|
+
if (isOpen) return;
|
|
6407
|
+
openedByHoverRef.current = true;
|
|
6408
|
+
setIsOpen(true);
|
|
6409
|
+
};
|
|
6410
|
+
const handlePointerLeave = (event) => {
|
|
6411
|
+
if (!openOnHover || event.pointerType === "touch") return;
|
|
6412
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
6413
|
+
closeTimerRef.current = setTimeout(() => {
|
|
6414
|
+
handleClose();
|
|
6415
|
+
closeTimerRef.current = null;
|
|
6416
|
+
}, 120);
|
|
6417
|
+
};
|
|
6418
|
+
const handleTriggerClick = () => {
|
|
6419
|
+
if (openedByHoverRef.current && isOpen) {
|
|
6420
|
+
openedByHoverRef.current = false;
|
|
6421
|
+
return;
|
|
6422
|
+
}
|
|
6423
|
+
setIsOpen((previousValue) => !previousValue);
|
|
6424
|
+
};
|
|
6425
|
+
const isInline = variant === "inline";
|
|
6426
|
+
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
6384
6427
|
const listbox = menuRect ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6385
6428
|
"div",
|
|
6386
6429
|
{
|
|
@@ -6391,16 +6434,20 @@ var Select = ({
|
|
|
6391
6434
|
style: {
|
|
6392
6435
|
position: "fixed",
|
|
6393
6436
|
top: menuRect.top,
|
|
6394
|
-
left: menuRect.left,
|
|
6437
|
+
left: contentAlign === "start" ? menuRect.left : void 0,
|
|
6438
|
+
right: contentAlign === "end" ? window.innerWidth - menuRect.right : void 0,
|
|
6395
6439
|
width: menuRect.width,
|
|
6396
6440
|
zIndex: SELECT_DROPDOWN_Z
|
|
6397
6441
|
},
|
|
6398
6442
|
className: cn(
|
|
6399
6443
|
AGG_ROOT_CLASS_NAME,
|
|
6400
6444
|
rootClassName,
|
|
6401
|
-
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto
|
|
6445
|
+
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto border border-agg-separator bg-agg-secondary flex flex-col",
|
|
6446
|
+
isInline ? "min-w-[120px] gap-0 rounded-agg-lg py-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]" : "gap-1 rounded-[12px] p-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]",
|
|
6402
6447
|
contentClassName
|
|
6403
6448
|
),
|
|
6449
|
+
onPointerEnter: handlePointerEnter,
|
|
6450
|
+
onPointerLeave: handlePointerLeave,
|
|
6404
6451
|
children: items.map((item) => {
|
|
6405
6452
|
const isSelected = item.value === value;
|
|
6406
6453
|
const isHidden = item.hidden === true;
|
|
@@ -6414,9 +6461,10 @@ var Select = ({
|
|
|
6414
6461
|
disabled: item.disabled,
|
|
6415
6462
|
className: cn(
|
|
6416
6463
|
"agg-select-item",
|
|
6417
|
-
"relative flex w-full items-center
|
|
6464
|
+
"relative flex w-full items-center text-left text-agg-sm leading-agg-5 outline-none",
|
|
6465
|
+
isInline ? "gap-2 px-4 py-2" : "gap-3 rounded-[6px] py-3 pl-3 pr-5",
|
|
6418
6466
|
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
6419
|
-
isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6467
|
+
isSelected ? isInline ? "font-agg-bold text-agg-foreground" : "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6420
6468
|
item.disabled && "cursor-not-allowed opacity-60",
|
|
6421
6469
|
itemClassName
|
|
6422
6470
|
),
|
|
@@ -6428,6 +6476,13 @@ var Select = ({
|
|
|
6428
6476
|
handleClose();
|
|
6429
6477
|
},
|
|
6430
6478
|
children: [
|
|
6479
|
+
isInline && isSelected ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6480
|
+
"span",
|
|
6481
|
+
{
|
|
6482
|
+
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
6483
|
+
"aria-hidden": true
|
|
6484
|
+
}
|
|
6485
|
+
) : null,
|
|
6431
6486
|
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6432
6487
|
"span",
|
|
6433
6488
|
{
|
|
@@ -6457,7 +6512,11 @@ var Select = ({
|
|
|
6457
6512
|
"div",
|
|
6458
6513
|
{
|
|
6459
6514
|
ref: containerRef,
|
|
6460
|
-
className: cn(
|
|
6515
|
+
className: cn(
|
|
6516
|
+
"group/agg-select relative inline-flex",
|
|
6517
|
+
isInline ? "w-auto" : "w-full",
|
|
6518
|
+
className
|
|
6519
|
+
),
|
|
6461
6520
|
children: [
|
|
6462
6521
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
6463
6522
|
"button",
|
|
@@ -6469,19 +6528,19 @@ var Select = ({
|
|
|
6469
6528
|
disabled: isDisabled,
|
|
6470
6529
|
className: cn(
|
|
6471
6530
|
"agg-select-trigger",
|
|
6472
|
-
"flex
|
|
6473
|
-
"
|
|
6531
|
+
"flex cursor-pointer items-center gap-2 font-agg-sans text-agg-foreground outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
6532
|
+
isInline ? "h-auto w-auto bg-transparent px-2 py-1 pr-8 text-left text-agg-base leading-agg-6" : "h-10 w-full border border-agg-separator bg-agg-secondary px-3 py-[9px] pr-10 text-left text-agg-sm leading-agg-5",
|
|
6474
6533
|
triggerRadiusClass,
|
|
6475
|
-
getMotionClassName(
|
|
6534
|
+
!isInline && getMotionClassName(
|
|
6476
6535
|
enableAnimations,
|
|
6477
6536
|
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
6478
6537
|
),
|
|
6479
|
-
isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
6480
|
-
"hover:border-agg-primary"
|
|
6481
|
-
"focus:border-agg-primary focus:ring-0",
|
|
6482
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
6538
|
+
!isInline && isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
6539
|
+
!isInline && "hover:border-agg-primary focus:border-agg-primary focus:ring-0"
|
|
6483
6540
|
),
|
|
6484
|
-
onClick:
|
|
6541
|
+
onClick: handleTriggerClick,
|
|
6542
|
+
onPointerEnter: handlePointerEnter,
|
|
6543
|
+
onPointerLeave: handlePointerLeave,
|
|
6485
6544
|
children: [
|
|
6486
6545
|
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6487
6546
|
RemoteImage,
|
|
@@ -6495,14 +6554,23 @@ var Select = ({
|
|
|
6495
6554
|
]
|
|
6496
6555
|
}
|
|
6497
6556
|
),
|
|
6498
|
-
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6499
|
-
|
|
6557
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6558
|
+
"span",
|
|
6500
6559
|
{
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6560
|
+
className: cn(
|
|
6561
|
+
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
6562
|
+
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
6563
|
+
),
|
|
6564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
6565
|
+
Icon,
|
|
6566
|
+
{
|
|
6567
|
+
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
6568
|
+
size: "small",
|
|
6569
|
+
color: "currentColor"
|
|
6570
|
+
}
|
|
6571
|
+
)
|
|
6504
6572
|
}
|
|
6505
|
-
)
|
|
6573
|
+
),
|
|
6506
6574
|
isOpen && typeof document !== "undefined" && listbox ? (0, import_react_dom.createPortal)(listbox, resolveSelectPortalContainer(containerRef.current)) : null
|
|
6507
6575
|
]
|
|
6508
6576
|
}
|
|
@@ -8815,8 +8883,9 @@ var isOrderBookRow = (v) => (0, import_sdk11.hasShape)(v, {
|
|
|
8815
8883
|
total: (t) => typeof t === "number" && t >= 0,
|
|
8816
8884
|
tone: (x) => x === "positive" || x === "negative"
|
|
8817
8885
|
});
|
|
8818
|
-
var formatProbabilityCents = (value) => {
|
|
8886
|
+
var formatProbabilityCents = (value, formatPrice) => {
|
|
8819
8887
|
if (value == null) return "-";
|
|
8888
|
+
if (formatPrice) return formatPrice(value);
|
|
8820
8889
|
const cents = (value * 100).toFixed(1).replace(/\.0$/, "");
|
|
8821
8890
|
return `${cents}\xA2`;
|
|
8822
8891
|
};
|
|
@@ -11077,7 +11146,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11077
11146
|
}, [chartOutcomeLabel, (_d = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _d.label]);
|
|
11078
11147
|
const {
|
|
11079
11148
|
chart: { selectedChartTimeRange },
|
|
11080
|
-
formatting: { formatPercent },
|
|
11149
|
+
formatting: { formatPercent, formatPrice },
|
|
11081
11150
|
general: { theme }
|
|
11082
11151
|
} = (0, import_hooks40.useSdkUiConfig)();
|
|
11083
11152
|
const isDarkTheme = theme === "dark";
|
|
@@ -11352,8 +11421,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
11352
11421
|
});
|
|
11353
11422
|
return {
|
|
11354
11423
|
value: outcome.id,
|
|
11355
|
-
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
11356
|
-
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price)}`
|
|
11424
|
+
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
11425
|
+
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
11357
11426
|
};
|
|
11358
11427
|
})
|
|
11359
11428
|
}
|
|
@@ -11775,7 +11844,7 @@ var EventListItemDetails = (props) => {
|
|
|
11775
11844
|
EventListItemDetails.displayName = "EventListItemDetails";
|
|
11776
11845
|
|
|
11777
11846
|
// src/events/market-details/index.tsx
|
|
11778
|
-
var
|
|
11847
|
+
var import_hooks44 = require("@agg-build/hooks");
|
|
11779
11848
|
var import_react20 = require("react");
|
|
11780
11849
|
|
|
11781
11850
|
// src/events/orderbook/index.tsx
|
|
@@ -12023,6 +12092,7 @@ var OrderbookRow = ({
|
|
|
12023
12092
|
entry,
|
|
12024
12093
|
formatNumber,
|
|
12025
12094
|
formatCurrency,
|
|
12095
|
+
formatPrice,
|
|
12026
12096
|
enableAnimations,
|
|
12027
12097
|
showBadge,
|
|
12028
12098
|
badgeLabel
|
|
@@ -12091,7 +12161,7 @@ var OrderbookRow = ({
|
|
|
12091
12161
|
"w-9 min-w-9 md:min-w-10 md:w-10 text-agg-sm font-agg-bold leading-agg-5",
|
|
12092
12162
|
priceClassName
|
|
12093
12163
|
),
|
|
12094
|
-
children: formatProbabilityCents(entry.row.price)
|
|
12164
|
+
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
12095
12165
|
}
|
|
12096
12166
|
),
|
|
12097
12167
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(OrderbookVenueLogos, { venues })
|
|
@@ -12113,7 +12183,10 @@ var Orderbook = ({
|
|
|
12113
12183
|
className
|
|
12114
12184
|
}) => {
|
|
12115
12185
|
var _a, _b, _c, _d, _e;
|
|
12116
|
-
const {
|
|
12186
|
+
const {
|
|
12187
|
+
enableWebsocketsLogs,
|
|
12188
|
+
formatting: { formatPrice }
|
|
12189
|
+
} = (0, import_hooks41.useAggUiConfig)();
|
|
12117
12190
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
12118
12191
|
const scrollContainerRef = (0, import_react18.useRef)(null);
|
|
12119
12192
|
const spreadRowRef = (0, import_react18.useRef)(null);
|
|
@@ -12178,6 +12251,7 @@ var Orderbook = ({
|
|
|
12178
12251
|
entry,
|
|
12179
12252
|
formatNumber,
|
|
12180
12253
|
formatCurrency,
|
|
12254
|
+
formatPrice,
|
|
12181
12255
|
enableAnimations,
|
|
12182
12256
|
showBadge: index === askEntries.length - 1,
|
|
12183
12257
|
badgeLabel: labels.asks
|
|
@@ -12190,7 +12264,7 @@ var Orderbook = ({
|
|
|
12190
12264
|
ref: spreadRowRef,
|
|
12191
12265
|
className: "agg-orderbook-spread flex items-center border-y border-agg-separator h-9 px-5 py-2 gap-3 md:gap-10",
|
|
12192
12266
|
role: "separator",
|
|
12193
|
-
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
12267
|
+
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null, formatPrice)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
12194
12268
|
children: [
|
|
12195
12269
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
12196
12270
|
Typography,
|
|
@@ -12200,7 +12274,7 @@ var Orderbook = ({
|
|
|
12200
12274
|
children: [
|
|
12201
12275
|
"Last: ",
|
|
12202
12276
|
labels.lastOutcome ? `${labels.lastOutcome} ` : "",
|
|
12203
|
-
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null)
|
|
12277
|
+
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null, formatPrice)
|
|
12204
12278
|
]
|
|
12205
12279
|
}
|
|
12206
12280
|
),
|
|
@@ -12227,6 +12301,7 @@ var Orderbook = ({
|
|
|
12227
12301
|
entry,
|
|
12228
12302
|
formatNumber,
|
|
12229
12303
|
formatCurrency,
|
|
12304
|
+
formatPrice,
|
|
12230
12305
|
enableAnimations,
|
|
12231
12306
|
showBadge: index === 0,
|
|
12232
12307
|
badgeLabel: labels.bids
|
|
@@ -12403,6 +12478,7 @@ var resolveTradingStateBadgeClassName = (kind) => {
|
|
|
12403
12478
|
};
|
|
12404
12479
|
|
|
12405
12480
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
12481
|
+
var import_hooks42 = require("@agg-build/hooks");
|
|
12406
12482
|
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
12407
12483
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
12408
12484
|
positive: {
|
|
@@ -12453,6 +12529,7 @@ var OutcomePriceContent = ({
|
|
|
12453
12529
|
value,
|
|
12454
12530
|
textClassName
|
|
12455
12531
|
}) => {
|
|
12532
|
+
const { formatPrice } = (0, import_hooks42.useAggUiConfig)().formatting;
|
|
12456
12533
|
if (isLoading) {
|
|
12457
12534
|
return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
12458
12535
|
"span",
|
|
@@ -12471,7 +12548,7 @@ var OutcomePriceContent = ({
|
|
|
12471
12548
|
as: "span",
|
|
12472
12549
|
variant: isSelected ? "body-strong" : "body",
|
|
12473
12550
|
className: cn("shrink-0 whitespace-nowrap", textClassName),
|
|
12474
|
-
children: formatProbabilityCents(value)
|
|
12551
|
+
children: formatProbabilityCents(value, formatPrice)
|
|
12475
12552
|
}
|
|
12476
12553
|
);
|
|
12477
12554
|
};
|
|
@@ -12565,7 +12642,7 @@ var MarketDetailsOutcomeButton = ({
|
|
|
12565
12642
|
MarketDetailsOutcomeButton.displayName = "MarketDetailsOutcomeButton";
|
|
12566
12643
|
|
|
12567
12644
|
// src/events/market-details/market-details-graph-panel.tsx
|
|
12568
|
-
var
|
|
12645
|
+
var import_hooks43 = require("@agg-build/hooks");
|
|
12569
12646
|
var import_react19 = require("react");
|
|
12570
12647
|
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
12571
12648
|
var MarketDetailsGraphPanel = ({
|
|
@@ -12582,13 +12659,13 @@ var MarketDetailsGraphPanel = ({
|
|
|
12582
12659
|
classNames
|
|
12583
12660
|
}) => {
|
|
12584
12661
|
var _a, _b, _c;
|
|
12585
|
-
const config = (0,
|
|
12662
|
+
const config = (0, import_hooks43.useSdkUiConfig)();
|
|
12586
12663
|
const {
|
|
12587
|
-
formatting: { formatPercent, formatCompactCurrency },
|
|
12664
|
+
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
12588
12665
|
general: { theme }
|
|
12589
12666
|
} = config;
|
|
12590
12667
|
const isDarkTheme = theme === "dark";
|
|
12591
|
-
const labels = (0,
|
|
12668
|
+
const labels = (0, import_hooks43.useLabels)();
|
|
12592
12669
|
const selectedTimeRange = config.chart.selectedChartTimeRange;
|
|
12593
12670
|
const setSelectedTimeRange = config.chart.setSelectedChartTimeRange;
|
|
12594
12671
|
const [chartRangeOverride, setChartRangeOverride] = (0, import_react19.useState)(null);
|
|
@@ -12608,7 +12685,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12608
12685
|
livePrices
|
|
12609
12686
|
});
|
|
12610
12687
|
}, [livePrices, venueMarkets, resolvedChartOutcomeLabel, chartSelectedOutcomeId]);
|
|
12611
|
-
const rollingWindow = (0,
|
|
12688
|
+
const rollingWindow = (0, import_hooks43.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
12612
12689
|
const chartPrimaryOutcomeId = (_b = (_a = chartOutcomesByVenue[0]) == null ? void 0 : _a.outcome.id) != null ? _b : null;
|
|
12613
12690
|
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
12614
12691
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
@@ -12618,7 +12695,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12618
12695
|
isLoading: isMarketChartLoading,
|
|
12619
12696
|
error: marketChartError,
|
|
12620
12697
|
refetch: refetchMarketChart
|
|
12621
|
-
} = (0,
|
|
12698
|
+
} = (0, import_hooks43.useMarketChart)({
|
|
12622
12699
|
marketId: chartPrimaryOutcomeId,
|
|
12623
12700
|
venueMarketIds: chartVenueOutcomeIds,
|
|
12624
12701
|
interval: rollingWindow.interval,
|
|
@@ -12798,8 +12875,8 @@ var MarketDetailsGraphPanel = ({
|
|
|
12798
12875
|
const price = outcome.probability;
|
|
12799
12876
|
return {
|
|
12800
12877
|
value: outcome.id,
|
|
12801
|
-
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
12802
|
-
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
|
|
12878
|
+
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
12879
|
+
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
12803
12880
|
};
|
|
12804
12881
|
})
|
|
12805
12882
|
}
|
|
@@ -12828,7 +12905,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
12828
12905
|
}
|
|
12829
12906
|
),
|
|
12830
12907
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }),
|
|
12831
|
-
|
|
12908
|
+
import_hooks43.CHART_TIME_RANGES.map((timeRange) => {
|
|
12832
12909
|
const isActive = effectiveChartTimeRange === timeRange;
|
|
12833
12910
|
const isDisabled = isResolvedMarket && timeRange !== "ALL";
|
|
12834
12911
|
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
@@ -12871,7 +12948,7 @@ var MarketDetailsUnavailableState = ({
|
|
|
12871
12948
|
ariaLabel,
|
|
12872
12949
|
classNames
|
|
12873
12950
|
}) => {
|
|
12874
|
-
const labels = (0,
|
|
12951
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
12875
12952
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12876
12953
|
Card,
|
|
12877
12954
|
{
|
|
@@ -12895,7 +12972,7 @@ var MarketDetailsNotFoundState = ({
|
|
|
12895
12972
|
ariaLabel: _ariaLabel,
|
|
12896
12973
|
classNames: _classNames
|
|
12897
12974
|
}) => {
|
|
12898
|
-
const labels = (0,
|
|
12975
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
12899
12976
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
12900
12977
|
StateMessage,
|
|
12901
12978
|
{
|
|
@@ -12933,33 +13010,33 @@ var MarketDetailsContent = ({
|
|
|
12933
13010
|
midpointsResult
|
|
12934
13011
|
}) => {
|
|
12935
13012
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
12936
|
-
const config = (0,
|
|
13013
|
+
const config = (0, import_hooks44.useSdkUiConfig)();
|
|
12937
13014
|
const {
|
|
12938
13015
|
features: { enableAnimations },
|
|
12939
13016
|
formatting: { formatPercent }
|
|
12940
13017
|
} = config;
|
|
12941
|
-
const labels = (0,
|
|
12942
|
-
const tradingContext = (0,
|
|
13018
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13019
|
+
const tradingContext = (0, import_hooks44.useEventTradingContext)();
|
|
12943
13020
|
const detailsContentId = (0, import_react20.useId)();
|
|
12944
13021
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
12945
13022
|
const resolvedMarket = (0, import_react20.useMemo)(() => {
|
|
12946
13023
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
12947
13024
|
}, [venueMarkets, marketId]);
|
|
12948
13025
|
const clusterVenueMarkets = resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets;
|
|
12949
|
-
const wsLivePrices = (0,
|
|
12950
|
-
const wsBestPrices = (0,
|
|
12951
|
-
const wsBestCandidates = (0,
|
|
13026
|
+
const wsLivePrices = (0, import_hooks44.useLiveOutcomePrices)(clusterVenueMarkets);
|
|
13027
|
+
const wsBestPrices = (0, import_hooks44.useLiveBestPrices)(clusterVenueMarkets);
|
|
13028
|
+
const wsBestCandidates = (0, import_hooks44.useLiveBestPriceCandidates)(clusterVenueMarkets);
|
|
12952
13029
|
const scopedResolvedMarket = (0, import_react20.useMemo)(() => {
|
|
12953
13030
|
var _a2, _b2;
|
|
12954
13031
|
if (!resolvedMarket) return null;
|
|
12955
13032
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
12956
13033
|
}, [resolvedMarket]);
|
|
12957
|
-
const isResolvedMarket = (0,
|
|
12958
|
-
(0,
|
|
13034
|
+
const isResolvedMarket = (0, import_hooks44.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
13035
|
+
(0, import_hooks44.useEventOrderbookData)(
|
|
12959
13036
|
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
12960
13037
|
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
12961
13038
|
);
|
|
12962
|
-
const fetchedClusterMidpointResult = (0,
|
|
13039
|
+
const fetchedClusterMidpointResult = (0, import_hooks44.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
|
|
12963
13040
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
|
|
12964
13041
|
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
12965
13042
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
@@ -12968,7 +13045,7 @@ var MarketDetailsContent = ({
|
|
|
12968
13045
|
const clusterBestMidpointVenue = clusterMidpointResult.bestMidpointVenue;
|
|
12969
13046
|
const clusterBestPricesRest = clusterMidpointResult.bestPrices;
|
|
12970
13047
|
const clusterBestPrices = (0, import_react20.useMemo)(
|
|
12971
|
-
() => (0,
|
|
13048
|
+
() => (0, import_hooks44.mergeBestPricesPreferringLive)(clusterBestPricesRest, wsBestPrices),
|
|
12972
13049
|
[clusterBestPricesRest, wsBestPrices]
|
|
12973
13050
|
);
|
|
12974
13051
|
const clusterBestPriceVenuesByOutcomeId = clusterMidpointResult.bestPriceVenuesByOutcomeId;
|
|
@@ -13023,7 +13100,7 @@ var MarketDetailsContent = ({
|
|
|
13023
13100
|
return (_a2 = model.market.venueMarkets.find((venueMarket) => venueMarket.id === model.market.id)) != null ? _a2 : model.primaryVenueMarket;
|
|
13024
13101
|
}, [model]);
|
|
13025
13102
|
const marketTradingState = (0, import_react20.useMemo)(() => {
|
|
13026
|
-
return (0,
|
|
13103
|
+
return (0, import_hooks44.resolveMarketTradingState)(scopedMarketForCard);
|
|
13027
13104
|
}, [scopedMarketForCard]);
|
|
13028
13105
|
const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
|
|
13029
13106
|
const isUpcomingMarket = marketTradingState.kind === "unopened";
|
|
@@ -13184,7 +13261,7 @@ var MarketDetailsContent = ({
|
|
|
13184
13261
|
fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
|
|
13185
13262
|
});
|
|
13186
13263
|
if (referencePrice != null) return referencePrice;
|
|
13187
|
-
return (0,
|
|
13264
|
+
return (0, import_hooks44.findLivePriceById)(wsLivePrices, displayOutcome.id);
|
|
13188
13265
|
}, [
|
|
13189
13266
|
clusterBestMidpoint,
|
|
13190
13267
|
clusterBestMidpointsByOutcomeId,
|
|
@@ -13210,7 +13287,7 @@ var MarketDetailsContent = ({
|
|
|
13210
13287
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
13211
13288
|
const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
|
|
13212
13289
|
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
13213
|
-
const marketOrderbookResult = (0,
|
|
13290
|
+
const marketOrderbookResult = (0, import_hooks44.useMarketOrderbook)({
|
|
13214
13291
|
marketId: primaryVenueMarketId,
|
|
13215
13292
|
enabled: orderBookEnabled && !!primaryVenueMarketId,
|
|
13216
13293
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
@@ -13391,7 +13468,7 @@ var MarketDetailsContent = ({
|
|
|
13391
13468
|
!compactHeader ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
13392
13469
|
RemoteImage,
|
|
13393
13470
|
{
|
|
13394
|
-
src: (0,
|
|
13471
|
+
src: (0, import_hooks44.optimizedImageUrl)(model.image, 60),
|
|
13395
13472
|
alt: "",
|
|
13396
13473
|
className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
|
|
13397
13474
|
}
|
|
@@ -13642,7 +13719,7 @@ var MarketDetailsContent = ({
|
|
|
13642
13719
|
};
|
|
13643
13720
|
var MarketDetails = (_a) => {
|
|
13644
13721
|
var _b = _a, { isOpened } = _b, props = __objRest(_b, ["isOpened"]);
|
|
13645
|
-
const labels = (0,
|
|
13722
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13646
13723
|
if (props.isLoading) {
|
|
13647
13724
|
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
13648
13725
|
Skeleton,
|
|
@@ -13697,13 +13774,13 @@ var resolveIsResolvedEvent = (sourceMarkets, eventTradingState) => {
|
|
|
13697
13774
|
return eventTradingState.kind === "resolved";
|
|
13698
13775
|
}
|
|
13699
13776
|
if (sourceMarkets.length === 0) return false;
|
|
13700
|
-
return sourceMarkets.every((market) => (0,
|
|
13777
|
+
return sourceMarkets.every((market) => (0, import_hooks44.resolveMarketTradingState)(market).kind === "resolved");
|
|
13701
13778
|
};
|
|
13702
13779
|
var resolveResolvedWinnerMarketId = (sourceMarkets, eventTradingState) => {
|
|
13703
13780
|
var _a, _b, _c, _d, _e;
|
|
13704
13781
|
const preferredMarket = (_a = eventTradingState == null ? void 0 : eventTradingState.primaryMarket) != null ? _a : null;
|
|
13705
13782
|
if (preferredMarket && sourceMarkets.some((market) => market.id === preferredMarket.id)) {
|
|
13706
|
-
if ((0,
|
|
13783
|
+
if ((0, import_hooks44.resolveMarketTradingState)(preferredMarket).kind === "resolved") {
|
|
13707
13784
|
return preferredMarket.id;
|
|
13708
13785
|
}
|
|
13709
13786
|
}
|
|
@@ -13723,8 +13800,8 @@ var MarketDetailsList = ({
|
|
|
13723
13800
|
midpointsResult
|
|
13724
13801
|
}) => {
|
|
13725
13802
|
var _a, _b;
|
|
13726
|
-
const labels = (0,
|
|
13727
|
-
const tradingContext = (0,
|
|
13803
|
+
const labels = (0, import_hooks44.useLabels)();
|
|
13804
|
+
const tradingContext = (0, import_hooks44.useEventTradingContext)();
|
|
13728
13805
|
const selectedMarketId = (_a = tradingContext == null ? void 0 : tradingContext.selectedMarketId) != null ? _a : null;
|
|
13729
13806
|
const [expandedMarketId, setExpandedMarketId] = (0, import_react20.useState)(null);
|
|
13730
13807
|
const [areResolvedMarketsVisible, setAreResolvedMarketsVisible] = (0, import_react20.useState)(false);
|
|
@@ -13733,10 +13810,10 @@ var MarketDetailsList = ({
|
|
|
13733
13810
|
markets: rawMarkets,
|
|
13734
13811
|
isLoading,
|
|
13735
13812
|
error
|
|
13736
|
-
} = (0,
|
|
13813
|
+
} = (0, import_hooks44.useVenueMarkets)({
|
|
13737
13814
|
venueEventId: resolvedEventId,
|
|
13738
13815
|
enabled: !providedMarkets && !!resolvedEventId,
|
|
13739
|
-
status:
|
|
13816
|
+
status: import_hooks44.MarketStatus.open,
|
|
13740
13817
|
// Keep in lockstep with useEnrichedVenueEvent: limit is part of the React
|
|
13741
13818
|
// Query key, so a mismatch would fork the shared cache into two requests.
|
|
13742
13819
|
// fetchAll drains every page — events can exceed any single-page limit
|
|
@@ -13780,7 +13857,7 @@ var MarketDetailsList = ({
|
|
|
13780
13857
|
const resolved = [];
|
|
13781
13858
|
const closed = [];
|
|
13782
13859
|
sourceMarkets.forEach((market) => {
|
|
13783
|
-
const marketStateKind = (0,
|
|
13860
|
+
const marketStateKind = (0, import_hooks44.resolveMarketTradingState)(market).kind;
|
|
13784
13861
|
if (marketStateKind === "resolved") {
|
|
13785
13862
|
resolved.push(market);
|
|
13786
13863
|
return;
|
|
@@ -13808,10 +13885,10 @@ var MarketDetailsList = ({
|
|
|
13808
13885
|
const hasPrefetchedMarkets = !!providedMarkets || !!((_b = eventTradingState == null ? void 0 : eventTradingState.marketStates) == null ? void 0 : _b.length);
|
|
13809
13886
|
const midpointEligibleMarkets = (0, import_react20.useMemo)(() => {
|
|
13810
13887
|
return displayedMarkets.filter(
|
|
13811
|
-
(market) => (0,
|
|
13888
|
+
(market) => (0, import_hooks44.resolveMarketTradingState)(market).kind !== "resolved"
|
|
13812
13889
|
);
|
|
13813
13890
|
}, [displayedMarkets]);
|
|
13814
|
-
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0,
|
|
13891
|
+
const { prices: midpointsFallback, venueByOutcomeId: midpointsFallbackVenues } = (0, import_hooks44.useViewportMidpoints)(midpointEligibleMarkets);
|
|
13815
13892
|
(0, import_react20.useEffect)(() => {
|
|
13816
13893
|
if (isResolvedEvent) {
|
|
13817
13894
|
setAreResolvedMarketsVisible(false);
|
|
@@ -13830,7 +13907,7 @@ var MarketDetailsList = ({
|
|
|
13830
13907
|
return;
|
|
13831
13908
|
}
|
|
13832
13909
|
const fallbackSelectableMarket = displayedMarkets.find(
|
|
13833
|
-
(market) => !(0,
|
|
13910
|
+
(market) => !(0, import_hooks44.resolveMarketTradingState)(market).isTradingDisabled
|
|
13834
13911
|
);
|
|
13835
13912
|
if (!fallbackSelectableMarket) {
|
|
13836
13913
|
return;
|
|
@@ -13852,7 +13929,7 @@ var MarketDetailsList = ({
|
|
|
13852
13929
|
setExpandedMarketId(marketId);
|
|
13853
13930
|
onExpandedMarketChange == null ? void 0 : onExpandedMarketChange(marketId);
|
|
13854
13931
|
if (marketId === selectedMarketId) return;
|
|
13855
|
-
if ((0,
|
|
13932
|
+
if ((0, import_hooks44.resolveMarketTradingState)(market).isTradingDisabled) return;
|
|
13856
13933
|
tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
|
|
13857
13934
|
};
|
|
13858
13935
|
if (!hasPrefetchedMarkets && isLoading) {
|
|
@@ -13945,7 +14022,7 @@ var MarketDetailsList = ({
|
|
|
13945
14022
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
13946
14023
|
|
|
13947
14024
|
// src/events/list/index.tsx
|
|
13948
|
-
var
|
|
14025
|
+
var import_hooks46 = require("@agg-build/hooks");
|
|
13949
14026
|
var import_sdk15 = require("@agg-build/sdk");
|
|
13950
14027
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
13951
14028
|
var import_react23 = require("react");
|
|
@@ -14068,7 +14145,7 @@ var CategorySidebar = ({
|
|
|
14068
14145
|
CategorySidebar.displayName = "CategorySidebar";
|
|
14069
14146
|
|
|
14070
14147
|
// src/events/list/event-list-tabs.tsx
|
|
14071
|
-
var
|
|
14148
|
+
var import_hooks45 = require("@agg-build/hooks");
|
|
14072
14149
|
var import_sdk14 = require("@agg-build/sdk");
|
|
14073
14150
|
var import_react22 = require("react");
|
|
14074
14151
|
|
|
@@ -14156,14 +14233,14 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
14156
14233
|
);
|
|
14157
14234
|
};
|
|
14158
14235
|
var useEventListTabs = (tabs) => {
|
|
14159
|
-
const labels = (0,
|
|
14160
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
14161
|
-
const { isLocationBlocked } = (0,
|
|
14236
|
+
const labels = (0, import_hooks45.useLabels)();
|
|
14237
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks45.useAppConfig)();
|
|
14238
|
+
const { isLocationBlocked } = (0, import_hooks45.useGeoBlock)();
|
|
14162
14239
|
return (0, import_react22.useMemo)(() => {
|
|
14163
14240
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
14164
14241
|
return baseTabs.flatMap((tab) => {
|
|
14165
14242
|
if (!tab.venueLogo) return [tab];
|
|
14166
|
-
const availabilityState = (0,
|
|
14243
|
+
const availabilityState = (0, import_hooks45.getVenueAvailabilityState)({
|
|
14167
14244
|
venueId: tab.venueLogo,
|
|
14168
14245
|
disabledVenues,
|
|
14169
14246
|
isConfigLoading: isAppConfigLoading && tab.venueLogo === import_sdk14.Venue.kalshi,
|
|
@@ -14277,15 +14354,15 @@ var EventList = ({
|
|
|
14277
14354
|
stateRef
|
|
14278
14355
|
}) => {
|
|
14279
14356
|
var _a, _b, _c, _d, _e;
|
|
14280
|
-
const labels = (0,
|
|
14281
|
-
const { disabledVenues } = (0,
|
|
14357
|
+
const labels = (0, import_hooks46.useLabels)();
|
|
14358
|
+
const { disabledVenues } = (0, import_hooks46.useAppConfig)();
|
|
14282
14359
|
const {
|
|
14283
14360
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
14284
|
-
} = (0,
|
|
14361
|
+
} = (0, import_hooks46.useSdkUiConfig)();
|
|
14285
14362
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
14286
14363
|
const resolvedTabs = useEventListTabs();
|
|
14287
14364
|
const visibleVenues = (0, import_react23.useMemo)(
|
|
14288
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
14365
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks46.getVisibleVenueIdsByConfig)(import_sdk15.VENUES, disabledVenues),
|
|
14289
14366
|
[disabledVenues]
|
|
14290
14367
|
);
|
|
14291
14368
|
const [activeTabValue, setActiveTabValue] = (0, import_react23.useState)(
|
|
@@ -14330,7 +14407,7 @@ var EventList = ({
|
|
|
14330
14407
|
setCategoryPath([]);
|
|
14331
14408
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
14332
14409
|
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
14333
|
-
const { categories: topLevelCategories } = (0,
|
|
14410
|
+
const { categories: topLevelCategories } = (0, import_hooks46.useCategories)({
|
|
14334
14411
|
queryKeyScope: "event-list-top-categories",
|
|
14335
14412
|
enabled: isDiscoveryFiltersEnabled,
|
|
14336
14413
|
limit: 100
|
|
@@ -14346,7 +14423,7 @@ var EventList = ({
|
|
|
14346
14423
|
])
|
|
14347
14424
|
);
|
|
14348
14425
|
}, [categoryPath, sortedTopLevelCategories]);
|
|
14349
|
-
const { childrenByParentId: baseChildrenByParentId } = (0,
|
|
14426
|
+
const { childrenByParentId: baseChildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14350
14427
|
queryKeyScope: "event-list-category-children",
|
|
14351
14428
|
enabled: isDiscoveryFiltersEnabled,
|
|
14352
14429
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -14367,7 +14444,7 @@ var EventList = ({
|
|
|
14367
14444
|
}
|
|
14368
14445
|
return Array.from(ids);
|
|
14369
14446
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
14370
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
14447
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14371
14448
|
queryKeyScope: "event-list-category-children",
|
|
14372
14449
|
enabled: isDiscoveryFiltersEnabled,
|
|
14373
14450
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -14383,7 +14460,7 @@ var EventList = ({
|
|
|
14383
14460
|
}
|
|
14384
14461
|
return Array.from(ids);
|
|
14385
14462
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
14386
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
14463
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks46.useCategoryChildren)({
|
|
14387
14464
|
queryKeyScope: "event-list-category-children",
|
|
14388
14465
|
enabled: isDiscoveryFiltersEnabled,
|
|
14389
14466
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -14439,14 +14516,14 @@ var EventList = ({
|
|
|
14439
14516
|
isFetchingNextPage,
|
|
14440
14517
|
isPlaceholderData,
|
|
14441
14518
|
loadedPageCount
|
|
14442
|
-
} = (0,
|
|
14519
|
+
} = (0, import_hooks46.useVenueEvents)({
|
|
14443
14520
|
queryKeyScope: "event-list",
|
|
14444
14521
|
venues,
|
|
14445
14522
|
search,
|
|
14446
14523
|
categoryIds: resolvedCategoryIds,
|
|
14447
14524
|
matchStatus,
|
|
14448
14525
|
limit: requestLimit,
|
|
14449
|
-
status: [
|
|
14526
|
+
status: [import_hooks46.MarketStatus.open],
|
|
14450
14527
|
sortBy: sortQueryParams.sortBy,
|
|
14451
14528
|
sortDir: sortQueryParams.sortDir,
|
|
14452
14529
|
endDateFrom,
|
|
@@ -14481,7 +14558,7 @@ var EventList = ({
|
|
|
14481
14558
|
const visibleMidpointVenueMarketIds = (0, import_react23.useMemo)(() => {
|
|
14482
14559
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
14483
14560
|
}, [visibleVenueMarkets]);
|
|
14484
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
14561
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks46.useVenueMarketMidpoints)({
|
|
14485
14562
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
14486
14563
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
14487
14564
|
});
|
|
@@ -14662,7 +14739,7 @@ var EventList = ({
|
|
|
14662
14739
|
onMarketClick,
|
|
14663
14740
|
getMarketHref,
|
|
14664
14741
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
14665
|
-
marketStatus:
|
|
14742
|
+
marketStatus: import_hooks46.MarketStatus.open
|
|
14666
14743
|
},
|
|
14667
14744
|
event.id
|
|
14668
14745
|
)),
|