@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
@@ -10,7 +10,7 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-BTRFSEPC.mjs";
13
+ } from "./chunk-QM3WWPCV.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
@@ -18,10 +18,10 @@ import {
18
18
  WITHDRAW_MODAL_OPEN_EVENT,
19
19
  useClaimWinnings,
20
20
  useResolvedMarketClaim
21
- } from "./chunk-73MO7MYG.mjs";
21
+ } from "./chunk-JOZPXDNZ.mjs";
22
22
  import {
23
23
  getDisplayOutcomePrice
24
- } from "./chunk-TR7HUVY7.mjs";
24
+ } from "./chunk-LPIAEKSZ.mjs";
25
25
  import {
26
26
  AggErrorBoundary,
27
27
  Button,
@@ -48,10 +48,11 @@ import {
48
48
  __spreadValues,
49
49
  cn,
50
50
  filterOpenEvents,
51
+ normalizeVenueMarketCluster,
51
52
  resolveTabVenus,
52
53
  shortenAddress,
53
54
  sortCategoriesForNavigation
54
- } from "./chunk-MIAAL7BL.mjs";
55
+ } from "./chunk-UTXQUOU3.mjs";
55
56
 
56
57
  // src/pages/home/index.tsx
57
58
  import {
@@ -61,7 +62,8 @@ import {
61
62
  useEventListState,
62
63
  useLabels as useLabels4,
63
64
  useSdkUiConfig as useSdkUiConfig4,
64
- useSearch
65
+ useSearch,
66
+ useVenueMarketMidpoints
65
67
  } from "@agg-build/hooks";
66
68
  import { VENUES } from "@agg-build/sdk";
67
69
  import { useCallback as useCallback4, useEffect as useEffect8, useMemo as useMemo5, useRef as useRef7, useState as useState9 } from "react";
@@ -381,258 +383,6 @@ import {
381
383
  } from "@agg-build/hooks";
382
384
  import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
383
385
 
384
- // src/pages/event-market/sports-market-card.tsx
385
- import {
386
- MarketStatus,
387
- resolveMarketTradingState,
388
- useEventTradingContext,
389
- useLabels as useLabels2,
390
- useSdkUiConfig
391
- } from "@agg-build/hooks";
392
- import { useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
393
-
394
- // src/pages/event-market/sports-line-rail.tsx
395
- import * as React from "react";
396
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
397
- function VenueRow({ venues, active }) {
398
- if (!venues || venues.length === 0) return /* @__PURE__ */ jsx2("span", { className: "h-4" });
399
- const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
400
- const extra = venues.length - shown.length;
401
- return /* @__PURE__ */ jsxs2(
402
- "span",
403
- {
404
- className: cn(
405
- "flex h-4 items-center justify-center gap-1",
406
- !active && "text-agg-muted-foreground"
407
- ),
408
- children: [
409
- shown.map((venue, index) => /* @__PURE__ */ jsx2(
410
- VenueLogo,
411
- {
412
- venue,
413
- isMonochromatic: !active,
414
- size: "small",
415
- className: "size-3! shrink-0"
416
- },
417
- `${venue}-${index}`
418
- )),
419
- extra > 0 && /* @__PURE__ */ jsxs2("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
420
- "+",
421
- extra
422
- ] })
423
- ]
424
- }
425
- );
426
- }
427
- function SportsLineRail({
428
- stops,
429
- selectedIndex,
430
- onSelect,
431
- ariaLabel,
432
- previousAriaLabel,
433
- nextAriaLabel,
434
- className
435
- }) {
436
- const scrollRef = React.useRef(null);
437
- const itemRefs = React.useRef([]);
438
- const didInit = React.useRef(false);
439
- const programmatic = React.useRef(false);
440
- const progTimer = React.useRef(void 0);
441
- const skipCenterOnPropSync = React.useRef(false);
442
- const pendingScrollIndex = React.useRef(null);
443
- const scrollSettleTimer = React.useRef(void 0);
444
- const stopCount = stops.length;
445
- const [pad, setPad] = React.useState({ left: 0, right: 0 });
446
- const [mask, setMask] = React.useState({ left: false, right: false });
447
- const updateMask = React.useCallback(() => {
448
- const c = scrollRef.current;
449
- if (!c || !c.clientWidth) return;
450
- setMask({
451
- left: c.scrollLeft > 1,
452
- right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
453
- });
454
- }, []);
455
- const resolveNearestIndexToViewportCenter = React.useCallback(() => {
456
- const container = scrollRef.current;
457
- if (!container || !container.clientWidth) return null;
458
- const viewportCenter = container.scrollLeft + container.clientWidth / 2;
459
- let nearestIndex = null;
460
- let nearestDistance = Number.POSITIVE_INFINITY;
461
- itemRefs.current.forEach((item, index) => {
462
- if (!item) return;
463
- const itemCenter = item.offsetLeft + item.offsetWidth / 2;
464
- const distance = Math.abs(itemCenter - viewportCenter);
465
- if (distance < nearestDistance) {
466
- nearestDistance = distance;
467
- nearestIndex = index;
468
- }
469
- });
470
- return nearestIndex;
471
- }, []);
472
- React.useLayoutEffect(() => {
473
- const c = scrollRef.current;
474
- if (!c) return;
475
- const measure = () => {
476
- var _a, _b, _c, _d;
477
- const w = c.clientWidth;
478
- if (!w) return;
479
- const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
480
- const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
481
- setPad({
482
- left: Math.max(0, w / 2 - firstW / 2),
483
- right: Math.max(0, w / 2 - lastW / 2)
484
- });
485
- updateMask();
486
- };
487
- const onScroll = () => {
488
- if (!programmatic.current) {
489
- const nearestIndex = resolveNearestIndexToViewportCenter();
490
- if (nearestIndex != null && nearestIndex !== selectedIndex) {
491
- pendingScrollIndex.current = nearestIndex;
492
- clearTimeout(scrollSettleTimer.current);
493
- scrollSettleTimer.current = setTimeout(() => {
494
- const nextIndex = pendingScrollIndex.current;
495
- if (nextIndex == null || nextIndex === selectedIndex) return;
496
- skipCenterOnPropSync.current = true;
497
- onSelect(nextIndex);
498
- }, 120);
499
- }
500
- }
501
- updateMask();
502
- };
503
- measure();
504
- const ro = new ResizeObserver(measure);
505
- ro.observe(c);
506
- c.addEventListener("scroll", onScroll, { passive: true });
507
- return () => {
508
- ro.disconnect();
509
- c.removeEventListener("scroll", onScroll);
510
- clearTimeout(scrollSettleTimer.current);
511
- };
512
- }, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
513
- React.useEffect(() => {
514
- pendingScrollIndex.current = selectedIndex;
515
- }, [selectedIndex]);
516
- React.useEffect(() => {
517
- const c = scrollRef.current;
518
- const el = itemRefs.current[selectedIndex];
519
- if (!c || !el || !c.clientWidth) return;
520
- if (skipCenterOnPropSync.current) {
521
- skipCenterOnPropSync.current = false;
522
- updateMask();
523
- return;
524
- }
525
- const max = c.scrollWidth - c.clientWidth;
526
- const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
527
- programmatic.current = true;
528
- c.scrollTo({
529
- left: Math.max(0, Math.min(max, target)),
530
- behavior: didInit.current ? "smooth" : "auto"
531
- });
532
- if (pad.left > 0 || pad.right > 0) didInit.current = true;
533
- clearTimeout(progTimer.current);
534
- progTimer.current = setTimeout(() => {
535
- programmatic.current = false;
536
- }, 500);
537
- updateMask();
538
- }, [selectedIndex, stopCount, pad, updateMask]);
539
- const select = (index) => {
540
- const next = Math.min(stops.length - 1, Math.max(0, index));
541
- if (next !== selectedIndex) onSelect(next);
542
- };
543
- const step = (delta) => select(selectedIndex + delta);
544
- if (stopCount === 0) return null;
545
- return /* @__PURE__ */ jsxs2(
546
- "div",
547
- {
548
- className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
549
- "aria-label": ariaLabel,
550
- children: [
551
- /* @__PURE__ */ jsx2(
552
- "button",
553
- {
554
- type: "button",
555
- onClick: () => step(-1),
556
- disabled: selectedIndex === 0,
557
- "aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
558
- 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",
559
- children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-left", className: "size-4" })
560
- }
561
- ),
562
- /* @__PURE__ */ jsxs2("div", { className: "relative min-w-0 flex-1", children: [
563
- /* @__PURE__ */ jsx2(
564
- "div",
565
- {
566
- ref: scrollRef,
567
- style: { paddingLeft: pad.left, paddingRight: pad.right },
568
- className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
569
- children: stops.map((stop, index) => {
570
- const active = index === selectedIndex;
571
- return /* @__PURE__ */ jsxs2(
572
- "button",
573
- {
574
- type: "button",
575
- ref: (el) => {
576
- itemRefs.current[index] = el;
577
- },
578
- onClick: () => select(index),
579
- disabled: stop.disabled,
580
- "aria-pressed": active,
581
- className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
582
- children: [
583
- /* @__PURE__ */ jsx2(
584
- "span",
585
- {
586
- className: cn(
587
- "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",
588
- 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"
589
- ),
590
- children: stop.value
591
- }
592
- ),
593
- /* @__PURE__ */ jsx2(VenueRow, { venues: stop.venues, active })
594
- ]
595
- },
596
- index
597
- );
598
- })
599
- }
600
- ),
601
- /* @__PURE__ */ jsx2(
602
- "span",
603
- {
604
- className: cn(
605
- "pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
606
- mask.left ? "opacity-100" : "opacity-0"
607
- )
608
- }
609
- ),
610
- /* @__PURE__ */ jsx2(
611
- "span",
612
- {
613
- className: cn(
614
- "pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
615
- mask.right ? "opacity-100" : "opacity-0"
616
- )
617
- }
618
- )
619
- ] }),
620
- /* @__PURE__ */ jsx2(
621
- "button",
622
- {
623
- type: "button",
624
- onClick: () => step(1),
625
- disabled: selectedIndex === stopCount - 1,
626
- "aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
627
- 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",
628
- children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-right", className: "size-4" })
629
- }
630
- )
631
- ]
632
- }
633
- );
634
- }
635
-
636
386
  // src/pages/event-market/sports-event-market.utils.ts
637
387
  var SPORTS_MARKET_TYPE_KEYS = [
638
388
  "moneyline",
@@ -689,6 +439,10 @@ var SPORTS_LEGACY_PROP_CATEGORY_KEY_SET = /* @__PURE__ */ new Set([
689
439
  "assists",
690
440
  "shots"
691
441
  ]);
442
+ var SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET = /* @__PURE__ */ new Set([
443
+ "exact_score",
444
+ ...SPORTS_LEGACY_PROP_CATEGORY_KEY_SET
445
+ ]);
692
446
  var SPORTS_MARKET_GROUP_TO_TAB = {
693
447
  game_lines: "game_lines",
694
448
  spreads: "game_lines",
@@ -776,9 +530,15 @@ var SPORTS_MARKET_TYPE_ORDER = [
776
530
  ];
777
531
  var YES_NO_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
778
532
  var LINE_MARKET_TYPES = /* @__PURE__ */ new Set(["spread", "total"]);
533
+ var PLAYER_PROP_COUNT_PATTERN = /\+\s|\bo\/u\b|\bover\/under\b/i;
534
+ var REG_TIME_TITLE_PATTERN = /^reg(?:ular)?\s*time\s*:/i;
779
535
  var toTrimmedString = (value) => {
780
536
  return typeof value === "string" ? value.trim() : "";
781
537
  };
538
+ var resolveSportsMarketAggKey = (market) => {
539
+ const typedMarket = market;
540
+ return toTrimmedString(typedMarket.aggKey);
541
+ };
782
542
  var sanitizeFamilyValue = (value) => {
783
543
  return value.toLowerCase().replace(/[-+]?\d+(?:\.\d+)?/g, "").replace(/[¢$]/g, "").replace(/\s+/g, " ").replace(/[|:()[\]{}]/g, "").trim();
784
544
  };
@@ -838,15 +598,36 @@ var normalizeSportsMarketGroup = (value) => {
838
598
  if (!resolvedValue) return null;
839
599
  return SPORTS_MARKET_GROUP_KEY_SET.has(resolvedValue) ? resolvedValue : "other";
840
600
  };
841
- var resolveMarketSectionTabKey = (market) => {
842
- const category = normalizeSportsMarketCategory(market.marketCategory);
843
- if (category && SPORTS_LEGACY_PROP_CATEGORY_KEY_SET.has(category)) {
601
+ var resolveFallbackSportsMarketCategory = (market) => {
602
+ const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
603
+ const question = toTrimmedString(market.question).toLowerCase();
604
+ if (marketSubtype.includes("exact_score") || marketSubtype.includes("correct_score") || question.includes("exact score") || question.includes("correct score")) {
605
+ return "exact_score";
606
+ }
607
+ if (marketSubtype.includes("corner") || question.includes("corner")) {
608
+ return "corners";
609
+ }
610
+ if (marketSubtype.includes("shot")) return "shots";
611
+ if (marketSubtype.includes("assist")) return "assists";
612
+ if (marketSubtype.includes("goal")) return "goals";
613
+ if (!PLAYER_PROP_COUNT_PATTERN.test(question) || !question.includes(":") || question.includes(" vs ") || question.includes(" vs. ")) {
614
+ return null;
615
+ }
616
+ if (question.includes("shot")) return "shots";
617
+ if (question.includes("assist")) return "assists";
618
+ if (question.includes("goal")) return "goals";
619
+ return null;
620
+ };
621
+ var resolveMarketSectionTabKey = (market) => {
622
+ const normalizedCategory = normalizeSportsMarketCategory(market.marketCategory);
623
+ const fallbackCategory = !normalizedCategory || normalizedCategory === "other" ? resolveFallbackSportsMarketCategory(market) : null;
624
+ const category = fallbackCategory != null ? fallbackCategory : normalizedCategory;
625
+ if (category && SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET.has(category)) {
844
626
  return category;
845
627
  }
846
628
  const group = normalizeSportsMarketGroup(market.marketGroup);
847
629
  if (group) return SPORTS_MARKET_GROUP_TO_TAB[group];
848
630
  if (category === "game_lines") return "game_lines";
849
- if (category === "exact_score") return "exact_score";
850
631
  if (category === "other") return "other";
851
632
  return null;
852
633
  };
@@ -870,13 +651,27 @@ var resolveSportsSectionMarkets = ({
870
651
  sectionMarkets
871
652
  }) => {
872
653
  const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tabKey);
873
- if (tabKey !== "game_lines") return effectiveSectionMarkets;
874
- const eventMoneylineMarkets = eventMarkets.filter(
875
- (market) => normalizeSportsMarketType(market.sportsMarketType) === "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
654
+ const filteredSectionMarkets = effectiveSectionMarkets.filter(
655
+ (market) => resolveMarketSectionTabKey(market) === tabKey
876
656
  );
877
- if (eventMoneylineMarkets.length === 0) return effectiveSectionMarkets;
878
- const lineSectionMarkets = effectiveSectionMarkets.filter(
879
- (market) => normalizeSportsMarketType(market.sportsMarketType) !== "moneyline"
657
+ if (tabKey !== "game_lines") return filteredSectionMarkets;
658
+ const eventMoneylineMarkets = (() => {
659
+ const dedupedMarkets = [];
660
+ const seenMoneylineKeys = /* @__PURE__ */ new Set();
661
+ for (const market of eventMarkets) {
662
+ if (normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" || resolveMarketSectionTabKey(market) !== "game_lines") {
663
+ continue;
664
+ }
665
+ const moneylineKey = resolveSportsMarketAggKey(market) || market.id;
666
+ if (seenMoneylineKeys.has(moneylineKey)) continue;
667
+ seenMoneylineKeys.add(moneylineKey);
668
+ dedupedMarkets.push(market);
669
+ }
670
+ return dedupedMarkets;
671
+ })();
672
+ if (eventMoneylineMarkets.length === 0) return filteredSectionMarkets;
673
+ const lineSectionMarkets = filteredSectionMarkets.filter(
674
+ (market) => normalizeSportsMarketType(market.sportsMarketType) !== "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
880
675
  );
881
676
  return [...eventMoneylineMarkets, ...lineSectionMarkets];
882
677
  };
@@ -904,7 +699,15 @@ var isBinarySportsMoneylineMarket = (market) => {
904
699
  );
905
700
  const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
906
701
  const marketGroup = normalizeSportsMarketGroup(market.marketGroup);
907
- return marketSubtype === "moneyline" && marketGroup === "game_lines" && normalizeSportsPeriod(market.period) === "full" && normalizedOutcomeLabels.length === 2 && normalizedOutcomeLabels.every((label) => YES_NO_LABELS.has(label));
702
+ const sportsMarketType = normalizeSportsMarketType(market.sportsMarketType);
703
+ const question = toTrimmedString(market.question);
704
+ const aggKey = resolveSportsMarketAggKey(market);
705
+ return sportsMarketType === "moneyline" && marketGroup === "game_lines" && normalizeSportsPeriod(market.period) === "full" && normalizedOutcomeLabels.length === 2 && normalizedOutcomeLabels.every((label) => YES_NO_LABELS.has(label)) && (marketSubtype === "moneyline" || REG_TIME_TITLE_PATTERN.test(question) || aggKey.includes("_ml_"));
706
+ };
707
+ var AGGKEY_LINE_TOKEN_PATTERN = /_\d+p\d+/g;
708
+ var resolveSportsLineFamilyKey = (market) => {
709
+ const aggKey = resolveSportsMarketAggKey(market);
710
+ return aggKey ? aggKey.replace(AGGKEY_LINE_TOKEN_PATTERN, "") : "";
908
711
  };
909
712
  var resolveDisplayGroupFamilyKey = (market) => {
910
713
  var _a, _b, _c;
@@ -918,11 +721,12 @@ var resolveDisplayGroupFamilyKey = (market) => {
918
721
  if (isBinarySportsMoneylineMarket(market)) {
919
722
  return `${period}|moneyline|${marketCategory}`;
920
723
  }
724
+ const lineFamily = resolveSportsLineFamilyKey(market);
921
725
  if (sportsMarketType === "spread") {
922
- return `${period}|spread|${marketCategory}`;
726
+ return lineFamily ? `${period}|spread|${lineFamily}` : `${period}|spread|${marketCategory}`;
923
727
  }
924
728
  if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
925
- return `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
729
+ return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
926
730
  }
927
731
  return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
928
732
  };
@@ -1097,103 +901,346 @@ var aggregateSportsLineStops = (markets) => {
1097
901
  venues.add(venue);
1098
902
  }
1099
903
  }
1100
- return {
1101
- value,
1102
- representative,
1103
- venues: Array.from(venues),
1104
- volume: resolveTotalGroupVolume(lineMarkets),
1105
- lineValue: (_b = representative.lineValue) != null ? _b : Number.NEGATIVE_INFINITY
1106
- };
1107
- }).sort(
1108
- (left, right) => left.lineValue !== right.lineValue ? left.lineValue - right.lineValue : left.value.localeCompare(right.value)
1109
- );
1110
- };
1111
- var buildSportsSlideFromGroup = (group) => {
1112
- const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets) : [];
1113
- const hasLadder = lineStops.length > 1;
1114
- const stops = hasLadder ? lineStops.map((lineStop) => ({
1115
- value: lineStop.value,
1116
- venues: lineStop.venues,
1117
- market: lineStop.representative
1118
- })) : [];
1119
- const defaultStopIndex = hasLadder ? lineStops.reduce(
1120
- (bestIndex, lineStop, index) => lineStop.volume > lineStops[bestIndex].volume ? index : bestIndex,
1121
- 0
1122
- ) : 0;
1123
- return {
1124
- id: group.id,
1125
- kind: resolveSlideKind(group),
1126
- group,
1127
- hasLadder,
1128
- stops,
1129
- defaultStopIndex
1130
- };
1131
- };
1132
- var formatSportsPeriodGrammarLabel = (period) => {
1133
- const grammarMatch = SPORTS_PERIOD_GRAMMAR_PATTERN.exec(period);
1134
- if (!grammarMatch) return null;
1135
- if (grammarMatch[1]) {
1136
- const family = grammarMatch[1].charAt(0).toUpperCase() + grammarMatch[1].slice(1);
1137
- return `${family} ${Number(grammarMatch[2])}`;
1138
- }
1139
- return `First ${Number(grammarMatch[3])} Innings`;
1140
- };
1141
- var resolveSportsCategoryTokens = (event) => {
1142
- return new Set(
1143
- event.categories.flatMap((entry) => {
1144
- const categoryName = toTrimmedString(entry.category.name).toLowerCase();
1145
- const categoryDisplayName = toTrimmedString(entry.category.displayName).toLowerCase();
1146
- return [categoryName, categoryDisplayName].filter(Boolean);
1147
- })
1148
- );
1149
- };
1150
- var isNonStandardSportsLikeEvent = (event) => {
1151
- const categoryTokens = resolveSportsCategoryTokens(event);
1152
- if ([...categoryTokens].some((token) => ESPORTS_CATEGORY_TOKENS.has(token))) {
1153
- return true;
1154
- }
1155
- if (ESPORTS_TITLE_PATTERN.test(event.title) || SERIES_SCOPE_PATTERN.test(event.title)) {
1156
- return true;
1157
- }
1158
- return event.venueMarkets.some((market) => {
1159
- const question = toTrimmedString(market.question);
1160
- return ESPORTS_TITLE_PATTERN.test(question) || SERIES_SCOPE_PATTERN.test(question);
1161
- });
1162
- };
1163
- var resolveVisibleSportsSectionTabDefinitions = (event) => {
1164
- const presentTabKeys = /* @__PURE__ */ new Set();
1165
- for (const market of event.venueMarkets) {
1166
- const tabKey = resolveMarketSectionTabKey(market);
1167
- if (tabKey) presentTabKeys.add(tabKey);
1168
- }
1169
- let definitions = SPORTS_SECTION_TAB_DEFINITIONS.filter(
1170
- (definition) => presentTabKeys.has(definition.key)
904
+ return {
905
+ value,
906
+ representative,
907
+ venues: Array.from(venues),
908
+ volume: resolveTotalGroupVolume(lineMarkets),
909
+ lineValue: (_b = representative.lineValue) != null ? _b : Number.NEGATIVE_INFINITY
910
+ };
911
+ }).sort(
912
+ (left, right) => left.lineValue !== right.lineValue ? left.lineValue - right.lineValue : left.value.localeCompare(right.value)
913
+ );
914
+ };
915
+ var buildSportsSlideFromGroup = (group) => {
916
+ const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets) : [];
917
+ const hasLadder = lineStops.length > 1;
918
+ const stops = hasLadder ? lineStops.map((lineStop) => ({
919
+ value: lineStop.value,
920
+ venues: lineStop.venues,
921
+ market: lineStop.representative
922
+ })) : [];
923
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
924
+ (bestIndex, lineStop, index) => lineStop.volume > lineStops[bestIndex].volume ? index : bestIndex,
925
+ 0
926
+ ) : 0;
927
+ return {
928
+ id: group.id,
929
+ kind: resolveSlideKind(group),
930
+ group,
931
+ hasLadder,
932
+ stops,
933
+ defaultStopIndex
934
+ };
935
+ };
936
+ var resolveSportsCategoryTokens = (event) => {
937
+ return new Set(
938
+ event.categories.flatMap((entry) => {
939
+ const categoryName = toTrimmedString(entry.category.name).toLowerCase();
940
+ const categoryDisplayName = toTrimmedString(entry.category.displayName).toLowerCase();
941
+ return [categoryName, categoryDisplayName].filter(Boolean);
942
+ })
943
+ );
944
+ };
945
+ var isNonStandardSportsLikeEvent = (event) => {
946
+ const categoryTokens = resolveSportsCategoryTokens(event);
947
+ if ([...categoryTokens].some((token) => ESPORTS_CATEGORY_TOKENS.has(token))) {
948
+ return true;
949
+ }
950
+ if (ESPORTS_TITLE_PATTERN.test(event.title) || SERIES_SCOPE_PATTERN.test(event.title)) {
951
+ return true;
952
+ }
953
+ return event.venueMarkets.some((market) => {
954
+ const question = toTrimmedString(market.question);
955
+ return ESPORTS_TITLE_PATTERN.test(question) || SERIES_SCOPE_PATTERN.test(question);
956
+ });
957
+ };
958
+ var resolveVisibleSportsSectionTabDefinitions = (event) => {
959
+ const presentTabKeys = /* @__PURE__ */ new Set();
960
+ for (const market of event.venueMarkets) {
961
+ const tabKey = resolveMarketSectionTabKey(market);
962
+ if (tabKey) presentTabKeys.add(tabKey);
963
+ }
964
+ let definitions = SPORTS_SECTION_TAB_DEFINITIONS.filter(
965
+ (definition) => presentTabKeys.has(definition.key)
966
+ );
967
+ if (isNonStandardSportsLikeEvent(event)) {
968
+ definitions = definitions.filter(
969
+ (definition) => SPORTS_NON_STANDARD_VISIBLE_TAB_KEY_SET.has(definition.key)
970
+ );
971
+ }
972
+ return definitions;
973
+ };
974
+ var mergeSportsSectionMarketsIntoEvent = ({
975
+ event,
976
+ sectionMarketsByKey
977
+ }) => {
978
+ var _a;
979
+ const orderedVenueMarkets = [...event.venueMarkets];
980
+ const seenMarketIds = new Set(orderedVenueMarkets.map((market) => market.id));
981
+ for (const sectionKey of SPORTS_SECTION_TAB_DEFINITIONS.map((definition) => definition.key)) {
982
+ for (const market of (_a = sectionMarketsByKey[sectionKey]) != null ? _a : []) {
983
+ if (seenMarketIds.has(market.id)) continue;
984
+ seenMarketIds.add(market.id);
985
+ orderedVenueMarkets.push(market);
986
+ }
987
+ }
988
+ return __spreadProps(__spreadValues({}, event), {
989
+ venueMarkets: orderedVenueMarkets
990
+ });
991
+ };
992
+
993
+ // src/pages/event-market/sports-market-card.tsx
994
+ import {
995
+ MarketStatus,
996
+ resolveMarketTradingState,
997
+ useEventTradingContext,
998
+ useLabels as useLabels2,
999
+ useSdkUiConfig
1000
+ } from "@agg-build/hooks";
1001
+ import { useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
1002
+
1003
+ // src/pages/event-market/sports-line-rail.tsx
1004
+ import * as React from "react";
1005
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1006
+ function VenueRow({ venues, active }) {
1007
+ if (!venues || venues.length === 0) return /* @__PURE__ */ jsx2("span", { className: "h-4" });
1008
+ const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
1009
+ const extra = venues.length - shown.length;
1010
+ return /* @__PURE__ */ jsxs2(
1011
+ "span",
1012
+ {
1013
+ className: cn(
1014
+ "flex h-4 items-center justify-center gap-1",
1015
+ !active && "text-agg-muted-foreground"
1016
+ ),
1017
+ children: [
1018
+ shown.map((venue, index) => /* @__PURE__ */ jsx2(
1019
+ VenueLogo,
1020
+ {
1021
+ venue,
1022
+ isMonochromatic: !active,
1023
+ size: "small",
1024
+ className: "size-3! shrink-0"
1025
+ },
1026
+ `${venue}-${index}`
1027
+ )),
1028
+ extra > 0 && /* @__PURE__ */ jsxs2("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
1029
+ "+",
1030
+ extra
1031
+ ] })
1032
+ ]
1033
+ }
1034
+ );
1035
+ }
1036
+ function SportsLineRail({
1037
+ stops,
1038
+ selectedIndex,
1039
+ onSelect,
1040
+ ariaLabel,
1041
+ previousAriaLabel,
1042
+ nextAriaLabel,
1043
+ className
1044
+ }) {
1045
+ const scrollRef = React.useRef(null);
1046
+ const itemRefs = React.useRef([]);
1047
+ const didInit = React.useRef(false);
1048
+ const programmatic = React.useRef(false);
1049
+ const progTimer = React.useRef(void 0);
1050
+ const skipCenterOnPropSync = React.useRef(false);
1051
+ const pendingScrollIndex = React.useRef(null);
1052
+ const scrollSettleTimer = React.useRef(void 0);
1053
+ const stopCount = stops.length;
1054
+ const [pad, setPad] = React.useState({ left: 0, right: 0 });
1055
+ const [mask, setMask] = React.useState({ left: false, right: false });
1056
+ const updateMask = React.useCallback(() => {
1057
+ const c = scrollRef.current;
1058
+ if (!c || !c.clientWidth) return;
1059
+ setMask({
1060
+ left: c.scrollLeft > 1,
1061
+ right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
1062
+ });
1063
+ }, []);
1064
+ const resolveNearestIndexToViewportCenter = React.useCallback(() => {
1065
+ const container = scrollRef.current;
1066
+ if (!container || !container.clientWidth) return null;
1067
+ const viewportCenter = container.scrollLeft + container.clientWidth / 2;
1068
+ let nearestIndex = null;
1069
+ let nearestDistance = Number.POSITIVE_INFINITY;
1070
+ itemRefs.current.forEach((item, index) => {
1071
+ if (!item) return;
1072
+ const itemCenter = item.offsetLeft + item.offsetWidth / 2;
1073
+ const distance = Math.abs(itemCenter - viewportCenter);
1074
+ if (distance < nearestDistance) {
1075
+ nearestDistance = distance;
1076
+ nearestIndex = index;
1077
+ }
1078
+ });
1079
+ return nearestIndex;
1080
+ }, []);
1081
+ React.useLayoutEffect(() => {
1082
+ const c = scrollRef.current;
1083
+ if (!c) return;
1084
+ const measure = () => {
1085
+ var _a, _b, _c, _d;
1086
+ const w = c.clientWidth;
1087
+ if (!w) return;
1088
+ const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
1089
+ const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
1090
+ setPad({
1091
+ left: Math.max(0, w / 2 - firstW / 2),
1092
+ right: Math.max(0, w / 2 - lastW / 2)
1093
+ });
1094
+ updateMask();
1095
+ };
1096
+ const onScroll = () => {
1097
+ if (!programmatic.current) {
1098
+ const nearestIndex = resolveNearestIndexToViewportCenter();
1099
+ if (nearestIndex != null && nearestIndex !== selectedIndex) {
1100
+ pendingScrollIndex.current = nearestIndex;
1101
+ clearTimeout(scrollSettleTimer.current);
1102
+ scrollSettleTimer.current = setTimeout(() => {
1103
+ const nextIndex = pendingScrollIndex.current;
1104
+ if (nextIndex == null || nextIndex === selectedIndex) return;
1105
+ skipCenterOnPropSync.current = true;
1106
+ onSelect(nextIndex);
1107
+ }, 120);
1108
+ }
1109
+ }
1110
+ updateMask();
1111
+ };
1112
+ measure();
1113
+ const ro = new ResizeObserver(measure);
1114
+ ro.observe(c);
1115
+ c.addEventListener("scroll", onScroll, { passive: true });
1116
+ return () => {
1117
+ ro.disconnect();
1118
+ c.removeEventListener("scroll", onScroll);
1119
+ clearTimeout(scrollSettleTimer.current);
1120
+ };
1121
+ }, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
1122
+ React.useEffect(() => {
1123
+ pendingScrollIndex.current = selectedIndex;
1124
+ }, [selectedIndex]);
1125
+ React.useEffect(() => {
1126
+ const c = scrollRef.current;
1127
+ const el = itemRefs.current[selectedIndex];
1128
+ if (!c || !el || !c.clientWidth) return;
1129
+ if (skipCenterOnPropSync.current) {
1130
+ skipCenterOnPropSync.current = false;
1131
+ updateMask();
1132
+ return;
1133
+ }
1134
+ const max = c.scrollWidth - c.clientWidth;
1135
+ const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
1136
+ programmatic.current = true;
1137
+ c.scrollTo({
1138
+ left: Math.max(0, Math.min(max, target)),
1139
+ behavior: didInit.current ? "smooth" : "auto"
1140
+ });
1141
+ if (pad.left > 0 || pad.right > 0) didInit.current = true;
1142
+ clearTimeout(progTimer.current);
1143
+ progTimer.current = setTimeout(() => {
1144
+ programmatic.current = false;
1145
+ }, 500);
1146
+ updateMask();
1147
+ }, [selectedIndex, stopCount, pad, updateMask]);
1148
+ const select = (index) => {
1149
+ const next = Math.min(stops.length - 1, Math.max(0, index));
1150
+ if (next !== selectedIndex) onSelect(next);
1151
+ };
1152
+ const step = (delta) => select(selectedIndex + delta);
1153
+ if (stopCount === 0) return null;
1154
+ return /* @__PURE__ */ jsxs2(
1155
+ "div",
1156
+ {
1157
+ className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
1158
+ "aria-label": ariaLabel,
1159
+ children: [
1160
+ /* @__PURE__ */ jsx2(
1161
+ "button",
1162
+ {
1163
+ type: "button",
1164
+ onClick: () => step(-1),
1165
+ disabled: selectedIndex === 0,
1166
+ "aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
1167
+ 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",
1168
+ children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-left", className: "size-4" })
1169
+ }
1170
+ ),
1171
+ /* @__PURE__ */ jsxs2("div", { className: "relative min-w-0 flex-1", children: [
1172
+ /* @__PURE__ */ jsx2(
1173
+ "div",
1174
+ {
1175
+ ref: scrollRef,
1176
+ style: { paddingLeft: pad.left, paddingRight: pad.right },
1177
+ className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
1178
+ children: stops.map((stop, index) => {
1179
+ const active = index === selectedIndex;
1180
+ return /* @__PURE__ */ jsxs2(
1181
+ "button",
1182
+ {
1183
+ type: "button",
1184
+ ref: (el) => {
1185
+ itemRefs.current[index] = el;
1186
+ },
1187
+ onClick: () => select(index),
1188
+ disabled: stop.disabled,
1189
+ "aria-pressed": active,
1190
+ className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
1191
+ children: [
1192
+ /* @__PURE__ */ jsx2(
1193
+ "span",
1194
+ {
1195
+ className: cn(
1196
+ "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",
1197
+ 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"
1198
+ ),
1199
+ children: stop.value
1200
+ }
1201
+ ),
1202
+ /* @__PURE__ */ jsx2(VenueRow, { venues: stop.venues, active })
1203
+ ]
1204
+ },
1205
+ index
1206
+ );
1207
+ })
1208
+ }
1209
+ ),
1210
+ /* @__PURE__ */ jsx2(
1211
+ "span",
1212
+ {
1213
+ className: cn(
1214
+ "pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
1215
+ mask.left ? "opacity-100" : "opacity-0"
1216
+ )
1217
+ }
1218
+ ),
1219
+ /* @__PURE__ */ jsx2(
1220
+ "span",
1221
+ {
1222
+ className: cn(
1223
+ "pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
1224
+ mask.right ? "opacity-100" : "opacity-0"
1225
+ )
1226
+ }
1227
+ )
1228
+ ] }),
1229
+ /* @__PURE__ */ jsx2(
1230
+ "button",
1231
+ {
1232
+ type: "button",
1233
+ onClick: () => step(1),
1234
+ disabled: selectedIndex === stopCount - 1,
1235
+ "aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
1236
+ 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",
1237
+ children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-right", className: "size-4" })
1238
+ }
1239
+ )
1240
+ ]
1241
+ }
1171
1242
  );
1172
- if (isNonStandardSportsLikeEvent(event)) {
1173
- definitions = definitions.filter(
1174
- (definition) => SPORTS_NON_STANDARD_VISIBLE_TAB_KEY_SET.has(definition.key)
1175
- );
1176
- }
1177
- return definitions;
1178
- };
1179
- var mergeSportsSectionMarketsIntoEvent = ({
1180
- event,
1181
- sectionMarketsByKey
1182
- }) => {
1183
- var _a;
1184
- const orderedVenueMarkets = [...event.venueMarkets];
1185
- const seenMarketIds = new Set(orderedVenueMarkets.map((market) => market.id));
1186
- for (const sectionKey of SPORTS_SECTION_TAB_DEFINITIONS.map((definition) => definition.key)) {
1187
- for (const market of (_a = sectionMarketsByKey[sectionKey]) != null ? _a : []) {
1188
- if (seenMarketIds.has(market.id)) continue;
1189
- seenMarketIds.add(market.id);
1190
- orderedVenueMarkets.push(market);
1191
- }
1192
- }
1193
- return __spreadProps(__spreadValues({}, event), {
1194
- venueMarkets: orderedVenueMarkets
1195
- });
1196
- };
1243
+ }
1197
1244
 
1198
1245
  // src/pages/event-market/sports-market-card.tsx
1199
1246
  import { jsx as jsx3 } from "react/jsx-runtime";
@@ -1221,6 +1268,19 @@ var SportsMarketCard = ({
1221
1268
  [group.markets]
1222
1269
  );
1223
1270
  const isCombinedMoneylineGroup = group.sportsMarketType === "moneyline" && combinedMoneylineMarkets.length > 1 && combinedMoneylineMarkets.length === group.markets.length;
1271
+ const preferredResolvedMoneylineMarket = useMemo(() => {
1272
+ var _a2, _b2;
1273
+ if (!isCombinedMoneylineGroup) return null;
1274
+ const resolvedYesWinnerMarket = (_a2 = combinedMoneylineMarkets.find(
1275
+ (market) => market.venueMarketOutcomes.some(
1276
+ (outcome) => outcome.winner === true && outcome.label.trim().toLowerCase() === "yes"
1277
+ )
1278
+ )) != null ? _a2 : null;
1279
+ if (resolvedYesWinnerMarket) return resolvedYesWinnerMarket;
1280
+ return (_b2 = combinedMoneylineMarkets.find(
1281
+ (market) => market.venueMarketOutcomes.some((outcome) => outcome.winner === true)
1282
+ )) != null ? _b2 : null;
1283
+ }, [combinedMoneylineMarkets, isCombinedMoneylineGroup]);
1224
1284
  useEffect3(() => {
1225
1285
  if (!slide.hasLadder) return;
1226
1286
  const tradingMarketId = tradingContext == null ? void 0 : tradingContext.selectedMarketId;
@@ -1228,7 +1288,7 @@ var SportsMarketCard = ({
1228
1288
  const matchedIndex = slide.stops.findIndex((stop) => stop.market.id === tradingMarketId);
1229
1289
  if (matchedIndex >= 0) setSelectedLineIndex(matchedIndex);
1230
1290
  }, [slide.hasLadder, slide.stops, tradingContext == null ? void 0 : tradingContext.selectedMarketId]);
1231
- const activeMoneylineMarket = isCombinedMoneylineGroup && (tradingContext == null ? void 0 : tradingContext.selectedMarketId) ? (_a = group.markets.find((market) => market.id === tradingContext.selectedMarketId)) != null ? _a : null : null;
1291
+ 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;
1232
1292
  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;
1233
1293
  const activeDefaultOutcome = isCombinedMoneylineGroup && activeMarket ? (_f = activeMarket.venueMarketOutcomes.find(
1234
1294
  (outcome) => outcome.label.trim().toLowerCase() === "yes"
@@ -1380,39 +1440,6 @@ var resolveSportsSectionLabel = (labels, key) => {
1380
1440
  return labels.eventMarketPage.sports.otherTab;
1381
1441
  }
1382
1442
  };
1383
- var resolveSportsPeriodLabel = (labels, period) => {
1384
- var _a;
1385
- switch (period) {
1386
- case "full":
1387
- return labels.eventMarketPage.sports.fullPeriod;
1388
- case "1h":
1389
- return labels.eventMarketPage.sports.firstHalfPeriod;
1390
- case "2h":
1391
- return labels.eventMarketPage.sports.secondHalfPeriod;
1392
- case "q1":
1393
- return labels.eventMarketPage.sports.quarterOnePeriod;
1394
- case "q2":
1395
- return labels.eventMarketPage.sports.quarterTwoPeriod;
1396
- case "q3":
1397
- return labels.eventMarketPage.sports.quarterThreePeriod;
1398
- case "q4":
1399
- return labels.eventMarketPage.sports.quarterFourPeriod;
1400
- case "ot":
1401
- return labels.eventMarketPage.sports.overtimePeriod;
1402
- case "first_inning":
1403
- return "1st Inning";
1404
- case "second_inning":
1405
- return "2nd Inning";
1406
- case "third_inning":
1407
- return "3rd Inning";
1408
- case "first_5_innings":
1409
- return "1st 5 Innings";
1410
- case "other":
1411
- return labels.eventMarketPage.sports.otherPeriod;
1412
- default:
1413
- return (_a = formatSportsPeriodGrammarLabel(period)) != null ? _a : labels.eventMarketPage.sports.otherPeriod;
1414
- }
1415
- };
1416
1443
  var SportsTabButton = ({
1417
1444
  isActive,
1418
1445
  label,
@@ -1624,7 +1651,7 @@ var SportsMarkets = ({
1624
1651
  );
1625
1652
  }
1626
1653
  const shouldShowLoadingState = stableSectionMarkets == null && !isSectionSettled;
1627
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-5", "data-testid": "sports-markets", children: [
1654
+ return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-3", "data-testid": "sports-markets", children: [
1628
1655
  shouldRenderTabs ? /* @__PURE__ */ jsx4(
1629
1656
  "div",
1630
1657
  {
@@ -1653,28 +1680,24 @@ var SportsMarkets = ({
1653
1680
  }
1654
1681
  ) : null,
1655
1682
  displayedPeriodGroups.map((periodGroup) => {
1656
- const hasMultiplePeriods = displayedPeriodGroups.length > 1;
1657
- return /* @__PURE__ */ jsxs3(
1683
+ return /* @__PURE__ */ jsx4(
1658
1684
  "section",
1659
1685
  {
1660
1686
  className: "flex flex-col gap-3",
1661
1687
  "data-period-key": periodGroup.key,
1662
- children: [
1663
- hasMultiplePeriods ? /* @__PURE__ */ jsx4(Typography, { variant: "body-large-strong", className: "text-agg-foreground", children: resolveSportsPeriodLabel(labels, periodGroup.key) }) : null,
1664
- periodGroup.groups.map((group) => /* @__PURE__ */ jsx4(
1665
- SportsMarketCard,
1666
- {
1667
- group,
1668
- venueMarkets: displayedSectionMarkets,
1669
- isExpanded: expandedGroupId === group.id,
1670
- onToggle: handleToggleGroup,
1671
- onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
1672
- live,
1673
- midpointsResult
1674
- },
1675
- group.id
1676
- ))
1677
- ]
1688
+ children: periodGroup.groups.map((group) => /* @__PURE__ */ jsx4(
1689
+ SportsMarketCard,
1690
+ {
1691
+ group,
1692
+ venueMarkets: displayedSectionMarkets,
1693
+ isExpanded: expandedGroupId === group.id,
1694
+ onToggle: handleToggleGroup,
1695
+ onOutcomeSelect: (_groupId, _selection) => handleGroupOutcomeSelect(group.id),
1696
+ live,
1697
+ midpointsResult
1698
+ },
1699
+ group.id
1700
+ ))
1678
1701
  },
1679
1702
  `${activeTabKey}-${periodGroup.key}`
1680
1703
  );
@@ -1921,7 +1944,11 @@ var EventMarketPageContent = ({
1921
1944
  const [isMobileTradeOpen, setIsMobileTradeOpen] = useState6(false);
1922
1945
  const isMobileViewport = useIsMobileEventMarketViewport();
1923
1946
  const tradingContext = useEventTradingContext4();
1924
- const midpointsResult = useMidpoints2(event.venueMarkets);
1947
+ const eventDetailVenueMarkets = useMemo4(
1948
+ () => normalizeVenueMarketCluster(event.venueMarkets),
1949
+ [event.venueMarkets]
1950
+ );
1951
+ const midpointsResult = useMidpoints2(eventDetailVenueMarkets);
1925
1952
  const internalResolvedClaim = useResolvedMarketClaim({
1926
1953
  market: eventTradingState.primaryMarket,
1927
1954
  enabled: eventTradingState.kind === "resolved",
@@ -2240,6 +2267,17 @@ var MIN_SEARCH_LENGTH = 3;
2240
2267
  var SEARCH_DEBOUNCE_MS = 300;
2241
2268
  var SEARCH_RESULTS_LIMIT = 20;
2242
2269
  var MOBILE_HOME_SEARCH_MEDIA_QUERY = "(max-width: 767px)";
2270
+ var collectVisibleVenueMarketIds = (venueMarkets) => {
2271
+ var _a;
2272
+ const ids = [];
2273
+ for (const market of venueMarkets) {
2274
+ ids.push(market.id);
2275
+ for (const sibling of (_a = market.matchedVenueMarkets) != null ? _a : []) {
2276
+ ids.push(sibling.id);
2277
+ }
2278
+ }
2279
+ return [...new Set(ids)];
2280
+ };
2243
2281
  var HomeSearchResults = ({
2244
2282
  activeTabValue,
2245
2283
  query,
@@ -2294,6 +2332,19 @@ var HomeSearchResults = ({
2294
2332
  }
2295
2333
  return filtered;
2296
2334
  }, [searchResults, activeVenues]);
2335
+ const visibleVenueMarkets = useMemo5(() => {
2336
+ return openEvents.flatMap((event) => {
2337
+ var _a;
2338
+ return (_a = event.venueMarkets) != null ? _a : [];
2339
+ });
2340
+ }, [openEvents]);
2341
+ const visibleMidpointVenueMarketIds = useMemo5(() => {
2342
+ return collectVisibleVenueMarketIds(visibleVenueMarkets);
2343
+ }, [visibleVenueMarkets]);
2344
+ const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = useVenueMarketMidpoints({
2345
+ venueMarketIds: visibleMidpointVenueMarketIds,
2346
+ enabled: visibleMidpointVenueMarketIds.length > 0
2347
+ });
2297
2348
  const loadMoreRef = useRef7(null);
2298
2349
  useEffect8(() => {
2299
2350
  if (!hasNextPage) return;
@@ -2384,6 +2435,8 @@ var HomeSearchResults = ({
2384
2435
  EventListItem,
2385
2436
  {
2386
2437
  event,
2438
+ midpointRows: sharedMidpointRows,
2439
+ midpointsLoading: isSharedMidpointsLoading,
2387
2440
  classNames: {
2388
2441
  root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
2389
2442
  },
@@ -2737,12 +2790,12 @@ import {
2737
2790
  useExecutionOrders,
2738
2791
  useExecutionPositions,
2739
2792
  useGeoBlock,
2740
- useLabels as useLabels9,
2793
+ useLabels as useLabels10,
2741
2794
  useQueryClient,
2742
2795
  useSdkUiConfig as useSdkUiConfig5,
2743
2796
  useUserActivity
2744
2797
  } from "@agg-build/hooks";
2745
- import { Venue } from "@agg-build/sdk";
2798
+ import { Venue as Venue2 } from "@agg-build/sdk";
2746
2799
  import { useCallback as useCallback5, useEffect as useEffect10, useMemo as useMemo7, useState as useState11 } from "react";
2747
2800
 
2748
2801
  // src/pages/user-profile/chain-display.ts
@@ -2979,8 +3032,136 @@ var AvailableBalanceCard = ({
2979
3032
  };
2980
3033
  AvailableBalanceCard.displayName = "AvailableBalanceCard";
2981
3034
 
3035
+ // src/pages/user-profile/components/claim-activity-breakdown-modal.tsx
3036
+ import { useLabels as useLabels6 } from "@agg-build/hooks";
3037
+ import { Venue } from "@agg-build/sdk";
3038
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3039
+ var CLAIM_VENUE_LABELS = {
3040
+ [Venue.kalshi]: "Kalshi",
3041
+ [Venue.polymarket]: "Polymarket",
3042
+ [Venue.limitless]: "Limitless",
3043
+ [Venue.opinion]: "Opinion",
3044
+ [Venue.predict]: "Predict",
3045
+ [Venue.probable]: "Probable",
3046
+ [Venue.myriad]: "Myriad",
3047
+ [Venue.hyperliquid]: "Hyperliquid"
3048
+ };
3049
+ var ClaimActivityBreakdownModal = ({
3050
+ activity,
3051
+ onOpenChange,
3052
+ onTransactionSelect
3053
+ }) => {
3054
+ var _a;
3055
+ const labels = useLabels6();
3056
+ return /* @__PURE__ */ jsx9(
3057
+ Modal,
3058
+ {
3059
+ open: activity !== null,
3060
+ onOpenChange,
3061
+ "aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
3062
+ children: /* @__PURE__ */ jsxs8(
3063
+ Modal.Container,
3064
+ {
3065
+ maxWidth: "600px",
3066
+ "aria-label": labels.userProfile.activity.claimBreakdownModalAriaLabel,
3067
+ children: [
3068
+ /* @__PURE__ */ jsx9(
3069
+ Modal.Header,
3070
+ {
3071
+ title: (_a = activity == null ? void 0 : activity.title) != null ? _a : "",
3072
+ classNames: {
3073
+ root: "border-b-0!",
3074
+ container: "px-4 py-4 sm:px-8 sm:pt-7 sm:pb-3",
3075
+ title: "text-2xl leading-8"
3076
+ }
3077
+ }
3078
+ ),
3079
+ activity ? /* @__PURE__ */ jsx9(Modal.Body, { classNames: { root: "px-4 pt-0 pb-4 sm:px-8 sm:pt-0 sm:pb-7" }, children: /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-6", children: [
3080
+ /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-3", children: [
3081
+ /* @__PURE__ */ jsx9("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 }),
3082
+ /* @__PURE__ */ jsx9("p", { className: "min-w-0 flex-1 text-agg-sm leading-5 text-agg-foreground", children: activity.marketTitle })
3083
+ ] }),
3084
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-col", children: activity.transactions.map((transaction, index) => {
3085
+ var _a2;
3086
+ const isInteractive = Boolean(transaction.txHash && transaction.chainId);
3087
+ return /* @__PURE__ */ jsxs8("div", { children: [
3088
+ /* @__PURE__ */ jsxs8(
3089
+ "button",
3090
+ {
3091
+ type: "button",
3092
+ className: [
3093
+ "flex w-full items-center justify-between gap-6 rounded-agg-lg px-3 py-2 text-left transition-colors",
3094
+ "bg-transparent hover:bg-agg-secondary-hover",
3095
+ isInteractive ? "cursor-pointer" : "cursor-default"
3096
+ ].join(" "),
3097
+ "aria-label": labels.userProfile.activity.claimBreakdownTransactionLinkAria(
3098
+ transaction.venue
3099
+ ),
3100
+ disabled: !isInteractive,
3101
+ onClick: () => {
3102
+ if (!isInteractive) return;
3103
+ onTransactionSelect(transaction);
3104
+ },
3105
+ children: [
3106
+ /* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex flex-1 flex-col gap-2", children: [
3107
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3108
+ /* @__PURE__ */ jsx9(
3109
+ VenueLogo,
3110
+ {
3111
+ venue: transaction.venue,
3112
+ size: "small",
3113
+ className: "shrink-0"
3114
+ }
3115
+ ),
3116
+ /* @__PURE__ */ jsx9("p", { className: "text-agg-sm leading-5 text-agg-foreground", children: (_a2 = CLAIM_VENUE_LABELS[transaction.venue]) != null ? _a2 : transaction.venue })
3117
+ ] }),
3118
+ transaction.hasError && transaction.errorMessage ? /* @__PURE__ */ jsx9(
3119
+ Tooltip,
3120
+ {
3121
+ size: "medium",
3122
+ content: transaction.errorMessage,
3123
+ sideOffset: 4,
3124
+ children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-agg-error!", children: [
3125
+ /* @__PURE__ */ jsx9(
3126
+ Icon,
3127
+ {
3128
+ name: "circle-xmark",
3129
+ size: "small",
3130
+ className: "size-3! text-agg-error!"
3131
+ }
3132
+ ),
3133
+ /* @__PURE__ */ jsx9("p", { className: "truncate text-agg-sm leading-5 text-agg-error!", children: transaction.errorMessage })
3134
+ ] })
3135
+ }
3136
+ ) : /* @__PURE__ */ jsx9("p", { className: "text-agg-sm leading-5 text-agg-muted-foreground", children: transaction.transactionLabel })
3137
+ ] }),
3138
+ /* @__PURE__ */ jsxs8("div", { className: "flex shrink-0 items-center gap-3", children: [
3139
+ /* @__PURE__ */ jsx9("p", { className: "text-agg-sm font-agg-bold leading-5 text-agg-foreground", children: transaction.amountLabel }),
3140
+ isInteractive ? /* @__PURE__ */ jsx9(
3141
+ Icon,
3142
+ {
3143
+ name: "external-link",
3144
+ size: "small",
3145
+ className: "text-agg-muted-foreground"
3146
+ }
3147
+ ) : null
3148
+ ] })
3149
+ ]
3150
+ }
3151
+ ),
3152
+ index < activity.transactions.length - 1 ? /* @__PURE__ */ jsx9("div", { className: "my-1 h-px w-full bg-agg-separator", "aria-hidden": true }) : null
3153
+ ] }, transaction.id);
3154
+ }) })
3155
+ ] }) }) : null
3156
+ ]
3157
+ }
3158
+ )
3159
+ }
3160
+ );
3161
+ };
3162
+
2982
3163
  // src/pages/user-profile/components/positions-activity.tsx
2983
- import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels7 } from "@agg-build/hooks";
3164
+ import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels8 } from "@agg-build/hooks";
2984
3165
  import { Fragment as Fragment4, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef8, useState as useState10 } from "react";
2985
3166
 
2986
3167
  // src/pages/user-profile/user-profile.constants.ts
@@ -3177,16 +3358,8 @@ var toPositionRowViewModel = (position, labels = defaultLabels) => {
3177
3358
  };
3178
3359
  };
3179
3360
 
3180
- // src/primitives/conditional-wrapper.tsx
3181
- var ConditionalWrapper = ({
3182
- condition,
3183
- wrapper,
3184
- children
3185
- }) => condition ? wrapper(children) : children;
3186
- ConditionalWrapper.displayName = "ConditionalWrapper";
3187
-
3188
3361
  // src/pages/user-profile/components/activity-row.tsx
3189
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3362
+ import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
3190
3363
  var shouldOpenInNewTab = (activity) => {
3191
3364
  return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
3192
3365
  };
@@ -3203,7 +3376,7 @@ var RowWrapper = ({
3203
3376
  }) => {
3204
3377
  if (href) {
3205
3378
  const opensInNewTab = target === "_blank";
3206
- return /* @__PURE__ */ jsx9(
3379
+ return /* @__PURE__ */ jsx10(
3207
3380
  "a",
3208
3381
  {
3209
3382
  href,
@@ -3219,7 +3392,7 @@ var RowWrapper = ({
3219
3392
  }
3220
3393
  );
3221
3394
  }
3222
- return /* @__PURE__ */ jsx9("button", { type: "button", className, onClick, children });
3395
+ return /* @__PURE__ */ jsx10("button", { type: "button", className, onClick, children });
3223
3396
  };
3224
3397
  var TRANSFER_ICON = {
3225
3398
  withdrawal: "upload",
@@ -3254,7 +3427,7 @@ var AmountTimeStack = ({
3254
3427
  timeLabel,
3255
3428
  tone,
3256
3429
  mobile
3257
- }) => /* @__PURE__ */ jsxs8(
3430
+ }) => /* @__PURE__ */ jsxs9(
3258
3431
  "div",
3259
3432
  {
3260
3433
  className: cn(
@@ -3262,7 +3435,7 @@ var AmountTimeStack = ({
3262
3435
  mobile ? "sm:hidden" : "hidden sm:flex sm:w-[120px] sm:shrink-0"
3263
3436
  ),
3264
3437
  children: [
3265
- /* @__PURE__ */ jsx9(
3438
+ /* @__PURE__ */ jsx10(
3266
3439
  "p",
3267
3440
  {
3268
3441
  className: cn(
@@ -3273,7 +3446,7 @@ var AmountTimeStack = ({
3273
3446
  children: amountLabel
3274
3447
  }
3275
3448
  ),
3276
- /* @__PURE__ */ jsx9(
3449
+ /* @__PURE__ */ jsx10(
3277
3450
  "p",
3278
3451
  {
3279
3452
  className: cn(
@@ -3290,9 +3463,9 @@ var AmountTimeStack = ({
3290
3463
  var TradeTypeCell = ({
3291
3464
  activity,
3292
3465
  tone
3293
- }) => /* @__PURE__ */ jsxs8("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3294
- /* @__PURE__ */ jsx9(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
3295
- /* @__PURE__ */ jsx9(
3466
+ }) => /* @__PURE__ */ jsxs9("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3467
+ /* @__PURE__ */ jsx10(VenueLogo, { venue: activity.venue, size: "small", className: "shrink-0" }),
3468
+ /* @__PURE__ */ jsx10(
3296
3469
  "p",
3297
3470
  {
3298
3471
  className: cn(
@@ -3307,8 +3480,8 @@ var TradeTypeCell = ({
3307
3480
  var TransferTypeCell = ({
3308
3481
  activity,
3309
3482
  tone
3310
- }) => /* @__PURE__ */ jsxs8("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3311
- /* @__PURE__ */ jsx9(
3483
+ }) => /* @__PURE__ */ jsxs9("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3484
+ /* @__PURE__ */ jsx10(
3312
3485
  Icon,
3313
3486
  {
3314
3487
  name: TRANSFER_ICON[activity.kind],
@@ -3319,7 +3492,7 @@ var TransferTypeCell = ({
3319
3492
  )
3320
3493
  }
3321
3494
  ),
3322
- /* @__PURE__ */ jsx9(
3495
+ /* @__PURE__ */ jsx10(
3323
3496
  "p",
3324
3497
  {
3325
3498
  className: cn(
@@ -3334,8 +3507,8 @@ var TransferTypeCell = ({
3334
3507
  var RedeemTypeCell = ({
3335
3508
  activity,
3336
3509
  tone
3337
- }) => /* @__PURE__ */ jsxs8("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3338
- /* @__PURE__ */ jsx9(
3510
+ }) => /* @__PURE__ */ jsxs9("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
3511
+ /* @__PURE__ */ jsx10(
3339
3512
  Icon,
3340
3513
  {
3341
3514
  name: "gift-bonus",
@@ -3346,7 +3519,7 @@ var RedeemTypeCell = ({
3346
3519
  )
3347
3520
  }
3348
3521
  ),
3349
- /* @__PURE__ */ jsx9(
3522
+ /* @__PURE__ */ jsx10(
3350
3523
  "p",
3351
3524
  {
3352
3525
  className: cn(
@@ -3363,7 +3536,7 @@ var OutcomeBadge = ({
3363
3536
  tone
3364
3537
  }) => {
3365
3538
  if (!label) return null;
3366
- return /* @__PURE__ */ jsx9("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__ */ jsx9(
3539
+ return /* @__PURE__ */ jsx10("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__ */ jsx10(
3367
3540
  "span",
3368
3541
  {
3369
3542
  className: cn(
@@ -3377,9 +3550,9 @@ var OutcomeBadge = ({
3377
3550
  var TradeOutcomeShares = ({
3378
3551
  activity,
3379
3552
  tone
3380
- }) => /* @__PURE__ */ jsxs8(Fragment2, { children: [
3381
- /* @__PURE__ */ jsx9(OutcomeBadge, { label: activity.outcomeLabel, tone }),
3382
- /* @__PURE__ */ jsx9(
3553
+ }) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
3554
+ /* @__PURE__ */ jsx10(OutcomeBadge, { label: activity.outcomeLabel, tone }),
3555
+ /* @__PURE__ */ jsx10(
3383
3556
  "span",
3384
3557
  {
3385
3558
  className: cn(
@@ -3399,8 +3572,8 @@ var RedeemRow = ({
3399
3572
  const tone = resolveToneClasses(activity);
3400
3573
  const statusVisual = getStatusVisual(activity);
3401
3574
  const activityStatus = resolveActivityStatus(activity);
3402
- const shouldShowInlineStatus = activityStatus !== "completed";
3403
- return /* @__PURE__ */ jsx9(
3575
+ const shouldShowInlineStatus = activityStatus === "pending";
3576
+ return /* @__PURE__ */ jsx10(
3404
3577
  RowWrapper,
3405
3578
  {
3406
3579
  className,
@@ -3408,173 +3581,30 @@ var RedeemRow = ({
3408
3581
  target: href ? "_blank" : void 0,
3409
3582
  rel: href ? "noopener noreferrer" : void 0,
3410
3583
  onClick,
3411
- children: /* @__PURE__ */ jsx9(
3412
- ConditionalWrapper,
3413
- {
3414
- condition: !!activity.errorMessage,
3415
- wrapper: (children) => /* @__PURE__ */ jsx9(
3416
- Tooltip,
3417
- {
3418
- size: "medium",
3419
- content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
3420
- /* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
3421
- /* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
3422
- ] }),
3423
- sideOffset: 4,
3424
- children
3425
- }
3426
- ),
3427
- children: /* @__PURE__ */ jsxs8(
3428
- "div",
3429
- {
3430
- className: cn(
3431
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
3432
- "relative z-10"
3433
- ),
3434
- "data-status": activityStatus,
3435
- children: [
3436
- /* @__PURE__ */ jsx9(RedeemTypeCell, { activity, tone }),
3437
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
3438
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3439
- /* @__PURE__ */ jsx9(
3440
- Icon,
3441
- {
3442
- name: "gift-bonus",
3443
- size: "small",
3444
- className: cn(
3445
- "shrink-0 text-agg-foreground",
3446
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3447
- )
3448
- }
3449
- ),
3450
- /* @__PURE__ */ jsx9(
3451
- "p",
3452
- {
3453
- className: cn(
3454
- "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3455
- tone.primary,
3456
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3457
- ),
3458
- children: activity.type
3459
- }
3460
- )
3461
- ] }),
3462
- /* @__PURE__ */ jsx9(OutcomeBadge, { label: activity.outcomeLabel, tone })
3463
- ] }),
3464
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3465
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3466
- /* @__PURE__ */ jsx9("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx9(
3467
- RemoteImage,
3468
- {
3469
- src: activity.thumbnailSrc,
3470
- alt: "",
3471
- className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
3472
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
3473
- }
3474
- ) }),
3475
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
3476
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-center gap-2", children: [
3477
- /* @__PURE__ */ jsx9(
3478
- "p",
3479
- {
3480
- className: cn(
3481
- "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",
3482
- tone.primary
3483
- ),
3484
- children: activity.title
3485
- }
3486
- ),
3487
- shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx9(
3488
- LoadingIcon,
3489
- {
3490
- size: "small",
3491
- className: cn("shrink-0", statusVisual.iconClassName)
3492
- }
3493
- ) : /* @__PURE__ */ jsx9(
3494
- Icon,
3495
- {
3496
- name: statusVisual.icon,
3497
- size: "small",
3498
- className: cn("shrink-0", statusVisual.iconClassName)
3499
- }
3500
- ) : null
3501
- ] }),
3502
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
3503
- /* @__PURE__ */ jsx9("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx9(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
3504
- /* @__PURE__ */ jsx9(
3505
- "p",
3506
- {
3507
- className: cn(
3508
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3509
- tone.meta
3510
- ),
3511
- children: activity.marketTitle
3512
- }
3513
- )
3514
- ] })
3515
- ] })
3516
- ] }),
3517
- /* @__PURE__ */ jsx9(
3518
- AmountTimeStack,
3519
- {
3520
- amountLabel: activity.amountLabel,
3521
- timeLabel: activity.timeLabel,
3522
- tone,
3523
- mobile: true
3524
- }
3525
- )
3526
- ] }),
3527
- /* @__PURE__ */ jsx9(
3528
- AmountTimeStack,
3529
- {
3530
- amountLabel: activity.amountLabel,
3531
- timeLabel: activity.timeLabel,
3532
- tone
3533
- }
3534
- )
3535
- ]
3536
- }
3537
- )
3538
- }
3539
- )
3540
- }
3541
- );
3542
- };
3543
- var TradeRow = ({
3544
- activity,
3545
- className,
3546
- href,
3547
- onClick
3548
- }) => {
3549
- const tone = resolveToneClasses(activity);
3550
- return /* @__PURE__ */ jsx9(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ jsx9(
3551
- ConditionalWrapper,
3552
- {
3553
- condition: !!activity.errorMessage,
3554
- wrapper: (children) => /* @__PURE__ */ jsx9(
3555
- Tooltip,
3556
- {
3557
- size: "medium",
3558
- content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
3559
- /* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
3560
- /* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
3561
- ] }),
3562
- sideOffset: 4,
3563
- children
3564
- }
3565
- ),
3566
- children: /* @__PURE__ */ jsxs8(
3584
+ children: /* @__PURE__ */ jsxs9(
3567
3585
  "div",
3568
3586
  {
3569
3587
  className: cn(
3570
3588
  "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
3571
3589
  "relative z-10"
3572
3590
  ),
3591
+ "data-status": activityStatus,
3573
3592
  children: [
3574
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
3575
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3576
- /* @__PURE__ */ jsx9(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
3577
- /* @__PURE__ */ jsx9(
3593
+ /* @__PURE__ */ jsx10(RedeemTypeCell, { activity, tone }),
3594
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
3595
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3596
+ /* @__PURE__ */ jsx10(
3597
+ Icon,
3598
+ {
3599
+ name: "gift-bonus",
3600
+ size: "small",
3601
+ className: cn(
3602
+ "shrink-0 text-agg-foreground",
3603
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3604
+ )
3605
+ }
3606
+ ),
3607
+ /* @__PURE__ */ jsx10(
3578
3608
  "p",
3579
3609
  {
3580
3610
  className: cn(
@@ -3586,35 +3616,62 @@ var TradeRow = ({
3586
3616
  }
3587
3617
  )
3588
3618
  ] }),
3589
- /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsx9(TradeOutcomeShares, { activity, tone }) })
3619
+ /* @__PURE__ */ jsx10(OutcomeBadge, { label: activity.outcomeLabel, tone })
3590
3620
  ] }),
3591
- /* @__PURE__ */ jsx9(TradeTypeCell, { activity, tone }),
3592
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3593
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3594
- /* @__PURE__ */ jsx9("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx9(
3621
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3622
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3623
+ /* @__PURE__ */ jsx10("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx10(
3595
3624
  RemoteImage,
3596
3625
  {
3597
3626
  src: activity.thumbnailSrc,
3598
3627
  alt: "",
3599
3628
  className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
3600
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
3601
- }
3602
- ) }),
3603
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
3604
- /* @__PURE__ */ jsx9(
3605
- "p",
3606
- {
3607
- className: cn(
3608
- "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]",
3609
- tone.primary
3610
- ),
3611
- children: activity.title
3612
- }
3613
- ),
3614
- /* @__PURE__ */ jsx9("div", { className: "hidden flex-wrap items-center gap-2 sm:flex sm:gap-3", children: /* @__PURE__ */ jsx9(TradeOutcomeShares, { activity, tone }) })
3629
+ classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
3630
+ }
3631
+ ) }),
3632
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
3633
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-2", children: [
3634
+ /* @__PURE__ */ jsx10(
3635
+ "p",
3636
+ {
3637
+ className: cn(
3638
+ "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",
3639
+ tone.primary
3640
+ ),
3641
+ children: activity.title
3642
+ }
3643
+ ),
3644
+ shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx10(
3645
+ LoadingIcon,
3646
+ {
3647
+ size: "small",
3648
+ className: cn("shrink-0", statusVisual.iconClassName)
3649
+ }
3650
+ ) : /* @__PURE__ */ jsx10(
3651
+ Icon,
3652
+ {
3653
+ name: statusVisual.icon,
3654
+ size: "small",
3655
+ className: cn("shrink-0", statusVisual.iconClassName)
3656
+ }
3657
+ ) : null
3658
+ ] }),
3659
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
3660
+ /* @__PURE__ */ jsx10("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx10(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
3661
+ /* @__PURE__ */ jsx10(
3662
+ "p",
3663
+ {
3664
+ className: cn(
3665
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3666
+ tone.meta
3667
+ ),
3668
+ children: activity.marketTitle
3669
+ }
3670
+ )
3671
+ ] })
3615
3672
  ] })
3616
3673
  ] }),
3617
- /* @__PURE__ */ jsx9(
3674
+ /* @__PURE__ */ jsx10(
3618
3675
  AmountTimeStack,
3619
3676
  {
3620
3677
  amountLabel: activity.amountLabel,
@@ -3624,7 +3681,7 @@ var TradeRow = ({
3624
3681
  }
3625
3682
  )
3626
3683
  ] }),
3627
- /* @__PURE__ */ jsx9(
3684
+ /* @__PURE__ */ jsx10(
3628
3685
  AmountTimeStack,
3629
3686
  {
3630
3687
  amountLabel: activity.amountLabel,
@@ -3636,6 +3693,86 @@ var TradeRow = ({
3636
3693
  }
3637
3694
  )
3638
3695
  }
3696
+ );
3697
+ };
3698
+ var TradeRow = ({
3699
+ activity,
3700
+ className,
3701
+ href,
3702
+ onClick
3703
+ }) => {
3704
+ const tone = resolveToneClasses(activity);
3705
+ return /* @__PURE__ */ jsx10(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ jsxs9(
3706
+ "div",
3707
+ {
3708
+ className: cn(
3709
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
3710
+ "relative z-10"
3711
+ ),
3712
+ children: [
3713
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
3714
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3715
+ /* @__PURE__ */ jsx10(VenueLogo, { venue: activity.venue, size: "small", className: "size-5 shrink-0" }),
3716
+ /* @__PURE__ */ jsx10(
3717
+ "p",
3718
+ {
3719
+ className: cn(
3720
+ "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3721
+ tone.primary,
3722
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3723
+ ),
3724
+ children: activity.type
3725
+ }
3726
+ )
3727
+ ] }),
3728
+ /* @__PURE__ */ jsx10("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsx10(TradeOutcomeShares, { activity, tone }) })
3729
+ ] }),
3730
+ /* @__PURE__ */ jsx10(TradeTypeCell, { activity, tone }),
3731
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3732
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3733
+ /* @__PURE__ */ jsx10("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx10(
3734
+ RemoteImage,
3735
+ {
3736
+ src: activity.thumbnailSrc,
3737
+ alt: "",
3738
+ className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
3739
+ classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
3740
+ }
3741
+ ) }),
3742
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
3743
+ /* @__PURE__ */ jsx10(
3744
+ "p",
3745
+ {
3746
+ className: cn(
3747
+ "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]",
3748
+ tone.primary
3749
+ ),
3750
+ children: activity.title
3751
+ }
3752
+ ),
3753
+ /* @__PURE__ */ jsx10("div", { className: "hidden flex-wrap items-center gap-2 sm:flex sm:gap-3", children: /* @__PURE__ */ jsx10(TradeOutcomeShares, { activity, tone }) })
3754
+ ] })
3755
+ ] }),
3756
+ /* @__PURE__ */ jsx10(
3757
+ AmountTimeStack,
3758
+ {
3759
+ amountLabel: activity.amountLabel,
3760
+ timeLabel: activity.timeLabel,
3761
+ tone,
3762
+ mobile: true
3763
+ }
3764
+ )
3765
+ ] }),
3766
+ /* @__PURE__ */ jsx10(
3767
+ AmountTimeStack,
3768
+ {
3769
+ amountLabel: activity.amountLabel,
3770
+ timeLabel: activity.timeLabel,
3771
+ tone
3772
+ }
3773
+ )
3774
+ ]
3775
+ }
3639
3776
  ) });
3640
3777
  };
3641
3778
  var TransferRow = ({
@@ -3648,7 +3785,7 @@ var TransferRow = ({
3648
3785
  const transferStatus = resolveActivityStatus(activity);
3649
3786
  const transferIconName = TRANSFER_ICON[activity.kind];
3650
3787
  const statusVisual = getStatusVisual(activity);
3651
- return /* @__PURE__ */ jsx9(
3788
+ return /* @__PURE__ */ jsx10(
3652
3789
  RowWrapper,
3653
3790
  {
3654
3791
  className,
@@ -3656,116 +3793,98 @@ var TransferRow = ({
3656
3793
  target: href ? "_blank" : void 0,
3657
3794
  rel: href ? "noopener noreferrer" : void 0,
3658
3795
  onClick,
3659
- children: /* @__PURE__ */ jsx9(
3660
- ConditionalWrapper,
3796
+ children: /* @__PURE__ */ jsxs9(
3797
+ "div",
3661
3798
  {
3662
- condition: !!activity.errorMessage,
3663
- wrapper: (children) => /* @__PURE__ */ jsx9(
3664
- Tooltip,
3665
- {
3666
- size: "medium",
3667
- content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
3668
- /* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
3669
- /* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
3670
- ] }),
3671
- sideOffset: 4,
3672
- children
3673
- }
3799
+ className: cn(
3800
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
3801
+ "relative z-10"
3674
3802
  ),
3675
- children: /* @__PURE__ */ jsxs8(
3676
- "div",
3677
- {
3678
- className: cn(
3679
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
3680
- "relative z-10"
3803
+ children: [
3804
+ /* @__PURE__ */ jsx10(TransferTypeCell, { activity, tone }),
3805
+ /* @__PURE__ */ jsx10("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3806
+ /* @__PURE__ */ jsx10(
3807
+ Icon,
3808
+ {
3809
+ name: transferIconName,
3810
+ size: "small",
3811
+ className: cn(
3812
+ "shrink-0 text-agg-foreground",
3813
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3814
+ )
3815
+ }
3681
3816
  ),
3682
- children: [
3683
- /* @__PURE__ */ jsx9(TransferTypeCell, { activity, tone }),
3684
- /* @__PURE__ */ jsx9("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3685
- /* @__PURE__ */ jsx9(
3686
- Icon,
3817
+ /* @__PURE__ */ jsx10(
3818
+ "p",
3819
+ {
3820
+ className: cn(
3821
+ "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3822
+ tone.primary,
3823
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3824
+ ),
3825
+ children: activity.type
3826
+ }
3827
+ )
3828
+ ] }) }),
3829
+ /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3830
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3831
+ /* @__PURE__ */ jsx10(
3832
+ "div",
3833
+ {
3834
+ 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",
3835
+ "data-status": transferStatus,
3836
+ children: statusVisual.spin ? /* @__PURE__ */ jsx10(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx10(
3837
+ Icon,
3838
+ {
3839
+ name: statusVisual.icon,
3840
+ size: "medium",
3841
+ className: cn(statusVisual.iconClassName)
3842
+ }
3843
+ )
3844
+ }
3845
+ ),
3846
+ /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
3847
+ /* @__PURE__ */ jsx10(
3848
+ "p",
3687
3849
  {
3688
- name: transferIconName,
3689
- size: "small",
3690
3850
  className: cn(
3691
- "shrink-0 text-agg-foreground",
3692
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3693
- )
3851
+ "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",
3852
+ tone.primary
3853
+ ),
3854
+ children: activity.title
3694
3855
  }
3695
3856
  ),
3696
- /* @__PURE__ */ jsx9(
3857
+ /* @__PURE__ */ jsx10(
3697
3858
  "p",
3698
3859
  {
3699
3860
  className: cn(
3700
- "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3701
- tone.primary,
3702
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
3703
- ),
3704
- children: activity.type
3705
- }
3706
- )
3707
- ] }) }),
3708
- /* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:contents", children: [
3709
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
3710
- /* @__PURE__ */ jsx9(
3711
- "div",
3712
- {
3713
- 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",
3714
- "data-status": transferStatus,
3715
- children: statusVisual.spin ? /* @__PURE__ */ jsx9(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx9(
3716
- Icon,
3717
- {
3718
- name: statusVisual.icon,
3719
- size: "medium",
3720
- className: cn(statusVisual.iconClassName)
3721
- }
3722
- )
3723
- }
3724
- ),
3725
- /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
3726
- /* @__PURE__ */ jsx9(
3727
- "p",
3728
- {
3729
- className: cn(
3730
- "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",
3731
- tone.primary
3732
- ),
3733
- children: activity.title
3734
- }
3861
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3862
+ tone.meta
3735
3863
  ),
3736
- /* @__PURE__ */ jsx9(
3737
- "p",
3738
- {
3739
- className: cn(
3740
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
3741
- tone.meta
3742
- ),
3743
- children: activity.subtitleLabel
3744
- }
3745
- )
3746
- ] })
3747
- ] }),
3748
- /* @__PURE__ */ jsx9(
3749
- AmountTimeStack,
3750
- {
3751
- amountLabel: activity.amountLabel,
3752
- timeLabel: activity.timeLabel,
3753
- tone,
3754
- mobile: true
3864
+ children: activity.subtitleLabel
3755
3865
  }
3756
3866
  )
3757
- ] }),
3758
- /* @__PURE__ */ jsx9(
3759
- AmountTimeStack,
3760
- {
3761
- amountLabel: activity.amountLabel,
3762
- timeLabel: activity.timeLabel,
3763
- tone
3764
- }
3765
- )
3766
- ]
3767
- }
3768
- )
3867
+ ] })
3868
+ ] }),
3869
+ /* @__PURE__ */ jsx10(
3870
+ AmountTimeStack,
3871
+ {
3872
+ amountLabel: activity.amountLabel,
3873
+ timeLabel: activity.timeLabel,
3874
+ tone,
3875
+ mobile: true
3876
+ }
3877
+ )
3878
+ ] }),
3879
+ /* @__PURE__ */ jsx10(
3880
+ AmountTimeStack,
3881
+ {
3882
+ amountLabel: activity.amountLabel,
3883
+ timeLabel: activity.timeLabel,
3884
+ tone
3885
+ }
3886
+ )
3887
+ ]
3769
3888
  }
3770
3889
  )
3771
3890
  }
@@ -3783,10 +3902,10 @@ var ActivityRow = ({ activity, href, onClick }) => {
3783
3902
  "before:bg-agg-secondary-hover before:rounded-agg-xl"
3784
3903
  );
3785
3904
  if (activity.kind === "trade") {
3786
- return /* @__PURE__ */ jsx9(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
3905
+ return /* @__PURE__ */ jsx10(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
3787
3906
  }
3788
3907
  if (activity.kind === "redeem") {
3789
- return /* @__PURE__ */ jsx9(
3908
+ return /* @__PURE__ */ jsx10(
3790
3909
  RedeemRow,
3791
3910
  {
3792
3911
  activity,
@@ -3796,7 +3915,7 @@ var ActivityRow = ({ activity, href, onClick }) => {
3796
3915
  }
3797
3916
  );
3798
3917
  }
3799
- return /* @__PURE__ */ jsx9(
3918
+ return /* @__PURE__ */ jsx10(
3800
3919
  TransferRow,
3801
3920
  {
3802
3921
  activity,
@@ -3809,19 +3928,19 @@ var ActivityRow = ({ activity, href, onClick }) => {
3809
3928
  ActivityRow.displayName = "ActivityRow";
3810
3929
 
3811
3930
  // src/pages/user-profile/components/empty-state.tsx
3812
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
3931
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
3813
3932
  var EmptyState = ({ title, description, className }) => {
3814
- return /* @__PURE__ */ jsx10(
3933
+ return /* @__PURE__ */ jsx11(
3815
3934
  "div",
3816
3935
  {
3817
3936
  className: cn("flex flex-col items-center justify-center gap-8 p-10", className),
3818
3937
  role: "status",
3819
3938
  "aria-live": "polite",
3820
- children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-center gap-5", children: [
3821
- /* @__PURE__ */ jsx10(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
3822
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
3823
- /* @__PURE__ */ jsx10("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title }),
3824
- description ? /* @__PURE__ */ jsx10("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal", children: description }) : null
3939
+ children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center gap-5", children: [
3940
+ /* @__PURE__ */ jsx11(SearchEmptyIcon, { className: "h-10 w-10 text-agg-muted-foreground", "aria-hidden": true }),
3941
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center gap-1 text-center text-agg-foreground", children: [
3942
+ /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold", children: title }),
3943
+ description ? /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal", children: description }) : null
3825
3944
  ] })
3826
3945
  ] })
3827
3946
  }
@@ -3830,8 +3949,8 @@ var EmptyState = ({ title, description, className }) => {
3830
3949
  EmptyState.displayName = "EmptyState";
3831
3950
 
3832
3951
  // src/pages/user-profile/components/position-row.tsx
3833
- import { optimizedImageUrl, useLabels as useLabels6 } from "@agg-build/hooks";
3834
- import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
3952
+ import { optimizedImageUrl, useLabels as useLabels7 } from "@agg-build/hooks";
3953
+ import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
3835
3954
  var floorToTwoDecimals = (value) => {
3836
3955
  if (!Number.isFinite(value) || value <= 0) return 0;
3837
3956
  return Math.trunc(value * 100) / 100;
@@ -3844,8 +3963,8 @@ var toneTextClassName = (tone) => {
3844
3963
  if (tone === "negative") return "text-agg-error";
3845
3964
  return "text-agg-muted-foreground";
3846
3965
  };
3847
- var OutcomePill = ({ label }) => /* @__PURE__ */ jsx11("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__ */ jsx11("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label }) });
3848
- var ResolutionPill = ({ label }) => /* @__PURE__ */ jsx11("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__ */ jsx11("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label }) });
3966
+ var OutcomePill = ({ label }) => /* @__PURE__ */ jsx12("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__ */ jsx12("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label }) });
3967
+ var ResolutionPill = ({ label }) => /* @__PURE__ */ jsx12("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__ */ jsx12("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label }) });
3849
3968
  var VenueShares = ({
3850
3969
  model,
3851
3970
  totalSharesLabel,
@@ -3853,26 +3972,26 @@ var VenueShares = ({
3853
3972
  keyPrefix
3854
3973
  }) => {
3855
3974
  if (!totalSharesLabel && model.venueShareBreakdown.length === 0) return null;
3856
- return /* @__PURE__ */ jsxs10("div", { className: cn(className, "gap-2"), children: [
3857
- model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ jsx11("div", { className: "flex items-center gap-1", children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ jsx11(
3975
+ return /* @__PURE__ */ jsxs11("div", { className: cn(className, "gap-2"), children: [
3976
+ model.venueShareBreakdown.length > 0 ? /* @__PURE__ */ jsx12("div", { className: "flex items-center gap-1", children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ jsx12(
3858
3977
  Tooltip,
3859
3978
  {
3860
- content: /* @__PURE__ */ jsx11("span", { children: row.sharesLabel }),
3979
+ content: /* @__PURE__ */ jsx12("span", { children: row.sharesLabel }),
3861
3980
  "aria-label": `${row.venue} shares`,
3862
3981
  side: "top",
3863
- children: /* @__PURE__ */ jsx11(
3982
+ children: /* @__PURE__ */ jsx12(
3864
3983
  "span",
3865
3984
  {
3866
3985
  tabIndex: 0,
3867
3986
  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",
3868
3987
  "aria-label": `${row.venue} shares`,
3869
- children: /* @__PURE__ */ jsx11(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
3988
+ children: /* @__PURE__ */ jsx12(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
3870
3989
  }
3871
3990
  )
3872
3991
  },
3873
3992
  `${keyPrefix}-${row.venue}-${String(index)}`
3874
3993
  )) }) : null,
3875
- totalSharesLabel ? /* @__PURE__ */ jsx11("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: totalSharesLabel }) : null
3994
+ totalSharesLabel ? /* @__PURE__ */ jsx12("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: totalSharesLabel }) : null
3876
3995
  ] });
3877
3996
  };
3878
3997
  var StatusBadge = ({
@@ -3881,7 +4000,7 @@ var StatusBadge = ({
3881
4000
  }) => {
3882
4001
  if (status === "lost" || status === "won_claimed") return null;
3883
4002
  const isWon = status === "won_unclaimed";
3884
- return /* @__PURE__ */ jsxs10(
4003
+ return /* @__PURE__ */ jsxs11(
3885
4004
  "span",
3886
4005
  {
3887
4006
  className: cn(
@@ -3890,7 +4009,7 @@ var StatusBadge = ({
3890
4009
  isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-foreground"
3891
4010
  ),
3892
4011
  children: [
3893
- /* @__PURE__ */ jsx11(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
4012
+ /* @__PURE__ */ jsx12(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
3894
4013
  isWon ? labels.won : labels.open
3895
4014
  ]
3896
4015
  }
@@ -3903,7 +4022,7 @@ var ResultBadge = ({
3903
4022
  if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
3904
4023
  const isWon = status === "won_claimed";
3905
4024
  const isSold = status === "sold";
3906
- return /* @__PURE__ */ jsxs10(
4025
+ return /* @__PURE__ */ jsxs11(
3907
4026
  "span",
3908
4027
  {
3909
4028
  className: cn(
@@ -3912,7 +4031,7 @@ var ResultBadge = ({
3912
4031
  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"
3913
4032
  ),
3914
4033
  children: [
3915
- /* @__PURE__ */ jsx11(
4034
+ /* @__PURE__ */ jsx12(
3916
4035
  Icon,
3917
4036
  {
3918
4037
  name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
@@ -3928,27 +4047,27 @@ var ResultBadge = ({
3928
4047
  var TotalTradedCell = ({
3929
4048
  model,
3930
4049
  className
3931
- }) => /* @__PURE__ */ jsxs10(
4050
+ }) => /* @__PURE__ */ jsxs11(
3932
4051
  "div",
3933
4052
  {
3934
4053
  className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
3935
4054
  children: [
3936
- /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
3937
- /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
4055
+ /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
4056
+ /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
3938
4057
  ]
3939
4058
  }
3940
4059
  );
3941
4060
  var PositionValueCell = ({
3942
4061
  value,
3943
4062
  className
3944
- }) => /* @__PURE__ */ jsxs10(
4063
+ }) => /* @__PURE__ */ jsxs11(
3945
4064
  "div",
3946
4065
  {
3947
4066
  className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
3948
4067
  children: [
3949
- /* @__PURE__ */ jsxs10("div", { className: "flex items-baseline gap-1.5", children: [
3950
- /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
3951
- /* @__PURE__ */ jsx11(
4068
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-1.5", children: [
4069
+ /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
4070
+ /* @__PURE__ */ jsx12(
3952
4071
  "p",
3953
4072
  {
3954
4073
  className: cn(
@@ -3959,9 +4078,9 @@ var PositionValueCell = ({
3959
4078
  }
3960
4079
  )
3961
4080
  ] }),
3962
- /* @__PURE__ */ jsxs10("div", { className: "flex items-baseline gap-1.5", children: [
3963
- /* @__PURE__ */ jsx11("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
3964
- /* @__PURE__ */ jsx11(
4081
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-1.5", children: [
4082
+ /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
4083
+ /* @__PURE__ */ jsx12(
3965
4084
  "p",
3966
4085
  {
3967
4086
  className: cn(
@@ -3983,7 +4102,7 @@ var PositionRow = ({
3983
4102
  onClaim,
3984
4103
  isClaiming = false
3985
4104
  }) => {
3986
- const labels = useLabels6().userProfile.positions;
4105
+ const labels = useLabels7().userProfile.positions;
3987
4106
  const model = toPositionRowViewModel(position, {
3988
4107
  avgPrefix: labels.avgPrefix,
3989
4108
  nowPrefix: labels.nowPrefix,
@@ -4025,7 +4144,7 @@ var PositionRow = ({
4025
4144
  handleDivClick();
4026
4145
  }
4027
4146
  };
4028
- return /* @__PURE__ */ jsx11(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ jsxs10(
4147
+ return /* @__PURE__ */ jsx12(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ jsxs11(
4029
4148
  "div",
4030
4149
  {
4031
4150
  className: cn(
@@ -4033,9 +4152,9 @@ var PositionRow = ({
4033
4152
  isClosed ? "md:gap-8" : "md:gap-6"
4034
4153
  ),
4035
4154
  children: [
4036
- /* @__PURE__ */ jsxs10("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: [
4037
- /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
4038
- /* @__PURE__ */ jsx11("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ jsx11(
4155
+ /* @__PURE__ */ jsxs11("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: [
4156
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
4157
+ /* @__PURE__ */ jsx12("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ jsx12(
4039
4158
  RemoteImage,
4040
4159
  {
4041
4160
  src: optimizedImageUrl(model.thumbnailSrc, 60),
@@ -4043,11 +4162,11 @@ var PositionRow = ({
4043
4162
  className: "h-full w-full rounded-agg-sm object-cover"
4044
4163
  }
4045
4164
  ) }),
4046
- /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 flex-col", children: [
4047
- /* @__PURE__ */ jsx11("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 }),
4048
- /* @__PURE__ */ jsxs10("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
4049
- /* @__PURE__ */ jsx11(OutcomePill, { label: model.selectedOutcomeLabel }),
4050
- /* @__PURE__ */ jsx11(
4165
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col", children: [
4166
+ /* @__PURE__ */ jsx12("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 }),
4167
+ /* @__PURE__ */ jsxs11("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
4168
+ /* @__PURE__ */ jsx12(OutcomePill, { label: model.selectedOutcomeLabel }),
4169
+ /* @__PURE__ */ jsx12(
4051
4170
  VenueShares,
4052
4171
  {
4053
4172
  model,
@@ -4059,10 +4178,10 @@ var PositionRow = ({
4059
4178
  ] })
4060
4179
  ] })
4061
4180
  ] }),
4062
- /* @__PURE__ */ jsx11("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ jsx11(OutcomePill, { label: model.selectedOutcomeLabel }) })
4181
+ /* @__PURE__ */ jsx12("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ jsx12(OutcomePill, { label: model.selectedOutcomeLabel }) })
4063
4182
  ] }),
4064
- isClosed ? /* @__PURE__ */ jsx11("div", { className: "md:hidden", children: /* @__PURE__ */ jsx11(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
4065
- /* @__PURE__ */ jsx11(
4183
+ isClosed ? /* @__PURE__ */ jsx12("div", { className: "md:hidden", children: /* @__PURE__ */ jsx12(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
4184
+ /* @__PURE__ */ jsx12(
4066
4185
  VenueShares,
4067
4186
  {
4068
4187
  model,
@@ -4071,14 +4190,14 @@ var PositionRow = ({
4071
4190
  className: "agg-position-venues flex min-w-0 flex-1 flex-wrap content-center items-center gap-x-3 gap-y-2 md:hidden"
4072
4191
  }
4073
4192
  ),
4074
- /* @__PURE__ */ jsxs10("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
4075
- /* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 items-center gap-5", children: [
4076
- /* @__PURE__ */ jsx11(TotalTradedCell, { model }),
4077
- /* @__PURE__ */ jsx11(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
4193
+ /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
4194
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 items-center gap-5", children: [
4195
+ /* @__PURE__ */ jsx12(TotalTradedCell, { model }),
4196
+ /* @__PURE__ */ jsx12(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
4078
4197
  ] }),
4079
- isClosed ? /* @__PURE__ */ jsx11(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
4080
- /* @__PURE__ */ jsx11(StatusBadge, { status: model.positionStatus, labels }),
4081
- model.canClaim ? /* @__PURE__ */ jsxs10(
4198
+ isClosed ? /* @__PURE__ */ jsx12(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
4199
+ /* @__PURE__ */ jsx12(StatusBadge, { status: model.positionStatus, labels }),
4200
+ model.canClaim ? /* @__PURE__ */ jsxs11(
4082
4201
  "button",
4083
4202
  {
4084
4203
  type: "button",
@@ -4087,48 +4206,48 @@ var PositionRow = ({
4087
4206
  disabled: isClaiming,
4088
4207
  "aria-busy": isClaiming || void 0,
4089
4208
  children: [
4090
- isClaiming ? /* @__PURE__ */ jsx11(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4209
+ isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4091
4210
  labels.claim
4092
4211
  ]
4093
4212
  }
4094
4213
  ) : null
4095
4214
  ] })
4096
4215
  ] }),
4097
- isClosed ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
4098
- /* @__PURE__ */ jsx11("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ jsx11(ResolutionPill, { label: model.resolutionLabel }) }),
4099
- /* @__PURE__ */ jsx11(
4216
+ isClosed ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
4217
+ /* @__PURE__ */ jsx12("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ jsx12(ResolutionPill, { label: model.resolutionLabel }) }),
4218
+ /* @__PURE__ */ jsx12(
4100
4219
  TotalTradedCell,
4101
4220
  {
4102
4221
  model,
4103
4222
  className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
4104
4223
  }
4105
4224
  ),
4106
- /* @__PURE__ */ jsx11(
4225
+ /* @__PURE__ */ jsx12(
4107
4226
  PositionValueCell,
4108
4227
  {
4109
4228
  value: model.payout,
4110
4229
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
4111
4230
  }
4112
4231
  ),
4113
- /* @__PURE__ */ jsx11("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ jsx11(ResultBadge, { status: model.positionStatus, labels }) })
4114
- ] }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
4115
- /* @__PURE__ */ jsx11(
4232
+ /* @__PURE__ */ jsx12("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ jsx12(ResultBadge, { status: model.positionStatus, labels }) })
4233
+ ] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
4234
+ /* @__PURE__ */ jsx12(
4116
4235
  TotalTradedCell,
4117
4236
  {
4118
4237
  model,
4119
4238
  className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
4120
4239
  }
4121
4240
  ),
4122
- /* @__PURE__ */ jsx11(
4241
+ /* @__PURE__ */ jsx12(
4123
4242
  PositionValueCell,
4124
4243
  {
4125
4244
  value: model.currentValue,
4126
4245
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
4127
4246
  }
4128
4247
  ),
4129
- /* @__PURE__ */ jsxs10("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
4130
- /* @__PURE__ */ jsx11(StatusBadge, { status: model.positionStatus, labels }),
4131
- model.canClaim ? /* @__PURE__ */ jsxs10(
4248
+ /* @__PURE__ */ jsxs11("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
4249
+ /* @__PURE__ */ jsx12(StatusBadge, { status: model.positionStatus, labels }),
4250
+ model.canClaim ? /* @__PURE__ */ jsxs11(
4132
4251
  "button",
4133
4252
  {
4134
4253
  type: "button",
@@ -4137,14 +4256,14 @@ var PositionRow = ({
4137
4256
  disabled: isClaiming,
4138
4257
  "aria-busy": isClaiming || void 0,
4139
4258
  children: [
4140
- isClaiming ? /* @__PURE__ */ jsx11(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4259
+ isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4141
4260
  labels.claim
4142
4261
  ]
4143
4262
  }
4144
4263
  ) : null
4145
4264
  ] })
4146
4265
  ] }),
4147
- /* @__PURE__ */ jsx11("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ jsx11(
4266
+ /* @__PURE__ */ jsx12("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ jsx12(
4148
4267
  Icon,
4149
4268
  {
4150
4269
  name: "chevron-right",
@@ -4159,16 +4278,16 @@ var PositionRow = ({
4159
4278
  PositionRow.displayName = "PositionRow";
4160
4279
 
4161
4280
  // src/pages/user-profile/components/positions-activity.tsx
4162
- import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4281
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4163
4282
  var tabItems = [
4164
4283
  { value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
4165
4284
  // Open orders is intentionally hidden from the user-profile tab group.
4166
4285
  // Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
4167
4286
  { value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
4168
4287
  ];
4169
- var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ jsx12("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ jsxs11(Fragment4, { children: [
4170
- /* @__PURE__ */ jsx12("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
4171
- index < acc.length - 1 ? /* @__PURE__ */ jsx12("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
4288
+ var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ jsx13("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
4289
+ /* @__PURE__ */ jsx13("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
4290
+ index < acc.length - 1 ? /* @__PURE__ */ jsx13("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
4172
4291
  ] }, index)) });
4173
4292
  var PositionsActivity = ({
4174
4293
  activePositions = [],
@@ -4199,7 +4318,7 @@ var PositionsActivity = ({
4199
4318
  initialPositionFilter = "active",
4200
4319
  className
4201
4320
  }) => {
4202
- const positionsLabels = useLabels7().userProfile.positions;
4321
+ const positionsLabels = useLabels8().userProfile.positions;
4203
4322
  const isTabControlled = tab !== void 0;
4204
4323
  const [internalActiveTab, setInternalActiveTab] = useState10(
4205
4324
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
@@ -4329,7 +4448,7 @@ var PositionsActivity = ({
4329
4448
  isLoadingMoreActivities,
4330
4449
  onLoadMoreActivities
4331
4450
  ]);
4332
- return /* @__PURE__ */ jsxs11(
4451
+ return /* @__PURE__ */ jsxs12(
4333
4452
  "div",
4334
4453
  {
4335
4454
  className: cn(
@@ -4338,7 +4457,7 @@ var PositionsActivity = ({
4338
4457
  className
4339
4458
  ),
4340
4459
  children: [
4341
- /* @__PURE__ */ jsx12(
4460
+ /* @__PURE__ */ jsx13(
4342
4461
  Tabs,
4343
4462
  {
4344
4463
  items: tabItems,
@@ -4352,7 +4471,7 @@ var PositionsActivity = ({
4352
4471
  }
4353
4472
  }
4354
4473
  ),
4355
- /* @__PURE__ */ jsxs11(
4474
+ /* @__PURE__ */ jsxs12(
4356
4475
  "div",
4357
4476
  {
4358
4477
  className: cn(
@@ -4360,12 +4479,12 @@ var PositionsActivity = ({
4360
4479
  isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
4361
4480
  ),
4362
4481
  children: [
4363
- isPositionsTab ? /* @__PURE__ */ jsxs11("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
4364
- /* @__PURE__ */ jsx12("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) => {
4482
+ isPositionsTab ? /* @__PURE__ */ jsxs12("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
4483
+ /* @__PURE__ */ jsx13("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) => {
4365
4484
  const isActive = filter.value === positionFilter;
4366
- return /* @__PURE__ */ jsxs11("div", { className: "flex flex-1 items-stretch", children: [
4367
- idx > 0 ? /* @__PURE__ */ jsx12("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
4368
- /* @__PURE__ */ jsx12(
4485
+ return /* @__PURE__ */ jsxs12("div", { className: "flex flex-1 items-stretch", children: [
4486
+ idx > 0 ? /* @__PURE__ */ jsx13("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
4487
+ /* @__PURE__ */ jsx13(
4369
4488
  "button",
4370
4489
  {
4371
4490
  type: "button",
@@ -4380,7 +4499,7 @@ var PositionsActivity = ({
4380
4499
  )
4381
4500
  ] }, filter.value);
4382
4501
  }) }),
4383
- /* @__PURE__ */ jsxs11(
4502
+ /* @__PURE__ */ jsxs12(
4384
4503
  "div",
4385
4504
  {
4386
4505
  className: "agg-position-search relative flex w-full min-w-0 flex-1",
@@ -4391,9 +4510,9 @@ var PositionsActivity = ({
4391
4510
  setIsSearchFocused(false);
4392
4511
  },
4393
4512
  children: [
4394
- /* @__PURE__ */ jsx12("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ jsxs11("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: [
4395
- /* @__PURE__ */ jsx12(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
4396
- /* @__PURE__ */ jsx12(
4513
+ /* @__PURE__ */ jsx13("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ jsxs12("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: [
4514
+ /* @__PURE__ */ jsx13(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
4515
+ /* @__PURE__ */ jsx13(
4397
4516
  "input",
4398
4517
  {
4399
4518
  value: searchValue,
@@ -4408,7 +4527,7 @@ var PositionsActivity = ({
4408
4527
  }
4409
4528
  )
4410
4529
  ] }) }),
4411
- isSearchFocused && searchValue.trim() ? /* @__PURE__ */ jsx12("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__ */ jsx12(
4530
+ isSearchFocused && searchValue.trim() ? /* @__PURE__ */ jsx13("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__ */ jsx13(
4412
4531
  "ul",
4413
4532
  {
4414
4533
  className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
@@ -4421,9 +4540,9 @@ var PositionsActivity = ({
4421
4540
  setIsSearchFocused(false);
4422
4541
  onPositionClick == null ? void 0 : onPositionClick(item.raw);
4423
4542
  };
4424
- const innerContent = /* @__PURE__ */ jsxs11(Fragment5, { children: [
4425
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
4426
- /* @__PURE__ */ jsx12(
4543
+ const innerContent = /* @__PURE__ */ jsxs12(Fragment5, { children: [
4544
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
4545
+ /* @__PURE__ */ jsx13(
4427
4546
  "img",
4428
4547
  {
4429
4548
  src: optimizedImageUrl2(item.thumbnailSrc, 48),
@@ -4431,16 +4550,16 @@ var PositionsActivity = ({
4431
4550
  className: "size-12 shrink-0 rounded-agg-lg object-cover"
4432
4551
  }
4433
4552
  ),
4434
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
4435
- /* @__PURE__ */ jsx12("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 }),
4436
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
4437
- /* @__PURE__ */ jsx12("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 }),
4438
- /* @__PURE__ */ jsx12("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
4439
- /* @__PURE__ */ jsx12("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 })
4553
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
4554
+ /* @__PURE__ */ jsx13("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 }),
4555
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
4556
+ /* @__PURE__ */ jsx13("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 }),
4557
+ /* @__PURE__ */ jsx13("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
4558
+ /* @__PURE__ */ jsx13("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 })
4440
4559
  ] })
4441
4560
  ] })
4442
4561
  ] }),
4443
- /* @__PURE__ */ jsx12(
4562
+ /* @__PURE__ */ jsx13(
4444
4563
  Icon,
4445
4564
  {
4446
4565
  name: "chevron-right",
@@ -4449,7 +4568,7 @@ var PositionsActivity = ({
4449
4568
  }
4450
4569
  )
4451
4570
  ] });
4452
- return /* @__PURE__ */ jsx12(
4571
+ return /* @__PURE__ */ jsx13(
4453
4572
  "li",
4454
4573
  {
4455
4574
  role: "presentation",
@@ -4457,7 +4576,7 @@ var PositionsActivity = ({
4457
4576
  "agg-position-search-result-item",
4458
4577
  index > 0 && "border-t border-agg-separator"
4459
4578
  ),
4460
- children: itemHref ? /* @__PURE__ */ jsx12(
4579
+ children: itemHref ? /* @__PURE__ */ jsx13(
4461
4580
  "a",
4462
4581
  {
4463
4582
  href: itemHref,
@@ -4472,7 +4591,7 @@ var PositionsActivity = ({
4472
4591
  },
4473
4592
  children: innerContent
4474
4593
  }
4475
- ) : /* @__PURE__ */ jsx12(
4594
+ ) : /* @__PURE__ */ jsx13(
4476
4595
  "button",
4477
4596
  {
4478
4597
  type: "button",
@@ -4486,34 +4605,34 @@ var PositionsActivity = ({
4486
4605
  );
4487
4606
  })
4488
4607
  }
4489
- ) : /* @__PURE__ */ jsx12("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
4608
+ ) : /* @__PURE__ */ jsx13("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
4490
4609
  ]
4491
4610
  }
4492
4611
  )
4493
4612
  ] }) : null,
4494
- /* @__PURE__ */ jsxs11("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
4495
- /* @__PURE__ */ jsxs11("div", { className: "w-full px-4 sm:px-6", children: [
4496
- isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ jsxs11("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
4497
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4498
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
4499
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
4500
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
4501
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
4502
- /* @__PURE__ */ jsx12("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4503
- ] }) : /* @__PURE__ */ jsxs11("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4504
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4505
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
4506
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
4507
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
4508
- /* @__PURE__ */ jsx12("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4613
+ /* @__PURE__ */ jsxs12("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
4614
+ /* @__PURE__ */ jsxs12("div", { className: "w-full px-4 sm:px-6", children: [
4615
+ isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
4616
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4617
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
4618
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
4619
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
4620
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
4621
+ /* @__PURE__ */ jsx13("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4622
+ ] }) : /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4623
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4624
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
4625
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
4626
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
4627
+ /* @__PURE__ */ jsx13("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4509
4628
  ] }) : null,
4510
- isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ jsxs11("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4511
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
4512
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
4513
- /* @__PURE__ */ jsx12("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
4629
+ isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4630
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
4631
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
4632
+ /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
4514
4633
  ] }) : null
4515
4634
  ] }),
4516
- /* @__PURE__ */ jsx12(
4635
+ /* @__PURE__ */ jsx13(
4517
4636
  "div",
4518
4637
  {
4519
4638
  ref: rowsScrollRef,
@@ -4525,8 +4644,8 @@ var PositionsActivity = ({
4525
4644
  "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
4526
4645
  "[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
4527
4646
  ),
4528
- children: isPositionsTab ? /* @__PURE__ */ jsxs11("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
4529
- isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx12(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx12(
4647
+ children: isPositionsTab ? /* @__PURE__ */ jsxs12("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
4648
+ isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx13(
4530
4649
  EmptyState,
4531
4650
  {
4532
4651
  title: "Unable to load positions",
@@ -4534,15 +4653,15 @@ var PositionsActivity = ({
4534
4653
  }
4535
4654
  ) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
4536
4655
  var _a;
4537
- return /* @__PURE__ */ jsxs11(Fragment4, { children: [
4538
- index > 0 ? /* @__PURE__ */ jsx12(
4656
+ return /* @__PURE__ */ jsxs12(Fragment4, { children: [
4657
+ index > 0 ? /* @__PURE__ */ jsx13(
4539
4658
  "div",
4540
4659
  {
4541
4660
  className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
4542
4661
  "aria-hidden": true
4543
4662
  }
4544
4663
  ) : null,
4545
- /* @__PURE__ */ jsx12(
4664
+ /* @__PURE__ */ jsx13(
4546
4665
  PositionRow,
4547
4666
  {
4548
4667
  position,
@@ -4556,15 +4675,15 @@ var PositionsActivity = ({
4556
4675
  }
4557
4676
  )
4558
4677
  ] }, position.id);
4559
- }) : /* @__PURE__ */ jsx12(
4678
+ }) : /* @__PURE__ */ jsx13(
4560
4679
  EmptyState,
4561
4680
  {
4562
4681
  title: "No positions yet",
4563
4682
  description: "Your open trades will appear here once you place an order."
4564
4683
  }
4565
4684
  ),
4566
- isLoadingMorePositions ? /* @__PURE__ */ jsx12(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
4567
- hasMorePositions ? /* @__PURE__ */ jsx12(
4685
+ isLoadingMorePositions ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
4686
+ hasMorePositions ? /* @__PURE__ */ jsx13(
4568
4687
  "div",
4569
4688
  {
4570
4689
  ref: positionsLoadMoreRef,
@@ -4572,22 +4691,22 @@ var PositionsActivity = ({
4572
4691
  "aria-hidden": true
4573
4692
  }
4574
4693
  ) : null
4575
- ] }) : /* @__PURE__ */ jsxs11("div", { className: "agg-activity-list flex flex-col gap-5", children: [
4576
- isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx12(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx12(
4694
+ ] }) : /* @__PURE__ */ jsxs12("div", { className: "agg-activity-list flex flex-col gap-5", children: [
4695
+ isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx13(
4577
4696
  EmptyState,
4578
4697
  {
4579
4698
  title: "Unable to load activity",
4580
4699
  description: "Please try again in a moment."
4581
4700
  }
4582
- ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ jsxs11(Fragment4, { children: [
4583
- index > 0 ? /* @__PURE__ */ jsx12(
4701
+ ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
4702
+ index > 0 ? /* @__PURE__ */ jsx13(
4584
4703
  "div",
4585
4704
  {
4586
4705
  className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
4587
4706
  "aria-hidden": true
4588
4707
  }
4589
4708
  ) : null,
4590
- /* @__PURE__ */ jsx12(
4709
+ /* @__PURE__ */ jsx13(
4591
4710
  ActivityRow,
4592
4711
  {
4593
4712
  activity,
@@ -4595,15 +4714,15 @@ var PositionsActivity = ({
4595
4714
  onClick: onActivityClick
4596
4715
  }
4597
4716
  )
4598
- ] }, activity.id)) : /* @__PURE__ */ jsx12(
4717
+ ] }, activity.id)) : /* @__PURE__ */ jsx13(
4599
4718
  EmptyState,
4600
4719
  {
4601
4720
  title: "No activity yet",
4602
4721
  description: "Your trading activity will appear here."
4603
4722
  }
4604
4723
  ),
4605
- isLoadingMoreActivities ? /* @__PURE__ */ jsx12(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
4606
- hasMoreActivities ? /* @__PURE__ */ jsx12(
4724
+ isLoadingMoreActivities ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
4725
+ hasMoreActivities ? /* @__PURE__ */ jsx13(
4607
4726
  "div",
4608
4727
  {
4609
4728
  ref: activitiesLoadMoreRef,
@@ -4625,14 +4744,14 @@ var PositionsActivity = ({
4625
4744
  PositionsActivity.displayName = "PositionsActivity";
4626
4745
 
4627
4746
  // src/pages/user-profile/components/positions-value-card.tsx
4628
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4747
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
4629
4748
  var PositionsValueCard = ({
4630
4749
  label = "Positions Value",
4631
4750
  valueLabel,
4632
4751
  isLoading = false,
4633
4752
  className
4634
4753
  }) => {
4635
- return /* @__PURE__ */ jsxs12(
4754
+ return /* @__PURE__ */ jsxs13(
4636
4755
  "div",
4637
4756
  {
4638
4757
  className: cn(
@@ -4641,8 +4760,8 @@ var PositionsValueCard = ({
4641
4760
  className
4642
4761
  ),
4643
4762
  children: [
4644
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
4645
- /* @__PURE__ */ jsx13(
4763
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
4764
+ /* @__PURE__ */ jsx14(
4646
4765
  "svg",
4647
4766
  {
4648
4767
  xmlns: "http://www.w3.org/2000/svg",
@@ -4650,7 +4769,7 @@ var PositionsValueCard = ({
4650
4769
  height: "16",
4651
4770
  viewBox: "0 0 16 16",
4652
4771
  fill: "none",
4653
- children: /* @__PURE__ */ jsx13(
4772
+ children: /* @__PURE__ */ jsx14(
4654
4773
  "path",
4655
4774
  {
4656
4775
  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",
@@ -4659,22 +4778,51 @@ var PositionsValueCard = ({
4659
4778
  )
4660
4779
  }
4661
4780
  ),
4662
- /* @__PURE__ */ jsx13("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
4781
+ /* @__PURE__ */ jsx14("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
4663
4782
  ] }),
4664
- /* @__PURE__ */ jsx13("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ jsx13("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ jsx13(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
4783
+ /* @__PURE__ */ jsx14("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ jsx14("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ jsx14(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
4665
4784
  ]
4666
4785
  }
4667
4786
  );
4668
4787
  };
4669
4788
  PositionsValueCard.displayName = "PositionsValueCard";
4670
4789
 
4790
+ // src/pages/user-profile/transaction-explorer.ts
4791
+ var AGG_TX_EXPLORER_URLS = {
4792
+ "1": "https://etherscan.io/tx/",
4793
+ "56": "https://bscscan.com/tx/",
4794
+ "137": "https://polygonscan.com/tx/",
4795
+ "1337": "https://app.hyperliquid.xyz/explorer/tx/",
4796
+ "8453": "https://basescan.org/tx/",
4797
+ "42161": "https://arbiscan.io/tx/",
4798
+ "792703809": "https://solscan.io/tx/"
4799
+ };
4800
+ var buildAggTxExplorerHref = (chainId, txHash) => {
4801
+ if (chainId === null || chainId === void 0) return void 0;
4802
+ if (!txHash) return void 0;
4803
+ const normalizedChainId = String(chainId).trim();
4804
+ const normalizedTxHash = txHash.trim();
4805
+ if (!normalizedChainId || !normalizedTxHash) return void 0;
4806
+ const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
4807
+ if (!baseUrl) return void 0;
4808
+ return `${baseUrl}${normalizedTxHash}`;
4809
+ };
4810
+
4671
4811
  // src/pages/user-profile/components/user-info-card.tsx
4672
- import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels8 } from "@agg-build/hooks";
4812
+ import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels9 } from "@agg-build/hooks";
4813
+
4814
+ // src/primitives/conditional-wrapper.tsx
4815
+ var ConditionalWrapper = ({
4816
+ condition,
4817
+ wrapper,
4818
+ children
4819
+ }) => condition ? wrapper(children) : children;
4820
+ ConditionalWrapper.displayName = "ConditionalWrapper";
4673
4821
 
4674
4822
  // src/pages/user-profile/components/default-avatar.tsx
4675
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
4823
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4676
4824
  var DefaultAvatar = ({ className }) => {
4677
- return /* @__PURE__ */ jsxs13(
4825
+ return /* @__PURE__ */ jsxs14(
4678
4826
  "svg",
4679
4827
  {
4680
4828
  xmlns: "http://www.w3.org/2000/svg",
@@ -4685,15 +4833,15 @@ var DefaultAvatar = ({ className }) => {
4685
4833
  className: cn("shrink-0 text-agg-muted-foreground", className),
4686
4834
  "aria-hidden": true,
4687
4835
  children: [
4688
- /* @__PURE__ */ jsxs13("g", { clipPath: "url(#clip0_default_avatar)", children: [
4689
- /* @__PURE__ */ jsx14(
4836
+ /* @__PURE__ */ jsxs14("g", { clipPath: "url(#clip0_default_avatar)", children: [
4837
+ /* @__PURE__ */ jsx15(
4690
4838
  "path",
4691
4839
  {
4692
4840
  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",
4693
4841
  fill: "var(--agg-color-secondary-hover)"
4694
4842
  }
4695
4843
  ),
4696
- /* @__PURE__ */ jsx14(
4844
+ /* @__PURE__ */ jsx15(
4697
4845
  "path",
4698
4846
  {
4699
4847
  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",
@@ -4701,7 +4849,7 @@ var DefaultAvatar = ({ className }) => {
4701
4849
  fillOpacity: "0.12"
4702
4850
  }
4703
4851
  ),
4704
- /* @__PURE__ */ jsx14(
4852
+ /* @__PURE__ */ jsx15(
4705
4853
  "path",
4706
4854
  {
4707
4855
  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",
@@ -4710,7 +4858,7 @@ var DefaultAvatar = ({ className }) => {
4710
4858
  }
4711
4859
  )
4712
4860
  ] }),
4713
- /* @__PURE__ */ jsx14("defs", { children: /* @__PURE__ */ jsx14("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx14("rect", { width: "120", height: "120", fill: "white" }) }) })
4861
+ /* @__PURE__ */ jsx15("defs", { children: /* @__PURE__ */ jsx15("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx15("rect", { width: "120", height: "120", fill: "white" }) }) })
4714
4862
  ]
4715
4863
  }
4716
4864
  );
@@ -4718,7 +4866,7 @@ var DefaultAvatar = ({ className }) => {
4718
4866
  DefaultAvatar.displayName = "DefaultAvatar";
4719
4867
 
4720
4868
  // src/pages/user-profile/components/user-info-card.tsx
4721
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4869
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
4722
4870
  var UserInfoCard = ({
4723
4871
  user,
4724
4872
  onEditProfile,
@@ -4728,10 +4876,10 @@ var UserInfoCard = ({
4728
4876
  className
4729
4877
  }) => {
4730
4878
  var _a;
4731
- const labels = useLabels8();
4879
+ const labels = useLabels9();
4732
4880
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
4733
4881
  const hasWallets = wallets.length > 0;
4734
- return /* @__PURE__ */ jsxs14(
4882
+ return /* @__PURE__ */ jsxs15(
4735
4883
  "div",
4736
4884
  {
4737
4885
  className: cn(
@@ -4740,26 +4888,26 @@ var UserInfoCard = ({
4740
4888
  className
4741
4889
  ),
4742
4890
  children: [
4743
- /* @__PURE__ */ jsxs14("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
4744
- /* @__PURE__ */ jsx15("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ jsx15(
4891
+ /* @__PURE__ */ jsxs15("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
4892
+ /* @__PURE__ */ jsx16("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ jsx16(
4745
4893
  RemoteImage,
4746
4894
  {
4747
4895
  src: optimizedImageUrl3(user.avatarUrl, 120),
4748
4896
  alt: user.username,
4749
4897
  className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
4750
4898
  }
4751
- ) : /* @__PURE__ */ jsx15(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
4752
- /* @__PURE__ */ jsxs14("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
4753
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
4754
- /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-center gap-2", children: [
4755
- /* @__PURE__ */ jsx15("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
4756
- user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ jsx15("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
4899
+ ) : /* @__PURE__ */ jsx16(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
4900
+ /* @__PURE__ */ jsxs15("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
4901
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
4902
+ /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-center gap-2", children: [
4903
+ /* @__PURE__ */ jsx16("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
4904
+ user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ jsx16("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
4757
4905
  const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
4758
- const iconNode = /* @__PURE__ */ jsx15("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__ */ jsx15(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
4906
+ const iconNode = /* @__PURE__ */ jsx16("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__ */ jsx16(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
4759
4907
  if (!social.handle) {
4760
- return /* @__PURE__ */ jsx15("span", { children: iconNode }, `${social.platform}-icon`);
4908
+ return /* @__PURE__ */ jsx16("span", { children: iconNode }, `${social.platform}-icon`);
4761
4909
  }
4762
- return /* @__PURE__ */ jsx15(
4910
+ return /* @__PURE__ */ jsx16(
4763
4911
  "a",
4764
4912
  {
4765
4913
  href: social.handle,
@@ -4772,55 +4920,55 @@ var UserInfoCard = ({
4772
4920
  );
4773
4921
  }) }) : null
4774
4922
  ] }),
4775
- onEditProfile ? /* @__PURE__ */ jsxs14(
4923
+ onEditProfile ? /* @__PURE__ */ jsxs15(
4776
4924
  "button",
4777
4925
  {
4778
4926
  type: "button",
4779
4927
  onClick: onEditProfile,
4780
4928
  className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
4781
4929
  children: [
4782
- /* @__PURE__ */ jsx15(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
4783
- /* @__PURE__ */ jsx15("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
4930
+ /* @__PURE__ */ jsx16(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
4931
+ /* @__PURE__ */ jsx16("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
4784
4932
  ]
4785
4933
  }
4786
4934
  ) : null
4787
4935
  ] }),
4788
- hasWallets || !!user.socialHandle ? /* @__PURE__ */ jsxs14("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
4936
+ hasWallets || !!user.socialHandle ? /* @__PURE__ */ jsxs15("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
4789
4937
  wallets.map((wallet, idx) => {
4790
4938
  const chainLower = wallet.chain.toLowerCase();
4791
4939
  const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
4792
- return /* @__PURE__ */ jsxs14(
4940
+ return /* @__PURE__ */ jsxs15(
4793
4941
  "div",
4794
4942
  {
4795
4943
  className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
4796
4944
  children: [
4797
- /* @__PURE__ */ jsx15("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx15(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
4798
- /* @__PURE__ */ jsx15("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 })
4945
+ /* @__PURE__ */ jsx16("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx16(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
4946
+ /* @__PURE__ */ jsx16("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 })
4799
4947
  ]
4800
4948
  },
4801
4949
  `wallet-${idx}`
4802
4950
  );
4803
4951
  }),
4804
- user.socialHandle ? /* @__PURE__ */ jsx15("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ jsx15("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
4952
+ user.socialHandle ? /* @__PURE__ */ jsx16("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ jsx16("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
4805
4953
  ] }) : null
4806
4954
  ] })
4807
4955
  ] }),
4808
- (onDeposit || onWithdraw) && /* @__PURE__ */ jsxs14("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
4809
- onDeposit ? /* @__PURE__ */ jsx15(
4956
+ (onDeposit || onWithdraw) && /* @__PURE__ */ jsxs15("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
4957
+ onDeposit ? /* @__PURE__ */ jsx16(
4810
4958
  ConditionalWrapper,
4811
4959
  {
4812
4960
  condition: isDepositBlocked,
4813
- wrapper: (children) => /* @__PURE__ */ jsx15(
4961
+ wrapper: (children) => /* @__PURE__ */ jsx16(
4814
4962
  Tooltip,
4815
4963
  {
4816
- content: /* @__PURE__ */ jsx15("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
4964
+ content: /* @__PURE__ */ jsx16("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
4817
4965
  size: "small",
4818
4966
  side: "bottom",
4819
4967
  sideOffset: 4,
4820
4968
  children
4821
4969
  }
4822
4970
  ),
4823
- children: /* @__PURE__ */ jsx15(
4971
+ children: /* @__PURE__ */ jsx16(
4824
4972
  Button,
4825
4973
  __spreadProps(__spreadValues({
4826
4974
  variant: "primary",
@@ -4832,7 +4980,7 @@ var UserInfoCard = ({
4832
4980
  )
4833
4981
  }
4834
4982
  ) : null,
4835
- onWithdraw ? /* @__PURE__ */ jsx15(
4983
+ onWithdraw ? /* @__PURE__ */ jsx16(
4836
4984
  Button,
4837
4985
  {
4838
4986
  variant: "secondary",
@@ -4842,15 +4990,15 @@ var UserInfoCard = ({
4842
4990
  children: labels.auth.withdraw
4843
4991
  }
4844
4992
  ) : null,
4845
- onEditProfile ? /* @__PURE__ */ jsxs14(
4993
+ onEditProfile ? /* @__PURE__ */ jsxs15(
4846
4994
  "button",
4847
4995
  {
4848
4996
  type: "button",
4849
4997
  onClick: onEditProfile,
4850
4998
  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",
4851
4999
  children: [
4852
- /* @__PURE__ */ jsx15(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
4853
- /* @__PURE__ */ jsx15("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
5000
+ /* @__PURE__ */ jsx16(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
5001
+ /* @__PURE__ */ jsx16("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
4854
5002
  ]
4855
5003
  }
4856
5004
  ) : null
@@ -4861,29 +5009,8 @@ var UserInfoCard = ({
4861
5009
  };
4862
5010
  UserInfoCard.displayName = "UserInfoCard";
4863
5011
 
4864
- // src/pages/user-profile/transaction-explorer.ts
4865
- var AGG_TX_EXPLORER_URLS = {
4866
- "1": "https://etherscan.io/tx/",
4867
- "56": "https://bscscan.com/tx/",
4868
- "137": "https://polygonscan.com/tx/",
4869
- "1337": "https://app.hyperliquid.xyz/explorer/tx/",
4870
- "8453": "https://basescan.org/tx/",
4871
- "42161": "https://arbiscan.io/tx/",
4872
- "792703809": "https://solscan.io/tx/"
4873
- };
4874
- var buildAggTxExplorerHref = (chainId, txHash) => {
4875
- if (chainId === null || chainId === void 0) return void 0;
4876
- if (!txHash) return void 0;
4877
- const normalizedChainId = String(chainId).trim();
4878
- const normalizedTxHash = txHash.trim();
4879
- if (!normalizedChainId || !normalizedTxHash) return void 0;
4880
- const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
4881
- if (!baseUrl) return void 0;
4882
- return `${baseUrl}${normalizedTxHash}`;
4883
- };
4884
-
4885
5012
  // src/pages/user-profile/index.tsx
4886
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
5013
+ import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
4887
5014
  var currencyFormatter = new Intl.NumberFormat("en-US", {
4888
5015
  style: "currency",
4889
5016
  currency: "USD",
@@ -5214,11 +5341,49 @@ var toRedeemPayoutAmountLabel = (item) => {
5214
5341
  sign: "+"
5215
5342
  });
5216
5343
  };
5344
+ var toRedeemTransactionAmountLabel = ({
5345
+ leg,
5346
+ totalPayoutRaw,
5347
+ legCount
5348
+ }) => {
5349
+ var _a;
5350
+ if (legCount === 1 && totalPayoutRaw != null) {
5351
+ return `+${formatScaledNumberTwoDecimals(totalPayoutRaw)} ${leg.payoutTokenSymbol || "USDC"}`;
5352
+ }
5353
+ return toTokenAmountLabel({
5354
+ amountRaw: (_a = leg.payoutAmountRaw) != null ? _a : "0",
5355
+ tokenSymbol: leg.payoutTokenSymbol || "USDC",
5356
+ chainId: leg.chainId,
5357
+ sign: "+"
5358
+ });
5359
+ };
5360
+ var toRedeemTransactions = (item) => {
5361
+ const legs = Array.isArray(item.legs) ? item.legs : [];
5362
+ return legs.map((leg) => {
5363
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
5364
+ return {
5365
+ id: leg.id,
5366
+ venue: leg.venue,
5367
+ chainId: (_a = leg.chainId) != null ? _a : void 0,
5368
+ txHash: (_b = leg.txHash) != null ? _b : void 0,
5369
+ marketTitle: (_d = (_c = leg.venueMarket) == null ? void 0 : _c.question) != null ? _d : "Market",
5370
+ outcomeLabel: (_h = (_g = (_e = leg.venueMarketOutcome) == null ? void 0 : _e.title) != null ? _g : (_f = leg.venueMarketOutcome) == null ? void 0 : _f.label) != null ? _h : "",
5371
+ amountLabel: toRedeemTransactionAmountLabel({
5372
+ leg,
5373
+ totalPayoutRaw: item.totalPayoutRaw,
5374
+ legCount: legs.length
5375
+ }),
5376
+ transactionLabel: (_j = (_i = shortenAddress(leg.txHash)) != null ? _i : leg.txHash) != null ? _j : "Transaction",
5377
+ errorMessage: (_k = leg.errorMessage) != null ? _k : void 0,
5378
+ hasError: TRANSFER_FAILED_STATUSES.has(leg.status.toLowerCase()) || Boolean((_l = leg.errorMessage) == null ? void 0 : _l.trim())
5379
+ };
5380
+ });
5381
+ };
5217
5382
  var POSITION_ROW_VENUE_ORDER = [
5218
- Venue.polymarket,
5219
- Venue.kalshi,
5220
- Venue.opinion,
5221
- Venue.limitless
5383
+ Venue2.polymarket,
5384
+ Venue2.kalshi,
5385
+ Venue2.opinion,
5386
+ Venue2.limitless
5222
5387
  ];
5223
5388
  function venueBreakdownSortKey(venue) {
5224
5389
  const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
@@ -5297,7 +5462,7 @@ var UserProfilePage = ({
5297
5462
  const { isDepositBlocked } = useGeoBlock();
5298
5463
  const balanceState = useAggBalance();
5299
5464
  const client = useAggClient();
5300
- const labels = useLabels9();
5465
+ const labels = useLabels10();
5301
5466
  const {
5302
5467
  trading: { executionMode: configuredExecutionMode }
5303
5468
  } = useSdkUiConfig5();
@@ -5318,6 +5483,7 @@ var UserProfilePage = ({
5318
5483
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
5319
5484
  }, [balanceState, shouldUseHookData]);
5320
5485
  const [positionFilter, setPositionFilter] = useState11(initialPositionFilter);
5486
+ const [selectedClaimActivity, setSelectedClaimActivity] = useState11(null);
5321
5487
  const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
5322
5488
  const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
5323
5489
  const activePositionsQuery = useExecutionPositions({
@@ -5382,6 +5548,22 @@ var UserProfilePage = ({
5382
5548
  },
5383
5549
  [startClaim]
5384
5550
  );
5551
+ const handleActivityRowClick = useCallback5(
5552
+ (activity) => {
5553
+ if (activity.kind === "redeem") {
5554
+ setSelectedClaimActivity(activity);
5555
+ return;
5556
+ }
5557
+ onActivityClick == null ? void 0 : onActivityClick(activity);
5558
+ },
5559
+ [onActivityClick]
5560
+ );
5561
+ const handleClaimTransactionSelect = useCallback5((transaction) => {
5562
+ const href = buildAggTxExplorerHref(transaction.chainId, transaction.txHash);
5563
+ setSelectedClaimActivity(null);
5564
+ if (!href || typeof window === "undefined") return;
5565
+ window.open(href, "_blank", "noopener,noreferrer");
5566
+ }, []);
5385
5567
  useEffect10(() => {
5386
5568
  if (!shouldUseHookData || !isAuthenticated) {
5387
5569
  setProfileUser(void 0);
@@ -5575,6 +5757,7 @@ var UserProfilePage = ({
5575
5757
  const isFailed = status === "failed";
5576
5758
  const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
5577
5759
  const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
5760
+ const transactions = toRedeemTransactions(redeemItem);
5578
5761
  return {
5579
5762
  kind: "redeem",
5580
5763
  id: redeemItem.id,
@@ -5590,7 +5773,8 @@ var UserProfilePage = ({
5590
5773
  marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
5591
5774
  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 : "",
5592
5775
  amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
5593
- timeLabel
5776
+ timeLabel,
5777
+ transactions
5594
5778
  };
5595
5779
  }
5596
5780
  logUnknownActivityType(item);
@@ -5701,7 +5885,7 @@ var UserProfilePage = ({
5701
5885
  const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
5702
5886
  return source.filter(shouldIncludeByShares);
5703
5887
  }, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
5704
- return /* @__PURE__ */ jsx16(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx16(
5888
+ return /* @__PURE__ */ jsx17(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx17(
5705
5889
  "section",
5706
5890
  {
5707
5891
  className: cn(
@@ -5709,7 +5893,7 @@ var UserProfilePage = ({
5709
5893
  "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
5710
5894
  classNames == null ? void 0 : classNames.root
5711
5895
  ),
5712
- children: /* @__PURE__ */ jsxs15(
5896
+ children: /* @__PURE__ */ jsxs16(
5713
5897
  "div",
5714
5898
  {
5715
5899
  className: cn(
@@ -5719,8 +5903,8 @@ var UserProfilePage = ({
5719
5903
  classNames == null ? void 0 : classNames.topRow
5720
5904
  ),
5721
5905
  children: [
5722
- /* @__PURE__ */ jsxs15("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: [
5723
- /* @__PURE__ */ jsx16(
5906
+ /* @__PURE__ */ jsxs16("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: [
5907
+ /* @__PURE__ */ jsx17(
5724
5908
  "div",
5725
5909
  {
5726
5910
  className: cn(
@@ -5728,7 +5912,7 @@ var UserProfilePage = ({
5728
5912
  "flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
5729
5913
  classNames == null ? void 0 : classNames.leftColumn
5730
5914
  ),
5731
- children: /* @__PURE__ */ jsx16(
5915
+ children: /* @__PURE__ */ jsx17(
5732
5916
  UserInfoCard,
5733
5917
  {
5734
5918
  user: resolvedUser,
@@ -5741,7 +5925,7 @@ var UserProfilePage = ({
5741
5925
  )
5742
5926
  }
5743
5927
  ),
5744
- /* @__PURE__ */ jsxs15(
5928
+ /* @__PURE__ */ jsxs16(
5745
5929
  "div",
5746
5930
  {
5747
5931
  className: cn(
@@ -5749,14 +5933,14 @@ var UserProfilePage = ({
5749
5933
  classNames == null ? void 0 : classNames.rightColumn
5750
5934
  ),
5751
5935
  children: [
5752
- /* @__PURE__ */ jsx16(
5936
+ /* @__PURE__ */ jsx17(
5753
5937
  PositionsValueCard,
5754
5938
  {
5755
5939
  valueLabel: positionsValueLabel,
5756
5940
  isLoading: isPositionsValueLoading
5757
5941
  }
5758
5942
  ),
5759
- /* @__PURE__ */ jsx16(
5943
+ /* @__PURE__ */ jsx17(
5760
5944
  AvailableBalanceCard,
5761
5945
  {
5762
5946
  valueLabel: availableBalanceLabel,
@@ -5774,7 +5958,7 @@ var UserProfilePage = ({
5774
5958
  }
5775
5959
  )
5776
5960
  ] }),
5777
- /* @__PURE__ */ jsx16(
5961
+ /* @__PURE__ */ jsx17(
5778
5962
  PositionsActivity,
5779
5963
  {
5780
5964
  tab,
@@ -5787,8 +5971,11 @@ var UserProfilePage = ({
5787
5971
  getPositionHref,
5788
5972
  onClaim: handleClaimPosition,
5789
5973
  claimingPositionKeys: claimingKeys,
5790
- onActivityClick,
5791
- getActivityHref,
5974
+ onActivityClick: handleActivityRowClick,
5975
+ getActivityHref: (activity) => {
5976
+ if (activity.kind === "redeem") return void 0;
5977
+ return getActivityHref == null ? void 0 : getActivityHref(activity);
5978
+ },
5792
5979
  onOpenOrderClick,
5793
5980
  onCancelOrder: handleCancelOrder,
5794
5981
  cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
@@ -5822,6 +6009,17 @@ var UserProfilePage = ({
5822
6009
  } : void 0,
5823
6010
  className: classNames == null ? void 0 : classNames.positionsActivity
5824
6011
  }
6012
+ ),
6013
+ /* @__PURE__ */ jsx17(
6014
+ ClaimActivityBreakdownModal,
6015
+ {
6016
+ activity: selectedClaimActivity,
6017
+ onOpenChange: (open) => {
6018
+ if (open) return;
6019
+ setSelectedClaimActivity(null);
6020
+ },
6021
+ onTransactionSelect: handleClaimTransactionSelect
6022
+ }
5825
6023
  )
5826
6024
  ]
5827
6025
  }