@agg-build/ui 2.1.5 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-T4YZGAYS.mjs → chunk-4QGZ3FWI.mjs} +1 -1
- package/dist/{chunk-XUBIJI4R.mjs → chunk-JGBEQ4IV.mjs} +1079 -872
- package/dist/{chunk-BW7S2YR3.mjs → chunk-JOZPXDNZ.mjs} +48 -21
- package/dist/{chunk-R2YNZJZ3.mjs → chunk-LPIAEKSZ.mjs} +82 -2
- package/dist/{chunk-TBZWRUFB.mjs → chunk-QM3WWPCV.mjs} +201 -87
- package/dist/{chunk-VP76G6PN.mjs → chunk-UTXQUOU3.mjs} +177 -27
- package/dist/{chunk-XHE2VO3S.mjs → chunk-ZRYHWHTD.mjs} +2 -2
- package/dist/events.js +369 -82
- package/dist/events.mjs +3 -3
- package/dist/index.js +2180 -1621
- package/dist/index.mjs +9 -7
- package/dist/modals.js +2 -2
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1552 -995
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +74 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +131 -20
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item/event-list-item.types.d.mts +6 -2
- package/dist/types/events/item/event-list-item.types.d.ts +6 -2
- package/dist/types/events/item/event-list-item.utils.d.mts +3 -2
- package/dist/types/events/item/event-list-item.utils.d.ts +3 -2
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +0 -6
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +0 -6
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +9 -0
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +9 -0
- package/dist/types/events/market-details/market-details.types.d.mts +1 -0
- package/dist/types/events/market-details/market-details.types.d.ts +1 -0
- package/dist/types/events/shared/chart-venue-selection.d.mts +2 -1
- package/dist/types/events/shared/chart-venue-selection.d.ts +2 -1
- package/dist/types/events/shared/event-trading-state.utils.d.mts +4 -2
- package/dist/types/events/shared/event-trading-state.utils.d.ts +4 -2
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +1 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.mts +8 -0
- package/dist/types/pages/user-profile/components/claim-activity-breakdown-modal.d.ts +8 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -1
- package/dist/types/pages/user-profile/index.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +14 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +14 -0
- package/dist/types/primitives/search/search.types.d.mts +1 -0
- package/dist/types/primitives/search/search.types.d.ts +1 -0
- package/dist/types/primitives/search/search.utils.d.mts +4 -1
- package/dist/types/primitives/search/search.utils.d.ts +4 -1
- package/dist/types/shared/utils.d.mts +16 -0
- package/dist/types/shared/utils.d.ts +16 -0
- package/dist/types/trading/types.d.mts +2 -1
- package/dist/types/trading/types.d.ts +2 -1
- package/package.json +3 -3
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isErrorWithStatus,
|
|
11
11
|
useEventListTabs,
|
|
12
12
|
useEventListTabsHeaderOverflow
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QM3WWPCV.mjs";
|
|
14
14
|
import {
|
|
15
15
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
16
16
|
PlaceOrder,
|
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
WITHDRAW_MODAL_OPEN_EVENT,
|
|
19
19
|
useClaimWinnings,
|
|
20
20
|
useResolvedMarketClaim
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JOZPXDNZ.mjs";
|
|
22
|
+
import {
|
|
23
|
+
getDisplayOutcomePrice
|
|
24
|
+
} from "./chunk-LPIAEKSZ.mjs";
|
|
22
25
|
import {
|
|
23
26
|
AggErrorBoundary,
|
|
24
27
|
Button,
|
|
@@ -45,10 +48,11 @@ import {
|
|
|
45
48
|
__spreadValues,
|
|
46
49
|
cn,
|
|
47
50
|
filterOpenEvents,
|
|
51
|
+
normalizeVenueMarketCluster,
|
|
48
52
|
resolveTabVenus,
|
|
49
53
|
shortenAddress,
|
|
50
54
|
sortCategoriesForNavigation
|
|
51
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-UTXQUOU3.mjs";
|
|
52
56
|
|
|
53
57
|
// src/pages/home/index.tsx
|
|
54
58
|
import {
|
|
@@ -58,7 +62,8 @@ import {
|
|
|
58
62
|
useEventListState,
|
|
59
63
|
useLabels as useLabels4,
|
|
60
64
|
useSdkUiConfig as useSdkUiConfig4,
|
|
61
|
-
useSearch
|
|
65
|
+
useSearch,
|
|
66
|
+
useVenueMarketMidpoints
|
|
62
67
|
} from "@agg-build/hooks";
|
|
63
68
|
import { VENUES } from "@agg-build/sdk";
|
|
64
69
|
import { useCallback as useCallback4, useEffect as useEffect8, useMemo as useMemo5, useRef as useRef7, useState as useState9 } from "react";
|
|
@@ -378,258 +383,6 @@ import {
|
|
|
378
383
|
} from "@agg-build/hooks";
|
|
379
384
|
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
380
385
|
|
|
381
|
-
// src/pages/event-market/sports-market-card.tsx
|
|
382
|
-
import {
|
|
383
|
-
MarketStatus,
|
|
384
|
-
resolveMarketTradingState,
|
|
385
|
-
useEventTradingContext,
|
|
386
|
-
useLabels as useLabels2,
|
|
387
|
-
useSdkUiConfig
|
|
388
|
-
} from "@agg-build/hooks";
|
|
389
|
-
import { useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
390
|
-
|
|
391
|
-
// src/pages/event-market/sports-line-rail.tsx
|
|
392
|
-
import * as React from "react";
|
|
393
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
394
|
-
function VenueRow({ venues, active }) {
|
|
395
|
-
if (!venues || venues.length === 0) return /* @__PURE__ */ jsx2("span", { className: "h-4" });
|
|
396
|
-
const shown = venues.length > 3 ? venues.slice(0, 2) : venues;
|
|
397
|
-
const extra = venues.length - shown.length;
|
|
398
|
-
return /* @__PURE__ */ jsxs2(
|
|
399
|
-
"span",
|
|
400
|
-
{
|
|
401
|
-
className: cn(
|
|
402
|
-
"flex h-4 items-center justify-center gap-1",
|
|
403
|
-
!active && "text-agg-muted-foreground"
|
|
404
|
-
),
|
|
405
|
-
children: [
|
|
406
|
-
shown.map((venue, index) => /* @__PURE__ */ jsx2(
|
|
407
|
-
VenueLogo,
|
|
408
|
-
{
|
|
409
|
-
venue,
|
|
410
|
-
isMonochromatic: !active,
|
|
411
|
-
size: "small",
|
|
412
|
-
className: "size-3! shrink-0"
|
|
413
|
-
},
|
|
414
|
-
`${venue}-${index}`
|
|
415
|
-
)),
|
|
416
|
-
extra > 0 && /* @__PURE__ */ jsxs2("span", { className: "text-[10px] font-agg-bold uppercase leading-[14px] text-agg-muted-foreground", children: [
|
|
417
|
-
"+",
|
|
418
|
-
extra
|
|
419
|
-
] })
|
|
420
|
-
]
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
function SportsLineRail({
|
|
425
|
-
stops,
|
|
426
|
-
selectedIndex,
|
|
427
|
-
onSelect,
|
|
428
|
-
ariaLabel,
|
|
429
|
-
previousAriaLabel,
|
|
430
|
-
nextAriaLabel,
|
|
431
|
-
className
|
|
432
|
-
}) {
|
|
433
|
-
const scrollRef = React.useRef(null);
|
|
434
|
-
const itemRefs = React.useRef([]);
|
|
435
|
-
const didInit = React.useRef(false);
|
|
436
|
-
const programmatic = React.useRef(false);
|
|
437
|
-
const progTimer = React.useRef(void 0);
|
|
438
|
-
const skipCenterOnPropSync = React.useRef(false);
|
|
439
|
-
const pendingScrollIndex = React.useRef(null);
|
|
440
|
-
const scrollSettleTimer = React.useRef(void 0);
|
|
441
|
-
const stopCount = stops.length;
|
|
442
|
-
const [pad, setPad] = React.useState({ left: 0, right: 0 });
|
|
443
|
-
const [mask, setMask] = React.useState({ left: false, right: false });
|
|
444
|
-
const updateMask = React.useCallback(() => {
|
|
445
|
-
const c = scrollRef.current;
|
|
446
|
-
if (!c || !c.clientWidth) return;
|
|
447
|
-
setMask({
|
|
448
|
-
left: c.scrollLeft > 1,
|
|
449
|
-
right: c.scrollLeft + c.clientWidth < c.scrollWidth - 1
|
|
450
|
-
});
|
|
451
|
-
}, []);
|
|
452
|
-
const resolveNearestIndexToViewportCenter = React.useCallback(() => {
|
|
453
|
-
const container = scrollRef.current;
|
|
454
|
-
if (!container || !container.clientWidth) return null;
|
|
455
|
-
const viewportCenter = container.scrollLeft + container.clientWidth / 2;
|
|
456
|
-
let nearestIndex = null;
|
|
457
|
-
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
458
|
-
itemRefs.current.forEach((item, index) => {
|
|
459
|
-
if (!item) return;
|
|
460
|
-
const itemCenter = item.offsetLeft + item.offsetWidth / 2;
|
|
461
|
-
const distance = Math.abs(itemCenter - viewportCenter);
|
|
462
|
-
if (distance < nearestDistance) {
|
|
463
|
-
nearestDistance = distance;
|
|
464
|
-
nearestIndex = index;
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
return nearestIndex;
|
|
468
|
-
}, []);
|
|
469
|
-
React.useLayoutEffect(() => {
|
|
470
|
-
const c = scrollRef.current;
|
|
471
|
-
if (!c) return;
|
|
472
|
-
const measure = () => {
|
|
473
|
-
var _a, _b, _c, _d;
|
|
474
|
-
const w = c.clientWidth;
|
|
475
|
-
if (!w) return;
|
|
476
|
-
const firstW = (_b = (_a = itemRefs.current[0]) == null ? void 0 : _a.offsetWidth) != null ? _b : 0;
|
|
477
|
-
const lastW = (_d = (_c = itemRefs.current[stopCount - 1]) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
|
|
478
|
-
setPad({
|
|
479
|
-
left: Math.max(0, w / 2 - firstW / 2),
|
|
480
|
-
right: Math.max(0, w / 2 - lastW / 2)
|
|
481
|
-
});
|
|
482
|
-
updateMask();
|
|
483
|
-
};
|
|
484
|
-
const onScroll = () => {
|
|
485
|
-
if (!programmatic.current) {
|
|
486
|
-
const nearestIndex = resolveNearestIndexToViewportCenter();
|
|
487
|
-
if (nearestIndex != null && nearestIndex !== selectedIndex) {
|
|
488
|
-
pendingScrollIndex.current = nearestIndex;
|
|
489
|
-
clearTimeout(scrollSettleTimer.current);
|
|
490
|
-
scrollSettleTimer.current = setTimeout(() => {
|
|
491
|
-
const nextIndex = pendingScrollIndex.current;
|
|
492
|
-
if (nextIndex == null || nextIndex === selectedIndex) return;
|
|
493
|
-
skipCenterOnPropSync.current = true;
|
|
494
|
-
onSelect(nextIndex);
|
|
495
|
-
}, 120);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
updateMask();
|
|
499
|
-
};
|
|
500
|
-
measure();
|
|
501
|
-
const ro = new ResizeObserver(measure);
|
|
502
|
-
ro.observe(c);
|
|
503
|
-
c.addEventListener("scroll", onScroll, { passive: true });
|
|
504
|
-
return () => {
|
|
505
|
-
ro.disconnect();
|
|
506
|
-
c.removeEventListener("scroll", onScroll);
|
|
507
|
-
clearTimeout(scrollSettleTimer.current);
|
|
508
|
-
};
|
|
509
|
-
}, [onSelect, resolveNearestIndexToViewportCenter, selectedIndex, stopCount, updateMask]);
|
|
510
|
-
React.useEffect(() => {
|
|
511
|
-
pendingScrollIndex.current = selectedIndex;
|
|
512
|
-
}, [selectedIndex]);
|
|
513
|
-
React.useEffect(() => {
|
|
514
|
-
const c = scrollRef.current;
|
|
515
|
-
const el = itemRefs.current[selectedIndex];
|
|
516
|
-
if (!c || !el || !c.clientWidth) return;
|
|
517
|
-
if (skipCenterOnPropSync.current) {
|
|
518
|
-
skipCenterOnPropSync.current = false;
|
|
519
|
-
updateMask();
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
const max = c.scrollWidth - c.clientWidth;
|
|
523
|
-
const target = el.offsetLeft - c.clientWidth / 2 + el.clientWidth / 2;
|
|
524
|
-
programmatic.current = true;
|
|
525
|
-
c.scrollTo({
|
|
526
|
-
left: Math.max(0, Math.min(max, target)),
|
|
527
|
-
behavior: didInit.current ? "smooth" : "auto"
|
|
528
|
-
});
|
|
529
|
-
if (pad.left > 0 || pad.right > 0) didInit.current = true;
|
|
530
|
-
clearTimeout(progTimer.current);
|
|
531
|
-
progTimer.current = setTimeout(() => {
|
|
532
|
-
programmatic.current = false;
|
|
533
|
-
}, 500);
|
|
534
|
-
updateMask();
|
|
535
|
-
}, [selectedIndex, stopCount, pad, updateMask]);
|
|
536
|
-
const select = (index) => {
|
|
537
|
-
const next = Math.min(stops.length - 1, Math.max(0, index));
|
|
538
|
-
if (next !== selectedIndex) onSelect(next);
|
|
539
|
-
};
|
|
540
|
-
const step = (delta) => select(selectedIndex + delta);
|
|
541
|
-
if (stopCount === 0) return null;
|
|
542
|
-
return /* @__PURE__ */ jsxs2(
|
|
543
|
-
"div",
|
|
544
|
-
{
|
|
545
|
-
className: cn("flex items-center justify-center gap-3 px-3 py-3 sm:gap-4 sm:px-5", className),
|
|
546
|
-
"aria-label": ariaLabel,
|
|
547
|
-
children: [
|
|
548
|
-
/* @__PURE__ */ jsx2(
|
|
549
|
-
"button",
|
|
550
|
-
{
|
|
551
|
-
type: "button",
|
|
552
|
-
onClick: () => step(-1),
|
|
553
|
-
disabled: selectedIndex === 0,
|
|
554
|
-
"aria-label": previousAriaLabel != null ? previousAriaLabel : "Previous line",
|
|
555
|
-
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",
|
|
556
|
-
children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-left", className: "size-4" })
|
|
557
|
-
}
|
|
558
|
-
),
|
|
559
|
-
/* @__PURE__ */ jsxs2("div", { className: "relative min-w-0 flex-1", children: [
|
|
560
|
-
/* @__PURE__ */ jsx2(
|
|
561
|
-
"div",
|
|
562
|
-
{
|
|
563
|
-
ref: scrollRef,
|
|
564
|
-
style: { paddingLeft: pad.left, paddingRight: pad.right },
|
|
565
|
-
className: "flex items-end gap-1 overflow-x-hidden py-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
566
|
-
children: stops.map((stop, index) => {
|
|
567
|
-
const active = index === selectedIndex;
|
|
568
|
-
return /* @__PURE__ */ jsxs2(
|
|
569
|
-
"button",
|
|
570
|
-
{
|
|
571
|
-
type: "button",
|
|
572
|
-
ref: (el) => {
|
|
573
|
-
itemRefs.current[index] = el;
|
|
574
|
-
},
|
|
575
|
-
onClick: () => select(index),
|
|
576
|
-
disabled: stop.disabled,
|
|
577
|
-
"aria-pressed": active,
|
|
578
|
-
className: "flex shrink-0 cursor-pointer flex-col items-center gap-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",
|
|
579
|
-
children: [
|
|
580
|
-
/* @__PURE__ */ jsx2(
|
|
581
|
-
"span",
|
|
582
|
-
{
|
|
583
|
-
className: cn(
|
|
584
|
-
"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",
|
|
585
|
-
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"
|
|
586
|
-
),
|
|
587
|
-
children: stop.value
|
|
588
|
-
}
|
|
589
|
-
),
|
|
590
|
-
/* @__PURE__ */ jsx2(VenueRow, { venues: stop.venues, active })
|
|
591
|
-
]
|
|
592
|
-
},
|
|
593
|
-
index
|
|
594
|
-
);
|
|
595
|
-
})
|
|
596
|
-
}
|
|
597
|
-
),
|
|
598
|
-
/* @__PURE__ */ jsx2(
|
|
599
|
-
"span",
|
|
600
|
-
{
|
|
601
|
-
className: cn(
|
|
602
|
-
"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-agg-secondary to-transparent transition-opacity duration-200",
|
|
603
|
-
mask.left ? "opacity-100" : "opacity-0"
|
|
604
|
-
)
|
|
605
|
-
}
|
|
606
|
-
),
|
|
607
|
-
/* @__PURE__ */ jsx2(
|
|
608
|
-
"span",
|
|
609
|
-
{
|
|
610
|
-
className: cn(
|
|
611
|
-
"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-agg-secondary to-transparent transition-opacity duration-200",
|
|
612
|
-
mask.right ? "opacity-100" : "opacity-0"
|
|
613
|
-
)
|
|
614
|
-
}
|
|
615
|
-
)
|
|
616
|
-
] }),
|
|
617
|
-
/* @__PURE__ */ jsx2(
|
|
618
|
-
"button",
|
|
619
|
-
{
|
|
620
|
-
type: "button",
|
|
621
|
-
onClick: () => step(1),
|
|
622
|
-
disabled: selectedIndex === stopCount - 1,
|
|
623
|
-
"aria-label": nextAriaLabel != null ? nextAriaLabel : "Next line",
|
|
624
|
-
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",
|
|
625
|
-
children: /* @__PURE__ */ jsx2(Icon, { name: "chevron-right", className: "size-4" })
|
|
626
|
-
}
|
|
627
|
-
)
|
|
628
|
-
]
|
|
629
|
-
}
|
|
630
|
-
);
|
|
631
|
-
}
|
|
632
|
-
|
|
633
386
|
// src/pages/event-market/sports-event-market.utils.ts
|
|
634
387
|
var SPORTS_MARKET_TYPE_KEYS = [
|
|
635
388
|
"moneyline",
|
|
@@ -686,6 +439,10 @@ var SPORTS_LEGACY_PROP_CATEGORY_KEY_SET = /* @__PURE__ */ new Set([
|
|
|
686
439
|
"assists",
|
|
687
440
|
"shots"
|
|
688
441
|
]);
|
|
442
|
+
var SPORTS_CATEGORY_OVERRIDE_TAB_KEY_SET = /* @__PURE__ */ new Set([
|
|
443
|
+
"exact_score",
|
|
444
|
+
...SPORTS_LEGACY_PROP_CATEGORY_KEY_SET
|
|
445
|
+
]);
|
|
689
446
|
var SPORTS_MARKET_GROUP_TO_TAB = {
|
|
690
447
|
game_lines: "game_lines",
|
|
691
448
|
spreads: "game_lines",
|
|
@@ -773,9 +530,15 @@ var SPORTS_MARKET_TYPE_ORDER = [
|
|
|
773
530
|
];
|
|
774
531
|
var YES_NO_LABELS = /* @__PURE__ */ new Set(["yes", "no"]);
|
|
775
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;
|
|
776
535
|
var toTrimmedString = (value) => {
|
|
777
536
|
return typeof value === "string" ? value.trim() : "";
|
|
778
537
|
};
|
|
538
|
+
var resolveSportsMarketAggKey = (market) => {
|
|
539
|
+
const typedMarket = market;
|
|
540
|
+
return toTrimmedString(typedMarket.aggKey);
|
|
541
|
+
};
|
|
779
542
|
var sanitizeFamilyValue = (value) => {
|
|
780
543
|
return value.toLowerCase().replace(/[-+]?\d+(?:\.\d+)?/g, "").replace(/[¢$]/g, "").replace(/\s+/g, " ").replace(/[|:()[\]{}]/g, "").trim();
|
|
781
544
|
};
|
|
@@ -835,15 +598,36 @@ var normalizeSportsMarketGroup = (value) => {
|
|
|
835
598
|
if (!resolvedValue) return null;
|
|
836
599
|
return SPORTS_MARKET_GROUP_KEY_SET.has(resolvedValue) ? resolvedValue : "other";
|
|
837
600
|
};
|
|
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
|
+
};
|
|
838
621
|
var resolveMarketSectionTabKey = (market) => {
|
|
839
|
-
const
|
|
840
|
-
|
|
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)) {
|
|
841
626
|
return category;
|
|
842
627
|
}
|
|
843
628
|
const group = normalizeSportsMarketGroup(market.marketGroup);
|
|
844
629
|
if (group) return SPORTS_MARKET_GROUP_TO_TAB[group];
|
|
845
630
|
if (category === "game_lines") return "game_lines";
|
|
846
|
-
if (category === "exact_score") return "exact_score";
|
|
847
631
|
if (category === "other") return "other";
|
|
848
632
|
return null;
|
|
849
633
|
};
|
|
@@ -867,13 +651,27 @@ var resolveSportsSectionMarkets = ({
|
|
|
867
651
|
sectionMarkets
|
|
868
652
|
}) => {
|
|
869
653
|
const effectiveSectionMarkets = sectionMarkets.length > 0 ? sectionMarkets : eventMarkets.filter((market) => resolveMarketSectionTabKey(market) === tabKey);
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
(market) => normalizeSportsMarketType(market.sportsMarketType) === "moneyline" && resolveMarketSectionTabKey(market) === "game_lines"
|
|
654
|
+
const filteredSectionMarkets = effectiveSectionMarkets.filter(
|
|
655
|
+
(market) => resolveMarketSectionTabKey(market) === tabKey
|
|
873
656
|
);
|
|
874
|
-
if (
|
|
875
|
-
const
|
|
876
|
-
|
|
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"
|
|
877
675
|
);
|
|
878
676
|
return [...eventMoneylineMarkets, ...lineSectionMarkets];
|
|
879
677
|
};
|
|
@@ -901,7 +699,15 @@ var isBinarySportsMoneylineMarket = (market) => {
|
|
|
901
699
|
);
|
|
902
700
|
const marketSubtype = toTrimmedString(market.marketSubtype).toLowerCase();
|
|
903
701
|
const marketGroup = normalizeSportsMarketGroup(market.marketGroup);
|
|
904
|
-
|
|
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, "") : "";
|
|
905
711
|
};
|
|
906
712
|
var resolveDisplayGroupFamilyKey = (market) => {
|
|
907
713
|
var _a, _b, _c;
|
|
@@ -915,11 +721,12 @@ var resolveDisplayGroupFamilyKey = (market) => {
|
|
|
915
721
|
if (isBinarySportsMoneylineMarket(market)) {
|
|
916
722
|
return `${period}|moneyline|${marketCategory}`;
|
|
917
723
|
}
|
|
724
|
+
const lineFamily = resolveSportsLineFamilyKey(market);
|
|
918
725
|
if (sportsMarketType === "spread") {
|
|
919
|
-
return `${period}|spread|${marketCategory}`;
|
|
726
|
+
return lineFamily ? `${period}|spread|${lineFamily}` : `${period}|spread|${marketCategory}`;
|
|
920
727
|
}
|
|
921
728
|
if (market.lineValue != null || LINE_MARKET_TYPES.has(sportsMarketType)) {
|
|
922
|
-
return `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
729
|
+
return lineFamily ? `${period}|${sportsMarketType}|${lineFamily}` : `${period}|${sportsMarketType}|${marketCategory}|${normalizedQuestion}|${outcomeKey}`;
|
|
923
730
|
}
|
|
924
731
|
return `${period}|${sportsMarketType}|${marketCategory}|${toTrimmedString(market.question)}|${outcomeKey}|${market.id}`;
|
|
925
732
|
};
|
|
@@ -1126,15 +933,6 @@ var buildSportsSlideFromGroup = (group) => {
|
|
|
1126
933
|
defaultStopIndex
|
|
1127
934
|
};
|
|
1128
935
|
};
|
|
1129
|
-
var formatSportsPeriodGrammarLabel = (period) => {
|
|
1130
|
-
const grammarMatch = SPORTS_PERIOD_GRAMMAR_PATTERN.exec(period);
|
|
1131
|
-
if (!grammarMatch) return null;
|
|
1132
|
-
if (grammarMatch[1]) {
|
|
1133
|
-
const family = grammarMatch[1].charAt(0).toUpperCase() + grammarMatch[1].slice(1);
|
|
1134
|
-
return `${family} ${Number(grammarMatch[2])}`;
|
|
1135
|
-
}
|
|
1136
|
-
return `First ${Number(grammarMatch[3])} Innings`;
|
|
1137
|
-
};
|
|
1138
936
|
var resolveSportsCategoryTokens = (event) => {
|
|
1139
937
|
return new Set(
|
|
1140
938
|
event.categories.flatMap((entry) => {
|
|
@@ -1186,11 +984,263 @@ var mergeSportsSectionMarketsIntoEvent = ({
|
|
|
1186
984
|
seenMarketIds.add(market.id);
|
|
1187
985
|
orderedVenueMarkets.push(market);
|
|
1188
986
|
}
|
|
1189
|
-
}
|
|
1190
|
-
return __spreadProps(__spreadValues({}, event), {
|
|
1191
|
-
venueMarkets: orderedVenueMarkets
|
|
1192
|
-
});
|
|
1193
|
-
};
|
|
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
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1194
1244
|
|
|
1195
1245
|
// src/pages/event-market/sports-market-card.tsx
|
|
1196
1246
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
@@ -1218,6 +1268,19 @@ var SportsMarketCard = ({
|
|
|
1218
1268
|
[group.markets]
|
|
1219
1269
|
);
|
|
1220
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]);
|
|
1221
1284
|
useEffect3(() => {
|
|
1222
1285
|
if (!slide.hasLadder) return;
|
|
1223
1286
|
const tradingMarketId = tradingContext == null ? void 0 : tradingContext.selectedMarketId;
|
|
@@ -1225,7 +1288,7 @@ var SportsMarketCard = ({
|
|
|
1225
1288
|
const matchedIndex = slide.stops.findIndex((stop) => stop.market.id === tradingMarketId);
|
|
1226
1289
|
if (matchedIndex >= 0) setSelectedLineIndex(matchedIndex);
|
|
1227
1290
|
}, [slide.hasLadder, slide.stops, tradingContext == null ? void 0 : tradingContext.selectedMarketId]);
|
|
1228
|
-
const activeMoneylineMarket = isCombinedMoneylineGroup
|
|
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;
|
|
1229
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;
|
|
1230
1293
|
const activeDefaultOutcome = isCombinedMoneylineGroup && activeMarket ? (_f = activeMarket.venueMarketOutcomes.find(
|
|
1231
1294
|
(outcome) => outcome.label.trim().toLowerCase() === "yes"
|
|
@@ -1268,7 +1331,7 @@ var SportsMarketCard = ({
|
|
|
1268
1331
|
const combinedMoneylineHeaderOutcomeItems = useMemo(() => {
|
|
1269
1332
|
if (!isCombinedMoneylineGroup) return void 0;
|
|
1270
1333
|
return combinedMoneylineMarkets.flatMap((market, index) => {
|
|
1271
|
-
var _a2;
|
|
1334
|
+
var _a2, _b2;
|
|
1272
1335
|
const typedMarket = market;
|
|
1273
1336
|
const yesOutcome = market.venueMarketOutcomes.find(
|
|
1274
1337
|
(outcome) => outcome.label.trim().toLowerCase() === "yes"
|
|
@@ -1276,19 +1339,25 @@ var SportsMarketCard = ({
|
|
|
1276
1339
|
if (!yesOutcome) return [];
|
|
1277
1340
|
const label = ((_a2 = typedMarket.shortTitle) == null ? void 0 : _a2.trim()) || market.question.trim();
|
|
1278
1341
|
if (!label) return [];
|
|
1342
|
+
const probability = midpointsResult == null ? void 0 : getDisplayOutcomePrice({
|
|
1343
|
+
outcomeId: yesOutcome.id,
|
|
1344
|
+
outcomeLabel: yesOutcome.label,
|
|
1345
|
+
bestMidpointsByOutcomeId: (_b2 = midpointsResult.bestMidpointsByOutcomeId) != null ? _b2 : midpointsResult.prices
|
|
1346
|
+
});
|
|
1279
1347
|
return [
|
|
1280
1348
|
{
|
|
1281
1349
|
id: yesOutcome.id,
|
|
1282
1350
|
label,
|
|
1283
1351
|
title: label,
|
|
1284
|
-
probability
|
|
1352
|
+
probability,
|
|
1353
|
+
isPriceLoading: (midpointsResult == null ? void 0 : midpointsResult.isLoading) === true && probability == null,
|
|
1285
1354
|
tone: index === 0 ? "positive" : "negative",
|
|
1286
1355
|
variant: "outcome",
|
|
1287
1356
|
venue: market.venue
|
|
1288
1357
|
}
|
|
1289
1358
|
];
|
|
1290
1359
|
});
|
|
1291
|
-
}, [combinedMoneylineMarkets, isCombinedMoneylineGroup]);
|
|
1360
|
+
}, [combinedMoneylineMarkets, isCombinedMoneylineGroup, midpointsResult]);
|
|
1292
1361
|
const headerOutcomeVariant = isCombinedMoneylineGroup ? "outcome" : resolveSportsMarketCardVariant(activeMarket);
|
|
1293
1362
|
const handleLineSelect = (index) => {
|
|
1294
1363
|
var _a2, _b2;
|
|
@@ -1371,39 +1440,6 @@ var resolveSportsSectionLabel = (labels, key) => {
|
|
|
1371
1440
|
return labels.eventMarketPage.sports.otherTab;
|
|
1372
1441
|
}
|
|
1373
1442
|
};
|
|
1374
|
-
var resolveSportsPeriodLabel = (labels, period) => {
|
|
1375
|
-
var _a;
|
|
1376
|
-
switch (period) {
|
|
1377
|
-
case "full":
|
|
1378
|
-
return labels.eventMarketPage.sports.fullPeriod;
|
|
1379
|
-
case "1h":
|
|
1380
|
-
return labels.eventMarketPage.sports.firstHalfPeriod;
|
|
1381
|
-
case "2h":
|
|
1382
|
-
return labels.eventMarketPage.sports.secondHalfPeriod;
|
|
1383
|
-
case "q1":
|
|
1384
|
-
return labels.eventMarketPage.sports.quarterOnePeriod;
|
|
1385
|
-
case "q2":
|
|
1386
|
-
return labels.eventMarketPage.sports.quarterTwoPeriod;
|
|
1387
|
-
case "q3":
|
|
1388
|
-
return labels.eventMarketPage.sports.quarterThreePeriod;
|
|
1389
|
-
case "q4":
|
|
1390
|
-
return labels.eventMarketPage.sports.quarterFourPeriod;
|
|
1391
|
-
case "ot":
|
|
1392
|
-
return labels.eventMarketPage.sports.overtimePeriod;
|
|
1393
|
-
case "first_inning":
|
|
1394
|
-
return "1st Inning";
|
|
1395
|
-
case "second_inning":
|
|
1396
|
-
return "2nd Inning";
|
|
1397
|
-
case "third_inning":
|
|
1398
|
-
return "3rd Inning";
|
|
1399
|
-
case "first_5_innings":
|
|
1400
|
-
return "1st 5 Innings";
|
|
1401
|
-
case "other":
|
|
1402
|
-
return labels.eventMarketPage.sports.otherPeriod;
|
|
1403
|
-
default:
|
|
1404
|
-
return (_a = formatSportsPeriodGrammarLabel(period)) != null ? _a : labels.eventMarketPage.sports.otherPeriod;
|
|
1405
|
-
}
|
|
1406
|
-
};
|
|
1407
1443
|
var SportsTabButton = ({
|
|
1408
1444
|
isActive,
|
|
1409
1445
|
label,
|
|
@@ -1615,7 +1651,7 @@ var SportsMarkets = ({
|
|
|
1615
1651
|
);
|
|
1616
1652
|
}
|
|
1617
1653
|
const shouldShowLoadingState = stableSectionMarkets == null && !isSectionSettled;
|
|
1618
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-
|
|
1654
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-3", "data-testid": "sports-markets", children: [
|
|
1619
1655
|
shouldRenderTabs ? /* @__PURE__ */ jsx4(
|
|
1620
1656
|
"div",
|
|
1621
1657
|
{
|
|
@@ -1644,28 +1680,24 @@ var SportsMarkets = ({
|
|
|
1644
1680
|
}
|
|
1645
1681
|
) : null,
|
|
1646
1682
|
displayedPeriodGroups.map((periodGroup) => {
|
|
1647
|
-
|
|
1648
|
-
return /* @__PURE__ */ jsxs3(
|
|
1683
|
+
return /* @__PURE__ */ jsx4(
|
|
1649
1684
|
"section",
|
|
1650
1685
|
{
|
|
1651
1686
|
className: "flex flex-col gap-3",
|
|
1652
1687
|
"data-period-key": periodGroup.key,
|
|
1653
|
-
children:
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
group.id
|
|
1667
|
-
))
|
|
1668
|
-
]
|
|
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
|
+
))
|
|
1669
1701
|
},
|
|
1670
1702
|
`${activeTabKey}-${periodGroup.key}`
|
|
1671
1703
|
);
|
|
@@ -1912,7 +1944,11 @@ var EventMarketPageContent = ({
|
|
|
1912
1944
|
const [isMobileTradeOpen, setIsMobileTradeOpen] = useState6(false);
|
|
1913
1945
|
const isMobileViewport = useIsMobileEventMarketViewport();
|
|
1914
1946
|
const tradingContext = useEventTradingContext4();
|
|
1915
|
-
const
|
|
1947
|
+
const eventDetailVenueMarkets = useMemo4(
|
|
1948
|
+
() => normalizeVenueMarketCluster(event.venueMarkets),
|
|
1949
|
+
[event.venueMarkets]
|
|
1950
|
+
);
|
|
1951
|
+
const midpointsResult = useMidpoints2(eventDetailVenueMarkets);
|
|
1916
1952
|
const internalResolvedClaim = useResolvedMarketClaim({
|
|
1917
1953
|
market: eventTradingState.primaryMarket,
|
|
1918
1954
|
enabled: eventTradingState.kind === "resolved",
|
|
@@ -2231,6 +2267,17 @@ var MIN_SEARCH_LENGTH = 3;
|
|
|
2231
2267
|
var SEARCH_DEBOUNCE_MS = 300;
|
|
2232
2268
|
var SEARCH_RESULTS_LIMIT = 20;
|
|
2233
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
|
+
};
|
|
2234
2281
|
var HomeSearchResults = ({
|
|
2235
2282
|
activeTabValue,
|
|
2236
2283
|
query,
|
|
@@ -2285,6 +2332,19 @@ var HomeSearchResults = ({
|
|
|
2285
2332
|
}
|
|
2286
2333
|
return filtered;
|
|
2287
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
|
+
});
|
|
2288
2348
|
const loadMoreRef = useRef7(null);
|
|
2289
2349
|
useEffect8(() => {
|
|
2290
2350
|
if (!hasNextPage) return;
|
|
@@ -2375,6 +2435,8 @@ var HomeSearchResults = ({
|
|
|
2375
2435
|
EventListItem,
|
|
2376
2436
|
{
|
|
2377
2437
|
event,
|
|
2438
|
+
midpointRows: sharedMidpointRows,
|
|
2439
|
+
midpointsLoading: isSharedMidpointsLoading,
|
|
2378
2440
|
classNames: {
|
|
2379
2441
|
root: "agg-event-list-item w-full min-w-0! max-w-none justify-between!"
|
|
2380
2442
|
},
|
|
@@ -2728,12 +2790,12 @@ import {
|
|
|
2728
2790
|
useExecutionOrders,
|
|
2729
2791
|
useExecutionPositions,
|
|
2730
2792
|
useGeoBlock,
|
|
2731
|
-
useLabels as
|
|
2793
|
+
useLabels as useLabels10,
|
|
2732
2794
|
useQueryClient,
|
|
2733
2795
|
useSdkUiConfig as useSdkUiConfig5,
|
|
2734
2796
|
useUserActivity
|
|
2735
2797
|
} from "@agg-build/hooks";
|
|
2736
|
-
import { Venue } from "@agg-build/sdk";
|
|
2798
|
+
import { Venue as Venue2 } from "@agg-build/sdk";
|
|
2737
2799
|
import { useCallback as useCallback5, useEffect as useEffect10, useMemo as useMemo7, useState as useState11 } from "react";
|
|
2738
2800
|
|
|
2739
2801
|
// src/pages/user-profile/chain-display.ts
|
|
@@ -2970,8 +3032,136 @@ var AvailableBalanceCard = ({
|
|
|
2970
3032
|
};
|
|
2971
3033
|
AvailableBalanceCard.displayName = "AvailableBalanceCard";
|
|
2972
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
|
+
|
|
2973
3163
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
2974
|
-
import { optimizedImageUrl as optimizedImageUrl2, useLabels as
|
|
3164
|
+
import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels8 } from "@agg-build/hooks";
|
|
2975
3165
|
import { Fragment as Fragment4, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef8, useState as useState10 } from "react";
|
|
2976
3166
|
|
|
2977
3167
|
// src/pages/user-profile/user-profile.constants.ts
|
|
@@ -3168,16 +3358,8 @@ var toPositionRowViewModel = (position, labels = defaultLabels) => {
|
|
|
3168
3358
|
};
|
|
3169
3359
|
};
|
|
3170
3360
|
|
|
3171
|
-
// src/primitives/conditional-wrapper.tsx
|
|
3172
|
-
var ConditionalWrapper = ({
|
|
3173
|
-
condition,
|
|
3174
|
-
wrapper,
|
|
3175
|
-
children
|
|
3176
|
-
}) => condition ? wrapper(children) : children;
|
|
3177
|
-
ConditionalWrapper.displayName = "ConditionalWrapper";
|
|
3178
|
-
|
|
3179
3361
|
// src/pages/user-profile/components/activity-row.tsx
|
|
3180
|
-
import { Fragment as Fragment2, jsx as
|
|
3362
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3181
3363
|
var shouldOpenInNewTab = (activity) => {
|
|
3182
3364
|
return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
|
|
3183
3365
|
};
|
|
@@ -3194,7 +3376,7 @@ var RowWrapper = ({
|
|
|
3194
3376
|
}) => {
|
|
3195
3377
|
if (href) {
|
|
3196
3378
|
const opensInNewTab = target === "_blank";
|
|
3197
|
-
return /* @__PURE__ */
|
|
3379
|
+
return /* @__PURE__ */ jsx10(
|
|
3198
3380
|
"a",
|
|
3199
3381
|
{
|
|
3200
3382
|
href,
|
|
@@ -3210,7 +3392,7 @@ var RowWrapper = ({
|
|
|
3210
3392
|
}
|
|
3211
3393
|
);
|
|
3212
3394
|
}
|
|
3213
|
-
return /* @__PURE__ */
|
|
3395
|
+
return /* @__PURE__ */ jsx10("button", { type: "button", className, onClick, children });
|
|
3214
3396
|
};
|
|
3215
3397
|
var TRANSFER_ICON = {
|
|
3216
3398
|
withdrawal: "upload",
|
|
@@ -3245,7 +3427,7 @@ var AmountTimeStack = ({
|
|
|
3245
3427
|
timeLabel,
|
|
3246
3428
|
tone,
|
|
3247
3429
|
mobile
|
|
3248
|
-
}) => /* @__PURE__ */
|
|
3430
|
+
}) => /* @__PURE__ */ jsxs9(
|
|
3249
3431
|
"div",
|
|
3250
3432
|
{
|
|
3251
3433
|
className: cn(
|
|
@@ -3253,7 +3435,7 @@ var AmountTimeStack = ({
|
|
|
3253
3435
|
mobile ? "sm:hidden" : "hidden sm:flex sm:w-[120px] sm:shrink-0"
|
|
3254
3436
|
),
|
|
3255
3437
|
children: [
|
|
3256
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ jsx10(
|
|
3257
3439
|
"p",
|
|
3258
3440
|
{
|
|
3259
3441
|
className: cn(
|
|
@@ -3264,7 +3446,7 @@ var AmountTimeStack = ({
|
|
|
3264
3446
|
children: amountLabel
|
|
3265
3447
|
}
|
|
3266
3448
|
),
|
|
3267
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsx10(
|
|
3268
3450
|
"p",
|
|
3269
3451
|
{
|
|
3270
3452
|
className: cn(
|
|
@@ -3281,9 +3463,9 @@ var AmountTimeStack = ({
|
|
|
3281
3463
|
var TradeTypeCell = ({
|
|
3282
3464
|
activity,
|
|
3283
3465
|
tone
|
|
3284
|
-
}) => /* @__PURE__ */
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
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(
|
|
3287
3469
|
"p",
|
|
3288
3470
|
{
|
|
3289
3471
|
className: cn(
|
|
@@ -3298,8 +3480,8 @@ var TradeTypeCell = ({
|
|
|
3298
3480
|
var TransferTypeCell = ({
|
|
3299
3481
|
activity,
|
|
3300
3482
|
tone
|
|
3301
|
-
}) => /* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3483
|
+
}) => /* @__PURE__ */ jsxs9("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
|
|
3484
|
+
/* @__PURE__ */ jsx10(
|
|
3303
3485
|
Icon,
|
|
3304
3486
|
{
|
|
3305
3487
|
name: TRANSFER_ICON[activity.kind],
|
|
@@ -3310,7 +3492,7 @@ var TransferTypeCell = ({
|
|
|
3310
3492
|
)
|
|
3311
3493
|
}
|
|
3312
3494
|
),
|
|
3313
|
-
/* @__PURE__ */
|
|
3495
|
+
/* @__PURE__ */ jsx10(
|
|
3314
3496
|
"p",
|
|
3315
3497
|
{
|
|
3316
3498
|
className: cn(
|
|
@@ -3325,8 +3507,8 @@ var TransferTypeCell = ({
|
|
|
3325
3507
|
var RedeemTypeCell = ({
|
|
3326
3508
|
activity,
|
|
3327
3509
|
tone
|
|
3328
|
-
}) => /* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3510
|
+
}) => /* @__PURE__ */ jsxs9("div", { className: "hidden w-[108px] shrink-0 items-center gap-3 sm:flex", children: [
|
|
3511
|
+
/* @__PURE__ */ jsx10(
|
|
3330
3512
|
Icon,
|
|
3331
3513
|
{
|
|
3332
3514
|
name: "gift-bonus",
|
|
@@ -3337,7 +3519,7 @@ var RedeemTypeCell = ({
|
|
|
3337
3519
|
)
|
|
3338
3520
|
}
|
|
3339
3521
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3522
|
+
/* @__PURE__ */ jsx10(
|
|
3341
3523
|
"p",
|
|
3342
3524
|
{
|
|
3343
3525
|
className: cn(
|
|
@@ -3354,7 +3536,7 @@ var OutcomeBadge = ({
|
|
|
3354
3536
|
tone
|
|
3355
3537
|
}) => {
|
|
3356
3538
|
if (!label) return null;
|
|
3357
|
-
return /* @__PURE__ */
|
|
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(
|
|
3358
3540
|
"span",
|
|
3359
3541
|
{
|
|
3360
3542
|
className: cn(
|
|
@@ -3368,9 +3550,9 @@ var OutcomeBadge = ({
|
|
|
3368
3550
|
var TradeOutcomeShares = ({
|
|
3369
3551
|
activity,
|
|
3370
3552
|
tone
|
|
3371
|
-
}) => /* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
/* @__PURE__ */
|
|
3553
|
+
}) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
3554
|
+
/* @__PURE__ */ jsx10(OutcomeBadge, { label: activity.outcomeLabel, tone }),
|
|
3555
|
+
/* @__PURE__ */ jsx10(
|
|
3374
3556
|
"span",
|
|
3375
3557
|
{
|
|
3376
3558
|
className: cn(
|
|
@@ -3390,8 +3572,8 @@ var RedeemRow = ({
|
|
|
3390
3572
|
const tone = resolveToneClasses(activity);
|
|
3391
3573
|
const statusVisual = getStatusVisual(activity);
|
|
3392
3574
|
const activityStatus = resolveActivityStatus(activity);
|
|
3393
|
-
const shouldShowInlineStatus = activityStatus
|
|
3394
|
-
return /* @__PURE__ */
|
|
3575
|
+
const shouldShowInlineStatus = activityStatus === "pending";
|
|
3576
|
+
return /* @__PURE__ */ jsx10(
|
|
3395
3577
|
RowWrapper,
|
|
3396
3578
|
{
|
|
3397
3579
|
className,
|
|
@@ -3399,173 +3581,30 @@ var RedeemRow = ({
|
|
|
3399
3581
|
target: href ? "_blank" : void 0,
|
|
3400
3582
|
rel: href ? "noopener noreferrer" : void 0,
|
|
3401
3583
|
onClick,
|
|
3402
|
-
children: /* @__PURE__ */
|
|
3403
|
-
ConditionalWrapper,
|
|
3404
|
-
{
|
|
3405
|
-
condition: !!activity.errorMessage,
|
|
3406
|
-
wrapper: (children) => /* @__PURE__ */ jsx9(
|
|
3407
|
-
Tooltip,
|
|
3408
|
-
{
|
|
3409
|
-
size: "medium",
|
|
3410
|
-
content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
|
|
3411
|
-
/* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
3412
|
-
/* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
3413
|
-
] }),
|
|
3414
|
-
sideOffset: 4,
|
|
3415
|
-
children
|
|
3416
|
-
}
|
|
3417
|
-
),
|
|
3418
|
-
children: /* @__PURE__ */ jsxs8(
|
|
3419
|
-
"div",
|
|
3420
|
-
{
|
|
3421
|
-
className: cn(
|
|
3422
|
-
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
3423
|
-
"relative z-10"
|
|
3424
|
-
),
|
|
3425
|
-
"data-status": activityStatus,
|
|
3426
|
-
children: [
|
|
3427
|
-
/* @__PURE__ */ jsx9(RedeemTypeCell, { activity, tone }),
|
|
3428
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
|
|
3429
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
3430
|
-
/* @__PURE__ */ jsx9(
|
|
3431
|
-
Icon,
|
|
3432
|
-
{
|
|
3433
|
-
name: "gift-bonus",
|
|
3434
|
-
size: "small",
|
|
3435
|
-
className: cn(
|
|
3436
|
-
"shrink-0 text-agg-foreground",
|
|
3437
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
3438
|
-
)
|
|
3439
|
-
}
|
|
3440
|
-
),
|
|
3441
|
-
/* @__PURE__ */ jsx9(
|
|
3442
|
-
"p",
|
|
3443
|
-
{
|
|
3444
|
-
className: cn(
|
|
3445
|
-
"agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
3446
|
-
tone.primary,
|
|
3447
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
3448
|
-
),
|
|
3449
|
-
children: activity.type
|
|
3450
|
-
}
|
|
3451
|
-
)
|
|
3452
|
-
] }),
|
|
3453
|
-
/* @__PURE__ */ jsx9(OutcomeBadge, { label: activity.outcomeLabel, tone })
|
|
3454
|
-
] }),
|
|
3455
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
3456
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
3457
|
-
/* @__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(
|
|
3458
|
-
RemoteImage,
|
|
3459
|
-
{
|
|
3460
|
-
src: activity.thumbnailSrc,
|
|
3461
|
-
alt: "",
|
|
3462
|
-
className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
|
|
3463
|
-
classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
|
|
3464
|
-
}
|
|
3465
|
-
) }),
|
|
3466
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
|
|
3467
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3468
|
-
/* @__PURE__ */ jsx9(
|
|
3469
|
-
"p",
|
|
3470
|
-
{
|
|
3471
|
-
className: cn(
|
|
3472
|
-
"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",
|
|
3473
|
-
tone.primary
|
|
3474
|
-
),
|
|
3475
|
-
children: activity.title
|
|
3476
|
-
}
|
|
3477
|
-
),
|
|
3478
|
-
shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx9(
|
|
3479
|
-
LoadingIcon,
|
|
3480
|
-
{
|
|
3481
|
-
size: "small",
|
|
3482
|
-
className: cn("shrink-0", statusVisual.iconClassName)
|
|
3483
|
-
}
|
|
3484
|
-
) : /* @__PURE__ */ jsx9(
|
|
3485
|
-
Icon,
|
|
3486
|
-
{
|
|
3487
|
-
name: statusVisual.icon,
|
|
3488
|
-
size: "small",
|
|
3489
|
-
className: cn("shrink-0", statusVisual.iconClassName)
|
|
3490
|
-
}
|
|
3491
|
-
) : null
|
|
3492
|
-
] }),
|
|
3493
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
|
|
3494
|
-
/* @__PURE__ */ jsx9("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx9(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
|
|
3495
|
-
/* @__PURE__ */ jsx9(
|
|
3496
|
-
"p",
|
|
3497
|
-
{
|
|
3498
|
-
className: cn(
|
|
3499
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
3500
|
-
tone.meta
|
|
3501
|
-
),
|
|
3502
|
-
children: activity.marketTitle
|
|
3503
|
-
}
|
|
3504
|
-
)
|
|
3505
|
-
] })
|
|
3506
|
-
] })
|
|
3507
|
-
] }),
|
|
3508
|
-
/* @__PURE__ */ jsx9(
|
|
3509
|
-
AmountTimeStack,
|
|
3510
|
-
{
|
|
3511
|
-
amountLabel: activity.amountLabel,
|
|
3512
|
-
timeLabel: activity.timeLabel,
|
|
3513
|
-
tone,
|
|
3514
|
-
mobile: true
|
|
3515
|
-
}
|
|
3516
|
-
)
|
|
3517
|
-
] }),
|
|
3518
|
-
/* @__PURE__ */ jsx9(
|
|
3519
|
-
AmountTimeStack,
|
|
3520
|
-
{
|
|
3521
|
-
amountLabel: activity.amountLabel,
|
|
3522
|
-
timeLabel: activity.timeLabel,
|
|
3523
|
-
tone
|
|
3524
|
-
}
|
|
3525
|
-
)
|
|
3526
|
-
]
|
|
3527
|
-
}
|
|
3528
|
-
)
|
|
3529
|
-
}
|
|
3530
|
-
)
|
|
3531
|
-
}
|
|
3532
|
-
);
|
|
3533
|
-
};
|
|
3534
|
-
var TradeRow = ({
|
|
3535
|
-
activity,
|
|
3536
|
-
className,
|
|
3537
|
-
href,
|
|
3538
|
-
onClick
|
|
3539
|
-
}) => {
|
|
3540
|
-
const tone = resolveToneClasses(activity);
|
|
3541
|
-
return /* @__PURE__ */ jsx9(RowWrapper, { className: cn(className), href, onClick, children: /* @__PURE__ */ jsx9(
|
|
3542
|
-
ConditionalWrapper,
|
|
3543
|
-
{
|
|
3544
|
-
condition: !!activity.errorMessage,
|
|
3545
|
-
wrapper: (children) => /* @__PURE__ */ jsx9(
|
|
3546
|
-
Tooltip,
|
|
3547
|
-
{
|
|
3548
|
-
size: "medium",
|
|
3549
|
-
content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
|
|
3550
|
-
/* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
3551
|
-
/* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
3552
|
-
] }),
|
|
3553
|
-
sideOffset: 4,
|
|
3554
|
-
children
|
|
3555
|
-
}
|
|
3556
|
-
),
|
|
3557
|
-
children: /* @__PURE__ */ jsxs8(
|
|
3584
|
+
children: /* @__PURE__ */ jsxs9(
|
|
3558
3585
|
"div",
|
|
3559
3586
|
{
|
|
3560
3587
|
className: cn(
|
|
3561
3588
|
"flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
|
|
3562
3589
|
"relative z-10"
|
|
3563
3590
|
),
|
|
3591
|
+
"data-status": activityStatus,
|
|
3564
3592
|
children: [
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
/* @__PURE__ */
|
|
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(
|
|
3569
3608
|
"p",
|
|
3570
3609
|
{
|
|
3571
3610
|
className: cn(
|
|
@@ -3577,35 +3616,62 @@ var TradeRow = ({
|
|
|
3577
3616
|
}
|
|
3578
3617
|
)
|
|
3579
3618
|
] }),
|
|
3580
|
-
/* @__PURE__ */
|
|
3619
|
+
/* @__PURE__ */ jsx10(OutcomeBadge, { label: activity.outcomeLabel, tone })
|
|
3581
3620
|
] }),
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
/* @__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(
|
|
3586
3624
|
RemoteImage,
|
|
3587
3625
|
{
|
|
3588
3626
|
src: activity.thumbnailSrc,
|
|
3589
3627
|
alt: "",
|
|
3590
3628
|
className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
|
|
3591
|
-
classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
|
|
3592
|
-
}
|
|
3593
|
-
) }),
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
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
|
+
] })
|
|
3606
3672
|
] })
|
|
3607
3673
|
] }),
|
|
3608
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsx10(
|
|
3609
3675
|
AmountTimeStack,
|
|
3610
3676
|
{
|
|
3611
3677
|
amountLabel: activity.amountLabel,
|
|
@@ -3615,7 +3681,7 @@ var TradeRow = ({
|
|
|
3615
3681
|
}
|
|
3616
3682
|
)
|
|
3617
3683
|
] }),
|
|
3618
|
-
/* @__PURE__ */
|
|
3684
|
+
/* @__PURE__ */ jsx10(
|
|
3619
3685
|
AmountTimeStack,
|
|
3620
3686
|
{
|
|
3621
3687
|
amountLabel: activity.amountLabel,
|
|
@@ -3627,6 +3693,86 @@ var TradeRow = ({
|
|
|
3627
3693
|
}
|
|
3628
3694
|
)
|
|
3629
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
|
+
}
|
|
3630
3776
|
) });
|
|
3631
3777
|
};
|
|
3632
3778
|
var TransferRow = ({
|
|
@@ -3639,7 +3785,7 @@ var TransferRow = ({
|
|
|
3639
3785
|
const transferStatus = resolveActivityStatus(activity);
|
|
3640
3786
|
const transferIconName = TRANSFER_ICON[activity.kind];
|
|
3641
3787
|
const statusVisual = getStatusVisual(activity);
|
|
3642
|
-
return /* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ jsx10(
|
|
3643
3789
|
RowWrapper,
|
|
3644
3790
|
{
|
|
3645
3791
|
className,
|
|
@@ -3647,116 +3793,98 @@ var TransferRow = ({
|
|
|
3647
3793
|
target: href ? "_blank" : void 0,
|
|
3648
3794
|
rel: href ? "noopener noreferrer" : void 0,
|
|
3649
3795
|
onClick,
|
|
3650
|
-
children: /* @__PURE__ */
|
|
3651
|
-
|
|
3796
|
+
children: /* @__PURE__ */ jsxs9(
|
|
3797
|
+
"div",
|
|
3652
3798
|
{
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
{
|
|
3657
|
-
size: "medium",
|
|
3658
|
-
content: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-4", children: [
|
|
3659
|
-
/* @__PURE__ */ jsx9(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
|
|
3660
|
-
/* @__PURE__ */ jsx9("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
|
|
3661
|
-
] }),
|
|
3662
|
-
sideOffset: 4,
|
|
3663
|
-
children
|
|
3664
|
-
}
|
|
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"
|
|
3665
3802
|
),
|
|
3666
|
-
children:
|
|
3667
|
-
|
|
3668
|
-
{
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
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
|
+
}
|
|
3672
3816
|
),
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
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",
|
|
3678
3849
|
{
|
|
3679
|
-
name: transferIconName,
|
|
3680
|
-
size: "small",
|
|
3681
3850
|
className: cn(
|
|
3682
|
-
"
|
|
3683
|
-
|
|
3684
|
-
)
|
|
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
|
|
3685
3855
|
}
|
|
3686
3856
|
),
|
|
3687
|
-
/* @__PURE__ */
|
|
3857
|
+
/* @__PURE__ */ jsx10(
|
|
3688
3858
|
"p",
|
|
3689
3859
|
{
|
|
3690
3860
|
className: cn(
|
|
3691
|
-
"font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
3692
|
-
tone.
|
|
3693
|
-
activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
|
|
3694
|
-
),
|
|
3695
|
-
children: activity.type
|
|
3696
|
-
}
|
|
3697
|
-
)
|
|
3698
|
-
] }) }),
|
|
3699
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex w-full items-center justify-between sm:contents", children: [
|
|
3700
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
3701
|
-
/* @__PURE__ */ jsx9(
|
|
3702
|
-
"div",
|
|
3703
|
-
{
|
|
3704
|
-
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",
|
|
3705
|
-
"data-status": transferStatus,
|
|
3706
|
-
children: statusVisual.spin ? /* @__PURE__ */ jsx9(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx9(
|
|
3707
|
-
Icon,
|
|
3708
|
-
{
|
|
3709
|
-
name: statusVisual.icon,
|
|
3710
|
-
size: "medium",
|
|
3711
|
-
className: cn(statusVisual.iconClassName)
|
|
3712
|
-
}
|
|
3713
|
-
)
|
|
3714
|
-
}
|
|
3715
|
-
),
|
|
3716
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
|
|
3717
|
-
/* @__PURE__ */ jsx9(
|
|
3718
|
-
"p",
|
|
3719
|
-
{
|
|
3720
|
-
className: cn(
|
|
3721
|
-
"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",
|
|
3722
|
-
tone.primary
|
|
3723
|
-
),
|
|
3724
|
-
children: activity.title
|
|
3725
|
-
}
|
|
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
|
|
3726
3863
|
),
|
|
3727
|
-
|
|
3728
|
-
"p",
|
|
3729
|
-
{
|
|
3730
|
-
className: cn(
|
|
3731
|
-
"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
|
|
3732
|
-
tone.meta
|
|
3733
|
-
),
|
|
3734
|
-
children: activity.subtitleLabel
|
|
3735
|
-
}
|
|
3736
|
-
)
|
|
3737
|
-
] })
|
|
3738
|
-
] }),
|
|
3739
|
-
/* @__PURE__ */ jsx9(
|
|
3740
|
-
AmountTimeStack,
|
|
3741
|
-
{
|
|
3742
|
-
amountLabel: activity.amountLabel,
|
|
3743
|
-
timeLabel: activity.timeLabel,
|
|
3744
|
-
tone,
|
|
3745
|
-
mobile: true
|
|
3864
|
+
children: activity.subtitleLabel
|
|
3746
3865
|
}
|
|
3747
3866
|
)
|
|
3748
|
-
] })
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
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
|
+
]
|
|
3760
3888
|
}
|
|
3761
3889
|
)
|
|
3762
3890
|
}
|
|
@@ -3774,10 +3902,10 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
3774
3902
|
"before:bg-agg-secondary-hover before:rounded-agg-xl"
|
|
3775
3903
|
);
|
|
3776
3904
|
if (activity.kind === "trade") {
|
|
3777
|
-
return /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ jsx10(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
|
|
3778
3906
|
}
|
|
3779
3907
|
if (activity.kind === "redeem") {
|
|
3780
|
-
return /* @__PURE__ */
|
|
3908
|
+
return /* @__PURE__ */ jsx10(
|
|
3781
3909
|
RedeemRow,
|
|
3782
3910
|
{
|
|
3783
3911
|
activity,
|
|
@@ -3787,7 +3915,7 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
3787
3915
|
}
|
|
3788
3916
|
);
|
|
3789
3917
|
}
|
|
3790
|
-
return /* @__PURE__ */
|
|
3918
|
+
return /* @__PURE__ */ jsx10(
|
|
3791
3919
|
TransferRow,
|
|
3792
3920
|
{
|
|
3793
3921
|
activity,
|
|
@@ -3800,19 +3928,19 @@ var ActivityRow = ({ activity, href, onClick }) => {
|
|
|
3800
3928
|
ActivityRow.displayName = "ActivityRow";
|
|
3801
3929
|
|
|
3802
3930
|
// src/pages/user-profile/components/empty-state.tsx
|
|
3803
|
-
import { jsx as
|
|
3931
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3804
3932
|
var EmptyState = ({ title, description, className }) => {
|
|
3805
|
-
return /* @__PURE__ */
|
|
3933
|
+
return /* @__PURE__ */ jsx11(
|
|
3806
3934
|
"div",
|
|
3807
3935
|
{
|
|
3808
3936
|
className: cn("flex flex-col items-center justify-center gap-8 p-10", className),
|
|
3809
3937
|
role: "status",
|
|
3810
3938
|
"aria-live": "polite",
|
|
3811
|
-
children: /* @__PURE__ */
|
|
3812
|
-
/* @__PURE__ */
|
|
3813
|
-
/* @__PURE__ */
|
|
3814
|
-
/* @__PURE__ */
|
|
3815
|
-
description ? /* @__PURE__ */
|
|
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
|
|
3816
3944
|
] })
|
|
3817
3945
|
] })
|
|
3818
3946
|
}
|
|
@@ -3821,8 +3949,8 @@ var EmptyState = ({ title, description, className }) => {
|
|
|
3821
3949
|
EmptyState.displayName = "EmptyState";
|
|
3822
3950
|
|
|
3823
3951
|
// src/pages/user-profile/components/position-row.tsx
|
|
3824
|
-
import { optimizedImageUrl, useLabels as
|
|
3825
|
-
import { Fragment as Fragment3, jsx as
|
|
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";
|
|
3826
3954
|
var floorToTwoDecimals = (value) => {
|
|
3827
3955
|
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
3828
3956
|
return Math.trunc(value * 100) / 100;
|
|
@@ -3835,8 +3963,8 @@ var toneTextClassName = (tone) => {
|
|
|
3835
3963
|
if (tone === "negative") return "text-agg-error";
|
|
3836
3964
|
return "text-agg-muted-foreground";
|
|
3837
3965
|
};
|
|
3838
|
-
var OutcomePill = ({ label }) => /* @__PURE__ */
|
|
3839
|
-
var ResolutionPill = ({ label }) => /* @__PURE__ */
|
|
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 }) });
|
|
3840
3968
|
var VenueShares = ({
|
|
3841
3969
|
model,
|
|
3842
3970
|
totalSharesLabel,
|
|
@@ -3844,26 +3972,26 @@ var VenueShares = ({
|
|
|
3844
3972
|
keyPrefix
|
|
3845
3973
|
}) => {
|
|
3846
3974
|
if (!totalSharesLabel && model.venueShareBreakdown.length === 0) return null;
|
|
3847
|
-
return /* @__PURE__ */
|
|
3848
|
-
model.venueShareBreakdown.length > 0 ? /* @__PURE__ */
|
|
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(
|
|
3849
3977
|
Tooltip,
|
|
3850
3978
|
{
|
|
3851
|
-
content: /* @__PURE__ */
|
|
3979
|
+
content: /* @__PURE__ */ jsx12("span", { children: row.sharesLabel }),
|
|
3852
3980
|
"aria-label": `${row.venue} shares`,
|
|
3853
3981
|
side: "top",
|
|
3854
|
-
children: /* @__PURE__ */
|
|
3982
|
+
children: /* @__PURE__ */ jsx12(
|
|
3855
3983
|
"span",
|
|
3856
3984
|
{
|
|
3857
3985
|
tabIndex: 0,
|
|
3858
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",
|
|
3859
3987
|
"aria-label": `${row.venue} shares`,
|
|
3860
|
-
children: /* @__PURE__ */
|
|
3988
|
+
children: /* @__PURE__ */ jsx12(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" })
|
|
3861
3989
|
}
|
|
3862
3990
|
)
|
|
3863
3991
|
},
|
|
3864
3992
|
`${keyPrefix}-${row.venue}-${String(index)}`
|
|
3865
3993
|
)) }) : null,
|
|
3866
|
-
totalSharesLabel ? /* @__PURE__ */
|
|
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
|
|
3867
3995
|
] });
|
|
3868
3996
|
};
|
|
3869
3997
|
var StatusBadge = ({
|
|
@@ -3872,7 +4000,7 @@ var StatusBadge = ({
|
|
|
3872
4000
|
}) => {
|
|
3873
4001
|
if (status === "lost" || status === "won_claimed") return null;
|
|
3874
4002
|
const isWon = status === "won_unclaimed";
|
|
3875
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ jsxs11(
|
|
3876
4004
|
"span",
|
|
3877
4005
|
{
|
|
3878
4006
|
className: cn(
|
|
@@ -3881,7 +4009,7 @@ var StatusBadge = ({
|
|
|
3881
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"
|
|
3882
4010
|
),
|
|
3883
4011
|
children: [
|
|
3884
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ jsx12(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
|
|
3885
4013
|
isWon ? labels.won : labels.open
|
|
3886
4014
|
]
|
|
3887
4015
|
}
|
|
@@ -3894,7 +4022,7 @@ var ResultBadge = ({
|
|
|
3894
4022
|
if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
|
|
3895
4023
|
const isWon = status === "won_claimed";
|
|
3896
4024
|
const isSold = status === "sold";
|
|
3897
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ jsxs11(
|
|
3898
4026
|
"span",
|
|
3899
4027
|
{
|
|
3900
4028
|
className: cn(
|
|
@@ -3903,7 +4031,7 @@ var ResultBadge = ({
|
|
|
3903
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"
|
|
3904
4032
|
),
|
|
3905
4033
|
children: [
|
|
3906
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsx12(
|
|
3907
4035
|
Icon,
|
|
3908
4036
|
{
|
|
3909
4037
|
name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
|
|
@@ -3919,27 +4047,27 @@ var ResultBadge = ({
|
|
|
3919
4047
|
var TotalTradedCell = ({
|
|
3920
4048
|
model,
|
|
3921
4049
|
className
|
|
3922
|
-
}) => /* @__PURE__ */
|
|
4050
|
+
}) => /* @__PURE__ */ jsxs11(
|
|
3923
4051
|
"div",
|
|
3924
4052
|
{
|
|
3925
4053
|
className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
|
|
3926
4054
|
children: [
|
|
3927
|
-
/* @__PURE__ */
|
|
3928
|
-
/* @__PURE__ */
|
|
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 })
|
|
3929
4057
|
]
|
|
3930
4058
|
}
|
|
3931
4059
|
);
|
|
3932
4060
|
var PositionValueCell = ({
|
|
3933
4061
|
value,
|
|
3934
4062
|
className
|
|
3935
|
-
}) => /* @__PURE__ */
|
|
4063
|
+
}) => /* @__PURE__ */ jsxs11(
|
|
3936
4064
|
"div",
|
|
3937
4065
|
{
|
|
3938
4066
|
className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
|
|
3939
4067
|
children: [
|
|
3940
|
-
/* @__PURE__ */
|
|
3941
|
-
/* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
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(
|
|
3943
4071
|
"p",
|
|
3944
4072
|
{
|
|
3945
4073
|
className: cn(
|
|
@@ -3950,9 +4078,9 @@ var PositionValueCell = ({
|
|
|
3950
4078
|
}
|
|
3951
4079
|
)
|
|
3952
4080
|
] }),
|
|
3953
|
-
/* @__PURE__ */
|
|
3954
|
-
/* @__PURE__ */
|
|
3955
|
-
/* @__PURE__ */
|
|
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(
|
|
3956
4084
|
"p",
|
|
3957
4085
|
{
|
|
3958
4086
|
className: cn(
|
|
@@ -3974,7 +4102,7 @@ var PositionRow = ({
|
|
|
3974
4102
|
onClaim,
|
|
3975
4103
|
isClaiming = false
|
|
3976
4104
|
}) => {
|
|
3977
|
-
const labels =
|
|
4105
|
+
const labels = useLabels7().userProfile.positions;
|
|
3978
4106
|
const model = toPositionRowViewModel(position, {
|
|
3979
4107
|
avgPrefix: labels.avgPrefix,
|
|
3980
4108
|
nowPrefix: labels.nowPrefix,
|
|
@@ -4016,7 +4144,7 @@ var PositionRow = ({
|
|
|
4016
4144
|
handleDivClick();
|
|
4017
4145
|
}
|
|
4018
4146
|
};
|
|
4019
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ jsx12(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ jsxs11(
|
|
4020
4148
|
"div",
|
|
4021
4149
|
{
|
|
4022
4150
|
className: cn(
|
|
@@ -4024,9 +4152,9 @@ var PositionRow = ({
|
|
|
4024
4152
|
isClosed ? "md:gap-8" : "md:gap-6"
|
|
4025
4153
|
),
|
|
4026
4154
|
children: [
|
|
4027
|
-
/* @__PURE__ */
|
|
4028
|
-
/* @__PURE__ */
|
|
4029
|
-
/* @__PURE__ */
|
|
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(
|
|
4030
4158
|
RemoteImage,
|
|
4031
4159
|
{
|
|
4032
4160
|
src: optimizedImageUrl(model.thumbnailSrc, 60),
|
|
@@ -4034,11 +4162,11 @@ var PositionRow = ({
|
|
|
4034
4162
|
className: "h-full w-full rounded-agg-sm object-cover"
|
|
4035
4163
|
}
|
|
4036
4164
|
) }),
|
|
4037
|
-
/* @__PURE__ */
|
|
4038
|
-
/* @__PURE__ */
|
|
4039
|
-
/* @__PURE__ */
|
|
4040
|
-
/* @__PURE__ */
|
|
4041
|
-
/* @__PURE__ */
|
|
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(
|
|
4042
4170
|
VenueShares,
|
|
4043
4171
|
{
|
|
4044
4172
|
model,
|
|
@@ -4050,10 +4178,10 @@ var PositionRow = ({
|
|
|
4050
4178
|
] })
|
|
4051
4179
|
] })
|
|
4052
4180
|
] }),
|
|
4053
|
-
/* @__PURE__ */
|
|
4181
|
+
/* @__PURE__ */ jsx12("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ jsx12(OutcomePill, { label: model.selectedOutcomeLabel }) })
|
|
4054
4182
|
] }),
|
|
4055
|
-
isClosed ? /* @__PURE__ */
|
|
4056
|
-
/* @__PURE__ */
|
|
4183
|
+
isClosed ? /* @__PURE__ */ jsx12("div", { className: "md:hidden", children: /* @__PURE__ */ jsx12(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
|
|
4184
|
+
/* @__PURE__ */ jsx12(
|
|
4057
4185
|
VenueShares,
|
|
4058
4186
|
{
|
|
4059
4187
|
model,
|
|
@@ -4062,14 +4190,14 @@ var PositionRow = ({
|
|
|
4062
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"
|
|
4063
4191
|
}
|
|
4064
4192
|
),
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
/* @__PURE__ */
|
|
4067
|
-
/* @__PURE__ */
|
|
4068
|
-
/* @__PURE__ */
|
|
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 })
|
|
4069
4197
|
] }),
|
|
4070
|
-
isClosed ? /* @__PURE__ */
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
model.canClaim ? /* @__PURE__ */
|
|
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(
|
|
4073
4201
|
"button",
|
|
4074
4202
|
{
|
|
4075
4203
|
type: "button",
|
|
@@ -4078,48 +4206,48 @@ var PositionRow = ({
|
|
|
4078
4206
|
disabled: isClaiming,
|
|
4079
4207
|
"aria-busy": isClaiming || void 0,
|
|
4080
4208
|
children: [
|
|
4081
|
-
isClaiming ? /* @__PURE__ */
|
|
4209
|
+
isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
|
|
4082
4210
|
labels.claim
|
|
4083
4211
|
]
|
|
4084
4212
|
}
|
|
4085
4213
|
) : null
|
|
4086
4214
|
] })
|
|
4087
4215
|
] }),
|
|
4088
|
-
isClosed ? /* @__PURE__ */
|
|
4089
|
-
/* @__PURE__ */
|
|
4090
|
-
/* @__PURE__ */
|
|
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(
|
|
4091
4219
|
TotalTradedCell,
|
|
4092
4220
|
{
|
|
4093
4221
|
model,
|
|
4094
4222
|
className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
|
|
4095
4223
|
}
|
|
4096
4224
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx12(
|
|
4098
4226
|
PositionValueCell,
|
|
4099
4227
|
{
|
|
4100
4228
|
value: model.payout,
|
|
4101
4229
|
className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
|
|
4102
4230
|
}
|
|
4103
4231
|
),
|
|
4104
|
-
/* @__PURE__ */
|
|
4105
|
-
] }) : /* @__PURE__ */
|
|
4106
|
-
/* @__PURE__ */
|
|
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(
|
|
4107
4235
|
TotalTradedCell,
|
|
4108
4236
|
{
|
|
4109
4237
|
model,
|
|
4110
4238
|
className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
|
|
4111
4239
|
}
|
|
4112
4240
|
),
|
|
4113
|
-
/* @__PURE__ */
|
|
4241
|
+
/* @__PURE__ */ jsx12(
|
|
4114
4242
|
PositionValueCell,
|
|
4115
4243
|
{
|
|
4116
4244
|
value: model.currentValue,
|
|
4117
4245
|
className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
|
|
4118
4246
|
}
|
|
4119
4247
|
),
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
/* @__PURE__ */
|
|
4122
|
-
model.canClaim ? /* @__PURE__ */
|
|
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(
|
|
4123
4251
|
"button",
|
|
4124
4252
|
{
|
|
4125
4253
|
type: "button",
|
|
@@ -4128,14 +4256,14 @@ var PositionRow = ({
|
|
|
4128
4256
|
disabled: isClaiming,
|
|
4129
4257
|
"aria-busy": isClaiming || void 0,
|
|
4130
4258
|
children: [
|
|
4131
|
-
isClaiming ? /* @__PURE__ */
|
|
4259
|
+
isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
|
|
4132
4260
|
labels.claim
|
|
4133
4261
|
]
|
|
4134
4262
|
}
|
|
4135
4263
|
) : null
|
|
4136
4264
|
] })
|
|
4137
4265
|
] }),
|
|
4138
|
-
/* @__PURE__ */
|
|
4266
|
+
/* @__PURE__ */ jsx12("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ jsx12(
|
|
4139
4267
|
Icon,
|
|
4140
4268
|
{
|
|
4141
4269
|
name: "chevron-right",
|
|
@@ -4150,16 +4278,16 @@ var PositionRow = ({
|
|
|
4150
4278
|
PositionRow.displayName = "PositionRow";
|
|
4151
4279
|
|
|
4152
4280
|
// src/pages/user-profile/components/positions-activity.tsx
|
|
4153
|
-
import { Fragment as Fragment5, jsx as
|
|
4281
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4154
4282
|
var tabItems = [
|
|
4155
4283
|
{ value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
|
|
4156
4284
|
// Open orders is intentionally hidden from the user-profile tab group.
|
|
4157
4285
|
// Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
|
|
4158
4286
|
{ value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
|
|
4159
4287
|
];
|
|
4160
|
-
var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */
|
|
4161
|
-
/* @__PURE__ */
|
|
4162
|
-
index < acc.length - 1 ? /* @__PURE__ */
|
|
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
|
|
4163
4291
|
] }, index)) });
|
|
4164
4292
|
var PositionsActivity = ({
|
|
4165
4293
|
activePositions = [],
|
|
@@ -4190,7 +4318,7 @@ var PositionsActivity = ({
|
|
|
4190
4318
|
initialPositionFilter = "active",
|
|
4191
4319
|
className
|
|
4192
4320
|
}) => {
|
|
4193
|
-
const positionsLabels =
|
|
4321
|
+
const positionsLabels = useLabels8().userProfile.positions;
|
|
4194
4322
|
const isTabControlled = tab !== void 0;
|
|
4195
4323
|
const [internalActiveTab, setInternalActiveTab] = useState10(
|
|
4196
4324
|
tab != null ? tab : USER_PROFILE_TAB_POSITIONS
|
|
@@ -4320,7 +4448,7 @@ var PositionsActivity = ({
|
|
|
4320
4448
|
isLoadingMoreActivities,
|
|
4321
4449
|
onLoadMoreActivities
|
|
4322
4450
|
]);
|
|
4323
|
-
return /* @__PURE__ */
|
|
4451
|
+
return /* @__PURE__ */ jsxs12(
|
|
4324
4452
|
"div",
|
|
4325
4453
|
{
|
|
4326
4454
|
className: cn(
|
|
@@ -4329,7 +4457,7 @@ var PositionsActivity = ({
|
|
|
4329
4457
|
className
|
|
4330
4458
|
),
|
|
4331
4459
|
children: [
|
|
4332
|
-
/* @__PURE__ */
|
|
4460
|
+
/* @__PURE__ */ jsx13(
|
|
4333
4461
|
Tabs,
|
|
4334
4462
|
{
|
|
4335
4463
|
items: tabItems,
|
|
@@ -4343,7 +4471,7 @@ var PositionsActivity = ({
|
|
|
4343
4471
|
}
|
|
4344
4472
|
}
|
|
4345
4473
|
),
|
|
4346
|
-
/* @__PURE__ */
|
|
4474
|
+
/* @__PURE__ */ jsxs12(
|
|
4347
4475
|
"div",
|
|
4348
4476
|
{
|
|
4349
4477
|
className: cn(
|
|
@@ -4351,12 +4479,12 @@ var PositionsActivity = ({
|
|
|
4351
4479
|
isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
|
|
4352
4480
|
),
|
|
4353
4481
|
children: [
|
|
4354
|
-
isPositionsTab ? /* @__PURE__ */
|
|
4355
|
-
/* @__PURE__ */
|
|
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) => {
|
|
4356
4484
|
const isActive = filter.value === positionFilter;
|
|
4357
|
-
return /* @__PURE__ */
|
|
4358
|
-
idx > 0 ? /* @__PURE__ */
|
|
4359
|
-
/* @__PURE__ */
|
|
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(
|
|
4360
4488
|
"button",
|
|
4361
4489
|
{
|
|
4362
4490
|
type: "button",
|
|
@@ -4371,7 +4499,7 @@ var PositionsActivity = ({
|
|
|
4371
4499
|
)
|
|
4372
4500
|
] }, filter.value);
|
|
4373
4501
|
}) }),
|
|
4374
|
-
/* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsxs12(
|
|
4375
4503
|
"div",
|
|
4376
4504
|
{
|
|
4377
4505
|
className: "agg-position-search relative flex w-full min-w-0 flex-1",
|
|
@@ -4382,9 +4510,9 @@ var PositionsActivity = ({
|
|
|
4382
4510
|
setIsSearchFocused(false);
|
|
4383
4511
|
},
|
|
4384
4512
|
children: [
|
|
4385
|
-
/* @__PURE__ */
|
|
4386
|
-
/* @__PURE__ */
|
|
4387
|
-
/* @__PURE__ */
|
|
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(
|
|
4388
4516
|
"input",
|
|
4389
4517
|
{
|
|
4390
4518
|
value: searchValue,
|
|
@@ -4399,7 +4527,7 @@ var PositionsActivity = ({
|
|
|
4399
4527
|
}
|
|
4400
4528
|
)
|
|
4401
4529
|
] }) }),
|
|
4402
|
-
isSearchFocused && searchValue.trim() ? /* @__PURE__ */
|
|
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(
|
|
4403
4531
|
"ul",
|
|
4404
4532
|
{
|
|
4405
4533
|
className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
|
|
@@ -4412,9 +4540,9 @@ var PositionsActivity = ({
|
|
|
4412
4540
|
setIsSearchFocused(false);
|
|
4413
4541
|
onPositionClick == null ? void 0 : onPositionClick(item.raw);
|
|
4414
4542
|
};
|
|
4415
|
-
const innerContent = /* @__PURE__ */
|
|
4416
|
-
/* @__PURE__ */
|
|
4417
|
-
/* @__PURE__ */
|
|
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(
|
|
4418
4546
|
"img",
|
|
4419
4547
|
{
|
|
4420
4548
|
src: optimizedImageUrl2(item.thumbnailSrc, 48),
|
|
@@ -4422,16 +4550,16 @@ var PositionsActivity = ({
|
|
|
4422
4550
|
className: "size-12 shrink-0 rounded-agg-lg object-cover"
|
|
4423
4551
|
}
|
|
4424
4552
|
),
|
|
4425
|
-
/* @__PURE__ */
|
|
4426
|
-
/* @__PURE__ */
|
|
4427
|
-
/* @__PURE__ */
|
|
4428
|
-
/* @__PURE__ */
|
|
4429
|
-
/* @__PURE__ */
|
|
4430
|
-
/* @__PURE__ */
|
|
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 })
|
|
4431
4559
|
] })
|
|
4432
4560
|
] })
|
|
4433
4561
|
] }),
|
|
4434
|
-
/* @__PURE__ */
|
|
4562
|
+
/* @__PURE__ */ jsx13(
|
|
4435
4563
|
Icon,
|
|
4436
4564
|
{
|
|
4437
4565
|
name: "chevron-right",
|
|
@@ -4440,7 +4568,7 @@ var PositionsActivity = ({
|
|
|
4440
4568
|
}
|
|
4441
4569
|
)
|
|
4442
4570
|
] });
|
|
4443
|
-
return /* @__PURE__ */
|
|
4571
|
+
return /* @__PURE__ */ jsx13(
|
|
4444
4572
|
"li",
|
|
4445
4573
|
{
|
|
4446
4574
|
role: "presentation",
|
|
@@ -4448,7 +4576,7 @@ var PositionsActivity = ({
|
|
|
4448
4576
|
"agg-position-search-result-item",
|
|
4449
4577
|
index > 0 && "border-t border-agg-separator"
|
|
4450
4578
|
),
|
|
4451
|
-
children: itemHref ? /* @__PURE__ */
|
|
4579
|
+
children: itemHref ? /* @__PURE__ */ jsx13(
|
|
4452
4580
|
"a",
|
|
4453
4581
|
{
|
|
4454
4582
|
href: itemHref,
|
|
@@ -4463,7 +4591,7 @@ var PositionsActivity = ({
|
|
|
4463
4591
|
},
|
|
4464
4592
|
children: innerContent
|
|
4465
4593
|
}
|
|
4466
|
-
) : /* @__PURE__ */
|
|
4594
|
+
) : /* @__PURE__ */ jsx13(
|
|
4467
4595
|
"button",
|
|
4468
4596
|
{
|
|
4469
4597
|
type: "button",
|
|
@@ -4477,34 +4605,34 @@ var PositionsActivity = ({
|
|
|
4477
4605
|
);
|
|
4478
4606
|
})
|
|
4479
4607
|
}
|
|
4480
|
-
) : /* @__PURE__ */
|
|
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
|
|
4481
4609
|
]
|
|
4482
4610
|
}
|
|
4483
4611
|
)
|
|
4484
4612
|
] }) : null,
|
|
4485
|
-
/* @__PURE__ */
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
4490
|
-
/* @__PURE__ */
|
|
4491
|
-
/* @__PURE__ */
|
|
4492
|
-
/* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4494
|
-
] }) : /* @__PURE__ */
|
|
4495
|
-
/* @__PURE__ */
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */
|
|
4498
|
-
/* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */
|
|
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 })
|
|
4500
4628
|
] }) : null,
|
|
4501
|
-
isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */
|
|
4502
|
-
/* @__PURE__ */
|
|
4503
|
-
/* @__PURE__ */
|
|
4504
|
-
/* @__PURE__ */
|
|
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" })
|
|
4505
4633
|
] }) : null
|
|
4506
4634
|
] }),
|
|
4507
|
-
/* @__PURE__ */
|
|
4635
|
+
/* @__PURE__ */ jsx13(
|
|
4508
4636
|
"div",
|
|
4509
4637
|
{
|
|
4510
4638
|
ref: rowsScrollRef,
|
|
@@ -4516,8 +4644,8 @@ var PositionsActivity = ({
|
|
|
4516
4644
|
"[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
|
|
4517
4645
|
"[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
|
|
4518
4646
|
),
|
|
4519
|
-
children: isPositionsTab ? /* @__PURE__ */
|
|
4520
|
-
isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */
|
|
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(
|
|
4521
4649
|
EmptyState,
|
|
4522
4650
|
{
|
|
4523
4651
|
title: "Unable to load positions",
|
|
@@ -4525,15 +4653,15 @@ var PositionsActivity = ({
|
|
|
4525
4653
|
}
|
|
4526
4654
|
) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
|
|
4527
4655
|
var _a;
|
|
4528
|
-
return /* @__PURE__ */
|
|
4529
|
-
index > 0 ? /* @__PURE__ */
|
|
4656
|
+
return /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
4657
|
+
index > 0 ? /* @__PURE__ */ jsx13(
|
|
4530
4658
|
"div",
|
|
4531
4659
|
{
|
|
4532
4660
|
className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
|
|
4533
4661
|
"aria-hidden": true
|
|
4534
4662
|
}
|
|
4535
4663
|
) : null,
|
|
4536
|
-
/* @__PURE__ */
|
|
4664
|
+
/* @__PURE__ */ jsx13(
|
|
4537
4665
|
PositionRow,
|
|
4538
4666
|
{
|
|
4539
4667
|
position,
|
|
@@ -4547,15 +4675,15 @@ var PositionsActivity = ({
|
|
|
4547
4675
|
}
|
|
4548
4676
|
)
|
|
4549
4677
|
] }, position.id);
|
|
4550
|
-
}) : /* @__PURE__ */
|
|
4678
|
+
}) : /* @__PURE__ */ jsx13(
|
|
4551
4679
|
EmptyState,
|
|
4552
4680
|
{
|
|
4553
4681
|
title: "No positions yet",
|
|
4554
4682
|
description: "Your open trades will appear here once you place an order."
|
|
4555
4683
|
}
|
|
4556
4684
|
),
|
|
4557
|
-
isLoadingMorePositions ? /* @__PURE__ */
|
|
4558
|
-
hasMorePositions ? /* @__PURE__ */
|
|
4685
|
+
isLoadingMorePositions ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
|
|
4686
|
+
hasMorePositions ? /* @__PURE__ */ jsx13(
|
|
4559
4687
|
"div",
|
|
4560
4688
|
{
|
|
4561
4689
|
ref: positionsLoadMoreRef,
|
|
@@ -4563,22 +4691,22 @@ var PositionsActivity = ({
|
|
|
4563
4691
|
"aria-hidden": true
|
|
4564
4692
|
}
|
|
4565
4693
|
) : null
|
|
4566
|
-
] }) : /* @__PURE__ */
|
|
4567
|
-
isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */
|
|
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(
|
|
4568
4696
|
EmptyState,
|
|
4569
4697
|
{
|
|
4570
4698
|
title: "Unable to load activity",
|
|
4571
4699
|
description: "Please try again in a moment."
|
|
4572
4700
|
}
|
|
4573
|
-
) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */
|
|
4574
|
-
index > 0 ? /* @__PURE__ */
|
|
4701
|
+
) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
4702
|
+
index > 0 ? /* @__PURE__ */ jsx13(
|
|
4575
4703
|
"div",
|
|
4576
4704
|
{
|
|
4577
4705
|
className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
|
|
4578
4706
|
"aria-hidden": true
|
|
4579
4707
|
}
|
|
4580
4708
|
) : null,
|
|
4581
|
-
/* @__PURE__ */
|
|
4709
|
+
/* @__PURE__ */ jsx13(
|
|
4582
4710
|
ActivityRow,
|
|
4583
4711
|
{
|
|
4584
4712
|
activity,
|
|
@@ -4586,15 +4714,15 @@ var PositionsActivity = ({
|
|
|
4586
4714
|
onClick: onActivityClick
|
|
4587
4715
|
}
|
|
4588
4716
|
)
|
|
4589
|
-
] }, activity.id)) : /* @__PURE__ */
|
|
4717
|
+
] }, activity.id)) : /* @__PURE__ */ jsx13(
|
|
4590
4718
|
EmptyState,
|
|
4591
4719
|
{
|
|
4592
4720
|
title: "No activity yet",
|
|
4593
4721
|
description: "Your trading activity will appear here."
|
|
4594
4722
|
}
|
|
4595
4723
|
),
|
|
4596
|
-
isLoadingMoreActivities ? /* @__PURE__ */
|
|
4597
|
-
hasMoreActivities ? /* @__PURE__ */
|
|
4724
|
+
isLoadingMoreActivities ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
|
|
4725
|
+
hasMoreActivities ? /* @__PURE__ */ jsx13(
|
|
4598
4726
|
"div",
|
|
4599
4727
|
{
|
|
4600
4728
|
ref: activitiesLoadMoreRef,
|
|
@@ -4616,14 +4744,14 @@ var PositionsActivity = ({
|
|
|
4616
4744
|
PositionsActivity.displayName = "PositionsActivity";
|
|
4617
4745
|
|
|
4618
4746
|
// src/pages/user-profile/components/positions-value-card.tsx
|
|
4619
|
-
import { jsx as
|
|
4747
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4620
4748
|
var PositionsValueCard = ({
|
|
4621
4749
|
label = "Positions Value",
|
|
4622
4750
|
valueLabel,
|
|
4623
4751
|
isLoading = false,
|
|
4624
4752
|
className
|
|
4625
4753
|
}) => {
|
|
4626
|
-
return /* @__PURE__ */
|
|
4754
|
+
return /* @__PURE__ */ jsxs13(
|
|
4627
4755
|
"div",
|
|
4628
4756
|
{
|
|
4629
4757
|
className: cn(
|
|
@@ -4632,8 +4760,8 @@ var PositionsValueCard = ({
|
|
|
4632
4760
|
className
|
|
4633
4761
|
),
|
|
4634
4762
|
children: [
|
|
4635
|
-
/* @__PURE__ */
|
|
4636
|
-
/* @__PURE__ */
|
|
4763
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
4764
|
+
/* @__PURE__ */ jsx14(
|
|
4637
4765
|
"svg",
|
|
4638
4766
|
{
|
|
4639
4767
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4641,7 +4769,7 @@ var PositionsValueCard = ({
|
|
|
4641
4769
|
height: "16",
|
|
4642
4770
|
viewBox: "0 0 16 16",
|
|
4643
4771
|
fill: "none",
|
|
4644
|
-
children: /* @__PURE__ */
|
|
4772
|
+
children: /* @__PURE__ */ jsx14(
|
|
4645
4773
|
"path",
|
|
4646
4774
|
{
|
|
4647
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",
|
|
@@ -4650,22 +4778,51 @@ var PositionsValueCard = ({
|
|
|
4650
4778
|
)
|
|
4651
4779
|
}
|
|
4652
4780
|
),
|
|
4653
|
-
/* @__PURE__ */
|
|
4781
|
+
/* @__PURE__ */ jsx14("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
|
|
4654
4782
|
] }),
|
|
4655
|
-
/* @__PURE__ */
|
|
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 })
|
|
4656
4784
|
]
|
|
4657
4785
|
}
|
|
4658
4786
|
);
|
|
4659
4787
|
};
|
|
4660
4788
|
PositionsValueCard.displayName = "PositionsValueCard";
|
|
4661
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
|
+
|
|
4662
4811
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
4663
|
-
import { optimizedImageUrl as optimizedImageUrl3, useLabels as
|
|
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";
|
|
4664
4821
|
|
|
4665
4822
|
// src/pages/user-profile/components/default-avatar.tsx
|
|
4666
|
-
import { jsx as
|
|
4823
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4667
4824
|
var DefaultAvatar = ({ className }) => {
|
|
4668
|
-
return /* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ jsxs14(
|
|
4669
4826
|
"svg",
|
|
4670
4827
|
{
|
|
4671
4828
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4676,15 +4833,15 @@ var DefaultAvatar = ({ className }) => {
|
|
|
4676
4833
|
className: cn("shrink-0 text-agg-muted-foreground", className),
|
|
4677
4834
|
"aria-hidden": true,
|
|
4678
4835
|
children: [
|
|
4679
|
-
/* @__PURE__ */
|
|
4680
|
-
/* @__PURE__ */
|
|
4836
|
+
/* @__PURE__ */ jsxs14("g", { clipPath: "url(#clip0_default_avatar)", children: [
|
|
4837
|
+
/* @__PURE__ */ jsx15(
|
|
4681
4838
|
"path",
|
|
4682
4839
|
{
|
|
4683
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",
|
|
4684
4841
|
fill: "var(--agg-color-secondary-hover)"
|
|
4685
4842
|
}
|
|
4686
4843
|
),
|
|
4687
|
-
/* @__PURE__ */
|
|
4844
|
+
/* @__PURE__ */ jsx15(
|
|
4688
4845
|
"path",
|
|
4689
4846
|
{
|
|
4690
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",
|
|
@@ -4692,7 +4849,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
4692
4849
|
fillOpacity: "0.12"
|
|
4693
4850
|
}
|
|
4694
4851
|
),
|
|
4695
|
-
/* @__PURE__ */
|
|
4852
|
+
/* @__PURE__ */ jsx15(
|
|
4696
4853
|
"path",
|
|
4697
4854
|
{
|
|
4698
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",
|
|
@@ -4701,7 +4858,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
4701
4858
|
}
|
|
4702
4859
|
)
|
|
4703
4860
|
] }),
|
|
4704
|
-
/* @__PURE__ */
|
|
4861
|
+
/* @__PURE__ */ jsx15("defs", { children: /* @__PURE__ */ jsx15("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx15("rect", { width: "120", height: "120", fill: "white" }) }) })
|
|
4705
4862
|
]
|
|
4706
4863
|
}
|
|
4707
4864
|
);
|
|
@@ -4709,7 +4866,7 @@ var DefaultAvatar = ({ className }) => {
|
|
|
4709
4866
|
DefaultAvatar.displayName = "DefaultAvatar";
|
|
4710
4867
|
|
|
4711
4868
|
// src/pages/user-profile/components/user-info-card.tsx
|
|
4712
|
-
import { jsx as
|
|
4869
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4713
4870
|
var UserInfoCard = ({
|
|
4714
4871
|
user,
|
|
4715
4872
|
onEditProfile,
|
|
@@ -4719,10 +4876,10 @@ var UserInfoCard = ({
|
|
|
4719
4876
|
className
|
|
4720
4877
|
}) => {
|
|
4721
4878
|
var _a;
|
|
4722
|
-
const labels =
|
|
4879
|
+
const labels = useLabels9();
|
|
4723
4880
|
const wallets = (_a = user.connectedWallets) != null ? _a : [];
|
|
4724
4881
|
const hasWallets = wallets.length > 0;
|
|
4725
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ jsxs15(
|
|
4726
4883
|
"div",
|
|
4727
4884
|
{
|
|
4728
4885
|
className: cn(
|
|
@@ -4731,26 +4888,26 @@ var UserInfoCard = ({
|
|
|
4731
4888
|
className
|
|
4732
4889
|
),
|
|
4733
4890
|
children: [
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
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(
|
|
4736
4893
|
RemoteImage,
|
|
4737
4894
|
{
|
|
4738
4895
|
src: optimizedImageUrl3(user.avatarUrl, 120),
|
|
4739
4896
|
alt: user.username,
|
|
4740
4897
|
className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
|
|
4741
4898
|
}
|
|
4742
|
-
) : /* @__PURE__ */
|
|
4743
|
-
/* @__PURE__ */
|
|
4744
|
-
/* @__PURE__ */
|
|
4745
|
-
/* @__PURE__ */
|
|
4746
|
-
/* @__PURE__ */
|
|
4747
|
-
user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */
|
|
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) => {
|
|
4748
4905
|
const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
|
|
4749
|
-
const iconNode = /* @__PURE__ */
|
|
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" }) });
|
|
4750
4907
|
if (!social.handle) {
|
|
4751
|
-
return /* @__PURE__ */
|
|
4908
|
+
return /* @__PURE__ */ jsx16("span", { children: iconNode }, `${social.platform}-icon`);
|
|
4752
4909
|
}
|
|
4753
|
-
return /* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ jsx16(
|
|
4754
4911
|
"a",
|
|
4755
4912
|
{
|
|
4756
4913
|
href: social.handle,
|
|
@@ -4763,55 +4920,55 @@ var UserInfoCard = ({
|
|
|
4763
4920
|
);
|
|
4764
4921
|
}) }) : null
|
|
4765
4922
|
] }),
|
|
4766
|
-
onEditProfile ? /* @__PURE__ */
|
|
4923
|
+
onEditProfile ? /* @__PURE__ */ jsxs15(
|
|
4767
4924
|
"button",
|
|
4768
4925
|
{
|
|
4769
4926
|
type: "button",
|
|
4770
4927
|
onClick: onEditProfile,
|
|
4771
4928
|
className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
|
|
4772
4929
|
children: [
|
|
4773
|
-
/* @__PURE__ */
|
|
4774
|
-
/* @__PURE__ */
|
|
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" })
|
|
4775
4932
|
]
|
|
4776
4933
|
}
|
|
4777
4934
|
) : null
|
|
4778
4935
|
] }),
|
|
4779
|
-
hasWallets || !!user.socialHandle ? /* @__PURE__ */
|
|
4936
|
+
hasWallets || !!user.socialHandle ? /* @__PURE__ */ jsxs15("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
|
|
4780
4937
|
wallets.map((wallet, idx) => {
|
|
4781
4938
|
const chainLower = wallet.chain.toLowerCase();
|
|
4782
4939
|
const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
|
|
4783
|
-
return /* @__PURE__ */
|
|
4940
|
+
return /* @__PURE__ */ jsxs15(
|
|
4784
4941
|
"div",
|
|
4785
4942
|
{
|
|
4786
4943
|
className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
|
|
4787
4944
|
children: [
|
|
4788
|
-
/* @__PURE__ */
|
|
4789
|
-
/* @__PURE__ */
|
|
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 })
|
|
4790
4947
|
]
|
|
4791
4948
|
},
|
|
4792
4949
|
`wallet-${idx}`
|
|
4793
4950
|
);
|
|
4794
4951
|
}),
|
|
4795
|
-
user.socialHandle ? /* @__PURE__ */
|
|
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
|
|
4796
4953
|
] }) : null
|
|
4797
4954
|
] })
|
|
4798
4955
|
] }),
|
|
4799
|
-
(onDeposit || onWithdraw) && /* @__PURE__ */
|
|
4800
|
-
onDeposit ? /* @__PURE__ */
|
|
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(
|
|
4801
4958
|
ConditionalWrapper,
|
|
4802
4959
|
{
|
|
4803
4960
|
condition: isDepositBlocked,
|
|
4804
|
-
wrapper: (children) => /* @__PURE__ */
|
|
4961
|
+
wrapper: (children) => /* @__PURE__ */ jsx16(
|
|
4805
4962
|
Tooltip,
|
|
4806
4963
|
{
|
|
4807
|
-
content: /* @__PURE__ */
|
|
4964
|
+
content: /* @__PURE__ */ jsx16("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
|
|
4808
4965
|
size: "small",
|
|
4809
4966
|
side: "bottom",
|
|
4810
4967
|
sideOffset: 4,
|
|
4811
4968
|
children
|
|
4812
4969
|
}
|
|
4813
4970
|
),
|
|
4814
|
-
children: /* @__PURE__ */
|
|
4971
|
+
children: /* @__PURE__ */ jsx16(
|
|
4815
4972
|
Button,
|
|
4816
4973
|
__spreadProps(__spreadValues({
|
|
4817
4974
|
variant: "primary",
|
|
@@ -4823,7 +4980,7 @@ var UserInfoCard = ({
|
|
|
4823
4980
|
)
|
|
4824
4981
|
}
|
|
4825
4982
|
) : null,
|
|
4826
|
-
onWithdraw ? /* @__PURE__ */
|
|
4983
|
+
onWithdraw ? /* @__PURE__ */ jsx16(
|
|
4827
4984
|
Button,
|
|
4828
4985
|
{
|
|
4829
4986
|
variant: "secondary",
|
|
@@ -4833,15 +4990,15 @@ var UserInfoCard = ({
|
|
|
4833
4990
|
children: labels.auth.withdraw
|
|
4834
4991
|
}
|
|
4835
4992
|
) : null,
|
|
4836
|
-
onEditProfile ? /* @__PURE__ */
|
|
4993
|
+
onEditProfile ? /* @__PURE__ */ jsxs15(
|
|
4837
4994
|
"button",
|
|
4838
4995
|
{
|
|
4839
4996
|
type: "button",
|
|
4840
4997
|
onClick: onEditProfile,
|
|
4841
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",
|
|
4842
4999
|
children: [
|
|
4843
|
-
/* @__PURE__ */
|
|
4844
|
-
/* @__PURE__ */
|
|
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" })
|
|
4845
5002
|
]
|
|
4846
5003
|
}
|
|
4847
5004
|
) : null
|
|
@@ -4852,29 +5009,8 @@ var UserInfoCard = ({
|
|
|
4852
5009
|
};
|
|
4853
5010
|
UserInfoCard.displayName = "UserInfoCard";
|
|
4854
5011
|
|
|
4855
|
-
// src/pages/user-profile/transaction-explorer.ts
|
|
4856
|
-
var AGG_TX_EXPLORER_URLS = {
|
|
4857
|
-
"1": "https://etherscan.io/tx/",
|
|
4858
|
-
"56": "https://bscscan.com/tx/",
|
|
4859
|
-
"137": "https://polygonscan.com/tx/",
|
|
4860
|
-
"1337": "https://app.hyperliquid.xyz/explorer/tx/",
|
|
4861
|
-
"8453": "https://basescan.org/tx/",
|
|
4862
|
-
"42161": "https://arbiscan.io/tx/",
|
|
4863
|
-
"792703809": "https://solscan.io/tx/"
|
|
4864
|
-
};
|
|
4865
|
-
var buildAggTxExplorerHref = (chainId, txHash) => {
|
|
4866
|
-
if (chainId === null || chainId === void 0) return void 0;
|
|
4867
|
-
if (!txHash) return void 0;
|
|
4868
|
-
const normalizedChainId = String(chainId).trim();
|
|
4869
|
-
const normalizedTxHash = txHash.trim();
|
|
4870
|
-
if (!normalizedChainId || !normalizedTxHash) return void 0;
|
|
4871
|
-
const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
|
|
4872
|
-
if (!baseUrl) return void 0;
|
|
4873
|
-
return `${baseUrl}${normalizedTxHash}`;
|
|
4874
|
-
};
|
|
4875
|
-
|
|
4876
5012
|
// src/pages/user-profile/index.tsx
|
|
4877
|
-
import { jsx as
|
|
5013
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4878
5014
|
var currencyFormatter = new Intl.NumberFormat("en-US", {
|
|
4879
5015
|
style: "currency",
|
|
4880
5016
|
currency: "USD",
|
|
@@ -5205,11 +5341,49 @@ var toRedeemPayoutAmountLabel = (item) => {
|
|
|
5205
5341
|
sign: "+"
|
|
5206
5342
|
});
|
|
5207
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
|
+
};
|
|
5208
5382
|
var POSITION_ROW_VENUE_ORDER = [
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5383
|
+
Venue2.polymarket,
|
|
5384
|
+
Venue2.kalshi,
|
|
5385
|
+
Venue2.opinion,
|
|
5386
|
+
Venue2.limitless
|
|
5213
5387
|
];
|
|
5214
5388
|
function venueBreakdownSortKey(venue) {
|
|
5215
5389
|
const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
|
|
@@ -5288,7 +5462,7 @@ var UserProfilePage = ({
|
|
|
5288
5462
|
const { isDepositBlocked } = useGeoBlock();
|
|
5289
5463
|
const balanceState = useAggBalance();
|
|
5290
5464
|
const client = useAggClient();
|
|
5291
|
-
const labels =
|
|
5465
|
+
const labels = useLabels10();
|
|
5292
5466
|
const {
|
|
5293
5467
|
trading: { executionMode: configuredExecutionMode }
|
|
5294
5468
|
} = useSdkUiConfig5();
|
|
@@ -5309,6 +5483,7 @@ var UserProfilePage = ({
|
|
|
5309
5483
|
return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
|
|
5310
5484
|
}, [balanceState, shouldUseHookData]);
|
|
5311
5485
|
const [positionFilter, setPositionFilter] = useState11(initialPositionFilter);
|
|
5486
|
+
const [selectedClaimActivity, setSelectedClaimActivity] = useState11(null);
|
|
5312
5487
|
const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
|
|
5313
5488
|
const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
|
|
5314
5489
|
const activePositionsQuery = useExecutionPositions({
|
|
@@ -5373,6 +5548,22 @@ var UserProfilePage = ({
|
|
|
5373
5548
|
},
|
|
5374
5549
|
[startClaim]
|
|
5375
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
|
+
}, []);
|
|
5376
5567
|
useEffect10(() => {
|
|
5377
5568
|
if (!shouldUseHookData || !isAuthenticated) {
|
|
5378
5569
|
setProfileUser(void 0);
|
|
@@ -5566,6 +5757,7 @@ var UserProfilePage = ({
|
|
|
5566
5757
|
const isFailed = status === "failed";
|
|
5567
5758
|
const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
|
|
5568
5759
|
const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
|
|
5760
|
+
const transactions = toRedeemTransactions(redeemItem);
|
|
5569
5761
|
return {
|
|
5570
5762
|
kind: "redeem",
|
|
5571
5763
|
id: redeemItem.id,
|
|
@@ -5581,7 +5773,8 @@ var UserProfilePage = ({
|
|
|
5581
5773
|
marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
|
|
5582
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 : "",
|
|
5583
5775
|
amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
|
|
5584
|
-
timeLabel
|
|
5776
|
+
timeLabel,
|
|
5777
|
+
transactions
|
|
5585
5778
|
};
|
|
5586
5779
|
}
|
|
5587
5780
|
logUnknownActivityType(item);
|
|
@@ -5692,7 +5885,7 @@ var UserProfilePage = ({
|
|
|
5692
5885
|
const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
|
|
5693
5886
|
return source.filter(shouldIncludeByShares);
|
|
5694
5887
|
}, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
|
|
5695
|
-
return /* @__PURE__ */
|
|
5888
|
+
return /* @__PURE__ */ jsx17(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx17(
|
|
5696
5889
|
"section",
|
|
5697
5890
|
{
|
|
5698
5891
|
className: cn(
|
|
@@ -5700,7 +5893,7 @@ var UserProfilePage = ({
|
|
|
5700
5893
|
"w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
|
|
5701
5894
|
classNames == null ? void 0 : classNames.root
|
|
5702
5895
|
),
|
|
5703
|
-
children: /* @__PURE__ */
|
|
5896
|
+
children: /* @__PURE__ */ jsxs16(
|
|
5704
5897
|
"div",
|
|
5705
5898
|
{
|
|
5706
5899
|
className: cn(
|
|
@@ -5710,8 +5903,8 @@ var UserProfilePage = ({
|
|
|
5710
5903
|
classNames == null ? void 0 : classNames.topRow
|
|
5711
5904
|
),
|
|
5712
5905
|
children: [
|
|
5713
|
-
/* @__PURE__ */
|
|
5714
|
-
/* @__PURE__ */
|
|
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(
|
|
5715
5908
|
"div",
|
|
5716
5909
|
{
|
|
5717
5910
|
className: cn(
|
|
@@ -5719,7 +5912,7 @@ var UserProfilePage = ({
|
|
|
5719
5912
|
"flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
|
|
5720
5913
|
classNames == null ? void 0 : classNames.leftColumn
|
|
5721
5914
|
),
|
|
5722
|
-
children: /* @__PURE__ */
|
|
5915
|
+
children: /* @__PURE__ */ jsx17(
|
|
5723
5916
|
UserInfoCard,
|
|
5724
5917
|
{
|
|
5725
5918
|
user: resolvedUser,
|
|
@@ -5732,7 +5925,7 @@ var UserProfilePage = ({
|
|
|
5732
5925
|
)
|
|
5733
5926
|
}
|
|
5734
5927
|
),
|
|
5735
|
-
/* @__PURE__ */
|
|
5928
|
+
/* @__PURE__ */ jsxs16(
|
|
5736
5929
|
"div",
|
|
5737
5930
|
{
|
|
5738
5931
|
className: cn(
|
|
@@ -5740,14 +5933,14 @@ var UserProfilePage = ({
|
|
|
5740
5933
|
classNames == null ? void 0 : classNames.rightColumn
|
|
5741
5934
|
),
|
|
5742
5935
|
children: [
|
|
5743
|
-
/* @__PURE__ */
|
|
5936
|
+
/* @__PURE__ */ jsx17(
|
|
5744
5937
|
PositionsValueCard,
|
|
5745
5938
|
{
|
|
5746
5939
|
valueLabel: positionsValueLabel,
|
|
5747
5940
|
isLoading: isPositionsValueLoading
|
|
5748
5941
|
}
|
|
5749
5942
|
),
|
|
5750
|
-
/* @__PURE__ */
|
|
5943
|
+
/* @__PURE__ */ jsx17(
|
|
5751
5944
|
AvailableBalanceCard,
|
|
5752
5945
|
{
|
|
5753
5946
|
valueLabel: availableBalanceLabel,
|
|
@@ -5765,7 +5958,7 @@ var UserProfilePage = ({
|
|
|
5765
5958
|
}
|
|
5766
5959
|
)
|
|
5767
5960
|
] }),
|
|
5768
|
-
/* @__PURE__ */
|
|
5961
|
+
/* @__PURE__ */ jsx17(
|
|
5769
5962
|
PositionsActivity,
|
|
5770
5963
|
{
|
|
5771
5964
|
tab,
|
|
@@ -5778,8 +5971,11 @@ var UserProfilePage = ({
|
|
|
5778
5971
|
getPositionHref,
|
|
5779
5972
|
onClaim: handleClaimPosition,
|
|
5780
5973
|
claimingPositionKeys: claimingKeys,
|
|
5781
|
-
onActivityClick,
|
|
5782
|
-
getActivityHref
|
|
5974
|
+
onActivityClick: handleActivityRowClick,
|
|
5975
|
+
getActivityHref: (activity) => {
|
|
5976
|
+
if (activity.kind === "redeem") return void 0;
|
|
5977
|
+
return getActivityHref == null ? void 0 : getActivityHref(activity);
|
|
5978
|
+
},
|
|
5783
5979
|
onOpenOrderClick,
|
|
5784
5980
|
onCancelOrder: handleCancelOrder,
|
|
5785
5981
|
cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
|
|
@@ -5813,6 +6009,17 @@ var UserProfilePage = ({
|
|
|
5813
6009
|
} : void 0,
|
|
5814
6010
|
className: classNames == null ? void 0 : classNames.positionsActivity
|
|
5815
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
|
+
}
|
|
5816
6023
|
)
|
|
5817
6024
|
]
|
|
5818
6025
|
}
|