@agg-market/ui 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/chart.js +18 -5
  2. package/dist/chart.mjs +2 -2
  3. package/dist/{chunk-LK5D3ZTK.mjs → chunk-3QLOUBDJ.mjs} +1 -1
  4. package/dist/{chunk-4KMFDCAH.mjs → chunk-3W7NBJLU.mjs} +2 -2
  5. package/dist/{chunk-KCPDVBIZ.mjs → chunk-4S3I6X7F.mjs} +14 -13
  6. package/dist/{chunk-OA2IZ3VW.mjs → chunk-5ADMXO3Y.mjs} +1 -1
  7. package/dist/{chunk-7NISYVSJ.mjs → chunk-6JG6I5AY.mjs} +1 -1
  8. package/dist/{chunk-TA7LKYKP.mjs → chunk-DCORNTCY.mjs} +1 -1
  9. package/dist/{chunk-QYZKC7KG.mjs → chunk-GNSPZ53C.mjs} +87 -86
  10. package/dist/{chunk-422MCIXV.mjs → chunk-HOXTJ742.mjs} +15 -11
  11. package/dist/{chunk-KFOATMAE.mjs → chunk-JNH64AKR.mjs} +32 -25
  12. package/dist/{chunk-DL7STJQ5.mjs → chunk-LA3FBBSJ.mjs} +3 -3
  13. package/dist/{chunk-CTVMT3VL.mjs → chunk-LCZKSITC.mjs} +2 -2
  14. package/dist/chunk-M4RJHRFT.mjs +445 -0
  15. package/dist/{chunk-D5FTFSKL.mjs → chunk-MBHTXNHX.mjs} +4 -4
  16. package/dist/{chunk-O46OFVH6.mjs → chunk-MJHKBCXQ.mjs} +2 -2
  17. package/dist/{chunk-2MJY6RVY.mjs → chunk-NH2G3POM.mjs} +1 -1
  18. package/dist/{chunk-BEDUFOIG.mjs → chunk-OH56VUYK.mjs} +6 -20
  19. package/dist/{chunk-BN5VVHNV.mjs → chunk-OJVTGNIF.mjs} +17 -4
  20. package/dist/{chunk-6425RRBI.mjs → chunk-P2PJBO5C.mjs} +1 -1
  21. package/dist/{chunk-D7JTOGYP.mjs → chunk-PORVP72S.mjs} +22 -2
  22. package/dist/{chunk-5GDNWQZS.mjs → chunk-QLMVKLNJ.mjs} +1 -1
  23. package/dist/{chunk-GHB3GOCW.mjs → chunk-QM7CGMFG.mjs} +5 -21
  24. package/dist/connect-button.js +22 -2
  25. package/dist/connect-button.mjs +2 -2
  26. package/dist/deposit-modal.js +22 -2
  27. package/dist/deposit-modal.mjs +2 -2
  28. package/dist/event-list-item-details.js +235 -243
  29. package/dist/event-list-item-details.mjs +7 -7
  30. package/dist/event-list-item.js +178 -210
  31. package/dist/event-list-item.mjs +4 -4
  32. package/dist/event-list.js +181 -225
  33. package/dist/event-list.mjs +5 -5
  34. package/dist/event-market-page.d.mts +1 -1
  35. package/dist/event-market-page.d.ts +1 -1
  36. package/dist/event-market-page.js +498 -576
  37. package/dist/event-market-page.mjs +11 -12
  38. package/dist/home-page.js +181 -225
  39. package/dist/home-page.mjs +6 -6
  40. package/dist/index.d.mts +3 -3
  41. package/dist/index.d.ts +3 -3
  42. package/dist/index.js +331 -347
  43. package/dist/index.mjs +21 -21
  44. package/dist/market-details.d.mts +1 -1
  45. package/dist/market-details.d.ts +1 -1
  46. package/dist/market-details.js +345 -417
  47. package/dist/market-details.mjs +7 -8
  48. package/dist/onboarding-modal.js +35 -14
  49. package/dist/onboarding-modal.mjs +2 -2
  50. package/dist/place-order.d.mts +1 -1
  51. package/dist/place-order.d.ts +1 -1
  52. package/dist/place-order.js +173 -191
  53. package/dist/place-order.mjs +3 -3
  54. package/dist/profile-modal.js +22 -2
  55. package/dist/profile-modal.mjs +2 -2
  56. package/dist/search.d.mts +1 -1
  57. package/dist/search.d.ts +1 -1
  58. package/dist/search.js +22 -2
  59. package/dist/search.mjs +2 -2
  60. package/dist/settlement.d.mts +1 -1
  61. package/dist/settlement.d.ts +1 -1
  62. package/dist/settlement.js +173 -191
  63. package/dist/settlement.mjs +3 -3
  64. package/dist/skeleton.js +151 -189
  65. package/dist/skeleton.mjs +1 -1
  66. package/dist/styles.css +1 -1
  67. package/dist/switch-button.js +2 -2
  68. package/dist/switch-button.mjs +1 -1
  69. package/dist/tailwind.css +1 -1
  70. package/dist/user-profile-page.d.mts +1 -1
  71. package/dist/user-profile-page.d.ts +1 -1
  72. package/dist/user-profile-page.js +22 -2
  73. package/dist/user-profile-page.mjs +2 -2
  74. package/dist/venue-logo.d.mts +3 -2
  75. package/dist/venue-logo.d.ts +3 -2
  76. package/dist/venue-logo.js +22 -2
  77. package/dist/venue-logo.mjs +1 -1
  78. package/dist/{venue-logo.types-HRf1yBLD.d.mts → venue-logo.types-CGUc22ly.d.mts} +3 -1
  79. package/dist/{venue-logo.types-D8Cu2rAm.d.ts → venue-logo.types-Dqr39S1-.d.ts} +3 -1
  80. package/dist/withdraw-modal.js +22 -2
  81. package/dist/withdraw-modal.mjs +2 -2
  82. package/package.json +2 -2
  83. package/dist/chunk-V52WSZHQ.mjs +0 -482
  84. package/dist/{types-JBf1DZlH.d.ts → types-DkGlbmXq.d.mts} +2 -2
  85. package/dist/{types-JBf1DZlH.d.mts → types-DkGlbmXq.d.ts} +2 -2
