@agg-build/ui 2.2.3 → 2.2.4
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-QM3WWPCV.mjs → chunk-3R2CQTNM.mjs} +71 -37
- package/dist/{chunk-ZRYHWHTD.mjs → chunk-44GSDH2Y.mjs} +2 -2
- package/dist/{chunk-UTXQUOU3.mjs → chunk-6Z5GQ3KL.mjs} +60 -14
- package/dist/{chunk-4QGZ3FWI.mjs → chunk-7OVSGWI7.mjs} +1 -1
- package/dist/{chunk-JOZPXDNZ.mjs → chunk-MXM5PM4A.mjs} +3 -3
- package/dist/{chunk-LPIAEKSZ.mjs → chunk-SG573ODC.mjs} +1 -1
- package/dist/{chunk-TDLI6F55.mjs → chunk-XJTNK3DS.mjs} +127 -17
- package/dist/events.js +125 -45
- package/dist/events.mjs +3 -3
- package/dist/index.js +250 -60
- package/dist/index.mjs +7 -7
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +250 -60
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +59 -13
- package/dist/primitives.mjs +1 -1
- package/dist/trading.mjs +4 -4
- package/dist/types/events/shared/format-event-title.d.mts +21 -6
- package/dist/types/events/shared/format-event-title.d.ts +21 -6
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +19 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +19 -1
- package/package.json +3 -3
package/dist/pages.js
CHANGED
|
@@ -6165,23 +6165,69 @@ var isSportEvent = (categories, structureType) => {
|
|
|
6165
6165
|
return isSportCategoryToken(categoryEntry.id) || isSportCategoryToken((_a2 = categoryEntry.category) == null ? void 0 : _a2.id) || isSportCategoryToken((_b = categoryEntry.category) == null ? void 0 : _b.name) || isSportCategoryToken((_c = categoryEntry.category) == null ? void 0 : _c.displayName) || isSportCategoryToken((_d = categoryEntry.category) == null ? void 0 : _d.parentId);
|
|
6166
6166
|
})) != null ? _a : false;
|
|
6167
6167
|
};
|
|
6168
|
-
var
|
|
6169
|
-
|
|
6168
|
+
var hasFixtureMarketMetadata = (venueMarkets) => {
|
|
6169
|
+
var _a;
|
|
6170
|
+
return (_a = venueMarkets == null ? void 0 : venueMarkets.some((venueMarket) => {
|
|
6171
|
+
var _a2, _b, _c, _d;
|
|
6172
|
+
return Boolean(
|
|
6173
|
+
((_a2 = venueMarket.sportsMarketType) == null ? void 0 : _a2.trim()) || ((_b = venueMarket.marketCategory) == null ? void 0 : _b.trim()) || ((_c = venueMarket.marketSubtype) == null ? void 0 : _c.trim()) || ((_d = venueMarket.period) == null ? void 0 : _d.trim()) || venueMarket.lineValue != null
|
|
6174
|
+
);
|
|
6175
|
+
})) != null ? _a : false;
|
|
6176
|
+
};
|
|
6177
|
+
var shouldDisplaySportsEventTimestamp = ({
|
|
6170
6178
|
categories,
|
|
6171
6179
|
structureType,
|
|
6180
|
+
venueMarkets
|
|
6181
|
+
}) => {
|
|
6182
|
+
if (!isSportEvent(categories, structureType)) return false;
|
|
6183
|
+
if (structureType === "sport") {
|
|
6184
|
+
return true;
|
|
6185
|
+
}
|
|
6186
|
+
if (typeof structureType === "string" && structureType.trim()) {
|
|
6187
|
+
return false;
|
|
6188
|
+
}
|
|
6189
|
+
return hasFixtureMarketMetadata(venueMarkets);
|
|
6190
|
+
};
|
|
6191
|
+
var resolveSportsEventTimestamp = ({
|
|
6172
6192
|
gameStartTime,
|
|
6173
6193
|
endDate
|
|
6194
|
+
}) => {
|
|
6195
|
+
return (gameStartTime == null ? void 0 : gameStartTime.trim()) || (endDate == null ? void 0 : endDate.trim()) || null;
|
|
6196
|
+
};
|
|
6197
|
+
var resolveEventTimestampLabel = ({
|
|
6198
|
+
categories,
|
|
6199
|
+
structureType,
|
|
6200
|
+
gameStartTime,
|
|
6201
|
+
endDate,
|
|
6202
|
+
venueMarkets
|
|
6203
|
+
}) => {
|
|
6204
|
+
if (!shouldDisplaySportsEventTimestamp({ categories, structureType, venueMarkets })) {
|
|
6205
|
+
return null;
|
|
6206
|
+
}
|
|
6207
|
+
const timestamp = resolveSportsEventTimestamp({ gameStartTime, endDate });
|
|
6208
|
+
if (!timestamp) return null;
|
|
6209
|
+
return formatSportsEventTimeEt(timestamp);
|
|
6210
|
+
};
|
|
6211
|
+
var resolveEventHeading = ({
|
|
6212
|
+
title: title2,
|
|
6213
|
+
categories,
|
|
6214
|
+
structureType,
|
|
6215
|
+
gameStartTime,
|
|
6216
|
+
endDate,
|
|
6217
|
+
venueMarkets
|
|
6174
6218
|
}) => {
|
|
6175
6219
|
const resolvedTitle = title2.trim();
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6220
|
+
return {
|
|
6221
|
+
title: resolvedTitle,
|
|
6222
|
+
timestampLabel: resolveEventTimestampLabel({
|
|
6223
|
+
title: resolvedTitle,
|
|
6224
|
+
categories,
|
|
6225
|
+
structureType,
|
|
6226
|
+
gameStartTime,
|
|
6227
|
+
endDate,
|
|
6228
|
+
venueMarkets
|
|
6229
|
+
})
|
|
6230
|
+
};
|
|
6185
6231
|
};
|
|
6186
6232
|
|
|
6187
6233
|
// src/events/item/event-list-item.utils.ts
|
|
@@ -6522,13 +6568,13 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
|
|
|
6522
6568
|
const probability = normalizeProbability(
|
|
6523
6569
|
(_a = options == null ? void 0 : options.priceByOutcomeId) == null ? void 0 : _a.get(visibleOutcome.outcome.id)
|
|
6524
6570
|
);
|
|
6525
|
-
const resolvedTitle =
|
|
6571
|
+
const resolvedTitle = resolveEventHeading({
|
|
6526
6572
|
title: (_b = event == null ? void 0 : event.title) != null ? _b : "",
|
|
6527
6573
|
categories: event.categories,
|
|
6528
6574
|
structureType: event.structureType,
|
|
6529
6575
|
gameStartTime: event.gameStartTime,
|
|
6530
6576
|
endDate: event.endDate
|
|
6531
|
-
});
|
|
6577
|
+
}).title;
|
|
6532
6578
|
if (!resolvedTitle) return null;
|
|
6533
6579
|
const { marketCount, venueCount } = getVenueSummary(event.venueMarkets);
|
|
6534
6580
|
const marketSummaryLabel = [
|
|
@@ -9145,13 +9191,16 @@ var EventListItemContent = ({
|
|
|
9145
9191
|
const config = (0, import_hooks35.useSdkUiConfig)();
|
|
9146
9192
|
const labels = (0, import_hooks35.useLabels)();
|
|
9147
9193
|
const allVenueMarkets = (0, import_react14.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
9148
|
-
const
|
|
9194
|
+
const eventHeading = resolveEventHeading({
|
|
9149
9195
|
title: event.title,
|
|
9150
9196
|
categories: event.categories,
|
|
9151
9197
|
structureType: event.structureType,
|
|
9152
9198
|
gameStartTime: event.gameStartTime,
|
|
9153
|
-
endDate: event.endDate
|
|
9199
|
+
endDate: event.endDate,
|
|
9200
|
+
venueMarkets: event.venueMarkets
|
|
9154
9201
|
});
|
|
9202
|
+
const resolvedTitle = eventHeading.title;
|
|
9203
|
+
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
9155
9204
|
const resolvedImage = event.image;
|
|
9156
9205
|
const visibleVenueLogos = (0, import_react14.useMemo)(() => {
|
|
9157
9206
|
var _a2;
|
|
@@ -9457,10 +9506,10 @@ var EventListItemContent = ({
|
|
|
9457
9506
|
href,
|
|
9458
9507
|
onClick: handleClick,
|
|
9459
9508
|
onKeyDown: handleKeyDown,
|
|
9460
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
9509
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
9461
9510
|
withGradient: true,
|
|
9462
9511
|
children: [
|
|
9463
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: cn("agg-event-card-header flex
|
|
9512
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: cn("agg-event-card-header flex items-center gap-4", classNames == null ? void 0 : classNames.header), children: [
|
|
9464
9513
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9465
9514
|
RemoteImage,
|
|
9466
9515
|
{
|
|
@@ -9472,19 +9521,32 @@ var EventListItemContent = ({
|
|
|
9472
9521
|
}
|
|
9473
9522
|
}
|
|
9474
9523
|
),
|
|
9475
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9524
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "min-w-0 flex-1 self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "flex h-12 min-w-0 flex-col justify-center", children: [
|
|
9525
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9526
|
+
Typography,
|
|
9527
|
+
{
|
|
9528
|
+
variant: "body-strong",
|
|
9529
|
+
className: cn(
|
|
9530
|
+
"agg-event-title",
|
|
9531
|
+
"min-w-0 text-agg-base font-agg-bold leading-agg-6",
|
|
9532
|
+
resolvedTimestamp ? "truncate whitespace-nowrap" : "text-wrap wrap-break-word line-clamp-2",
|
|
9533
|
+
classNames == null ? void 0 : classNames.title
|
|
9534
|
+
),
|
|
9535
|
+
children: resolvedTitle
|
|
9536
|
+
}
|
|
9537
|
+
),
|
|
9538
|
+
resolvedTimestamp ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "agg-event-timestamp-row mt-0.5 h-5 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9539
|
+
Typography,
|
|
9540
|
+
{
|
|
9541
|
+
variant: "body",
|
|
9542
|
+
className: cn(
|
|
9543
|
+
"agg-event-timestamp min-w-0 truncate",
|
|
9544
|
+
"text-agg-sm leading-agg-5 text-agg-muted-foreground"
|
|
9545
|
+
),
|
|
9546
|
+
children: resolvedTimestamp
|
|
9547
|
+
}
|
|
9548
|
+
) }) : null
|
|
9549
|
+
] }) })
|
|
9488
9550
|
] }),
|
|
9489
9551
|
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
|
|
9490
9552
|
"div",
|
|
@@ -13273,19 +13335,27 @@ var EventListItemDetailsContent = ({
|
|
|
13273
13335
|
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
13274
13336
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, venueMarkets]);
|
|
13275
13337
|
const resolvedTitle = (0, import_react23.useMemo)(() => {
|
|
13276
|
-
return
|
|
13338
|
+
return resolveEventHeading({
|
|
13277
13339
|
title: event.title,
|
|
13278
13340
|
categories: event.categories,
|
|
13279
13341
|
structureType: event.structureType,
|
|
13280
13342
|
gameStartTime: event.gameStartTime,
|
|
13281
|
-
endDate: event.endDate
|
|
13343
|
+
endDate: event.endDate,
|
|
13344
|
+
venueMarkets: event.venueMarkets
|
|
13282
13345
|
});
|
|
13283
|
-
}, [
|
|
13346
|
+
}, [
|
|
13347
|
+
event.categories,
|
|
13348
|
+
event.endDate,
|
|
13349
|
+
event.gameStartTime,
|
|
13350
|
+
event.structureType,
|
|
13351
|
+
event.title,
|
|
13352
|
+
event.venueMarkets
|
|
13353
|
+
]);
|
|
13284
13354
|
return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(
|
|
13285
13355
|
Card,
|
|
13286
13356
|
{
|
|
13287
13357
|
className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
13288
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
13358
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
13289
13359
|
onClick: () => {
|
|
13290
13360
|
onClick == null ? void 0 : onClick(event);
|
|
13291
13361
|
},
|
|
@@ -13310,19 +13380,29 @@ var EventListItemDetailsContent = ({
|
|
|
13310
13380
|
}
|
|
13311
13381
|
),
|
|
13312
13382
|
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
13313
|
-
/* @__PURE__ */ (0, import_jsx_runtime136.
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
|
|
13383
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { className: "min-w-0", children: [
|
|
13384
|
+
/* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13385
|
+
Typography,
|
|
13386
|
+
{
|
|
13387
|
+
variant: "body-strong",
|
|
13388
|
+
className: cn(
|
|
13389
|
+
"agg-event-title",
|
|
13390
|
+
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
13391
|
+
resolvedTitle.timestampLabel ? "truncate whitespace-nowrap" : "truncate text-wrap wrap-break-word line-clamp-2",
|
|
13392
|
+
classNames == null ? void 0 : classNames.title
|
|
13393
|
+
),
|
|
13394
|
+
children: resolvedTitle.title
|
|
13395
|
+
}
|
|
13396
|
+
),
|
|
13397
|
+
resolvedTitle.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13398
|
+
Typography,
|
|
13399
|
+
{
|
|
13400
|
+
variant: "body",
|
|
13401
|
+
className: "agg-event-timestamp mt-0.5 min-w-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
13402
|
+
children: resolvedTitle.timestampLabel
|
|
13403
|
+
}
|
|
13404
|
+
) : null
|
|
13405
|
+
] }),
|
|
13326
13406
|
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
13327
13407
|
EventListItemDetailsMarketSelector,
|
|
13328
13408
|
{
|
|
@@ -21026,7 +21106,12 @@ var SPORTS_SECTION_TAB_DEFINITIONS = [
|
|
|
21026
21106
|
{ key: "shots", marketCategory: "shots" },
|
|
21027
21107
|
{
|
|
21028
21108
|
key: "other",
|
|
21029
|
-
|
|
21109
|
+
// `player_props` is deliberately NOT fetched here: goals/assists/shots/corners
|
|
21110
|
+
// props already have dedicated tabs (resolveMarketSectionTabKey routes them
|
|
21111
|
+
// there by category), so including the group would re-fetch hundreds of props
|
|
21112
|
+
// already shown elsewhere. The handful with no stat category (e.g. "saves")
|
|
21113
|
+
// are back-filled from the game-wide set in resolveSportsSectionMarkets.
|
|
21114
|
+
marketGroup: ["other", "team_props", "specials", "completion"]
|
|
21030
21115
|
}
|
|
21031
21116
|
];
|
|
21032
21117
|
var SPORTS_NON_STANDARD_VISIBLE_TAB_KEYS = ["game_lines", "other"];
|
|
@@ -21195,6 +21280,13 @@ var resolveSportsSectionMarkets = ({
|
|
|
21195
21280
|
const filteredSectionMarkets = effectiveSectionMarkets.filter(
|
|
21196
21281
|
(market) => resolveMarketSectionTabKey(market) === tabKey
|
|
21197
21282
|
);
|
|
21283
|
+
if (tabKey === "other") {
|
|
21284
|
+
const seenIds = new Set(filteredSectionMarkets.map((market) => market.id));
|
|
21285
|
+
const strayOtherMarkets = eventMarkets.filter(
|
|
21286
|
+
(market) => !seenIds.has(market.id) && resolveMarketSectionTabKey(market) === "other"
|
|
21287
|
+
);
|
|
21288
|
+
return [...filteredSectionMarkets, ...strayOtherMarkets];
|
|
21289
|
+
}
|
|
21198
21290
|
if (tabKey !== "game_lines") return filteredSectionMarkets;
|
|
21199
21291
|
const eventMoneylineMarkets = (() => {
|
|
21200
21292
|
const dedupedMarkets = [];
|
|
@@ -21250,6 +21342,48 @@ var resolveSportsLineFamilyKey = (market) => {
|
|
|
21250
21342
|
const aggKey = resolveSportsMarketAggKey(market);
|
|
21251
21343
|
return aggKey ? aggKey.replace(AGGKEY_LINE_TOKEN_PATTERN, "") : "";
|
|
21252
21344
|
};
|
|
21345
|
+
var resolveSpreadFamilyKey = (market) => {
|
|
21346
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
21347
|
+
return aggKey ? aggKey.replace(/_sp_.+$/i, "_sp") : "";
|
|
21348
|
+
};
|
|
21349
|
+
var resolveSpreadFavoredToken = (market) => {
|
|
21350
|
+
var _a, _b, _c;
|
|
21351
|
+
const aggKey = resolveSportsMarketAggKey(market);
|
|
21352
|
+
return (_c = (_b = (_a = aggKey.match(/_sp_([a-z0-9]+?)_\d+p\d+/i)) == null ? void 0 : _a[1]) == null ? void 0 : _b.toLowerCase()) != null ? _c : null;
|
|
21353
|
+
};
|
|
21354
|
+
var resolveSpreadHomeToken = (markets) => {
|
|
21355
|
+
var _a;
|
|
21356
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
21357
|
+
let prefix = "";
|
|
21358
|
+
for (const market of markets) {
|
|
21359
|
+
const token = resolveSpreadFavoredToken(market);
|
|
21360
|
+
if (token) tokens.add(token);
|
|
21361
|
+
if (!prefix) prefix = (_a = resolveSportsMarketAggKey(market).split("_sp_")[0]) != null ? _a : "";
|
|
21362
|
+
}
|
|
21363
|
+
if (tokens.size === 0 || !prefix) return null;
|
|
21364
|
+
return Array.from(tokens).sort((left, right) => prefix.indexOf(left) - prefix.indexOf(right))[0];
|
|
21365
|
+
};
|
|
21366
|
+
var SPREAD_NON_TEAM_TITLE_PATTERN = /\b(?:yes|no|over|under|wins?\s+by|reg\.?\s*time|goal\s*diff|more\s+than|less\s+than|halftime|1st\s+half|2nd\s+half|goals?)\b/i;
|
|
21367
|
+
var isSpreadTeamTitle = (title2) => {
|
|
21368
|
+
const trimmed = toTrimmedString(title2);
|
|
21369
|
+
if (!trimmed || trimmed.length > 24) return false;
|
|
21370
|
+
const normalized = trimmed.toLowerCase();
|
|
21371
|
+
if (normalized === "yes" || normalized === "no") return false;
|
|
21372
|
+
return !SPREAD_NON_TEAM_TITLE_PATTERN.test(trimmed);
|
|
21373
|
+
};
|
|
21374
|
+
var resolveSpreadOutcomeTeamNames = (activeMarket, groupMarkets) => {
|
|
21375
|
+
const aggKey = resolveSportsMarketAggKey(activeMarket);
|
|
21376
|
+
const twins = aggKey ? groupMarkets.filter((market) => resolveSportsMarketAggKey(market) === aggKey) : [activeMarket];
|
|
21377
|
+
const pickName = (index) => {
|
|
21378
|
+
const cleanTitles = twins.map((market) => {
|
|
21379
|
+
var _a, _b;
|
|
21380
|
+
return toTrimmedString((_b = (_a = market.venueMarketOutcomes) == null ? void 0 : _a[index]) == null ? void 0 : _b.title);
|
|
21381
|
+
}).filter((title2) => isSpreadTeamTitle(title2));
|
|
21382
|
+
if (cleanTitles.length === 0) return null;
|
|
21383
|
+
return cleanTitles.reduce((longest, title2) => title2.length > longest.length ? title2 : longest);
|
|
21384
|
+
};
|
|
21385
|
+
return { favored: pickName(0), dog: pickName(1) };
|
|
21386
|
+
};
|
|
21253
21387
|
var resolveDisplayGroupFamilyKey = (market) => {
|
|
21254
21388
|
var _a, _b, _c;
|
|
21255
21389
|
const normalizedQuestion = sanitizeFamilyValue(toTrimmedString(market.question));
|
|
@@ -21264,7 +21398,8 @@ var resolveDisplayGroupFamilyKey = (market) => {
|
|
|
21264
21398
|
}
|
|
21265
21399
|
const lineFamily = resolveSportsLineFamilyKey(market);
|
|
21266
21400
|
if (sportsMarketType === "spread") {
|
|
21267
|
-
|
|
21401
|
+
const spreadFamily = resolveSpreadFamilyKey(market);
|
|
21402
|
+
return spreadFamily ? `${period}|spread|${spreadFamily}` : `${period}|spread|${marketCategory}`;
|
|
21268
21403
|
}
|
|
21269
21404
|
if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
|
|
21270
21405
|
return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
@@ -21424,17 +21559,33 @@ var resolveSlideKind = (group) => {
|
|
|
21424
21559
|
if (group.sportsMarketType === "total") return "total";
|
|
21425
21560
|
return "other";
|
|
21426
21561
|
};
|
|
21427
|
-
var aggregateSportsLineStops = (markets) => {
|
|
21562
|
+
var aggregateSportsLineStops = (markets, isSpread = false) => {
|
|
21428
21563
|
var _a;
|
|
21429
|
-
const
|
|
21564
|
+
const homeToken = isSpread ? resolveSpreadHomeToken(markets) : null;
|
|
21565
|
+
const axisOf = (market) => {
|
|
21566
|
+
var _a2, _b;
|
|
21567
|
+
if (homeToken) {
|
|
21568
|
+
const favored = resolveSpreadFavoredToken(market);
|
|
21569
|
+
if (favored) {
|
|
21570
|
+
const magnitude = Math.abs((_a2 = market.lineValue) != null ? _a2 : 0);
|
|
21571
|
+
return favored === homeToken ? -magnitude : magnitude;
|
|
21572
|
+
}
|
|
21573
|
+
}
|
|
21574
|
+
return (_b = market.lineValue) != null ? _b : Number.NEGATIVE_INFINITY;
|
|
21575
|
+
};
|
|
21576
|
+
const displayOf = (market) => {
|
|
21577
|
+
var _a2;
|
|
21578
|
+
return homeToken ? resolveSelectedSportsLineValue(Math.abs((_a2 = market.lineValue) != null ? _a2 : 0)) : resolveSelectedSportsLineValue(market.lineValue);
|
|
21579
|
+
};
|
|
21580
|
+
const marketsByAxis = /* @__PURE__ */ new Map();
|
|
21430
21581
|
for (const market of markets) {
|
|
21431
|
-
const
|
|
21432
|
-
const lineMarkets = (_a =
|
|
21582
|
+
const axis = axisOf(market);
|
|
21583
|
+
const lineMarkets = (_a = marketsByAxis.get(axis)) != null ? _a : [];
|
|
21433
21584
|
lineMarkets.push(market);
|
|
21434
|
-
|
|
21585
|
+
marketsByAxis.set(axis, lineMarkets);
|
|
21435
21586
|
}
|
|
21436
|
-
return Array.from(
|
|
21437
|
-
var _a2
|
|
21587
|
+
return Array.from(marketsByAxis.entries()).map(([axis, lineMarkets]) => {
|
|
21588
|
+
var _a2;
|
|
21438
21589
|
const representative = (_a2 = lineMarkets[resolveHighestVolumeIndex(lineMarkets)]) != null ? _a2 : lineMarkets[0];
|
|
21439
21590
|
const venues = /* @__PURE__ */ new Set();
|
|
21440
21591
|
for (const lineMarket of lineMarkets) {
|
|
@@ -21443,18 +21594,18 @@ var aggregateSportsLineStops = (markets) => {
|
|
|
21443
21594
|
}
|
|
21444
21595
|
}
|
|
21445
21596
|
return {
|
|
21446
|
-
value,
|
|
21597
|
+
value: displayOf(representative),
|
|
21447
21598
|
representative,
|
|
21448
21599
|
venues: Array.from(venues),
|
|
21449
21600
|
volume: resolveTotalGroupVolume(lineMarkets),
|
|
21450
|
-
lineValue:
|
|
21601
|
+
lineValue: axis
|
|
21451
21602
|
};
|
|
21452
21603
|
}).sort(
|
|
21453
21604
|
(left, right) => left.lineValue !== right.lineValue ? left.lineValue - right.lineValue : left.value.localeCompare(right.value)
|
|
21454
21605
|
);
|
|
21455
21606
|
};
|
|
21456
21607
|
var buildSportsSlideFromGroup = (group) => {
|
|
21457
|
-
const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets) : [];
|
|
21608
|
+
const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
|
|
21458
21609
|
const hasLadder = lineStops.length > 1;
|
|
21459
21610
|
const stops = hasLadder ? lineStops.map((lineStop) => ({
|
|
21460
21611
|
value: lineStop.value,
|
|
@@ -21893,6 +22044,45 @@ var SportsMarketCard = ({
|
|
|
21893
22044
|
];
|
|
21894
22045
|
});
|
|
21895
22046
|
}, [combinedMoneylineMarkets, isCombinedMoneylineGroup, midpointsResult]);
|
|
22047
|
+
const spreadHeaderOutcomeItems = (0, import_react36.useMemo)(() => {
|
|
22048
|
+
var _a2;
|
|
22049
|
+
if (slide.kind !== "spread" || !activeMarket) return void 0;
|
|
22050
|
+
const outcomes = (_a2 = activeMarket.venueMarketOutcomes) != null ? _a2 : [];
|
|
22051
|
+
const lineValue = activeMarket.lineValue;
|
|
22052
|
+
if (outcomes.length < 2 || lineValue == null) return void 0;
|
|
22053
|
+
const { favored, dog } = resolveSpreadOutcomeTeamNames(activeMarket, group.markets);
|
|
22054
|
+
if (!favored && !dog) return void 0;
|
|
22055
|
+
const magnitude = Math.abs(lineValue);
|
|
22056
|
+
const formatLine = (value) => `${value > 0 ? "+" : "\u2212"}${Number.isInteger(magnitude) ? String(magnitude) : magnitude.toFixed(1)}`;
|
|
22057
|
+
return [
|
|
22058
|
+
{ index: 0, name: favored, signedLine: -magnitude },
|
|
22059
|
+
{ index: 1, name: dog, signedLine: magnitude }
|
|
22060
|
+
].flatMap(({ index, name, signedLine }) => {
|
|
22061
|
+
var _a3;
|
|
22062
|
+
const outcome = outcomes[index];
|
|
22063
|
+
if (!outcome) return [];
|
|
22064
|
+
const label2 = name != null ? name : outcome.label.trim();
|
|
22065
|
+
const probability = midpointsResult == null ? void 0 : getDisplayOutcomePrice({
|
|
22066
|
+
outcomeId: outcome.id,
|
|
22067
|
+
outcomeLabel: outcome.label,
|
|
22068
|
+
bestMidpointsByOutcomeId: (_a3 = midpointsResult.bestMidpointsByOutcomeId) != null ? _a3 : midpointsResult.prices
|
|
22069
|
+
});
|
|
22070
|
+
return [
|
|
22071
|
+
{
|
|
22072
|
+
id: outcome.id,
|
|
22073
|
+
label: label2,
|
|
22074
|
+
title: label2,
|
|
22075
|
+
lineLabel: formatLine(signedLine),
|
|
22076
|
+
probability,
|
|
22077
|
+
isPriceLoading: (midpointsResult == null ? void 0 : midpointsResult.isLoading) === true && probability == null,
|
|
22078
|
+
tone: index === 0 ? "positive" : "negative",
|
|
22079
|
+
variant: "line",
|
|
22080
|
+
venue: activeMarket.venue
|
|
22081
|
+
}
|
|
22082
|
+
];
|
|
22083
|
+
});
|
|
22084
|
+
}, [slide.kind, activeMarket, group.markets, midpointsResult]);
|
|
22085
|
+
const headerOutcomeItemsOverride = combinedMoneylineHeaderOutcomeItems != null ? combinedMoneylineHeaderOutcomeItems : spreadHeaderOutcomeItems;
|
|
21896
22086
|
const headerOutcomeVariant = isCombinedMoneylineGroup ? "outcome" : resolveSportsMarketCardVariant(activeMarket);
|
|
21897
22087
|
const handleLineSelect = (index) => {
|
|
21898
22088
|
var _a2, _b2;
|
|
@@ -21923,7 +22113,7 @@ var SportsMarketCard = ({
|
|
|
21923
22113
|
compactHeader: true,
|
|
21924
22114
|
subtitleOverride: compactSubtitle,
|
|
21925
22115
|
headerOutcomeVariant,
|
|
21926
|
-
headerOutcomeItemsOverride
|
|
22116
|
+
headerOutcomeItemsOverride,
|
|
21927
22117
|
isOpened: isExpanded,
|
|
21928
22118
|
suppressOutcomeFallbackSelection: activeMarket.id !== (tradingContext == null ? void 0 : tradingContext.selectedMarketId),
|
|
21929
22119
|
onOpenChange: () => onToggle(group.id, activeMarket),
|
package/dist/pages.mjs
CHANGED
|
@@ -8,17 +8,17 @@ import {
|
|
|
8
8
|
UserProfilePage,
|
|
9
9
|
buildAggTxExplorerHref,
|
|
10
10
|
useHomePageModals
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-XJTNK3DS.mjs";
|
|
12
|
+
import "./chunk-3R2CQTNM.mjs";
|
|
13
13
|
import {
|
|
14
14
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
15
15
|
WITHDRAW_MODAL_OPEN_EVENT,
|
|
16
16
|
requestAggDepositModalOpen,
|
|
17
17
|
requestAggWithdrawModalOpen
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-MXM5PM4A.mjs";
|
|
19
|
+
import "./chunk-SG573ODC.mjs";
|
|
20
|
+
import "./chunk-7OVSGWI7.mjs";
|
|
21
|
+
import "./chunk-6Z5GQ3KL.mjs";
|
|
22
22
|
export {
|
|
23
23
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
24
24
|
EventMarketPage,
|
package/dist/primitives.js
CHANGED
|
@@ -6557,23 +6557,69 @@ var isSportEvent = (categories, structureType) => {
|
|
|
6557
6557
|
return isSportCategoryToken(categoryEntry.id) || isSportCategoryToken((_a2 = categoryEntry.category) == null ? void 0 : _a2.id) || isSportCategoryToken((_b = categoryEntry.category) == null ? void 0 : _b.name) || isSportCategoryToken((_c = categoryEntry.category) == null ? void 0 : _c.displayName) || isSportCategoryToken((_d = categoryEntry.category) == null ? void 0 : _d.parentId);
|
|
6558
6558
|
})) != null ? _a : false;
|
|
6559
6559
|
};
|
|
6560
|
-
var
|
|
6561
|
-
|
|
6560
|
+
var hasFixtureMarketMetadata = (venueMarkets) => {
|
|
6561
|
+
var _a;
|
|
6562
|
+
return (_a = venueMarkets == null ? void 0 : venueMarkets.some((venueMarket) => {
|
|
6563
|
+
var _a2, _b, _c, _d;
|
|
6564
|
+
return Boolean(
|
|
6565
|
+
((_a2 = venueMarket.sportsMarketType) == null ? void 0 : _a2.trim()) || ((_b = venueMarket.marketCategory) == null ? void 0 : _b.trim()) || ((_c = venueMarket.marketSubtype) == null ? void 0 : _c.trim()) || ((_d = venueMarket.period) == null ? void 0 : _d.trim()) || venueMarket.lineValue != null
|
|
6566
|
+
);
|
|
6567
|
+
})) != null ? _a : false;
|
|
6568
|
+
};
|
|
6569
|
+
var shouldDisplaySportsEventTimestamp = ({
|
|
6562
6570
|
categories,
|
|
6563
6571
|
structureType,
|
|
6572
|
+
venueMarkets
|
|
6573
|
+
}) => {
|
|
6574
|
+
if (!isSportEvent(categories, structureType)) return false;
|
|
6575
|
+
if (structureType === "sport") {
|
|
6576
|
+
return true;
|
|
6577
|
+
}
|
|
6578
|
+
if (typeof structureType === "string" && structureType.trim()) {
|
|
6579
|
+
return false;
|
|
6580
|
+
}
|
|
6581
|
+
return hasFixtureMarketMetadata(venueMarkets);
|
|
6582
|
+
};
|
|
6583
|
+
var resolveSportsEventTimestamp = ({
|
|
6564
6584
|
gameStartTime,
|
|
6565
6585
|
endDate
|
|
6586
|
+
}) => {
|
|
6587
|
+
return (gameStartTime == null ? void 0 : gameStartTime.trim()) || (endDate == null ? void 0 : endDate.trim()) || null;
|
|
6588
|
+
};
|
|
6589
|
+
var resolveEventTimestampLabel = ({
|
|
6590
|
+
categories,
|
|
6591
|
+
structureType,
|
|
6592
|
+
gameStartTime,
|
|
6593
|
+
endDate,
|
|
6594
|
+
venueMarkets
|
|
6595
|
+
}) => {
|
|
6596
|
+
if (!shouldDisplaySportsEventTimestamp({ categories, structureType, venueMarkets })) {
|
|
6597
|
+
return null;
|
|
6598
|
+
}
|
|
6599
|
+
const timestamp = resolveSportsEventTimestamp({ gameStartTime, endDate });
|
|
6600
|
+
if (!timestamp) return null;
|
|
6601
|
+
return formatSportsEventTimeEt(timestamp);
|
|
6602
|
+
};
|
|
6603
|
+
var resolveEventHeading = ({
|
|
6604
|
+
title: title2,
|
|
6605
|
+
categories,
|
|
6606
|
+
structureType,
|
|
6607
|
+
gameStartTime,
|
|
6608
|
+
endDate,
|
|
6609
|
+
venueMarkets
|
|
6566
6610
|
}) => {
|
|
6567
6611
|
const resolvedTitle = title2.trim();
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6612
|
+
return {
|
|
6613
|
+
title: resolvedTitle,
|
|
6614
|
+
timestampLabel: resolveEventTimestampLabel({
|
|
6615
|
+
title: resolvedTitle,
|
|
6616
|
+
categories,
|
|
6617
|
+
structureType,
|
|
6618
|
+
gameStartTime,
|
|
6619
|
+
endDate,
|
|
6620
|
+
venueMarkets
|
|
6621
|
+
})
|
|
6622
|
+
};
|
|
6577
6623
|
};
|
|
6578
6624
|
|
|
6579
6625
|
// src/events/item/event-list-item.utils.ts
|
|
@@ -6872,13 +6918,13 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
|
|
|
6872
6918
|
const probability = normalizeProbability(
|
|
6873
6919
|
(_a = options == null ? void 0 : options.priceByOutcomeId) == null ? void 0 : _a.get(visibleOutcome.outcome.id)
|
|
6874
6920
|
);
|
|
6875
|
-
const resolvedTitle =
|
|
6921
|
+
const resolvedTitle = resolveEventHeading({
|
|
6876
6922
|
title: (_b = event == null ? void 0 : event.title) != null ? _b : "",
|
|
6877
6923
|
categories: event.categories,
|
|
6878
6924
|
structureType: event.structureType,
|
|
6879
6925
|
gameStartTime: event.gameStartTime,
|
|
6880
6926
|
endDate: event.endDate
|
|
6881
|
-
});
|
|
6927
|
+
}).title;
|
|
6882
6928
|
if (!resolvedTitle) return null;
|
|
6883
6929
|
const { marketCount, venueCount } = getVenueSummary(event.venueMarkets);
|
|
6884
6930
|
const marketSummaryLabel = [
|
package/dist/primitives.mjs
CHANGED
package/dist/trading.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
parseVenue,
|
|
9
9
|
useClaimWinnings,
|
|
10
10
|
useResolvedMarketClaim
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MXM5PM4A.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SETTLEMENT_SECTION_ID,
|
|
14
14
|
Settlement,
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
getTradingValueLabel,
|
|
24
24
|
getTradingVenueLabel,
|
|
25
25
|
useEventTradingContext
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-SG573ODC.mjs";
|
|
27
|
+
import "./chunk-7OVSGWI7.mjs";
|
|
28
|
+
import "./chunk-6Z5GQ3KL.mjs";
|
|
29
29
|
export {
|
|
30
30
|
PlaceOrder,
|
|
31
31
|
PlaceOrderFailureView,
|
|
@@ -7,18 +7,33 @@ type EventCategoryLike = {
|
|
|
7
7
|
parentId?: string | null;
|
|
8
8
|
} | null;
|
|
9
9
|
};
|
|
10
|
-
type
|
|
10
|
+
type ResolveEventHeadingParams = {
|
|
11
11
|
title: string;
|
|
12
12
|
categories?: readonly EventCategoryLike[] | null;
|
|
13
13
|
structureType?: string | null;
|
|
14
14
|
/**
|
|
15
|
-
* Scheduled kickoff of the underlying game.
|
|
16
|
-
*
|
|
17
|
-
* can sit well after the game (e.g. Kalshi World Cup markets expire weeks
|
|
18
|
-
* later — a June 22 game would otherwise read "- July 6").
|
|
15
|
+
* Scheduled kickoff/start of the underlying game. This is the only event
|
|
16
|
+
* date we currently trust as user-meaningful on list/tile surfaces.
|
|
19
17
|
*/
|
|
20
18
|
gameStartTime?: string | null;
|
|
21
19
|
endDate?: string | null;
|
|
20
|
+
venueMarkets?: readonly EventMarketLike[] | null;
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
type EventHeading = {
|
|
23
|
+
title: string;
|
|
24
|
+
timestampLabel: string | null;
|
|
25
|
+
};
|
|
26
|
+
type EventMarketLike = {
|
|
27
|
+
sportsMarketType?: string | null;
|
|
28
|
+
marketCategory?: string | null;
|
|
29
|
+
marketGroup?: string | null;
|
|
30
|
+
marketSubtype?: string | null;
|
|
31
|
+
period?: string | null;
|
|
32
|
+
lineValue?: number | null;
|
|
33
|
+
};
|
|
34
|
+
export declare const isSportEvent: (categories: readonly EventCategoryLike[] | null | undefined, structureType: string | null | undefined) => boolean;
|
|
35
|
+
export declare const shouldDisplaySportsEventTimestamp: ({ categories, structureType, venueMarkets, }: Pick<ResolveEventHeadingParams, "categories" | "structureType" | "venueMarkets">) => boolean;
|
|
36
|
+
export declare const resolveSportsEventTimestamp: ({ gameStartTime, endDate, }: Pick<ResolveEventHeadingParams, "gameStartTime" | "endDate">) => string | null;
|
|
37
|
+
export declare const resolveEventTimestampLabel: ({ categories, structureType, gameStartTime, endDate, venueMarkets, }: ResolveEventHeadingParams) => string | null;
|
|
38
|
+
export declare const resolveEventHeading: ({ title, categories, structureType, gameStartTime, endDate, venueMarkets, }: ResolveEventHeadingParams) => EventHeading;
|
|
24
39
|
export {};
|