@agg-build/ui 2.2.0 → 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 (42) hide show
  1. package/dist/{chunk-5MRFY5ZQ.mjs → chunk-4QGZ3FWI.mjs} +1 -1
  2. package/dist/{chunk-DTOI4V6P.mjs → chunk-JGBEQ4IV.mjs} +1151 -953
  3. package/dist/{chunk-73MO7MYG.mjs → chunk-JOZPXDNZ.mjs} +30 -7
  4. package/dist/{chunk-TR7HUVY7.mjs → chunk-LPIAEKSZ.mjs} +82 -2
  5. package/dist/{chunk-BTRFSEPC.mjs → chunk-QM3WWPCV.mjs} +107 -29
  6. package/dist/{chunk-MIAAL7BL.mjs → chunk-UTXQUOU3.mjs} +98 -4
  7. package/dist/{chunk-HNLA44SY.mjs → chunk-ZRYHWHTD.mjs} +2 -2
  8. package/dist/events.js +277 -31
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +1999 -1533
  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 +1371 -907
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +4 -3
  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 +114 -6
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/events/item/event-list-item.types.d.mts +4 -0
  23. package/dist/types/events/item/event-list-item.types.d.ts +4 -0
  24. package/dist/types/events/item/event-list-item.utils.d.mts +1 -1
  25. package/dist/types/events/item/event-list-item.utils.d.ts +1 -1
  26. package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -5
  27. package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -5
  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/shared/event-trading-state.utils.d.mts +4 -2
  31. package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
  32. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
  33. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
  34. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
  35. package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
  36. package/dist/types/pages/user-profile/index.d.mts +1 -1
  37. package/dist/types/pages/user-profile/index.d.ts +1 -1
  38. package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
  39. package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
  40. package/dist/types/shared/utils.d.mts +16 -0
  41. package/dist/types/shared/utils.d.ts +16 -0
  42. 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,8 +6348,14 @@ 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)}%`;
@@ -9004,6 +9097,24 @@ var buildOutcomeMidpointsByOutcomeId = (midpointRows) => {
9004
9097
  }
9005
9098
  return outcomeMidpointsByOutcomeId;
9006
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
+ };
9007
9118
  var resolveMarketHrefFromEventHref = (eventHref, marketId, outcomeId) => {
9008
9119
  if (!eventHref) return void 0;
9009
9120
  if (typeof window === "undefined") return void 0;
@@ -9020,6 +9131,9 @@ var EventListItemContent = ({
9020
9131
  event,
9021
9132
  classNames,
9022
9133
  arbitrageByOutcomeId,
9134
+ midpointPrices,
9135
+ midpointRows: sharedMidpointRows,
9136
+ midpointsLoading,
9023
9137
  onEventClick,
9024
9138
  onMarketClick,
9025
9139
  getMarketHref,
@@ -9073,6 +9187,8 @@ var EventListItemContent = ({
9073
9187
  if (!isLazyMarketsQueryEnabled || lazyLoadedMarkets.length === 0) return allVenueMarkets;
9074
9188
  return dedupeVenueMarketsById([...allVenueMarkets, ...lazyLoadedMarkets]);
9075
9189
  }, [allVenueMarkets, isLazyMarketsQueryEnabled, lazyLoadedMarkets]);
9190
+ const hasExpandedMarkets = isLazyMarketsQueryEnabled && lazyLoadedMarkets.length > 0;
9191
+ const shouldUseSharedMidpoints = !hasExpandedMarkets && (midpointPrices !== void 0 || sharedMidpointRows !== void 0 || midpointsLoading !== void 0);
9076
9192
  const midpointVenueMarketIds = (0, import_react14.useMemo)(() => {
9077
9193
  var _a2;
9078
9194
  const ids = [];
@@ -9084,19 +9200,21 @@ var EventListItemContent = ({
9084
9200
  }
9085
9201
  return [...new Set(ids)];
9086
9202
  }, [resolvedOutcomeMarkets]);
9087
- const { midpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
9088
- venueMarketIds: midpointVenueMarketIds,
9089
- enabled: midpointVenueMarketIds.length > 0
9203
+ const { midpointRows: fetchedMidpointRows, isLoading: isVenueMarketMidpointsLoading } = (0, import_hooks35.useVenueMarketMidpoints)({
9204
+ venueMarketIds: shouldUseSharedMidpoints ? [] : midpointVenueMarketIds,
9205
+ enabled: !shouldUseSharedMidpoints && midpointVenueMarketIds.length > 0
9090
9206
  });
9091
- const { prices: displayMidpointsByOutcomeId, isLoading: isOutcomeMidpointsLoading } = (0, import_hooks35.useMidpoints)(resolvedOutcomeMarkets);
9092
- 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;
9093
9211
  const displayPriceByOutcomeId = (0, import_react14.useMemo)(() => {
9094
- const priceByOutcomeId = new Map(displayMidpointsByOutcomeId);
9095
- for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(midpointRows)) {
9212
+ const priceByOutcomeId = new Map(resolvedDisplayMidpointsByOutcomeId);
9213
+ for (const [outcomeId, price] of buildOutcomeMidpointsByOutcomeId(resolvedMidpointRows)) {
9096
9214
  priceByOutcomeId.set(outcomeId, price);
9097
9215
  }
9098
9216
  return priceByOutcomeId;
9099
- }, [displayMidpointsByOutcomeId, midpointRows]);
9217
+ }, [resolvedDisplayMidpointsByOutcomeId, resolvedMidpointRows]);
9100
9218
  const comparison = (0, import_react14.useMemo)(() => {
9101
9219
  return normalizeEventListItemV2Comparison({
9102
9220
  venueMarkets: resolvedOutcomeMarkets,
@@ -9107,6 +9225,9 @@ var EventListItemContent = ({
9107
9225
  const gapsByVenueMarketId = (0, import_react14.useMemo)(() => {
9108
9226
  return computePriceGapsFromComparisonRows(comparison.rows);
9109
9227
  }, [comparison.rows]);
9228
+ const arbReturnByVenueMarketId = (0, import_react14.useMemo)(() => {
9229
+ return buildArbReturnByVenueMarketId(resolvedMidpointRows);
9230
+ }, [resolvedMidpointRows]);
9110
9231
  const shouldRenderLoadingOutcomeRow = shouldEnableLazyMarketLoading && (!isLazyMarketsQueryEnabled || isLoadingLazyMarkets || isFetchingNextLazyMarketsPage || hasNextLazyMarketsPage);
9111
9232
  const resolvedVolume = (_a = resolveDisplayVolume(event.volume, allVenueMarkets)) != null ? _a : 0;
9112
9233
  const volumeLabel = `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItem.volumeSuffix}`;
@@ -9238,10 +9359,10 @@ var EventListItemContent = ({
9238
9359
  )
9239
9360
  ] });
9240
9361
  };
9241
- const renderPriceGapPill = (value) => {
9362
+ const renderPriceGapPill = (value, source = "percent") => {
9242
9363
  if (!config.features.enablePriceGap) return null;
9243
9364
  if (isAwaitingMidpoints) return null;
9244
- const formattedPriceGap = formatPriceGapPercent(value);
9365
+ const formattedPriceGap = formatPriceGapPercent(value, source);
9245
9366
  if (!formattedPriceGap) return null;
9246
9367
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
9247
9368
  "span",
@@ -9377,7 +9498,9 @@ var EventListItemContent = ({
9377
9498
  comparison.rows.map((row) => {
9378
9499
  var _a2;
9379
9500
  const arbitragePercent = (_a2 = arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.outcome.id]) != null ? _a2 : arbitrageByOutcomeId == null ? void 0 : arbitrageByOutcomeId[row.market.id];
9380
- 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";
9381
9504
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(
9382
9505
  "div",
9383
9506
  {
@@ -9397,7 +9520,7 @@ var EventListItemContent = ({
9397
9520
  ) }),
9398
9521
  /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { className: "agg-outcome-meta flex shrink-0 flex-row items-center justify-end gap-2", children: [
9399
9522
  renderArbitrage(arbitragePercent),
9400
- renderPriceGapPill(priceGapPercent),
9523
+ renderPriceGapPill(priceGapPercent, priceGapSource),
9401
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(
9402
9525
  (price, priceIndex) => renderComparisonPriceBadge(row, price, priceIndex)
9403
9526
  ) })
@@ -9904,6 +10027,23 @@ var resolveSortQueryParams = (value) => {
9904
10027
  }
9905
10028
  return { sortBy: "volume24hr", sortDir: "desc" };
9906
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
+ };
9907
10047
  var EventList = ({
9908
10048
  title: title2,
9909
10049
  limit = DEFAULT_EVENTS_LIMIT,
@@ -10118,6 +10258,16 @@ var EventList = ({
10118
10258
  if (resolvedMaxVisibleItems == null) return normalizedEvents;
10119
10259
  return normalizedEvents.slice(0, resolvedMaxVisibleItems);
10120
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
+ });
10121
10271
  const shouldRenderLoadingState = isLoading && !isPlaceholderData && tileEvents.length === 0;
10122
10272
  const shouldRenderEmptyState = !isLoading && !isError && tileEvents.length === 0;
10123
10273
  const shouldRenderPaginationLoadingItems = shouldPaginate && hasNextPage;
@@ -10286,6 +10436,8 @@ var EventList = ({
10286
10436
  EventListItem,
10287
10437
  {
10288
10438
  event,
10439
+ midpointRows: sharedMidpointRows,
10440
+ midpointsLoading: isSharedMidpointsLoading,
10289
10441
  classNames: {
10290
10442
  root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
10291
10443
  },
@@ -10553,6 +10705,79 @@ var isDateLikeLabel = (value) => {
10553
10705
  if (!value.trim()) return false;
10554
10706
  return (0, import_dayjs4.default)(value).isValid();
10555
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
+ };
10556
10781
  var matchOutcomeByLabel = (outcome, selectedOutcomeLabel) => {
10557
10782
  const normalizedSelectedLabel = normalizeLabel(selectedOutcomeLabel);
10558
10783
  const semanticSelectedLabel = toSemanticLabel(selectedOutcomeLabel);
@@ -12612,7 +12837,6 @@ var EventListItemDetailsGraphSection = ({
12612
12837
  venueMarkets,
12613
12838
  selectedMarketId,
12614
12839
  livePrices,
12615
- wsLivePrices,
12616
12840
  restMidpoints,
12617
12841
  bestMidpoint,
12618
12842
  bestPrices,
@@ -12806,7 +13030,7 @@ var EventListItemDetailsGraphSection = ({
12806
13030
  {
12807
13031
  classNames: { root: cn("agg-chart-region", classNames == null ? void 0 : classNames.chart) },
12808
13032
  series: visibleChartSeries,
12809
- height: 300,
13033
+ height: 200,
12810
13034
  isLoading: isScopedMarketChartLoading,
12811
13035
  chartType: selectedChartType,
12812
13036
  liveCandle: selectedChartType === "candlestick" ? (_m = chartLiveState.liveCandle) != null ? _m : void 0 : void 0,
@@ -12835,7 +13059,7 @@ var EventListItemDetailsGraphSection = ({
12835
13059
  ),
12836
13060
  children: chartAvailableVenueOutcomes.map((item) => {
12837
13061
  var _a3, _b3;
12838
- const percentage = (_b3 = (_a3 = resolvedOutcomePriceByMarketId.get(item.market.id)) == null ? void 0 : _a3.get(item.outcome.id)) != null ? _b3 : wsLivePrices.get(item.outcome.id);
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);
12839
13063
  const text = formatMarketProbabilityPercent(percentage, formatPercent);
12840
13064
  const seriesId = `${item.venue}-chart`;
12841
13065
  const isActiveVenue = activeGraphVenue === item.venue;
@@ -12843,6 +13067,7 @@ var EventListItemDetailsGraphSection = ({
12843
13067
  "button",
12844
13068
  {
12845
13069
  type: "button",
13070
+ "data-id": item.outcome.id,
12846
13071
  "aria-label": `${item.venue} ${text}`,
12847
13072
  "aria-pressed": isActiveVenue,
12848
13073
  className: cn(
@@ -12933,6 +13158,7 @@ var EventListItemDetailsContent = ({
12933
13158
  detailsStats,
12934
13159
  eventTradingState,
12935
13160
  ariaLabel,
13161
+ defaultTimeRange,
12936
13162
  onClick,
12937
13163
  midpointsResult
12938
13164
  }) => {
@@ -12941,9 +13167,6 @@ var EventListItemDetailsContent = ({
12941
13167
  const lastAppliedEventSyncKeyRef = (0, import_react23.useRef)(null);
12942
13168
  const lastAppliedDefaultRef = (0, import_react23.useRef)(null);
12943
13169
  const [chartRangeOverride, setChartRangeOverride] = (0, import_react23.useState)(null);
12944
- (0, import_react23.useEffect)(() => {
12945
- setChartRangeOverride(null);
12946
- }, [event.id]);
12947
13170
  const config = (0, import_hooks46.useSdkUiConfig)();
12948
13171
  const labels = (0, import_hooks46.useLabels)();
12949
13172
  const tradingContext = (0, import_hooks39.useEventTradingContext)();
@@ -12952,13 +13175,20 @@ var EventListItemDetailsContent = ({
12952
13175
  return eventTradingState != null ? eventTradingState : (0, import_hooks46.resolveEventTradingState)(event);
12953
13176
  }, [event, eventTradingState]);
12954
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]);
12955
13185
  const scopedSelectedMarketId = (tradingContext == null ? void 0 : tradingContext.selectedEventId) === event.id ? tradingContext.selectedMarketId : null;
12956
13186
  (0, import_hooks46.useEventOrderbookData)(
12957
13187
  resolvedEventTradingState.isTradingDisabled ? [] : resolvedEventTradingState.displayMarkets,
12958
13188
  scopedSelectedMarketId
12959
13189
  );
12960
- const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(resolvedEventTradingState.displayMarkets);
12961
- const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(resolvedEventTradingState.displayMarkets);
13190
+ const wsLivePrices = (0, import_hooks46.useLiveOutcomePrices)(eventDetailVenueMarkets);
13191
+ const wsBestPrices = (0, import_hooks46.useLiveBestPrices)(eventDetailVenueMarkets);
12962
13192
  const resolvedMidpointsResult = midpointsResult != null ? midpointsResult : {
12963
13193
  prices: /* @__PURE__ */ new Map(),
12964
13194
  bestMidpointsByOutcomeId: /* @__PURE__ */ new Map(),
@@ -12983,6 +13213,16 @@ var EventListItemDetailsContent = ({
12983
13213
  for (const [k, v] of wsLivePrices) merged.set(k, v);
12984
13214
  return merged;
12985
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]);
12986
13226
  (0, import_react23.useEffect)(() => {
12987
13227
  if (!tradingContext) return;
12988
13228
  if (lastAppliedEventSyncKeyRef.current === eventSyncKey) return;
@@ -13020,10 +13260,6 @@ var EventListItemDetailsContent = ({
13020
13260
  tradingContext,
13021
13261
  tradingContext == null ? void 0 : tradingContext.selectedEventId
13022
13262
  ]);
13023
- const venueMarkets = (0, import_react23.useMemo)(
13024
- () => resolvedEventTradingState.displayMarkets,
13025
- [resolvedEventTradingState.displayMarkets]
13026
- );
13027
13263
  const marketOptions = (0, import_react23.useMemo)(
13028
13264
  () => venueMarkets.map((vm) => ({
13029
13265
  value: vm.id,
@@ -13145,7 +13381,6 @@ var EventListItemDetailsContent = ({
13145
13381
  venueMarkets,
13146
13382
  selectedMarketId: (_d = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.id) != null ? _d : null,
13147
13383
  livePrices,
13148
- wsLivePrices,
13149
13384
  restMidpoints,
13150
13385
  bestMidpoint,
13151
13386
  bestPrices,
@@ -13861,8 +14096,13 @@ var resolveTradingStateTimestampLabel = (labels, state) => {
13861
14096
  return null;
13862
14097
  };
13863
14098
  var resolveTradingStatePresentation = (labels, state) => {
14099
+ var _a;
13864
14100
  const timestampLabel = resolveTradingStateTimestampLabel(labels, state);
13865
- 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;
13866
14106
  if (state.kind === "resolved") {
13867
14107
  return {
13868
14108
  badgeLabel: labels.eventMarketPage.tradingResolvedBadge,
@@ -14573,6 +14813,10 @@ var MarketDetailsContent = ({
14573
14813
  const isOutcomeSelectionLocked = marketTradingState.isTradingDisabled;
14574
14814
  const isUpcomingMarket = marketTradingState.kind === "unopened";
14575
14815
  const marketStatePresentation = resolveTradingStatePresentation(labels, marketTradingState);
14816
+ const resolvedWinningOutcomeLabel = resolveResolvedOutcomeLabel({
14817
+ market: scopedMarketForCard,
14818
+ outcome: marketTradingState.winningOutcome
14819
+ });
14576
14820
  const marketDetailsTabs = (0, import_react27.useMemo)(() => {
14577
14821
  return getMarketDetailsTabs(labels);
14578
14822
  }, [labels]);
@@ -15009,7 +15253,9 @@ var MarketDetailsContent = ({
15009
15253
  )
15010
15254
  }
15011
15255
  ),
15012
- /* @__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
+ ) })
15013
15259
  ]
15014
15260
  }
15015
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)(
@@ -17955,7 +18201,7 @@ var PlaceOrderResolvedView = ({
17955
18201
  className,
17956
18202
  isSportsEvent = false
17957
18203
  }) => {
17958
- var _a;
18204
+ var _a, _b;
17959
18205
  const labels = (0, import_hooks54.useLabels)();
17960
18206
  const tradingLabels = labels.trading;
17961
18207
  const resolvingTimestamp = (_a = resolutionTimestamp != null ? resolutionTimestamp : tradingState.resolvesAt) != null ? _a : tradingState.endsAt;
@@ -18033,7 +18279,16 @@ var PlaceOrderResolvedView = ({
18033
18279
  ),
18034
18280
  children: [
18035
18281
  tradingState.market ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(Typography, { variant: "body", className: "text-center", children: tradingState.market.question }) : null,
18036
- 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
18037
18292
  ]
18038
18293
  }
18039
18294
  )
@@ -18095,6 +18350,16 @@ var renderRouteBreakdownRow = (row) => {
18095
18350
  rowKey
18096
18351
  );
18097
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
+ };
18098
18363
  var renderRouteCard = ({
18099
18364
  card,
18100
18365
  enableAnimations,
@@ -20328,7 +20593,7 @@ function useResolvedMarketClaim(options = {}) {
20328
20593
  }, executionMode === "paper" ? { mode: "paper" } : {}));
20329
20594
  const claimWinnings = useClaimWinnings();
20330
20595
  return (0, import_react34.useMemo)(() => {
20331
- var _a2, _b, _c;
20596
+ var _a2;
20332
20597
  if (!shouldFetch || !marketId) return void 0;
20333
20598
  const group = positions.find(
20334
20599
  (candidate) => candidate.targetMarketId === marketId
@@ -20340,7 +20605,10 @@ function useResolvedMarketClaim(options = {}) {
20340
20605
  if (winningOutcomes.length === 0) return void 0;
20341
20606
  const totals = (0, import_hooks56.computeClosedPositionTotals)(group);
20342
20607
  const winningShares = winningOutcomes.reduce((sum, outcome) => sum + outcome.totalSize, 0);
20343
- 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 : "";
20344
20612
  const claimKey = group.targetMarketId;
20345
20613
  const canClaim = group.redeemStatus === "eligible" && totals.winningOutcomeIds.length > 0;
20346
20614
  return {
@@ -20656,252 +20924,6 @@ var import_react38 = require("react");
20656
20924
  var import_hooks59 = require("@agg-build/hooks");
20657
20925
  var import_react37 = require("react");
20658
20926
 
20659
- // src/pages/event-market/sports-market-card.tsx
20660
- var import_hooks58 = require("@agg-build/hooks");
20661
- var import_react36 = require("react");
20662
-
20663
- // src/pages/event-market/sports-line-rail.tsx
20664
- var React = __toESM(require("react"));
20665
- var import_jsx_runtime149 = require("react/jsx-runtime");
20666
- function VenueRow({ venues, active }) {
20667
- if (!venues || venues.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "h-4" });
20668
- const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
20669
- const extra = venues.length - shown.length;
20670
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20671
- "span",
20672
- {
20673
- className: cn(
20674
- "flex h-4 items-center justify-center gap-1",
20675
- !active && "text-agg-muted-foreground"
20676
- ),
20677
- children: [
20678
- shown.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20679
- VenueLogo,
20680
- {
20681
- venue,
20682
- isMonochromatic: !active,
20683
- size: "small",
20684
- className: "size-3! shrink-0"
20685
- },
20686
- `${venue}-${index}`
20687
- )),
20688
- extra > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
20689
- "+",
20690
- extra
20691
- ] })
20692
- ]
20693
- }
20694
- );
20695
- }
20696
- function SportsLineRail({
20697
- stops,
20698
- selectedIndex,
20699
- onSelect,
20700
- ariaLabel,
20701
- previousAriaLabel,
20702
- nextAriaLabel,
20703
- className
20704
- }) {
20705
- const scrollRef = React.useRef(null);
20706
- const itemRefs = React.useRef([]);
20707
- const didInit = React.useRef(false);
20708
- const programmatic = React.useRef(false);
20709
- const progTimer = React.useRef(void 0);
20710
- const skipCenterOnPropSync = React.useRef(false);
20711
- const pendingScrollIndex = React.useRef(null);
20712
- const scrollSettleTimer = React.useRef(void 0);
20713
- const stopCount = stops.length;
20714
- const [pad, setPad] = React.useState({ left: 0, right: 0 });
20715
- const [mask, setMask] = React.useState({ left: false, right: false });
20716
- const updateMask = React.useCallback(() => {
20717
- const c = scrollRef.current;
20718
- if (!c || !c.clientWidth) return;
20719
- setMask({
20720
- left: c.scrollLeft > 1,
20721
- right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
20722
- });
20723
- }, []);
20724
- const resolveNearestIndexToViewportCenter = React.useCallback(() => {
20725
- const container = scrollRef.current;
20726
- if (!container || !container.clientWidth) return null;
20727
- const viewportCenter = container.scrollLeft + container.clientWidth / 2;
20728
- let nearestIndex = null;
20729
- let nearestDistance = Number.POSITIVE_INFINITY;
20730
- itemRefs.current.forEach((item, index) => {
20731
- if (!item) return;
20732
- const itemCenter = item.offsetLeft + item.offsetWidth / 2;
20733
- const distance = Math.abs(itemCenter - viewportCenter);
20734
- if (distance < nearestDistance) {
20735
- nearestDistance = distance;
20736
- nearestIndex = index;
20737
- }
20738
- });
20739
- return nearestIndex;
20740
- }, []);
20741
- React.useLayoutEffect(() => {
20742
- const c = scrollRef.current;
20743
- if (!c) return;
20744
- const measure = () => {
20745
- var _a, _b, _c, _d;
20746
- const w = c.clientWidth;
20747
- if (!w) return;
20748
- const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
20749
- const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
20750
- setPad({
20751
- left: Math.max(0, w / 2 - firstW / 2),
20752
- right: Math.max(0, w / 2 - lastW / 2)
20753
- });
20754
- updateMask();
20755
- };
20756
- const onScroll = () => {
20757
- if (!programmatic.current) {
20758
- const nearestIndex = resolveNearestIndexToViewportCenter();
20759
- if (nearestIndex != null && nearestIndex !== selectedIndex) {
20760
- pendingScrollIndex.current = nearestIndex;
20761
- clearTimeout(scrollSettleTimer.current);
20762
- scrollSettleTimer.current = setTimeout(() => {
20763
- const nextIndex = pendingScrollIndex.current;
20764
- if (nextIndex == null || nextIndex === selectedIndex) return;
20765
- skipCenterOnPropSync.current = true;
20766
- onSelect(nextIndex);
20767
- }, 120);
20768
- }
20769
- }
20770
- updateMask();
20771
- };
20772
- measure();
20773
- const ro = new ResizeObserver(measure);
20774
- ro.observe(c);
20775
- c.addEventListener("scroll", onScroll, { passive: true });
20776
- return () => {
20777
- ro.disconnect();
20778
- c.removeEventListener("scroll", onScroll);
20779
- clearTimeout(scrollSettleTimer.current);
20780
- };
20781
- }, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
20782
- React.useEffect(() => {
20783
- pendingScrollIndex.current = selectedIndex;
20784
- }, [selectedIndex]);
20785
- React.useEffect(() => {
20786
- const c = scrollRef.current;
20787
- const el = itemRefs.current[selectedIndex];
20788
- if (!c || !el || !c.clientWidth) return;
20789
- if (skipCenterOnPropSync.current) {
20790
- skipCenterOnPropSync.current = false;
20791
- updateMask();
20792
- return;
20793
- }
20794
- const max = c.scrollWidth - c.clientWidth;
20795
- const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
20796
- programmatic.current = true;
20797
- c.scrollTo({
20798
- left: Math.max(0, Math.min(max, target)),
20799
- behavior: didInit.current ? "smooth" : "auto"
20800
- });
20801
- if (pad.left > 0 || pad.right > 0) didInit.current = true;
20802
- clearTimeout(progTimer.current);
20803
- progTimer.current = setTimeout(() => {
20804
- programmatic.current = false;
20805
- }, 500);
20806
- updateMask();
20807
- }, [selectedIndex, stopCount, pad, updateMask]);
20808
- const select = (index) => {
20809
- const next = Math.min(stops.length - 1, Math.max(0, index));
20810
- if (next !== selectedIndex) onSelect(next);
20811
- };
20812
- const step = (delta) => select(selectedIndex + delta);
20813
- if (stopCount === 0) return null;
20814
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20815
- "div",
20816
- {
20817
- className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
20818
- "aria-label": ariaLabel,
20819
- children: [
20820
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20821
- "button",
20822
- {
20823
- type: "button",
20824
- onClick: () => step(-1),
20825
- disabled: selectedIndex === 0,
20826
- "aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
20827
- 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",
20828
- children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-left", className: "size-4" })
20829
- }
20830
- ),
20831
- /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
20832
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20833
- "div",
20834
- {
20835
- ref: scrollRef,
20836
- style: { paddingLeft: pad.left, paddingRight: pad.right },
20837
- className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
20838
- children: stops.map((stop, index) => {
20839
- const active = index === selectedIndex;
20840
- return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
20841
- "button",
20842
- {
20843
- type: "button",
20844
- ref: (el) => {
20845
- itemRefs.current[index] = el;
20846
- },
20847
- onClick: () => select(index),
20848
- disabled: stop.disabled,
20849
- "aria-pressed": active,
20850
- className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
20851
- children: [
20852
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20853
- "span",
20854
- {
20855
- className: cn(
20856
- "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",
20857
- 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"
20858
- ),
20859
- children: stop.value
20860
- }
20861
- ),
20862
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(VenueRow, { venues: stop.venues, active })
20863
- ]
20864
- },
20865
- index
20866
- );
20867
- })
20868
- }
20869
- ),
20870
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20871
- "span",
20872
- {
20873
- className: cn(
20874
- "pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
20875
- mask.left ? "opacity-100" : "opacity-0"
20876
- )
20877
- }
20878
- ),
20879
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20880
- "span",
20881
- {
20882
- className: cn(
20883
- "pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
20884
- mask.right ? "opacity-100" : "opacity-0"
20885
- )
20886
- }
20887
- )
20888
- ] }),
20889
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(
20890
- "button",
20891
- {
20892
- type: "button",
20893
- onClick: () => step(1),
20894
- disabled: selectedIndex === stopCount - 1,
20895
- "aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
20896
- 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",
20897
- children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Icon, { name: "chevron-right", className: "size-4" })
20898
- }
20899
- )
20900
- ]
20901
- }
20902
- );
20903
- }
20904
-
20905
20927
  // src/pages/event-market/sports-event-market.utils.ts
20906
20928
  var SPORTS_MARKET_TYPE_KEYS = [
20907
20929
  "moneyline",
@@ -20958,6 +20980,10 @@ var SPORTS_LEGACY_PROP_CATEGORY_KEY_SET = /* @__PURE__ */ new Set([
20958
20980
  "assists",
20959
20981
  "shots"
20960
20982
  ]);
20983
+ var SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET = /* @__PURE__ */ new Set([
20984
+ "exact_score",
20985
+ ...SPORTS_LEGACY_PROP_CATEGORY_KEY_SET
20986
+ ]);
20961
20987
  var SPORTS_MARKET_GROUP_TO_TAB = {
20962
20988
  game_lines: "game_lines",
20963
20989
  spreads: "game_lines",
@@ -21045,9 +21071,15 @@ var SPORTS_MARKET_TYPE_ORDER = [
21045
21071
  ];
21046
21072
  var YES_NO_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
21047
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;
21048
21076
  var toTrimmedString = (value) => {
21049
21077
  return typeof value === "string" ? value.trim() : "";
21050
21078
  };
21079
+ var resolveSportsMarketAggKey = (market) => {
21080
+ const typedMarket = market;
21081
+ return toTrimmedString(typedMarket.aggKey);
21082
+ };
21051
21083
  var sanitizeFamilyValue = (value) => {
21052
21084
  return value.toLowerCase().replace(/[-+]?\d+(?:\.\d+)?/g, "").replace(/[¢$]/g, "").replace(/\s+/g, " ").replace(/[|:()[\]{}]/g, "").trim();
21053
21085
  };
@@ -21107,15 +21139,36 @@ var normalizeSportsMarketGroup = (value) => {
21107
21139
  if (!resolvedValue) return null;
21108
21140
  return SPORTS_MARKET_GROUP_KEY_SET.has(resolvedValue) ? resolvedValue : "other";
21109
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
+ };
21110
21162
  var resolveMarketSectionTabKey = (market) => {
21111
- const category = normalizeSportsMarketCategory(market.marketCategory);
21112
- 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)) {
21113
21167
  return category;
21114
21168
  }
21115
21169
  const group = normalizeSportsMarketGroup(market.marketGroup);
21116
21170
  if (group) return SPORTS_MARKET_GROUP_TO_TAB[group];
21117
21171
  if (category === "game_lines") return "game_lines";
21118
- if (category === "exact_score") return "exact_score";
21119
21172
  if (category === "other") return "other";
21120
21173
  return null;
21121
21174
  };
@@ -21139,13 +21192,27 @@ var resolveSportsSectionMarkets = ({
21139
21192
  sectionMarkets
21140
21193
  }) => {
21141
21194
  const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tabKey);
21142
- if (tabKey !== "game_lines") return effectiveSectionMarkets;
21143
- const eventMoneylineMarkets = eventMarkets.filter(
21144
- (market) => normalizeSportsMarketType(market.sportsMarketType) === "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
21145
- );
21146
- if (eventMoneylineMarkets.length === 0) return effectiveSectionMarkets;
21147
- const lineSectionMarkets = effectiveSectionMarkets.filter(
21148
- (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"
21149
21216
  );
21150
21217
  return [...eventMoneylineMarkets, ...lineSectionMarkets];
21151
21218
  };
@@ -21173,7 +21240,15 @@ var isBinarySportsMoneylineMarket = (market) => {
21173
21240
  );
21174
21241
  const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
21175
21242
  const marketGroup = normalizeSportsMarketGroup(market.marketGroup);
21176
- 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, "") : "";
21177
21252
  };
21178
21253
  var resolveDisplayGroupFamilyKey = (market) => {
21179
21254
  var _a, _b, _c;
@@ -21187,11 +21262,12 @@ var resolveDisplayGroupFamilyKey = (market) => {
21187
21262
  if (isBinarySportsMoneylineMarket(market)) {
21188
21263
  return `${period}|moneyline|${marketCategory}`;
21189
21264
  }
21265
+ const lineFamily = resolveSportsLineFamilyKey(market);
21190
21266
  if (sportsMarketType === "spread") {
21191
- return `${period}|spread|${marketCategory}`;
21267
+ return lineFamily ? `${period}|spread|${lineFamily}` : `${period}|spread|${marketCategory}`;
21192
21268
  }
21193
21269
  if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
21194
- return `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
21270
+ return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
21195
21271
  }
