@agg-build/ui 2.1.5 → 2.2.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.
Files changed (52) hide show
  1. package/dist/{chunk-T4YZGAYS.mjs → chunk-4QGZ3FWI.mjs} +1 -1
  2. package/dist/{chunk-XUBIJI4R.mjs → chunk-JGBEQ4IV.mjs} +1079 -872
  3. package/dist/{chunk-BW7S2YR3.mjs → chunk-JOZPXDNZ.mjs} +48 -21
  4. package/dist/{chunk-R2YNZJZ3.mjs → chunk-LPIAEKSZ.mjs} +82 -2
  5. package/dist/{chunk-TBZWRUFB.mjs → chunk-QM3WWPCV.mjs} +201 -87
  6. package/dist/{chunk-VP76G6PN.mjs → chunk-UTXQUOU3.mjs} +177 -27
  7. package/dist/{chunk-XHE2VO3S.mjs → chunk-ZRYHWHTD.mjs} +2 -2
  8. package/dist/events.js +369 -82
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2180 -1621
  11. package/dist/index.mjs +9 -7
  12. package/dist/modals.js +2 -2
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +1552 -995
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +74 -26
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +131 -20
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/item/event-list-item.types.d.mts +6 -2
  23. package/dist/types/events/item/event-list-item.types.d.ts +6 -2
  24. package/dist/types/events/item/event-list-item.utils.d.mts +3 -2
  25. package/dist/types/events/item/event-list-item.utils.d.ts +3 -2
  26. package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -6
  27. package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -6
  28. package/dist/types/events/item-details/event-list-item-details.utils.d.mts +9 -0
  29. package/dist/types/events/item-details/event-list-item-details.utils.d.ts +9 -0
  30. package/dist/types/events/market-details/market-details.types.d.mts +1 -0
  31. package/dist/types/events/market-details/market-details.types.d.ts +1 -0
  32. package/dist/types/events/shared/chart-venue-selection.d.mts +2 -1
  33. package/dist/types/events/shared/chart-venue-selection.d.ts +2 -1
  34. package/dist/types/events/shared/event-trading-state.utils.d.mts +4 -2
  35. package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
  36. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
  37. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
  38. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
  39. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
  40. package/dist/types/pages/user-profile/index.d.mts +1 -1
  41. package/dist/types/pages/user-profile/index.d.ts +1 -1
  42. package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
  43. package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
  44. package/dist/types/primitives/search/search.types.d.mts +1 -0
  45. package/dist/types/primitives/search/search.types.d.ts +1 -0
  46. package/dist/types/primitives/search/search.utils.d.mts +4 -1
  47. package/dist/types/primitives/search/search.utils.d.ts +4 -1
  48. package/dist/types/shared/utils.d.mts +16 -0
  49. package/dist/types/shared/utils.d.ts +16 -0
  50. package/dist/types/trading/types.d.mts +2 -1
  51. package/dist/types/trading/types.d.ts +2 -1
  52. package/package.json +3 -3
package/dist/pages.js CHANGED
@@ -156,6 +156,92 @@ var formatUsd = (value, options) => {
156
156
  maximumFractionDigits
157
157
  });
158
158
  };
159
+ var GENERIC_BINARY_OUTCOME_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
160
+ var TOTAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["over", "under"]);
161
+ var DIRECTIONAL_OUTCOME_LABELS = /* @__PURE__ */ new Set(["up", "down"]);
162
+ var NUMERIC_TOKEN_RE = /[-+]?\d+(?:\.\d+)?/;
163
+ var UP_OR_DOWN_QUESTION_RE = /\bup or down\b/i;
164
+ var normalizeResolvedOutcomeLabel = (value) => {
165
+ const trimmedValue = value == null ? void 0 : value.trim();
166
+ return trimmedValue ? trimmedValue : null;
167
+ };
168
+ var readOutcomeMetadataLabel = (outcome) => {
169
+ const outcomeRecord = outcome;
170
+ for (const key of ["displayName", "name", "title"]) {
171
+ const value = outcomeRecord[key];
172
+ if (typeof value !== "string") continue;
173
+ const normalizedValue = normalizeResolvedOutcomeLabel(value);
174
+ if (normalizedValue) return normalizedValue;
175
+ }
176
+ return null;
177
+ };
178
+ var formatLineValue = (value) => {
179
+ return Number.isInteger(value) ? String(value) : String(value);
180
+ };
181
+ var readMarketLabel = (market) => {
182
+ var _a;
183
+ const rawLabel = (_a = normalizeResolvedOutcomeLabel(market == null ? void 0 : market.shortTitle)) != null ? _a : normalizeResolvedOutcomeLabel(market == null ? void 0 : market.question);
184
+ if (!rawLabel) return null;
185
+ if (/^draw\s*\(/i.test(rawLabel)) return "Draw";
186
+ return rawLabel;
187
+ };
188
+ var deriveTotalOutcomeLabel = (outcome, metadataLabel) => {
189
+ const normalizedMetadataLabel = metadataLabel == null ? void 0 : metadataLabel.trim().toLowerCase();
190
+ if (normalizedMetadataLabel && TOTAL_OUTCOME_LABELS.has(normalizedMetadataLabel)) {
191
+ return metadataLabel;
192
+ }
193
+ const normalizedRawLabel = outcome.label.trim().toLowerCase();
194
+ if (normalizedRawLabel === "yes") return "Over";
195
+ if (normalizedRawLabel === "no") return "Under";
196
+ return metadataLabel;
197
+ };
198
+ var resolveResolvedOutcomeLabel = ({
199
+ market,
200
+ outcome,
201
+ allowSportsMoneylineMarketFallback = true
202
+ }) => {
203
+ var _a;
204
+ if (!outcome) return null;
205
+ const rawLabel = normalizeResolvedOutcomeLabel(outcome.label);
206
+ const metadataLabel = readOutcomeMetadataLabel(outcome);
207
+ const normalizedRawLabel = (_a = rawLabel == null ? void 0 : rawLabel.toLowerCase()) != null ? _a : "";
208
+ const isGenericBinary = GENERIC_BINARY_OUTCOME_LABELS.has(normalizedRawLabel);
209
+ const isSportsMarket = Boolean(
210
+ (market == null ? void 0 : market.sportsMarketType) || (market == null ? void 0 : market.marketGroup) || (market == null ? void 0 : market.lineValue) != null
211
+ );
212
+ if (!isSportsMarket) {
213
+ const isDirectionalBinaryMarket = Boolean((market == null ? void 0 : market.question) && UP_OR_DOWN_QUESTION_RE.test(market.question)) && Boolean(metadataLabel && DIRECTIONAL_OUTCOME_LABELS.has(metadataLabel.trim().toLowerCase()));
214
+ if (isDirectionalBinaryMarket) return metadataLabel;
215
+ if (isGenericBinary) return rawLabel;
216
+ return metadataLabel != null ? metadataLabel : rawLabel;
217
+ }
218
+ const lineValue = typeof (market == null ? void 0 : market.lineValue) === "number" ? market.lineValue : null;
219
+ const isMoneylineMarket = (market == null ? void 0 : market.sportsMarketType) === "moneyline" || (market == null ? void 0 : market.marketGroup) === "game_lines";
220
+ const isTotalMarket = (market == null ? void 0 : market.sportsMarketType) === "total" || (market == null ? void 0 : market.marketGroup) === "totals";
221
+ if (isMoneylineMarket && metadataLabel) return metadataLabel;
222
+ if (allowSportsMoneylineMarketFallback && isMoneylineMarket && isGenericBinary) {
223
+ const marketLabel = readMarketLabel(market);
224
+ if (marketLabel) return marketLabel;
225
+ }
226
+ if (isTotalMarket) {
227
+ const totalLabel = deriveTotalOutcomeLabel(outcome, metadataLabel);
228
+ if (totalLabel && lineValue != null && !NUMERIC_TOKEN_RE.test(totalLabel)) {
229
+ return `${totalLabel} ${formatLineValue(Math.abs(lineValue))}`;
230
+ }
231
+ if (totalLabel) return totalLabel;
232
+ }
233
+ const isSpreadMarket = (market == null ? void 0 : market.sportsMarketType) === "spread" || (market == null ? void 0 : market.marketGroup) === "spreads";
234
+ if (isSpreadMarket && metadataLabel) {
235
+ if (lineValue != null && !NUMERIC_TOKEN_RE.test(metadataLabel)) {
236
+ const resolvedLineValue = normalizedRawLabel === "no" ? Math.abs(lineValue) : lineValue;
237
+ const formattedLineValue = resolvedLineValue > 0 ? `+${formatLineValue(resolvedLineValue)}` : formatLineValue(resolvedLineValue);
238
+ return `${metadataLabel} ${formattedLineValue}`;
239
+ }
240
+ return metadataLabel;
241
+ }
242
+ if (metadataLabel) return metadataLabel;
243
+ return rawLabel;
244
+ };
159
245
 
160
246
  // src/primitives/error-boundary/index.tsx
161
247
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -3960,7 +4046,8 @@ var normalizeSeries = (series) => {
3960
4046
  }).filter((seriesItem) => seriesItem.points.length > 0);
3961
4047
  };
3962
4048
  var formatDefaultChartValue = (value) => {
3963
- return `${Number(value).toFixed(2)}%`;
4049
+ const roundedValue = Number(value.toFixed(1));
4050
+ return `${Number.isInteger(roundedValue) ? String(roundedValue) : roundedValue.toFixed(1)}%`;
3964
4051
  };
