@agg-build/ui 4.18.0 → 4.18.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/events.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  EventList,
5
5
  EventListItem,
6
6
  EventListItemV2
7
- } from "./chunk-WSZYDOZN.mjs";
7
+ } from "./chunk-DXASFSVL.mjs";
8
8
  import {
9
9
  EventListItemDetails,
10
10
  MarketDetails,
@@ -19,13 +19,13 @@ import {
19
19
  orderbookRowLimitDefault,
20
20
  resolveEventDetailsSyncKey,
21
21
  useCenterOrderbookSpread
22
- } from "./chunk-2UPO6G3S.mjs";
22
+ } from "./chunk-DWPBGMVJ.mjs";
23
23
  import {
24
24
  formatProbabilityCents,
25
25
  resolveOrderBookRows,
26
26
  resolveUnifiedOrderBookEntries
27
- } from "./chunk-JJ3VVCEP.mjs";
28
- import "./chunk-WIGSRHUG.mjs";
27
+ } from "./chunk-WOCZ4TVT.mjs";
28
+ import "./chunk-XZVGHKMW.mjs";
29
29
  export {
30
30
  EventList,
31
31
  EventListItem,
package/dist/index.js CHANGED
@@ -7335,7 +7335,8 @@ var init_remote_image = __esm({
7335
7335
  width,
7336
7336
  height,
7337
7337
  onClick,
7338
- ariaLabel
7338
+ ariaLabel,
7339
+ fallback
7339
7340
  }) => {
7340
7341
  const {
7341
7342
  general: { theme }
@@ -7392,7 +7393,7 @@ var init_remote_image = __esm({
7392
7393
  className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
7393
7394
  "aria-hidden": true,
7394
7395
  "aria-errormessage": "Image failed to load",
7395
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7396
+ children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7396
7397
  Icon,
7397
7398
  {
7398
7399
  name: "image",
@@ -13600,13 +13601,17 @@ var init_event_list_item_details_utils = __esm({
13600
13601
  nowSec = (0, import_dayjs4.default)().unix(),
13601
13602
  selectedMarket
13602
13603
  }) => {
13603
- var _a, _b;
13604
+ var _a;
13604
13605
  const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
13605
- const preferredEventStart = (_a = toUnixTimestamp(event.startDate)) != null ? _a : toUnixTimestamp(event.creationDate);
13606
- const marketStartCandidates = scopedMarkets.map((market) => {
13607
- var _a2;
13608
- return (_a2 = toUnixTimestamp(market.startDate)) != null ? _a2 : toUnixTimestamp(market.creationDate);
13609
- }).filter((value) => value != null);
13606
+ const resolveHistoryStart = (startDate, creationDate) => {
13607
+ const start = toUnixTimestamp(startDate);
13608
+ if (start != null && start <= nowSec) return start;
13609
+ const created = toUnixTimestamp(creationDate);
13610
+ if (created != null && created <= nowSec) return created;
13611
+ return null;
13612
+ };
13613
+ const preferredEventStart = resolveHistoryStart(event.startDate, event.creationDate);
13614
+ const marketStartCandidates = scopedMarkets.map((market) => resolveHistoryStart(market.startDate, market.creationDate)).filter((value) => value != null);
13610
13615
  const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
13611
13616
  (value) => value != null
13612
13617
  );
@@ -13644,7 +13649,7 @@ var init_event_list_item_details_utils = __esm({
13644
13649
  const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
13645
13650
  return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
13646
13651
  });
13647
- return (_b = matchingRange != null ? matchingRange : fallbackRange) != null ? _b : "ALL";
13652
+ return (_a = matchingRange != null ? matchingRange : fallbackRange) != null ? _a : "ALL";
13648
13653
  };
13649
13654
  matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
13650
13655
  const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
@@ -17424,6 +17429,20 @@ var init_item_details = __esm({
17424
17429
  resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
17425
17430
  scopedSelectedMarketId
17426
17431
  );
17432
+ const selectedBetdexOutcomes = (0, import_react31.useMemo)(
17433
+ () => eventDetailVenueMarkets.filter((market) => market.venue === "betdex").flatMap(
17434
+ (market) => market.venueMarketOutcomes.map((outcome) => ({
17435
+ venue: market.venue,
17436
+ venueMarketOutcomeId: outcome.id
17437
+ }))
17438
+ ),
17439
+ [eventDetailVenueMarkets]
17440
+ );
17441
+ (0, import_hooks59.useMarketOrderbook)({
17442
+ venueOutcomes: selectedBetdexOutcomes,
17443
+ enabled: !resolvedEventTradingState.isTradingDisabled && selectedBetdexOutcomes.length > 0,
17444
+ live: false
17445
+ });
17427
17446
  const wsLivePrices = (0, import_hooks59.useLiveOutcomePrices)(eventDetailVenueMarkets);
17428
17447
  const wsBestPrices = (0, import_hooks59.useLiveBestPrices)(eventDetailVenueMarkets);
17429
17448
  const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
@@ -17561,6 +17580,7 @@ var init_item_details = __esm({
17561
17580
  src: (0, import_hooks59.optimizedImageUrl)(event.image, 60),
17562
17581
  retinaSrc: (0, import_hooks59.retinaImageUrl)(event.image, 60),
17563
17582
  alt: "",
17583
+ fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(VenueLogo, { venue: event.venue, size: "large" }) : void 0,
17564
17584
  className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
17565
17585
  }
17566
17586
  ),
@@ -17712,7 +17732,7 @@ var init_item_details = __esm({
17712
17732
  selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
17713
17733
  eventEndDate: event.endDate,
17714
17734
  contractWindow,
17715
- range: config.chart.selectedChartTimeRange,
17735
+ range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
17716
17736
  live: !resolvedEventTradingState.isTradingDisabled && config.features.enableLiveUpdates
17717
17737
  },
17718
17738
  event.id
@@ -17762,7 +17782,7 @@ var init_item_details = __esm({
17762
17782
  ) : null,
17763
17783
  !contractWindow ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }) : null,
17764
17784
  !contractWindow && import_hooks59.CHART_TIME_RANGES.map((timeRange) => {
17765
- const effectiveRange = chartView === "all" ? config.chart.selectedChartTimeRange : chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
17785
+ const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
17766
17786
  const isActive = timeRange === effectiveRange;
17767
17787
  return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
17768
17788
  Button,
@@ -19351,6 +19371,13 @@ var init_market_details = __esm({
19351
19371
  labels
19352
19372
  });
19353
19373
  }, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title2]);
19374
+ const primaryVenue = (0, import_react36.useMemo)(
19375
+ () => {
19376
+ var _a2, _b2;
19377
+ return (_b2 = (_a2 = venueMarkets.find((venueMarket) => venueMarket.id === marketId)) != null ? _a2 : venueMarkets[0]) == null ? void 0 : _b2.venue;
19378
+ },
19379
+ [venueMarkets, marketId]
19380
+ );
19354
19381
  const livePrices = (0, import_react36.useMemo)(() => {
19355
19382
  const merged = /* @__PURE__ */ new Map();
19356
19383
  if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
@@ -19557,6 +19584,26 @@ var init_market_details = __esm({
19557
19584
  });
19558
19585
  }, [model, selectedOutcomeLabel, selectedOutcomeId]);
19559
19586
  const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
19587
+ const betdexSeedOutcomes = (0, import_react36.useMemo)(
19588
+ () => {
19589
+ var _a2;
19590
+ return ((_a2 = model == null ? void 0 : model.market.venueMarkets) != null ? _a2 : []).filter((venueMarket) => venueMarket.venue === "betdex").flatMap(
19591
+ (venueMarket) => {
19592
+ var _a3;
19593
+ return ((_a3 = venueMarket.venueMarketOutcomes) != null ? _a3 : []).map((outcome) => ({
19594
+ venue: venueMarket.venue,
19595
+ venueMarketOutcomeId: outcome.id
19596
+ }));
19597
+ }
19598
+ );
19599
+ },
19600
+ [model]
19601
+ );
19602
+ (0, import_hooks63.useMarketOrderbook)({
19603
+ venueOutcomes: betdexSeedOutcomes,
19604
+ enabled: !orderBookEnabled && !marketTradingState.isTradingDisabled && betdexSeedOutcomes.length > 0,
19605
+ live: false
19606
+ });
19560
19607
  const selectedVenueOutcome = selectedOutcomesByVenue.find(
19561
19608
  (item) => item.outcomeId === selectedOutcomeId
19562
19609
  );
@@ -19751,6 +19798,7 @@ var init_market_details = __esm({
19751
19798
  src: (0, import_hooks63.optimizedImageUrl)(model.image, 60),
19752
19799
  retinaSrc: (0, import_hooks63.retinaImageUrl)(model.image, 60),
19753
19800
  alt: "",
19801
+ fallback: primaryVenue ? /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(VenueLogo, { venue: primaryVenue, size: "large" }) : void 0,
19754
19802
  className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
19755
19803
  }
19756
19804
  ) : null,
@@ -23257,7 +23305,7 @@ var init_index_place_order_utils = __esm({
23257
23305
  selectedMarket,
23258
23306
  tradeSide = "buy"
23259
23307
  }) => {
23260
- var _a, _b, _c, _d, _e;
23308
+ var _a, _b, _c, _d, _e, _f;
23261
23309
  if (!selectedMarket) {
23262
23310
  return {
23263
23311
  tone: "warning",
@@ -23277,7 +23325,15 @@ var init_index_place_order_utils = __esm({
23277
23325
  };
23278
23326
  }
23279
23327
  if (quoteData.status === "no_orderbooks") {
23280
- const serverError = (_a = quoteData.error) == null ? void 0 : _a.trim();
23328
+ const warnings = (_a = quoteData.warnings) != null ? _a : [];
23329
+ if (warnings.length > 0 && warnings.every((warning) => warning.reason === "hosted_cash_unavailable")) {
23330
+ return {
23331
+ tone: "warning",
23332
+ message: labels.betdexBalanceUnavailable,
23333
+ placement: "above-action"
23334
+ };
23335
+ }
23336
+ const serverError = (_b = quoteData.error) == null ? void 0 : _b.trim();
23281
23337
  return {
23282
23338
  tone: "error",
23283
23339
  message: serverError || labels.noOrderbooks,
@@ -23294,24 +23350,24 @@ var init_index_place_order_utils = __esm({
23294
23350
  if (quoteData.status === "insufficient_input_amount") {
23295
23351
  return {
23296
23352
  tone: "error",
23297
- message: (_b = quoteData.message) != null ? _b : labels.insufficientInputAmount,
23353
+ message: (_c = quoteData.message) != null ? _c : labels.insufficientInputAmount,
23298
23354
  placement: "above-action"
23299
23355
  };
23300
23356
  }
23301
23357
  if (quoteData.status === "invalid_input") {
23302
23358
  return {
23303
23359
  tone: "error",
23304
- message: (_c = quoteData.message) != null ? _c : labels.quoteUnavailable,
23360
+ message: (_d = quoteData.message) != null ? _d : labels.quoteUnavailable,
23305
23361
  placement: "above-action"
23306
23362
  };
23307
23363
  }
23308
23364
  if (quoteData.status === "insufficient_position") {
23309
- const total = (_d = quoteData.positionAvailability) == null ? void 0 : _d.totalSellableShares;
23365
+ const total = (_e = quoteData.positionAvailability) == null ? void 0 : _e.totalSellableShares;
23310
23366
  const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
23311
23367
  return { tone: "error", message, placement: "above-action" };
23312
23368
  }
23313
23369
  if (quoteData.status === "insufficient_depth") {
23314
- const serverError = (_e = quoteData.error) == null ? void 0 : _e.trim();
23370
+ const serverError = (_f = quoteData.error) == null ? void 0 : _f.trim();
23315
23371
  return {
23316
23372
  tone: "error",
23317
23373
  message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
@@ -25993,6 +26049,7 @@ var init_place_order = __esm({
25993
26049
  headerSubtitle,
25994
26050
  headerImage,
25995
26051
  headerTitle,
26052
+ headerVenue,
25996
26053
  onClose
25997
26054
  }) => {
25998
26055
  if (!headerTitle) return null;
@@ -26003,6 +26060,7 @@ var init_place_order = __esm({
26003
26060
  {
26004
26061
  src: headerImage,
26005
26062
  alt: "",
26063
+ fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
26006
26064
  className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
26007
26065
  }
26008
26066
  ),
@@ -26329,7 +26387,7 @@ var init_place_order = __esm({
26329
26387
  showResolvingState = false,
26330
26388
  midpointsResult
26331
26389
  }) => {
26332
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha;
26390
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
26333
26391
  const {
26334
26392
  enableDebug: isExecutionDebugEnabled,
26335
26393
  features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
@@ -28615,6 +28673,7 @@ var init_place_order = __esm({
28615
28673
  headerSubtitle,
28616
28674
  headerImage,
28617
28675
  headerTitle,
28676
+ headerVenue: (_ia = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ia : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
28618
28677
  onClose
28619
28678
  }),
28620
28679
  /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
@@ -35166,6 +35225,7 @@ var EventListItemContent = ({
35166
35225
  src: (0, import_hooks44.optimizedImageUrl)(resolvedImage, 40),
35167
35226
  retinaSrc: (0, import_hooks44.retinaImageUrl)(resolvedImage, 40),
35168
35227
  alt: "",
35228
+ fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
35169
35229
  classNames: {
35170
35230
  root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
35171
35231
  image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
@@ -35661,6 +35721,18 @@ var getDefaultEventListTabs = (labels) => {
35661
35721
  venueLogo: import_sdk16.Venue.prophetx,
35662
35722
  venues: [import_sdk16.Venue.prophetx]
35663
35723
  },
35724
+ {
35725
+ value: import_sdk16.Venue.tiprun,
35726
+ label: labels.venues.tiprun,
35727
+ venueLogo: import_sdk16.Venue.tiprun,
35728
+ venues: [import_sdk16.Venue.tiprun]
35729
+ },
35730
+ {
35731
+ value: import_sdk16.Venue.betdex,
35732
+ label: labels.venues.betdex,
35733
+ venueLogo: import_sdk16.Venue.betdex,
35734
+ venues: [import_sdk16.Venue.betdex]
35735
+ },
35664
35736
  {
35665
35737
  value: import_sdk16.Venue.opinion,
35666
35738
  label: labels.venues.opinion,
package/dist/index.mjs CHANGED
@@ -12,12 +12,12 @@ import {
12
12
  buildAggTxExplorerHref,
13
13
  formatShareAmount,
14
14
  useHomePageModals
15
- } from "./chunk-FTWJRLJQ.mjs";
15
+ } from "./chunk-RFMA5ABT.mjs";
16
16
  import {
17
17
  EventList,
18
18
  EventListItem,
19
19
  EventListItemV2
20
- } from "./chunk-WSZYDOZN.mjs";
20
+ } from "./chunk-DXASFSVL.mjs";
21
21
  import {
22
22
  CARD_NETWORK_OPTIONS,
23
23
  DepositModal,
@@ -30,14 +30,14 @@ import {
30
30
  buildTerminalSummary,
31
31
  clearPendingCardSession,
32
32
  getPendingCardSession
33
- } from "./chunk-ZNOAKSPT.mjs";
33
+ } from "./chunk-47CCGQH6.mjs";
34
34
  import {
35
35
  EventMarketPage,
36
36
  EventOpenOrders,
37
37
  EventOpenOrdersCard,
38
38
  formatRecurringCountdown,
39
39
  useEventOpenOrders
40
- } from "./chunk-HFL3CEWG.mjs";
40
+ } from "./chunk-NSQQ62QK.mjs";
41
41
  import {
42
42
  EventListItemDetails,
43
43
  MarketDetails,
@@ -52,7 +52,7 @@ import {
52
52
  orderbookRowLimitDefault,
53
53
  resolveEventDetailsSyncKey,
54
54
  useCenterOrderbookSpread
55
- } from "./chunk-2UPO6G3S.mjs";
55
+ } from "./chunk-DWPBGMVJ.mjs";
56
56
  import {
57
57
  AggNotificationEventsProvider,
58
58
  DEPOSIT_MODAL_OPEN_EVENT,
@@ -74,7 +74,7 @@ import {
74
74
  useResolvedMarketClaim,
75
75
  useSharedKycFlow,
76
76
  venueRequiresSharedKyc
77
- } from "./chunk-2OBJ7DYT.mjs";
77
+ } from "./chunk-5YHKIJ23.mjs";
78
78
  import {
79
79
  SETTLEMENT_SECTION_ID,
80
80
  Settlement,
@@ -95,7 +95,7 @@ import {
95
95
  resolveOrderBookRows,
96
96
  resolveUnifiedOrderBookEntries,
97
97
  useEventTradingContext
98
- } from "./chunk-JJ3VVCEP.mjs";
98
+ } from "./chunk-WOCZ4TVT.mjs";
99
99
  import {
100
100
  ConnectAccountsStep,
101
101
  ConnectKalshiModal,
@@ -106,7 +106,7 @@ import {
106
106
  OnboardingModal,
107
107
  ProfileSetupStep,
108
108
  SharedKycModal
109
- } from "./chunk-NRPS2D3Q.mjs";
109
+ } from "./chunk-ROA5K67W.mjs";
110
110
  import {
111
111
  AGG_DEFAULT_URL,
112
112
  AGG_DOCS_URL,
@@ -228,7 +228,7 @@ import {
228
228
  useOptionalToast,
229
229
  useToast,
230
230
  venueLogoNames
231
- } from "./chunk-WIGSRHUG.mjs";
231
+ } from "./chunk-XZVGHKMW.mjs";
232
232
 
233
233
  // src/notifications/agg-toast-provider.tsx
234
234
  import { jsx } from "react/jsx-runtime";
package/dist/modals.js CHANGED
@@ -4807,7 +4807,8 @@ var RemoteImage = ({
4807
4807
  width,
4808
4808
  height,
4809
4809
  onClick,
4810
- ariaLabel
4810
+ ariaLabel,
4811
+ fallback
4811
4812
  }) => {
4812
4813
  const {
4813
4814
  general: { theme }
@@ -4864,7 +4865,7 @@ var RemoteImage = ({
4864
4865
  className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
4865
4866
  "aria-hidden": true,
4866
4867
  "aria-errormessage": "Image failed to load",
4867
- children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4868
+ children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
4868
4869
  Icon,
4869
4870
  {
4870
4871
  name: "image",
package/dist/modals.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  buildTerminalSummary,
12
12
  clearPendingCardSession,
13
13
  getPendingCardSession
14
- } from "./chunk-ZNOAKSPT.mjs";
14
+ } from "./chunk-47CCGQH6.mjs";
15
15
  import {
16
16
  ConnectAccountsStep,
17
17
  ConnectKalshiModal,
@@ -22,8 +22,8 @@ import {
22
22
  OnboardingModal,
23
23
  ProfileSetupStep,
24
24
  SharedKycModal
25
- } from "./chunk-NRPS2D3Q.mjs";
26
- import "./chunk-WIGSRHUG.mjs";
25
+ } from "./chunk-ROA5K67W.mjs";
26
+ import "./chunk-XZVGHKMW.mjs";
27
27
  export {
28
28
  CARD_NETWORK_OPTIONS,
29
29
  ConnectAccountsStep,
package/dist/pages.js CHANGED
@@ -7242,7 +7242,8 @@ var init_remote_image = __esm({
7242
7242
  width,
7243
7243
  height,
7244
7244
  onClick,
7245
- ariaLabel
7245
+ ariaLabel,
7246
+ fallback
7246
7247
  }) => {
7247
7248
  const {
7248
7249
  general: { theme }
@@ -7299,7 +7300,7 @@ var init_remote_image = __esm({
7299
7300
  className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
7300
7301
  "aria-hidden": true,
7301
7302
  "aria-errormessage": "Image failed to load",
7302
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7303
+ children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
7303
7304
  Icon,
7304
7305
  {
7305
7306
  name: "image",
@@ -12899,13 +12900,17 @@ var init_event_list_item_details_utils = __esm({
12899
12900
  nowSec = (0, import_dayjs4.default)().unix(),
12900
12901
  selectedMarket
12901
12902
  }) => {
12902
- var _a, _b;
12903
+ var _a;
12903
12904
  const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
12904
- const preferredEventStart = (_a = toUnixTimestamp(event.startDate)) != null ? _a : toUnixTimestamp(event.creationDate);
12905
- const marketStartCandidates = scopedMarkets.map((market) => {
12906
- var _a2;
12907
- return (_a2 = toUnixTimestamp(market.startDate)) != null ? _a2 : toUnixTimestamp(market.creationDate);
12908
- }).filter((value) => value != null);
12905
+ const resolveHistoryStart = (startDate, creationDate) => {
12906
+ const start = toUnixTimestamp(startDate);
12907
+ if (start != null && start <= nowSec) return start;
12908
+ const created = toUnixTimestamp(creationDate);
12909
+ if (created != null && created <= nowSec) return created;
12910
+ return null;
12911
+ };
12912
+ const preferredEventStart = resolveHistoryStart(event.startDate, event.creationDate);
12913
+ const marketStartCandidates = scopedMarkets.map((market) => resolveHistoryStart(market.startDate, market.creationDate)).filter((value) => value != null);
12909
12914
  const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
12910
12915
  (value) => value != null
12911
12916
  );
@@ -12943,7 +12948,7 @@ var init_event_list_item_details_utils = __esm({
12943
12948
  const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
12944
12949
  return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
12945
12950
  });
12946
- return (_b = matchingRange != null ? matchingRange : fallbackRange) != null ? _b : "ALL";
12951
+ return (_a = matchingRange != null ? matchingRange : fallbackRange) != null ? _a : "ALL";
12947
12952
  };
12948
12953
  matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
12949
12954
  const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
@@ -16649,6 +16654,20 @@ var init_item_details = __esm({
16649
16654
  resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
16650
16655
  scopedSelectedMarketId
16651
16656
  );
16657
+ const selectedBetdexOutcomes = (0, import_react35.useMemo)(
16658
+ () => eventDetailVenueMarkets.filter((market) => market.venue === "betdex").flatMap(
16659
+ (market) => market.venueMarketOutcomes.map((outcome) => ({
16660
+ venue: market.venue,
16661
+ venueMarketOutcomeId: outcome.id
16662
+ }))
16663
+ ),
16664
+ [eventDetailVenueMarkets]
16665
+ );
16666
+ (0, import_hooks58.useMarketOrderbook)({
16667
+ venueOutcomes: selectedBetdexOutcomes,
16668
+ enabled: !resolvedEventTradingState.isTradingDisabled && selectedBetdexOutcomes.length > 0,
16669
+ live: false
16670
+ });
16652
16671
  const wsLivePrices = (0, import_hooks58.useLiveOutcomePrices)(eventDetailVenueMarkets);
16653
16672
  const wsBestPrices = (0, import_hooks58.useLiveBestPrices)(eventDetailVenueMarkets);
16654
16673
  const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
@@ -16786,6 +16805,7 @@ var init_item_details = __esm({
16786
16805
  src: (0, import_hooks58.optimizedImageUrl)(event.image, 60),
16787
16806
  retinaSrc: (0, import_hooks58.retinaImageUrl)(event.image, 60),
16788
16807
  alt: "",
16808
+ fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: event.venue, size: "large" }) : void 0,
16789
16809
  className: "agg-event-image size-10 rounded-agg-lg object-cover md:size-[60px]"
16790
16810
  }
16791
16811
  ),
@@ -16937,7 +16957,7 @@ var init_item_details = __esm({
16937
16957
  selectedOutcomeId: (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedOutcomeId : (_f = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venueMarketOutcomes[0]) == null ? void 0 : _f.id,
16938
16958
  eventEndDate: event.endDate,
16939
16959
  contractWindow,
16940
- range: config.chart.selectedChartTimeRange,
16960
+ range: chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange,
16941
16961
  live: !resolvedEventTradingState.isTradingDisabled && config.features.enableLiveUpdates
16942
16962
  },
16943
16963
  event.id
@@ -16987,7 +17007,7 @@ var init_item_details = __esm({
16987
17007
  ) : null,
16988
17008
  !contractWindow ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { "aria-hidden": "true", className: "hidden h-4 w-px bg-agg-separator md:block" }) : null,
16989
17009
  !contractWindow && import_hooks58.CHART_TIME_RANGES.map((timeRange) => {
16990
- const effectiveRange = chartView === "all" ? config.chart.selectedChartTimeRange : chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
17010
+ const effectiveRange = chartRangeOverride != null ? chartRangeOverride : config.chart.selectedChartTimeRange;
16991
17011
  const isActive = timeRange === effectiveRange;
16992
17012
  return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
16993
17013
  Button,
@@ -18572,6 +18592,13 @@ var init_market_details = __esm({
18572
18592
  labels
18573
18593
  });
18574
18594
  }, [config.formatting.formatCompactCurrency, venueMarkets, image, labels, marketId, title2]);
18595
+ const primaryVenue = (0, import_react40.useMemo)(
18596
+ () => {
18597
+ var _a2, _b2;
18598
+ return (_b2 = (_a2 = venueMarkets.find((venueMarket) => venueMarket.id === marketId)) != null ? _a2 : venueMarkets[0]) == null ? void 0 : _b2.venue;
18599
+ },
18600
+ [venueMarkets, marketId]
18601
+ );
18575
18602
  const livePrices = (0, import_react40.useMemo)(() => {
18576
18603
  const merged = /* @__PURE__ */ new Map();
18577
18604
  if (midpointsFallback == null ? void 0 : midpointsFallback.size) {
@@ -18778,6 +18805,26 @@ var init_market_details = __esm({
18778
18805
  });
18779
18806
  }, [model, selectedOutcomeLabel, selectedOutcomeId]);
18780
18807
  const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
18808
+ const betdexSeedOutcomes = (0, import_react40.useMemo)(
18809
+ () => {
18810
+ var _a2;
18811
+ return ((_a2 = model == null ? void 0 : model.market.venueMarkets) != null ? _a2 : []).filter((venueMarket) => venueMarket.venue === "betdex").flatMap(
18812
+ (venueMarket) => {
18813
+ var _a3;
18814
+ return ((_a3 = venueMarket.venueMarketOutcomes) != null ? _a3 : []).map((outcome) => ({
18815
+ venue: venueMarket.venue,
18816
+ venueMarketOutcomeId: outcome.id
18817
+ }));
18818
+ }
18819
+ );
18820
+ },
18821
+ [model]
18822
+ );
18823
+ (0, import_hooks62.useMarketOrderbook)({
18824
+ venueOutcomes: betdexSeedOutcomes,
18825
+ enabled: !orderBookEnabled && !marketTradingState.isTradingDisabled && betdexSeedOutcomes.length > 0,
18826
+ live: false
18827
+ });
18781
18828
  const selectedVenueOutcome = selectedOutcomesByVenue.find(
18782
18829
  (item) => item.outcomeId === selectedOutcomeId
18783
18830
  );
@@ -18972,6 +19019,7 @@ var init_market_details = __esm({
18972
19019
  src: (0, import_hooks62.optimizedImageUrl)(model.image, 60),
18973
19020
  retinaSrc: (0, import_hooks62.retinaImageUrl)(model.image, 60),
18974
19021
  alt: "",
19022
+ fallback: primaryVenue ? /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(VenueLogo, { venue: primaryVenue, size: "large" }) : void 0,
18975
19023
  className: "agg-market-image size-12 rounded-agg-lg object-cover md:size-[60px]"
18976
19024
  }
18977
19025
  ) : null,
@@ -22551,7 +22599,7 @@ var init_index_place_order_utils = __esm({
22551
22599
  selectedMarket,
22552
22600
  tradeSide = "buy"
22553
22601
  }) => {
22554
- var _a, _b, _c, _d, _e;
22602
+ var _a, _b, _c, _d, _e, _f;
22555
22603
  if (!selectedMarket) {
22556
22604
  return {
22557
22605
  tone: "warning",
@@ -22571,7 +22619,15 @@ var init_index_place_order_utils = __esm({
22571
22619
  };
22572
22620
  }
22573
22621
  if (quoteData.status === "no_orderbooks") {
22574
- const serverError = (_a = quoteData.error) == null ? void 0 : _a.trim();
22622
+ const warnings = (_a = quoteData.warnings) != null ? _a : [];
22623
+ if (warnings.length > 0 && warnings.every((warning) => warning.reason === "hosted_cash_unavailable")) {
22624
+ return {
22625
+ tone: "warning",
22626
+ message: labels.betdexBalanceUnavailable,
22627
+ placement: "above-action"
22628
+ };
22629
+ }
22630
+ const serverError = (_b = quoteData.error) == null ? void 0 : _b.trim();
22575
22631
  return {
22576
22632
  tone: "error",
22577
22633
  message: serverError || labels.noOrderbooks,
@@ -22588,24 +22644,24 @@ var init_index_place_order_utils = __esm({
22588
22644
  if (quoteData.status === "insufficient_input_amount") {
22589
22645
  return {
22590
22646
  tone: "error",
22591
- message: (_b = quoteData.message) != null ? _b : labels.insufficientInputAmount,
22647
+ message: (_c = quoteData.message) != null ? _c : labels.insufficientInputAmount,
22592
22648
  placement: "above-action"
22593
22649
  };
22594
22650
  }
22595
22651
  if (quoteData.status === "invalid_input") {
22596
22652
  return {
22597
22653
  tone: "error",
22598
- message: (_c = quoteData.message) != null ? _c : labels.quoteUnavailable,
22654
+ message: (_d = quoteData.message) != null ? _d : labels.quoteUnavailable,
22599
22655
  placement: "above-action"
22600
22656
  };
22601
22657
  }
22602
22658
  if (quoteData.status === "insufficient_position") {
22603
- const total = (_d = quoteData.positionAvailability) == null ? void 0 : _d.totalSellableShares;
22659
+ const total = (_e = quoteData.positionAvailability) == null ? void 0 : _e.totalSellableShares;
22604
22660
  const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
22605
22661
  return { tone: "error", message, placement: "above-action" };
22606
22662
  }
22607
22663
  if (quoteData.status === "insufficient_depth") {
22608
- const serverError = (_e = quoteData.error) == null ? void 0 : _e.trim();
22664
+ const serverError = (_f = quoteData.error) == null ? void 0 : _f.trim();
22609
22665
  return {
22610
22666
  tone: "error",
22611
22667
  message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
@@ -25284,6 +25340,7 @@ var init_place_order = __esm({
25284
25340
  headerSubtitle,
25285
25341
  headerImage,
25286
25342
  headerTitle,
25343
+ headerVenue,
25287
25344
  onClose
25288
25345
  }) => {
25289
25346
  if (!headerTitle) return null;
@@ -25294,6 +25351,7 @@ var init_place_order = __esm({
25294
25351
  {
25295
25352
  src: headerImage,
25296
25353
  alt: "",
25354
+ fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
25297
25355
  className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
25298
25356
  }
25299
25357
  ),
@@ -25620,7 +25678,7 @@ var init_place_order = __esm({
25620
25678
  showResolvingState = false,
25621
25679
  midpointsResult
25622
25680
  }) => {
25623
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha;
25681
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
25624
25682
  const {
25625
25683
  enableDebug: isExecutionDebugEnabled,
25626
25684
  features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
@@ -27906,6 +27964,7 @@ var init_place_order = __esm({
27906
27964
  headerSubtitle,
27907
27965
  headerImage,
27908
27966
  headerTitle,
27967
+ headerVenue: (_ia = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ia : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
27909
27968
  onClose
27910
27969
  }),
27911
27970
  /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
@@ -33372,6 +33431,7 @@ var EventListItemContent = ({
33372
33431
  src: (0, import_hooks40.optimizedImageUrl)(resolvedImage, 40),
33373
33432
  retinaSrc: (0, import_hooks40.retinaImageUrl)(resolvedImage, 40),
33374
33433
  alt: "",
33434
+ fallback: event.venue ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(VenueLogo, { venue: event.venue, size: "medium" }) : void 0,
33375
33435
  classNames: {
33376
33436
  root: "agg-event-image h-10 w-10 shrink-0 rounded-agg-lg object-cover",
33377
33437
  image: "transition-transform duration-300 group-hover/agg-event-card:scale-110"
@@ -33867,6 +33927,18 @@ var getDefaultEventListTabs = (labels) => {
33867
33927
  venueLogo: import_sdk14.Venue.prophetx,
33868
33928
  venues: [import_sdk14.Venue.prophetx]
33869
33929
  },
33930
+ {
33931
+ value: import_sdk14.Venue.tiprun,
33932
+ label: labels.venues.tiprun,
33933
+ venueLogo: import_sdk14.Venue.tiprun,
33934
+ venues: [import_sdk14.Venue.tiprun]
33935
+ },
33936
+ {
33937
+ value: import_sdk14.Venue.betdex,
33938
+ label: labels.venues.betdex,
33939
+ venueLogo: import_sdk14.Venue.betdex,
33940
+ venues: [import_sdk14.Venue.betdex]
33941
+ },
33870
33942
  {
33871
33943
  value: import_sdk14.Venue.opinion,
33872
33944
  label: labels.venues.opinion,