@agg-build/ui 4.21.0 → 4.21.1
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-JLO2BGSF.mjs → chunk-LIB6TLLV.mjs} +1 -1
- package/dist/{chunk-DWPBGMVJ.mjs → chunk-LTFRGJPL.mjs} +121 -167
- package/dist/{chunk-DONMO42Q.mjs → chunk-R7ARCUYW.mjs} +14 -3
- package/dist/{chunk-5PA5KLXN.mjs → chunk-YBMDEGTJ.mjs} +3 -3
- package/dist/{event-market-UREM3ZE7.mjs → event-market-5SIXH2XF.mjs} +2 -2
- package/dist/events.js +121 -167
- package/dist/events.mjs +2 -2
- package/dist/index.js +140 -175
- package/dist/index.mjs +4 -4
- package/dist/pages.js +140 -175
- package/dist/pages.mjs +4 -4
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/types/events/item-details/event-markets-chart.d.mts +1 -2
- package/dist/types/events/item-details/event-markets-chart.d.ts +1 -2
- package/dist/types/events/item-details/event-markets-chart.utils.d.mts +4 -12
- package/dist/types/events/item-details/event-markets-chart.utils.d.ts +4 -12
- package/package.json +2 -2
package/dist/pages.js
CHANGED
|
@@ -15792,71 +15792,39 @@ var init_event_chart_window = __esm({
|
|
|
15792
15792
|
});
|
|
15793
15793
|
|
|
15794
15794
|
// src/events/item-details/event-markets-chart.utils.ts
|
|
15795
|
-
|
|
15796
|
-
var _a, _b;
|
|
15797
|
-
if (!selectedOutcomeId) return null;
|
|
15798
|
-
const allMarkets = normalizeVenueMarketCluster(markets);
|
|
15799
|
-
const market = allMarkets.find(
|
|
15800
|
-
(item) => item.venueMarketOutcomes.some((outcome2) => outcome2.id === selectedOutcomeId)
|
|
15801
|
-
);
|
|
15802
|
-
const outcome = market == null ? void 0 : market.venueMarketOutcomes.find((item) => item.id === selectedOutcomeId);
|
|
15803
|
-
if (!market || !outcome) return null;
|
|
15804
|
-
return (_b = (_a = collectEligibleVenueOutcomes({
|
|
15805
|
-
venueMarkets: normalizeVenueMarketCluster(markets, market.id),
|
|
15806
|
-
selectedOutcomeLabel: outcome.label,
|
|
15807
|
-
selectedOutcomeId
|
|
15808
|
-
}).find((item) => item.venue === venue)) == null ? void 0 : _a.outcomeId) != null ? _b : null;
|
|
15809
|
-
}
|
|
15810
|
-
function resolveEventChartPage(outcomes, selectedOutcomeId, requestedPage) {
|
|
15811
|
-
var _a;
|
|
15812
|
-
const pinned = outcomes.find((outcome) => outcome.id === selectedOutcomeId);
|
|
15813
|
-
const remaining = outcomes.filter((outcome) => outcome.id !== (pinned == null ? void 0 : pinned.id));
|
|
15814
|
-
const pageSize = EVENT_CHART_SERIES_LIMIT - (pinned ? 1 : 0);
|
|
15815
|
-
const pageCount = Math.max(1, Math.ceil(remaining.length / pageSize));
|
|
15816
|
-
const page = Math.max(0, Math.min(requestedPage, pageCount - 1));
|
|
15817
|
-
return {
|
|
15818
|
-
page,
|
|
15819
|
-
pageCount,
|
|
15820
|
-
pinnedId: (_a = pinned == null ? void 0 : pinned.id) != null ? _a : null,
|
|
15821
|
-
outcomes: [
|
|
15822
|
-
...pinned ? [pinned] : [],
|
|
15823
|
-
...remaining.slice(page * pageSize, (page + 1) * pageSize)
|
|
15824
|
-
]
|
|
15825
|
-
};
|
|
15826
|
-
}
|
|
15827
|
-
var import_hooks57, EVENT_CHART_SERIES_LIMIT, resolveEventChartOutcomes;
|
|
15795
|
+
var import_hooks57, EVENT_CHART_MARKET_LIMIT, marketVolume, resolveTopEventChartMarkets, resolveEventChartOutcomes;
|
|
15828
15796
|
var init_event_markets_chart_utils = __esm({
|
|
15829
15797
|
"src/events/item-details/event-markets-chart.utils.ts"() {
|
|
15830
15798
|
"use strict";
|
|
15831
15799
|
import_hooks57 = require("@agg-build/hooks");
|
|
15832
15800
|
init_venue_market_cluster();
|
|
15833
|
-
|
|
15834
|
-
|
|
15835
|
-
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15801
|
+
init_event_list_item_details_utils();
|
|
15802
|
+
EVENT_CHART_MARKET_LIMIT = 3;
|
|
15803
|
+
marketVolume = (market) => {
|
|
15804
|
+
var _a;
|
|
15805
|
+
return Number.isFinite(market.volume) ? Math.max(0, (_a = market.volume) != null ? _a : 0) : 0;
|
|
15806
|
+
};
|
|
15807
|
+
resolveTopEventChartMarkets = (markets, venue) => normalizeVenueMarketCluster(markets).filter((market) => market.venue === venue && market.venueMarketOutcomes.length > 0).sort(
|
|
15808
|
+
(left, right) => marketVolume(right) - marketVolume(left) || left.id.localeCompare(right.id)
|
|
15809
|
+
).slice(0, EVENT_CHART_MARKET_LIMIT);
|
|
15810
|
+
resolveEventChartOutcomes = (markets, venue, eventEndDate) => resolveTopEventChartMarkets(markets, venue).flatMap((market) => {
|
|
15841
15811
|
var _a, _b, _c;
|
|
15842
15812
|
const state = (0, import_hooks57.resolveMarketTradingState)(market);
|
|
15843
15813
|
const hasFinalResult = state.kind === "resolved" && market.venueMarketOutcomes.some((outcome) => outcome.winner === true) && market.venueMarketOutcomes.every((outcome) => outcome.winner != null);
|
|
15844
15814
|
const settledAt = Date.parse((_c = (_b = (_a = market.resolutionDate) != null ? _a : market.endDate) != null ? _b : eventEndDate) != null ? _c : "") / 1e3;
|
|
15845
|
-
const ordered =
|
|
15846
|
-
const rank = (label2) => label2.trim().toLowerCase() === "yes" ? 0 : label2.trim().toLowerCase() === "no" ? 1 : 2;
|
|
15847
|
-
return rank(a.label) - rank(b.label);
|
|
15848
|
-
});
|
|
15815
|
+
const ordered = sortOutcomeSelectorOutcomes(market.venueMarketOutcomes);
|
|
15849
15816
|
return ordered.map((outcome) => {
|
|
15850
|
-
var _a2;
|
|
15817
|
+
var _a2, _b2;
|
|
15851
15818
|
return {
|
|
15852
15819
|
id: outcome.id,
|
|
15853
15820
|
marketId: market.id,
|
|
15854
15821
|
venue: market.venue,
|
|
15855
15822
|
side: outcome.label,
|
|
15823
|
+
outcomeLabel: ((_a2 = outcome.title) == null ? void 0 : _a2.trim()) || outcome.label,
|
|
15856
15824
|
live: !state.isTradingDisabled,
|
|
15857
15825
|
finalValue: hasFinalResult ? outcome.winner ? 100 : 0 : void 0,
|
|
15858
15826
|
settledAt: Number.isFinite(settledAt) ? settledAt : void 0,
|
|
15859
|
-
label: `${market.question} \xB7 ${((
|
|
15827
|
+
label: `${market.question} \xB7 ${((_b2 = outcome.title) == null ? void 0 : _b2.trim()) || outcome.label}`
|
|
15860
15828
|
};
|
|
15861
15829
|
});
|
|
15862
15830
|
});
|
|
@@ -15872,8 +15840,8 @@ var init_event_markets_chart = __esm({
|
|
|
15872
15840
|
import_react35 = require("react");
|
|
15873
15841
|
import_hooks58 = require("@agg-build/hooks");
|
|
15874
15842
|
init_chart();
|
|
15875
|
-
|
|
15876
|
-
|
|
15843
|
+
init_badge();
|
|
15844
|
+
init_venue_logo();
|
|
15877
15845
|
init_chart_utils();
|
|
15878
15846
|
init_venue_market_cluster();
|
|
15879
15847
|
init_event_list_item_details_utils();
|
|
@@ -15886,8 +15854,7 @@ var init_event_markets_chart = __esm({
|
|
|
15886
15854
|
eventEndDate,
|
|
15887
15855
|
contractWindow,
|
|
15888
15856
|
range,
|
|
15889
|
-
live
|
|
15890
|
-
selectedOutcomeId
|
|
15857
|
+
live
|
|
15891
15858
|
}) => {
|
|
15892
15859
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
15893
15860
|
const labels = (0, import_hooks58.useLabels)();
|
|
@@ -15899,31 +15866,20 @@ var init_event_markets_chart = __esm({
|
|
|
15899
15866
|
() => [...new Set(normalizeVenueMarketCluster(markets).map((market) => market.venue))],
|
|
15900
15867
|
[markets]
|
|
15901
15868
|
);
|
|
15902
|
-
const venue = venues.includes(defaultVenue) ? defaultVenue : (_a = venues[0]) != null ? _a : defaultVenue;
|
|
15903
|
-
const outcomes = (0, import_react35.useMemo)(
|
|
15904
|
-
() => resolveEventChartOutcomes(markets, venue, eventEndDate),
|
|
15905
|
-
[markets, venue, eventEndDate]
|
|
15906
|
-
);
|
|
15907
15869
|
const [selection, setSelection] = (0, import_react35.useState)(() => ({
|
|
15908
|
-
|
|
15909
|
-
|
|
15870
|
+
defaultVenue,
|
|
15871
|
+
venue: defaultVenue,
|
|
15910
15872
|
hidden: /* @__PURE__ */ new Set()
|
|
15911
15873
|
}));
|
|
15912
|
-
const
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
);
|
|
15916
|
-
const
|
|
15917
|
-
() =>
|
|
15918
|
-
[
|
|
15919
|
-
);
|
|
15920
|
-
const page = (0, import_react35.useMemo)(
|
|
15921
|
-
() => resolveEventChartPage(outcomes, pinnedOutcomeId, currentSelection.page),
|
|
15922
|
-
[outcomes, pinnedOutcomeId, currentSelection.page]
|
|
15923
|
-
);
|
|
15924
|
-
const activeOutcomes = page.outcomes.filter(
|
|
15925
|
-
(outcome) => outcome.id === page.pinnedId || !currentSelection.hidden.has(outcome.id)
|
|
15874
|
+
const requestedVenue = selection.defaultVenue === defaultVenue ? selection.venue : defaultVenue;
|
|
15875
|
+
const venue = venues.includes(requestedVenue) ? requestedVenue : (_a = venues[0]) != null ? _a : defaultVenue;
|
|
15876
|
+
const hidden = selection.defaultVenue === defaultVenue && selection.venue === venue ? selection.hidden : /* @__PURE__ */ new Set();
|
|
15877
|
+
const topMarkets = (0, import_react35.useMemo)(() => resolveTopEventChartMarkets(markets, venue), [markets, venue]);
|
|
15878
|
+
const outcomes = (0, import_react35.useMemo)(
|
|
15879
|
+
() => resolveEventChartOutcomes(topMarkets, venue, eventEndDate),
|
|
15880
|
+
[topMarkets, venue, eventEndDate]
|
|
15926
15881
|
);
|
|
15882
|
+
const activeOutcomes = outcomes.filter((outcome) => !hidden.has(outcome.id));
|
|
15927
15883
|
const activeIds = new Set(activeOutcomes.map((outcome) => outcome.id));
|
|
15928
15884
|
const rollingWindow = (0, import_hooks58.useRollingChartWindow)({
|
|
15929
15885
|
range,
|
|
@@ -15956,10 +15912,10 @@ var init_event_markets_chart = __esm({
|
|
|
15956
15912
|
live: live && !windowEnded
|
|
15957
15913
|
});
|
|
15958
15914
|
const stableColorIds = (0, import_react35.useMemo)(
|
|
15959
|
-
() =>
|
|
15960
|
-
[
|
|
15915
|
+
() => normalizeVenueMarketCluster(markets).filter((market) => market.venue === venue).map((market) => market.id).sort(),
|
|
15916
|
+
[markets, venue]
|
|
15961
15917
|
);
|
|
15962
|
-
const allSeries =
|
|
15918
|
+
const allSeries = outcomes.map((outcome) => {
|
|
15963
15919
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i;
|
|
15964
15920
|
const settledAt = outcome.settledAt == null ? void 0 : contractWindow ? Math.min(outcome.settledAt, contractWindow.to) : outcome.settledAt;
|
|
15965
15921
|
const outcomeLive = outcome.live && !windowEnded;
|
|
@@ -15995,110 +15951,109 @@ var init_event_markets_chart = __esm({
|
|
|
15995
15951
|
});
|
|
15996
15952
|
const visibleSeries = allSeries.filter((series) => activeIds.has(series.id));
|
|
15997
15953
|
const hasVisibleHistory = visibleSeries.some((series) => series.points.length > 0);
|
|
15998
|
-
const volume =
|
|
15999
|
-
(
|
|
15954
|
+
const volume = topMarkets.reduce(
|
|
15955
|
+
(sum, market) => {
|
|
16000
15956
|
var _a2;
|
|
16001
|
-
return sum + ((_a2 = market.volume) != null ? _a2 : 0);
|
|
16002
|
-
},
|
|
16003
|
-
|
|
15957
|
+
return sum + (Number.isFinite(market.volume) ? Math.max(0, (_a2 = market.volume) != null ? _a2 : 0) : 0);
|
|
15958
|
+
},
|
|
15959
|
+
0
|
|
16004
15960
|
);
|
|
16005
15961
|
const venueLabel = (_g = labels.venues[venue]) != null ? _g : venue;
|
|
16006
15962
|
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-event-markets-chart flex flex-col gap-3", children: [
|
|
16007
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
}
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16029
|
-
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
suffix: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "chevron-right", size: "small" }),
|
|
16036
|
-
children: labels.eventItemDetails.comparisonNextSeries
|
|
16037
|
-
}
|
|
16038
|
-
)
|
|
16039
|
-
] }) : null
|
|
16040
|
-
] }),
|
|
16041
|
-
outcomes.length > EVENT_CHART_SERIES_LIMIT ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "text-agg-xs text-agg-muted-foreground", children: labels.eventItemDetails.comparisonSeriesBudget(EVENT_CHART_SERIES_LIMIT) }) : null,
|
|
15963
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-market-badges flex min-w-0 gap-2 overflow-x-auto pb-1 md:flex-wrap", children: venues.map((item) => {
|
|
15964
|
+
var _a2, _b2;
|
|
15965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
15966
|
+
"button",
|
|
15967
|
+
{
|
|
15968
|
+
type: "button",
|
|
15969
|
+
"aria-label": (_a2 = labels.venues[item]) != null ? _a2 : item,
|
|
15970
|
+
"aria-pressed": venue === item,
|
|
15971
|
+
className: "agg-market-badge cursor-pointer rounded-agg-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
15972
|
+
onClick: (event) => {
|
|
15973
|
+
event.preventDefault();
|
|
15974
|
+
event.stopPropagation();
|
|
15975
|
+
if (item !== venue) setSelection({ defaultVenue, venue: item, hidden: /* @__PURE__ */ new Set() });
|
|
15976
|
+
},
|
|
15977
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
15978
|
+
Badge,
|
|
15979
|
+
{
|
|
15980
|
+
text: (_b2 = labels.venues[item]) != null ? _b2 : item,
|
|
15981
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: item, size: "small", title: item }),
|
|
15982
|
+
size: "large",
|
|
15983
|
+
isActive: venue === item,
|
|
15984
|
+
classNames: { root: "shrink-0 border px-4 h-8 md:h-9" }
|
|
15985
|
+
}
|
|
15986
|
+
)
|
|
15987
|
+
},
|
|
15988
|
+
item
|
|
15989
|
+
);
|
|
15990
|
+
}) }),
|
|
16042
15991
|
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16043
15992
|
"div",
|
|
16044
15993
|
{
|
|
16045
15994
|
role: "group",
|
|
16046
15995
|
"aria-label": labels.eventItemDetails.chartLegend,
|
|
16047
|
-
className: "flex flex-
|
|
16048
|
-
children:
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
15996
|
+
className: "flex flex-col gap-2",
|
|
15997
|
+
children: topMarkets.map((market) => {
|
|
15998
|
+
var _a2;
|
|
15999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
16000
|
+
"div",
|
|
16001
|
+
{
|
|
16002
|
+
"data-chart-market-id": market.id,
|
|
16003
|
+
className: "flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-1",
|
|
16004
|
+
children: [
|
|
16005
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("span", { className: "flex min-w-0 items-center gap-2 text-agg-sm text-agg-foreground", children: [
|
|
16006
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16007
|
+
"span",
|
|
16008
|
+
{
|
|
16009
|
+
"aria-hidden": "true",
|
|
16010
|
+
className: "h-0 w-4 shrink-0 border-t-2",
|
|
16011
|
+
style: {
|
|
16012
|
+
borderColor: (_a2 = allSeries.find((series) => series.marketId === market.id)) == null ? void 0 : _a2.color
|
|
16013
|
+
}
|
|
16014
|
+
}
|
|
16015
|
+
),
|
|
16016
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "truncate", title: market.question, children: market.question })
|
|
16017
|
+
] }),
|
|
16018
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-outcome-switch flex max-w-full flex-wrap gap-1 rounded-agg-full bg-agg-secondary", children: allSeries.filter((series) => series.marketId === market.id).map((series) => {
|
|
16019
|
+
const value = !activeIds.has(series.id) ? labels.eventItemDetails.comparisonHiddenSeries : series.pending ? labels.common.loading : series.points.length === 0 ? labels.eventItemDetails.marketHistoryUnavailable : formatDefaultChartValue(
|
|
16020
|
+
series.current != null ? series.current * 100 : series.points.at(-1).value
|
|
16021
|
+
);
|
|
16022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16023
|
+
"button",
|
|
16024
|
+
{
|
|
16025
|
+
type: "button",
|
|
16026
|
+
"data-chart-outcome-id": series.id,
|
|
16027
|
+
"aria-label": `${series.label} ${value}`,
|
|
16028
|
+
"aria-pressed": activeIds.has(series.id),
|
|
16029
|
+
title: `${series.label} ${value}`,
|
|
16030
|
+
className: "cursor-pointer rounded-agg-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
16031
|
+
onClick: (event) => {
|
|
16032
|
+
event.preventDefault();
|
|
16033
|
+
event.stopPropagation();
|
|
16034
|
+
const next = new Set(hidden);
|
|
16035
|
+
if (next.has(series.id)) next.delete(series.id);
|
|
16036
|
+
else next.add(series.id);
|
|
16037
|
+
setSelection({ defaultVenue, venue, hidden: next });
|
|
16038
|
+
},
|
|
16039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16040
|
+
Badge,
|
|
16041
|
+
{
|
|
16042
|
+
text: `${series.outcomeLabel} ${value}`,
|
|
16043
|
+
size: "large",
|
|
16044
|
+
isActive: activeIds.has(series.id),
|
|
16045
|
+
classNames: { root: "h-8 w-36 border px-4 tabular-nums md:h-9" }
|
|
16046
|
+
}
|
|
16047
|
+
)
|
|
16048
|
+
},
|
|
16049
|
+
series.id
|
|
16050
|
+
);
|
|
16051
|
+
}) })
|
|
16052
|
+
]
|
|
16063
16053
|
},
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
|
|
16067
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16068
|
-
"span",
|
|
16069
|
-
{
|
|
16070
|
-
"aria-hidden": "true",
|
|
16071
|
-
className: "h-0 w-4 shrink-0 border-t-2",
|
|
16072
|
-
style: {
|
|
16073
|
-
borderColor: series.color,
|
|
16074
|
-
borderTopStyle: series.lineStyle === "dashed" ? "dashed" : "solid"
|
|
16075
|
-
}
|
|
16076
|
-
}
|
|
16077
|
-
),
|
|
16078
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "min-w-0 text-left [overflow-wrap:anywhere]", children: series.label }),
|
|
16079
|
-
series.id === page.pinnedId ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: labels.eventItemDetails.comparisonSelectedSeries }) : null,
|
|
16080
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("span", { className: "inline-grid shrink-0 items-center font-agg-semibold tabular-nums", children: [
|
|
16081
|
-
[
|
|
16082
|
-
formatDefaultChartValue(100),
|
|
16083
|
-
formatDefaultChartValue(99.9),
|
|
16084
|
-
labels.common.loading,
|
|
16085
|
-
labels.eventItemDetails.comparisonHiddenSeries,
|
|
16086
|
-
labels.eventItemDetails.marketHistoryUnavailable
|
|
16087
|
-
].map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
16088
|
-
"span",
|
|
16089
|
-
{
|
|
16090
|
-
"aria-hidden": "true",
|
|
16091
|
-
className: "invisible col-start-1 row-start-1 select-none",
|
|
16092
|
-
children: value
|
|
16093
|
-
},
|
|
16094
|
-
index
|
|
16095
|
-
)),
|
|
16096
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "col-start-1 row-start-1", children: !activeIds.has(series.id) ? labels.eventItemDetails.comparisonHiddenSeries : series.pending ? labels.common.loading : series.points.length === 0 ? labels.eventItemDetails.marketHistoryUnavailable : series.current != null ? formatDefaultChartValue(series.current * 100) : formatDefaultChartValue(series.points.at(-1).value) })
|
|
16097
|
-
] })
|
|
16098
|
-
]
|
|
16099
|
-
},
|
|
16100
|
-
series.id
|
|
16101
|
-
))
|
|
16054
|
+
market.id
|
|
16055
|
+
);
|
|
16056
|
+
})
|
|
16102
16057
|
}
|
|
16103
16058
|
),
|
|
16104
16059
|
visibleSeries.length === 0 && allSeries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
@@ -16634,7 +16589,7 @@ var init_item_details = __esm({
|
|
|
16634
16589
|
recurringMarkets,
|
|
16635
16590
|
sportsLiveState
|
|
16636
16591
|
}) => {
|
|
16637
|
-
var _a, _b, _c, _d, _e, _f
|
|
16592
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16638
16593
|
const [selectedChartType, setSelectedChartType] = (0, import_react36.useState)("line");
|
|
16639
16594
|
const [chartView, setChartView] = (0, import_react36.useState)(defaultChartView);
|
|
16640
16595
|
const lastAppliedEventSyncKeyRef = (0, import_react36.useRef)(null);
|
|
@@ -16962,7 +16917,6 @@ var init_item_details = __esm({
|
|
|
16962
16917
|
{
|
|
16963
16918
|
markets: event.venueMarkets,
|
|
16964
16919
|
defaultVenue: event.venue,
|
|
16965
|
-
selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
|
|
16966
16920
|
eventEndDate: event.endDate,
|
|
16967
16921
|
contractWindow,
|
|
16968
16922
|
range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
|
|
@@ -16977,7 +16931,7 @@ var init_item_details = __esm({
|
|
|
16977
16931
|
selectedChartType,
|
|
16978
16932
|
venueInfo,
|
|
16979
16933
|
venueMarkets,
|
|
16980
|
-
selectedMarketId: (
|
|
16934
|
+
selectedMarketId: (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _f : null,
|
|
16981
16935
|
livePrices,
|
|
16982
16936
|
restMidpoints,
|
|
16983
16937
|
bestMidpoint,
|
|
@@ -31275,7 +31229,7 @@ var init_event_market_shared = __esm({
|
|
|
31275
31229
|
});
|
|
31276
31230
|
|
|
31277
31231
|
// src/pages/event-market/sports-event-market.utils.ts
|
|
31278
|
-
var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
|
|
31232
|
+
var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, DRAW_OUTCOME_TITLE_PATTERN, isThreeWayMoneylineHub, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
|
|
31279
31233
|
var init_sports_event_market_utils = __esm({
|
|
31280
31234
|
"src/pages/event-market/sports-event-market.utils.ts"() {
|
|
31281
31235
|
"use strict";
|
|
@@ -31686,6 +31640,7 @@ var init_sports_event_market_utils = __esm({
|
|
|
31686
31640
|
}
|
|
31687
31641
|
if (tab.kind !== "game_lines") return filteredSectionMarkets;
|
|
31688
31642
|
const dedupeEventMarketsOfType = (type) => {
|
|
31643
|
+
var _a, _b, _c, _d;
|
|
31689
31644
|
const dedupedMarkets = [];
|
|
31690
31645
|
const keptIndexByKey = /* @__PURE__ */ new Map();
|
|
31691
31646
|
for (const market of eventMarkets) {
|
|
@@ -31696,6 +31651,10 @@ var init_sports_event_market_utils = __esm({
|
|
|
31696
31651
|
const keptIndex = keptIndexByKey.get(key);
|
|
31697
31652
|
if (keptIndex !== void 0) {
|
|
31698
31653
|
const kept = dedupedMarkets[keptIndex];
|
|
31654
|
+
if (hasTeamTitledOutcomes(kept) && hasTeamTitledOutcomes(market) && ((_b = (_a = kept.venueMarketOutcomes) == null ? void 0 : _a.length) != null ? _b : 0) !== ((_d = (_c = market.venueMarketOutcomes) == null ? void 0 : _c.length) != null ? _d : 0)) {
|
|
31655
|
+
dedupedMarkets.push(market);
|
|
31656
|
+
continue;
|
|
31657
|
+
}
|
|
31699
31658
|
if (!hasTeamTitledOutcomes(kept) && hasTeamTitledOutcomes(market)) {
|
|
31700
31659
|
dedupedMarkets[keptIndex] = market;
|
|
31701
31660
|
}
|
|
@@ -31825,6 +31784,12 @@ var init_sports_event_market_utils = __esm({
|
|
|
31825
31784
|
"specials",
|
|
31826
31785
|
"completion"
|
|
31827
31786
|
]);
|
|
31787
|
+
DRAW_OUTCOME_TITLE_PATTERN = /\b(draw|tie)\b/i;
|
|
31788
|
+
isThreeWayMoneylineHub = (market) => {
|
|
31789
|
+
var _a, _b;
|
|
31790
|
+
const outcomes = (_a = market.venueMarketOutcomes) != null ? _a : [];
|
|
31791
|
+
return normalizeSportsMarketType(market.sportsMarketType) === "moneyline" && normalizeSportsMarketGroup(market.marketGroup) === "game_lines" && normalizeSportsPeriod(market.period) === "full" && outcomes.length === 3 && outcomes.filter((outcome) => DRAW_OUTCOME_TITLE_PATTERN.test(toTrimmedString(outcome.title))).length === 1 && ((_b = market.matchedVenueMarkets) != null ? _b : []).length > 0;
|
|
31792
|
+
};
|
|
31828
31793
|
resolveDisplayGroupFamilyKey = (market, sport) => {
|
|
31829
31794
|
var _a, _b, _c;
|
|
31830
31795
|
const normalizedQuestion = sanitizeFamilyValue(toTrimmedString(market.question));
|
|
@@ -31834,7 +31799,7 @@ var init_sports_event_market_utils = __esm({
|
|
|
31834
31799
|
const sportsMarketType = (_b = normalizeSportsMarketType(market.sportsMarketType)) != null ? _b : "other";
|
|
31835
31800
|
const period = normalizeSportsPeriod(market.period);
|
|
31836
31801
|
const marketCategory = (_c = normalizeSportsMarketCategory(market.marketCategory)) != null ? _c : "other";
|
|
31837
|
-
if (isBinarySportsMoneylineMarket(market)) {
|
|
31802
|
+
if (isBinarySportsMoneylineMarket(market) || isThreeWayMoneylineHub(market)) {
|
|
31838
31803
|
return `${period}|moneyline|${marketCategory}`;
|
|
31839
31804
|
}
|
|
31840
31805
|
if (sportsMarketType === "to_advance") {
|
|
@@ -31898,7 +31863,7 @@ var init_sports_event_market_utils = __esm({
|
|
|
31898
31863
|
resolveDisplayGroupTitle = (market, groupMarkets = [market], sport, isCombinedLegGroup = false) => {
|
|
31899
31864
|
const sportsMarketType = normalizeSportsMarketType(market.sportsMarketType);
|
|
31900
31865
|
const question = toTrimmedString(market.question);
|
|
31901
|
-
if (isBinarySportsMoneylineMarket(market)) return "Moneyline";
|
|
31866
|
+
if (isBinarySportsMoneylineMarket(market) || isThreeWayMoneylineHub(market)) return "Moneyline";
|
|
31902
31867
|
if (sportsMarketType === "to_advance") return "Team to Advance";
|
|
31903
31868
|
if (sportsMarketType === "spread") return "Spreads";
|
|
31904
31869
|
if (isCombinedLegGroup) {
|
package/dist/pages.mjs
CHANGED
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
buildAggTxExplorerHref,
|
|
14
14
|
formatShareAmount,
|
|
15
15
|
useHomePageModals
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-YBMDEGTJ.mjs";
|
|
17
|
+
import "./chunk-LIB6TLLV.mjs";
|
|
18
18
|
import {
|
|
19
19
|
EventMarketPage,
|
|
20
20
|
EventOpenOrders,
|
|
21
21
|
EventOpenOrdersCard,
|
|
22
22
|
formatRecurringCountdown,
|
|
23
23
|
useEventOpenOrders
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-R7ARCUYW.mjs";
|
|
25
|
+
import "./chunk-LTFRGJPL.mjs";
|
|
26
26
|
import {
|
|
27
27
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
28
28
|
WITHDRAW_MODAL_OPEN_EVENT,
|