3965
4052
  var resolveChartTimeFormatter = (windowSeconds) => {
3966
4053
  return (timestamp) => {
@@ -5923,7 +6010,7 @@ var sizeClasses2 = {
5923
6010
  var lineColorByVenue = {
5924
6011
  light: {
5925
6012
  [import_sdk10.Venue.kalshi]: "#00D295",
5926
- [import_sdk10.Venue.limitless]: "#000000",
6013
+ [import_sdk10.Venue.limitless]: "#C4FF00",
5927
6014
  [import_sdk10.Venue.opinion]: "#000000",
5928
6015
  [import_sdk10.Venue.polymarket]: "#2E5CFF",
5929
6016
  [import_sdk10.Venue.predict]: "#6D57F8",
@@ -5933,7 +6020,7 @@ var lineColorByVenue = {
5933
6020
  },
5934
6021
  dark: {
5935
6022
  [import_sdk10.Venue.kalshi]: "#00D295",
5936
- [import_sdk10.Venue.limitless]: "#FFFFFF",
6023
+ [import_sdk10.Venue.limitless]: "#C4FF00",
5937
6024
  [import_sdk10.Venue.opinion]: "#FFFFFF",
5938
6025
  [import_sdk10.Venue.polymarket]: "#2E5CFF",
5939
6026
  [import_sdk10.Venue.predict]: "#6D57F8",
@@ -6261,13 +6348,26 @@ var formatMarketProbabilityPercent = (value, formatPercent = formatWholePercent)
6261
6348
  }
6262
6349
  return formattedValue;
6263
6350
  };
6264
- var formatPriceGapPercent = (value) => {
6351
+ var formatPriceGapPercent = (value, mode = "percent") => {
6265
6352
  if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
6353
+ if (value <= 0) return void 0;
6354
+ if (mode === "fraction") {
6355
+ const percentageValue = value * 100;
6356
+ if (percentageValue < import_hooks26.MIN_PRICE_GAP_PCT) return void 0;
6357
+ return `${Math.round(percentageValue)}%`;
6358
+ }
6266
6359
  if (value < import_hooks26.MIN_PRICE_GAP_PCT) return void 0;
6267
6360
  if (value > import_hooks26.MAX_PRICE_GAP_PCT) return void 0;
6268
6361
  return `${Math.round(value)}%`;
6269
6362
  };
6270
6363
  var sortOutcomes = (outcomes) => {
6364
+ return sortOutcomesWithPrices(outcomes);
6365
+ };
6366
+ var resolveOutcomeProbability = (outcome, priceByOutcomeId) => {
6367
+ const resolvedPrice = priceByOutcomeId === void 0 ? outcome.price : priceByOutcomeId.has(outcome.id) ? priceByOutcomeId.get(outcome.id) : void 0;
6368
+ return normalizeProbability(resolvedPrice);
6369
+ };
6370
+ var sortOutcomesWithPrices = (outcomes, priceByOutcomeId) => {
6271
6371
  if (outcomes.length <= 1) return outcomes;
6272
6372
  if (hasBinaryOutcomes(outcomes)) {
6273
6373
  return sortYesFirst(outcomes);
@@ -6283,38 +6383,41 @@ var sortOutcomes = (outcomes) => {
6283
6383
  }
6284
6384
  return [...outcomes].sort((a, b) => {
6285
6385
  var _a, _b;
6286
- const aPrice = (_a = normalizeProbability(a.price)) != null ? _a : 0;
6287
- const bPrice = (_b = normalizeProbability(b.price)) != null ? _b : 0;
6386
+ const aPrice = (_a = resolveOutcomeProbability(a, priceByOutcomeId)) != null ? _a : 0;
6387
+ const bPrice = (_b = resolveOutcomeProbability(b, priceByOutcomeId)) != null ? _b : 0;
6288
6388
  return bPrice - aPrice;
6289
6389
  });
6290
6390
  };
6291
- var compareVisibleOutcomeRows = (left, right) => {
6391
+ var compareVisibleOutcomeRows = (left, right, priceByOutcomeId) => {
6292
6392
  var _a, _b;
6293
6393
  const leftDate = toDate(resolveOutcomeTitle(left.outcome));
6294
6394
  const rightDate = toDate(resolveOutcomeTitle(right.outcome));
6295
6395
  if (leftDate && rightDate) {
6296
6396
  return leftDate.getTime() - rightDate.getTime();
6297
6397
  }
6298
- const leftProbability = (_a = normalizeProbability(left.outcome.price)) != null ? _a : -1;
6299
- const rightProbability = (_b = normalizeProbability(right.outcome.price)) != null ? _b : -1;
6398
+ const leftProbability = (_a = resolveOutcomeProbability(left.outcome, priceByOutcomeId)) != null ? _a : -1;
6399
+ const rightProbability = (_b = resolveOutcomeProbability(right.outcome, priceByOutcomeId)) != null ? _b : -1;
6300
6400
  return rightProbability - leftProbability;
6301
6401
  };
6302
- var shouldReplaceVisibleOutcome = (current, next) => {
6402
+ var shouldReplaceVisibleOutcome = (current, next, priceByOutcomeId) => {
6303
6403
  var _a, _b;
6304
6404
  const currentVolume = typeof current.market.volume === "number" ? current.market.volume : -1;
6305
6405
  const nextVolume = typeof next.market.volume === "number" ? next.market.volume : -1;
6306
6406
  if (currentVolume !== nextVolume) {
6307
6407
  return nextVolume > currentVolume;
6308
6408
  }
6309
- const currentProbability = (_a = normalizeProbability(current.outcome.price)) != null ? _a : -1;
6310
- const nextProbability = (_b = normalizeProbability(next.outcome.price)) != null ? _b : -1;
6409
+ const currentProbability = (_a = resolveOutcomeProbability(current.outcome, priceByOutcomeId)) != null ? _a : -1;
6410
+ const nextProbability = (_b = resolveOutcomeProbability(next.outcome, priceByOutcomeId)) != null ? _b : -1;
6311
6411
  return nextProbability > currentProbability;
6312
6412
  };
6313
- var resolveVisibleOutcomes = (venueMarkets) => {
6413
+ var resolveVisibleOutcomes = (venueMarkets, priceByOutcomeId) => {
6314
6414
  const visibleOutcomesByLabel = /* @__PURE__ */ new Map();
6315
6415
  venueMarkets.forEach((market) => {
6316
6416
  const title2 = market.question;
6317
- const canonicalOutcome = sortOutcomes(market.venueMarketOutcomes)[0];
6417
+ const canonicalOutcome = sortOutcomesWithPrices(
6418
+ market.venueMarketOutcomes,
6419
+ priceByOutcomeId
6420
+ )[0];
6318
6421
  if (!canonicalOutcome) return;
6319
6422
  const normalizedTitle = title2.trim().toLowerCase();
6320
6423
  const nextVisibleOutcome = {
@@ -6324,11 +6427,11 @@ var resolveVisibleOutcomes = (venueMarkets) => {
6324
6427
  title: title2
6325
6428
  };
6326
6429
  const currentVisibleOutcome = visibleOutcomesByLabel.get(normalizedTitle);
6327
- if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome)) {
6430
+ if (!currentVisibleOutcome || shouldReplaceVisibleOutcome(currentVisibleOutcome, nextVisibleOutcome, priceByOutcomeId)) {
6328
6431
  visibleOutcomesByLabel.set(normalizedTitle, nextVisibleOutcome);
6329
6432
  }
6330
6433
  });
6331
- return [...visibleOutcomesByLabel.values()].sort(compareVisibleOutcomeRows).slice(0, Math.max(1, 2));
6434
+ return [...visibleOutcomesByLabel.values()].sort((left, right) => compareVisibleOutcomeRows(left, right, priceByOutcomeId)).slice(0, Math.max(1, 2));
6332
6435
  };
6333
6436
  var dedupeVenueMarketsById = (venueMarkets) => {
6334
6437
  const seenClusterIds = /* @__PURE__ */ new Set();
@@ -6408,18 +6511,19 @@ var toVenueLogoName = (value) => {
6408
6511
  if (!venueLogoNameSet.has(value)) return null;
6409
6512
  return value;
6410
6513
  };
6411
- var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency) => {
6412
- var _a, _b;
6514
+ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCurrency, options) => {
6515
+ var _a, _b, _c;
6413
6516
  const primaryVenueMarket = selectPrimaryVenueMarket(event.venueMarkets);
6414
6517
  if (!primaryVenueMarket) return null;
6415
6518
  const primaryVenue = toVenueLogoName(primaryVenueMarket.venue);
6416
6519
  if (!primaryVenue) return null;
6417
- const visibleOutcome = resolveVisibleOutcomes(event.venueMarkets)[0];
6520
+ const visibleOutcome = resolveVisibleOutcomes(event.venueMarkets, options == null ? void 0 : options.priceByOutcomeId)[0];
6418
6521
  if (!visibleOutcome) return null;
6419
- const probability = normalizeProbability(visibleOutcome.outcome.price);
6420
- if (probability == null) return null;
6522
+ const probability = normalizeProbability(
6523
+ (_a = options == null ? void 0 : options.priceByOutcomeId) == null ? void 0 : _a.get(visibleOutcome.outcome.id)
6524
+ );
6421
6525
  const resolvedTitle = formatEventTitleWithDateSuffix({
6422
- title: (_a = event == null ? void 0 : event.title) != null ? _a : "",
6526
+ title: (_b = event == null ? void 0 : event.title) != null ? _b : "",
6423
6527
  categories: event.categories,
6424
6528
  structureType: event.structureType,
6425
6529
  gameStartTime: event.gameStartTime,
@@ -6441,13 +6545,14 @@ var mapVenueEventToSearchResult = (event, labels, formatPercent, formatCompactCu
6441
6545
  return {
6442
6546
  id: event.id,
6443
6547
  title: resolvedTitle,
6444
- thumbnailSrc: (_b = resolveTileImage(event, primaryVenueMarket, void 0)) != null ? _b : "",
6548
+ thumbnailSrc: (_c = resolveTileImage(event, primaryVenueMarket, void 0)) != null ? _c : "",
6445
6549
  thumbnailAlt: resolvedTitle,
6446
6550
  venue: primaryVenue,
6447
6551
  visibleVenues,
6448
6552
  marketSummaryLabel,
6449
6553
  volumeLabel,
6450
6554
  valueLabel: formatMarketProbabilityPercent(probability, formatPercent),
6555
+ isValueLoading: probability == null && (options == null ? void 0 : options.isPriceLoading) === true,
6451
6556
  contextLabel: formatSearchContextLabel(visibleOutcome.title)
6452
6557
  };
6453
6558
  };
@@ -6557,7 +6662,16 @@ var SearchResultRow = ({
6557
6662
  children: [
6558
6663
  /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
6559
6664
  /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
6560
- /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
6665
+ item.isValueLoading ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
6666
+ "span",
6667
+ {
6668
+ "aria-hidden": "true",
6669
+ className: cn(
6670
+ "agg-search-result-value-loading",
6671
+ "h-5 w-12 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
6672
+ )
6673
+ }
6674
+ ) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
6561
6675
  "p",
6562
6676
  {
6563
6677
  className: cn(
@@ -6670,6 +6784,24 @@ var Search = ({
6670
6784
  () => filterOpenEvents(searchResults),
6671
6785
  [searchResults]
6672
6786
  );
6787
+ const visibleVenueMarkets = (0, import_react7.useMemo)(
6788
+ () => openEvents.flatMap((event) => {
6789
+ var _a;
6790
+ return (_a = event.venueMarkets) != null ? _a : [];
6791
+ }),
6792
+ [openEvents]
6793
+ );
6794
+ const livePrices = (0, import_hooks27.useLiveOutcomePrices)(visibleVenueMarkets);
6795
+ const midpointResult = (0, import_hooks27.useMidpoints)(visibleVenueMarkets);
6796
+ const searchDisplayPrices = (0, import_react7.useMemo)(() => {
6797
+ if (!midpointResult.bestMidpointsByOutcomeId.size) return livePrices;
6798
+ if (!livePrices.size) return midpointResult.bestMidpointsByOutcomeId;
6799
+ const merged = new Map(midpointResult.bestMidpointsByOutcomeId);
6800
+ for (const [outcomeId, price] of livePrices) {
6801
+ merged.set(outcomeId, price);
6802
+ }
6803
+ return merged;
6804
+ }, [livePrices, midpointResult.bestMidpointsByOutcomeId]);
6673
6805
  const { validatedResults, eventsByResultId } = (0, import_react7.useMemo)(() => {
6674
6806
  const nextEventsByResultId = /* @__PURE__ */ new Map();
6675
6807
  const nextResults = openEvents.map((event) => {
@@ -6677,7 +6809,11 @@ var Search = ({
6677
6809
  event,
6678
6810
  labels,
6679
6811
  formatPercent,
6680
- formatCompactCurrency
6812
+ formatCompactCurrency,
6813
+ {
6814
+ priceByOutcomeId: searchDisplayPrices,
6815
+ isPriceLoading: midpointResult.isLoading
6816
+ }
6681
6817
  );
6682
6818
  if (!item) return null;
6683
6819
  nextEventsByResultId.set(item.id, event);
@@ -6687,7 +6823,14 @@ var Search = ({
6687
6823
  validatedResults: nextResults,
6688
6824
  eventsByResultId: nextEventsByResultId
6689
6825
  };
6690
- }, [formatCompactCurrency, formatPercent, labels, openEvents]);
6826
+ }, [
6827
+ formatCompactCurrency,
6828
+ formatPercent,
6829
+ labels,
6830
+ midpointResult.isLoading,
6831
+ openEvents,
6832
+ searchDisplayPrices
6833
+ ]);
6691
6834
  const hasSearchValue = trimmedValue.length > 0;
6692
6835
  const shouldRenderDropdown = isFocused && shouldSearchValue && !searchConfig.result && !searchConfig.isShowingAllResults;
6693
6836
  const resolvedIsActive = isFocused;
@@ -8771,9 +8914,8 @@ var collectOutcomePrices = (market, outcome, priceByOutcomeId) => {
8771
8914
  const prices = [];
8772
8915
  const seenOutcomeKeys = /* @__PURE__ */ new Set();
8773
8916
  const addPrice = (priceMarket, priceOutcome) => {
8774
- var _a2;
8775
8917
  if (!priceMarket || !priceOutcome) return;
8776
- const resolvedPrice = (_a2 = priceByOutcomeId == null ? void 0 : priceByOutcomeId.get(priceOutcome.id)) != null ? _a2 : priceOutcome.price;
8918
+ const resolvedPrice = priceByOutcomeId === void 0 ? priceOutcome.price : priceByOutcomeId.has(priceOutcome.id) ? priceByOutcomeId.get(priceOutcome.id) : void 0;
8777
8919
  const normalizedPrice = normalizeProbability(resolvedPrice);
8778
8920
  if (normalizedPrice == null) return;
8779
8921
  const key = `${priceMarket.id}:${priceOutcome.id}`;
@@ -8955,6 +9097,24 @@ var buildOutcomeMidpointsByOutcomeId = (midpointRows) => {
8955
9097
  }
8956
9098
  return outcomeMidpointsByOutcomeId;
8957
9099
  };
9100
+ var buildArbReturnByVenueMarketId = (midpointRows) => {
9101
+ const arbReturnByVenueMarketId = /* @__PURE__ */ new Map();
9102
+ const addArbReturn = (value) => {
9103
+ var _a, _b;
9104
+ if (!value || typeof value !== "object") return;
9105
+ const row = value;
9106
+ if (row.venueMarketId && !arbReturnByVenueMarketId.has(row.venueMarketId)) {
9107
+ arbReturnByVenueMarketId.set(row.venueMarketId, (_a = row.arbReturn) != null ? _a : null);
9108
+ }
9109
+ for (const matchedRow of (_b = row.matched) != null ? _b : []) {
9110
+ addArbReturn(matchedRow);
9111
+ }
9112
+ };
9113
+ for (const row of midpointRows) {
9114
+ addArbReturn(row);
9115
+ }
9116
+ return arbReturnByVenueMarketId;
9117
+ };
8958
9118
  var resolveMarketHrefFromEventHref = (eventHref, marketId, outcomeId) => {
8959
9119
  if (!eventHref) return void 0;
8960
9120
  if (typeof window === "undefined") return void 0;
@@ -8971,6 +9131,9 @@ var EventListItemContent = ({
8971
9131
  event,
8972
9132
  classNames,
8973
9133
  arbitrageByOutcomeId,
9134
+ midpointPrices,
9135
+ midpointRows: sharedMidpointRows,
9136
+ midpointsLoading,
8974
9137
  onEventClick,
8975
9138
  onMarketClick,
8976
9139
  getMarketHref,
@@ -9024,6 +9187,8 @@ var EventListItemContent = ({
9024
9187
  if (!isLazyMarketsQueryEnabled || lazyLoadedMarkets.length === 0) return allVenueMarkets;
9025
9188
  return dedupeVenueMarketsById([...allVenueMarkets, ...lazyLoadedMarkets]);
9026
9189
  }, [allVenueMarkets, isLazyMarketsQueryEnabled, lazyLoadedMarkets]);
9190
+ const hasExpandedMarkets = isLazyMarketsQueryEnabled && lazyLoadedMarkets.length > 0;
9191
+ const shouldUseSharedMidpoints = !hasExpandedMarkets && (midpointPrices !== void 0 || sharedMidpointRows !== void 0 || midpointsLoading !== void 0);
9027
9192
  const midpointVenueMarketIds = (0, import_react14.useMemo)(() => {
9028
9193
  var _a2;
9029
9194
  const ids = [];
@@ -9035,19 +9200,21 @@ var EventListItemContent = ({
9035
9200
  }
9036
9201
  return [...new Set(ids)];
9037
9202
  }, [resolvedOutcomeMarkets]);
9038
- const { midpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
9039
- venueMarketIds: midpointVenueMarketIds,
9040
- enabled: midpointVenueMarketIds.length > 0
9203
+ const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
9204
+ venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
9205
+ enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
9041
9206
  });
9042
- const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks35.useMidpoints)(resolvedOutcomeMarkets);
9043
- const isAwaitingMidpoints = isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
9207
+ const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks35.useMidpoints)(shouldUseSharedMidpoints ? [] : resolvedOutcomeMarkets);
9208
+ const resolvedMidpointRows = shouldUseSharedMidpoints ? sharedMidpointRows != null ? sharedMidpointRows : [] : fetchedMidpointRows;
9209
+ const resolvedDisplayMidpointsByOutcomeId = shouldUseSharedMidpoints ? midpointPrices != null ? midpointPrices : /* @__PURE__ */ new Map() : displayMidpointsByOutcomeId;
9210
+ const isAwaitingMidpoints = midpointsLoading != null ? midpointsLoading : isOutcomeMidpointsLoading || midpointVenueMarketIds.length > 0 && isVenueMarketMidpointsLoading;
9044
9211
  const displayPriceByOutcomeId = (0, import_react14.useMemo)(() => {
9045
- const priceByOutcomeId = new Map(displayMidpointsByOutcomeId);
9046
- for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(midpointRows)) {
9212
+ const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
9213
+ for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(resolvedMidpointRows)) {
9047
9214
  priceByOutcomeId.set(outcomeId, price);
9048
9215
  }
9049
9216
  return priceByOutcomeId;
9050
- }, [displayMidpointsByOutcomeId, midpointRows]);
9217
+ }, [resolvedDisplayMidpointsByOutcomeId, resolvedMidpointRows]);
9051
9218
  const comparison = (0, import_react14.useMemo)(() => {
9052
9219
  return normalizeEventListItemV2Comparison({
9053
9220
  venueMarkets: resolvedOutcomeMarkets,
@@ -9058,6 +9225,9 @@ var EventListItemContent = ({
9058
9225
  const gapsByVenueMarketId = (0, import_react14.useMemo)(() => {
9059
9226
  return computePriceGapsFromComparisonRows(comparison.rows);
9060
9227
  }, [comparison.rows]);
9228
+ const arbReturnByVenueMarketId = (0, import_react14.useMemo)(() => {
9229
+ return buildArbReturnByVenueMarketId(resolvedMidpointRows);
9230
+ }, [resolvedMidpointRows]);
9061
9231
  const shouldRenderLoadingOutcomeRow = shouldEnableLazyMarketLoading && (!isLazyMarketsQueryEnabled || isLoadingLazyMarkets || isFetchingNextLazyMarketsPage || hasNextLazyMarketsPage);
9062
9232
  const resolvedVolume = (_a = resolveDisplayVolume(event.volume, allVenueMarkets)) != null ? _a : 0;
9063
9233
  const volumeLabel = `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}`;
@@ -9189,10 +9359,10 @@ var EventListItemContent = ({
9189
9359
  )
9190
9360
  ] });
9191
9361
  };
9192
- const renderPriceGapPill = (value) => {
9362
+ const renderPriceGapPill = (value, source = "percent") => {
9193
9363
  if (!config.features.enablePriceGap) return null;
9194
9364
  if (isAwaitingMidpoints) return null;
9195
- const formattedPriceGap = formatPriceGapPercent(value);
9365
+ const formattedPriceGap = formatPriceGapPercent(value, source);
9196
9366
  if (!formattedPriceGap) return null;
9197
9367
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
9198
9368
  "span",
@@ -9328,7 +9498,9 @@ var EventListItemContent = ({
9328
9498
  comparison.rows.map((row) => {
9329
9499
  var _a2;
9330
9500
  const arbitragePercent = (_a2 = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.outcome.id]) != null ? _a2 : arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.market.id];
9331
- const priceGapPercent = gapsByVenueMarketId.get(row.market.id);
9501
+ const arbReturn = arbReturnByVenueMarketId.get(row.market.id);
9502
+ const priceGapPercent = arbReturn == null ? gapsByVenueMarketId.get(row.market.id) : arbReturn;
9503
+ const priceGapSource = arbReturn == null ? "percent" : "fraction";
9332
9504
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
9333
9505
  "div",
9334
9506
  {
@@ -9348,7 +9520,7 @@ var EventListItemContent = ({
9348
9520
  ) }),
9349
9521
  /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
9350
9522
  renderArbitrage(arbitragePercent),
9351
- renderPriceGapPill(priceGapPercent),
9523
+ renderPriceGapPill(priceGapPercent, priceGapSource),
9352
9524
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { className: "agg-outcome-price-strip relative flex shrink-0 items-center justify-end", children: isAwaitingMidpoints ? renderPriceStripSkeleton(row.prices.length) : row.prices.map(
9353
9525
  (price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
9354
9526
  ) })
@@ -9855,6 +10027,23 @@ var resolveSortQueryParams = (value) => {
9855
10027
  }
9856
10028
  return { sortBy: "volume24hr", sortDir: "desc" };
9857
10029
  };
10030
+ var collectEventListVenueMarkets = (events) => {
10031
+ return events.flatMap((event) => {
10032
+ var _a;
10033
+ return (_a = event.venueMarkets) != null ? _a : [];
10034
+ });
10035
+ };
10036
+ var collectMidpointVenueMarketIds = (venueMarkets) => {
10037
+ var _a;
10038
+ const ids = [];
10039
+ for (const market of venueMarkets) {
10040
+ ids.push(market.id);
10041
+ for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
10042
+ ids.push(sibling.id);
10043
+ }
10044
+ }
10045
+ return [...new Set(ids)];
10046
+ };
9858
10047
  var EventList = ({
9859
10048
  title: title2,
9860
10049
  limit = DEFAULT_EVENTS_LIMIT,
@@ -10069,6 +10258,16 @@ var EventList = ({
10069
10258
  if (resolvedMaxVisibleItems == null) return normalizedEvents;
10070
10259
  return normalizedEvents.slice(0, resolvedMaxVisibleItems);
10071
10260
  }, [orderedEvents, resolvedMaxVisibleItems]);
10261
+ const visibleVenueMarkets = (0, import_react17.useMemo)(() => {
10262
+ return collectEventListVenueMarkets(tileEvents);
10263
+ }, [tileEvents]);
10264
+ const visibleMidpointVenueMarketIds = (0, import_react17.useMemo)(() => {
10265
+ return collectMidpointVenueMarketIds(visibleVenueMarkets);
10266
+ }, [visibleVenueMarkets]);
10267
+ const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks37.useVenueMarketMidpoints)({
10268
+ venueMarketIds: visibleMidpointVenueMarketIds,
10269
+ enabled: visibleMidpointVenueMarketIds.length > 0
10270
+ });
10072
10271
  const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
10073
10272
  const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
10074
10273
  const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage;
@@ -10237,6 +10436,8 @@ var EventList = ({
10237
10436
  EventListItem,
10238
10437
  {
10239
10438
  event,
10439
+ midpointRows: sharedMidpointRows,
10440
+ midpointsLoading: isSharedMidpointsLoading,
10240
10441
  classNames: {
10241
10442
  root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
10242
10443
  },
@@ -10504,6 +10705,79 @@ var isDateLikeLabel = (value) => {
10504
10705
  if (!value.trim()) return false;
10505
10706
  return (0, import_dayjs4.default)(value).isValid();
10506
10707
  };
10708
+ var CHART_RANGE_PRIORITY = ["1H", "6H", "1D", "1W", "1M", "ALL"];
10709
+ var RANGE_SECONDS_BY_TIME_RANGE = {
10710
+ "1H": 60 * 60,
10711
+ "6H": 6 * 60 * 60,
10712
+ "1D": 24 * 60 * 60,
10713
+ "1W": 7 * 24 * 60 * 60,
10714
+ "1M": 30 * 24 * 60 * 60,
10715
+ ALL: 6 * 30 * 24 * 60 * 60
10716
+ };
10717
+ var toUnixTimestamp = (value) => {
10718
+ if (!value) return null;
10719
+ const parsedValue = (0, import_dayjs4.default)(value);
10720
+ if (!parsedValue.isValid()) return null;
10721
+ return parsedValue.unix();
10722
+ };
10723
+ var isResolvedMarketStatus = (status) => {
10724
+ if (!status) return false;
10725
+ const normalizedStatus = status.trim().toLowerCase();
10726
+ return normalizedStatus.includes("resolved") || normalizedStatus.includes("closed") || normalizedStatus.includes("settled") || normalizedStatus.includes("final");
10727
+ };
10728
+ var resolveInitialEventDetailsChartRange = ({
10729
+ chartData,
10730
+ event,
10731
+ fallbackRange,
10732
+ nowSec = (0, import_dayjs4.default)().unix(),
10733
+ selectedMarket
10734
+ }) => {
10735
+ var _a, _b;
10736
+ const scopedMarkets = selectedMarket ? [selectedMarket] : event.venueMarkets;
10737
+ const preferredEventStart = (_a = toUnixTimestamp(event.startDate)) != null ? _a : toUnixTimestamp(event.creationDate);
10738
+ const marketStartCandidates = scopedMarkets.map((market) => {
10739
+ var _a2;
10740
+ return (_a2 = toUnixTimestamp(market.startDate)) != null ? _a2 : toUnixTimestamp(market.creationDate);
10741
+ }).filter((value) => value != null);
10742
+ const metadataStarts = [preferredEventStart, ...marketStartCandidates].filter(
10743
+ (value) => value != null
10744
+ );
10745
+ const metadataEnds = [
10746
+ toUnixTimestamp(event.endDate),
10747
+ ...scopedMarkets.flatMap((market) => [
10748
+ toUnixTimestamp(market.endDate),
10749
+ toUnixTimestamp(market.resolutionDate)
10750
+ ])
10751
+ ].filter((value) => value != null);
10752
+ const historyTimestamps = chartData == null ? [] : Object.values(chartData.venues).flatMap((venueData) => [
10753
+ ...venueData.candles.map((candle) => candle.time),
10754
+ ...venueData.liveCandle ? [venueData.liveCandle.time] : []
10755
+ ]);
10756
+ const startCandidates = [...metadataStarts, ...historyTimestamps];
10757
+ if (startCandidates.length === 0) {
10758
+ return fallbackRange != null ? fallbackRange : null;
10759
+ }
10760
+ const marketResolved = [event.status, ...scopedMarkets.map((market) => market.status)].some(
10761
+ isResolvedMarketStatus
10762
+ );
10763
+ const isUsingSharedOverlapStart = scopedMarkets.length > 1 && marketStartCandidates.length === scopedMarkets.length;
10764
+ const startTs = isUsingSharedOverlapStart ? Math.max(...marketStartCandidates) : Math.min(...startCandidates);
10765
+ const endTs = Math.max(
10766
+ ...marketResolved && metadataEnds.length > 0 ? [nowSec, ...metadataEnds, ...historyTimestamps] : [nowSec, ...historyTimestamps]
10767
+ );
10768
+ const spanSeconds = Math.max(0, endTs - startTs);
10769
+ if (spanSeconds <= 0) {
10770
+ return fallbackRange != null ? fallbackRange : null;
10771
+ }
10772
+ if (!marketResolved && spanSeconds > RANGE_SECONDS_BY_TIME_RANGE["1M"]) {
10773
+ return "1M";
10774
+ }
10775
+ const requiredSeconds = spanSeconds * (isUsingSharedOverlapStart ? 1 : marketResolved ? 1.05 : 1.2);
10776
+ const matchingRange = CHART_RANGE_PRIORITY.find((range) => {
10777
+ return RANGE_SECONDS_BY_TIME_RANGE[range] >= requiredSeconds;
10778
+ });
10779
+ return (_b = matchingRange != null ? matchingRange : fallbackRange) != null ? _b : "ALL";
10780
+ };
10507
10781
  var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
10508
10782
  const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
10509
10783
  const semanticSelectedLabel = toSemanticLabel(selectedOutcomeLabel);
@@ -11457,13 +11731,8 @@ var resolveChartVenueOutcomes = ({
11457
11731
  }) => {
11458
11732
  if (eligibleVenueOutcomes.length <= 1) return eligibleVenueOutcomes;
11459
11733
  const sortedEligibleVenueOutcomes = [...eligibleVenueOutcomes].sort((left, right) => {
11460
- var _a, _b;
11461
- const leftProbability = normalizeProbability(
11462
- (_a = livePrices.get(left.outcome.id)) != null ? _a : left.outcome.price
11463
- );
11464
- const rightProbability = normalizeProbability(
11465
- (_b = livePrices.get(right.outcome.id)) != null ? _b : right.outcome.price
11466
- );
11734
+ const leftProbability = normalizeProbability(livePrices.get(left.outcome.id));
11735
+ const rightProbability = normalizeProbability(livePrices.get(right.outcome.id));
11467
11736
  const probabilityDifference = (leftProbability != null ? leftProbability : 2) - (rightProbability != null ? rightProbability : 2);
11468
11737
  if (probabilityDifference !== 0) return probabilityDifference;
11469
11738
  if (left.venue === right.venue) return 0;
@@ -12556,13 +12825,18 @@ var EventListItemDetailsNotFoundState = ({
12556
12825
  }
12557
12826
  );
12558
12827
  };
12828
+ var resolveResolvedOutcomePriceMap = (outcomes) => {
12829
+ if (!(outcomes == null ? void 0 : outcomes.length)) return null;
12830
+ if (!outcomes.some((outcome) => outcome.winner === true)) return null;
12831
+ if (outcomes.some((outcome) => outcome.winner == null)) return null;
12832
+ return new Map(outcomes.map((outcome) => [outcome.id, outcome.winner === true ? 1 : 0]));
12833
+ };
12559
12834
  var EventListItemDetailsGraphSection = ({
12560
12835
  classNames,
12561
12836
  selectedChartType,
12562
12837
  venueMarkets,
12563
12838
  selectedMarketId,
12564
12839
  livePrices,
12565
- wsLivePrices,
12566
12840
  restMidpoints,
12567
12841
  bestMidpoint,
12568
12842
  bestPrices,
@@ -12677,6 +12951,18 @@ var EventListItemDetailsGraphSection = ({
12677
12951
  });
12678
12952
  });
12679
12953
  }, [availableMarkets, tradingContext == null ? void 0 : tradingContext.selectedMarket]);
12954
+ const resolvedOutcomePriceByMarketId = (0, import_react23.useMemo)(() => {
12955
+ const map = /* @__PURE__ */ new Map();
12956
+ for (const market of availableMarkets) {
12957
+ const marketTradingState = (0, import_hooks46.resolveMarketTradingState)(market);
12958
+ if (marketTradingState.kind !== "resolved") continue;
12959
+ const outcomePriceMap = resolveResolvedOutcomePriceMap(market.venueMarketOutcomes);
12960
+ if (outcomePriceMap) {
12961
+ map.set(market.id, outcomePriceMap);
12962
+ }
12963
+ }
12964
+ return map;
12965
+ }, [availableMarkets]);
12680
12966
  const resolvedVenueChartSeries = (0, import_react23.useMemo)(() => {
12681
12967
  return resolveMarketChartVenueSeries({
12682
12968
  chartData: scopedMarketChartData,
@@ -12744,7 +13030,7 @@ var EventListItemDetailsGraphSection = ({
12744
13030
  {
12745
13031
  classNames: { root: cn("agg-chart-region", classNames == null ? void 0 : classNames.chart) },
12746
13032
  series: visibleChartSeries,
12747
- height: 300,
13033
+ height: 200,
12748
13034
  isLoading: isScopedMarketChartLoading,
12749
13035
  chartType: selectedChartType,
12750
13036
  liveCandle: selectedChartType === "candlestick" ? (_m = chartLiveState.liveCandle) != null ? _m : void 0 : void 0,
@@ -12772,8 +13058,8 @@ var EventListItemDetailsGraphSection = ({
12772
13058
  classNames == null ? void 0 : classNames.outcomeBadges
12773
13059
  ),
12774
13060
  children: chartAvailableVenueOutcomes.map((item) => {
12775
- var _a3;
12776
- const percentage = (_a3 = wsLivePrices.get(item.outcome.id)) != null ? _a3 : item.outcome.price;
13061
+ var _a3, _b3;
13062
+ const percentage = (_b3 = (_a3 = resolvedOutcomePriceByMarketId.get(item.market.id)) == null ? void 0 : _a3.get(item.outcome.id)) != null ? _b3 : livePrices.get(item.outcome.id);
12777
13063
  const text = formatMarketProbabilityPercent(percentage, formatPercent);
12778
13064
  const seriesId = `${item.venue}-chart`;
12779
13065
  const isActiveVenue = activeGraphVenue === item.venue;
@@ -12781,6 +13067,7 @@ var EventListItemDetailsGraphSection = ({
12781
13067
  "button",
12782
13068
  {
12783
13069
  type: "button",
13070
+ "data-id": item.outcome.id,
12784
13071
  "aria-label": `${item.venue} ${text}`,
12785
13072
  "aria-pressed": isActiveVenue,
12786
13073
  className: cn(
@@ -12836,21 +13123,21 @@ var EventListItemDetailsGraphSection = ({
12836
13123
  tradingContext == null ? void 0 : tradingContext.selectOutcome(outcomeId);
12837
13124
  },
12838
13125
  options: selectedMarketOutcomes.map((outcome) => {
12839
- var _a3, _b3, _c3;
12840
- const price = getDisplayOutcomePrice({
13126
+ var _a3, _b3, _c3, _d3, _e2;
13127
+ const resolvedPrice = availableMarkets[0] == null ? void 0 : (_b3 = resolvedOutcomePriceByMarketId.get(((_a3 = tradingContext == null ? void 0 : tradingContext.selectedMarket) != null ? _a3 : availableMarkets[0]).id)) == null ? void 0 : _b3.get(outcome.id);
13128
+ const price = resolvedPrice != null ? resolvedPrice : getDisplayOutcomePrice({
12841
13129
  outcomeId: outcome.id,
12842
13130
  outcomeLabel: outcome.label,
12843
- selection: (_a3 = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _a3 : "buy",
13131
+ selection: (_c3 = tradingContext == null ? void 0 : tradingContext.tradeSide) != null ? _c3 : "buy",
12844
13132
  bestPrices,
12845
13133
  bestMidpoint,
12846
13134
  bestMidpointsByOutcomeId: restMidpoints,
12847
- livePrices,
12848
- fallbackPrice: outcome.price
13135
+ livePrices
12849
13136
  });
12850
13137
  return {
12851
13138
  value: outcome.id,
12852
- label: `${(_b3 = outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`,
12853
- ariaLabel: `${(_c3 = outcome.title) != null ? _c3 : outcome.label} ${formatProbabilityCents(price)}`
13139
+ label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price)}`,
13140
+ ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price)}`
12854
13141
  };
12855
13142
  })
12856
13143
  }
@@ -12871,6 +13158,7 @@ var EventListItemDetailsContent = ({
12871
13158
  detailsStats,
12872
13159
  eventTradingState,
12873
13160
  ariaLabel,
13161
+ defaultTimeRange,
12874
13162
  onClick,
12875
13163
  midpointsResult
12876
13164
  }) => {
@@ -12879,9 +13167,6 @@ var EventListItemDetailsContent = ({
12879
13167
  const lastAppliedEventSyncKeyRef = (0, import_react23.useRef)(null);
12880
13168
  const lastAppliedDefaultRef = (0, import_react23.useRef)(null);
12881
13169
  const [chartRangeOverride, setChartRangeOverride] = (0, import_react23.useState)(null);
12882
- (0, import_react23.useEffect)(() => {
12883
- setChartRangeOverride(null);
12884
- }, [event.id]);
12885
13170
  const config = (0, import_hooks46.useSdkUiConfig)();
12886
13171
  const labels = (0, import_hooks46.useLabels)();
12887
13172
  const tradingContext = (0, import_hooks39.useEventTradingContext)();
@@ -12890,13 +13175,20 @@ var EventListItemDetailsContent = ({
12890
13175
  return eventTradingState != null ? eventTradingState : (0, import_hooks46.resolveEventTradingState)(event);
12891
13176
  }, [event, eventTradingState]);
12892
13177
  const scopedSelectedMarket = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? (_a = tradingContext.selectedMarket) != null ? _a : resolvedEventTradingState.primaryMarket : resolvedEventTradingState.primaryMarket;
13178
+ const venueMarkets = (0, import_react23.useMemo)(
13179
+ () => resolvedEventTradingState.displayMarkets,
13180
+ [resolvedEventTradingState.displayMarkets]
13181
+ );
13182
+ const eventDetailVenueMarkets = (0, import_react23.useMemo)(() => {
13183
+ return normalizeVenueMarketCluster(venueMarkets);
13184
+ }, [venueMarkets]);
12893
13185
  const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
12894
13186
  (0, import_hooks46.useEventOrderbookData)(
12895
13187
  resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
12896
13188
  scopedSelectedMarketId
12897
13189
  );
12898
- const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(resolvedEventTradingState.displayMarkets);
12899
- const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(resolvedEventTradingState.displayMarkets);
13190
+ const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(eventDetailVenueMarkets);
13191
+ const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(eventDetailVenueMarkets);
12900
13192
  const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
12901
13193
  prices: /* @__PURE__ */ new Map(),
12902
13194
  bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
@@ -12921,6 +13213,16 @@ var EventListItemDetailsContent = ({
12921
13213
  for (const [k, v] of wsLivePrices) merged.set(k, v);
12922
13214
  return merged;
12923
13215
  }, [restMidpoints, wsLivePrices]);
13216
+ const initialChartTimeRange = (0, import_react23.useMemo)(() => {
13217
+ return resolveInitialEventDetailsChartRange({
13218
+ event,
13219
+ selectedMarket: scopedSelectedMarket,
13220
+ fallbackRange: defaultTimeRange != null ? defaultTimeRange : config.chart.selectedChartTimeRange
13221
+ });
13222
+ }, [config.chart.selectedChartTimeRange, defaultTimeRange, event, scopedSelectedMarket]);
13223
+ (0, import_react23.useEffect)(() => {
13224
+ setChartRangeOverride(initialChartTimeRange);
13225
+ }, [event.id, initialChartTimeRange, scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id]);
12924
13226
  (0, import_react23.useEffect)(() => {
12925
13227
  if (!tradingContext) return;
12926
13228
  if (lastAppliedEventSyncKeyRef.current === eventSyncKey) return;
@@ -12958,10 +13260,6 @@ var EventListItemDetailsContent = ({
12958
13260
  tradingContext,
12959
13261
  tradingContext == null ? void 0 : tradingContext.selectedEventId
12960
13262
  ]);
12961
- const venueMarkets = (0, import_react23.useMemo)(
12962
- () => resolvedEventTradingState.displayMarkets,
12963
- [resolvedEventTradingState.displayMarkets]
12964
- );
12965
13263
  const marketOptions = (0, import_react23.useMemo)(
12966
13264
  () => venueMarkets.map((vm) => ({
12967
13265
  value: vm.id,
@@ -13083,7 +13381,6 @@ var EventListItemDetailsContent = ({
13083
13381
  venueMarkets,
13084
13382
  selectedMarketId: (_d = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _d : null,
13085
13383
  livePrices,
13086
- wsLivePrices,
13087
13384
  restMidpoints,
13088
13385
  bestMidpoint,
13089
13386
  bestPrices,
@@ -13799,8 +14096,13 @@ var resolveTradingStateTimestampLabel = (labels, state) => {
13799
14096
  return null;
13800
14097
  };
13801
14098
  var resolveTradingStatePresentation = (labels, state) => {
14099
+ var _a;
13802
14100
  const timestampLabel = resolveTradingStateTimestampLabel(labels, state);
13803
- const winningOutcomeLabel = state.winningOutcome ? labels.eventMarketPage.winningOutcome(state.winningOutcome.label) : null;
14101
+ const resolvedOutcomeLabel = resolveResolvedOutcomeLabel({
14102
+ market: (_a = state.market) != null ? _a : null,
14103
+ outcome: state.winningOutcome
14104
+ });
14105
+ const winningOutcomeLabel = resolvedOutcomeLabel ? labels.eventMarketPage.winningOutcome(resolvedOutcomeLabel) : null;
13804
14106
  if (state.kind === "resolved") {
13805
14107
  return {
13806
14108
  badgeLabel: labels.eventMarketPage.tradingResolvedBadge,
@@ -13930,6 +14232,34 @@ var getMarketDetailsOutcomeButtonClassNames = ({
13930
14232
  text: cn(isSelected ? toneClasses.text : "text-agg-foreground")
13931
14233
  };
13932
14234
  };
14235
+ var OutcomePriceContent = ({
14236
+ isLoading,
14237
+ isSelected,
14238
+ value,
14239
+ textClassName
14240
+ }) => {
14241
+ if (isLoading) {
14242
+ return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
14243
+ "span",
14244
+ {
14245
+ "aria-hidden": "true",
14246
+ className: cn(
14247
+ "agg-market-details-outcome-price-loading",
14248
+ "h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
14249
+ )
14250
+ }
14251
+ );
14252
+ }
14253
+ return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
14254
+ Typography,
14255
+ {
14256
+ as: "span",
14257
+ variant: isSelected ? "body-strong" : "body",
14258
+ className: cn("shrink-0 whitespace-nowrap", textClassName),
14259
+ children: formatProbabilityCents(value)
14260
+ }
14261
+ );
14262
+ };
13933
14263
  var MarketDetailsOutcomeButton = ({
13934
14264
  ariaControls,
13935
14265
  enableAnimations,
@@ -13985,12 +14315,12 @@ var MarketDetailsOutcomeButton = ({
13985
14315
  }
13986
14316
  ) : null,
13987
14317
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
13988
- Typography,
14318
+ OutcomePriceContent,
13989
14319
  {
13990
- as: "span",
13991
- variant: isSelected ? "body-strong" : "body",
13992
- className: cn("shrink-0 whitespace-nowrap", classNames.text),
13993
- children: formatProbabilityCents(item.probability)
14320
+ isLoading: item.isPriceLoading,
14321
+ isSelected,
14322
+ value: item.probability,
14323
+ textClassName: classNames.text
13994
14324
  }
13995
14325
  )
13996
14326
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "inline-flex max-w-full items-center justify-center gap-1.5", children: [
@@ -14005,12 +14335,12 @@ var MarketDetailsOutcomeButton = ({
14005
14335
  }
14006
14336
  ),
14007
14337
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
14008
- Typography,
14338
+ OutcomePriceContent,
14009
14339
  {
14010
- as: "span",
14011
- variant: isSelected ? "body-strong" : "body",
14012
- className: cn("shrink-0 whitespace-nowrap", classNames.text),
14013
- children: formatProbabilityCents(item.probability)
14340
+ isLoading: item.isPriceLoading,
14341
+ isSelected,
14342
+ value: item.probability,
14343
+ textClassName: classNames.text
14014
14344
  }
14015
14345
  )
14016
14346
  ] })
@@ -14202,9 +14532,8 @@ var MarketDetailsGraphPanel = ({
14202
14532
  var _a2, _b2, _c2, _d;
14203
14533
  return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)("div", { className: "agg-chart-toolbar w-full flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
14204
14534
  /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("div", { className: "agg-market-venues flex flex-wrap gap-2", children: chartAvailableOutcomesByVenue.map((item) => {
14205
- var _a3;
14206
14535
  const probability = formatProbabilityPercent(
14207
- (_a3 = wsLivePrices.get(item.outcome.id)) != null ? _a3 : item.outcome.price,
14536
+ wsLivePrices.get(item.outcome.id),
14208
14537
  formatPercent
14209
14538
  );
14210
14539
  const isActiveVenue = selectedGraphVenue === item.venue;
@@ -14415,16 +14744,8 @@ var MarketDetailsContent = ({
14415
14744
  isResolvedMarket ? [] : resolvedMarket == null ? void 0 : resolvedMarket.venueMarkets,
14416
14745
  (_b = scopedResolvedMarket == null ? void 0 : scopedResolvedMarket.id) != null ? _b : null
14417
14746
  );
14418
- const clusterMidpointResult = midpointsResult != null ? midpointsResult : {
14419
- prices: /* @__PURE__ */ new Map(),
14420
- bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
14421
- venueByOutcomeId: /* @__PURE__ */ new Map(),
14422
- bestPrices: /* @__PURE__ */ new Map(),
14423
- bestPriceVenuesByOutcomeId: /* @__PURE__ */ new Map(),
14424
- isLoading: false,
14425
- bestMidpoint: void 0,
14426
- bestMidpointVenue: void 0
14427
- };
14747
+ const fetchedClusterMidpointResult = (0, import_hooks49.useMidpoints)(midpointsResult ? [] : clusterVenueMarkets);
14748
+ const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
14428
14749
  const clusterMidpoints = (_c = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _c : clusterMidpointResult.prices;
14429
14750
  const clusterBestMidpointsByOutcomeId = clusterMidpoints;
14430
14751
  const clusterVenueByOutcomeId = clusterMidpointResult.venueByOutcomeId;
@@ -14492,6 +14813,10 @@ var MarketDetailsContent = ({
14492
14813
  const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
14493
14814
  const isUpcomingMarket = marketTradingState.kind === "unopened";
14494
14815
  const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
14816
+ const resolvedWinningOutcomeLabel = resolveResolvedOutcomeLabel({
14817
+ market: scopedMarketForCard,
14818
+ outcome: marketTradingState.winningOutcome
14819
+ });
14495
14820
  const marketDetailsTabs = (0, import_react27.useMemo)(() => {
14496
14821
  return getMarketDetailsTabs(labels);
14497
14822
  }, [labels]);
@@ -14584,18 +14909,24 @@ var MarketDetailsContent = ({
14584
14909
  });
14585
14910
  const bestVenue = candidate == null ? void 0 : candidate.venue;
14586
14911
  const outcomeBestPrice = candidate == null ? void 0 : candidate.price;
14912
+ const isPriceLoading = !isResolvedMarket && outcomeBestPrice == null && clusterMidpointResult.isLoading;
14587
14913
  if (isResolvedMarket) {
14588
14914
  const isWinningOutcome = item.id === ((_a2 = marketTradingState.winningOutcome) == null ? void 0 : _a2.id);
14589
14915
  return __spreadValues(__spreadProps(__spreadValues({}, item), {
14590
- probability: isWinningOutcome ? 1 : 0
14916
+ probability: isWinningOutcome ? 1 : 0,
14917
+ isPriceLoading: false
14591
14918
  }), bestVenue ? { venue: bestVenue } : {});
14592
14919
  }
14593
14920
  if (outcomeBestPrice != null) {
14594
14921
  return __spreadValues(__spreadProps(__spreadValues({}, item), {
14595
- probability: outcomeBestPrice
14922
+ probability: outcomeBestPrice,
14923
+ isPriceLoading: false
14596
14924
  }), bestVenue ? { venue: bestVenue } : {});
14597
14925
  }
14598
- return item;
14926
+ return __spreadProps(__spreadValues({}, item), {
14927
+ probability: void 0,
14928
+ isPriceLoading
14929
+ });
14599
14930
  });
14600
14931
  }, [
14601
14932
  clusterBestMidpoint,
@@ -14617,7 +14948,7 @@ var MarketDetailsContent = ({
14617
14948
  wsBestCandidates
14618
14949
  ]);
14619
14950
  const headlineProbability = (0, import_react27.useMemo)(() => {
14620
- var _a2, _b2, _c2, _d2;
14951
+ var _a2;
14621
14952
  if (!model || !scopedMarketForCard) return void 0;
14622
14953
  if (isResolvedMarket) {
14623
14954
  const yesOutcome2 = resolveYesOutcome(scopedMarketForCard);
@@ -14625,10 +14956,7 @@ var MarketDetailsContent = ({
14625
14956
  return yesOutcome2.winner === true ? 1 : 0;
14626
14957
  }
14627
14958
  const yesOutcome = resolveYesOutcome(scopedMarketForCard);
14628
- const displayOutcome = yesOutcome != null ? yesOutcome : (_b2 = scopedMarketForCard.venueMarketOutcomes) == null ? void 0 : _b2.reduce(
14629
- (acc, outcome) => outcome.price > acc.price ? outcome : acc,
14630
- (_a2 = scopedMarketForCard.venueMarketOutcomes) == null ? void 0 : _a2[0]
14631
- );
14959
+ const displayOutcome = yesOutcome != null ? yesOutcome : (_a2 = scopedMarketForCard.venueMarketOutcomes) == null ? void 0 : _a2[0];
14632
14960
  if (displayOutcome == null) return void 0;
14633
14961
  const referencePrice = getDisplayOutcomePrice({
14634
14962
  outcomeId: displayOutcome.id,
@@ -14638,10 +14966,10 @@ var MarketDetailsContent = ({
14638
14966
  bestMidpoint: clusterBestMidpoint,
14639
14967
  bestMidpointsByOutcomeId: clusterBestMidpointsByOutcomeId,
14640
14968
  livePrices: wsLivePrices,
14641
- fallbackPrice: (_c2 = midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)) != null ? _c2 : displayOutcome.price
14969
+ fallbackPrice: midpointsFallback == null ? void 0 : midpointsFallback.get(displayOutcome.id)
14642
14970
  });
14643
14971
  if (referencePrice != null) return referencePrice;
14644
- return (_d2 = (0, import_hooks49.findLivePriceById)(wsLivePrices, displayOutcome.id)) != null ? _d2 : displayOutcome.price;
14972
+ return (0, import_hooks49.findLivePriceById)(wsLivePrices, displayOutcome.id);
14645
14973
  }, [
14646
14974
  clusterBestMidpoint,
14647
14975
  clusterBestMidpointsByOutcomeId,
@@ -14925,7 +15253,9 @@ var MarketDetailsContent = ({
14925
15253
  )
14926
15254
  }
14927
15255
  ),
14928
- /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(marketTradingState.winningOutcome.label) })
15256
+ /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(Typography, { variant: "body", children: labels.eventMarketPage.resolvedOutcome(
15257
+ resolvedWinningOutcomeLabel != null ? resolvedWinningOutcomeLabel : marketTradingState.winningOutcome.label
15258
+ ) })
14929
15259
  ]
14930
15260
  }
14931
15261
  ) }) : isUpcomingMarket ? /* @__PURE__ */ (0, import_jsx_runtime141.jsx)("div", { className: "agg-outcomes flex w-full items-center justify-end md:w-auto md:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsxs)(
@@ -16206,7 +16536,7 @@ var mapVenueMarketOutcomesToPlaceOrderOutcomes = (venueMarketOutcomes) => {
16206
16536
  label: outcome.label,
16207
16537
  title: (_a = outcome.title) != null ? _a : null,
16208
16538
  price: outcome.price,
16209
- priceLabel: getTradingPriceLabel(outcome.price)
16539
+ priceLabel: outcome.price != null ? getTradingPriceLabel(outcome.price) : ""
16210
16540
  };
16211
16541
  });
16212
16542
  };
@@ -17871,7 +18201,7 @@ var PlaceOrderResolvedView = ({
17871
18201
  className,
17872
18202
  isSportsEvent = false
17873
18203
  }) => {
17874
- var _a;
18204
+ var _a, _b;
17875
18205
  const labels = (0, import_hooks54.useLabels)();
17876
18206
  const tradingLabels = labels.trading;
17877
18207
  const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
@@ -17949,7 +18279,16 @@ var PlaceOrderResolvedView = ({
17949
18279
  ),
17950
18280
  children: [
17951
18281
  tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
17952
- tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(tradingState.winningOutcome.label) }) : null
18282
+ tradingState.winningOutcome ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body-large-strong", children: tradingLabels.outcome(
18283
+ shouldUseRawResolvedPlaceOrderOutcomeLabel(
18284
+ tradingState.market,
18285
+ tradingState.winningOutcome
18286
+ ) ? tradingState.winningOutcome.label : (_b = resolveResolvedOutcomeLabel({
18287
+ market: tradingState.market,
18288
+ outcome: tradingState.winningOutcome,
18289
+ allowSportsMoneylineMarketFallback: false
18290
+ })) != null ? _b : tradingState.winningOutcome.label
18291
+ ) }) : null
17953
18292
  ]
17954
18293
  }
17955
18294
  )
@@ -18011,6 +18350,16 @@ var renderRouteBreakdownRow = (row) => {
18011
18350
  rowKey
18012
18351
  );
18013
18352
  };
18353
+ var SIDE_NAMED_MONEYLINE_QUESTION_RE = /\s(?:vs\.?|@|at)\s/i;
18354
+ var shouldUseRawResolvedPlaceOrderOutcomeLabel = (market, outcome) => {
18355
+ var _a, _b;
18356
+ if (!market || !outcome) return false;
18357
+ const isSportsMoneylineMarket = (market.sportsMarketType === "moneyline" || market.marketGroup === "game_lines") && (outcome.label.trim().toLowerCase() === "yes" || outcome.label.trim().toLowerCase() === "no");
18358
+ if (!isSportsMoneylineMarket) return false;
18359
+ const marketLabel = ((_b = (_a = market.shortTitle) != null ? _a : market.question) != null ? _b : "").trim();
18360
+ if (!marketLabel) return false;
18361
+ return !SIDE_NAMED_MONEYLINE_QUESTION_RE.test(marketLabel);
18362
+ };
18014
18363
  var renderRouteCard = ({
18015
18364
  card,
18016
18365
  enableAnimations,
@@ -18426,16 +18775,10 @@ var PlaceOrder = ({
18426
18775
  scopedSelectedMarket ? [scopedSelectedMarket] : void 0
18427
18776
  );
18428
18777
  const wsBestPrices = (0, import_hooks54.useLiveBestPrices)(scopedSelectedMarket ? [scopedSelectedMarket] : void 0);
18429
- const clusterMidpointResult = midpointsResult != null ? midpointsResult : {
18430
- prices: /* @__PURE__ */ new Map(),
18431
- bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
18432
- venueByOutcomeId: /* @__PURE__ */ new Map(),
18433
- bestPrices: /* @__PURE__ */ new Map(),
18434
- bestPriceVenuesByOutcomeId: /* @__PURE__ */ new Map(),
18435
- isLoading: false,
18436
- bestMidpoint: void 0,
18437
- bestMidpointVenue: void 0
18438
- };
18778
+ const fetchedClusterMidpointResult = (0, import_hooks54.useMidpoints)(
18779
+ midpointsResult ? [] : scopedSelectedMarket ? [scopedSelectedMarket] : []
18780
+ );
18781
+ const clusterMidpointResult = midpointsResult != null ? midpointsResult : fetchedClusterMidpointResult;
18439
18782
  const clusterBestMidpointsByOutcomeId = (_i = clusterMidpointResult.bestMidpointsByOutcomeId) != null ? _i : clusterMidpointResult.prices;
18440
18783
  const clusterBestMidpoint = clusterMidpointResult.bestMidpoint;
18441
18784
  const clusterBestPricesRest = clusterMidpointResult.bestPrices;
@@ -19618,11 +19961,11 @@ var PlaceOrder = ({
19618
19961
  bestPrices: clusterBestPrices,
19619
19962
  bestMidpoint: clusterBestMidpoint,
19620
19963
  bestMidpointsByOutcomeId: clusterBestMidpointsByOutcomeId,
19621
- livePrices,
19622
- fallbackPrice: outcome.price
19964
+ livePrices
19623
19965
  });
19624
19966
  const isActive = outcome.id === scopedSelectedOutcomeId;
19625
19967
  const isPositive = resolveIsPositiveOutcome(outcome, index);
19968
+ const isPriceLoading = clusterMidpointResult.isLoading && price == null;
19626
19969
  return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
19627
19970
  "button",
19628
19971
  {
@@ -19652,7 +19995,16 @@ var PlaceOrder = ({
19652
19995
  children: (_c2 = outcome.title) != null ? _c2 : outcome.label
19653
19996
  }
19654
19997
  ),
19655
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price) })
19998
+ isPriceLoading ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
19999
+ "span",
20000
+ {
20001
+ "aria-hidden": "true",
20002
+ className: cn(
20003
+ "agg-place-order-outcome-price-loading",
20004
+ "h-4 w-10 shrink-0 rounded-agg-sm bg-agg-separator animate-pulse"
20005
+ )
20006
+ }
20007
+ ) : /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { as: "span", variant: isActive ? "body-strong" : "body", children: formatProbabilityCents(price) })
19656
20008
  ]
19657
20009
  },
19658
20010
  outcome.id
@@ -20241,7 +20593,7 @@ function useResolvedMarketClaim(options = {}) {
20241
20593
  }, executionMode === "paper" ? { mode: "paper" } : {}));
20242
20594
  const claimWinnings = useClaimWinnings();
20243
20595
  return (0, import_react34.useMemo)(() => {
20244
- var _a2, _b, _c;
20596
+ var _a2;
20245
20597
  if (!shouldFetch || !marketId) return void 0;
20246
20598
  const group = positions.find(
20247
20599
  (candidate) => candidate.targetMarketId === marketId
@@ -20253,7 +20605,10 @@ function useResolvedMarketClaim(options = {}) {
20253
20605
  if (winningOutcomes.length === 0) return void 0;
20254
20606
  const totals = (0, import_hooks56.computeClosedPositionTotals)(group);
20255
20607
  const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
20256
- const winningOutcomeLabel = ((_b = (_a2 = winningOutcomes[0]) == null ? void 0 : _a2.title) == null ? void 0 : _b.trim()) || ((_c = winningOutcomes[0]) == null ? void 0 : _c.label) || "";
20608
+ const winningOutcomeLabel = (_a2 = resolveResolvedOutcomeLabel({
20609
+ market: market != null ? market : group.venueMarket,
20610
+ outcome: winningOutcomes[0]
20611
+ })) != null ? _a2 : "";
20257
20612
  const claimKey = group.targetMarketId;
20258
20613
  const canClaim = group.redeemStatus === "eligible" && totals.winningOutcomeIds.length > 0;
20259
20614
  return {
@@ -20569,252 +20924,6 @@ var import_react38 = require("react");
20569
20924
  var import_hooks59 = require("@agg-build/hooks");
20570
20925
  var import_react37 = require("react");
20571
20926
 
20572
- // src/pages/event-market/sports-market-card.tsx
20573
- var import_hooks58 = require("@agg-build/hooks");
20574
- var import_react36 = require("react");
20575
-
20576
- // src/pages/event-market/sports-line-rail.tsx
20577
- var React = __toESM(require("react"));
20578
- var import_jsx_runtime149 = require("react/jsx-runtime");
20579
- function VenueRow({ venues, active }) {
20580
- if (!venues || venues.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "h-4" });
20581
- const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
20582
- const extra = venues.length - shown.length;
20583
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20584
- "span",
20585
- {
20586
- className: cn(
20587
- "flex h-4 items-center justify-center gap-1",
20588
- !active && "text-agg-muted-foreground"
20589
- ),
20590
- children: [
20591
- shown.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20592
- VenueLogo,
20593
- {
20594
- venue,
20595
- isMonochromatic: !active,
20596
- size: "small",
20597
- className: "size-3! shrink-0"
20598
- },
20599
- `${venue}-${index}`
20600
- )),
20601
- extra > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
20602
- "+",
20603
- extra
20604
- ] })
20605
- ]
20606
- }
20607
- );
20608
- }
20609
- function SportsLineRail({
20610
- stops,
20611
- selectedIndex,
20612
- onSelect,
20613
- ariaLabel,
20614
- previousAriaLabel,
20615
- nextAriaLabel,
20616
- className
20617
- }) {
20618
- const scrollRef = React.useRef(null);
20619
- const itemRefs = React.useRef([]);
20620
- const didInit = React.useRef(false);
20621
- const programmatic = React.useRef(false);
20622
- const progTimer = React.useRef(void 0);
20623
- const skipCenterOnPropSync = React.useRef(false);
20624
- const pendingScrollIndex = React.useRef(null);
20625
- const scrollSettleTimer = React.useRef(void 0);
20626
- const stopCount = stops.length;
20627
- const [pad, setPad] = React.useState({ left: 0, right: 0 });
20628
- const [mask, setMask] = React.useState({ left: false, right: false });
20629
- const updateMask = React.useCallback(() => {
20630
- const c = scrollRef.current;
20631
- if (!c || !c.clientWidth) return;
20632
- setMask({
20633
- left: c.scrollLeft > 1,
20634
- right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
20635
- });
20636
- }, []);
20637
- const resolveNearestIndexToViewportCenter = React.useCallback(() => {
20638
- const container = scrollRef.current;
20639
- if (!container || !container.clientWidth) return null;
20640
- const viewportCenter = container.scrollLeft + container.clientWidth / 2;
20641
- let nearestIndex = null;
20642
- let nearestDistance = Number.POSITIVE_INFINITY;
20643
- itemRefs.current.forEach((item, index) => {
20644
- if (!item) return;
20645
- const itemCenter = item.offsetLeft + item.offsetWidth / 2;
20646
- const distance = Math.abs(itemCenter - viewportCenter);
20647
- if (distance < nearestDistance) {
20648
- nearestDistance = distance;
20649
- nearestIndex = index;
20650
- }
20651
- });
20652
- return nearestIndex;
20653
- }, []);
20654
- React.useLayoutEffect(() => {
20655
- const c = scrollRef.current;
20656
- if (!c) return;
20657
- const measure = () => {
20658
- var _a, _b, _c, _d;
20659
- const w = c.clientWidth;
20660
- if (!w) return;
20661
- const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
20662
- const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
20663
- setPad({
20664
- left: Math.max(0, w / 2 - firstW / 2),
20665
- right: Math.max(0, w / 2 - lastW / 2)
20666
- });
20667
- updateMask();
20668
- };
20669
- const onScroll = () => {
20670
- if (!programmatic.current) {
20671
- const nearestIndex = resolveNearestIndexToViewportCenter();
20672
- if (nearestIndex != null && nearestIndex !== selectedIndex) {
20673
- pendingScrollIndex.current = nearestIndex;
20674
- clearTimeout(scrollSettleTimer.current);
20675
- scrollSettleTimer.current = setTimeout(() => {
20676
- const nextIndex = pendingScrollIndex.current;
20677
- if (nextIndex == null || nextIndex === selectedIndex) return;
20678
- skipCenterOnPropSync.current = true;
20679
- onSelect(nextIndex);
20680
- }, 120);
20681
- }
20682
- }
20683
- updateMask();
20684
- };
20685
- measure();
20686
- const ro = new ResizeObserver(measure);
20687
- ro.observe(c);
20688
- c.addEventListener("scroll", onScroll, { passive: true });
20689
- return () => {
20690
- ro.disconnect();
20691
- c.removeEventListener("scroll", onScroll);
20692
- clearTimeout(scrollSettleTimer.current);
20693
- };
20694
- }, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
20695
- React.useEffect(() => {
20696
- pendingScrollIndex.current = selectedIndex;
20697
- }, [selectedIndex]);
20698
- React.useEffect(() => {
20699
- const c = scrollRef.current;
20700
- const el = itemRefs.current[selectedIndex];
20701
- if (!c || !el || !c.clientWidth) return;
20702
- if (skipCenterOnPropSync.current) {
20703
- skipCenterOnPropSync.current = false;
20704
- updateMask();
20705
- return;
20706
- }
20707
- const max = c.scrollWidth - c.clientWidth;
20708
- const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
20709
- programmatic.current = true;
20710
- c.scrollTo({
20711
- left: Math.max(0, Math.min(max, target)),
20712
- behavior: didInit.current ? "smooth" : "auto"
20713
- });
20714
- if (pad.left > 0 || pad.right > 0) didInit.current = true;
20715
- clearTimeout(progTimer.current);
20716
- progTimer.current = setTimeout(() => {
20717
- programmatic.current = false;
20718
- }, 500);
20719
- updateMask();
20720
- }, [selectedIndex, stopCount, pad, updateMask]);
20721
- const select = (index) => {
20722
- const next = Math.min(stops.length - 1, Math.max(0, index));
20723
- if (next !== selectedIndex) onSelect(next);
20724
- };
20725
- const step = (delta) => select(selectedIndex + delta);
20726
- if (stopCount === 0) return null;
20727
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20728
- "div",
20729
- {
20730
- className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
20731
- "aria-label": ariaLabel,
20732
- children: [
20733
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20734
- "button",
20735
- {
20736
- type: "button",
20737
- onClick: () => step(-1),
20738
- disabled: selectedIndex === 0,
20739
- "aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
20740
- className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
20741
- children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-left", className: "size-4" })
20742
- }
20743
- ),
20744
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
20745
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20746
- "div",
20747
- {
20748
- ref: scrollRef,
20749
- style: { paddingLeft: pad.left, paddingRight: pad.right },
20750
- className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
20751
- children: stops.map((stop, index) => {
20752
- const active = index === selectedIndex;
20753
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20754
- "button",
20755
- {
20756
- type: "button",
20757
- ref: (el) => {
20758
- itemRefs.current[index] = el;
20759
- },
20760
- onClick: () => select(index),
20761
- disabled: stop.disabled,
20762
- "aria-pressed": active,
20763
- className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
20764
- children: [
20765
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20766
- "span",
20767
- {
20768
- className: cn(
20769
- "flex h-8 min-w-[60px] items-center justify-center rounded-agg-full border px-3 text-agg-sm leading-agg-5 tabular-nums transition-colors",
20770
- active ? "border-agg-primary bg-agg-secondary font-agg-bold text-agg-foreground" : "border-transparent bg-agg-secondary text-agg-muted-foreground hover:bg-agg-secondary-hover hover:text-agg-foreground"
20771
- ),
20772
- children: stop.value
20773
- }
20774
- ),
20775
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueRow, { venues: stop.venues, active })
20776
- ]
20777
- },
20778
- index
20779
- );
20780
- })
20781
- }
20782
- ),
20783
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20784
- "span",
20785
- {
20786
- className: cn(
20787
- "pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
20788
- mask.left ? "opacity-100" : "opacity-0"
20789
- )
20790
- }
20791
- ),
20792
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20793
- "span",
20794
- {
20795
- className: cn(
20796
- "pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
20797
- mask.right ? "opacity-100" : "opacity-0"
20798
- )
20799
- }
20800
- )
20801
- ] }),
20802
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20803
- "button",
20804
- {
20805
- type: "button",
20806
- onClick: () => step(1),
20807
- disabled: selectedIndex === stopCount - 1,
20808
- "aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
20809
- className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
20810
- children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-right", className: "size-4" })
20811
- }
20812
- )
20813
- ]
20814
- }
20815
- );
20816
- }
20817
-
20818
20927
  // src/pages/event-market/sports-event-market.utils.ts
20819
20928
  var SPORTS_MARKET_TYPE_KEYS = [
20820
20929
  "moneyline",
@@ -20871,6 +20980,10 @@ var SPORTS_LEGACY_PROP_CATEGORY_KEY_SET = /* @__PURE__ */ new Set([
20871
20980
  "assists",
20872
20981
  "shots"
20873
20982
  ]);
20983
+ var SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET = /* @__PURE__ */ new Set([
20984
+ "exact_score",
20985
+ ...SPORTS_LEGACY_PROP_CATEGORY_KEY_SET
20986
+ ]);
20874
20987
  var SPORTS_MARKET_GROUP_TO_TAB = {
20875
20988
  game_lines: "game_lines",
20876
20989
  spreads: "game_lines",
@@ -20958,9 +21071,15 @@ var SPORTS_MARKET_TYPE_ORDER = [
20958
21071
  ];
20959
21072
  var YES_NO_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
20960
21073
  var LINE_MARKET_TYPES = /* @__PURE__ */ new Set(["spread", "total"]);
21074
+ var PLAYER_PROP_COUNT_PATTERN = /\+\s|\bo\/u\b|\bover\/under\b/i;
21075
+ var REG_TIME_TITLE_PATTERN = /^reg(?:ular)?\s*time\s*:/i;
20961
21076
  var toTrimmedString = (value) => {
20962
21077
  return typeof value === "string" ? value.trim() : "";
20963
21078
  };
21079
+ var resolveSportsMarketAggKey = (market) => {
21080
+ const typedMarket = market;
21081
+ return toTrimmedString(typedMarket.aggKey);
21082
+ };
20964
21083
  var sanitizeFamilyValue = (value) => {
20965
21084
  return value.toLowerCase().replace(/[-+]?\d+(?:\.\d+)?/g, "").replace(/[¢$]/g, "").replace(/\s+/g, " ").replace(/[|:()[\]{}]/g, "").trim();
20966
21085
  };
@@ -21020,15 +21139,36 @@ var normalizeSportsMarketGroup = (value) => {
21020
21139
  if (!resolvedValue) return null;
21021
21140
  return SPORTS_MARKET_GROUP_KEY_SET.has(resolvedValue) ? resolvedValue : "other";
21022
21141
  };
21142
+ var resolveFallbackSportsMarketCategory = (market) => {
21143
+ const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
21144
+ const question = toTrimmedString(market.question).toLowerCase();
21145
+ if (marketSubtype.includes("exact_score") || marketSubtype.includes("correct_score") || question.includes("exact score") || question.includes("correct score")) {
21146
+ return "exact_score";
21147
+ }
21148
+ if (marketSubtype.includes("corner") || question.includes("corner")) {
21149
+ return "corners";
21150
+ }
21151
+ if (marketSubtype.includes("shot")) return "shots";
21152
+ if (marketSubtype.includes("assist")) return "assists";
21153
+ if (marketSubtype.includes("goal")) return "goals";
21154
+ if (!PLAYER_PROP_COUNT_PATTERN.test(question) || !question.includes(":") || question.includes(" vs ") || question.includes(" vs. ")) {
21155
+ return null;
21156
+ }
21157
+ if (question.includes("shot")) return "shots";
21158
+ if (question.includes("assist")) return "assists";
21159
+ if (question.includes("goal")) return "goals";
21160
+ return null;
21161
+ };
21023
21162
  var resolveMarketSectionTabKey = (market) => {
21024
- const category = normalizeSportsMarketCategory(market.marketCategory);
21025
- if (category && SPORTS_LEGACY_PROP_CATEGORY_KEY_SET.has(category)) {
21163
+ const normalizedCategory = normalizeSportsMarketCategory(market.marketCategory);
21164
+ const fallbackCategory = !normalizedCategory || normalizedCategory === "other" ? resolveFallbackSportsMarketCategory(market) : null;
21165
+ const category = fallbackCategory != null ? fallbackCategory : normalizedCategory;
21166
+ if (category && SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET.has(category)) {
21026
21167
  return category;
21027
21168
  }
21028
21169
  const group = normalizeSportsMarketGroup(market.marketGroup);
21029
21170
  if (group) return SPORTS_MARKET_GROUP_TO_TAB[group];
21030
21171
  if (category === "game_lines") return "game_lines";
21031
- if (category === "exact_score") return "exact_score";
21032
21172
  if (category === "other") return "other";
21033
21173
  return null;
21034
21174
  };
@@ -21052,13 +21192,27 @@ var resolveSportsSectionMarkets = ({
21052
21192
  sectionMarkets
21053
21193
  }) => {
21054
21194
  const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tabKey);
21055
- if (tabKey !== "game_lines") return effectiveSectionMarkets;
21056
- const eventMoneylineMarkets = eventMarkets.filter(
21057
- (market) => normalizeSportsMarketType(market.sportsMarketType) === "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
21058
- );
21059
- if (eventMoneylineMarkets.length === 0) return effectiveSectionMarkets;
21060
- const lineSectionMarkets = effectiveSectionMarkets.filter(
21061
- (market) => normalizeSportsMarketType(market.sportsMarketType) !== "moneyline"
21195
+ const filteredSectionMarkets = effectiveSectionMarkets.filter(
21196
+ (market) => resolveMarketSectionTabKey(market) === tabKey
21197
+ );
21198
+ if (tabKey !== "game_lines") return filteredSectionMarkets;
21199
+ const eventMoneylineMarkets = (() => {
21200
+ const dedupedMarkets = [];
21201
+ const seenMoneylineKeys = /* @__PURE__ */ new Set();
21202
+ for (const market of eventMarkets) {
21203
+ if (normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" || resolveMarketSectionTabKey(market) !== "game_lines") {
21204
+ continue;
21205
+ }
21206
+ const moneylineKey = resolveSportsMarketAggKey(market) || market.id;
21207
+ if (seenMoneylineKeys.has(moneylineKey)) continue;
21208
+ seenMoneylineKeys.add(moneylineKey);
21209
+ dedupedMarkets.push(market);
21210
+ }
21211
+ return dedupedMarkets;
21212
+ })();
21213
+ if (eventMoneylineMarkets.length === 0) return filteredSectionMarkets;
21214
+ const lineSectionMarkets = filteredSectionMarkets.filter(
21215
+ (market) => normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
21062
21216
  );
21063
21217
  return [...eventMoneylineMarkets, ...lineSectionMarkets];
21064
21218
  };
@@ -21086,7 +21240,15 @@ var isBinarySportsMoneylineMarket = (market) => {
21086
21240
  );
21087
21241
  const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
21088
21242
  const marketGroup = normalizeSportsMarketGroup(market.marketGroup);
21089
- return marketSubtype === "moneyline" && marketGroup === "game_lines" && normalizeSportsPeriod(market.period) === "full" && normalizedOutcomeLabels.length === 2 && normalizedOutcomeLabels.every((label2) => YES_NO_LABELS.has(label2));
21243
+ const sportsMarketType = normalizeSportsMarketType(market.sportsMarketType);
21244
+ const question = toTrimmedString(market.question);
21245
+ const aggKey = resolveSportsMarketAggKey(market);
21246
+ return sportsMarketType === "moneyline" && marketGroup === "game_lines" && normalizeSportsPeriod(market.period) === "full" && normalizedOutcomeLabels.length === 2 && normalizedOutcomeLabels.every((label2) => YES_NO_LABELS.has(label2)) && (marketSubtype === "moneyline" || REG_TIME_TITLE_PATTERN.test(question) || aggKey.includes("_ml_"));
21247
+ };
21248
+ var AGGKEY_LINE_TOKEN_PATTERN = /_\d+p\d+/g;
21249
+ var resolveSportsLineFamilyKey = (market) => {
21250
+ const aggKey = resolveSportsMarketAggKey(market);
21251
+ return aggKey ? aggKey.replace(AGGKEY_LINE_TOKEN_PATTERN, "") : "";
21090
21252
  };
21091
21253
  var resolveDisplayGroupFamilyKey = (market) => {
21092
21254
  var _a, _b, _c;
@@ -21100,11 +21262,12 @@ var resolveDisplayGroupFamilyKey = (market) => {
21100
21262
  if (isBinarySportsMoneylineMarket(market)) {
21101
21263
  return `${period}|moneyline|${marketCategory}`;
21102
21264
  }
21265
+ const lineFamily = resolveSportsLineFamilyKey(market);
21103
21266
  if (sportsMarketType === "spread") {
21104
- return `${period}|spread|${marketCategory}`;
21267
+ return lineFamily ? `${period}|spread|${lineFamily}` : `${period}|spread|${marketCategory}`;
21105
21268
  }
21106
21269
  if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
21107
- return `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
21270
+ return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
21108
21271
  }
21109
21272
  return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
21110
21273
  };
@@ -21311,15 +21474,6 @@ var buildSportsSlideFromGroup = (group) => {
21311
21474
  defaultStopIndex
21312
21475
  };
21313
21476
  };
21314
- var formatSportsPeriodGrammarLabel = (period) => {
21315
- const grammarMatch = SPORTS_PERIOD_GRAMMAR_PATTERN.exec(period);
21316
- if (!grammarMatch) return null;
21317
- if (grammarMatch[1]) {
21318
- const family = grammarMatch[1].charAt(0).toUpperCase() + grammarMatch[1].slice(1);
21319
- return `${family} ${Number(grammarMatch[2])}`;
21320
- }
21321
- return `First ${Number(grammarMatch[3])} Innings`;
21322
- };
21323
21477
  var resolveSportsCategoryTokens = (event) => {
21324
21478
  return new Set(
21325
21479
  event.categories.flatMap((entry) => {
@@ -21371,11 +21525,257 @@ var mergeSportsSectionMarketsIntoEvent = ({
21371
21525
  seenMarketIds.add(market.id);
21372
21526
  orderedVenueMarkets.push(market);
21373
21527
  }
21374
- }
21375
- return __spreadProps(__spreadValues({}, event), {
21376
- venueMarkets: orderedVenueMarkets
21377
- });
21378
- };
21528
+ }
21529
+ return __spreadProps(__spreadValues({}, event), {
21530
+ venueMarkets: orderedVenueMarkets
21531
+ });
21532
+ };
21533
+
21534
+ // src/pages/event-market/sports-market-card.tsx
21535
+ var import_hooks58 = require("@agg-build/hooks");
21536
+ var import_react36 = require("react");
21537
+
21538
+ // src/pages/event-market/sports-line-rail.tsx
21539
+ var React = __toESM(require("react"));
21540
+ var import_jsx_runtime149 = require("react/jsx-runtime");
21541
+ function VenueRow({ venues, active }) {
21542
+ if (!venues || venues.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "h-4" });
21543
+ const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
21544
+ const extra = venues.length - shown.length;
21545
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
21546
+ "span",
21547
+ {
21548
+ className: cn(
21549
+ "flex h-4 items-center justify-center gap-1",
21550
+ !active && "text-agg-muted-foreground"
21551
+ ),
21552
+ children: [
21553
+ shown.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21554
+ VenueLogo,
21555
+ {
21556
+ venue,
21557
+ isMonochromatic: !active,
21558
+ size: "small",
21559
+ className: "size-3! shrink-0"
21560
+ },
21561
+ `${venue}-${index}`
21562
+ )),
21563
+ extra > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
21564
+ "+",
21565
+ extra
21566
+ ] })
21567
+ ]
21568
+ }
21569
+ );
21570
+ }
21571
+ function SportsLineRail({
21572
+ stops,
21573
+ selectedIndex,
21574
+ onSelect,
21575
+ ariaLabel,
21576
+ previousAriaLabel,
21577
+ nextAriaLabel,
21578
+ className
21579
+ }) {
21580
+ const scrollRef = React.useRef(null);
21581
+ const itemRefs = React.useRef([]);
21582
+ const didInit = React.useRef(false);
21583
+ const programmatic = React.useRef(false);
21584
+ const progTimer = React.useRef(void 0);
21585
+ const skipCenterOnPropSync = React.useRef(false);
21586
+ const pendingScrollIndex = React.useRef(null);
21587
+ const scrollSettleTimer = React.useRef(void 0);
21588
+ const stopCount = stops.length;
21589
+ const [pad, setPad] = React.useState({ left: 0, right: 0 });
21590
+ const [mask, setMask] = React.useState({ left: false, right: false });
21591
+ const updateMask = React.useCallback(() => {
21592
+ const c = scrollRef.current;
21593
+ if (!c || !c.clientWidth) return;
21594
+ setMask({
21595
+ left: c.scrollLeft > 1,
21596
+ right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
21597
+ });
21598
+ }, []);
21599
+ const resolveNearestIndexToViewportCenter = React.useCallback(() => {
21600
+ const container = scrollRef.current;
21601
+ if (!container || !container.clientWidth) return null;
21602
+ const viewportCenter = container.scrollLeft + container.clientWidth / 2;
21603
+ let nearestIndex = null;
21604
+ let nearestDistance = Number.POSITIVE_INFINITY;
21605
+ itemRefs.current.forEach((item, index) => {
21606
+ if (!item) return;
21607
+ const itemCenter = item.offsetLeft + item.offsetWidth / 2;
21608
+ const distance = Math.abs(itemCenter - viewportCenter);
21609
+ if (distance < nearestDistance) {
21610
+ nearestDistance = distance;
21611
+ nearestIndex = index;
21612
+ }
21613
+ });
21614
+ return nearestIndex;
21615
+ }, []);
21616
+ React.useLayoutEffect(() => {
21617
+ const c = scrollRef.current;
21618
+ if (!c) return;
21619
+ const measure = () => {
21620
+ var _a, _b, _c, _d;
21621
+ const w = c.clientWidth;
21622
+ if (!w) return;
21623
+ const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
21624
+ const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
21625
+ setPad({
21626
+ left: Math.max(0, w / 2 - firstW / 2),
21627
+ right: Math.max(0, w / 2 - lastW / 2)
21628
+ });
21629
+ updateMask();
21630
+ };
21631
+ const onScroll = () => {
21632
+ if (!programmatic.current) {
21633
+ const nearestIndex = resolveNearestIndexToViewportCenter();
21634
+ if (nearestIndex != null && nearestIndex !== selectedIndex) {
21635
+ pendingScrollIndex.current = nearestIndex;
21636
+ clearTimeout(scrollSettleTimer.current);
21637
+ scrollSettleTimer.current = setTimeout(() => {
21638
+ const nextIndex = pendingScrollIndex.current;
21639
+ if (nextIndex == null || nextIndex === selectedIndex) return;
21640
+ skipCenterOnPropSync.current = true;
21641
+ onSelect(nextIndex);
21642
+ }, 120);
21643
+ }
21644
+ }
21645
+ updateMask();
21646
+ };
21647
+ measure();
21648
+ const ro = new ResizeObserver(measure);
21649
+ ro.observe(c);
21650
+ c.addEventListener("scroll", onScroll, { passive: true });
21651
+ return () => {
21652
+ ro.disconnect();
21653
+ c.removeEventListener("scroll", onScroll);
21654
+ clearTimeout(scrollSettleTimer.current);
21655
+ };
21656
+ }, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
21657
+ React.useEffect(() => {
21658
+ pendingScrollIndex.current = selectedIndex;
21659
+ }, [selectedIndex]);
21660
+ React.useEffect(() => {
21661
+ const c = scrollRef.current;
21662
+ const el = itemRefs.current[selectedIndex];
21663
+ if (!c || !el || !c.clientWidth) return;
21664
+ if (skipCenterOnPropSync.current) {
21665
+ skipCenterOnPropSync.current = false;
21666
+ updateMask();
21667
+ return;
21668
+ }
21669
+ const max = c.scrollWidth - c.clientWidth;
21670
+ const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
21671
+ programmatic.current = true;
21672
+ c.scrollTo({
21673
+ left: Math.max(0, Math.min(max, target)),
21674
+ behavior: didInit.current ? "smooth" : "auto"
21675
+ });
21676
+ if (pad.left > 0 || pad.right > 0) didInit.current = true;
21677
+ clearTimeout(progTimer.current);
21678
+ progTimer.current = setTimeout(() => {
21679
+ programmatic.current = false;
21680
+ }, 500);
21681
+ updateMask();
21682
+ }, [selectedIndex, stopCount, pad, updateMask]);
21683
+ const select = (index) => {
21684
+ const next = Math.min(stops.length - 1, Math.max(0, index));
21685
+ if (next !== selectedIndex) onSelect(next);
21686
+ };
21687
+ const step = (delta) => select(selectedIndex + delta);
21688
+ if (stopCount === 0) return null;
21689
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
21690
+ "div",
21691
+ {
21692
+ className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
21693
+ "aria-label": ariaLabel,
21694
+ children: [
21695
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21696
+ "button",
21697
+ {
21698
+ type: "button",
21699
+ onClick: () => step(-1),
21700
+ disabled: selectedIndex === 0,
21701
+ "aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
21702
+ className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
21703
+ children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-left", className: "size-4" })
21704
+ }
21705
+ ),
21706
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
21707
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21708
+ "div",
21709
+ {
21710
+ ref: scrollRef,
21711
+ style: { paddingLeft: pad.left, paddingRight: pad.right },
21712
+ className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
21713
+ children: stops.map((stop, index) => {
21714
+ const active = index === selectedIndex;
21715
+ return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
21716
+ "button",
21717
+ {
21718
+ type: "button",
21719
+ ref: (el) => {
21720
+ itemRefs.current[index] = el;
21721
+ },
21722
+ onClick: () => select(index),
21723
+ disabled: stop.disabled,
21724
+ "aria-pressed": active,
21725
+ className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
21726
+ children: [
21727
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21728
+ "span",
21729
+ {
21730
+ className: cn(
21731
+ "flex h-8 min-w-[60px] items-center justify-center rounded-agg-full border px-3 text-agg-sm leading-agg-5 tabular-nums transition-colors",
21732
+ active ? "border-agg-primary bg-agg-secondary font-agg-bold text-agg-foreground" : "border-transparent bg-agg-secondary text-agg-muted-foreground hover:bg-agg-secondary-hover hover:text-agg-foreground"
21733
+ ),
21734
+ children: stop.value
21735
+ }
21736
+ ),
21737
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueRow, { venues: stop.venues, active })
21738
+ ]
21739
+ },
21740
+ index
21741
+ );
21742
+ })
21743
+ }
21744
+ ),
21745
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21746
+ "span",
21747
+ {
21748
+ className: cn(
21749
+ "pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
21750
+ mask.left ? "opacity-100" : "opacity-0"
21751
+ )
21752
+ }
21753
+ ),
21754
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21755
+ "span",
21756
+ {
21757
+ className: cn(
21758
+ "pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
21759
+ mask.right ? "opacity-100" : "opacity-0"
21760
+ )
21761
+ }
21762
+ )
21763
+ ] }),
21764
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
21765
+ "button",
21766
+ {
21767
+ type: "button",
21768
+ onClick: () => step(1),
21769
+ disabled: selectedIndex === stopCount - 1,
21770
+ "aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
21771
+ className: "flex size-5! shrink-0 cursor-pointer items-center justify-center text-agg-muted-foreground transition-colors hover:text-agg-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-30",
21772
+ children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-right", className: "size-4" })
21773
+ }
21774
+ )
21775
+ ]
21776
+ }
21777
+ );
21778
+ }
21379
21779
 
21380
21780
  // src/pages/event-market/sports-market-card.tsx
21381
21781
  var import_jsx_runtime150 = require("react/jsx-runtime");
@@ -21403,6 +21803,19 @@ var SportsMarketCard = ({
21403
21803
  [group.markets]
21404
21804
  );
21405
21805
  const isCombinedMoneylineGroup = group.sportsMarketType === "moneyline" && combinedMoneylineMarkets.length > 1 && combinedMoneylineMarkets.length === group.markets.length;
21806
+ const preferredResolvedMoneylineMarket = (0, import_react36.useMemo)(() => {
21807
+ var _a2, _b2;
21808
+ if (!isCombinedMoneylineGroup) return null;
21809
+ const resolvedYesWinnerMarket = (_a2 = combinedMoneylineMarkets.find(
21810
+ (market) => market.venueMarketOutcomes.some(
21811
+ (outcome) => outcome.winner === true && outcome.label.trim().toLowerCase() === "yes"
21812
+ )
21813
+ )) != null ? _a2 : null;
21814
+ if (resolvedYesWinnerMarket) return resolvedYesWinnerMarket;
21815
+ return (_b2 = combinedMoneylineMarkets.find(
21816
+ (market) => market.venueMarketOutcomes.some((outcome) => outcome.winner === true)
21817
+ )) != null ? _b2 : null;
21818
+ }, [combinedMoneylineMarkets, isCombinedMoneylineGroup]);
21406
21819
  (0, import_react36.useEffect)(() => {
21407
21820
  if (!slide.hasLadder) return;
21408
21821
  const tradingMarketId = tradingContext == null ? void 0 : tradingContext.selectedMarketId;
@@ -21410,7 +21823,7 @@ var SportsMarketCard = ({
21410
21823
  const matchedIndex = slide.stops.findIndex((stop) => stop.market.id === tradingMarketId);
21411
21824
  if (matchedIndex >= 0) setSelectedLineIndex(matchedIndex);
21412
21825
  }, [slide.hasLadder, slide.stops, tradingContext == null ? void 0 : tradingContext.selectedMarketId]);
21413
- const activeMoneylineMarket = isCombinedMoneylineGroup && (tradingContext == null ? void 0 : tradingContext.selectedMarketId) ? (_a = group.markets.find((market) => market.id === tradingContext.selectedMarketId)) != null ? _a : null : null;
21826
+ const activeMoneylineMarket = isCombinedMoneylineGroup ? preferredResolvedMoneylineMarket != null ? preferredResolvedMoneylineMarket : (tradingContext == null ? void 0 : tradingContext.selectedMarketId) ? (_a = group.markets.find((market) => market.id === tradingContext.selectedMarketId)) != null ? _a : null : null : null;
21414
21827
  const activeMarket = slide.hasLadder ? (_d = (_c = (_b = slide.stops[selectedLineIndex]) == null ? void 0 : _b.market) != null ? _c : group.markets[0]) != null ? _d : null : (_e = activeMoneylineMarket != null ? activeMoneylineMarket : group.markets[0]) != null ? _e : null;
21415
21828
  const activeDefaultOutcome = isCombinedMoneylineGroup && activeMarket ? (_f = activeMarket.venueMarketOutcomes.find(
21416
21829
  (outcome) => outcome.label.trim().toLowerCase() === "yes"
@@ -21453,7 +21866,7 @@ var SportsMarketCard = ({
21453
21866
  const combinedMoneylineHeaderOutcomeItems = (0, import_react36.useMemo)(() => {
21454
21867
  if (!isCombinedMoneylineGroup) return void 0;
21455
21868
  return combinedMoneylineMarkets.flatMap((market, index) => {
21456
- var _a2;
21869
+ var _a2, _b2;
21457
21870
  const typedMarket = market;
21458
21871
  const yesOutcome = market.venueMarketOutcomes.find(
21459
21872
  (outcome) => outcome.label.trim().toLowerCase() === "yes"
@@ -21461,19 +21874,25 @@ var SportsMarketCard = ({
21461
21874
  if (!yesOutcome) return [];
21462
21875
  const label2 = ((_a2 = typedMarket.shortTitle) == null ? void 0 : _a2.trim()) || market.question.trim();
21463
21876
  if (!label2) return [];
21877
+ const probability = midpointsResult == null ? void 0 : getDisplayOutcomePrice({
21878
+ outcomeId: yesOutcome.id,
21879
+ outcomeLabel: yesOutcome.label,
21880
+ bestMidpointsByOutcomeId: (_b2 = midpointsResult.bestMidpointsByOutcomeId) != null ? _b2 : midpointsResult.prices
21881
+ });
21464
21882
  return [
21465
21883
  {
21466
21884
  id: yesOutcome.id,
21467
21885
  label: label2,
21468
21886
  title: label2,
21469
- probability: yesOutcome.price,
21887
+ probability,
21888
+ isPriceLoading: (midpointsResult == null ? void 0 : midpointsResult.isLoading) === true && probability == null,
21470
21889
  tone: index === 0 ? "positive" : "negative",
21471
21890
  variant: "outcome",
21472
21891
  venue: market.venue
21473
21892
  }
21474
21893
  ];
21475
21894
  });
21476
- }, [combinedMoneylineMarkets, isCombinedMoneylineGroup]);
21895
+ }, [combinedMoneylineMarkets, isCombinedMoneylineGroup, midpointsResult]);
21477
21896
  const headerOutcomeVariant = isCombinedMoneylineGroup ? "outcome" : resolveSportsMarketCardVariant(activeMarket);
21478
21897
  const handleLineSelect = (index) => {
21479
21898
  var _a2, _b2;
@@ -21556,39 +21975,6 @@ var resolveSportsSectionLabel = (labels, key) => {
21556
21975
  return labels.eventMarketPage.sports.otherTab;
21557
21976
  }
21558
21977
  };
21559
- var resolveSportsPeriodLabel = (labels, period) => {
21560
- var _a;
21561
- switch (period) {
21562
- case "full":
21563
- return labels.eventMarketPage.sports.fullPeriod;
21564
- case "1h":
21565
- return labels.eventMarketPage.sports.firstHalfPeriod;
21566
- case "2h":
21567
- return labels.eventMarketPage.sports.secondHalfPeriod;
21568
- case "q1":
21569
- return labels.eventMarketPage.sports.quarterOnePeriod;
21570
- case "q2":
21571
- return labels.eventMarketPage.sports.quarterTwoPeriod;
21572
- case "q3":
21573
- return labels.eventMarketPage.sports.quarterThreePeriod;
21574
- case "q4":
21575
- return labels.eventMarketPage.sports.quarterFourPeriod;
21576
- case "ot":
21577
- return labels.eventMarketPage.sports.overtimePeriod;
21578
- case "first_inning":
21579
- return "1st Inning";
21580
- case "second_inning":
21581
- return "2nd Inning";
21582
- case "third_inning":
21583
- return "3rd Inning";
21584
- case "first_5_innings":
21585
- return "1st 5 Innings";
21586
- case "other":
21587
- return labels.eventMarketPage.sports.otherPeriod;
21588
- default:
21589
- return (_a = formatSportsPeriodGrammarLabel(period)) != null ? _a : labels.eventMarketPage.sports.otherPeriod;
21590
- }
21591
- };
21592
21978
  var SportsTabButton = ({
21593
21979
  isActive,
21594
21980
  label: label2,
@@ -21800,7 +22186,7 @@ var SportsMarkets = ({
21800
22186
  );
21801
22187
  }
21802
22188
  const shouldShowLoadingState = stableSectionMarkets == null && !isSectionSettled;
21803
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-5", "data-testid": "sports-markets", children: [
22189
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "flex flex-col gap-3", "data-testid": "sports-markets", children: [
21804
22190
  shouldRenderTabs ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21805
22191
  "div",
21806
22192
  {
@@ -21829,28 +22215,24 @@ var SportsMarkets = ({
21829
22215
  }
21830
22216
  ) : null,
21831
22217
  displayedPeriodGroups.map((periodGroup) => {
21832
- const hasMultiplePeriods = displayedPeriodGroups.length > 1;
21833
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
22218
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21834
22219
  "section",
21835
22220
  {
21836
22221
  className: "flex flex-col gap-3",
21837
22222
  "data-period-key": periodGroup.key,
21838
- children: [
21839
- hasMultiplePeriods ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Typography, { variant: "body-large-strong", className: "text-agg-foreground", children: resolveSportsPeriodLabel(labels, periodGroup.key) }) : null,
21840
- periodGroup.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21841
- SportsMarketCard,
21842
- {
21843
- group,
21844
- venueMarkets: displayedSectionMarkets,
21845
- isExpanded: expandedGroupId === group.id,
21846
- onToggle: handleToggleGroup,
21847
- onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
21848
- live,
21849
- midpointsResult
21850
- },
21851
- group.id
21852
- ))
21853
- ]
22223
+ children: periodGroup.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
22224
+ SportsMarketCard,
22225
+ {
22226
+ group,
22227
+ venueMarkets: displayedSectionMarkets,
22228
+ isExpanded: expandedGroupId === group.id,
22229
+ onToggle: handleToggleGroup,
22230
+ onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
22231
+ live,
22232
+ midpointsResult
22233
+ },
22234
+ group.id
22235
+ ))
21854
22236
  },
21855
22237
  `${activeTabKey}-${periodGroup.key}`
21856
22238
  );
@@ -22097,7 +22479,11 @@ var EventMarketPageContent = ({
22097
22479
  const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react39.useState)(false);
22098
22480
  const isMobileViewport = useIsMobileEventMarketViewport();
22099
22481
  const tradingContext = (0, import_hooks61.useEventTradingContext)();
22100
- const midpointsResult = (0, import_hooks61.useMidpoints)(event.venueMarkets);
22482
+ const eventDetailVenueMarkets = (0, import_react39.useMemo)(
22483
+ () => normalizeVenueMarketCluster(event.venueMarkets),
22484
+ [event.venueMarkets]
22485
+ );
22486
+ const midpointsResult = (0, import_hooks61.useMidpoints)(eventDetailVenueMarkets);
22101
22487
  const internalResolvedClaim = useResolvedMarketClaim({
22102
22488
  market: eventTradingState.primaryMarket,
22103
22489
  enabled: eventTradingState.kind === "resolved",
@@ -22416,6 +22802,17 @@ var MIN_SEARCH_LENGTH2 = 3;
22416
22802
  var SEARCH_DEBOUNCE_MS2 = 300;
22417
22803
  var SEARCH_RESULTS_LIMIT = 20;
22418
22804
  var MOBILE_HOME_SEARCH_MEDIA_QUERY = "(max-width: 767px)";
22805
+ var collectVisibleVenueMarketIds = (venueMarkets) => {
22806
+ var _a;
22807
+ const ids = [];
22808
+ for (const market of venueMarkets) {
22809
+ ids.push(market.id);
22810
+ for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
22811
+ ids.push(sibling.id);
22812
+ }
22813
+ }
22814
+ return [...new Set(ids)];
22815
+ };
22419
22816
  var HomeSearchResults = ({
22420
22817
  activeTabValue,
22421
22818
  query,
@@ -22470,6 +22867,19 @@ var HomeSearchResults = ({
22470
22867
  }
22471
22868
  return filtered;
22472
22869
  }, [searchResults, activeVenues]);
22870
+ const visibleVenueMarkets = (0, import_react42.useMemo)(() => {
22871
+ return openEvents.flatMap((event) => {
22872
+ var _a;
22873
+ return (_a = event.venueMarkets) != null ? _a : [];
22874
+ });
22875
+ }, [openEvents]);
22876
+ const visibleMidpointVenueMarketIds = (0, import_react42.useMemo)(() => {
22877
+ return collectVisibleVenueMarketIds(visibleVenueMarkets);
22878
+ }, [visibleVenueMarkets]);
22879
+ const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks62.useVenueMarketMidpoints)({
22880
+ venueMarketIds: visibleMidpointVenueMarketIds,
22881
+ enabled: visibleMidpointVenueMarketIds.length > 0
22882
+ });
22473
22883
  const loadMoreRef = (0, import_react42.useRef)(null);
22474
22884
  (0, import_react42.useEffect)(() => {
22475
22885
  if (!hasNextPage) return;
@@ -22560,6 +22970,8 @@ var HomeSearchResults = ({
22560
22970
  EventListItem,
22561
22971
  {
22562
22972
  event,
22973
+ midpointRows: sharedMidpointRows,
22974
+ midpointsLoading: isSharedMidpointsLoading,
22563
22975
  classNames: {
22564
22976
  root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
22565
22977
  },
@@ -22904,8 +23316,8 @@ var HomePage = ({
22904
23316
  HomePage.displayName = "HomePage";
22905
23317
 
22906
23318
  // src/pages/user-profile/index.tsx
22907
- var import_hooks67 = require("@agg-build/hooks");
22908
- var import_sdk19 = require("@agg-build/sdk");
23319
+ var import_hooks68 = require("@agg-build/hooks");
23320
+ var import_sdk20 = require("@agg-build/sdk");
22909
23321
  var import_react44 = require("react");
22910
23322
 
22911
23323
  // src/pages/user-profile/chain-display.ts
@@ -23142,8 +23554,136 @@ var AvailableBalanceCard = ({
23142
23554
  };
23143
23555
  AvailableBalanceCard.displayName = "AvailableBalanceCard";
23144
23556
 
23557
+ // src/pages/user-profile/components/claim-activity-breakdown-modal.tsx
23558
+ var import_hooks64 = require("@agg-build/hooks");
23559
+ var import_sdk19 = require("@agg-build/sdk");
23560
+ var import_jsx_runtime156 = require("react/jsx-runtime");
23561
+ var CLAIM_VENUE_LABELS = {
23562
+ [import_sdk19.Venue.kalshi]: "Kalshi",
23563
+ [import_sdk19.Venue.polymarket]: "Polymarket",
23564
+ [import_sdk19.Venue.limitless]: "Limitless",
23565
+ [import_sdk19.Venue.opinion]: "Opinion",
23566
+ [import_sdk19.Venue.predict]: "Predict",
23567
+ [import_sdk19.Venue.probable]: "Probable",
23568
+ [import_sdk19.Venue.myriad]: "Myriad",
23569
+ [import_sdk19.Venue.hyperliquid]: "Hyperliquid"
23570
+ };
23571
+ var ClaimActivityBreakdownModal = ({
23572
+ activity,
23573
+ onOpenChange,
23574
+ onTransactionSelect
23575
+ }) => {
23576
+ var _a;
23577
+ const labels = (0, import_hooks64.useLabels)();
23578
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23579
+ Modal,
23580
+ {
23581
+ open: activity !== null,
23582
+ onOpenChange,
23583
+ "aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
23584
+ children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23585
+ Modal.Container,
23586
+ {
23587
+ maxWidth: "600px",
23588
+ "aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
23589
+ children: [
23590
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23591
+ Modal.Header,
23592
+ {
23593
+ title: (_a = activity == null ? void 0 : activity.title) != null ? _a : "",
23594
+ classNames: {
23595
+ root: "border-b-0!",
23596
+ container: "px-4 py-4 sm:px-8 sm:pt-7 sm:pb-3",
23597
+ title: "text-2xl leading-8"
23598
+ }
23599
+ }
23600
+ ),
23601
+ activity ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Modal.Body, { classNames: { root: "px-4 pt-0 pb-4 sm:px-8 sm:pt-0 sm:pb-7" }, children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex flex-col gap-6", children: [
23602
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex flex-wrap items-center gap-3", children: [
23603
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-1.5 text-agg-sm leading-5 text-agg-foreground", children: activity.outcomeLabel }),
23604
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "min-w-0 flex-1 text-agg-sm leading-5 text-agg-foreground", children: activity.marketTitle })
23605
+ ] }),
23606
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex flex-col", children: activity.transactions.map((transaction, index) => {
23607
+ var _a2;
23608
+ const isInteractive = Boolean(transaction.txHash && transaction.chainId);
23609
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { children: [
23610
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23611
+ "button",
23612
+ {
23613
+ type: "button",
23614
+ className: [
23615
+ "flex w-full items-center justify-between gap-6 rounded-agg-lg px-3 py-2 text-left transition-colors",
23616
+ "bg-transparent hover:bg-agg-secondary-hover",
23617
+ isInteractive ? "cursor-pointer" : "cursor-default"
23618
+ ].join(" "),
23619
+ "aria-label": labels.userProfile.activity.claimBreakdownTransactionLinkAria(
23620
+ transaction.venue
23621
+ ),
23622
+ disabled: !isInteractive,
23623
+ onClick: () => {
23624
+ if (!isInteractive) return;
23625
+ onTransactionSelect(transaction);
23626
+ },
23627
+ children: [
23628
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "min-w-0 flex flex-1 flex-col gap-2", children: [
23629
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23630
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23631
+ VenueLogo,
23632
+ {
23633
+ venue: transaction.venue,
23634
+ size: "small",
23635
+ className: "shrink-0"
23636
+ }
23637
+ ),
23638
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-5 text-agg-foreground", children: (_a2 = CLAIM_VENUE_LABELS[transaction.venue]) != null ? _a2 : transaction.venue })
23639
+ ] }),
23640
+ transaction.hasError && transaction.errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23641
+ Tooltip,
23642
+ {
23643
+ size: "medium",
23644
+ content: transaction.errorMessage,
23645
+ sideOffset: 4,
23646
+ children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2 text-agg-error!", children: [
23647
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23648
+ Icon,
23649
+ {
23650
+ name: "circle-xmark",
23651
+ size: "small",
23652
+ className: "size-3! text-agg-error!"
23653
+ }
23654
+ ),
23655
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "truncate text-agg-sm leading-5 text-agg-error!", children: transaction.errorMessage })
23656
+ ] })
23657
+ }
23658
+ ) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm leading-5 text-agg-muted-foreground", children: transaction.transactionLabel })
23659
+ ] }),
23660
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex shrink-0 items-center gap-3", children: [
23661
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "text-agg-sm font-agg-bold leading-5 text-agg-foreground", children: transaction.amountLabel }),
23662
+ isInteractive ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23663
+ Icon,
23664
+ {
23665
+ name: "external-link",
23666
+ size: "small",
23667
+ className: "text-agg-muted-foreground"
23668
+ }
23669
+ ) : null
23670
+ ] })
23671
+ ]
23672
+ }
23673
+ ),
23674
+ index < activity.transactions.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "my-1 h-px w-full bg-agg-separator", "aria-hidden": true }) : null
23675
+ ] }, transaction.id);
23676
+ }) })
23677
+ ] }) }) : null
23678
+ ]
23679
+ }
23680
+ )
23681
+ }
23682
+ );
23683
+ };
23684
+
23145
23685
  // src/pages/user-profile/components/positions-activity.tsx
23146
- var import_hooks65 = require("@agg-build/hooks");
23686
+ var import_hooks66 = require("@agg-build/hooks");
23147
23687
  var import_react43 = require("react");
23148
23688
 
23149
23689
  // src/pages/user-profile/user-profile.constants.ts
@@ -23340,16 +23880,8 @@ var toPositionRowViewModel = (position, labels = defaultLabels2) => {
23340
23880
  };
23341
23881
  };
23342
23882
 
23343
- // src/primitives/conditional-wrapper.tsx
23344
- var ConditionalWrapper = ({
23345
- condition,
23346
- wrapper,
23347
- children
23348
- }) => condition ? wrapper(children) : children;
23349
- ConditionalWrapper.displayName = "ConditionalWrapper";
23350
-
23351
23883
  // src/pages/user-profile/components/activity-row.tsx
23352
- var import_jsx_runtime156 = require("react/jsx-runtime");
23884
+ var import_jsx_runtime157 = require("react/jsx-runtime");
23353
23885
  var shouldOpenInNewTab = (activity) => {
23354
23886
  return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
23355
23887
  };
@@ -23366,7 +23898,7 @@ var RowWrapper = ({
23366
23898
  }) => {
23367
23899
  if (href) {
23368
23900
  const opensInNewTab = target === "_blank";
23369
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23901
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23370
23902
  "a",
23371
23903
  {
23372
23904
  href,
@@ -23382,7 +23914,7 @@ var RowWrapper = ({
23382
23914
  }
23383
23915
  );
23384
23916
  }
23385
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("button", { type: "button", className, onClick, children });
23917
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("button", { type: "button", className, onClick, children });
23386
23918
  };
23387
23919
  var TRANSFER_ICON = {
23388
23920
  withdrawal: "upload",
@@ -23417,7 +23949,7 @@ var AmountTimeStack = ({
23417
23949
  timeLabel,
23418
23950
  tone,
23419
23951
  mobile
23420
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23952
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
23421
23953
  "div",
23422
23954
  {
23423
23955
  className: cn(
@@ -23425,7 +23957,7 @@ var AmountTimeStack = ({
23425
23957
  mobile ? "sm:hidden" : "hidden sm:flex sm:w-[120px] sm:shrink-0"
23426
23958
  ),
23427
23959
  children: [
23428
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23960
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23429
23961
  "p",
23430
23962
  {
23431
23963
  className: cn(
@@ -23436,7 +23968,7 @@ var AmountTimeStack = ({
23436
23968
  children: amountLabel
23437
23969
  }
23438
23970
  ),
23439
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23971
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23440
23972
  "p",
23441
23973
  {
23442
23974
  className: cn(
@@ -23453,9 +23985,9 @@ var AmountTimeStack = ({
23453
23985
  var TradeTypeCell = ({
23454
23986
  activity,
23455
23987
  tone
23456
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23457
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
23458
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23988
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23989
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
23990
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23459
23991
  "p",
23460
23992
  {
23461
23993
  className: cn(
@@ -23470,8 +24002,8 @@ var TradeTypeCell = ({
23470
24002
  var TransferTypeCell = ({
23471
24003
  activity,
23472
24004
  tone
23473
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23474
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24005
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
24006
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23475
24007
  Icon,
23476
24008
  {
23477
24009
  name: TRANSFER_ICON[activity.kind],
@@ -23482,7 +24014,7 @@ var TransferTypeCell = ({
23482
24014
  )
23483
24015
  }
23484
24016
  ),
23485
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24017
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23486
24018
  "p",
23487
24019
  {
23488
24020
  className: cn(
@@ -23497,8 +24029,8 @@ var TransferTypeCell = ({
23497
24029
  var RedeemTypeCell = ({
23498
24030
  activity,
23499
24031
  tone
23500
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23501
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24032
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
24033
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23502
24034
  Icon,
23503
24035
  {
23504
24036
  name: "gift-bonus",
@@ -23509,7 +24041,7 @@ var RedeemTypeCell = ({
23509
24041
  )
23510
24042
  }
23511
24043
  ),
23512
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24044
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23513
24045
  "p",
23514
24046
  {
23515
24047
  className: cn(
@@ -23526,7 +24058,7 @@ var OutcomeBadge = ({
23526
24058
  tone
23527
24059
  }) => {
23528
24060
  if (!label2) return null;
23529
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("span", { className: "agg-activity-outcome inline-flex items-center justify-center gap-1.5 rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24061
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("span", { className: "agg-activity-outcome inline-flex items-center justify-center gap-1.5 rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23530
24062
  "span",
23531
24063
  {
23532
24064
  className: cn(
@@ -23540,9 +24072,9 @@ var OutcomeBadge = ({
23540
24072
  var TradeOutcomeShares = ({
23541
24073
  activity,
23542
24074
  tone
23543
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(import_jsx_runtime156.Fragment, { children: [
23544
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }),
23545
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24075
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_jsx_runtime157.Fragment, { children: [
24076
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }),
24077
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23546
24078
  "span",
23547
24079
  {
23548
24080
  className: cn(
@@ -23562,8 +24094,8 @@ var RedeemRow = ({
23562
24094
  const tone = resolveToneClasses(activity);
23563
24095
  const statusVisual = getStatusVisual(activity);
23564
24096
  const activityStatus = resolveActivityStatus(activity);
23565
- const shouldShowInlineStatus = activityStatus !== "completed";
23566
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24097
+ const shouldShowInlineStatus = activityStatus === "pending";
24098
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23567
24099
  RowWrapper,
23568
24100
  {
23569
24101
  className,
@@ -23571,173 +24103,30 @@ var RedeemRow = ({
23571
24103
  target: href ? "_blank" : void 0,
23572
24104
  rel: href ? "noopener noreferrer" : void 0,
23573
24105
  onClick,
23574
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23575
- ConditionalWrapper,
23576
- {
23577
- condition: !!activity.errorMessage,
23578
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23579
- Tooltip,
23580
- {
23581
- size: "medium",
23582
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23583
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23584
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23585
- ] }),
23586
- sideOffset: 4,
23587
- children
23588
- }
23589
- ),
23590
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23591
- "div",
23592
- {
23593
- className: cn(
23594
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23595
- "relative z-10"
23596
- ),
23597
- "data-status": activityStatus,
23598
- children: [
23599
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RedeemTypeCell, { activity, tone }),
23600
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
23601
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23602
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23603
- Icon,
23604
- {
23605
- name: "gift-bonus",
23606
- size: "small",
23607
- className: cn(
23608
- "shrink-0 text-agg-foreground",
23609
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23610
- )
23611
- }
23612
- ),
23613
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23614
- "p",
23615
- {
23616
- className: cn(
23617
- "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23618
- tone.primary,
23619
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23620
- ),
23621
- children: activity.type
23622
- }
23623
- )
23624
- ] }),
23625
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone })
23626
- ] }),
23627
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23628
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23629
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23630
- RemoteImage,
23631
- {
23632
- src: activity.thumbnailSrc,
23633
- alt: "",
23634
- className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
23635
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
23636
- }
23637
- ) }),
23638
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
23639
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
23640
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23641
- "p",
23642
- {
23643
- className: cn(
23644
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
23645
- tone.primary
23646
- ),
23647
- children: activity.title
23648
- }
23649
- ),
23650
- shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23651
- LoadingIcon,
23652
- {
23653
- size: "small",
23654
- className: cn("shrink-0", statusVisual.iconClassName)
23655
- }
23656
- ) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23657
- Icon,
23658
- {
23659
- name: statusVisual.icon,
23660
- size: "small",
23661
- className: cn("shrink-0", statusVisual.iconClassName)
23662
- }
23663
- ) : null
23664
- ] }),
23665
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
23666
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "hidden sm:block", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
23667
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23668
- "p",
23669
- {
23670
- className: cn(
23671
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23672
- tone.meta
23673
- ),
23674
- children: activity.marketTitle
23675
- }
23676
- )
23677
- ] })
23678
- ] })
23679
- ] }),
23680
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23681
- AmountTimeStack,
23682
- {
23683
- amountLabel: activity.amountLabel,
23684
- timeLabel: activity.timeLabel,
23685
- tone,
23686
- mobile: true
23687
- }
23688
- )
23689
- ] }),
23690
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23691
- AmountTimeStack,
23692
- {
23693
- amountLabel: activity.amountLabel,
23694
- timeLabel: activity.timeLabel,
23695
- tone
23696
- }
23697
- )
23698
- ]
23699
- }
23700
- )
23701
- }
23702
- )
23703
- }
23704
- );
23705
- };
23706
- var TradeRow = ({
23707
- activity,
23708
- className,
23709
- href,
23710
- onClick
23711
- }) => {
23712
- const tone = resolveToneClasses(activity);
23713
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23714
- ConditionalWrapper,
23715
- {
23716
- condition: !!activity.errorMessage,
23717
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23718
- Tooltip,
23719
- {
23720
- size: "medium",
23721
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23722
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23723
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23724
- ] }),
23725
- sideOffset: 4,
23726
- children
23727
- }
23728
- ),
23729
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
24106
+ children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
23730
24107
  "div",
23731
24108
  {
23732
24109
  className: cn(
23733
24110
  "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23734
24111
  "relative z-10"
23735
24112
  ),
24113
+ "data-status": activityStatus,
23736
24114
  children: [
23737
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
23738
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23739
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
23740
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24115
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(RedeemTypeCell, { activity, tone }),
24116
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
24117
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
24118
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24119
+ Icon,
24120
+ {
24121
+ name: "gift-bonus",
24122
+ size: "small",
24123
+ className: cn(
24124
+ "shrink-0 text-agg-foreground",
24125
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
24126
+ )
24127
+ }
24128
+ ),
24129
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23741
24130
  "p",
23742
24131
  {
23743
24132
  className: cn(
@@ -23749,12 +24138,11 @@ var TradeRow = ({
23749
24138
  }
23750
24139
  )
23751
24140
  ] }),
23752
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TradeOutcomeShares, { activity, tone }) })
24141
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone })
23753
24142
  ] }),
23754
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TradeTypeCell, { activity, tone }),
23755
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23756
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23757
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24143
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
24144
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
24145
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23758
24146
  RemoteImage,
23759
24147
  {
23760
24148
  src: activity.thumbnailSrc,
@@ -23763,21 +24151,49 @@ var TradeRow = ({
23763
24151
  classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
23764
24152
  }
23765
24153
  ) }),
23766
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
23767
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23768
- "p",
23769
- {
23770
- className: cn(
23771
- "agg-activity-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] sm:text-agg-base sm:leading-agg-6 sm:whitespace-nowrap sm:text-ellipsis sm:[-webkit-line-clamp:1] sm:[display:block]",
23772
- tone.primary
23773
- ),
23774
- children: activity.title
23775
- }
23776
- ),
23777
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "hidden flex-wrap items-center gap-2 sm:flex sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TradeOutcomeShares, { activity, tone }) })
24154
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
24155
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
24156
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24157
+ "p",
24158
+ {
24159
+ className: cn(
24160
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
24161
+ tone.primary
24162
+ ),
24163
+ children: activity.title
24164
+ }
24165
+ ),
24166
+ shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24167
+ LoadingIcon,
24168
+ {
24169
+ size: "small",
24170
+ className: cn("shrink-0", statusVisual.iconClassName)
24171
+ }
24172
+ ) : /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24173
+ Icon,
24174
+ {
24175
+ name: statusVisual.icon,
24176
+ size: "small",
24177
+ className: cn("shrink-0", statusVisual.iconClassName)
24178
+ }
24179
+ ) : null
24180
+ ] }),
24181
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
24182
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "hidden sm:block", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
24183
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24184
+ "p",
24185
+ {
24186
+ className: cn(
24187
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
24188
+ tone.meta
24189
+ ),
24190
+ children: activity.marketTitle
24191
+ }
24192
+ )
24193
+ ] })
23778
24194
  ] })
23779
24195
  ] }),
23780
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24196
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23781
24197
  AmountTimeStack,
23782
24198
  {
23783
24199
  amountLabel: activity.amountLabel,
@@ -23787,7 +24203,7 @@ var TradeRow = ({
23787
24203
  }
23788
24204
  )
23789
24205
  ] }),
23790
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24206
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23791
24207
  AmountTimeStack,
23792
24208
  {
23793
24209
  amountLabel: activity.amountLabel,
@@ -23799,6 +24215,86 @@ var TradeRow = ({
23799
24215
  }
23800
24216
  )
23801
24217
  }
24218
+ );
24219
+ };
24220
+ var TradeRow = ({
24221
+ activity,
24222
+ className,
24223
+ href,
24224
+ onClick
24225
+ }) => {
24226
+ const tone = resolveToneClasses(activity);
24227
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
24228
+ "div",
24229
+ {
24230
+ className: cn(
24231
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
24232
+ "relative z-10"
24233
+ ),
24234
+ children: [
24235
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
24236
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
24237
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
24238
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24239
+ "p",
24240
+ {
24241
+ className: cn(
24242
+ "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
24243
+ tone.primary,
24244
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
24245
+ ),
24246
+ children: activity.type
24247
+ }
24248
+ )
24249
+ ] }),
24250
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeOutcomeShares, { activity, tone }) })
24251
+ ] }),
24252
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeTypeCell, { activity, tone }),
24253
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
24254
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
24255
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24256
+ RemoteImage,
24257
+ {
24258
+ src: activity.thumbnailSrc,
24259
+ alt: "",
24260
+ className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
24261
+ classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
24262
+ }
24263
+ ) }),
24264
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
24265
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24266
+ "p",
24267
+ {
24268
+ className: cn(
24269
+ "agg-activity-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] sm:text-agg-base sm:leading-agg-6 sm:whitespace-nowrap sm:text-ellipsis sm:[-webkit-line-clamp:1] sm:[display:block]",
24270
+ tone.primary
24271
+ ),
24272
+ children: activity.title
24273
+ }
24274
+ ),
24275
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "hidden flex-wrap items-center gap-2 sm:flex sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeOutcomeShares, { activity, tone }) })
24276
+ ] })
24277
+ ] }),
24278
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24279
+ AmountTimeStack,
24280
+ {
24281
+ amountLabel: activity.amountLabel,
24282
+ timeLabel: activity.timeLabel,
24283
+ tone,
24284
+ mobile: true
24285
+ }
24286
+ )
24287
+ ] }),
24288
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24289
+ AmountTimeStack,
24290
+ {
24291
+ amountLabel: activity.amountLabel,
24292
+ timeLabel: activity.timeLabel,
24293
+ tone
24294
+ }
24295
+ )
24296
+ ]
24297
+ }
23802
24298
  ) });
23803
24299
  };
23804
24300
  var TransferRow = ({
@@ -23811,7 +24307,7 @@ var TransferRow = ({
23811
24307
  const transferStatus = resolveActivityStatus(activity);
23812
24308
  const transferIconName = TRANSFER_ICON[activity.kind];
23813
24309
  const statusVisual = getStatusVisual(activity);
23814
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24310
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23815
24311
  RowWrapper,
23816
24312
  {
23817
24313
  className,
@@ -23819,116 +24315,98 @@ var TransferRow = ({
23819
24315
  target: href ? "_blank" : void 0,
23820
24316
  rel: href ? "noopener noreferrer" : void 0,
23821
24317
  onClick,
23822
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23823
- ConditionalWrapper,
24318
+ children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
24319
+ "div",
23824
24320
  {
23825
- condition: !!activity.errorMessage,
23826
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23827
- Tooltip,
23828
- {
23829
- size: "medium",
23830
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23831
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23832
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23833
- ] }),
23834
- sideOffset: 4,
23835
- children
23836
- }
24321
+ className: cn(
24322
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
24323
+ "relative z-10"
23837
24324
  ),
23838
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23839
- "div",
23840
- {
23841
- className: cn(
23842
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23843
- "relative z-10"
24325
+ children: [
24326
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TransferTypeCell, { activity, tone }),
24327
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex items-center gap-2", children: [
24328
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24329
+ Icon,
24330
+ {
24331
+ name: transferIconName,
24332
+ size: "small",
24333
+ className: cn(
24334
+ "shrink-0 text-agg-foreground",
24335
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
24336
+ )
24337
+ }
23844
24338
  ),
23845
- children: [
23846
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TransferTypeCell, { activity, tone }),
23847
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23848
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23849
- Icon,
24339
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24340
+ "p",
24341
+ {
24342
+ className: cn(
24343
+ "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
24344
+ tone.primary,
24345
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
24346
+ ),
24347
+ children: activity.type
24348
+ }
24349
+ )
24350
+ ] }) }),
24351
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
24352
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
24353
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24354
+ "div",
24355
+ {
24356
+ className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
24357
+ "data-status": transferStatus,
24358
+ children: statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24359
+ Icon,
24360
+ {
24361
+ name: statusVisual.icon,
24362
+ size: "medium",
24363
+ className: cn(statusVisual.iconClassName)
24364
+ }
24365
+ )
24366
+ }
24367
+ ),
24368
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
24369
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24370
+ "p",
23850
24371
  {
23851
- name: transferIconName,
23852
- size: "small",
23853
24372
  className: cn(
23854
- "shrink-0 text-agg-foreground",
23855
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23856
- )
24373
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
24374
+ tone.primary
24375
+ ),
24376
+ children: activity.title
23857
24377
  }
23858
24378
  ),
23859
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24379
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23860
24380
  "p",
23861
24381
  {
23862
24382
  className: cn(
23863
- "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23864
- tone.primary,
23865
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23866
- ),
23867
- children: activity.type
23868
- }
23869
- )
23870
- ] }) }),
23871
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23872
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23873
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23874
- "div",
23875
- {
23876
- className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
23877
- "data-status": transferStatus,
23878
- children: statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23879
- Icon,
23880
- {
23881
- name: statusVisual.icon,
23882
- size: "medium",
23883
- className: cn(statusVisual.iconClassName)
23884
- }
23885
- )
23886
- }
23887
- ),
23888
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
23889
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23890
- "p",
23891
- {
23892
- className: cn(
23893
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
23894
- tone.primary
23895
- ),
23896
- children: activity.title
23897
- }
24383
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
24384
+ tone.meta
23898
24385
  ),
23899
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23900
- "p",
23901
- {
23902
- className: cn(
23903
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23904
- tone.meta
23905
- ),
23906
- children: activity.subtitleLabel
23907
- }
23908
- )
23909
- ] })
23910
- ] }),
23911
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23912
- AmountTimeStack,
23913
- {
23914
- amountLabel: activity.amountLabel,
23915
- timeLabel: activity.timeLabel,
23916
- tone,
23917
- mobile: true
24386
+ children: activity.subtitleLabel
23918
24387
  }
23919
24388
  )
23920
- ] }),
23921
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23922
- AmountTimeStack,
23923
- {
23924
- amountLabel: activity.amountLabel,
23925
- timeLabel: activity.timeLabel,
23926
- tone
23927
- }
23928
- )
23929
- ]
23930
- }
23931
- )
24389
+ ] })
24390
+ ] }),
24391
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24392
+ AmountTimeStack,
24393
+ {
24394
+ amountLabel: activity.amountLabel,
24395
+ timeLabel: activity.timeLabel,
24396
+ tone,
24397
+ mobile: true
24398
+ }
24399
+ )
24400
+ ] }),
24401
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24402
+ AmountTimeStack,
24403
+ {
24404
+ amountLabel: activity.amountLabel,
24405
+ timeLabel: activity.timeLabel,
24406
+ tone
24407
+ }
24408
+ )
24409
+ ]
23932
24410
  }
23933
24411
  )
23934
24412
  }
@@ -23946,10 +24424,10 @@ var ActivityRow = ({ activity, href, onClick }) => {
23946
24424
  "before:bg-agg-secondary-hover before:rounded-agg-xl"
23947
24425
  );
23948
24426
  if (activity.kind === "trade") {
23949
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
24427
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
23950
24428
  }
23951
24429
  if (activity.kind === "redeem") {
23952
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24430
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23953
24431
  RedeemRow,
23954
24432
  {
23955
24433
  activity,
@@ -23959,7 +24437,7 @@ var ActivityRow = ({ activity, href, onClick }) => {
23959
24437
  }
23960
24438
  );
23961
24439
  }
23962
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24440
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23963
24441
  TransferRow,
23964
24442
  {
23965
24443
  activity,
@@ -23972,19 +24450,19 @@ var ActivityRow = ({ activity, href, onClick }) => {
23972
24450
  ActivityRow.displayName = "ActivityRow";
23973
24451
 
23974
24452
  // src/pages/user-profile/components/empty-state.tsx
23975
- var import_jsx_runtime157 = require("react/jsx-runtime");
24453
+ var import_jsx_runtime158 = require("react/jsx-runtime");
23976
24454
  var EmptyState = ({ title: title2, description, className }) => {
23977
- return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24455
+ return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
23978
24456
  "div",
23979
24457
  {
23980
24458
  className: cn("flex flex-col items-center justify-center gap-8 p-10", className),
23981
24459
  role: "status",
23982
24460
  "aria-live": "polite",
23983
- children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
23984
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
23985
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
23986
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title2 }),
23987
- description ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal", children: description }) : null
24461
+ children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
24462
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
24463
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
24464
+ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title2 }),
24465
+ description ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal", children: description }) : null
23988
24466
  ] })
23989
24467
  ] })
23990
24468
  }
@@ -23993,8 +24471,8 @@ var EmptyState = ({ title: title2, description, className }) => {
23993
24471
  EmptyState.displayName = "EmptyState";
23994
24472
 
23995
24473
  // src/pages/user-profile/components/position-row.tsx
23996
- var import_hooks64 = require("@agg-build/hooks");
23997
- var import_jsx_runtime158 = require("react/jsx-runtime");
24474
+ var import_hooks65 = require("@agg-build/hooks");
24475
+ var import_jsx_runtime159 = require("react/jsx-runtime");
23998
24476
  var floorToTwoDecimals = (value) => {
23999
24477
  if (!Number.isFinite(value) || value <= 0) return 0;
24000
24478
  return Math.trunc(value * 100) / 100;
@@ -24007,8 +24485,8 @@ var toneTextClassName = (tone) => {
24007
24485
  if (tone === "negative") return "text-agg-error";
24008
24486
  return "text-agg-muted-foreground";
24009
24487
  };
24010
- var OutcomePill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "agg-position-outcome max-w-[120px] inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label2 }) });
24011
- var ResolutionPill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "agg-position-resolution-pill inline-flex w-full items-center justify-center overflow-hidden rounded-full bg-agg-secondary-hover px-4 py-[6px] md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label2 }) });
24488
+ var OutcomePill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "agg-position-outcome max-w-[120px] inline-flex items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label2 }) });
24489
+ var ResolutionPill = ({ label: label2 }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "agg-position-resolution-pill inline-flex w-full items-center justify-center overflow-hidden rounded-full bg-agg-secondary-hover px-4 py-[6px] md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label2 }) });
24012
24490
  var VenueShares = ({
24013
24491
  model,
24014
24492
  totalSharesLabel,
@@ -24016,26 +24494,26 @@ var VenueShares = ({
24016
24494
  keyPrefix
24017
24495
  }) => {
24018
24496
  if (!totalSharesLabel && model.venueShareBreakdown.length === 0) return null;
24019
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn(className, "gap-2"), children: [
24020
- model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex items-center gap-1", children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24497
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: cn(className, "gap-2"), children: [
24498
+ model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex items-center gap-1", children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24021
24499
  Tooltip,
24022
24500
  {
24023
- content: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: row.sharesLabel }),
24501
+ content: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: row.sharesLabel }),
24024
24502
  "aria-label": `${row.venue} shares`,
24025
24503
  side: "top",
24026
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24504
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24027
24505
  "span",
24028
24506
  {
24029
24507
  tabIndex: 0,
24030
24508
  className: "cursor-help rounded-agg-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
24031
24509
  "aria-label": `${row.venue} shares`,
24032
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
24510
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
24033
24511
  }
24034
24512
  )
24035
24513
  },
24036
24514
  `${keyPrefix}-${row.venue}-${String(index)}`
24037
24515
  )) }) : null,
24038
- totalSharesLabel ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: totalSharesLabel }) : null
24516
+ totalSharesLabel ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: totalSharesLabel }) : null
24039
24517
  ] });
24040
24518
  };
24041
24519
  var StatusBadge = ({
@@ -24044,7 +24522,7 @@ var StatusBadge = ({
24044
24522
  }) => {
24045
24523
  if (status === "lost" || status === "won_claimed") return null;
24046
24524
  const isWon = status === "won_unclaimed";
24047
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24525
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24048
24526
  "span",
24049
24527
  {
24050
24528
  className: cn(
@@ -24053,7 +24531,7 @@ var StatusBadge = ({
24053
24531
  isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-foreground"
24054
24532
  ),
24055
24533
  children: [
24056
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
24534
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
24057
24535
  isWon ? labels.won : labels.open
24058
24536
  ]
24059
24537
  }
@@ -24066,7 +24544,7 @@ var ResultBadge = ({
24066
24544
  if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
24067
24545
  const isWon = status === "won_claimed";
24068
24546
  const isSold = status === "sold";
24069
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24547
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24070
24548
  "span",
24071
24549
  {
24072
24550
  className: cn(
@@ -24075,7 +24553,7 @@ var ResultBadge = ({
24075
24553
  isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : isSold ? "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-muted-foreground" : "border-agg-error/50 bg-agg-error/10 text-agg-error"
24076
24554
  ),
24077
24555
  children: [
24078
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24556
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24079
24557
  Icon,
24080
24558
  {
24081
24559
  name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
@@ -24091,27 +24569,27 @@ var ResultBadge = ({
24091
24569
  var TotalTradedCell = ({
24092
24570
  model,
24093
24571
  className
24094
- }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24572
+ }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24095
24573
  "div",
24096
24574
  {
24097
24575
  className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
24098
24576
  children: [
24099
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
24100
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
24577
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
24578
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
24101
24579
  ]
24102
24580
  }
24103
24581
  );
24104
24582
  var PositionValueCell = ({
24105
24583
  value,
24106
24584
  className
24107
- }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24585
+ }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24108
24586
  "div",
24109
24587
  {
24110
24588
  className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
24111
24589
  children: [
24112
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24113
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
24114
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24590
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24591
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
24592
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24115
24593
  "p",
24116
24594
  {
24117
24595
  className: cn(
@@ -24122,9 +24600,9 @@ var PositionValueCell = ({
24122
24600
  }
24123
24601
  )
24124
24602
  ] }),
24125
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24126
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
24127
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24603
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24604
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
24605
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24128
24606
  "p",
24129
24607
  {
24130
24608
  className: cn(
@@ -24146,7 +24624,7 @@ var PositionRow = ({
24146
24624
  onClaim,
24147
24625
  isClaiming = false
24148
24626
  }) => {
24149
- const labels = (0, import_hooks64.useLabels)().userProfile.positions;
24627
+ const labels = (0, import_hooks65.useLabels)().userProfile.positions;
24150
24628
  const model = toPositionRowViewModel(position, {
24151
24629
  avgPrefix: labels.avgPrefix,
24152
24630
  nowPrefix: labels.nowPrefix,
@@ -24188,7 +24666,7 @@ var PositionRow = ({
24188
24666
  handleDivClick();
24189
24667
  }
24190
24668
  };
24191
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24669
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24192
24670
  "div",
24193
24671
  {
24194
24672
  className: cn(
@@ -24196,21 +24674,21 @@ var PositionRow = ({
24196
24674
  isClosed ? "md:gap-8" : "md:gap-6"
24197
24675
  ),
24198
24676
  children: [
24199
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:w-auto md:min-w-0 md:flex-1 md:justify-start md:gap-4", children: [
24200
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
24201
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24677
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:w-auto md:min-w-0 md:flex-1 md:justify-start md:gap-4", children: [
24678
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
24679
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24202
24680
  RemoteImage,
24203
24681
  {
24204
- src: (0, import_hooks64.optimizedImageUrl)(model.thumbnailSrc, 60),
24682
+ src: (0, import_hooks65.optimizedImageUrl)(model.thumbnailSrc, 60),
24205
24683
  alt: "",
24206
24684
  className: "h-full w-full rounded-agg-sm object-cover"
24207
24685
  }
24208
24686
  ) }),
24209
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
24210
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "agg-position-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] md:block md:truncate md:text-agg-base md:leading-agg-6", children: model.title }),
24211
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
24212
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }),
24213
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24687
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
24688
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-position-market min-w-0 overflow-hidden font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] md:block md:truncate md:text-agg-base md:leading-agg-6", children: model.title }),
24689
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
24690
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }),
24691
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24214
24692
  VenueShares,
24215
24693
  {
24216
24694
  model,
@@ -24222,10 +24700,10 @@ var PositionRow = ({
24222
24700
  ] })
24223
24701
  ] })
24224
24702
  ] }),
24225
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }) })
24703
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }) })
24226
24704
  ] }),
24227
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
24228
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24705
+ isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "md:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
24706
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24229
24707
  VenueShares,
24230
24708
  {
24231
24709
  model,
@@ -24234,14 +24712,14 @@ var PositionRow = ({
24234
24712
  className: "agg-position-venues flex min-w-0 flex-1 flex-wrap content-center items-center gap-x-3 gap-y-2 md:hidden"
24235
24713
  }
24236
24714
  ),
24237
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
24238
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 items-center gap-5", children: [
24239
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(TotalTradedCell, { model }),
24240
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
24715
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
24716
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 items-center gap-5", children: [
24717
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TotalTradedCell, { model }),
24718
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
24241
24719
  ] }),
24242
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
24243
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24244
- model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24720
+ isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
24721
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24722
+ model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24245
24723
  "button",
24246
24724
  {
24247
24725
  type: "button",
@@ -24250,48 +24728,48 @@ var PositionRow = ({
24250
24728
  disabled: isClaiming,
24251
24729
  "aria-busy": isClaiming || void 0,
24252
24730
  children: [
24253
- isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
24731
+ isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
24254
24732
  labels.claim
24255
24733
  ]
24256
24734
  }
24257
24735
  ) : null
24258
24736
  ] })
24259
24737
  ] }),
24260
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
24261
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(ResolutionPill, { label: model.resolutionLabel }) }),
24262
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24738
+ isClosed ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
24739
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResolutionPill, { label: model.resolutionLabel }) }),
24740
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24263
24741
  TotalTradedCell,
24264
24742
  {
24265
24743
  model,
24266
24744
  className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
24267
24745
  }
24268
24746
  ),
24269
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24747
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24270
24748
  PositionValueCell,
24271
24749
  {
24272
24750
  value: model.payout,
24273
24751
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
24274
24752
  }
24275
24753
  ),
24276
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(ResultBadge, { status: model.positionStatus, labels }) })
24277
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
24278
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24754
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ResultBadge, { status: model.positionStatus, labels }) })
24755
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
24756
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24279
24757
  TotalTradedCell,
24280
24758
  {
24281
24759
  model,
24282
24760
  className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
24283
24761
  }
24284
24762
  ),
24285
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24763
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24286
24764
  PositionValueCell,
24287
24765
  {
24288
24766
  value: model.currentValue,
24289
24767
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
24290
24768
  }
24291
24769
  ),
24292
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
24293
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24294
- model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24770
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
24771
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24772
+ model.canClaim ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24295
24773
  "button",
24296
24774
  {
24297
24775
  type: "button",
@@ -24300,14 +24778,14 @@ var PositionRow = ({
24300
24778
  disabled: isClaiming,
24301
24779
  "aria-busy": isClaiming || void 0,
24302
24780
  children: [
24303
- isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
24781
+ isClaiming ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
24304
24782
  labels.claim
24305
24783
  ]
24306
24784
  }
24307
24785
  ) : null
24308
24786
  ] })
24309
24787
  ] }),
24310
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24788
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24311
24789
  Icon,
24312
24790
  {
24313
24791
  name: "chevron-right",
@@ -24322,16 +24800,16 @@ var PositionRow = ({
24322
24800
  PositionRow.displayName = "PositionRow";
24323
24801
 
24324
24802
  // src/pages/user-profile/components/positions-activity.tsx
24325
- var import_jsx_runtime159 = require("react/jsx-runtime");
24803
+ var import_jsx_runtime160 = require("react/jsx-runtime");
24326
24804
  var tabItems = [
24327
24805
  { value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
24328
24806
  // Open orders is intentionally hidden from the user-profile tab group.
24329
24807
  // Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
24330
24808
  { value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
24331
24809
  ];
24332
- var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react43.Fragment, { children: [
24333
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
24334
- index < acc.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
24810
+ var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
24811
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
24812
+ index < acc.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
24335
24813
  ] }, index)) });
24336
24814
  var PositionsActivity = ({
24337
24815
  activePositions = [],
@@ -24362,7 +24840,7 @@ var PositionsActivity = ({
24362
24840
  initialPositionFilter = "active",
24363
24841
  className
24364
24842
  }) => {
24365
- const positionsLabels = (0, import_hooks65.useLabels)().userProfile.positions;
24843
+ const positionsLabels = (0, import_hooks66.useLabels)().userProfile.positions;
24366
24844
  const isTabControlled = tab !== void 0;
24367
24845
  const [internalActiveTab, setInternalActiveTab] = (0, import_react43.useState)(
24368
24846
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
@@ -24492,7 +24970,7 @@ var PositionsActivity = ({
24492
24970
  isLoadingMoreActivities,
24493
24971
  onLoadMoreActivities
24494
24972
  ]);
24495
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24973
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24496
24974
  "div",
24497
24975
  {
24498
24976
  className: cn(
@@ -24501,7 +24979,7 @@ var PositionsActivity = ({
24501
24979
  className
24502
24980
  ),
24503
24981
  children: [
24504
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24982
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24505
24983
  Tabs,
24506
24984
  {
24507
24985
  items: tabItems,
@@ -24515,7 +24993,7 @@ var PositionsActivity = ({
24515
24993
  }
24516
24994
  }
24517
24995
  ),
24518
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24996
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24519
24997
  "div",
24520
24998
  {
24521
24999
  className: cn(
@@ -24523,12 +25001,12 @@ var PositionsActivity = ({
24523
25001
  isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
24524
25002
  ),
24525
25003
  children: [
24526
- isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
24527
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-position-filters flex h-10 w-[45%] max-w-[169px] shrink-0 items-stretch overflow-clip rounded-agg-sm border border-agg-separator sm:w-auto sm:min-w-[200px] sm:max-w-[270px]", children: USER_PROFILE_POSITION_FILTERS.map((filter, idx) => {
25004
+ isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
25005
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-filters flex h-10 w-[45%] max-w-[169px] shrink-0 items-stretch overflow-clip rounded-agg-sm border border-agg-separator sm:w-auto sm:min-w-[200px] sm:max-w-[270px]", children: USER_PROFILE_POSITION_FILTERS.map((filter, idx) => {
24528
25006
  const isActive = filter.value === positionFilter;
24529
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-1 items-stretch", children: [
24530
- idx > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
24531
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25007
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex flex-1 items-stretch", children: [
25008
+ idx > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
25009
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24532
25010
  "button",
24533
25011
  {
24534
25012
  type: "button",
@@ -24543,7 +25021,7 @@ var PositionsActivity = ({
24543
25021
  )
24544
25022
  ] }, filter.value);
24545
25023
  }) }),
24546
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
25024
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24547
25025
  "div",
24548
25026
  {
24549
25027
  className: "agg-position-search relative flex w-full min-w-0 flex-1",
@@ -24554,9 +25032,9 @@ var PositionsActivity = ({
24554
25032
  setIsSearchFocused(false);
24555
25033
  },
24556
25034
  children: [
24557
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex h-11 w-full items-center gap-3 rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5 focus-within:border-2 focus-within:border-agg-primary sm:h-10", children: [
24558
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
24559
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25035
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex h-11 w-full items-center gap-3 rounded-agg-sm border border-agg-separator bg-agg-secondary px-3 py-2.5 focus-within:border-2 focus-within:border-agg-primary sm:h-10", children: [
25036
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
25037
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24560
25038
  "input",
24561
25039
  {
24562
25040
  value: searchValue,
@@ -24571,7 +25049,7 @@ var PositionsActivity = ({
24571
25049
  }
24572
25050
  )
24573
25051
  ] }) }),
24574
- isSearchFocused && searchValue.trim() ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "agg-position-search-results absolute left-0 right-0 top-full z-50 mt-1 w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary pt-2 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]", children: searchResults.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25052
+ isSearchFocused && searchValue.trim() ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-position-search-results absolute left-0 right-0 top-full z-50 mt-1 w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary pt-2 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]", children: searchResults.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24575
25053
  "ul",
24576
25054
  {
24577
25055
  className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
@@ -24584,26 +25062,26 @@ var PositionsActivity = ({
24584
25062
  setIsSearchFocused(false);
24585
25063
  onPositionClick == null ? void 0 : onPositionClick(item.raw);
24586
25064
  };
24587
- const innerContent = /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
24588
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
24589
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25065
+ const innerContent = /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_jsx_runtime160.Fragment, { children: [
25066
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
25067
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24590
25068
  "img",
24591
25069
  {
24592
- src: (0, import_hooks65.optimizedImageUrl)(item.thumbnailSrc, 48),
25070
+ src: (0, import_hooks66.optimizedImageUrl)(item.thumbnailSrc, 48),
24593
25071
  alt: "",
24594
25072
  className: "size-12 shrink-0 rounded-agg-lg object-cover"
24595
25073
  }
24596
25074
  ),
24597
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
24598
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground", children: item.title }),
24599
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
24600
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "shrink-0 whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaPrimary }),
24601
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
24602
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaSecondary })
25075
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
25076
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-base leading-agg-6 font-agg-normal text-agg-foreground", children: item.title }),
25077
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
25078
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "shrink-0 whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaPrimary }),
25079
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
25080
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-muted-foreground", children: item.metaSecondary })
24603
25081
  ] })
24604
25082
  ] })
24605
25083
  ] }),
24606
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25084
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24607
25085
  Icon,
24608
25086
  {
24609
25087
  name: "chevron-right",
@@ -24612,7 +25090,7 @@ var PositionsActivity = ({
24612
25090
  }
24613
25091
  )
24614
25092
  ] });
24615
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25093
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24616
25094
  "li",
24617
25095
  {
24618
25096
  role: "presentation",
@@ -24620,7 +25098,7 @@ var PositionsActivity = ({
24620
25098
  "agg-position-search-result-item",
24621
25099
  index > 0 && "border-t border-agg-separator"
24622
25100
  ),
24623
- children: itemHref ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25101
+ children: itemHref ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24624
25102
  "a",
24625
25103
  {
24626
25104
  href: itemHref,
@@ -24635,7 +25113,7 @@ var PositionsActivity = ({
24635
25113
  },
24636
25114
  children: innerContent
24637
25115
  }
24638
- ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25116
+ ) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24639
25117
  "button",
24640
25118
  {
24641
25119
  type: "button",
@@ -24649,34 +25127,34 @@ var PositionsActivity = ({
24649
25127
  );
24650
25128
  })
24651
25129
  }
24652
- ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
25130
+ ) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
24653
25131
  ]
24654
25132
  }
24655
25133
  )
24656
25134
  ] }) : null,
24657
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
24658
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "w-full px-4 sm:px-6", children: [
24659
- isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
24660
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
24661
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
24662
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
24663
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
24664
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
24665
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
24666
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
24667
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
24668
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
24669
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
24670
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
24671
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
25135
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
25136
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "w-full px-4 sm:px-6", children: [
25137
+ isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
25138
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
25139
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
25140
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
25141
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
25142
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
25143
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
25144
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
25145
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
25146
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
25147
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
25148
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
25149
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
24672
25150
  ] }) : null,
24673
- isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
24674
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
24675
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
24676
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
25151
+ isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
25152
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
25153
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
25154
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
24677
25155
  ] }) : null
24678
25156
  ] }),
24679
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25157
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24680
25158
  "div",
24681
25159
  {
24682
25160
  ref: rowsScrollRef,
@@ -24688,8 +25166,8 @@ var PositionsActivity = ({
24688
25166
  "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
24689
25167
  "[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
24690
25168
  ),
24691
- children: isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
24692
- isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25169
+ children: isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
25170
+ isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24693
25171
  EmptyState,
24694
25172
  {
24695
25173
  title: "Unable to load positions",
@@ -24697,15 +25175,15 @@ var PositionsActivity = ({
24697
25175
  }
24698
25176
  ) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
24699
25177
  var _a;
24700
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react43.Fragment, { children: [
24701
- index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25178
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
25179
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24702
25180
  "div",
24703
25181
  {
24704
25182
  className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
24705
25183
  "aria-hidden": true
24706
25184
  }
24707
25185
  ) : null,
24708
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25186
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24709
25187
  PositionRow,
24710
25188
  {
24711
25189
  position,
@@ -24719,15 +25197,15 @@ var PositionsActivity = ({
24719
25197
  }
24720
25198
  )
24721
25199
  ] }, position.id);
24722
- }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25200
+ }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24723
25201
  EmptyState,
24724
25202
  {
24725
25203
  title: "No positions yet",
24726
25204
  description: "Your open trades will appear here once you place an order."
24727
25205
  }
24728
25206
  ),
24729
- isLoadingMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
24730
- hasMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25207
+ isLoadingMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
25208
+ hasMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24731
25209
  "div",
24732
25210
  {
24733
25211
  ref: positionsLoadMoreRef,
@@ -24735,22 +25213,22 @@ var PositionsActivity = ({
24735
25213
  "aria-hidden": true
24736
25214
  }
24737
25215
  ) : null
24738
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-activity-list flex flex-col gap-5", children: [
24739
- isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25216
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "agg-activity-list flex flex-col gap-5", children: [
25217
+ isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24740
25218
  EmptyState,
24741
25219
  {
24742
25220
  title: "Unable to load activity",
24743
25221
  description: "Please try again in a moment."
24744
25222
  }
24745
- ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react43.Fragment, { children: [
24746
- index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25223
+ ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_react43.Fragment, { children: [
25224
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24747
25225
  "div",
24748
25226
  {
24749
25227
  className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
24750
25228
  "aria-hidden": true
24751
25229
  }
24752
25230
  ) : null,
24753
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25231
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24754
25232
  ActivityRow,
24755
25233
  {
24756
25234
  activity,
@@ -24758,15 +25236,15 @@ var PositionsActivity = ({
24758
25236
  onClick: onActivityClick
24759
25237
  }
24760
25238
  )
24761
- ] }, activity.id)) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25239
+ ] }, activity.id)) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24762
25240
  EmptyState,
24763
25241
  {
24764
25242
  title: "No activity yet",
24765
25243
  description: "Your trading activity will appear here."
24766
25244
  }
24767
25245
  ),
24768
- isLoadingMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
24769
- hasMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25246
+ isLoadingMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
25247
+ hasMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24770
25248
  "div",
24771
25249
  {
24772
25250
  ref: activitiesLoadMoreRef,
@@ -24788,14 +25266,14 @@ var PositionsActivity = ({
24788
25266
  PositionsActivity.displayName = "PositionsActivity";
24789
25267
 
24790
25268
  // src/pages/user-profile/components/positions-value-card.tsx
24791
- var import_jsx_runtime160 = require("react/jsx-runtime");
25269
+ var import_jsx_runtime161 = require("react/jsx-runtime");
24792
25270
  var PositionsValueCard = ({
24793
25271
  label: label2 = "Positions Value",
24794
25272
  valueLabel,
24795
25273
  isLoading = false,
24796
25274
  className
24797
25275
  }) => {
24798
- return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
25276
+ return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
24799
25277
  "div",
24800
25278
  {
24801
25279
  className: cn(
@@ -24804,8 +25282,8 @@ var PositionsValueCard = ({
24804
25282
  className
24805
25283
  ),
24806
25284
  children: [
24807
- /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex items-center gap-2", children: [
24808
- /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
25285
+ /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "flex items-center gap-2", children: [
25286
+ /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
24809
25287
  "svg",
24810
25288
  {
24811
25289
  xmlns: "http://www.w3.org/2000/svg",
@@ -24813,7 +25291,7 @@ var PositionsValueCard = ({
24813
25291
  height: "16",
24814
25292
  viewBox: "0 0 16 16",
24815
25293
  fill: "none",
24816
- children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
25294
+ children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
24817
25295
  "path",
24818
25296
  {
24819
25297
  d: "M16 7.99957C16 8.36757 15.702 8.66623 15.3333 8.66623H13.6893C13.388 8.66623 13.1233 8.86957 13.0453 9.15957L11.9273 13.3209C11.8 13.7376 11.444 13.9996 11.0333 13.9996H11.022C10.6067 13.9949 10.252 13.7229 10.1393 13.3236L7.95667 4.50623L5.838 11.9989C5.71067 12.3969 5.378 12.6496 4.98467 12.6649C4.57667 12.6869 4.23867 12.4549 4.088 12.0902L3.02133 9.10757C2.926 8.84357 2.674 8.66557 2.39333 8.66557H0.666667C0.298 8.66557 0 8.3669 0 7.9989C0 7.6309 0.298 7.33223 0.666667 7.33223H2.394C3.23667 7.33223 3.99267 7.8649 4.27733 8.65823L4.90267 10.4089L7.092 2.66557C7.226 2.2489 7.57667 1.9809 7.99933 1.9989C8.41133 2.00623 8.76333 2.27757 8.876 2.67357L11.0487 11.4509L11.7567 8.81357C11.9907 7.94157 12.7847 7.33223 13.688 7.33223H15.332C15.7007 7.33223 15.9987 7.6309 15.9987 7.9989L16 7.99957Z",
@@ -24822,22 +25300,51 @@ var PositionsValueCard = ({
24822
25300
  )
24823
25301
  }
24824
25302
  ),
24825
- /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label2 })
25303
+ /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label2 })
24826
25304
  ] }),
24827
- /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
25305
+ /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
24828
25306
  ]
24829
25307
  }
24830
25308
  );
24831
25309
  };
24832
25310
  PositionsValueCard.displayName = "PositionsValueCard";
24833
25311
 
25312
+ // src/pages/user-profile/transaction-explorer.ts
25313
+ var AGG_TX_EXPLORER_URLS = {
25314
+ "1": "https://etherscan.io/tx/",
25315
+ "56": "https://bscscan.com/tx/",
25316
+ "137": "https://polygonscan.com/tx/",
25317
+ "1337": "https://app.hyperliquid.xyz/explorer/tx/",
25318
+ "8453": "https://basescan.org/tx/",
25319
+ "42161": "https://arbiscan.io/tx/",
25320
+ "792703809": "https://solscan.io/tx/"
25321
+ };
25322
+ var buildAggTxExplorerHref = (chainId, txHash) => {
25323
+ if (chainId === null || chainId === void 0) return void 0;
25324
+ if (!txHash) return void 0;
25325
+ const normalizedChainId = String(chainId).trim();
25326
+ const normalizedTxHash = txHash.trim();
25327
+ if (!normalizedChainId || !normalizedTxHash) return void 0;
25328
+ const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
25329
+ if (!baseUrl) return void 0;
25330
+ return `${baseUrl}${normalizedTxHash}`;
25331
+ };
25332
+
24834
25333
  // src/pages/user-profile/components/user-info-card.tsx
24835
- var import_hooks66 = require("@agg-build/hooks");
25334
+ var import_hooks67 = require("@agg-build/hooks");
25335
+
25336
+ // src/primitives/conditional-wrapper.tsx
25337
+ var ConditionalWrapper = ({
25338
+ condition,
25339
+ wrapper,
25340
+ children
25341
+ }) => condition ? wrapper(children) : children;
25342
+ ConditionalWrapper.displayName = "ConditionalWrapper";
24836
25343
 
24837
25344
  // src/pages/user-profile/components/default-avatar.tsx
24838
- var import_jsx_runtime161 = require("react/jsx-runtime");
25345
+ var import_jsx_runtime162 = require("react/jsx-runtime");
24839
25346
  var DefaultAvatar = ({ className }) => {
24840
- return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
25347
+ return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
24841
25348
  "svg",
24842
25349
  {
24843
25350
  xmlns: "http://www.w3.org/2000/svg",
@@ -24848,15 +25355,15 @@ var DefaultAvatar = ({ className }) => {
24848
25355
  className: cn("shrink-0 text-agg-muted-foreground", className),
24849
25356
  "aria-hidden": true,
24850
25357
  children: [
24851
- /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("g", { clipPath: "url(#clip0_default_avatar)", children: [
24852
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
25358
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("g", { clipPath: "url(#clip0_default_avatar)", children: [
25359
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
24853
25360
  "path",
24854
25361
  {
24855
25362
  d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
24856
25363
  fill: "var(--agg-color-secondary-hover)"
24857
25364
  }
24858
25365
  ),
24859
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
25366
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
24860
25367
  "path",
24861
25368
  {
24862
25369
  d: "M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z",
@@ -24864,7 +25371,7 @@ var DefaultAvatar = ({ className }) => {
24864
25371
  fillOpacity: "0.12"
24865
25372
  }
24866
25373
  ),
24867
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
25374
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
24868
25375
  "path",
24869
25376
  {
24870
25377
  d: "M73.7338 64.1259C80.4187 59.6756 84.8276 52.0804 84.8276 43.4487C84.8276 29.7376 73.7111 18.6211 60 18.6211C46.2890 18.6211 35.1724 29.7376 35.1724 43.4487C35.1724 52.0804 39.5814 59.6756 46.2662 64.1259C46.2662 64.1259 46.2683 64.1280 46.2704 64.1280C46.2683 64.1280 46.2683 64.1259 46.2683 64.1259C30.2669 68.9487 17.8076 81.9356 13.7959 98.2742L13.7980 98.2763C14.4518 99.0645 15.1304 99.8342 15.8235 100.589C15.9911 100.774 16.1669 100.949 16.3387 101.129C16.8724 101.696 17.4124 102.255 17.9669 102.801C18.1966 103.027 18.4304 103.244 18.6642 103.465C19.1773 103.954 19.6966 104.436 20.2262 104.905C20.4890 105.137 20.7559 105.367 21.0207 105.594C21.5400 106.039 22.0656 106.476 22.6014 106.902C22.8828 107.127 23.1662 107.349 23.4497 107.570C23.9918 107.988 24.5421 108.394 25.0987 108.791C25.3862 108.996 25.6697 109.205 25.9614 109.405C26.5490 109.811 27.1469 110.200 27.7490 110.585C28.0200 110.756 28.2849 110.934 28.5580 111.104C29.2531 111.532 29.9607 111.942 30.6745 112.343C30.8628 112.449 31.0469 112.562 31.2373 112.666C32.1600 113.171 33.0973 113.655 34.0490 114.112C34.0718 114.122 34.0966 114.133 34.1193 114.143C35.0276 114.578 35.9504 114.989 36.8835 115.378C37.1731 115.500 37.4690 115.608 37.7607 115.724C38.4352 115.993 39.1097 116.258 39.7966 116.502C40.1607 116.632 40.5290 116.750 40.8952 116.874C41.5200 117.085 42.1490 117.290 42.7821 117.478C43.1835 117.598 43.5869 117.710 43.9924 117.822C44.6049 117.991 45.2214 118.153 45.8442 118.304C46.2642 118.405 46.6862 118.502 47.1104 118.596C47.7331 118.732 48.3580 118.856 48.9869 118.972C49.4131 119.051 49.8373 119.131 50.2676 119.200C50.9173 119.305 51.5711 119.394 52.2269 119.479C52.6407 119.533 53.0524 119.593 53.4683 119.636C54.1924 119.715 54.9228 119.771 55.6531 119.822C56.0069 119.847 56.3566 119.885 56.7104 119.903C57.8007 119.965 58.8952 120 60 120C61.1049 120 62.1993 119.965 63.2897 119.907C63.6435 119.889 63.9952 119.851 64.3469 119.827C65.0793 119.775 65.8097 119.719 66.5318 119.640C66.9476 119.595 67.3593 119.537 67.7731 119.483C68.4290 119.398 69.0828 119.309 69.7324 119.204C70.1607 119.134 70.5869 119.055 71.0131 118.976C71.6421 118.860 72.2690 118.736 72.8897 118.600C73.3138 118.507 73.7359 118.409 74.1559 118.308C74.7766 118.157 75.3931 117.996 76.0076 117.826C76.4111 117.714 76.8166 117.602 77.2180 117.482C77.8531 117.292 78.4800 117.087 79.1049 116.878C79.4711 116.754 79.8414 116.636 80.2035 116.506C80.8883 116.260 81.5649 115.997 82.2393 115.728C82.5311 115.612 82.8269 115.502 83.1166 115.382C84.0456 114.994 84.9642 114.586 85.8683 114.151C85.8952 114.139 85.9242 114.127 85.9511 114.114C86.9028 113.657 87.8400 113.173 88.7628 112.668C88.9531 112.565 89.1373 112.451 89.3256 112.345C90.0393 111.944 90.7469 111.534 91.4421 111.106C91.7152 110.938 91.9821 110.760 92.2511 110.587C92.8531 110.202 93.4511 109.811 94.0387 109.407C94.3283 109.207 94.6138 109.000 94.9014 108.793C95.4580 108.394 96.0083 107.988 96.5504 107.572C96.8359 107.353 97.1173 107.129 97.3987 106.904C97.9324 106.478 98.4600 106.041 98.9793 105.596C99.2462 105.369 99.5131 105.139 99.7738 104.907C100.303 104.438 100.823 103.956 101.336 103.467C101.568 103.246 101.803 103.027 102.033 102.803C102.588 102.257 103.130 101.698 103.661 101.131C103.831 100.949 104.007 100.774 104.177 100.591C104.870 99.8363 105.548 99.0666 106.202 98.2783L106.204 98.2763C102.195 81.9356 89.7352 68.9487 73.7338 64.1259Z",
@@ -24873,7 +25380,7 @@ var DefaultAvatar = ({ className }) => {
24873
25380
  }
24874
25381
  )
24875
25382
  ] }),
24876
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("rect", { width: "120", height: "120", fill: "white" }) }) })
25383
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("rect", { width: "120", height: "120", fill: "white" }) }) })
24877
25384
  ]
24878
25385
  }
24879
25386
  );
@@ -24881,7 +25388,7 @@ var DefaultAvatar = ({ className }) => {
24881
25388
  DefaultAvatar.displayName = "DefaultAvatar";
24882
25389
 
24883
25390
  // src/pages/user-profile/components/user-info-card.tsx
24884
- var import_jsx_runtime162 = require("react/jsx-runtime");
25391
+ var import_jsx_runtime163 = require("react/jsx-runtime");
24885
25392
  var UserInfoCard = ({
24886
25393
  user,
24887
25394
  onEditProfile,
@@ -24891,10 +25398,10 @@ var UserInfoCard = ({
24891
25398
  className
24892
25399
  }) => {
24893
25400
  var _a;
24894
- const labels = (0, import_hooks66.useLabels)();
25401
+ const labels = (0, import_hooks67.useLabels)();
24895
25402
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
24896
25403
  const hasWallets = wallets.length > 0;
24897
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25404
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
24898
25405
  "div",
24899
25406
  {
24900
25407
  className: cn(
@@ -24903,26 +25410,26 @@ var UserInfoCard = ({
24903
25410
  className
24904
25411
  ),
24905
25412
  children: [
24906
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
24907
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25413
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
25414
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24908
25415
  RemoteImage,
24909
25416
  {
24910
- src: (0, import_hooks66.optimizedImageUrl)(user.avatarUrl, 120),
25417
+ src: (0, import_hooks67.optimizedImageUrl)(user.avatarUrl, 120),
24911
25418
  alt: user.username,
24912
25419
  className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
24913
25420
  }
24914
- ) : /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
24915
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
24916
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
24917
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
24918
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
24919
- user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
25421
+ ) : /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
25422
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
25423
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
25424
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
25425
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
25426
+ user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
24920
25427
  const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
24921
- const iconNode = /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-agg-separator bg-agg-secondary sm:size-8", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
25428
+ const iconNode = /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-full border border-agg-separator bg-agg-secondary sm:size-8", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
24922
25429
  if (!social.handle) {
24923
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { children: iconNode }, `${social.platform}-icon`);
25430
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { children: iconNode }, `${social.platform}-icon`);
24924
25431
  }
24925
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25432
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24926
25433
  "a",
24927
25434
  {
24928
25435
  href: social.handle,
@@ -24935,55 +25442,55 @@ var UserInfoCard = ({
24935
25442
  );
24936
25443
  }) }) : null
24937
25444
  ] }),
24938
- onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25445
+ onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
24939
25446
  "button",
24940
25447
  {
24941
25448
  type: "button",
24942
25449
  onClick: onEditProfile,
24943
25450
  className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
24944
25451
  children: [
24945
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
24946
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
25452
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
25453
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
24947
25454
  ]
24948
25455
  }
24949
25456
  ) : null
24950
25457
  ] }),
24951
- hasWallets || !!user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
25458
+ hasWallets || !!user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
24952
25459
  wallets.map((wallet, idx) => {
24953
25460
  const chainLower = wallet.chain.toLowerCase();
24954
25461
  const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
24955
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25462
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
24956
25463
  "div",
24957
25464
  {
24958
25465
  className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
24959
25466
  children: [
24960
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
24961
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: wallet.displayAddress })
25467
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
25468
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: wallet.displayAddress })
24962
25469
  ]
24963
25470
  },
24964
25471
  `wallet-${idx}`
24965
25472
  );
24966
25473
  }),
24967
- user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: user.socialHandle }) }) : null
25474
+ user.socialHandle ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "min-w-0 truncate text-agg-sm font-agg-normal leading-5 text-agg-foreground sm:text-agg-base sm:leading-6", children: user.socialHandle }) }) : null
24968
25475
  ] }) : null
24969
25476
  ] })
24970
25477
  ] }),
24971
- (onDeposit || onWithdraw) && /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
24972
- onDeposit ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25478
+ (onDeposit || onWithdraw) && /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
25479
+ onDeposit ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24973
25480
  ConditionalWrapper,
24974
25481
  {
24975
25482
  condition: isDepositBlocked,
24976
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25483
+ wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24977
25484
  Tooltip,
24978
25485
  {
24979
- content: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
25486
+ content: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
24980
25487
  size: "small",
24981
25488
  side: "bottom",
24982
25489
  sideOffset: 4,
24983
25490
  children
24984
25491
  }
24985
25492
  ),
24986
- children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25493
+ children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24987
25494
  Button,
24988
25495
  __spreadProps(__spreadValues({
24989
25496
  variant: "primary",
@@ -24995,7 +25502,7 @@ var UserInfoCard = ({
24995
25502
  )
24996
25503
  }
24997
25504
  ) : null,
24998
- onWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25505
+ onWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
24999
25506
  Button,
25000
25507
  {
25001
25508
  variant: "secondary",
@@ -25005,15 +25512,15 @@ var UserInfoCard = ({
25005
25512
  children: labels.auth.withdraw
25006
25513
  }
25007
25514
  ) : null,
25008
- onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25515
+ onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
25009
25516
  "button",
25010
25517
  {
25011
25518
  type: "button",
25012
25519
  onClick: onEditProfile,
25013
25520
  className: "flex sm:hidden shrink-0 cursor-pointer items-center gap-1.5 bg-transparent px-2 py-2 text-agg-primary hover:opacity-80",
25014
25521
  children: [
25015
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
25016
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
25522
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
25523
+ /* @__PURE__ */ (0, import_jsx_runtime163.jsx)("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
25017
25524
  ]
25018
25525
  }
25019
25526
  ) : null
@@ -25024,29 +25531,8 @@ var UserInfoCard = ({
25024
25531
  };
25025
25532
  UserInfoCard.displayName = "UserInfoCard";
25026
25533
 
25027
- // src/pages/user-profile/transaction-explorer.ts
25028
- var AGG_TX_EXPLORER_URLS = {
25029
- "1": "https://etherscan.io/tx/",
25030
- "56": "https://bscscan.com/tx/",
25031
- "137": "https://polygonscan.com/tx/",
25032
- "1337": "https://app.hyperliquid.xyz/explorer/tx/",
25033
- "8453": "https://basescan.org/tx/",
25034
- "42161": "https://arbiscan.io/tx/",
25035
- "792703809": "https://solscan.io/tx/"
25036
- };
25037
- var buildAggTxExplorerHref = (chainId, txHash) => {
25038
- if (chainId === null || chainId === void 0) return void 0;
25039
- if (!txHash) return void 0;
25040
- const normalizedChainId = String(chainId).trim();
25041
- const normalizedTxHash = txHash.trim();
25042
- if (!normalizedChainId || !normalizedTxHash) return void 0;
25043
- const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
25044
- if (!baseUrl) return void 0;
25045
- return `${baseUrl}${normalizedTxHash}`;
25046
- };
25047
-
25048
25534
  // src/pages/user-profile/index.tsx
25049
- var import_jsx_runtime163 = require("react/jsx-runtime");
25535
+ var import_jsx_runtime164 = require("react/jsx-runtime");
25050
25536
  var currencyFormatter = new Intl.NumberFormat("en-US", {
25051
25537
  style: "currency",
25052
25538
  currency: "USD",
@@ -25377,11 +25863,49 @@ var toRedeemPayoutAmountLabel = (item) => {
25377
25863
  sign: "+"
25378
25864
  });
25379
25865
  };
25866
+ var toRedeemTransactionAmountLabel = ({
25867
+ leg,
25868
+ totalPayoutRaw,
25869
+ legCount
25870
+ }) => {
25871
+ var _a;
25872
+ if (legCount === 1 && totalPayoutRaw != null) {
25873
+ return `+${formatScaledNumberTwoDecimals(totalPayoutRaw)} ${leg.payoutTokenSymbol || "USDC"}`;
25874
+ }
25875
+ return toTokenAmountLabel({
25876
+ amountRaw: (_a = leg.payoutAmountRaw) != null ? _a : "0",
25877
+ tokenSymbol: leg.payoutTokenSymbol || "USDC",
25878
+ chainId: leg.chainId,
25879
+ sign: "+"
25880
+ });
25881
+ };
25882
+ var toRedeemTransactions = (item) => {
25883
+ const legs = Array.isArray(item.legs) ? item.legs : [];
25884
+ return legs.map((leg) => {
25885
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
25886
+ return {
25887
+ id: leg.id,
25888
+ venue: leg.venue,
25889
+ chainId: (_a = leg.chainId) != null ? _a : void 0,
25890
+ txHash: (_b = leg.txHash) != null ? _b : void 0,
25891
+ marketTitle: (_d = (_c = leg.venueMarket) == null ? void 0 : _c.question) != null ? _d : "Market",
25892
+ outcomeLabel: (_h = (_g = (_e = leg.venueMarketOutcome) == null ? void 0 : _e.title) != null ? _g : (_f = leg.venueMarketOutcome) == null ? void 0 : _f.label) != null ? _h : "",
25893
+ amountLabel: toRedeemTransactionAmountLabel({
25894
+ leg,
25895
+ totalPayoutRaw: item.totalPayoutRaw,
25896
+ legCount: legs.length
25897
+ }),
25898
+ transactionLabel: (_j = (_i = shortenAddress(leg.txHash)) != null ? _i : leg.txHash) != null ? _j : "Transaction",
25899
+ errorMessage: (_k = leg.errorMessage) != null ? _k : void 0,
25900
+ hasError: TRANSFER_FAILED_STATUSES.has(leg.status.toLowerCase()) || Boolean((_l = leg.errorMessage) == null ? void 0 : _l.trim())
25901
+ };
25902
+ });
25903
+ };
25380
25904
  var POSITION_ROW_VENUE_ORDER = [
25381
- import_sdk19.Venue.polymarket,
25382
- import_sdk19.Venue.kalshi,
25383
- import_sdk19.Venue.opinion,
25384
- import_sdk19.Venue.limitless
25905
+ import_sdk20.Venue.polymarket,
25906
+ import_sdk20.Venue.kalshi,
25907
+ import_sdk20.Venue.opinion,
25908
+ import_sdk20.Venue.limitless
25385
25909
  ];
25386
25910
  function venueBreakdownSortKey(venue) {
25387
25911
  const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
@@ -25456,15 +25980,15 @@ var UserProfilePage = ({
25456
25980
  (0, import_react44.useEffect)(() => {
25457
25981
  setIsHydrated(true);
25458
25982
  }, []);
25459
- const { user: currentUser, isAuthenticated } = (0, import_hooks67.useAggAuthState)();
25460
- const { isDepositBlocked } = (0, import_hooks67.useGeoBlock)();
25461
- const balanceState = (0, import_hooks67.useAggBalance)();
25462
- const client = (0, import_hooks67.useAggClient)();
25463
- const labels = (0, import_hooks67.useLabels)();
25983
+ const { user: currentUser, isAuthenticated } = (0, import_hooks68.useAggAuthState)();
25984
+ const { isDepositBlocked } = (0, import_hooks68.useGeoBlock)();
25985
+ const balanceState = (0, import_hooks68.useAggBalance)();
25986
+ const client = (0, import_hooks68.useAggClient)();
25987
+ const labels = (0, import_hooks68.useLabels)();
25464
25988
  const {
25465
25989
  trading: { executionMode: configuredExecutionMode }
25466
- } = (0, import_hooks67.useSdkUiConfig)();
25467
- const queryClient = (0, import_hooks67.useQueryClient)();
25990
+ } = (0, import_hooks68.useSdkUiConfig)();
25991
+ const queryClient = (0, import_hooks68.useQueryClient)();
25468
25992
  const [internalCancellingIds, setInternalCancellingIds] = (0, import_react44.useState)({});
25469
25993
  const { claim: startClaim, claimingKeys } = useClaimWinnings({
25470
25994
  onClaim,
@@ -25481,15 +26005,16 @@ var UserProfilePage = ({
25481
26005
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
25482
26006
  }, [balanceState, shouldUseHookData]);
25483
26007
  const [positionFilter, setPositionFilter] = (0, import_react44.useState)(initialPositionFilter);
26008
+ const [selectedClaimActivity, setSelectedClaimActivity] = (0, import_react44.useState)(null);
25484
26009
  const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
25485
26010
  const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
25486
- const activePositionsQuery = (0, import_hooks67.useExecutionPositions)({
26011
+ const activePositionsQuery = (0, import_hooks68.useExecutionPositions)({
25487
26012
  enabled: shouldUseHookData && isAuthenticated,
25488
26013
  status: "active",
25489
26014
  limit: 25,
25490
26015
  mode: queryExecutionMode
25491
26016
  });
25492
- const closedPositionsQuery = (0, import_hooks67.useExecutionPositions)({
26017
+ const closedPositionsQuery = (0, import_hooks68.useExecutionPositions)({
25493
26018
  enabled: shouldUseHookData && isAuthenticated,
25494
26019
  status: "closed",
25495
26020
  limit: 25,
@@ -25505,12 +26030,12 @@ var UserProfilePage = ({
25505
26030
  (0, import_react44.useEffect)(() => {
25506
26031
  setPositionFilter(initialPositionFilter);
25507
26032
  }, [initialPositionFilter]);
25508
- const ordersQuery = (0, import_hooks67.useExecutionOrders)({
26033
+ const ordersQuery = (0, import_hooks68.useExecutionOrders)({
25509
26034
  enabled: shouldUseHookData && isAuthenticated,
25510
26035
  limit: 25,
25511
26036
  mode: queryExecutionMode
25512
26037
  });
25513
- const activityQuery = (0, import_hooks67.useUserActivity)({
26038
+ const activityQuery = (0, import_hooks68.useUserActivity)({
25514
26039
  enabled: shouldUseHookData && isAuthenticated,
25515
26040
  limit: 25
25516
26041
  });
@@ -25545,6 +26070,22 @@ var UserProfilePage = ({
25545
26070
  },
25546
26071
  [startClaim]
25547
26072
  );
26073
+ const handleActivityRowClick = (0, import_react44.useCallback)(
26074
+ (activity) => {
26075
+ if (activity.kind === "redeem") {
26076
+ setSelectedClaimActivity(activity);
26077
+ return;
26078
+ }
26079
+ onActivityClick == null ? void 0 : onActivityClick(activity);
26080
+ },
26081
+ [onActivityClick]
26082
+ );
26083
+ const handleClaimTransactionSelect = (0, import_react44.useCallback)((transaction) => {
26084
+ const href = buildAggTxExplorerHref(transaction.chainId, transaction.txHash);
26085
+ setSelectedClaimActivity(null);
26086
+ if (!href || typeof window === "undefined") return;
26087
+ window.open(href, "_blank", "noopener,noreferrer");
26088
+ }, []);
25548
26089
  (0, import_react44.useEffect)(() => {
25549
26090
  if (!shouldUseHookData || !isAuthenticated) {
25550
26091
  setProfileUser(void 0);
@@ -25568,7 +26109,7 @@ var UserProfilePage = ({
25568
26109
  var _a, _b, _c, _d, _e, _f;
25569
26110
  if (user) return user;
25570
26111
  const fullUser = profileUser != null ? profileUser : currentUser;
25571
- const walletAddress = (0, import_hooks67.getWalletAddressFromUserProfile)(fullUser);
26112
+ const walletAddress = (0, import_hooks68.getWalletAddressFromUserProfile)(fullUser);
25572
26113
  const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
25573
26114
  const twitterAccount = (_a = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a.find(
25574
26115
  (account) => String(account.provider).toLowerCase() === "twitter"
@@ -25738,6 +26279,7 @@ var UserProfilePage = ({
25738
26279
  const isFailed = status === "failed";
25739
26280
  const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
25740
26281
  const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
26282
+ const transactions = toRedeemTransactions(redeemItem);
25741
26283
  return {
25742
26284
  kind: "redeem",
25743
26285
  id: redeemItem.id,
@@ -25753,7 +26295,8 @@ var UserProfilePage = ({
25753
26295
  marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
25754
26296
  outcomeLabel: (_G = (_F = (_D = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _D.title) != null ? _F : (_E = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _E.label) != null ? _G : "",
25755
26297
  amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
25756
- timeLabel
26298
+ timeLabel,
26299
+ transactions
25757
26300
  };
25758
26301
  }
25759
26302
  logUnknownActivityType(item);
@@ -25790,7 +26333,7 @@ var UserProfilePage = ({
25790
26333
  (groups) => {
25791
26334
  return groups.flatMap((group) => {
25792
26335
  var _a, _b, _c, _d;
25793
- const closedTotals = (0, import_hooks67.computeClosedPositionTotals)(group);
26336
+ const closedTotals = (0, import_hooks68.computeClosedPositionTotals)(group);
25794
26337
  const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
25795
26338
  (outcome) => outcome.winner === true
25796
26339
  );
@@ -25864,7 +26407,7 @@ var UserProfilePage = ({
25864
26407
  const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
25865
26408
  return source.filter(shouldIncludeByShares);
25866
26409
  }, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
25867
- return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(AggErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26410
+ return /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(AggErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25868
26411
  "section",
25869
26412
  {
25870
26413
  className: cn(
@@ -25872,7 +26415,7 @@ var UserProfilePage = ({
25872
26415
  "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
25873
26416
  classNames == null ? void 0 : classNames.root
25874
26417
  ),
25875
- children: /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
26418
+ children: /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
25876
26419
  "div",
25877
26420
  {
25878
26421
  className: cn(
@@ -25882,8 +26425,8 @@ var UserProfilePage = ({
25882
26425
  classNames == null ? void 0 : classNames.topRow
25883
26426
  ),
25884
26427
  children: [
25885
- /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { className: "agg-profile-summary grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(300px,420px)] lg:items-stretch lg:gap-8", children: [
25886
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26428
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)("div", { className: "agg-profile-summary grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(300px,420px)] lg:items-stretch lg:gap-8", children: [
26429
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25887
26430
  "div",
25888
26431
  {
25889
26432
  className: cn(
@@ -25891,7 +26434,7 @@ var UserProfilePage = ({
25891
26434
  "flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
25892
26435
  classNames == null ? void 0 : classNames.leftColumn
25893
26436
  ),
25894
- children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26437
+ children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25895
26438
  UserInfoCard,
25896
26439
  {
25897
26440
  user: resolvedUser,
@@ -25904,7 +26447,7 @@ var UserProfilePage = ({
25904
26447
  )
25905
26448
  }
25906
26449
  ),
25907
- /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
26450
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
25908
26451
  "div",
25909
26452
  {
25910
26453
  className: cn(
@@ -25912,14 +26455,14 @@ var UserProfilePage = ({
25912
26455
  classNames == null ? void 0 : classNames.rightColumn
25913
26456
  ),
25914
26457
  children: [
25915
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26458
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25916
26459
  PositionsValueCard,
25917
26460
  {
25918
26461
  valueLabel: positionsValueLabel,
25919
26462
  isLoading: isPositionsValueLoading
25920
26463
  }
25921
26464
  ),
25922
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26465
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25923
26466
  AvailableBalanceCard,
25924
26467
  {
25925
26468
  valueLabel: availableBalanceLabel,
@@ -25937,7 +26480,7 @@ var UserProfilePage = ({
25937
26480
  }
25938
26481
  )
25939
26482
  ] }),
25940
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26483
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25941
26484
  PositionsActivity,
25942
26485
  {
25943
26486
  tab,
@@ -25950,8 +26493,11 @@ var UserProfilePage = ({
25950
26493
  getPositionHref,
25951
26494
  onClaim: handleClaimPosition,
25952
26495
  claimingPositionKeys: claimingKeys,
25953
- onActivityClick,
25954
- getActivityHref,
26496
+ onActivityClick: handleActivityRowClick,
26497
+ getActivityHref: (activity) => {
26498
+ if (activity.kind === "redeem") return void 0;
26499
+ return getActivityHref == null ? void 0 : getActivityHref(activity);
26500
+ },
25955
26501
  onOpenOrderClick,
25956
26502
  onCancelOrder: handleCancelOrder,
25957
26503
  cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
@@ -25985,6 +26531,17 @@ var UserProfilePage = ({
25985
26531
  } : void 0,
25986
26532
  className: classNames == null ? void 0 : classNames.positionsActivity
25987
26533
  }
26534
+ ),
26535
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
26536
+ ClaimActivityBreakdownModal,
26537
+ {
26538
+ activity: selectedClaimActivity,
26539
+ onOpenChange: (open) => {
26540
+ if (open) return;
26541
+ setSelectedClaimActivity(null);
26542
+ },
26543
+ onTransactionSelect: handleClaimTransactionSelect
26544
+ }
25988
26545
  )
25989
26546
  ]
25990
26547
  }