package/dist/chart.js CHANGED
@@ -122,10 +122,10 @@ var SwitchButton = ({
122
122
  return null;
123
123
  }
124
124
  const handleKeyDown = (event, optionIndex) => {
125
- if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
125
+ if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
126
126
  return;
127
127
  }
128
- event.preventDefault();
128
+ event == null ? void 0 : event.preventDefault();
129
129
  const nextOptionIndex = resolveNextEnabledIndex(
130
130
  options,
131
131
  optionIndex,
@@ -242,8 +242,18 @@ var normalizeSeries = (series) => {
242
242
  var defaultValueFormatter = (value) => {
243
243
  return `${Math.round(value)}%`;
244
244
  };
245
- var defaultTimeFormatter = (timestamp) => {
246
- return import_dayjs.default.unix(timestamp).format("MMM D");
245
+ var resolveTimeFormatter = (windowSeconds) => {
246
+ return (timestamp) => {
247
+ if (!Number.isFinite(timestamp))
248
+ return "";
249
+ if (windowSeconds <= 48 * 60 * 60) {
250
+ return import_dayjs.default.unix(timestamp).format("HH:mm");
251
+ }
252
+ if (windowSeconds <= 14 * 24 * 60 * 60) {
253
+ return import_dayjs.default.unix(timestamp).format("MMM D HH:mm");
254
+ }
255
+ return import_dayjs.default.unix(timestamp).format("MMM D");
256
+ };
247
257
  };
248
258
  var toLivelinePoints = (points) => {
249
259
  return points.map((point) => ({
@@ -366,6 +376,9 @@ var LineChart = ({
366
376
  const windowSeconds = (0, import_react2.useMemo)(() => {
367
377
  return resolveWindowSeconds(normalizedSeries);
368
378
  }, [normalizedSeries]);
379
+ const timeFormatter = (0, import_react2.useMemo)(() => {
380
+ return resolveTimeFormatter(windowSeconds);
381
+ }, [windowSeconds]);
369
382
  const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
370
383
  series: normalizedSeries,
371
384
  activeSeriesId,
@@ -404,7 +417,7 @@ var LineChart = ({
404
417
  pulse: false,
405
418
  window: windowSeconds,
406
419
  formatValue: defaultValueFormatter,
407
- formatTime: defaultTimeFormatter,
420
+ formatTime: timeFormatter,
408
421
  padding: {
409
422
  top: 12,
410
423
  right: 80,
package/dist/chart.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LineChart
3
- } from "./chunk-BN5VVHNV.mjs";
4
- import "./chunk-CTVMT3VL.mjs";
3
+ } from "./chunk-OJVTGNIF.mjs";
4
+ import "./chunk-LCZKSITC.mjs";
5
5
  import "./chunk-GJ4U5NCE.mjs";
6
6
  export {
7
7
  LineChart
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  VenueLogo,
6
6
  venueLogoLabels
7
- } from "./chunk-D7JTOGYP.mjs";
7
+ } from "./chunk-PORVP72S.mjs";
8
8
  import {
9
9
  Icon,
10
10
  ProfileIcon
@@ -6,10 +6,10 @@ import {
6
6
  import {
7
7
  Skeleton,
8
8
  skeletonViews
9
- } from "./chunk-V52WSZHQ.mjs";
9
+ } from "./chunk-M4RJHRFT.mjs";
10
10
  import {
11
11
  VenueLogo
12
- } from "./chunk-D7JTOGYP.mjs";
12
+ } from "./chunk-PORVP72S.mjs";
13
13
  import {
14
14
  Icon
15
15
  } from "./chunk-PZTHM6WG.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5K7VXAYM.mjs";
4
4
  import {
5
5
  VenueLogo
6
- } from "./chunk-D7JTOGYP.mjs";
6
+ } from "./chunk-PORVP72S.mjs";
7
7
  import {
8
8
  BestPricesIcon,
9
9
  CheckCircleIcon,
@@ -249,15 +249,7 @@ ProfileSetupStep.displayName = "ProfileSetupStep";
249
249
  import { useLabels as useLabels3 } from "@agg-market/hooks";
250
250
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
251
251
  var OnchainVenueLogos = () => {
252
- return /* @__PURE__ */ jsx3("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsx3(
253
- "div",
254
- {
255
- className: "overflow-hidden rounded sm:rounded-agg-md",
256
- style: { zIndex: ONCHAIN_VENUES.length - index },
257
- children: /* @__PURE__ */ jsx3(VenueLogo, { venue, size: "medium", className: "sm:h-8 sm:w-8" })
258
- },
259
- venue
260
- )) });
252
+ return /* @__PURE__ */ jsx3("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsx3("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ jsx3(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
261
253
  };
262
254
  var VenueCard = ({
263
255
  logos,
@@ -351,12 +343,13 @@ var ConnectAccountsStep = ({
351
343
  /* @__PURE__ */ jsx3(
352
344
  VenueCard,
353
345
  {
354
- logos: /* @__PURE__ */ jsx3("div", { className: "overflow-hidden rounded sm:rounded-agg-md", children: /* @__PURE__ */ jsx3(
346
+ logos: /* @__PURE__ */ jsx3("div", { className: "sm:flex sm:w-14 sm:items-center sm:justify-center", children: /* @__PURE__ */ jsx3(
355
347
  VenueLogo,
356
348
  {
357
349
  venue: "kalshi",
350
+ variant: "logo",
358
351
  size: "large",
359
- className: "h-6 w-6 sm:h-8 sm:w-8"
352
+ className: "h-6 w-6 sm:h-9 sm:w-9"
360
353
  }
361
354
  ) }),
362
355
  title: labels.onboarding.connectAccounts.kalshiTitle,
@@ -464,7 +457,15 @@ var ConnectKalshiModal = ({
464
457
  }
465
458
  ),
466
459
  /* @__PURE__ */ jsx4(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-8 items-center", children: [
467
- /* @__PURE__ */ jsx4("div", { className: "overflow-hidden rounded-agg-lg", children: /* @__PURE__ */ jsx4(VenueLogo, { venue: "kalshi", size: "large" }) }),
460
+ /* @__PURE__ */ jsx4(
461
+ VenueLogo,
462
+ {
463
+ venue: "kalshi",
464
+ variant: "logo",
465
+ size: "large",
466
+ className: "h-[60px] w-[60px]"
467
+ }
468
+ ),
468
469
  /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-4 items-center text-center", children: [
469
470
  /* @__PURE__ */ jsx4("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
470
471
  /* @__PURE__ */ jsx4("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-IGPNIM2B.mjs";
4
4
  import {
5
5
  VenueLogo
6
- } from "./chunk-D7JTOGYP.mjs";
6
+ } from "./chunk-PORVP72S.mjs";
7
7
  import {
8
8
  Icon
9
9
  } from "./chunk-PZTHM6WG.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-S3H63TQ5.mjs";
4
4
  import {
5
5
  VenueLogo
6
- } from "./chunk-D7JTOGYP.mjs";
6
+ } from "./chunk-PORVP72S.mjs";
7
7
  import {
8
8
  Icon
9
9
  } from "./chunk-PZTHM6WG.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VenueLogo
3
- } from "./chunk-D7JTOGYP.mjs";
3
+ } from "./chunk-PORVP72S.mjs";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-PZTHM6WG.mjs";
@@ -4,7 +4,7 @@ import {
4
4
  resolveOutcomeLabels,
5
5
  resolveOutcomesByVenue,
6
6
  resolveSeriesColor
7
- } from "./chunk-422MCIXV.mjs";
7
+ } from "./chunk-HOXTJ742.mjs";
8
8
  import {
9
9
  Tabs
10
10
  } from "./chunk-S3H63TQ5.mjs";
@@ -14,21 +14,19 @@ import {
14
14
  resolveTileImage,
15
15
  resolveTileTitle,
16
16
  selectPrimaryVenueMarket
17
- } from "./chunk-GHB3GOCW.mjs";
17
+ } from "./chunk-QM7CGMFG.mjs";
18
18
  import {
19
+ MarketDetailsOderbookSkeleton,
19
20
  Skeleton,
20
21
  eventListItemDetailsTimeRanges,
21
22
  getMarketDetailsTabs,
22
23
  marketDetailsBaseCardClassName,
23
24
  marketDetailsDefaultIsOpened,
24
25
  orderBookRowLimitDefault
25
- } from "./chunk-V52WSZHQ.mjs";
26
- import {
27
- LoadingIcon
28
- } from "./chunk-IGPNIM2B.mjs";
26
+ } from "./chunk-M4RJHRFT.mjs";
29
27
  import {
30
28
  VenueLogo
31
- } from "./chunk-D7JTOGYP.mjs";
29
+ } from "./chunk-PORVP72S.mjs";
32
30
  import {
33
31
  Typography
34
32
  } from "./chunk-ERGNR6UQ.mjs";
@@ -37,10 +35,10 @@ import {
37
35
  } from "./chunk-FO2QCB4Z.mjs";
38
36
  import {
39
37
  LineChart
40
- } from "./chunk-BN5VVHNV.mjs";
38
+ } from "./chunk-OJVTGNIF.mjs";
41
39
  import {
42
40
  SwitchButton
43
- } from "./chunk-CTVMT3VL.mjs";
41
+ } from "./chunk-LCZKSITC.mjs";
44
42
  import {
45
43
  __spreadProps,
46
44
  __spreadValues,
@@ -182,8 +180,7 @@ var resolveSubtitle = ({
182
180
  };
183
181
  var resolveOrderBookRows = ({
184
182
  data,
185
- side,
186
- depth
183
+ side
187
184
  }) => {
188
185
  if (!(data == null ? void 0 : data.length))
189
186
  return [];
@@ -214,9 +211,8 @@ var resolveOrderBookRows = ({
214
211
  return left.price - right.price;
215
212
  return right.price - left.price;
216
213
  });
217
- const limitedRows = sortedRows.slice(0, Math.max(1, depth));
218
- const maxTotal = limitedRows.reduce((currentMax, row) => Math.max(currentMax, row.total), 0) || 1;
219
- return limitedRows.map((row) => __spreadProps(__spreadValues({}, row), {
214
+ const maxTotal = sortedRows.reduce((currentMax, row) => Math.max(currentMax, row.total), 0) || 1;
215
+ return sortedRows.map((row) => __spreadProps(__spreadValues({}, row), {
220
216
  barScale: row.total / maxTotal
221
217
  }));
222
218
  };
@@ -329,44 +325,59 @@ var OrderBookRows = ({
329
325
  rows,
330
326
  title,
331
327
  formatNumber,
332
- formatCurrency
328
+ formatCurrency,
329
+ visibleRows
333
330
  }) => {
334
331
  const labels = useLabels();
335
332
  const isAsks = title === labels.marketDetails.asks;
336
333
  const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
337
334
  const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
335
+ const maxVisibleRows = Math.max(1, visibleRows);
336
+ const orderBookRowHeightPx = 28;
337
+ const orderBookDividerHeightPx = 1;
338
+ const orderBookRowGapPx = 8;
339
+ const orderBookVisibleHeightPx = maxVisibleRows * orderBookRowHeightPx + Math.max(0, maxVisibleRows - 1) * (orderBookDividerHeightPx + orderBookRowGapPx);
338
340
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
339
341
  /* @__PURE__ */ jsx(Typography, { variant: "caption-caps", children: title }),
340
- rows.map((row, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
341
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
342
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 md:gap-3", children: [
343
- /* @__PURE__ */ jsx(VenueLogo, { venue: row.venue, size: "small" }),
344
- /* @__PURE__ */ jsx(
345
- "span",
346
- {
347
- className: cn(
348
- "text-agg-xs font-agg-bold leading-agg-4 md:text-agg-sm md:leading-agg-5",
349
- priceClassName
350
- ),
351
- children: formatProbabilityCents(row.price)
352
- }
353
- )
354
- ] }),
355
- /* @__PURE__ */ jsx("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatNumber(row.size) }),
356
- /* @__PURE__ */ jsx("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatCurrency(row.total) }),
357
- /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(
358
- "div",
359
- {
360
- "aria-hidden": "true",
361
- className: cn("h-2 rounded-agg-full", barClassName),
362
- style: {
363
- width: `${Math.max(20, Math.round(row.barScale * 100))}%`
364
- }
365
- }
366
- ) })
367
- ] }),
368
- index < rows.length - 1 ? /* @__PURE__ */ jsx("div", { className: "h-px w-full bg-agg-separator" }) : null
369
- ] }, row.id))
342
+ /* @__PURE__ */ jsx(
343
+ "div",
344
+ {
345
+ className: "overflow-y-auto pr-1 flex flex-col gap-2",
346
+ style: { maxHeight: `${orderBookVisibleHeightPx}px` },
347
+ role: "region",
348
+ "aria-label": `${title} order book levels`,
349
+ children: rows.map((row, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
350
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
351
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 md:gap-3", children: [
352
+ /* @__PURE__ */ jsx(VenueLogo, { venue: row.venue, size: "small" }),
353
+ /* @__PURE__ */ jsx(
354
+ "span",
355
+ {
356
+ className: cn(
357
+ "text-agg-xs font-agg-bold leading-agg-4 md:text-agg-sm md:leading-agg-5",
358
+ priceClassName
359
+ ),
360
+ children: formatProbabilityCents(row.price)
361
+ }
362
+ )
363
+ ] }),
364
+ /* @__PURE__ */ jsx("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatNumber(row.size) }),
365
+ /* @__PURE__ */ jsx("span", { className: "truncate text-agg-xs leading-agg-4 text-center text-agg-foreground md:text-agg-sm md:leading-agg-5", children: formatCurrency(row.total) }),
366
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(
367
+ "div",
368
+ {
369
+ "aria-hidden": "true",
370
+ className: cn("h-2 rounded-agg-full", barClassName),
371
+ style: {
372
+ width: `${Math.max(20, Math.round(row.barScale * 100))}%`
373
+ }
374
+ }
375
+ ) })
376
+ ] }),
377
+ index < rows.length - 1 ? /* @__PURE__ */ jsx("div", { className: "h-px w-full bg-agg-separator" }) : null
378
+ ] }, row.id))
379
+ }
380
+ )
370
381
  ] });