21196
21272
  return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
21197
21273
  };
@@ -21398,15 +21474,6 @@ var buildSportsSlideFromGroup = (group) => {
21398
21474
  defaultStopIndex
21399
21475
  };
21400
21476
  };
21401
- var formatSportsPeriodGrammarLabel = (period) => {
21402
- const grammarMatch = SPORTS_PERIOD_GRAMMAR_PATTERN.exec(period);
21403
- if (!grammarMatch) return null;
21404
- if (grammarMatch[1]) {
21405
- const family = grammarMatch[1].charAt(0).toUpperCase() + grammarMatch[1].slice(1);
21406
- return `${family} ${Number(grammarMatch[2])}`;
21407
- }
21408
- return `First ${Number(grammarMatch[3])} Innings`;
21409
- };
21410
21477
  var resolveSportsCategoryTokens = (event) => {
21411
21478
  return new Set(
21412
21479
  event.categories.flatMap((entry) => {
@@ -21458,11 +21525,257 @@ var mergeSportsSectionMarketsIntoEvent = ({
21458
21525
  seenMarketIds.add(market.id);
21459
21526
  orderedVenueMarkets.push(market);
21460
21527
  }
21461
- }
21462
- return __spreadProps(__spreadValues({}, event), {
21463
- venueMarkets: orderedVenueMarkets
21464
- });
21465
- };
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
+ }
21466
21779
 
21467
21780
  // src/pages/event-market/sports-market-card.tsx
21468
21781
  var import_jsx_runtime150 = require("react/jsx-runtime");
@@ -21490,6 +21803,19 @@ var SportsMarketCard = ({
21490
21803
  [group.markets]
21491
21804
  );
21492
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]);
21493
21819
  (0, import_react36.useEffect)(() => {
21494
21820
  if (!slide.hasLadder) return;
21495
21821
  const tradingMarketId = tradingContext == null ? void 0 : tradingContext.selectedMarketId;
@@ -21497,7 +21823,7 @@ var SportsMarketCard = ({
21497
21823
  const matchedIndex = slide.stops.findIndex((stop) => stop.market.id === tradingMarketId);
21498
21824
  if (matchedIndex >= 0) setSelectedLineIndex(matchedIndex);
21499
21825
  }, [slide.hasLadder, slide.stops, tradingContext == null ? void 0 : tradingContext.selectedMarketId]);
21500
- 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;
21501
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;
21502
21828
  const activeDefaultOutcome = isCombinedMoneylineGroup && activeMarket ? (_f = activeMarket.venueMarketOutcomes.find(
21503
21829
  (outcome) => outcome.label.trim().toLowerCase() === "yes"
@@ -21649,39 +21975,6 @@ var resolveSportsSectionLabel = (labels, key) => {
21649
21975
  return labels.eventMarketPage.sports.otherTab;
21650
21976
  }
21651
21977
  };
21652
- var resolveSportsPeriodLabel = (labels, period) => {
21653
- var _a;
21654
- switch (period) {
21655
- case "full":
21656
- return labels.eventMarketPage.sports.fullPeriod;
21657
- case "1h":
21658
- return labels.eventMarketPage.sports.firstHalfPeriod;
21659
- case "2h":
21660
- return labels.eventMarketPage.sports.secondHalfPeriod;
21661
- case "q1":
21662
- return labels.eventMarketPage.sports.quarterOnePeriod;
21663
- case "q2":
21664
- return labels.eventMarketPage.sports.quarterTwoPeriod;
21665
- case "q3":
21666
- return labels.eventMarketPage.sports.quarterThreePeriod;
21667
- case "q4":
21668
- return labels.eventMarketPage.sports.quarterFourPeriod;
21669
- case "ot":
21670
- return labels.eventMarketPage.sports.overtimePeriod;
21671
- case "first_inning":
21672
- return "1st Inning";
21673
- case "second_inning":
21674
- return "2nd Inning";
21675
- case "third_inning":
21676
- return "3rd Inning";
21677
- case "first_5_innings":
21678
- return "1st 5 Innings";
21679
- case "other":
21680
- return labels.eventMarketPage.sports.otherPeriod;
21681
- default:
21682
- return (_a = formatSportsPeriodGrammarLabel(period)) != null ? _a : labels.eventMarketPage.sports.otherPeriod;
21683
- }
21684
- };
21685
21978
  var SportsTabButton = ({
21686
21979
  isActive,
21687
21980
  label: label2,
@@ -21893,7 +22186,7 @@ var SportsMarkets = ({
21893
22186
  );
21894
22187
  }
21895
22188
  const shouldShowLoadingState = stableSectionMarkets == null && !isSectionSettled;
21896
- 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: [
21897
22190
  shouldRenderTabs ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21898
22191
  "div",
21899
22192
  {
@@ -21922,28 +22215,24 @@ var SportsMarkets = ({
21922
22215
  }
21923
22216
  ) : null,
21924
22217
  displayedPeriodGroups.map((periodGroup) => {
21925
- const hasMultiplePeriods = displayedPeriodGroups.length > 1;
21926
- return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
22218
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21927
22219
  "section",
21928
22220
  {
21929
22221
  className: "flex flex-col gap-3",
21930
22222
  "data-period-key": periodGroup.key,
21931
- children: [
21932
- hasMultiplePeriods ? /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(Typography, { variant: "body-large-strong", className: "text-agg-foreground", children: resolveSportsPeriodLabel(labels, periodGroup.key) }) : null,
21933
- periodGroup.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
21934
- SportsMarketCard,
21935
- {
21936
- group,
21937
- venueMarkets: displayedSectionMarkets,
21938
- isExpanded: expandedGroupId === group.id,
21939
- onToggle: handleToggleGroup,
21940
- onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
21941
- live,
21942
- midpointsResult
21943
- },
21944
- group.id
21945
- ))
21946
- ]
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
+ ))
21947
22236
  },
21948
22237
  `${activeTabKey}-${periodGroup.key}`
21949
22238
  );
@@ -22190,7 +22479,11 @@ var EventMarketPageContent = ({
22190
22479
  const [isMobileTradeOpen, setIsMobileTradeOpen] = (0, import_react39.useState)(false);
22191
22480
  const isMobileViewport = useIsMobileEventMarketViewport();
22192
22481
  const tradingContext = (0, import_hooks61.useEventTradingContext)();
22193
- 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);
22194
22487
  const internalResolvedClaim = useResolvedMarketClaim({
22195
22488
  market: eventTradingState.primaryMarket,
22196
22489
  enabled: eventTradingState.kind === "resolved",
@@ -22509,6 +22802,17 @@ var MIN_SEARCH_LENGTH2 = 3;
22509
22802
  var SEARCH_DEBOUNCE_MS2 = 300;
22510
22803
  var SEARCH_RESULTS_LIMIT = 20;
22511
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
+ };
22512
22816
  var HomeSearchResults = ({
22513
22817
  activeTabValue,
22514
22818
  query,
@@ -22563,6 +22867,19 @@ var HomeSearchResults = ({
22563
22867
  }
22564
22868
  return filtered;
22565
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
+ });
22566
22883
  const loadMoreRef = (0, import_react42.useRef)(null);
22567
22884
  (0, import_react42.useEffect)(() => {
22568
22885
  if (!hasNextPage) return;
@@ -22653,6 +22970,8 @@ var HomeSearchResults = ({
22653
22970
  EventListItem,
22654
22971
  {
22655
22972
  event,
22973
+ midpointRows: sharedMidpointRows,
22974
+ midpointsLoading: isSharedMidpointsLoading,
22656
22975
  classNames: {
22657
22976
  root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
22658
22977
  },
@@ -22997,8 +23316,8 @@ var HomePage = ({
22997
23316
  HomePage.displayName = "HomePage";
22998
23317
 
22999
23318
  // src/pages/user-profile/index.tsx
23000
- var import_hooks67 = require("@agg-build/hooks");
23001
- var import_sdk19 = require("@agg-build/sdk");
23319
+ var import_hooks68 = require("@agg-build/hooks");
23320
+ var import_sdk20 = require("@agg-build/sdk");
23002
23321
  var import_react44 = require("react");
23003
23322
 
23004
23323
  // src/pages/user-profile/chain-display.ts
@@ -23235,8 +23554,136 @@ var AvailableBalanceCard = ({
23235
23554
  };
23236
23555
  AvailableBalanceCard.displayName = "AvailableBalanceCard";
23237
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
+
23238
23685
  // src/pages/user-profile/components/positions-activity.tsx
23239
- var import_hooks65 = require("@agg-build/hooks");
23686
+ var import_hooks66 = require("@agg-build/hooks");
23240
23687
  var import_react43 = require("react");
23241
23688
 
23242
23689
  // src/pages/user-profile/user-profile.constants.ts
@@ -23433,16 +23880,8 @@ var toPositionRowViewModel = (position, labels = defaultLabels2) => {
23433
23880
  };
23434
23881
  };
23435
23882
 
23436
- // src/primitives/conditional-wrapper.tsx
23437
- var ConditionalWrapper = ({
23438
- condition,
23439
- wrapper,
23440
- children
23441
- }) => condition ? wrapper(children) : children;
23442
- ConditionalWrapper.displayName = "ConditionalWrapper";
23443
-
23444
23883
  // src/pages/user-profile/components/activity-row.tsx
23445
- var import_jsx_runtime156 = require("react/jsx-runtime");
23884
+ var import_jsx_runtime157 = require("react/jsx-runtime");
23446
23885
  var shouldOpenInNewTab = (activity) => {
23447
23886
  return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
23448
23887
  };
@@ -23459,7 +23898,7 @@ var RowWrapper = ({
23459
23898
  }) => {
23460
23899
  if (href) {
23461
23900
  const opensInNewTab = target === "_blank";
23462
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23901
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23463
23902
  "a",
23464
23903
  {
23465
23904
  href,
@@ -23475,7 +23914,7 @@ var RowWrapper = ({
23475
23914
  }
23476
23915
  );
23477
23916
  }
23478
- 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 });
23479
23918
  };
23480
23919
  var TRANSFER_ICON = {
23481
23920
  withdrawal: "upload",
@@ -23510,7 +23949,7 @@ var AmountTimeStack = ({
23510
23949
  timeLabel,
23511
23950
  tone,
23512
23951
  mobile
23513
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23952
+ }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
23514
23953
  "div",
23515
23954
  {
23516
23955
  className: cn(
@@ -23518,7 +23957,7 @@ var AmountTimeStack = ({
23518
23957
  mobile ? "sm:hidden" : "hidden sm:flex sm:w-[120px] sm:shrink-0"
23519
23958
  ),
23520
23959
  children: [
23521
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23960
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23522
23961
  "p",
23523
23962
  {
23524
23963
  className: cn(
@@ -23529,7 +23968,7 @@ var AmountTimeStack = ({
23529
23968
  children: amountLabel
23530
23969
  }
23531
23970
  ),
23532
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23971
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23533
23972
  "p",
23534
23973
  {
23535
23974
  className: cn(
@@ -23546,9 +23985,9 @@ var AmountTimeStack = ({
23546
23985
  var TradeTypeCell = ({
23547
23986
  activity,
23548
23987
  tone
23549
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23550
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
23551
- /* @__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)(
23552
23991
  "p",
23553
23992
  {
23554
23993
  className: cn(
@@ -23563,8 +24002,8 @@ var TradeTypeCell = ({
23563
24002
  var TransferTypeCell = ({
23564
24003
  activity,
23565
24004
  tone
23566
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23567
- /* @__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)(
23568
24007
  Icon,
23569
24008
  {
23570
24009
  name: TRANSFER_ICON[activity.kind],
@@ -23575,7 +24014,7 @@ var TransferTypeCell = ({
23575
24014
  )
23576
24015
  }
23577
24016
  ),
23578
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24017
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23579
24018
  "p",
23580
24019
  {
23581
24020
  className: cn(
@@ -23590,8 +24029,8 @@ var TransferTypeCell = ({
23590
24029
  var RedeemTypeCell = ({
23591
24030
  activity,
23592
24031
  tone
23593
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
23594
- /* @__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)(
23595
24034
  Icon,
23596
24035
  {
23597
24036
  name: "gift-bonus",
@@ -23602,7 +24041,7 @@ var RedeemTypeCell = ({
23602
24041
  )
23603
24042
  }
23604
24043
  ),
23605
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24044
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23606
24045
  "p",
23607
24046
  {
23608
24047
  className: cn(
@@ -23619,7 +24058,7 @@ var OutcomeBadge = ({
23619
24058
  tone
23620
24059
  }) => {
23621
24060
  if (!label2) return null;
23622
- 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)(
23623
24062
  "span",
23624
24063
  {
23625
24064
  className: cn(
@@ -23633,9 +24072,9 @@ var OutcomeBadge = ({
23633
24072
  var TradeOutcomeShares = ({
23634
24073
  activity,
23635
24074
  tone
23636
- }) => /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(import_jsx_runtime156.Fragment, { children: [
23637
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }),
23638
- /* @__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)(
23639
24078
  "span",
23640
24079
  {
23641
24080
  className: cn(
@@ -23655,8 +24094,8 @@ var RedeemRow = ({
23655
24094
  const tone = resolveToneClasses(activity);
23656
24095
  const statusVisual = getStatusVisual(activity);
23657
24096
  const activityStatus = resolveActivityStatus(activity);
23658
- const shouldShowInlineStatus = activityStatus !== "completed";
23659
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24097
+ const shouldShowInlineStatus = activityStatus === "pending";
24098
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23660
24099
  RowWrapper,
23661
24100
  {
23662
24101
  className,
@@ -23664,173 +24103,30 @@ var RedeemRow = ({
23664
24103
  target: href ? "_blank" : void 0,
23665
24104
  rel: href ? "noopener noreferrer" : void 0,
23666
24105
  onClick,
23667
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23668
- ConditionalWrapper,
23669
- {
23670
- condition: !!activity.errorMessage,
23671
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23672
- Tooltip,
23673
- {
23674
- size: "medium",
23675
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23676
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23677
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23678
- ] }),
23679
- sideOffset: 4,
23680
- children
23681
- }
23682
- ),
23683
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23684
- "div",
23685
- {
23686
- className: cn(
23687
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23688
- "relative z-10"
23689
- ),
23690
- "data-status": activityStatus,
23691
- children: [
23692
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RedeemTypeCell, { activity, tone }),
23693
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
23694
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23695
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23696
- Icon,
23697
- {
23698
- name: "gift-bonus",
23699
- size: "small",
23700
- className: cn(
23701
- "shrink-0 text-agg-foreground",
23702
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23703
- )
23704
- }
23705
- ),
23706
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23707
- "p",
23708
- {
23709
- className: cn(
23710
- "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23711
- tone.primary,
23712
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23713
- ),
23714
- children: activity.type
23715
- }
23716
- )
23717
- ] }),
23718
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone })
23719
- ] }),
23720
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23721
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23722
- /* @__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)(
23723
- RemoteImage,
23724
- {
23725
- src: activity.thumbnailSrc,
23726
- alt: "",
23727
- className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
23728
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
23729
- }
23730
- ) }),
23731
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
23732
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
23733
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23734
- "p",
23735
- {
23736
- className: cn(
23737
- "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",
23738
- tone.primary
23739
- ),
23740
- children: activity.title
23741
- }
23742
- ),
23743
- shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23744
- LoadingIcon,
23745
- {
23746
- size: "small",
23747
- className: cn("shrink-0", statusVisual.iconClassName)
23748
- }
23749
- ) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23750
- Icon,
23751
- {
23752
- name: statusVisual.icon,
23753
- size: "small",
23754
- className: cn("shrink-0", statusVisual.iconClassName)
23755
- }
23756
- ) : null
23757
- ] }),
23758
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
23759
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { className: "hidden sm:block", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
23760
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23761
- "p",
23762
- {
23763
- className: cn(
23764
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23765
- tone.meta
23766
- ),
23767
- children: activity.marketTitle
23768
- }
23769
- )
23770
- ] })
23771
- ] })
23772
- ] }),
23773
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23774
- AmountTimeStack,
23775
- {
23776
- amountLabel: activity.amountLabel,
23777
- timeLabel: activity.timeLabel,
23778
- tone,
23779
- mobile: true
23780
- }
23781
- )
23782
- ] }),
23783
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23784
- AmountTimeStack,
23785
- {
23786
- amountLabel: activity.amountLabel,
23787
- timeLabel: activity.timeLabel,
23788
- tone
23789
- }
23790
- )
23791
- ]
23792
- }
23793
- )
23794
- }
23795
- )
23796
- }
23797
- );
23798
- };
23799
- var TradeRow = ({
23800
- activity,
23801
- className,
23802
- href,
23803
- onClick
23804
- }) => {
23805
- const tone = resolveToneClasses(activity);
23806
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23807
- ConditionalWrapper,
23808
- {
23809
- condition: !!activity.errorMessage,
23810
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23811
- Tooltip,
23812
- {
23813
- size: "medium",
23814
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23815
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23816
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23817
- ] }),
23818
- sideOffset: 4,
23819
- children
23820
- }
23821
- ),
23822
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
24106
+ children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
23823
24107
  "div",
23824
24108
  {
23825
24109
  className: cn(
23826
24110
  "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23827
24111
  "relative z-10"
23828
24112
  ),
24113
+ "data-status": activityStatus,
23829
24114
  children: [
23830
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
23831
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-2", children: [
23832
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
23833
- /* @__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)(
23834
24130
  "p",
23835
24131
  {
23836
24132
  className: cn(
@@ -23842,12 +24138,11 @@ var TradeRow = ({
23842
24138
  }
23843
24139
  )
23844
24140
  ] }),
23845
- /* @__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 })
23846
24142
  ] }),
23847
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TradeTypeCell, { activity, tone }),
23848
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23849
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23850
- /* @__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)(
23851
24146
  RemoteImage,
23852
24147
  {
23853
24148
  src: activity.thumbnailSrc,
@@ -23856,21 +24151,49 @@ var TradeRow = ({
23856
24151
  classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
23857
24152
  }
23858
24153
  ) }),
23859
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
23860
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23861
- "p",
23862
- {
23863
- className: cn(
23864
- "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]",
23865
- tone.primary
23866
- ),
23867
- children: activity.title
23868
- }
23869
- ),
23870
- /* @__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
+ ] })
23871
24194
  ] })
23872
24195
  ] }),
23873
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24196
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23874
24197
  AmountTimeStack,
23875
24198
  {
23876
24199
  amountLabel: activity.amountLabel,
@@ -23880,7 +24203,7 @@ var TradeRow = ({
23880
24203
  }
23881
24204
  )
23882
24205
  ] }),
23883
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24206
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23884
24207
  AmountTimeStack,
23885
24208
  {
23886
24209
  amountLabel: activity.amountLabel,
@@ -23892,6 +24215,86 @@ var TradeRow = ({
23892
24215
  }
23893
24216
  )
23894
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
+ }
23895
24298
  ) });
23896
24299
  };
23897
24300
  var TransferRow = ({
@@ -23904,7 +24307,7 @@ var TransferRow = ({
23904
24307
  const transferStatus = resolveActivityStatus(activity);
23905
24308
  const transferIconName = TRANSFER_ICON[activity.kind];
23906
24309
  const statusVisual = getStatusVisual(activity);
23907
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24310
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23908
24311
  RowWrapper,
23909
24312
  {
23910
24313
  className,
@@ -23912,116 +24315,98 @@ var TransferRow = ({
23912
24315
  target: href ? "_blank" : void 0,
23913
24316
  rel: href ? "noopener noreferrer" : void 0,
23914
24317
  onClick,
23915
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23916
- ConditionalWrapper,
24318
+ children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
24319
+ "div",
23917
24320
  {
23918
- condition: !!activity.errorMessage,
23919
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23920
- Tooltip,
23921
- {
23922
- size: "medium",
23923
- content: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex items-center gap-4", children: [
23924
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
23925
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
23926
- ] }),
23927
- sideOffset: 4,
23928
- children
23929
- }
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"
23930
24324
  ),
23931
- children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(
23932
- "div",
23933
- {
23934
- className: cn(
23935
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
23936
- "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
+ }
23937
24338
  ),
23938
- children: [
23939
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(TransferTypeCell, { activity, tone }),
23940
- /* @__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: [
23941
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23942
- 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",
23943
24371
  {
23944
- name: transferIconName,
23945
- size: "small",
23946
24372
  className: cn(
23947
- "shrink-0 text-agg-foreground",
23948
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23949
- )
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
23950
24377
  }
23951
24378
  ),
23952
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24379
+ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
23953
24380
  "p",
23954
24381
  {
23955
24382
  className: cn(
23956
- "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23957
- tone.primary,
23958
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
23959
- ),
23960
- children: activity.type
23961
- }
23962
- )
23963
- ] }) }),
23964
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex w-full items-center justify-between sm:contents", children: [
23965
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
23966
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23967
- "div",
23968
- {
23969
- 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",
23970
- "data-status": transferStatus,
23971
- children: statusVisual.spin ? /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23972
- Icon,
23973
- {
23974
- name: statusVisual.icon,
23975
- size: "medium",
23976
- className: cn(statusVisual.iconClassName)
23977
- }
23978
- )
23979
- }
23980
- ),
23981
- /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
23982
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23983
- "p",
23984
- {
23985
- className: cn(
23986
- "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",
23987
- tone.primary
23988
- ),
23989
- children: activity.title
23990
- }
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
23991
24385
  ),
23992
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
23993
- "p",
23994
- {
23995
- className: cn(
23996
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
23997
- tone.meta
23998
- ),
23999
- children: activity.subtitleLabel
24000
- }
24001
- )
24002
- ] })
24003
- ] }),
24004
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24005
- AmountTimeStack,
24006
- {
24007
- amountLabel: activity.amountLabel,
24008
- timeLabel: activity.timeLabel,
24009
- tone,
24010
- mobile: true
24386
+ children: activity.subtitleLabel
24011
24387
  }
24012
24388
  )
24013
- ] }),
24014
- /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24015
- AmountTimeStack,
24016
- {
24017
- amountLabel: activity.amountLabel,
24018
- timeLabel: activity.timeLabel,
24019
- tone
24020
- }
24021
- )
24022
- ]
24023
- }
24024
- )
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
+ ]
24025
24410
  }
24026
24411
  )
24027
24412
  }
@@ -24039,10 +24424,10 @@ var ActivityRow = ({ activity, href, onClick }) => {
24039
24424
  "before:bg-agg-secondary-hover before:rounded-agg-xl"
24040
24425
  );
24041
24426
  if (activity.kind === "trade") {
24042
- 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 });
24043
24428
  }
24044
24429
  if (activity.kind === "redeem") {
24045
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24430
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24046
24431
  RedeemRow,
24047
24432
  {
24048
24433
  activity,
@@ -24052,7 +24437,7 @@ var ActivityRow = ({ activity, href, onClick }) => {
24052
24437
  }
24053
24438
  );
24054
24439
  }
24055
- return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
24440
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24056
24441
  TransferRow,
24057
24442
  {
24058
24443
  activity,
@@ -24065,19 +24450,19 @@ var ActivityRow = ({ activity, href, onClick }) => {
24065
24450
  ActivityRow.displayName = "ActivityRow";
24066
24451
 
24067
24452
  // src/pages/user-profile/components/empty-state.tsx
24068
- var import_jsx_runtime157 = require("react/jsx-runtime");
24453
+ var import_jsx_runtime158 = require("react/jsx-runtime");
24069
24454
  var EmptyState = ({ title: title2, description, className }) => {
24070
- return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
24455
+ return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24071
24456
  "div",
24072
24457
  {
24073
24458
  className: cn("flex flex-col items-center justify-center gap-8 p-10", className),
24074
24459
  role: "status",
24075
24460
  "aria-live": "polite",
24076
- children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col items-center gap-5", children: [
24077
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
24078
- /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
24079
- /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title2 }),
24080
- 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
24081
24466
  ] })
24082
24467
  ] })
24083
24468
  }
@@ -24086,8 +24471,8 @@ var EmptyState = ({ title: title2, description, className }) => {
24086
24471
  EmptyState.displayName = "EmptyState";
24087
24472
 
24088
24473
  // src/pages/user-profile/components/position-row.tsx
24089
- var import_hooks64 = require("@agg-build/hooks");
24090
- 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");
24091
24476
  var floorToTwoDecimals = (value) => {
24092
24477
  if (!Number.isFinite(value) || value <= 0) return 0;
24093
24478
  return Math.trunc(value * 100) / 100;
@@ -24100,8 +24485,8 @@ var toneTextClassName = (tone) => {
24100
24485
  if (tone === "negative") return "text-agg-error";
24101
24486
  return "text-agg-muted-foreground";
24102
24487
  };
24103
- 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 }) });
24104
- 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 }) });
24105
24490
  var VenueShares = ({
24106
24491
  model,
24107
24492
  totalSharesLabel,
@@ -24109,26 +24494,26 @@ var VenueShares = ({
24109
24494
  keyPrefix
24110
24495
  }) => {
24111
24496
  if (!totalSharesLabel && model.venueShareBreakdown.length === 0) return null;
24112
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: cn(className, "gap-2"), children: [
24113
- 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)(
24114
24499
  Tooltip,
24115
24500
  {
24116
- content: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { children: row.sharesLabel }),
24501
+ content: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { children: row.sharesLabel }),
24117
24502
  "aria-label": `${row.venue} shares`,
24118
24503
  side: "top",
24119
- children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24504
+ children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24120
24505
  "span",
24121
24506
  {
24122
24507
  tabIndex: 0,
24123
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",
24124
24509
  "aria-label": `${row.venue} shares`,
24125
- 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" })
24126
24511
  }
24127
24512
  )
24128
24513
  },
24129
24514
  `${keyPrefix}-${row.venue}-${String(index)}`
24130
24515
  )) }) : null,
24131
- 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
24132
24517
  ] });
24133
24518
  };
24134
24519
  var StatusBadge = ({
@@ -24137,7 +24522,7 @@ var StatusBadge = ({
24137
24522
  }) => {
24138
24523
  if (status === "lost" || status === "won_claimed") return null;
24139
24524
  const isWon = status === "won_unclaimed";
24140
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24525
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24141
24526
  "span",
24142
24527
  {
24143
24528
  className: cn(
@@ -24146,7 +24531,7 @@ var StatusBadge = ({
24146
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"
24147
24532
  ),
24148
24533
  children: [
24149
- /* @__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!" }),
24150
24535
  isWon ? labels.won : labels.open
24151
24536
  ]
24152
24537
  }
@@ -24159,7 +24544,7 @@ var ResultBadge = ({
24159
24544
  if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
24160
24545
  const isWon = status === "won_claimed";
24161
24546
  const isSold = status === "sold";
24162
- return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24547
+ return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24163
24548
  "span",
24164
24549
  {
24165
24550
  className: cn(
@@ -24168,7 +24553,7 @@ var ResultBadge = ({
24168
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"
24169
24554
  ),
24170
24555
  children: [
24171
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24556
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24172
24557
  Icon,
24173
24558
  {
24174
24559
  name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
@@ -24184,27 +24569,27 @@ var ResultBadge = ({
24184
24569
  var TotalTradedCell = ({
24185
24570
  model,
24186
24571
  className
24187
- }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24572
+ }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24188
24573
  "div",
24189
24574
  {
24190
24575
  className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
24191
24576
  children: [
24192
- /* @__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 }),
24193
- /* @__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 })
24194
24579
  ]
24195
24580
  }
24196
24581
  );
24197
24582
  var PositionValueCell = ({
24198
24583
  value,
24199
24584
  className
24200
- }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
24585
+ }) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24201
24586
  "div",
24202
24587
  {
24203
24588
  className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
24204
24589
  children: [
24205
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24206
- /* @__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 }),
24207
- /* @__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)(
24208
24593
  "p",
24209
24594
  {
24210
24595
  className: cn(
@@ -24215,9 +24600,9 @@ var PositionValueCell = ({
24215
24600
  }
24216
24601
  )
24217
24602
  ] }),
24218
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
24219
- /* @__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 }),
24220
- /* @__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)(
24221
24606
  "p",
24222
24607
  {
24223
24608
  className: cn(
@@ -24239,7 +24624,7 @@ var PositionRow = ({
24239
24624
  onClaim,
24240
24625
  isClaiming = false
24241
24626
  }) => {
24242
- const labels = (0, import_hooks64.useLabels)().userProfile.positions;
24627
+ const labels = (0, import_hooks65.useLabels)().userProfile.positions;
24243
24628
  const model = toPositionRowViewModel(position, {
24244
24629
  avgPrefix: labels.avgPrefix,
24245
24630
  nowPrefix: labels.nowPrefix,
@@ -24281,7 +24666,7 @@ var PositionRow = ({
24281
24666
  handleDivClick();
24282
24667
  }
24283
24668
  };
24284
- 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)(
24285
24670
  "div",
24286
24671
  {
24287
24672
  className: cn(
@@ -24289,21 +24674,21 @@ var PositionRow = ({
24289
24674
  isClosed ? "md:gap-8" : "md:gap-6"
24290
24675
  ),
24291
24676
  children: [
24292
- /* @__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: [
24293
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
24294
- /* @__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)(
24295
24680
  RemoteImage,
24296
24681
  {
24297
- src: (0, import_hooks64.optimizedImageUrl)(model.thumbnailSrc, 60),
24682
+ src: (0, import_hooks65.optimizedImageUrl)(model.thumbnailSrc, 60),
24298
24683
  alt: "",
24299
24684
  className: "h-full w-full rounded-agg-sm object-cover"
24300
24685
  }
24301
24686
  ) }),
24302
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
24303
- /* @__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 }),
24304
- /* @__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: [
24305
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(OutcomePill, { label: model.selectedOutcomeLabel }),
24306
- /* @__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)(
24307
24692
  VenueShares,
24308
24693
  {
24309
24694
  model,
@@ -24315,10 +24700,10 @@ var PositionRow = ({
24315
24700
  ] })
24316
24701
  ] })
24317
24702
  ] }),
24318
- /* @__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 }) })
24319
24704
  ] }),
24320
- 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,
24321
- /* @__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)(
24322
24707
  VenueShares,
24323
24708
  {
24324
24709
  model,
@@ -24327,14 +24712,14 @@ var PositionRow = ({
24327
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"
24328
24713
  }
24329
24714
  ),
24330
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
24331
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "flex min-w-0 items-center gap-5", children: [
24332
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(TotalTradedCell, { model }),
24333
- /* @__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 })
24334
24719
  ] }),
24335
- 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: [
24336
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24337
- 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)(
24338
24723
  "button",
24339
24724
  {
24340
24725
  type: "button",
@@ -24343,48 +24728,48 @@ var PositionRow = ({
24343
24728
  disabled: isClaiming,
24344
24729
  "aria-busy": isClaiming || void 0,
24345
24730
  children: [
24346
- 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,
24347
24732
  labels.claim
24348
24733
  ]
24349
24734
  }
24350
24735
  ) : null
24351
24736
  ] })
24352
24737
  ] }),
24353
- isClosed ? /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
24354
- /* @__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 }) }),
24355
- /* @__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)(
24356
24741
  TotalTradedCell,
24357
24742
  {
24358
24743
  model,
24359
24744
  className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
24360
24745
  }
24361
24746
  ),
24362
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24747
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24363
24748
  PositionValueCell,
24364
24749
  {
24365
24750
  value: model.payout,
24366
24751
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
24367
24752
  }
24368
24753
  ),
24369
- /* @__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 }) })
24370
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
24371
- /* @__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)(
24372
24757
  TotalTradedCell,
24373
24758
  {
24374
24759
  model,
24375
24760
  className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
24376
24761
  }
24377
24762
  ),
24378
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
24763
+ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24379
24764
  PositionValueCell,
24380
24765
  {
24381
24766
  value: model.currentValue,
24382
24767
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
24383
24768
  }
24384
24769
  ),
24385
- /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
24386
- /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(StatusBadge, { status: model.positionStatus, labels }),
24387
- 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)(
24388
24773
  "button",
24389
24774
  {
24390
24775
  type: "button",
@@ -24393,14 +24778,14 @@ var PositionRow = ({
24393
24778
  disabled: isClaiming,
24394
24779
  "aria-busy": isClaiming || void 0,
24395
24780
  children: [
24396
- 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,
24397
24782
  labels.claim
24398
24783
  ]
24399
24784
  }
24400
24785
  ) : null
24401
24786
  ] })
24402
24787
  ] }),
24403
- /* @__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)(
24404
24789
  Icon,
24405
24790
  {
24406
24791
  name: "chevron-right",
@@ -24415,16 +24800,16 @@ var PositionRow = ({
24415
24800
  PositionRow.displayName = "PositionRow";
24416
24801
 
24417
24802
  // src/pages/user-profile/components/positions-activity.tsx
24418
- var import_jsx_runtime159 = require("react/jsx-runtime");
24803
+ var import_jsx_runtime160 = require("react/jsx-runtime");
24419
24804
  var tabItems = [
24420
24805
  { value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
24421
24806
  // Open orders is intentionally hidden from the user-profile tab group.
24422
24807
  // Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
24423
24808
  { value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
24424
24809
  ];
24425
- 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: [
24426
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
24427
- 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
24428
24813
  ] }, index)) });
24429
24814
  var PositionsActivity = ({
24430
24815
  activePositions = [],
@@ -24455,7 +24840,7 @@ var PositionsActivity = ({
24455
24840
  initialPositionFilter = "active",
24456
24841
  className
24457
24842
  }) => {
24458
- const positionsLabels = (0, import_hooks65.useLabels)().userProfile.positions;
24843
+ const positionsLabels = (0, import_hooks66.useLabels)().userProfile.positions;
24459
24844
  const isTabControlled = tab !== void 0;
24460
24845
  const [internalActiveTab, setInternalActiveTab] = (0, import_react43.useState)(
24461
24846
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
@@ -24585,7 +24970,7 @@ var PositionsActivity = ({
24585
24970
  isLoadingMoreActivities,
24586
24971
  onLoadMoreActivities
24587
24972
  ]);
24588
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24973
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24589
24974
  "div",
24590
24975
  {
24591
24976
  className: cn(
@@ -24594,7 +24979,7 @@ var PositionsActivity = ({
24594
24979
  className
24595
24980
  ),
24596
24981
  children: [
24597
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
24982
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24598
24983
  Tabs,
24599
24984
  {
24600
24985
  items: tabItems,
@@ -24608,7 +24993,7 @@ var PositionsActivity = ({
24608
24993
  }
24609
24994
  }
24610
24995
  ),
24611
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
24996
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24612
24997
  "div",
24613
24998
  {
24614
24999
  className: cn(
@@ -24616,12 +25001,12 @@ var PositionsActivity = ({
24616
25001
  isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
24617
25002
  ),
24618
25003
  children: [
24619
- 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: [
24620
- /* @__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) => {
24621
25006
  const isActive = filter.value === positionFilter;
24622
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex flex-1 items-stretch", children: [
24623
- idx > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
24624
- /* @__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)(
24625
25010
  "button",
24626
25011
  {
24627
25012
  type: "button",
@@ -24636,7 +25021,7 @@ var PositionsActivity = ({
24636
25021
  )
24637
25022
  ] }, filter.value);
24638
25023
  }) }),
24639
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
25024
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
24640
25025
  "div",
24641
25026
  {
24642
25027
  className: "agg-position-search relative flex w-full min-w-0 flex-1",
@@ -24647,9 +25032,9 @@ var PositionsActivity = ({
24647
25032
  setIsSearchFocused(false);
24648
25033
  },
24649
25034
  children: [
24650
- /* @__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: [
24651
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
24652
- /* @__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)(
24653
25038
  "input",
24654
25039
  {
24655
25040
  value: searchValue,
@@ -24664,7 +25049,7 @@ var PositionsActivity = ({
24664
25049
  }
24665
25050
  )
24666
25051
  ] }) }),
24667
- 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)(
24668
25053
  "ul",
24669
25054
  {
24670
25055
  className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
@@ -24677,26 +25062,26 @@ var PositionsActivity = ({
24677
25062
  setIsSearchFocused(false);
24678
25063
  onPositionClick == null ? void 0 : onPositionClick(item.raw);
24679
25064
  };
24680
- const innerContent = /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [
24681
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
24682
- /* @__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)(
24683
25068
  "img",
24684
25069
  {
24685
- src: (0, import_hooks65.optimizedImageUrl)(item.thumbnailSrc, 48),
25070
+ src: (0, import_hooks66.optimizedImageUrl)(item.thumbnailSrc, 48),
24686
25071
  alt: "",
24687
25072
  className: "size-12 shrink-0 rounded-agg-lg object-cover"
24688
25073
  }
24689
25074
  ),
24690
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
24691
- /* @__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 }),
24692
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
24693
- /* @__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 }),
24694
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
24695
- /* @__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 })
24696
25081
  ] })
24697
25082
  ] })
24698
25083
  ] }),
24699
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25084
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24700
25085
  Icon,
24701
25086
  {
24702
25087
  name: "chevron-right",
@@ -24705,7 +25090,7 @@ var PositionsActivity = ({
24705
25090
  }
24706
25091
  )
24707
25092
  ] });
24708
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25093
+ return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24709
25094
  "li",
24710
25095
  {
24711
25096
  role: "presentation",
@@ -24713,7 +25098,7 @@ var PositionsActivity = ({
24713
25098
  "agg-position-search-result-item",
24714
25099
  index > 0 && "border-t border-agg-separator"
24715
25100
  ),
24716
- children: itemHref ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25101
+ children: itemHref ? /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24717
25102
  "a",
24718
25103
  {
24719
25104
  href: itemHref,
@@ -24728,7 +25113,7 @@ var PositionsActivity = ({
24728
25113
  },
24729
25114
  children: innerContent
24730
25115
  }
24731
- ) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25116
+ ) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24732
25117
  "button",
24733
25118
  {
24734
25119
  type: "button",
@@ -24742,34 +25127,34 @@ var PositionsActivity = ({
24742
25127
  );
24743
25128
  })
24744
25129
  }
24745
- ) : /* @__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
24746
25131
  ]
24747
25132
  }
24748
25133
  )
24749
25134
  ] }) : null,
24750
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
24751
- /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "w-full px-4 sm:px-6", children: [
24752
- isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
24753
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
24754
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
24755
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
24756
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
24757
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
24758
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
24759
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
24760
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
24761
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
24762
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
24763
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
24764
- /* @__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 })
24765
25150
  ] }) : null,
24766
- isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
24767
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
24768
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
24769
- /* @__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" })
24770
25155
  ] }) : null
24771
25156
  ] }),
24772
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25157
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24773
25158
  "div",
24774
25159
  {
24775
25160
  ref: rowsScrollRef,
@@ -24781,8 +25166,8 @@ var PositionsActivity = ({
24781
25166
  "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
24782
25167
  "[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
24783
25168
  ),
24784
- children: isPositionsTab ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
24785
- 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)(
24786
25171
  EmptyState,
24787
25172
  {
24788
25173
  title: "Unable to load positions",
@@ -24790,15 +25175,15 @@ var PositionsActivity = ({
24790
25175
  }
24791
25176
  ) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
24792
25177
  var _a;
24793
- return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react43.Fragment, { children: [
24794
- 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)(
24795
25180
  "div",
24796
25181
  {
24797
25182
  className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
24798
25183
  "aria-hidden": true
24799
25184
  }
24800
25185
  ) : null,
24801
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25186
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24802
25187
  PositionRow,
24803
25188
  {
24804
25189
  position,
@@ -24812,15 +25197,15 @@ var PositionsActivity = ({
24812
25197
  }
24813
25198
  )
24814
25199
  ] }, position.id);
24815
- }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25200
+ }) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24816
25201
  EmptyState,
24817
25202
  {
24818
25203
  title: "No positions yet",
24819
25204
  description: "Your open trades will appear here once you place an order."
24820
25205
  }
24821
25206
  ),
24822
- isLoadingMorePositions ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
24823
- 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)(
24824
25209
  "div",
24825
25210
  {
24826
25211
  ref: positionsLoadMoreRef,
@@ -24828,22 +25213,22 @@ var PositionsActivity = ({
24828
25213
  "aria-hidden": true
24829
25214
  }
24830
25215
  ) : null
24831
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "agg-activity-list flex flex-col gap-5", children: [
24832
- 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)(
24833
25218
  EmptyState,
24834
25219
  {
24835
25220
  title: "Unable to load activity",
24836
25221
  description: "Please try again in a moment."
24837
25222
  }
24838
- ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_react43.Fragment, { children: [
24839
- 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)(
24840
25225
  "div",
24841
25226
  {
24842
25227
  className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
24843
25228
  "aria-hidden": true
24844
25229
  }
24845
25230
  ) : null,
24846
- /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25231
+ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24847
25232
  ActivityRow,
24848
25233
  {
24849
25234
  activity,
@@ -24851,15 +25236,15 @@ var PositionsActivity = ({
24851
25236
  onClick: onActivityClick
24852
25237
  }
24853
25238
  )
24854
- ] }, activity.id)) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
25239
+ ] }, activity.id)) : /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
24855
25240
  EmptyState,
24856
25241
  {
24857
25242
  title: "No activity yet",
24858
25243
  description: "Your trading activity will appear here."
24859
25244
  }
24860
25245
  ),
24861
- isLoadingMoreActivities ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
24862
- 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)(
24863
25248
  "div",
24864
25249
  {
24865
25250
  ref: activitiesLoadMoreRef,
@@ -24881,14 +25266,14 @@ var PositionsActivity = ({
24881
25266
  PositionsActivity.displayName = "PositionsActivity";
24882
25267
 
24883
25268
  // src/pages/user-profile/components/positions-value-card.tsx
24884
- var import_jsx_runtime160 = require("react/jsx-runtime");
25269
+ var import_jsx_runtime161 = require("react/jsx-runtime");
24885
25270
  var PositionsValueCard = ({
24886
25271
  label: label2 = "Positions Value",
24887
25272
  valueLabel,
24888
25273
  isLoading = false,
24889
25274
  className
24890
25275
  }) => {
24891
- return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(
25276
+ return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
24892
25277
  "div",
24893
25278
  {
24894
25279
  className: cn(
@@ -24897,8 +25282,8 @@ var PositionsValueCard = ({
24897
25282
  className
24898
25283
  ),
24899
25284
  children: [
24900
- /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)("div", { className: "flex items-center gap-2", children: [
24901
- /* @__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)(
24902
25287
  "svg",
24903
25288
  {
24904
25289
  xmlns: "http://www.w3.org/2000/svg",
@@ -24906,7 +25291,7 @@ var PositionsValueCard = ({
24906
25291
  height: "16",
24907
25292
  viewBox: "0 0 16 16",
24908
25293
  fill: "none",
24909
- children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
25294
+ children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
24910
25295
  "path",
24911
25296
  {
24912
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",
@@ -24915,22 +25300,51 @@ var PositionsValueCard = ({
24915
25300
  )
24916
25301
  }
24917
25302
  ),
24918
- /* @__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 })
24919
25304
  ] }),
24920
- /* @__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 })
24921
25306
  ]
24922
25307
  }
24923
25308
  );
24924
25309
  };
24925
25310
  PositionsValueCard.displayName = "PositionsValueCard";
24926
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
+
24927
25333
  // src/pages/user-profile/components/user-info-card.tsx
24928
- 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";
24929
25343
 
24930
25344
  // src/pages/user-profile/components/default-avatar.tsx
24931
- var import_jsx_runtime161 = require("react/jsx-runtime");
25345
+ var import_jsx_runtime162 = require("react/jsx-runtime");
24932
25346
  var DefaultAvatar = ({ className }) => {
24933
- return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
25347
+ return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
24934
25348
  "svg",
24935
25349
  {
24936
25350
  xmlns: "http://www.w3.org/2000/svg",
@@ -24941,15 +25355,15 @@ var DefaultAvatar = ({ className }) => {
24941
25355
  className: cn("shrink-0 text-agg-muted-foreground", className),
24942
25356
  "aria-hidden": true,
24943
25357
  children: [
24944
- /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("g", { clipPath: "url(#clip0_default_avatar)", children: [
24945
- /* @__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)(
24946
25360
  "path",
24947
25361
  {
24948
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",
24949
25363
  fill: "var(--agg-color-secondary-hover)"
24950
25364
  }
24951
25365
  ),
24952
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
25366
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
24953
25367
  "path",
24954
25368
  {
24955
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",
@@ -24957,7 +25371,7 @@ var DefaultAvatar = ({ className }) => {
24957
25371
  fillOpacity: "0.12"
24958
25372
  }
24959
25373
  ),
24960
- /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
25374
+ /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
24961
25375
  "path",
24962
25376
  {
24963
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",
@@ -24966,7 +25380,7 @@ var DefaultAvatar = ({ className }) => {
24966
25380
  }
24967
25381
  )
24968
25382
  ] }),
24969
- /* @__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" }) }) })
24970
25384
  ]
24971
25385
  }
24972
25386
  );
@@ -24974,7 +25388,7 @@ var DefaultAvatar = ({ className }) => {
24974
25388
  DefaultAvatar.displayName = "DefaultAvatar";
24975
25389
 
24976
25390
  // src/pages/user-profile/components/user-info-card.tsx
24977
- var import_jsx_runtime162 = require("react/jsx-runtime");
25391
+ var import_jsx_runtime163 = require("react/jsx-runtime");
24978
25392
  var UserInfoCard = ({
24979
25393
  user,
24980
25394
  onEditProfile,
@@ -24984,10 +25398,10 @@ var UserInfoCard = ({
24984
25398
  className
24985
25399
  }) => {
24986
25400
  var _a;
24987
- const labels = (0, import_hooks66.useLabels)();
25401
+ const labels = (0, import_hooks67.useLabels)();
24988
25402
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
24989
25403
  const hasWallets = wallets.length > 0;
24990
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25404
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
24991
25405
  "div",
24992
25406
  {
24993
25407
  className: cn(
@@ -24996,26 +25410,26 @@ var UserInfoCard = ({
24996
25410
  className
24997
25411
  ),
24998
25412
  children: [
24999
- /* @__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: [
25000
- /* @__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)(
25001
25415
  RemoteImage,
25002
25416
  {
25003
- src: (0, import_hooks66.optimizedImageUrl)(user.avatarUrl, 120),
25417
+ src: (0, import_hooks67.optimizedImageUrl)(user.avatarUrl, 120),
25004
25418
  alt: user.username,
25005
25419
  className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
25006
25420
  }
25007
- ) : /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
25008
- /* @__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: [
25009
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
25010
- /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [
25011
- /* @__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 }),
25012
- 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) => {
25013
25427
  const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
25014
- 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" }) });
25015
25429
  if (!social.handle) {
25016
- 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`);
25017
25431
  }
25018
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25432
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
25019
25433
  "a",
25020
25434
  {
25021
25435
  href: social.handle,
@@ -25028,55 +25442,55 @@ var UserInfoCard = ({
25028
25442
  );
25029
25443
  }) }) : null
25030
25444
  ] }),
25031
- onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25445
+ onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
25032
25446
  "button",
25033
25447
  {
25034
25448
  type: "button",
25035
25449
  onClick: onEditProfile,
25036
25450
  className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
25037
25451
  children: [
25038
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
25039
- /* @__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" })
25040
25454
  ]
25041
25455
  }
25042
25456
  ) : null
25043
25457
  ] }),
25044
- 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: [
25045
25459
  wallets.map((wallet, idx) => {
25046
25460
  const chainLower = wallet.chain.toLowerCase();
25047
25461
  const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
25048
- return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25462
+ return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
25049
25463
  "div",
25050
25464
  {
25051
25465
  className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
25052
25466
  children: [
25053
- /* @__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" }) }),
25054
- /* @__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 })
25055
25469
  ]
25056
25470
  },
25057
25471
  `wallet-${idx}`
25058
25472
  );
25059
25473
  }),
25060
- 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
25061
25475
  ] }) : null
25062
25476
  ] })
25063
25477
  ] }),
25064
- (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: [
25065
- 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)(
25066
25480
  ConditionalWrapper,
25067
25481
  {
25068
25482
  condition: isDepositBlocked,
25069
- wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25483
+ wrapper: (children) => /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
25070
25484
  Tooltip,
25071
25485
  {
25072
- 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 }),
25073
25487
  size: "small",
25074
25488
  side: "bottom",
25075
25489
  sideOffset: 4,
25076
25490
  children
25077
25491
  }
25078
25492
  ),
25079
- children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25493
+ children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
25080
25494
  Button,
25081
25495
  __spreadProps(__spreadValues({
25082
25496
  variant: "primary",
@@ -25088,7 +25502,7 @@ var UserInfoCard = ({
25088
25502
  )
25089
25503
  }
25090
25504
  ) : null,
25091
- onWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
25505
+ onWithdraw ? /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
25092
25506
  Button,
25093
25507
  {
25094
25508
  variant: "secondary",
@@ -25098,15 +25512,15 @@ var UserInfoCard = ({
25098
25512
  children: labels.auth.withdraw
25099
25513
  }
25100
25514
  ) : null,
25101
- onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(
25515
+ onEditProfile ? /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
25102
25516
  "button",
25103
25517
  {
25104
25518
  type: "button",
25105
25519
  onClick: onEditProfile,
25106
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",
25107
25521
  children: [
25108
- /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
25109
- /* @__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" })
25110
25524
  ]
25111
25525
  }
25112
25526
  ) : null
@@ -25117,29 +25531,8 @@ var UserInfoCard = ({
25117
25531
  };
25118
25532
  UserInfoCard.displayName = "UserInfoCard";
25119
25533
 
25120
- // src/pages/user-profile/transaction-explorer.ts
25121
- var AGG_TX_EXPLORER_URLS = {
25122
- "1": "https://etherscan.io/tx/",
25123
- "56": "https://bscscan.com/tx/",
25124
- "137": "https://polygonscan.com/tx/",
25125
- "1337": "https://app.hyperliquid.xyz/explorer/tx/",
25126
- "8453": "https://basescan.org/tx/",
25127
- "42161": "https://arbiscan.io/tx/",
25128
- "792703809": "https://solscan.io/tx/"
25129
- };
25130
- var buildAggTxExplorerHref = (chainId, txHash) => {
25131
- if (chainId === null || chainId === void 0) return void 0;
25132
- if (!txHash) return void 0;
25133
- const normalizedChainId = String(chainId).trim();
25134
- const normalizedTxHash = txHash.trim();
25135
- if (!normalizedChainId || !normalizedTxHash) return void 0;
25136
- const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
25137
- if (!baseUrl) return void 0;
25138
- return `${baseUrl}${normalizedTxHash}`;
25139
- };
25140
-
25141
25534
  // src/pages/user-profile/index.tsx
25142
- var import_jsx_runtime163 = require("react/jsx-runtime");
25535
+ var import_jsx_runtime164 = require("react/jsx-runtime");
25143
25536
  var currencyFormatter = new Intl.NumberFormat("en-US", {
25144
25537
  style: "currency",
25145
25538
  currency: "USD",
@@ -25470,11 +25863,49 @@ var toRedeemPayoutAmountLabel = (item) => {
25470
25863
  sign: "+"
25471
25864
  });
25472
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
+ };
25473
25904
  var POSITION_ROW_VENUE_ORDER = [
25474
- import_sdk19.Venue.polymarket,
25475
- import_sdk19.Venue.kalshi,
25476
- import_sdk19.Venue.opinion,
25477
- import_sdk19.Venue.limitless
25905
+ import_sdk20.Venue.polymarket,
25906
+ import_sdk20.Venue.kalshi,
25907
+ import_sdk20.Venue.opinion,
25908
+ import_sdk20.Venue.limitless
25478
25909
  ];
25479
25910
  function venueBreakdownSortKey(venue) {
25480
25911
  const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
@@ -25549,15 +25980,15 @@ var UserProfilePage = ({
25549
25980
  (0, import_react44.useEffect)(() => {
25550
25981
  setIsHydrated(true);
25551
25982
  }, []);
25552
- const { user: currentUser, isAuthenticated } = (0, import_hooks67.useAggAuthState)();
25553
- const { isDepositBlocked } = (0, import_hooks67.useGeoBlock)();
25554
- const balanceState = (0, import_hooks67.useAggBalance)();
25555
- const client = (0, import_hooks67.useAggClient)();
25556
- 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)();
25557
25988
  const {
25558
25989
  trading: { executionMode: configuredExecutionMode }
25559
- } = (0, import_hooks67.useSdkUiConfig)();
25560
- const queryClient = (0, import_hooks67.useQueryClient)();
25990
+ } = (0, import_hooks68.useSdkUiConfig)();
25991
+ const queryClient = (0, import_hooks68.useQueryClient)();
25561
25992
  const [internalCancellingIds, setInternalCancellingIds] = (0, import_react44.useState)({});
25562
25993
  const { claim: startClaim, claimingKeys } = useClaimWinnings({
25563
25994
  onClaim,
@@ -25574,15 +26005,16 @@ var UserProfilePage = ({
25574
26005
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
25575
26006
  }, [balanceState, shouldUseHookData]);
25576
26007
  const [positionFilter, setPositionFilter] = (0, import_react44.useState)(initialPositionFilter);
26008
+ const [selectedClaimActivity, setSelectedClaimActivity] = (0, import_react44.useState)(null);
25577
26009
  const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
25578
26010
  const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
25579
- const activePositionsQuery = (0, import_hooks67.useExecutionPositions)({
26011
+ const activePositionsQuery = (0, import_hooks68.useExecutionPositions)({
25580
26012
  enabled: shouldUseHookData && isAuthenticated,
25581
26013
  status: "active",
25582
26014
  limit: 25,
25583
26015
  mode: queryExecutionMode
25584
26016
  });
25585
- const closedPositionsQuery = (0, import_hooks67.useExecutionPositions)({
26017
+ const closedPositionsQuery = (0, import_hooks68.useExecutionPositions)({
25586
26018
  enabled: shouldUseHookData && isAuthenticated,
25587
26019
  status: "closed",
25588
26020
  limit: 25,
@@ -25598,12 +26030,12 @@ var UserProfilePage = ({
25598
26030
  (0, import_react44.useEffect)(() => {
25599
26031
  setPositionFilter(initialPositionFilter);
25600
26032
  }, [initialPositionFilter]);
25601
- const ordersQuery = (0, import_hooks67.useExecutionOrders)({
26033
+ const ordersQuery = (0, import_hooks68.useExecutionOrders)({
25602
26034
  enabled: shouldUseHookData && isAuthenticated,
25603
26035
  limit: 25,
25604
26036
  mode: queryExecutionMode
25605
26037
  });
25606
- const activityQuery = (0, import_hooks67.useUserActivity)({
26038
+ const activityQuery = (0, import_hooks68.useUserActivity)({
25607
26039
  enabled: shouldUseHookData && isAuthenticated,
25608
26040
  limit: 25
25609
26041
  });
@@ -25638,6 +26070,22 @@ var UserProfilePage = ({
25638
26070
  },
25639
26071
  [startClaim]
25640
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
+ }, []);
25641
26089
  (0, import_react44.useEffect)(() => {
25642
26090
  if (!shouldUseHookData || !isAuthenticated) {
25643
26091
  setProfileUser(void 0);
@@ -25661,7 +26109,7 @@ var UserProfilePage = ({
25661
26109
  var _a, _b, _c, _d, _e, _f;
25662
26110
  if (user) return user;
25663
26111
  const fullUser = profileUser != null ? profileUser : currentUser;
25664
- const walletAddress = (0, import_hooks67.getWalletAddressFromUserProfile)(fullUser);
26112
+ const walletAddress = (0, import_hooks68.getWalletAddressFromUserProfile)(fullUser);
25665
26113
  const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
25666
26114
  const twitterAccount = (_a = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a.find(
25667
26115
  (account) => String(account.provider).toLowerCase() === "twitter"
@@ -25831,6 +26279,7 @@ var UserProfilePage = ({
25831
26279
  const isFailed = status === "failed";
25832
26280
  const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
25833
26281
  const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
26282
+ const transactions = toRedeemTransactions(redeemItem);
25834
26283
  return {
25835
26284
  kind: "redeem",
25836
26285
  id: redeemItem.id,
@@ -25846,7 +26295,8 @@ var UserProfilePage = ({
25846
26295
  marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
25847
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 : "",
25848
26297
  amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
25849
- timeLabel
26298
+ timeLabel,
26299
+ transactions
25850
26300
  };
25851
26301
  }
25852
26302
  logUnknownActivityType(item);
@@ -25883,7 +26333,7 @@ var UserProfilePage = ({
25883
26333
  (groups) => {
25884
26334
  return groups.flatMap((group) => {
25885
26335
  var _a, _b, _c, _d;
25886
- const closedTotals = (0, import_hooks67.computeClosedPositionTotals)(group);
26336
+ const closedTotals = (0, import_hooks68.computeClosedPositionTotals)(group);
25887
26337
  const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
25888
26338
  (outcome) => outcome.winner === true
25889
26339
  );
@@ -25957,7 +26407,7 @@ var UserProfilePage = ({
25957
26407
  const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
25958
26408
  return source.filter(shouldIncludeByShares);
25959
26409
  }, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
25960
- 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)(
25961
26411
  "section",
25962
26412
  {
25963
26413
  className: cn(
@@ -25965,7 +26415,7 @@ var UserProfilePage = ({
25965
26415
  "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
25966
26416
  classNames == null ? void 0 : classNames.root
25967
26417
  ),
25968
- children: /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
26418
+ children: /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
25969
26419
  "div",
25970
26420
  {
25971
26421
  className: cn(
@@ -25975,8 +26425,8 @@ var UserProfilePage = ({
25975
26425
  classNames == null ? void 0 : classNames.topRow
25976
26426
  ),
25977
26427
  children: [
25978
- /* @__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: [
25979
- /* @__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)(
25980
26430
  "div",
25981
26431
  {
25982
26432
  className: cn(
@@ -25984,7 +26434,7 @@ var UserProfilePage = ({
25984
26434
  "flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
25985
26435
  classNames == null ? void 0 : classNames.leftColumn
25986
26436
  ),
25987
- children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26437
+ children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
25988
26438
  UserInfoCard,
25989
26439
  {
25990
26440
  user: resolvedUser,
@@ -25997,7 +26447,7 @@ var UserProfilePage = ({
25997
26447
  )
25998
26448
  }
25999
26449
  ),
26000
- /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)(
26450
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(
26001
26451
  "div",
26002
26452
  {
26003
26453
  className: cn(
@@ -26005,14 +26455,14 @@ var UserProfilePage = ({
26005
26455
  classNames == null ? void 0 : classNames.rightColumn
26006
26456
  ),
26007
26457
  children: [
26008
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26458
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
26009
26459
  PositionsValueCard,
26010
26460
  {
26011
26461
  valueLabel: positionsValueLabel,
26012
26462
  isLoading: isPositionsValueLoading
26013
26463
  }
26014
26464
  ),
26015
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26465
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
26016
26466
  AvailableBalanceCard,
26017
26467
  {
26018
26468
  valueLabel: availableBalanceLabel,
@@ -26030,7 +26480,7 @@ var UserProfilePage = ({
26030
26480
  }
26031
26481
  )
26032
26482
  ] }),
26033
- /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(
26483
+ /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(
26034
26484
  PositionsActivity,
26035
26485
  {
26036
26486
  tab,
@@ -26043,8 +26493,11 @@ var UserProfilePage = ({
26043
26493
  getPositionHref,
26044
26494
  onClaim: handleClaimPosition,
26045
26495
  claimingPositionKeys: claimingKeys,
26046
- onActivityClick,
26047
- getActivityHref,
26496
+ onActivityClick: handleActivityRowClick,
26497
+ getActivityHref: (activity) => {
26498
+ if (activity.kind === "redeem") return void 0;
26499
+ return getActivityHref == null ? void 0 : getActivityHref(activity);
26500
+ },
26048
26501
  onOpenOrderClick,
26049
26502
  onCancelOrder: handleCancelOrder,
26050
26503
  cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
@@ -26078,6 +26531,17 @@ var UserProfilePage = ({
26078
26531
  } : void 0,
26079
26532
  className: classNames == null ? void 0 : classNames.positionsActivity
26080
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
+ }
26081
26545
  )
26082
26546
  ]
26083
26547
  }