@agg-build/ui 2.1.1 → 2.1.2
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-TERG43WW.mjs → chunk-5RBHMMY3.mjs} +1 -1
- package/dist/{chunk-RPXRTXCY.mjs → chunk-75AMJAWR.mjs} +1 -1
- package/dist/{chunk-IQT4I5B4.mjs → chunk-7ZR5JYB3.mjs} +39 -241
- package/dist/{chunk-NK57KMYN.mjs → chunk-JJDYOBVG.mjs} +117 -48
- package/dist/{chunk-WU2C3C6K.mjs → chunk-NRNBJPYK.mjs} +1 -1
- package/dist/{chunk-YJO6LMRT.mjs → chunk-TBD3N4T4.mjs} +69 -7
- package/dist/{chunk-XHDGSRG7.mjs → chunk-ZOECARZW.mjs} +359 -14
- package/dist/events.js +175 -59
- package/dist/events.mjs +3 -3
- package/dist/index.js +1080 -820
- package/dist/index.mjs +12 -8
- package/dist/modals.js +1 -1
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +845 -589
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +68 -7
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +679 -339
- package/dist/trading.mjs +10 -6
- package/dist/types/events/shared/format-event-title.d.mts +25 -0
- package/dist/types/events/shared/format-event-title.d.ts +25 -0
- package/dist/types/events/shared/select-best-outcome.d.mts +88 -0
- package/dist/types/events/shared/select-best-outcome.d.ts +88 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +7 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +7 -0
- package/dist/types/primitives/search/search.utils.d.mts +3 -1
- package/dist/types/primitives/search/search.utils.d.ts +3 -1
- package/dist/types/trading/index.d.mts +2 -0
- package/dist/types/trading/index.d.ts +2 -0
- package/dist/types/trading/place-order/index.d.mts +1 -1
- package/dist/types/trading/place-order/index.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +23 -1
- package/dist/types/trading/place-order/index.place-order.types.d.ts +23 -1
- package/dist/types/trading/use-claim-winnings.d.mts +84 -0
- package/dist/types/trading/use-claim-winnings.d.ts +84 -0
- package/dist/types/trading/use-resolved-market-claim.d.mts +26 -0
- package/dist/types/trading/use-resolved-market-claim.d.ts +26 -0
- package/package.json +3 -3
package/dist/events.js
CHANGED
|
@@ -5491,6 +5491,56 @@ var VenueLogo = ({
|
|
|
5491
5491
|
};
|
|
5492
5492
|
VenueLogo.displayName = "VenueLogo";
|
|
5493
5493
|
|
|
5494
|
+
// src/events/shared/format-event-title.ts
|
|
5495
|
+
var import_dayjs2 = __toESM(require("dayjs"));
|
|
5496
|
+
var SPORT_CATEGORY_TOKENS = /* @__PURE__ */ new Set(["sport", "sports"]);
|
|
5497
|
+
var normalizeCategoryToken = (value) => {
|
|
5498
|
+
if (typeof value !== "string") return null;
|
|
5499
|
+
const normalizedValue = value.trim().toLowerCase();
|
|
5500
|
+
if (!normalizedValue) return null;
|
|
5501
|
+
return normalizedValue;
|
|
5502
|
+
};
|
|
5503
|
+
var isSportCategoryToken = (value) => {
|
|
5504
|
+
const normalizedValue = normalizeCategoryToken(value);
|
|
5505
|
+
if (!normalizedValue) return false;
|
|
5506
|
+
return SPORT_CATEGORY_TOKENS.has(normalizedValue);
|
|
5507
|
+
};
|
|
5508
|
+
var isSportEvent = (categories, structureType) => {
|
|
5509
|
+
var _a;
|
|
5510
|
+
if (isSportCategoryToken(structureType)) return true;
|
|
5511
|
+
return (_a = categories == null ? void 0 : categories.some((categoryEntry) => {
|
|
5512
|
+
var _a2, _b, _c, _d;
|
|
5513
|
+
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);
|
|
5514
|
+
})) != null ? _a : false;
|
|
5515
|
+
};
|
|
5516
|
+
var formatEventDateSuffix = (value, locale) => {
|
|
5517
|
+
if (!(0, import_dayjs2.default)(value).isValid()) return null;
|
|
5518
|
+
return new Intl.DateTimeFormat(locale, {
|
|
5519
|
+
month: "long",
|
|
5520
|
+
day: "numeric",
|
|
5521
|
+
timeZone: "UTC"
|
|
5522
|
+
}).format(new Date(value));
|
|
5523
|
+
};
|
|
5524
|
+
var formatEventTitleWithDateSuffix = ({
|
|
5525
|
+
title: title2,
|
|
5526
|
+
categories,
|
|
5527
|
+
structureType,
|
|
5528
|
+
gameStartTime,
|
|
5529
|
+
endDate,
|
|
5530
|
+
locale = "en-US"
|
|
5531
|
+
}) => {
|
|
5532
|
+
const resolvedTitle = title2.trim();
|
|
5533
|
+
if (!resolvedTitle) return resolvedTitle;
|
|
5534
|
+
if (!isSportEvent(categories, structureType)) return resolvedTitle;
|
|
5535
|
+
const dateSource = gameStartTime != null ? gameStartTime : endDate;
|
|
5536
|
+
if (!dateSource) return resolvedTitle;
|
|
5537
|
+
const formattedDate = formatEventDateSuffix(dateSource, locale);
|
|
5538
|
+
if (!formattedDate) return resolvedTitle;
|
|
5539
|
+
const suffix = ` - ${formattedDate}`;
|
|
5540
|
+
if (resolvedTitle.endsWith(suffix)) return resolvedTitle;
|
|
5541
|
+
return `${resolvedTitle}${suffix}`;
|
|
5542
|
+
};
|
|
5543
|
+
|
|
5494
5544
|
// src/events/item/event-list-item.utils.ts
|
|
5495
5545
|
var import_hooks25 = require("@agg-build/hooks");
|
|
5496
5546
|
|
|
@@ -6147,7 +6197,7 @@ var Select = ({
|
|
|
6147
6197
|
disabled: item.disabled,
|
|
6148
6198
|
className: cn(
|
|
6149
6199
|
"agg-select-item",
|
|
6150
|
-
"relative flex w-full items-center gap-3 rounded-[6px]
|
|
6200
|
+
"relative flex w-full items-center gap-3 rounded-[6px] pl-3 pr-5 py-3 text-left text-agg-sm leading-agg-5 outline-none",
|
|
6151
6201
|
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
6152
6202
|
isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
6153
6203
|
item.disabled && "cursor-not-allowed opacity-60",
|
|
@@ -7371,7 +7421,14 @@ var EventListItemContent = ({
|
|
|
7371
7421
|
const config = (0, import_hooks31.useSdkUiConfig)();
|
|
7372
7422
|
const labels = (0, import_hooks31.useLabels)();
|
|
7373
7423
|
const allVenueMarkets = (0, import_react10.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
7374
|
-
const resolvedTitle =
|
|
7424
|
+
const resolvedTitle = formatEventTitleWithDateSuffix({
|
|
7425
|
+
title: event.title,
|
|
7426
|
+
categories: event.categories,
|
|
7427
|
+
structureType: event.structureType,
|
|
7428
|
+
gameStartTime: event.gameStartTime,
|
|
7429
|
+
endDate: event.endDate,
|
|
7430
|
+
locale: config.general.locale
|
|
7431
|
+
});
|
|
7375
7432
|
const resolvedImage = event.image;
|
|
7376
7433
|
const visibleVenueLogos = (0, import_react10.useMemo)(() => {
|
|
7377
7434
|
var _a2;
|
|
@@ -7984,10 +8041,10 @@ var import_hooks33 = require("@agg-build/hooks");
|
|
|
7984
8041
|
|
|
7985
8042
|
// src/events/market-details/market-details.utils.ts
|
|
7986
8043
|
var import_sdk12 = require("@agg-build/sdk");
|
|
7987
|
-
var
|
|
8044
|
+
var import_dayjs4 = __toESM(require("dayjs"));
|
|
7988
8045
|
|
|
7989
8046
|
// src/events/item-details/event-list-item-details.utils.ts
|
|
7990
|
-
var
|
|
8047
|
+
var import_dayjs3 = __toESM(require("dayjs"));
|
|
7991
8048
|
var compareOutcomeSelectorLabels = (leftLabel, rightLabel) => {
|
|
7992
8049
|
const leftSemanticLabel = toSemanticLabel(leftLabel);
|
|
7993
8050
|
const rightSemanticLabel = toSemanticLabel(rightLabel);
|
|
@@ -8000,8 +8057,8 @@ var compareOutcomeSelectorLabels = (leftLabel, rightLabel) => {
|
|
|
8000
8057
|
if (leftBinaryOrder != null && rightBinaryOrder != null) {
|
|
8001
8058
|
return leftBinaryOrder - rightBinaryOrder;
|
|
8002
8059
|
}
|
|
8003
|
-
const leftDate = isDateLikeLabel(leftLabel) ? (0,
|
|
8004
|
-
const rightDate = isDateLikeLabel(rightLabel) ? (0,
|
|
8060
|
+
const leftDate = isDateLikeLabel(leftLabel) ? (0, import_dayjs3.default)(leftLabel).valueOf() : null;
|
|
8061
|
+
const rightDate = isDateLikeLabel(rightLabel) ? (0, import_dayjs3.default)(rightLabel).valueOf() : null;
|
|
8005
8062
|
if (leftDate != null && rightDate != null && leftDate !== rightDate) {
|
|
8006
8063
|
return leftDate - rightDate;
|
|
8007
8064
|
}
|
|
@@ -8042,7 +8099,7 @@ var toSemanticLabel = (value) => {
|
|
|
8042
8099
|
};
|
|
8043
8100
|
var isDateLikeLabel = (value) => {
|
|
8044
8101
|
if (!value.trim()) return false;
|
|
8045
|
-
return (0,
|
|
8102
|
+
return (0, import_dayjs3.default)(value).isValid();
|
|
8046
8103
|
};
|
|
8047
8104
|
var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
|
|
8048
8105
|
const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
|
|
@@ -8556,19 +8613,19 @@ var resolveOtherTabRows = (market, labels) => {
|
|
|
8556
8613
|
if (market.creationDate) {
|
|
8557
8614
|
rows.push({
|
|
8558
8615
|
label: labels.marketDetails.meta.created,
|
|
8559
|
-
value: (0,
|
|
8616
|
+
value: (0, import_dayjs4.default)(market.creationDate).format("MMM D, YYYY")
|
|
8560
8617
|
});
|
|
8561
8618
|
}
|
|
8562
8619
|
if (market.startDate) {
|
|
8563
8620
|
rows.push({
|
|
8564
8621
|
label: labels.marketDetails.meta.opens,
|
|
8565
|
-
value: (0,
|
|
8622
|
+
value: (0, import_dayjs4.default)(market.startDate).format("MMM D, YYYY")
|
|
8566
8623
|
});
|
|
8567
8624
|
}
|
|
8568
8625
|
if (market.endDate) {
|
|
8569
8626
|
rows.push({
|
|
8570
8627
|
label: labels.marketDetails.meta.closes,
|
|
8571
|
-
value: (0,
|
|
8628
|
+
value: (0, import_dayjs4.default)(market.endDate).format("MMM D, YYYY")
|
|
8572
8629
|
});
|
|
8573
8630
|
}
|
|
8574
8631
|
if (rows.length === 1) {
|
|
@@ -9653,7 +9710,7 @@ var import_react14 = require("react");
|
|
|
9653
9710
|
|
|
9654
9711
|
// src/trading/utils.ts
|
|
9655
9712
|
var import_hooks37 = require("@agg-build/hooks");
|
|
9656
|
-
var
|
|
9713
|
+
var import_dayjs5 = __toESM(require("dayjs"));
|
|
9657
9714
|
var defaultLabels = (0, import_hooks37.resolveAggUiLabels)("en-US");
|
|
9658
9715
|
var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
|
|
9659
9716
|
var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
|
|
@@ -10504,11 +10561,28 @@ var EventListItemDetailsContent = ({
|
|
|
10504
10561
|
if (typeof resolvedVolume !== "number") return "";
|
|
10505
10562
|
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
10506
10563
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, venueMarkets]);
|
|
10564
|
+
const resolvedTitle = (0, import_react16.useMemo)(() => {
|
|
10565
|
+
return formatEventTitleWithDateSuffix({
|
|
10566
|
+
title: event.title,
|
|
10567
|
+
categories: event.categories,
|
|
10568
|
+
structureType: event.structureType,
|
|
10569
|
+
gameStartTime: event.gameStartTime,
|
|
10570
|
+
endDate: event.endDate,
|
|
10571
|
+
locale: config.general.locale
|
|
10572
|
+
});
|
|
10573
|
+
}, [
|
|
10574
|
+
config.general.locale,
|
|
10575
|
+
event.categories,
|
|
10576
|
+
event.gameStartTime,
|
|
10577
|
+
event.endDate,
|
|
10578
|
+
event.structureType,
|
|
10579
|
+
event.title
|
|
10580
|
+
]);
|
|
10507
10581
|
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
10508
10582
|
Card,
|
|
10509
10583
|
{
|
|
10510
10584
|
className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
10511
|
-
"aria-label": ariaLabel != null ? ariaLabel :
|
|
10585
|
+
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
10512
10586
|
onClick: () => {
|
|
10513
10587
|
onClick == null ? void 0 : onClick(event);
|
|
10514
10588
|
},
|
|
@@ -10543,7 +10617,7 @@ var EventListItemDetailsContent = ({
|
|
|
10543
10617
|
"truncate text-wrap wrap-break-word line-clamp-2",
|
|
10544
10618
|
classNames == null ? void 0 : classNames.title
|
|
10545
10619
|
),
|
|
10546
|
-
children:
|
|
10620
|
+
children: resolvedTitle
|
|
10547
10621
|
}
|
|
10548
10622
|
),
|
|
10549
10623
|
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
@@ -11241,37 +11315,71 @@ var Orderbook = ({
|
|
|
11241
11315
|
};
|
|
11242
11316
|
Orderbook.displayName = "Orderbook";
|
|
11243
11317
|
|
|
11244
|
-
// src/events/shared/
|
|
11318
|
+
// src/events/shared/select-best-outcome.ts
|
|
11245
11319
|
var normalizeOutcomeLabel3 = (label2) => {
|
|
11246
11320
|
return typeof label2 === "string" ? label2.trim().toLowerCase() : "";
|
|
11247
11321
|
};
|
|
11248
|
-
var
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11322
|
+
var selectBestOutcomeCandidate = (args) => {
|
|
11323
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
11324
|
+
const { outcomeId, selection } = args;
|
|
11325
|
+
if (!outcomeId) return void 0;
|
|
11326
|
+
const resolveVenueMarketId = (venue) => {
|
|
11327
|
+
var _a2, _b2;
|
|
11328
|
+
return venue ? (_b2 = (_a2 = args.venueMarketIdByVenue) == null ? void 0 : _a2.get(venue)) != null ? _b2 : void 0 : void 0;
|
|
11329
|
+
};
|
|
11330
|
+
const make = (price, venue, source, updatedAt) => ({
|
|
11331
|
+
price,
|
|
11332
|
+
venue: venue != null ? venue : void 0,
|
|
11333
|
+
venueMarketId: resolveVenueMarketId(venue != null ? venue : void 0),
|
|
11334
|
+
outcomeId,
|
|
11335
|
+
source,
|
|
11336
|
+
updatedAt: updatedAt != null ? updatedAt : void 0
|
|
11337
|
+
});
|
|
11338
|
+
if (selection === "buy" || selection === "sell") {
|
|
11339
|
+
const wsSidePrice = selection === "buy" ? (_a = args.live) == null ? void 0 : _a.bestAsk : (_b = args.live) == null ? void 0 : _b.bestBid;
|
|
11340
|
+
const wsSideVenue = selection === "buy" ? (_c = args.live) == null ? void 0 : _c.bestAskVenue : (_d = args.live) == null ? void 0 : _d.bestBidVenue;
|
|
11341
|
+
if (wsSidePrice != null) {
|
|
11342
|
+
return make(wsSidePrice, wsSideVenue, "ws", (_e = args.live) == null ? void 0 : _e.updatedAt);
|
|
11343
|
+
}
|
|
11344
|
+
const restSidePrice = selection === "buy" ? (_f = args.restBest) == null ? void 0 : _f.bestAsk : (_g = args.restBest) == null ? void 0 : _g.bestBid;
|
|
11345
|
+
const restSideVenue = selection === "buy" ? (_h = args.restBestVenues) == null ? void 0 : _h.bestAskVenue : (_i = args.restBestVenues) == null ? void 0 : _i.bestBidVenue;
|
|
11346
|
+
if (restSidePrice != null) {
|
|
11347
|
+
return make(restSidePrice, restSideVenue, "rest-best", void 0);
|
|
11348
|
+
}
|
|
11262
11349
|
}
|
|
11263
|
-
if (
|
|
11264
|
-
return
|
|
11350
|
+
if (((_j = args.live) == null ? void 0 : _j.midpoint) != null) {
|
|
11351
|
+
return make(args.live.midpoint, args.live.midpointVenue, "ws", args.live.updatedAt);
|
|
11352
|
+
}
|
|
11353
|
+
if (normalizeOutcomeLabel3(args.outcomeLabel) === "yes" && args.bestMidpoint != null && args.bestMidpointVenue) {
|
|
11354
|
+
return make(args.bestMidpoint, args.bestMidpointVenue, "rest-midpoint", void 0);
|
|
11355
|
+
}
|
|
11356
|
+
if (args.restMidpoint != null) {
|
|
11357
|
+
return make(args.restMidpoint, args.restMidpointVenue, "rest-midpoint", void 0);
|
|
11358
|
+
}
|
|
11359
|
+
if (args.staticPrice != null) {
|
|
11360
|
+
return make(args.staticPrice, args.staticVenue, "static", void 0);
|
|
11361
|
+
}
|
|
11362
|
+
return void 0;
|
|
11363
|
+
};
|
|
11364
|
+
var buildVenueMarketIdByVenue = (venueMarkets) => {
|
|
11365
|
+
var _a;
|
|
11366
|
+
const map = /* @__PURE__ */ new Map();
|
|
11367
|
+
if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return map;
|
|
11368
|
+
const visit = (vm) => {
|
|
11369
|
+
if (vm.venue && vm.id && !map.has(vm.venue)) map.set(vm.venue, vm.id);
|
|
11370
|
+
};
|
|
11371
|
+
for (const vm of venueMarkets) {
|
|
11372
|
+
visit(vm);
|
|
11373
|
+
for (const sibling of (_a = vm.matchedVenueMarkets) != null ? _a : []) visit(sibling);
|
|
11265
11374
|
}
|
|
11266
|
-
|
|
11267
|
-
return (_a = bestVenue != null ? bestVenue : fallbackVenue) != null ? _a : void 0;
|
|
11375
|
+
return map;
|
|
11268
11376
|
};
|
|
11269
11377
|
|
|
11270
11378
|
// src/events/shared/event-trading-state.utils.ts
|
|
11271
|
-
var
|
|
11379
|
+
var import_dayjs6 = __toESM(require("dayjs"));
|
|
11272
11380
|
var formatTradingStateDate = (value) => {
|
|
11273
|
-
if (!(0,
|
|
11274
|
-
return (0,
|
|
11381
|
+
if (!(0, import_dayjs6.default)(value).isValid()) return value;
|
|
11382
|
+
return (0, import_dayjs6.default)(value).format("MMM D, YYYY");
|
|
11275
11383
|
};
|
|
11276
11384
|
var resolveTradingStateTimestampLabel = (labels, state) => {
|
|
11277
11385
|
if (state.kind === "resolved" && state.resolvesAt) {
|
|
@@ -11507,7 +11615,7 @@ var MarketDetailsContent = ({
|
|
|
11507
11615
|
suppressOutcomeFallbackSelection,
|
|
11508
11616
|
midpointsResult
|
|
11509
11617
|
}) => {
|
|
11510
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
11618
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
11511
11619
|
const config = (0, import_hooks42.useSdkUiConfig)();
|
|
11512
11620
|
const {
|
|
11513
11621
|
features: { enableAnimations },
|
|
@@ -11521,6 +11629,7 @@ var MarketDetailsContent = ({
|
|
|
11521
11629
|
const tradeSide = (_a = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a : "buy";
|
|
11522
11630
|
const wsLivePrices = (0, import_hooks42.useLiveOutcomePrices)(venueMarkets);
|
|
11523
11631
|
const wsBestPrices = (0, import_hooks42.useLiveBestPrices)(venueMarkets);
|
|
11632
|
+
const wsBestCandidates = (0, import_hooks42.useLiveBestPriceCandidates)(venueMarkets);
|
|
11524
11633
|
const resolvedMarket = (0, import_react19.useMemo)(() => {
|
|
11525
11634
|
return resolveMarketFromVenueMarkets(venueMarkets, marketId);
|
|
11526
11635
|
}, [venueMarkets, marketId]);
|
|
@@ -11530,6 +11639,10 @@ var MarketDetailsContent = ({
|
|
|
11530
11639
|
return (_b2 = (_a2 = resolvedMarket.venueMarkets.find((venueMarket) => venueMarket.id === resolvedMarket.id)) != null ? _a2 : resolvedMarket.venueMarkets[0]) != null ? _b2 : null;
|
|
11531
11640
|
}, [resolvedMarket]);
|
|
11532
11641
|
const isResolvedMarket = (0, import_hooks42.resolveMarketTradingState)(scopedResolvedMarket).kind === "resolved";
|
|
11642
|
+
(0, import_hooks42.useEventOrderbookData)(
|
|
11643
|
+
isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
|
|
11644
|
+
(_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
|
|
11645
|
+
);
|
|
11533
11646
|
const clusterMidpointResult = midpointsResult != null ? midpointsResult : {
|
|
11534
11647
|
prices: /* @__PURE__ */ new Map(),
|
|
11535
11648
|
bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
|
|
@@ -11540,7 +11653,7 @@ var MarketDetailsContent = ({
|
|
|
11540
11653
|
bestMidpoint: void 0,
|
|
11541
11654
|
bestMidpointVenue: void 0
|
|
11542
11655
|
};
|
|
11543
|
-
const clusterMidpoints = (
|
|
11656
|
+
const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
|
|
11544
11657
|
const clusterBestMidpointsByOutcomeId = clusterMidpoints;
|
|
11545
11658
|
const clusterVenueByOutcomeId = clusterMidpointResult.venueByOutcomeId;
|
|
11546
11659
|
const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
|
|
@@ -11655,7 +11768,7 @@ var MarketDetailsContent = ({
|
|
|
11655
11768
|
tradingContext == null ? void 0 : tradingContext.selectedOutcomeId
|
|
11656
11769
|
]);
|
|
11657
11770
|
const selectedOutcomeId = scopedSelectedOutcomeState.outcomeId;
|
|
11658
|
-
const selectedOutcomeLabel = (
|
|
11771
|
+
const selectedOutcomeLabel = (_d = scopedSelectedOutcomeState.outcomeLabel) != null ? _d : null;
|
|
11659
11772
|
const selectOutcome = tradingContext == null ? void 0 : tradingContext.selectOutcome;
|
|
11660
11773
|
const [selectedGraphVenue, setSelectedGraphVenue] = (0, import_react19.useState)(null);
|
|
11661
11774
|
const [chartOutcomeLabel, setChartOutcomeLabel] = (0, import_react19.useState)(selectedOutcomeLabel);
|
|
@@ -11689,31 +11802,33 @@ var MarketDetailsContent = ({
|
|
|
11689
11802
|
tradingContext == null ? void 0 : tradingContext.selectedMarketId,
|
|
11690
11803
|
selectOutcome
|
|
11691
11804
|
]);
|
|
11805
|
+
const venueMarketIdByVenue = (0, import_react19.useMemo)(
|
|
11806
|
+
() => buildVenueMarketIdByVenue(model == null ? void 0 : model.market.venueMarkets),
|
|
11807
|
+
[model]
|
|
11808
|
+
);
|
|
11692
11809
|
const headerOutcomeItems = (0, import_react19.useMemo)(() => {
|
|
11693
11810
|
if (!model) return [];
|
|
11694
11811
|
const items = resolveHeaderOutcomeItems(model.market.venueMarkets, scopedMarketForCard);
|
|
11695
11812
|
return items.map((item) => {
|
|
11696
11813
|
var _a2;
|
|
11697
11814
|
const fallbackPrice = midpointsFallback == null ? void 0 : midpointsFallback.get(item.id);
|
|
11698
|
-
const
|
|
11815
|
+
const candidate = selectBestOutcomeCandidate({
|
|
11699
11816
|
outcomeId: item.id,
|
|
11700
11817
|
outcomeLabel: item.label,
|
|
11701
11818
|
selection: tradeSide,
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
const outcomeBestPrice = getDisplayOutcomePrice({
|
|
11708
|
-
outcomeId: item.id,
|
|
11709
|
-
outcomeLabel: item.label,
|
|
11710
|
-
selection: tradeSide,
|
|
11711
|
-
bestPrices: clusterBestPrices,
|
|
11819
|
+
live: wsBestCandidates.get(item.id),
|
|
11820
|
+
restBest: clusterBestPricesRest.get(item.id),
|
|
11821
|
+
restBestVenues: clusterBestPriceVenuesByOutcomeId.get(item.id),
|
|
11822
|
+
restMidpoint: clusterBestMidpointsByOutcomeId.get(item.id),
|
|
11823
|
+
restMidpointVenue: clusterVenueByOutcomeId.get(item.id),
|
|
11712
11824
|
bestMidpoint: clusterBestMidpoint,
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11825
|
+
bestMidpointVenue: clusterBestMidpointVenue,
|
|
11826
|
+
staticPrice: fallbackPrice,
|
|
11827
|
+
staticVenue: midpointsFallbackVenues == null ? void 0 : midpointsFallbackVenues.get(item.id),
|
|
11828
|
+
venueMarketIdByVenue
|
|
11716
11829
|
});
|
|
11830
|
+
const bestVenue = candidate == null ? void 0 : candidate.venue;
|
|
11831
|
+
const outcomeBestPrice = candidate == null ? void 0 : candidate.price;
|
|
11717
11832
|
if (isResolvedMarket) {
|
|
11718
11833
|
const isWinningOutcome = item.id === ((_a2 = marketTradingState.winningOutcome) == null ? void 0 : _a2.id);
|
|
11719
11834
|
return __spreadValues(__spreadProps(__spreadValues({}, item), {
|
|
@@ -11731,17 +11846,18 @@ var MarketDetailsContent = ({
|
|
|
11731
11846
|
clusterBestMidpoint,
|
|
11732
11847
|
clusterBestMidpointVenue,
|
|
11733
11848
|
clusterBestMidpointsByOutcomeId,
|
|
11734
|
-
|
|
11849
|
+
clusterBestPricesRest,
|
|
11735
11850
|
clusterBestPriceVenuesByOutcomeId,
|
|
11736
11851
|
model,
|
|
11737
11852
|
scopedMarketForCard,
|
|
11738
11853
|
clusterVenueByOutcomeId,
|
|
11739
11854
|
isResolvedMarket,
|
|
11740
|
-
(
|
|
11855
|
+
(_e = marketTradingState.winningOutcome) == null ? void 0 : _e.id,
|
|
11741
11856
|
midpointsFallback,
|
|
11742
11857
|
midpointsFallbackVenues,
|
|
11743
11858
|
tradeSide,
|
|
11744
|
-
|
|
11859
|
+
venueMarketIdByVenue,
|
|
11860
|
+
wsBestCandidates
|
|
11745
11861
|
]);
|
|
11746
11862
|
const headlineProbability = (0, import_react19.useMemo)(() => {
|
|
11747
11863
|
var _a2, _b2, _c2, _d2;
|
|
@@ -11807,9 +11923,9 @@ var MarketDetailsContent = ({
|
|
|
11807
11923
|
const chartEnabled = isOpened && effectiveSelectedTab === "graph";
|
|
11808
11924
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
11809
11925
|
const rollingWindow = (0, import_hooks42.useRollingChartWindow)({ range: effectiveChartTimeRange });
|
|
11810
|
-
const primaryVenueMarketId = (
|
|
11811
|
-
const primaryOutcomeId = (
|
|
11812
|
-
const chartPrimaryOutcomeId = (
|
|
11926
|
+
const primaryVenueMarketId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.market.id) != null ? _g : null;
|
|
11927
|
+
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
11928
|
+
const chartPrimaryOutcomeId = (_k = (_j = chartOutcomesByVenue[0]) == null ? void 0 : _j.outcome.id) != null ? _k : null;
|
|
11813
11929
|
const chartVenueOutcomeIds = (0, import_react19.useMemo)(() => {
|
|
11814
11930
|
return chartOutcomesByVenue.map((item) => item.outcome.id);
|
|
11815
11931
|
}, [chartOutcomesByVenue]);
|
|
@@ -12312,7 +12428,7 @@ var MarketDetailsContent = ({
|
|
|
12312
12428
|
height: 260,
|
|
12313
12429
|
isLoading: isMarketChartLoading,
|
|
12314
12430
|
chartType: selectedChartType,
|
|
12315
|
-
liveCandle: selectedChartType === "candlestick" ? (
|
|
12431
|
+
liveCandle: selectedChartType === "candlestick" ? (_l = graphLiveState.liveCandle) != null ? _l : void 0 : void 0,
|
|
12316
12432
|
lineValue: graphLiveState.lineValue,
|
|
12317
12433
|
classNames: { root: "agg-chart-region w-full" },
|
|
12318
12434
|
showSeriesControls: chartAvailableOutcomesByVenue.length > 0 || headerOutcomeItems.length > 0,
|
package/dist/events.mjs
CHANGED
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
mergeVenueOutcomeOrderbooks,
|
|
16
16
|
orderbookRowLimitDefault,
|
|
17
17
|
useCenterOrderbookSpread
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JJDYOBVG.mjs";
|
|
19
19
|
import {
|
|
20
20
|
formatProbabilityCents,
|
|
21
21
|
resolveOrderBookRows,
|
|
22
22
|
resolveUnifiedOrderBookEntries
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-5RBHMMY3.mjs";
|
|
24
|
+
import "./chunk-TBD3N4T4.mjs";
|
|
25
25
|
export {
|
|
26
26
|
EventList,
|
|
27
27
|
EventListItem,
|