371
382
  };
372
383
  var getOutcomeButtonClassName = ({
@@ -484,9 +495,10 @@ var MarketDetailsContent = ({
484
495
  });
485
496
  return [...uniqueOutcomesByVenueAndId.values()];
486
497
  }, [outcomesByLabel]);
498
+ const canonicalMarketIdForHistory = model == null ? void 0 : model.market.id;
487
499
  const priceHistoryGroups = useMemo(() => {
488
- return buildPriceHistoryGroups(graphOutcomes);
489
- }, [graphOutcomes]);
500
+ return buildPriceHistoryGroups(graphOutcomes, canonicalMarketIdForHistory);
501
+ }, [canonicalMarketIdForHistory, graphOutcomes]);
490
502
  const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = usePriceHistory(__spreadProps(__spreadValues({
491
503
  groups: priceHistoryGroups
492
504
  }, timeWindow), {
@@ -506,17 +518,15 @@ var MarketDetailsContent = ({
506
518
  const askRows = useMemo(() => {
507
519
  return resolveOrderBookRows({
508
520
  data: orderBookData,
509
- side: "asks",
510
- depth: orderBookDepth
521
+ side: "asks"
511
522
  });
512
- }, [orderBookData, orderBookDepth]);
523
+ }, [orderBookData]);
513
524
  const bidRows = useMemo(() => {
514
525
  return resolveOrderBookRows({
515
526
  data: orderBookData,
516
- side: "bids",
517
- depth: orderBookDepth
527
+ side: "bids"
518
528
  });
519
- }, [orderBookData, orderBookDepth]);
529
+ }, [orderBookData]);
520
530
  const priceHistoryByVenue = useMemo(() => {
521
531
  const historyByVenue = /* @__PURE__ */ new Map();
522
532
  if (!(priceHistoryData == null ? void 0 : priceHistoryData.length)) {
@@ -536,11 +546,14 @@ var MarketDetailsContent = ({
536
546
  const graphSeriesByOutcomeLabel = useMemo(() => {
537
547
  const seriesByOutcomeLabel = /* @__PURE__ */ new Map();
538
548
  const resolveOutcomeCandidateIds = (outcomeByVenue) => {
539
- var _a;
549
+ var _a, _b;
550
+ const marketWithCanonicalId = outcomeByVenue.market;
540
551
  return [
541
552
  outcomeByVenue.outcome.id,
542
553
  (_a = outcomeByVenue.outcome.externalIdentifier) != null ? _a : void 0,
543
- outcomeByVenue.market.externalIdentifier
554
+ outcomeByVenue.market.externalIdentifier,
555
+ (_b = marketWithCanonicalId.marketId) != null ? _b : void 0,
556
+ canonicalMarketIdForHistory
544
557
  ].filter((value) => typeof value === "string" && value.trim().length > 0);
545
558
  };
546
559
  headerOutcomeItems.forEach((headerOutcomeItem) => {
@@ -572,7 +585,7 @@ var MarketDetailsContent = ({
572
585
  seriesByOutcomeLabel.set(headerOutcomeItem.label, graphSeries2);
573
586
  });
574
587
  return seriesByOutcomeLabel;
575
- }, [headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
588
+ }, [canonicalMarketIdForHistory, headerOutcomeItems, outcomesByLabel, priceHistoryByVenue]);
576
589
  const graphSeries = useMemo(() => {
577
590
  var _a;
578
591
  if (!selectedOutcomeLabel)
@@ -636,28 +649,29 @@ var MarketDetailsContent = ({
636
649
  Card,
637
650
  {
638
651
  className: cn(
639
- "w-full cursor-pointer rounded-agg-2xl text-left outline-none",
652
+ "w-full rounded-agg-2xl text-left outline-none",
640
653
  marketDetailsBaseCardClassName,
641
654
  classNames == null ? void 0 : classNames.root
642
655
  ),
643
- "aria-expanded": isOpened,
644
- "aria-controls": detailsContentId,
645
- role: "button",
646
- tabIndex: 0,
647
- "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
648
- onClick: handleToggleExpanded,
649
- onKeyDown: handleToggleExpanded,
650
656
  children: [
651
657
  /* @__PURE__ */ jsxs(
652
658
  "div",
653
659
  {
654
660
  className: cn(
655
- "flex flex-row items-center justify-between gap-3 px-5 py-4",
661
+ "cursor-pointer disabled:cursor-default",
662
+ "flex flex-wrap flex-row items-center justify-between gap-3 px-5 py-4",
656
663
  isOpened && "pb-3",
657
664
  classNames == null ? void 0 : classNames.header
658
665
  ),
666
+ "aria-expanded": isOpened,
667
+ "aria-controls": detailsContentId,
668
+ role: "button",
669
+ tabIndex: 0,
670
+ "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
671
+ onClick: handleToggleExpanded,
672
+ onKeyDown: handleToggleExpanded,
659
673
  children: [
660
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
674
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-52 items-center gap-3 md:gap-4", children: [
661
675
  model.image ? /* @__PURE__ */ jsx(
662
676
  "img",
663
677
  {
@@ -736,10 +750,7 @@ var MarketDetailsContent = ({
736
750
  id: detailsContentId,
737
751
  className: cn(
738
752
  "grid overflow-hidden",
739
- getMotionClassName(
740
- config.enableAnimations,
741
- "transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"
742
- ),
753
+ getMotionClassName(config.enableAnimations, "transition-all duration-500 ease-in-out"),
743
754
  isOpened ? "grid-rows-[1fr] opacity-100" : "pointer-events-none grid-rows-[0fr] opacity-0"
744
755
  ),
745
756
  "aria-hidden": !isOpened,
@@ -751,7 +762,7 @@ var MarketDetailsContent = ({
751
762
  className: cn(
752
763
  getMotionClassName(
753
764
  config.enableAnimations,
754
- "transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"
765
+ "transition-all duration-500 ease-in-out"
755
766
  ),
756
767
  isOpened ? cn(
757
768
  "translate-y-0 opacity-100",
@@ -772,26 +783,15 @@ var MarketDetailsContent = ({
772
783
  ) }),
773
784
  /* @__PURE__ */ jsx("div", { className: "h-px w-full bg-agg-separator" }),
774
785
  /* @__PURE__ */ jsxs("div", { className: cn("p-5", classNames == null ? void 0 : classNames.content), children: [
775
- selectedTab === "order-book" ? /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.orderBook), children: isOrderBookLoading ? /* @__PURE__ */ jsxs(
776
- "div",
777
- {
778
- className: "flex flex-col gap-2 min-h-40 items-center justify-center",
779
- role: "status",
780
- "aria-label": labels.marketDetails.loadingOrderbookAria,
781
- "aria-busy": true,
782
- children: [
783
- /* @__PURE__ */ jsx(LoadingIcon, {}),
784
- /* @__PURE__ */ jsx(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.loadingOrderbookLabel })
785
- ]
786
- }
787
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
786
+ selectedTab === "order-book" ? /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-5", classNames == null ? void 0 : classNames.orderBook), children: isOrderBookLoading ? /* @__PURE__ */ jsx(MarketDetailsOderbookSkeleton, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
788
787
  /* @__PURE__ */ jsx(
789
788
  OrderBookRows,
790
789
  {
791
790
  rows: askRows,
792
791
  title: labels.marketDetails.asks,
793
792
  formatNumber: config.formatNumber,
794
- formatCurrency: config.formatCurrency
793
+ formatCurrency: config.formatCurrency,
794
+ visibleRows: orderBookDepth
795
795
  }
796
796
  ),
797
797
  /* @__PURE__ */ jsx(
@@ -800,7 +800,8 @@ var MarketDetailsContent = ({
800
800
  rows: bidRows,
801
801
  title: labels.marketDetails.bids,
802
802
  formatNumber: config.formatNumber,
803
- formatCurrency: config.formatCurrency
803
+ formatCurrency: config.formatCurrency,
804
+ visibleRows: orderBookDepth
804
805
  }
805
806
  )
806
807
  ] }) }) : null,
@@ -2,11 +2,11 @@ import {
2
2
  resolveOutcomeTitle,
3
3
  selectPrimaryVenueMarket,
4
4
  sortOutcomes
5
- } from "./chunk-GHB3GOCW.mjs";
5
+ } from "./chunk-QM7CGMFG.mjs";
6
6
  import {
7
7
  fallbackLineColors,
8
8
  lineColorByVenue
9
- } from "./chunk-V52WSZHQ.mjs";
9
+ } from "./chunk-M4RJHRFT.mjs";
10
10
 
11
11
  // src/events/item-details/event-list-item-details.utils.ts
12
12
  import dayjs from "dayjs";
@@ -107,18 +107,22 @@ var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
107
107
  };
108
108
  }).filter((item) => item != null);
109
109
  };
110
- var buildPriceHistoryGroups = (selectedOutcomes) => {
111
- const venueMarketOutcomeIdsByVenue = /* @__PURE__ */ new Map();
112
- selectedOutcomes.forEach(({ venue, outcome }) => {
113
- var _a;
114
- if (!venueMarketOutcomeIdsByVenue.has(venue)) {
115
- venueMarketOutcomeIdsByVenue.set(venue, []);
110
+ var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
111
+ const marketIdByVenue = /* @__PURE__ */ new Map();
112
+ selectedOutcomes.forEach(({ venue, market }) => {
113
+ var _a, _b;
114
+ const marketWithCanonicalId = market;
115
+ const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
116
+ if (!canonicalMarketId)
117
+ return;
118
+ if (!marketIdByVenue.has(venue)) {
119
+ marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
116
120
  }
117
- (_a = venueMarketOutcomeIdsByVenue.get(venue)) == null ? void 0 : _a.push(outcome.id);
121
+ (_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
118
122
  });
119
- return [...venueMarketOutcomeIdsByVenue.entries()].map(([venue, venueMarketOutcomeIds]) => ({
123
+ return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
120
124
  venue,
121
- venueMarketOutcomeIds
125
+ venueMarketOutcomeIds: [...marketIds]
122
126
  })).filter((group) => group.venueMarketOutcomeIds.length > 0);
123
127
  };
124
128
  var resolveSeriesColor = (venue, index) => {