@agg-build/ui 2.4.9 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{chunk-CXSIXL7M.mjs → chunk-AELMIG74.mjs} +735 -263
  2. package/dist/chunk-AHQA3B7D.mjs +947 -0
  3. package/dist/{chunk-TEBAR55W.mjs → chunk-EDQ64EKO.mjs} +339 -1084
  4. package/dist/{chunk-GWRFSQQK.mjs → chunk-FAU2VOL6.mjs} +1594 -700
  5. package/dist/{chunk-PTNFXXOV.mjs → chunk-FMYYPNZZ.mjs} +904 -788
  6. package/dist/{chunk-UH3DUTMG.mjs → chunk-JQKJDSTW.mjs} +1 -1
  7. package/dist/{chunk-I4X5UNCT.mjs → chunk-XAG432PJ.mjs} +12 -6
  8. package/dist/events.js +1077 -999
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +16527 -14881
  11. package/dist/index.mjs +56 -18
  12. package/dist/modals.js +1292 -1084
  13. package/dist/modals.mjs +10 -10
  14. package/dist/pages.js +4973 -2627
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +905 -788
  17. package/dist/primitives.mjs +3 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +3383 -1508
  21. package/dist/trading.mjs +6 -4
  22. package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +2 -0
  23. package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +2 -0
  24. package/dist/types/auth/connect-button-view/index.d.mts +1 -1
  25. package/dist/types/auth/connect-button-view/index.d.ts +1 -1
  26. package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +1 -1
  27. package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +1 -1
  28. package/dist/types/pages/event-market/sports-event-market.utils.d.mts +0 -19
  29. package/dist/types/pages/event-market/sports-event-market.utils.d.ts +0 -19
  30. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
  31. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
  32. package/dist/types/pages/user-profile/components/open-order-row.d.mts +10 -1
  33. package/dist/types/pages/user-profile/components/open-order-row.d.ts +10 -1
  34. package/dist/types/pages/user-profile/components/positions-activity.d.mts +4 -1
  35. package/dist/types/pages/user-profile/components/positions-activity.d.ts +4 -1
  36. package/dist/types/pages/user-profile/components/positions-value-card.d.mts +4 -2
  37. package/dist/types/pages/user-profile/components/positions-value-card.d.ts +4 -2
  38. package/dist/types/pages/user-profile/index.d.mts +2 -2
  39. package/dist/types/pages/user-profile/index.d.ts +2 -2
  40. package/dist/types/pages/user-profile/user-profile.types.d.mts +12 -0
  41. package/dist/types/pages/user-profile/user-profile.types.d.ts +12 -0
  42. package/dist/types/primitives/calendar/index.d.mts +8 -0
  43. package/dist/types/primitives/calendar/index.d.ts +8 -0
  44. package/dist/types/primitives/icon/registry.d.mts +3 -0
  45. package/dist/types/primitives/icon/registry.d.ts +3 -0
  46. package/dist/types/primitives/icon/svg/calendar.d.mts +2 -0
  47. package/dist/types/primitives/icon/svg/calendar.d.ts +2 -0
  48. package/dist/types/primitives/icon/svg/minus.d.mts +2 -0
  49. package/dist/types/primitives/icon/svg/minus.d.ts +2 -0
  50. package/dist/types/primitives/icon/svg/plus.d.mts +2 -0
  51. package/dist/types/primitives/icon/svg/plus.d.ts +2 -0
  52. package/dist/types/primitives/index.d.mts +1 -0
  53. package/dist/types/primitives/index.d.ts +1 -0
  54. package/dist/types/profile/index.d.mts +1 -1
  55. package/dist/types/profile/index.d.ts +1 -1
  56. package/dist/types/profile/profile-modal.types.d.mts +6 -0
  57. package/dist/types/profile/profile-modal.types.d.ts +6 -0
  58. package/dist/types/profile/tabs/trading-access-tab.d.mts +3 -1
  59. package/dist/types/profile/tabs/trading-access-tab.d.ts +3 -1
  60. package/dist/types/trading/fund-kalshi-modal.d.mts +8 -0
  61. package/dist/types/trading/fund-kalshi-modal.d.ts +8 -0
  62. package/dist/types/trading/index.d.mts +1 -0
  63. package/dist/types/trading/index.d.ts +1 -0
  64. package/dist/types/trading/place-order/index.d.mts +1 -1
  65. package/dist/types/trading/place-order/index.d.ts +1 -1
  66. package/dist/types/trading/place-order/index.place-order.types.d.mts +13 -1
  67. package/dist/types/trading/place-order/index.place-order.types.d.ts +13 -1
  68. package/dist/types/trading/place-order/index.place-order.utils.d.mts +18 -1
  69. package/dist/types/trading/place-order/index.place-order.utils.d.ts +18 -1
  70. package/package.json +7 -4
  71. package/dist/chunk-JVRTJQPZ.mjs +0 -59
@@ -10,7 +10,7 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-I4X5UNCT.mjs";
13
+ } from "./chunk-XAG432PJ.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
@@ -18,10 +18,10 @@ import {
18
18
  WITHDRAW_MODAL_OPEN_EVENT,
19
19
  useClaimWinnings,
20
20
  useResolvedMarketClaim
21
- } from "./chunk-GWRFSQQK.mjs";
21
+ } from "./chunk-FAU2VOL6.mjs";
22
22
  import {
23
23
  getDisplayOutcomePrice
24
- } from "./chunk-UH3DUTMG.mjs";
24
+ } from "./chunk-JQKJDSTW.mjs";
25
25
  import {
26
26
  AggErrorBoundary,
27
27
  Button,
@@ -52,8 +52,9 @@ import {
52
52
  resolveTabVenus,
53
53
  shortenAddress,
54
54
  skeletonViews,
55
- sortCategoriesForNavigation
56
- } from "./chunk-PTNFXXOV.mjs";
55
+ sortCategoriesForNavigation,
56
+ useOptionalToast
57
+ } from "./chunk-FMYYPNZZ.mjs";
57
58
 
58
59
  // src/pages/home/index.tsx
59
60
  import {
@@ -663,6 +664,22 @@ var resolveSportsSectionFilters = (key) => {
663
664
  period: resolvedDefinition.period ? [...resolvedDefinition.period] : void 0
664
665
  };
665
666
  };
667
+ var hasTeamTitledOutcomes = (market) => {
668
+ var _a;
669
+ const titles = ((_a = market.venueMarketOutcomes) != null ? _a : []).map(
670
+ (outcome) => toTrimmedString(outcome.title)
671
+ );
672
+ return titles.length > 1 && titles.every((title) => title && !YES_NO_LABELS.has(title.toLowerCase())) && new Set(titles).size === titles.length;
673
+ };
674
+ var isClusterRelation = (left, right) => {
675
+ var _a, _b;
676
+ return ((_a = left.matchedVenueMarkets) != null ? _a : []).some((market) => market.id === right.id) || ((_b = right.matchedVenueMarkets) != null ? _b : []).some((market) => market.id === left.id);
677
+ };
678
+ var dropDecomposedLegsMergedIntoSingle = (markets) => markets.filter(
679
+ (market) => hasTeamTitledOutcomes(market) || !markets.some(
680
+ (other) => other !== market && hasTeamTitledOutcomes(other) && isClusterRelation(market, other)
681
+ )
682
+ );
666
683
  var resolveSportsSectionMarkets = ({
667
684
  tabKey,
668
685
  eventMarkets,
@@ -692,7 +709,7 @@ var resolveSportsSectionMarkets = ({
692
709
  seenKeys.add(key);
693
710
  dedupedMarkets.push(market);
694
711
  }
695
- return dedupedMarkets;
712
+ return dropDecomposedLegsMergedIntoSingle(dedupedMarkets);
696
713
  };
697
714
  const eventMoneylineMarkets = dedupeEventMarketsOfType("moneyline");
698
715
  const eventToAdvanceMarkets = dedupeEventMarketsOfType("to_advance");
@@ -1386,6 +1403,15 @@ function SportsLineRail({
1386
1403
 
1387
1404
  // src/pages/event-market/sports-market-card.tsx
1388
1405
  import { jsx as jsx3 } from "react/jsx-runtime";
1406
+ var resolveSportsLineOutcomeSide = (outcome) => {
1407
+ var _a;
1408
+ for (const candidate of [outcome.label, outcome.title]) {
1409
+ if (typeof candidate !== "string") continue;
1410
+ const matchedSide = (_a = candidate.trim().toLowerCase().match(/(?:^|\s)(over|under)(?=\s|$)/)) == null ? void 0 : _a[1];
1411
+ if (matchedSide === "over" || matchedSide === "under") return matchedSide;
1412
+ }
1413
+ return null;
1414
+ };
1389
1415
  var SportsMarketCard = ({
1390
1416
  group,
1391
1417
  venueMarkets,
@@ -1548,16 +1574,22 @@ var SportsMarketCard = ({
1548
1574
  setSelectedLineIndex(index);
1549
1575
  const market = (_a2 = slide.stops[index]) == null ? void 0 : _a2.market;
1550
1576
  if (!market) return;
1551
- const isGroupBeingTraded = group.markets.some(
1552
- (groupMarket) => groupMarket.id === (tradingContext == null ? void 0 : tradingContext.selectedMarketId)
1553
- );
1554
- if (!isGroupBeingTraded) return;
1555
1577
  const previousOutcomeIndex = previousMarket ? previousMarket.venueMarketOutcomes.findIndex(
1556
1578
  (outcome) => outcome.id === (tradingContext == null ? void 0 : tradingContext.selectedOutcomeId)
1557
1579
  ) : -1;
1558
- const nextOutcome = (_b2 = previousOutcomeIndex >= 0 ? market.venueMarketOutcomes[previousOutcomeIndex] : void 0) != null ? _b2 : market.venueMarketOutcomes[0];
1580
+ const previousOutcome = previousOutcomeIndex >= 0 ? previousMarket == null ? void 0 : previousMarket.venueMarketOutcomes[previousOutcomeIndex] : void 0;
1581
+ const previousOutcomeSide = previousOutcome ? resolveSportsLineOutcomeSide(previousOutcome) : null;
1582
+ const matchingSideOutcomes = previousOutcomeSide ? market.venueMarketOutcomes.filter(
1583
+ (outcome) => resolveSportsLineOutcomeSide(outcome) === previousOutcomeSide
1584
+ ) : [];
1585
+ const matchingSideOutcome = matchingSideOutcomes.length === 1 ? matchingSideOutcomes[0] : void 0;
1586
+ const nextOutcome = (_b2 = matchingSideOutcome != null ? matchingSideOutcome : previousOutcomeIndex >= 0 ? market.venueMarketOutcomes[previousOutcomeIndex] : void 0) != null ? _b2 : market.venueMarketOutcomes[0];
1559
1587
  if (nextOutcome) {
1560
1588
  tradingContext == null ? void 0 : tradingContext.selectMarketAndOutcome(market.id, nextOutcome.id);
1589
+ onOutcomeSelect == null ? void 0 : onOutcomeSelect(group.id, {
1590
+ marketId: market.id,
1591
+ outcomeId: nextOutcome.id
1592
+ });
1561
1593
  } else {
1562
1594
  tradingContext == null ? void 0 : tradingContext.selectMarket(market.id, market);
1563
1595
  }
@@ -2969,19 +3001,22 @@ HomePage.displayName = "HomePage";
2969
3001
  // src/pages/user-profile/index.tsx
2970
3002
  import {
2971
3003
  computeClosedPositionTotals,
3004
+ getVenueAvailabilityState,
2972
3005
  getWalletAddressFromUserProfile,
3006
+ useAppConfig as useAppConfig2,
2973
3007
  useAggAuthState,
2974
3008
  useAggBalance,
2975
3009
  useAggClient,
3010
+ useCancelManagedOrder,
2976
3011
  useExecutionOrders,
2977
3012
  useExecutionPositions,
2978
3013
  useGeoBlock,
2979
- useLabels as useLabels10,
2980
- useQueryClient,
3014
+ useLabels as useLabels11,
2981
3015
  useSdkUiConfig as useSdkUiConfig5,
2982
3016
  useUserActivity
2983
3017
  } from "@agg-build/hooks";
2984
3018
  import { Venue as Venue2 } from "@agg-build/sdk";
3019
+ import dayjs from "dayjs";
2985
3020
  import { useCallback as useCallback5, useEffect as useEffect10, useMemo as useMemo7, useState as useState11 } from "react";
2986
3021
 
2987
3022
  // src/pages/user-profile/chain-display.ts
@@ -3056,6 +3091,7 @@ var chainIconUrl = (label, key) => {
3056
3091
  var AvailableBalanceCard = ({
3057
3092
  label,
3058
3093
  valueLabel,
3094
+ reservedValueLabel,
3059
3095
  chains,
3060
3096
  isLoading = false,
3061
3097
  className
@@ -3211,7 +3247,8 @@ var AvailableBalanceCard = ({
3211
3247
  )
3212
3248
  }
3213
3249
  )
3214
- ] })
3250
+ ] }),
3251
+ !isLoading && reservedValueLabel ? /* @__PURE__ */ jsx8("p", { className: "font-agg-sans text-agg-xs leading-agg-4 text-agg-muted-foreground", children: balanceLabels.reservedForOpenOrders(reservedValueLabel) }) : null
3215
3252
  ]
3216
3253
  }
3217
3254
  );
@@ -3347,7 +3384,7 @@ var ClaimActivityBreakdownModal = ({
3347
3384
  };
3348
3385
 
3349
3386
  // src/pages/user-profile/components/positions-activity.tsx
3350
- import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels8 } from "@agg-build/hooks";
3387
+ import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels9 } from "@agg-build/hooks";
3351
3388
  import { Fragment as Fragment4, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef8, useState as useState10 } from "react";
3352
3389
 
3353
3390
  // src/pages/user-profile/user-profile.constants.ts
@@ -4134,32 +4171,161 @@ var EmptyState = ({ title, description, className }) => {
4134
4171
  };
4135
4172
  EmptyState.displayName = "EmptyState";
4136
4173
 
4137
- // src/pages/user-profile/components/position-row.tsx
4174
+ // src/pages/user-profile/components/open-order-row.tsx
4138
4175
  import { optimizedImageUrl, useLabels as useLabels7 } from "@agg-build/hooks";
4139
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4176
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4140
4177
  var shouldUseNativeLinkNavigation2 = (event) => {
4141
4178
  return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
4142
4179
  };
4180
+ var OpenOrderRow = ({
4181
+ order,
4182
+ href,
4183
+ onClick,
4184
+ onCancel,
4185
+ isCancelling = false,
4186
+ cancelLabel,
4187
+ cancelAriaLabel,
4188
+ limitPriceHeader,
4189
+ filledHeader,
4190
+ totalHeader,
4191
+ expirationHeader
4192
+ }) => {
4193
+ var _a, _b, _c, _d;
4194
+ const labels = useLabels7().userProfile.openOrders;
4195
+ const resolvedCancelLabel = cancelLabel != null ? cancelLabel : labels.cancel;
4196
+ const resolvedCancelAriaLabel = cancelAriaLabel != null ? cancelAriaLabel : labels.cancelOrderAria(order.id);
4197
+ const resolvedLimitPriceHeader = limitPriceHeader != null ? limitPriceHeader : labels.limitPriceHeader;
4198
+ const resolvedFilledHeader = filledHeader != null ? filledHeader : labels.filledHeader;
4199
+ const resolvedTotalHeader = totalHeader != null ? totalHeader : labels.totalHeader;
4200
+ const resolvedExpirationHeader = expirationHeader != null ? expirationHeader : labels.expirationHeader;
4201
+ const handleDivClick = () => {
4202
+ onClick == null ? void 0 : onClick(order);
4203
+ };
4204
+ const handleAnchorClick = (event) => {
4205
+ if (shouldUseNativeLinkNavigation2(event)) return;
4206
+ if (!onClick) return;
4207
+ event.preventDefault();
4208
+ onClick(order);
4209
+ };
4210
+ const handleCancelClick = (event) => {
4211
+ event.preventDefault();
4212
+ event.stopPropagation();
4213
+ onCancel == null ? void 0 : onCancel(order);
4214
+ };
4215
+ const status = order.status.toLowerCase();
4216
+ const isLimitOrder = order.orderType === "limit";
4217
+ const canCancel = status === "open" || status === "partially_filled_open" || status === "cancel_pending" || status === "submitted" && isLimitOrder || status === "pending" && !order.dagRunId;
4218
+ const Wrapper = href ? "a" : "div";
4219
+ const wrapperProps = href ? {
4220
+ href,
4221
+ onClick: handleAnchorClick
4222
+ } : {
4223
+ role: "button",
4224
+ tabIndex: 0,
4225
+ onClick: handleDivClick,
4226
+ onKeyDown: (event) => {
4227
+ if (event.target !== event.currentTarget) return;
4228
+ if (event.key !== "Enter" && event.key !== " ") return;
4229
+ event.preventDefault();
4230
+ handleDivClick();
4231
+ }
4232
+ };
4233
+ return /* @__PURE__ */ jsx12(
4234
+ Wrapper,
4235
+ __spreadProps(__spreadValues({
4236
+ "aria-label": order.title,
4237
+ className: cn(
4238
+ "agg-open-order-row relative block cursor-pointer focus-visible:outline-none",
4239
+ "before:absolute before:-top-2 before:-left-2 before:-bottom-2 before:-right-2 before:z-0",
4240
+ "before:rounded-agg-xl before:bg-agg-secondary-hover before:opacity-0 before:transition-all before:duration-300",
4241
+ "hover:before:opacity-100 focus-visible:before:opacity-100"
4242
+ )
4243
+ }, wrapperProps), {
4244
+ children: /* @__PURE__ */ jsxs11("div", { className: "agg-open-order-row-content relative z-10 flex w-full flex-col gap-3 rounded-agg-xl px-3 py-2.5 text-left lg:flex-row lg:items-center lg:gap-6 lg:px-0 lg:py-0", children: [
4245
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-center gap-3 lg:gap-4", children: [
4246
+ /* @__PURE__ */ jsx12("div", { className: "agg-open-order-image flex h-10 w-10 shrink-0 items-center justify-center lg:h-15 lg:w-15", children: /* @__PURE__ */ jsx12(
4247
+ RemoteImage,
4248
+ {
4249
+ src: optimizedImageUrl(order.thumbnailSrc, 60),
4250
+ alt: "",
4251
+ className: "h-full w-full rounded-agg-sm object-cover"
4252
+ }
4253
+ ) }),
4254
+ /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-2", children: [
4255
+ /* @__PURE__ */ jsx12("p", { className: "agg-open-order-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] lg:text-agg-base lg:leading-agg-6 lg:whitespace-nowrap lg:text-ellipsis lg:[-webkit-line-clamp:1] lg:[display:block]", children: order.title }),
4256
+ /* @__PURE__ */ jsx12("span", { className: "agg-open-order-outcome hidden lg:inline-flex w-fit items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ jsx12("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground whitespace-nowrap", children: order.outcomeLabel }) })
4257
+ ] })
4258
+ ] }),
4259
+ /* @__PURE__ */ jsxs11("div", { className: "flex w-full flex-wrap items-center gap-x-4 gap-y-2 lg:hidden", children: [
4260
+ /* @__PURE__ */ jsx12("span", { className: "agg-open-order-outcome inline-flex shrink-0 items-center justify-center rounded-full bg-agg-secondary-hover px-4 py-[6px]", children: /* @__PURE__ */ jsx12("span", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground whitespace-nowrap", children: order.outcomeLabel }) }),
4261
+ [
4262
+ { label: resolvedLimitPriceHeader, value: (_a = order.limitPriceLabel) != null ? _a : "\u2014" },
4263
+ { label: resolvedFilledHeader, value: order.filledLabel },
4264
+ { label: resolvedTotalHeader, value: order.valueLabel },
4265
+ { label: resolvedExpirationHeader, value: (_b = order.expirationLabel) != null ? _b : "\u2014" }
4266
+ ].map(({ label, value }) => /* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-1.5 whitespace-nowrap", children: [
4267
+ /* @__PURE__ */ jsx12("span", { className: "font-agg-sans text-agg-lg leading-agg-7 font-agg-normal text-agg-foreground", children: value }),
4268
+ /* @__PURE__ */ jsx12("span", { className: "font-agg-sans text-[10px] leading-[14px] font-agg-bold uppercase text-agg-muted-foreground", children: label })
4269
+ ] }, label))
4270
+ ] }),
4271
+ /* @__PURE__ */ jsx12("p", { className: "agg-open-order-limit-price hidden w-[120px] shrink-0 agg-type-body-strong text-agg-foreground lg:block", children: (_c = order.limitPriceLabel) != null ? _c : "\u2014" }),
4272
+ /* @__PURE__ */ jsx12("p", { className: "agg-open-order-filled hidden w-[120px] shrink-0 agg-type-body-strong text-agg-foreground lg:block", children: order.filledLabel }),
4273
+ /* @__PURE__ */ jsx12("p", { className: "agg-open-order-value hidden w-[120px] shrink-0 agg-type-body-strong text-agg-foreground lg:block", children: order.valueLabel }),
4274
+ /* @__PURE__ */ jsx12("p", { className: "agg-open-order-expiration hidden w-[140px] shrink-0 agg-type-label text-agg-foreground lg:block", children: (_d = order.expirationLabel) != null ? _d : "\u2014" }),
4275
+ /* @__PURE__ */ jsx12(
4276
+ "div",
4277
+ {
4278
+ className: cn(
4279
+ "shrink-0 justify-end",
4280
+ canCancel ? "flex w-full lg:w-[80px]" : "hidden lg:flex lg:w-[80px]"
4281
+ ),
4282
+ children: canCancel ? /* @__PURE__ */ jsx12(
4283
+ Button,
4284
+ {
4285
+ variant: "secondary",
4286
+ size: "small",
4287
+ isLoading: isCancelling,
4288
+ disabled: isCancelling,
4289
+ onClick: handleCancelClick,
4290
+ "aria-label": resolvedCancelAriaLabel,
4291
+ className: "w-full lg:w-auto !text-agg-error font-agg-bold",
4292
+ children: resolvedCancelLabel
4293
+ }
4294
+ ) : null
4295
+ }
4296
+ )
4297
+ ] })
4298
+ })
4299
+ );
4300
+ };
4301
+ OpenOrderRow.displayName = "OpenOrderRow";
4302
+
4303
+ // src/pages/user-profile/components/position-row.tsx
4304
+ import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels8 } from "@agg-build/hooks";
4305
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4306
+ var shouldUseNativeLinkNavigation3 = (event) => {
4307
+ return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
4308
+ };
4143
4309
  var toneTextClassName = (tone) => {
4144
4310
  if (tone === "positive") return "text-agg-success";
4145
4311
  if (tone === "negative") return "text-agg-error";
4146
4312
  return "text-agg-muted-foreground";
4147
4313
  };
4148
- 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 }) });
4149
- 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 }) });
4314
+ var OutcomePill = ({ label }) => /* @__PURE__ */ jsx13("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__ */ jsx13("span", { className: "whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground truncate", children: label }) });
4315
+ var ResolutionPill = ({ label }) => /* @__PURE__ */ jsx13("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__ */ jsx13("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: label }) });
4150
4316
  var VenueShares = ({
4151
4317
  model,
4152
4318
  className,
4153
4319
  keyPrefix
4154
4320
  }) => {
4155
4321
  if (model.venueShareBreakdown.length === 0) return null;
4156
- return /* @__PURE__ */ jsx12("div", { className: cn(className, "gap-x-3 gap-y-2"), children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ jsxs11(
4322
+ return /* @__PURE__ */ jsx13("div", { className: cn(className, "gap-x-3 gap-y-2"), children: model.venueShareBreakdown.map((row, index) => /* @__PURE__ */ jsxs12(
4157
4323
  "div",
4158
4324
  {
4159
4325
  className: "flex min-w-0 max-w-full items-center gap-1",
4160
4326
  children: [
4161
- /* @__PURE__ */ jsx12(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" }),
4162
- /* @__PURE__ */ jsx12("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: row.sharesLabel })
4327
+ /* @__PURE__ */ jsx13(VenueLogo, { venue: row.venue, size: "small", className: "size-4 shrink-0" }),
4328
+ /* @__PURE__ */ jsx13("span", { className: "truncate whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: row.sharesLabel })
4163
4329
  ]
4164
4330
  },
4165
4331
  `${keyPrefix}-${row.venue}-${row.sharesLabel}-${String(index)}`
@@ -4171,7 +4337,7 @@ var StatusBadge = ({
4171
4337
  }) => {
4172
4338
  if (status === "lost" || status === "won_claimed") return null;
4173
4339
  const isWon = status === "won_unclaimed";
4174
- return /* @__PURE__ */ jsxs11(
4340
+ return /* @__PURE__ */ jsxs12(
4175
4341
  "span",
4176
4342
  {
4177
4343
  className: cn(
@@ -4180,7 +4346,7 @@ var StatusBadge = ({
4180
4346
  isWon ? "border-agg-success/50 bg-agg-success/10 text-agg-success" : "border-agg-muted-foreground/30 bg-agg-secondary-hover text-agg-foreground"
4181
4347
  ),
4182
4348
  children: [
4183
- /* @__PURE__ */ jsx12(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
4349
+ /* @__PURE__ */ jsx13(Icon, { name: isWon ? "check-circle" : "hourglass-start", size: "small", className: "size-2.5!" }),
4184
4350
  isWon ? labels.won : labels.open
4185
4351
  ]
4186
4352
  }
@@ -4193,7 +4359,7 @@ var ResultBadge = ({
4193
4359
  if (status !== "won_claimed" && status !== "lost" && status !== "sold") return null;
4194
4360
  const isWon = status === "won_claimed";
4195
4361
  const isSold = status === "sold";
4196
- return /* @__PURE__ */ jsxs11(
4362
+ return /* @__PURE__ */ jsxs12(
4197
4363
  "span",
4198
4364
  {
4199
4365
  className: cn(
@@ -4202,7 +4368,7 @@ var ResultBadge = ({
4202
4368
  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"
4203
4369
  ),
4204
4370
  children: [
4205
- /* @__PURE__ */ jsx12(
4371
+ /* @__PURE__ */ jsx13(
4206
4372
  Icon,
4207
4373
  {
4208
4374
  name: isWon ? "check-circle" : isSold ? "hourglass-start" : "cross-circle",
@@ -4218,27 +4384,27 @@ var ResultBadge = ({
4218
4384
  var TotalTradedCell = ({
4219
4385
  model,
4220
4386
  className
4221
- }) => /* @__PURE__ */ jsxs11(
4387
+ }) => /* @__PURE__ */ jsxs12(
4222
4388
  "div",
4223
4389
  {
4224
4390
  className: cn("agg-position-total-traded flex flex-col gap-[2px] whitespace-nowrap", className),
4225
4391
  children: [
4226
- /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
4227
- /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
4392
+ /* @__PURE__ */ jsx13("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: model.totalTraded.primaryLabel }),
4393
+ /* @__PURE__ */ jsx13("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: model.totalTraded.averageLabel })
4228
4394
  ]
4229
4395
  }
4230
4396
  );
4231
4397
  var PositionValueCell = ({
4232
4398
  value,
4233
4399
  className
4234
- }) => /* @__PURE__ */ jsxs11(
4400
+ }) => /* @__PURE__ */ jsxs12(
4235
4401
  "div",
4236
4402
  {
4237
4403
  className: cn("agg-position-value-cell flex flex-col gap-[2px] whitespace-nowrap", className),
4238
4404
  children: [
4239
- /* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-1.5", children: [
4240
- /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
4241
- /* @__PURE__ */ jsx12(
4405
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-baseline gap-1.5", children: [
4406
+ /* @__PURE__ */ jsx13("p", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: value.primaryLabel }),
4407
+ /* @__PURE__ */ jsx13(
4242
4408
  "p",
4243
4409
  {
4244
4410
  className: cn(
@@ -4249,9 +4415,9 @@ var PositionValueCell = ({
4249
4415
  }
4250
4416
  )
4251
4417
  ] }),
4252
- /* @__PURE__ */ jsxs11("div", { className: "flex items-baseline gap-1.5", children: [
4253
- /* @__PURE__ */ jsx12("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
4254
- /* @__PURE__ */ jsx12(
4418
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-baseline gap-1.5", children: [
4419
+ /* @__PURE__ */ jsx13("p", { className: "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal text-agg-foreground", children: value.priceLabel }),
4420
+ /* @__PURE__ */ jsx13(
4255
4421
  "p",
4256
4422
  {
4257
4423
  className: cn(
@@ -4273,7 +4439,7 @@ var PositionRow = ({
4273
4439
  onClaim,
4274
4440
  isClaiming = false
4275
4441
  }) => {
4276
- const labels = useLabels7().userProfile.positions;
4442
+ const labels = useLabels8().userProfile.positions;
4277
4443
  const model = toPositionRowViewModel(position, {
4278
4444
  avgPrefix: labels.avgPrefix,
4279
4445
  nowPrefix: labels.nowPrefix,
@@ -4287,7 +4453,7 @@ var PositionRow = ({
4287
4453
  void (onClaim == null ? void 0 : onClaim(position));
4288
4454
  };
4289
4455
  const handleAnchorClick = (event) => {
4290
- if (shouldUseNativeLinkNavigation2(event)) return;
4456
+ if (shouldUseNativeLinkNavigation3(event)) return;
4291
4457
  if (!onClick) return;
4292
4458
  event.preventDefault();
4293
4459
  onClick(position);
@@ -4314,7 +4480,7 @@ var PositionRow = ({
4314
4480
  handleDivClick();
4315
4481
  }
4316
4482
  };
4317
- return /* @__PURE__ */ jsx12(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ jsxs11(
4483
+ return /* @__PURE__ */ jsx13(Wrapper, __spreadProps(__spreadValues({ className: sharedClassName }, wrapperProps), { children: /* @__PURE__ */ jsxs12(
4318
4484
  "div",
4319
4485
  {
4320
4486
  className: cn(
@@ -4322,21 +4488,21 @@ var PositionRow = ({
4322
4488
  isClosed ? "md:gap-8" : "md:gap-6"
4323
4489
  ),
4324
4490
  children: [
4325
- /* @__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: [
4326
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
4327
- /* @__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(
4491
+ /* @__PURE__ */ jsxs12("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: [
4492
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 items-center gap-3 md:gap-4", children: [
4493
+ /* @__PURE__ */ jsx13("div", { className: "agg-position-image flex h-10 w-10 shrink-0 items-center justify-center md:h-15 md:w-15", children: /* @__PURE__ */ jsx13(
4328
4494
  RemoteImage,
4329
4495
  {
4330
- src: optimizedImageUrl(model.thumbnailSrc, 60),
4496
+ src: optimizedImageUrl2(model.thumbnailSrc, 60),
4331
4497
  alt: "",
4332
4498
  className: "h-full w-full rounded-agg-sm object-cover"
4333
4499
  }
4334
4500
  ) }),
4335
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col", children: [
4336
- /* @__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 }),
4337
- /* @__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: [
4338
- /* @__PURE__ */ jsx12(OutcomePill, { label: model.selectedOutcomeLabel }),
4339
- /* @__PURE__ */ jsx12(
4501
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col", children: [
4502
+ /* @__PURE__ */ jsx13("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 }),
4503
+ /* @__PURE__ */ jsxs12("div", { className: "hidden min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2 pt-1 md:flex", children: [
4504
+ /* @__PURE__ */ jsx13(OutcomePill, { label: model.selectedOutcomeLabel }),
4505
+ /* @__PURE__ */ jsx13(
4340
4506
  VenueShares,
4341
4507
  {
4342
4508
  model,
@@ -4347,10 +4513,10 @@ var PositionRow = ({
4347
4513
  ] })
4348
4514
  ] })
4349
4515
  ] }),
4350
- /* @__PURE__ */ jsx12("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ jsx12(OutcomePill, { label: model.selectedOutcomeLabel }) })
4516
+ /* @__PURE__ */ jsx13("div", { className: "flex shrink-0 items-center justify-end md:hidden", children: /* @__PURE__ */ jsx13(OutcomePill, { label: model.selectedOutcomeLabel }) })
4351
4517
  ] }),
4352
- isClosed ? /* @__PURE__ */ jsx12("div", { className: "md:hidden", children: /* @__PURE__ */ jsx12(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
4353
- /* @__PURE__ */ jsx12(
4518
+ isClosed ? /* @__PURE__ */ jsx13("div", { className: "md:hidden", children: /* @__PURE__ */ jsx13(ResolutionPill, { label: `${labels.resolutionHeader}: ${model.resolutionLabel}` }) }) : null,
4519
+ /* @__PURE__ */ jsx13(
4354
4520
  VenueShares,
4355
4521
  {
4356
4522
  model,
@@ -4358,14 +4524,14 @@ var PositionRow = ({
4358
4524
  className: "agg-position-venues flex min-w-0 flex-1 flex-wrap content-center items-center gap-x-3 gap-y-2 md:hidden"
4359
4525
  }
4360
4526
  ),
4361
- /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
4362
- /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 items-center gap-5", children: [
4363
- /* @__PURE__ */ jsx12(TotalTradedCell, { model }),
4364
- /* @__PURE__ */ jsx12(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
4527
+ /* @__PURE__ */ jsxs12("div", { className: "flex w-full items-center justify-between gap-3 md:hidden", children: [
4528
+ /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 items-center gap-5", children: [
4529
+ /* @__PURE__ */ jsx13(TotalTradedCell, { model }),
4530
+ /* @__PURE__ */ jsx13(PositionValueCell, { value: isClosed ? model.payout : model.currentValue })
4365
4531
  ] }),
4366
- isClosed ? /* @__PURE__ */ jsx12(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
4367
- /* @__PURE__ */ jsx12(StatusBadge, { status: model.positionStatus, labels }),
4368
- model.canClaim ? /* @__PURE__ */ jsxs11(
4532
+ isClosed ? /* @__PURE__ */ jsx13(ResultBadge, { status: model.positionStatus, labels }) : /* @__PURE__ */ jsxs12("div", { className: "flex shrink-0 flex-col items-start justify-center gap-2", children: [
4533
+ /* @__PURE__ */ jsx13(StatusBadge, { status: model.positionStatus, labels }),
4534
+ model.canClaim ? /* @__PURE__ */ jsxs12(
4369
4535
  "button",
4370
4536
  {
4371
4537
  type: "button",
@@ -4374,48 +4540,48 @@ var PositionRow = ({
4374
4540
  disabled: isClaiming,
4375
4541
  "aria-busy": isClaiming || void 0,
4376
4542
  children: [
4377
- isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4543
+ isClaiming ? /* @__PURE__ */ jsx13(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4378
4544
  labels.claim
4379
4545
  ]
4380
4546
  }
4381
4547
  ) : null
4382
4548
  ] })
4383
4549
  ] }),
4384
- isClosed ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
4385
- /* @__PURE__ */ jsx12("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ jsx12(ResolutionPill, { label: model.resolutionLabel }) }),
4386
- /* @__PURE__ */ jsx12(
4550
+ isClosed ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
4551
+ /* @__PURE__ */ jsx13("div", { className: "hidden w-[90px] shrink-0 md:block lg:w-[120px]", children: /* @__PURE__ */ jsx13(ResolutionPill, { label: model.resolutionLabel }) }),
4552
+ /* @__PURE__ */ jsx13(
4387
4553
  TotalTradedCell,
4388
4554
  {
4389
4555
  model,
4390
4556
  className: "hidden w-[110px] shrink-0 md:flex lg:w-[130px]"
4391
4557
  }
4392
4558
  ),
4393
- /* @__PURE__ */ jsx12(
4559
+ /* @__PURE__ */ jsx13(
4394
4560
  PositionValueCell,
4395
4561
  {
4396
4562
  value: model.payout,
4397
4563
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
4398
4564
  }
4399
4565
  ),
4400
- /* @__PURE__ */ jsx12("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ jsx12(ResultBadge, { status: model.positionStatus, labels }) })
4401
- ] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
4402
- /* @__PURE__ */ jsx12(
4566
+ /* @__PURE__ */ jsx13("div", { className: "hidden w-[60px] shrink-0 items-center md:flex", children: /* @__PURE__ */ jsx13(ResultBadge, { status: model.positionStatus, labels }) })
4567
+ ] }) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
4568
+ /* @__PURE__ */ jsx13(
4403
4569
  TotalTradedCell,
4404
4570
  {
4405
4571
  model,
4406
4572
  className: "hidden w-[120px] shrink-0 md:flex lg:w-[140px]"
4407
4573
  }
4408
4574
  ),
4409
- /* @__PURE__ */ jsx12(
4575
+ /* @__PURE__ */ jsx13(
4410
4576
  PositionValueCell,
4411
4577
  {
4412
4578
  value: model.currentValue,
4413
4579
  className: "hidden w-[130px] shrink-0 md:flex lg:w-[160px]"
4414
4580
  }
4415
4581
  ),
4416
- /* @__PURE__ */ jsxs11("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
4417
- /* @__PURE__ */ jsx12(StatusBadge, { status: model.positionStatus, labels }),
4418
- model.canClaim ? /* @__PURE__ */ jsxs11(
4582
+ /* @__PURE__ */ jsxs12("div", { className: "hidden w-[100px] shrink-0 items-center gap-3 md:flex", children: [
4583
+ /* @__PURE__ */ jsx13(StatusBadge, { status: model.positionStatus, labels }),
4584
+ model.canClaim ? /* @__PURE__ */ jsxs12(
4419
4585
  "button",
4420
4586
  {
4421
4587
  type: "button",
@@ -4424,14 +4590,14 @@ var PositionRow = ({
4424
4590
  disabled: isClaiming,
4425
4591
  "aria-busy": isClaiming || void 0,
4426
4592
  children: [
4427
- isClaiming ? /* @__PURE__ */ jsx12(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4593
+ isClaiming ? /* @__PURE__ */ jsx13(LoadingIcon, { size: "small", className: "text-agg-primary" }) : null,
4428
4594
  labels.claim
4429
4595
  ]
4430
4596
  }
4431
4597
  ) : null
4432
4598
  ] })
4433
4599
  ] }),
4434
- /* @__PURE__ */ jsx12("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ jsx12(
4600
+ /* @__PURE__ */ jsx13("div", { className: "hidden w-5 shrink-0 items-center justify-end md:flex", children: /* @__PURE__ */ jsx13(
4435
4601
  Icon,
4436
4602
  {
4437
4603
  name: "chevron-right",
@@ -4446,20 +4612,20 @@ var PositionRow = ({
4446
4612
  PositionRow.displayName = "PositionRow";
4447
4613
 
4448
4614
  // src/pages/user-profile/components/positions-activity.tsx
4449
- import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4450
- var tabItems = [
4451
- { value: USER_PROFILE_TAB_POSITIONS, label: "Positions" },
4452
- // Open orders is intentionally hidden from the user-profile tab group.
4453
- // Restore by re-adding USER_PROFILE_TAB_OPEN_ORDERS here and the renderer below.
4454
- { value: USER_PROFILE_TAB_ACTIVITY, label: "Activity" }
4615
+ import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
4616
+ var getTabItems = (tabsLabels, showOpenOrders) => [
4617
+ { value: USER_PROFILE_TAB_POSITIONS, label: tabsLabels.positions },
4618
+ ...showOpenOrders ? [{ value: USER_PROFILE_TAB_OPEN_ORDERS, label: tabsLabels.openOrders }] : [],
4619
+ { value: USER_PROFILE_TAB_ACTIVITY, label: tabsLabels.activity }
4455
4620
  ];
4456
- 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: [
4457
- /* @__PURE__ */ jsx13("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
4458
- index < acc.length - 1 ? /* @__PURE__ */ jsx13("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
4621
+ var TabRowsSkeleton = ({ ariaLabel }) => /* @__PURE__ */ jsx14("div", { role: "status", "aria-label": ariaLabel, className: "flex flex-col gap-3 sm:gap-4", children: Array.from({ length: 3 }).map((_, index, acc) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
4622
+ /* @__PURE__ */ jsx14("div", { className: "h-14 rounded-agg-sm bg-agg-secondary-hover/80 sm:h-16" }, index),
4623
+ index < acc.length - 1 ? /* @__PURE__ */ jsx14("div", { className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator", "aria-hidden": true }) : null
4459
4624
  ] }, index)) });
4460
4625
  var PositionsActivity = ({
4461
4626
  activePositions = [],
4462
4627
  closedPositions = [],
4628
+ openOrders = [],
4463
4629
  activities = [],
4464
4630
  onPositionClick,
4465
4631
  getPositionHref,
@@ -4467,10 +4633,16 @@ var PositionsActivity = ({
4467
4633
  claimingPositionKeys,
4468
4634
  onActivityClick,
4469
4635
  getActivityHref,
4636
+ onOpenOrderClick,
4637
+ getOpenOrderHref,
4638
+ onCancelOrder,
4639
+ cancellingOrderIds,
4470
4640
  isLoadingPositions = false,
4471
4641
  isLoadingActivities = false,
4642
+ isLoadingOpenOrders = false,
4472
4643
  positionsError = false,
4473
4644
  activitiesError = false,
4645
+ openOrdersError = false,
4474
4646
  hasMoreActivePositions = false,
4475
4647
  isLoadingMoreActivePositions = false,
4476
4648
  onLoadMoreActivePositions,
@@ -4481,18 +4653,30 @@ var PositionsActivity = ({
4481
4653
  hasMoreActivities = false,
4482
4654
  isLoadingMoreActivities = false,
4483
4655
  onLoadMoreActivities,
4656
+ hasMoreOpenOrders = false,
4657
+ isLoadingMoreOpenOrders = false,
4658
+ onLoadMoreOpenOrders,
4659
+ showOpenOrders = false,
4484
4660
  tab,
4485
4661
  onTabChange,
4486
4662
  initialPositionFilter = "active",
4487
4663
  className
4488
4664
  }) => {
4489
- const positionsLabels = useLabels8().userProfile.positions;
4665
+ const userProfileLabels = useLabels9().userProfile;
4666
+ const positionsLabels = userProfileLabels.positions;
4667
+ const openOrdersLabels = userProfileLabels.openOrders;
4668
+ const tabItems = useMemo6(
4669
+ () => getTabItems(userProfileLabels.tabs, showOpenOrders),
4670
+ [showOpenOrders, userProfileLabels.tabs]
4671
+ );
4490
4672
  const isTabControlled = tab !== void 0;
4491
4673
  const [internalActiveTab, setInternalActiveTab] = useState10(
4492
4674
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
4493
4675
  );
4494
- const activeTab = isTabControlled ? tab : internalActiveTab;
4676
+ const requestedActiveTab = isTabControlled ? tab : internalActiveTab;
4677
+ const activeTab = requestedActiveTab === USER_PROFILE_TAB_OPEN_ORDERS && !showOpenOrders ? USER_PROFILE_TAB_POSITIONS : requestedActiveTab;
4495
4678
  const handleTabChange = (next) => {
4679
+ if (next === USER_PROFILE_TAB_OPEN_ORDERS && !showOpenOrders) return;
4496
4680
  if (!isTabControlled) setInternalActiveTab(next);
4497
4681
  onTabChange == null ? void 0 : onTabChange(next);
4498
4682
  };
@@ -4503,9 +4687,11 @@ var PositionsActivity = ({
4503
4687
  () => /* @__PURE__ */ new Set()
4504
4688
  );
4505
4689
  const positionsLoadMoreRef = useRef8(null);
4690
+ const openOrdersLoadMoreRef = useRef8(null);
4506
4691
  const activitiesLoadMoreRef = useRef8(null);
4507
4692
  const rowsScrollRef = useRef8(null);
4508
4693
  const isPositionsTab = activeTab === USER_PROFILE_TAB_POSITIONS;
4694
+ const isOpenOrdersTab = activeTab === USER_PROFILE_TAB_OPEN_ORDERS;
4509
4695
  const isActivityTab = activeTab === USER_PROFILE_TAB_ACTIVITY;
4510
4696
  const isClosedPositionsFilter = isPositionsTab && positionFilter === "closed";
4511
4697
  const positionsForCurrentFilter = useMemo6(() => {
@@ -4616,7 +4802,29 @@ var PositionsActivity = ({
4616
4802
  isLoadingMoreActivities,
4617
4803
  onLoadMoreActivities
4618
4804
  ]);
4619
- return /* @__PURE__ */ jsxs12(
4805
+ useEffect9(() => {
4806
+ if (!isOpenOrdersTab || !hasMoreOpenOrders) return;
4807
+ const target = openOrdersLoadMoreRef.current;
4808
+ if (!target || !onLoadMoreOpenOrders) return;
4809
+ const observer = new IntersectionObserver(
4810
+ (entries) => {
4811
+ const entry = entries[0];
4812
+ if (!(entry == null ? void 0 : entry.isIntersecting)) return;
4813
+ if (isLoadingOpenOrders || isLoadingMoreOpenOrders || !hasMoreOpenOrders) return;
4814
+ onLoadMoreOpenOrders();
4815
+ },
4816
+ { root: rowsScrollRef.current, rootMargin: "60px 0px" }
4817
+ );
4818
+ observer.observe(target);
4819
+ return () => observer.disconnect();
4820
+ }, [
4821
+ hasMoreOpenOrders,
4822
+ isLoadingMoreOpenOrders,
4823
+ isLoadingOpenOrders,
4824
+ isOpenOrdersTab,
4825
+ onLoadMoreOpenOrders
4826
+ ]);
4827
+ return /* @__PURE__ */ jsxs13(
4620
4828
  "div",
4621
4829
  {
4622
4830
  className: cn(
@@ -4625,7 +4833,7 @@ var PositionsActivity = ({
4625
4833
  className
4626
4834
  ),
4627
4835
  children: [
4628
- /* @__PURE__ */ jsx13(
4836
+ /* @__PURE__ */ jsx14(
4629
4837
  Tabs,
4630
4838
  {
4631
4839
  items: tabItems,
@@ -4639,7 +4847,7 @@ var PositionsActivity = ({
4639
4847
  }
4640
4848
  }
4641
4849
  ),
4642
- /* @__PURE__ */ jsxs12(
4850
+ /* @__PURE__ */ jsxs13(
4643
4851
  "div",
4644
4852
  {
4645
4853
  className: cn(
@@ -4647,12 +4855,12 @@ var PositionsActivity = ({
4647
4855
  isPositionsTab ? "pt-4 md:pt-6" : "pt-0 md:pt-6"
4648
4856
  ),
4649
4857
  children: [
4650
- isPositionsTab ? /* @__PURE__ */ jsxs12("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
4651
- /* @__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) => {
4858
+ isPositionsTab ? /* @__PURE__ */ jsxs13("div", { className: "agg-toolbar flex flex-row items-start gap-3 px-4 sm:gap-5 sm:px-6", children: [
4859
+ /* @__PURE__ */ jsx14("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) => {
4652
4860
  const isActive = filter.value === positionFilter;
4653
- return /* @__PURE__ */ jsxs12("div", { className: "flex flex-1 items-stretch", children: [
4654
- idx > 0 ? /* @__PURE__ */ jsx13("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
4655
- /* @__PURE__ */ jsx13(
4861
+ return /* @__PURE__ */ jsxs13("div", { className: "flex flex-1 items-stretch", children: [
4862
+ idx > 0 ? /* @__PURE__ */ jsx14("div", { className: "w-px bg-agg-separator", "aria-hidden": true }) : null,
4863
+ /* @__PURE__ */ jsx14(
4656
4864
  "button",
4657
4865
  {
4658
4866
  type: "button",
@@ -4667,7 +4875,7 @@ var PositionsActivity = ({
4667
4875
  )
4668
4876
  ] }, filter.value);
4669
4877
  }) }),
4670
- /* @__PURE__ */ jsxs12(
4878
+ /* @__PURE__ */ jsxs13(
4671
4879
  "div",
4672
4880
  {
4673
4881
  className: "agg-position-search relative flex w-full min-w-0 flex-1",
@@ -4678,9 +4886,9 @@ var PositionsActivity = ({
4678
4886
  setIsSearchFocused(false);
4679
4887
  },
4680
4888
  children: [
4681
- /* @__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: [
4682
- /* @__PURE__ */ jsx13(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
4683
- /* @__PURE__ */ jsx13(
4889
+ /* @__PURE__ */ jsx14("label", { className: "flex w-full min-w-0 flex-1", children: /* @__PURE__ */ jsxs13("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: [
4890
+ /* @__PURE__ */ jsx14(Icon, { name: "search", size: "small", className: "shrink-0 text-agg-muted-foreground" }),
4891
+ /* @__PURE__ */ jsx14(
4684
4892
  "input",
4685
4893
  {
4686
4894
  value: searchValue,
@@ -4695,7 +4903,7 @@ var PositionsActivity = ({
4695
4903
  }
4696
4904
  )
4697
4905
  ] }) }),
4698
- 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(
4906
+ isSearchFocused && searchValue.trim() ? /* @__PURE__ */ jsx14("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__ */ jsx14(
4699
4907
  "ul",
4700
4908
  {
4701
4909
  className: "agg-position-search-results-list m-0 flex list-none flex-col p-0",
@@ -4708,26 +4916,26 @@ var PositionsActivity = ({
4708
4916
  setIsSearchFocused(false);
4709
4917
  onPositionClick == null ? void 0 : onPositionClick(item.raw);
4710
4918
  };
4711
- const innerContent = /* @__PURE__ */ jsxs12(Fragment5, { children: [
4712
- /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
4713
- /* @__PURE__ */ jsx13(
4919
+ const innerContent = /* @__PURE__ */ jsxs13(Fragment5, { children: [
4920
+ /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
4921
+ /* @__PURE__ */ jsx14(
4714
4922
  "img",
4715
4923
  {
4716
- src: optimizedImageUrl2(item.thumbnailSrc, 48),
4924
+ src: optimizedImageUrl3(item.thumbnailSrc, 48),
4717
4925
  alt: "",
4718
4926
  className: "size-12 shrink-0 rounded-agg-lg object-cover"
4719
4927
  }
4720
4928
  ),
4721
- /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
4722
- /* @__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 }),
4723
- /* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
4724
- /* @__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 }),
4725
- /* @__PURE__ */ jsx13("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
4726
- /* @__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 })
4929
+ /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
4930
+ /* @__PURE__ */ jsx14("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 }),
4931
+ /* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-center gap-2 text-agg-muted-foreground", children: [
4932
+ /* @__PURE__ */ jsx14("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 }),
4933
+ /* @__PURE__ */ jsx14("span", { className: "text-agg-muted-foreground", "aria-hidden": true, children: "\xB7" }),
4934
+ /* @__PURE__ */ jsx14("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 })
4727
4935
  ] })
4728
4936
  ] })
4729
4937
  ] }),
4730
- /* @__PURE__ */ jsx13(
4938
+ /* @__PURE__ */ jsx14(
4731
4939
  Icon,
4732
4940
  {
4733
4941
  name: "chevron-right",
@@ -4736,7 +4944,7 @@ var PositionsActivity = ({
4736
4944
  }
4737
4945
  )
4738
4946
  ] });
4739
- return /* @__PURE__ */ jsx13(
4947
+ return /* @__PURE__ */ jsx14(
4740
4948
  "li",
4741
4949
  {
4742
4950
  role: "presentation",
@@ -4744,7 +4952,7 @@ var PositionsActivity = ({
4744
4952
  "agg-position-search-result-item",
4745
4953
  index > 0 && "border-t border-agg-separator"
4746
4954
  ),
4747
- children: itemHref ? /* @__PURE__ */ jsx13(
4955
+ children: itemHref ? /* @__PURE__ */ jsx14(
4748
4956
  "a",
4749
4957
  {
4750
4958
  href: itemHref,
@@ -4759,7 +4967,7 @@ var PositionsActivity = ({
4759
4967
  },
4760
4968
  children: innerContent
4761
4969
  }
4762
- ) : /* @__PURE__ */ jsx13(
4970
+ ) : /* @__PURE__ */ jsx14(
4763
4971
  "button",
4764
4972
  {
4765
4973
  type: "button",
@@ -4773,34 +4981,42 @@ var PositionsActivity = ({
4773
4981
  );
4774
4982
  })
4775
4983
  }
4776
- ) : /* @__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
4984
+ ) : /* @__PURE__ */ jsx14("div", { className: "px-5 py-6 font-agg-sans text-agg-sm leading-agg-5 text-agg-muted-foreground", children: positionsLabels.noResults }) }) : null
4777
4985
  ]
4778
4986
  }
4779
4987
  )
4780
4988
  ] }) : null,
4781
- /* @__PURE__ */ jsxs12("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
4782
- /* @__PURE__ */ jsxs12("div", { className: "w-full px-4 sm:px-6", children: [
4783
- isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
4784
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4785
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
4786
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
4787
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
4788
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
4789
- /* @__PURE__ */ jsx13("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4790
- ] }) : /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4791
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4792
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
4793
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
4794
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
4795
- /* @__PURE__ */ jsx13("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4989
+ /* @__PURE__ */ jsxs13("div", { className: "agg-positions-table-wrapper flex w-full gap-0 flex-col", children: [
4990
+ /* @__PURE__ */ jsxs13("div", { className: "w-full px-4 sm:px-6", children: [
4991
+ isPositionsTab && filteredPositions.length > 0 ? isClosedPositionsFilter ? /* @__PURE__ */ jsxs13("div", { className: "hidden items-start gap-8 px-0 md:flex", children: [
4992
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
4993
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[90px] shrink-0 lg:w-[120px]", children: positionsLabels.resolutionHeader }),
4994
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[110px] shrink-0 lg:w-[130px]", children: positionsLabels.totalTradedHeader }),
4995
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.payoutHeader }),
4996
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[60px] shrink-0", children: positionsLabels.resultHeader }),
4997
+ /* @__PURE__ */ jsx14("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
4998
+ ] }) : /* @__PURE__ */ jsxs13("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4999
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: positionsLabels.marketHeader }),
5000
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 lg:w-[140px]", children: positionsLabels.totalTradedHeader }),
5001
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[130px] shrink-0 lg:w-[160px]", children: positionsLabels.currentValueHeader }),
5002
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[100px] shrink-0", children: positionsLabels.statusHeader }),
5003
+ /* @__PURE__ */ jsx14("span", { className: "hidden w-5 shrink-0 sm:block", "aria-hidden": true })
5004
+ ] }) : null,
5005
+ isOpenOrdersTab && openOrders.length > 0 ? /* @__PURE__ */ jsxs13("div", { className: "hidden items-start gap-6 px-0 lg:flex", children: [
5006
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: openOrdersLabels.marketHeader }),
5007
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[120px] shrink-0", children: openOrdersLabels.limitPriceHeader }),
5008
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[120px] shrink-0", children: openOrdersLabels.filledHeader }),
5009
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[120px] shrink-0", children: openOrdersLabels.totalHeader }),
5010
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[140px] shrink-0", children: openOrdersLabels.expirationHeader }),
5011
+ /* @__PURE__ */ jsx14("span", { className: "w-[80px] shrink-0", "aria-hidden": true })
4796
5012
  ] }) : null,
4797
- isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ jsxs12("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
4798
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
4799
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
4800
- /* @__PURE__ */ jsx13("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
5013
+ isActivityTab && filteredActivities.length > 0 ? /* @__PURE__ */ jsxs13("div", { className: "hidden items-start gap-6 px-0 md:flex", children: [
5014
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-22 shrink-0", children: "Type" }),
5015
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header min-w-0 flex-1", children: "Market" }),
5016
+ /* @__PURE__ */ jsx14("p", { className: "agg-user-profile-table-header w-[120px] shrink-0 text-right", children: "Amount" })
4801
5017
  ] }) : null
4802
5018
  ] }),
4803
- /* @__PURE__ */ jsx13(
5019
+ /* @__PURE__ */ jsx14(
4804
5020
  "div",
4805
5021
  {
4806
5022
  ref: rowsScrollRef,
@@ -4812,8 +5028,8 @@ var PositionsActivity = ({
4812
5028
  "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-agg-muted-foreground/50",
4813
5029
  "[&::-webkit-scrollbar-thumb:hover]:bg-agg-muted-foreground/70"
4814
5030
  ),
4815
- children: isPositionsTab ? /* @__PURE__ */ jsxs12("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
4816
- isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx13(
5031
+ children: isPositionsTab ? /* @__PURE__ */ jsxs13("div", { className: "agg-portfolio-list flex flex-col gap-5", children: [
5032
+ isLoadingPositions && filteredPositions.length === 0 ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: "Loading positions" }) : positionsError && filteredPositions.length === 0 ? /* @__PURE__ */ jsx14(
4817
5033
  EmptyState,
4818
5034
  {
4819
5035
  title: "Unable to load positions",
@@ -4821,15 +5037,15 @@ var PositionsActivity = ({
4821
5037
  }
4822
5038
  ) : filteredPositions.length > 0 ? filteredPositions.map((position, index) => {
4823
5039
  var _a;
4824
- return /* @__PURE__ */ jsxs12(Fragment4, { children: [
4825
- index > 0 ? /* @__PURE__ */ jsx13(
5040
+ return /* @__PURE__ */ jsxs13(Fragment4, { children: [
5041
+ index > 0 ? /* @__PURE__ */ jsx14(
4826
5042
  "div",
4827
5043
  {
4828
5044
  className: "agg-position-divider h-px w-full shrink-0 bg-agg-separator",
4829
5045
  "aria-hidden": true
4830
5046
  }
4831
5047
  ) : null,
4832
- /* @__PURE__ */ jsx13(
5048
+ /* @__PURE__ */ jsx14(
4833
5049
  PositionRow,
4834
5050
  {
4835
5051
  position,
@@ -4843,15 +5059,15 @@ var PositionsActivity = ({
4843
5059
  }
4844
5060
  )
4845
5061
  ] }, position.id);
4846
- }) : /* @__PURE__ */ jsx13(
5062
+ }) : /* @__PURE__ */ jsx14(
4847
5063
  EmptyState,
4848
5064
  {
4849
5065
  title: "No positions yet",
4850
5066
  description: "Your open trades will appear here once you place an order."
4851
5067
  }
4852
5068
  ),
4853
- isLoadingMorePositions ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
4854
- hasMorePositions ? /* @__PURE__ */ jsx13(
5069
+ isLoadingMorePositions ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: "Loading more positions" }) : null,
5070
+ hasMorePositions ? /* @__PURE__ */ jsx14(
4855
5071
  "div",
4856
5072
  {
4857
5073
  ref: positionsLoadMoreRef,
@@ -4859,22 +5075,69 @@ var PositionsActivity = ({
4859
5075
  "aria-hidden": true
4860
5076
  }
4861
5077
  ) : null
4862
- ] }) : /* @__PURE__ */ jsxs12("div", { className: "agg-activity-list flex flex-col gap-5", children: [
4863
- isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx13(
5078
+ ] }) : isOpenOrdersTab ? /* @__PURE__ */ jsxs13("div", { className: "agg-open-orders-list flex flex-col gap-5", children: [
5079
+ isLoadingOpenOrders && openOrders.length === 0 ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: openOrdersLabels.loading }) : openOrdersError && openOrders.length === 0 ? /* @__PURE__ */ jsx14(
5080
+ EmptyState,
5081
+ {
5082
+ title: openOrdersLabels.errorTitle,
5083
+ description: openOrdersLabels.errorDescription
5084
+ }
5085
+ ) : openOrders.length > 0 ? openOrders.map((order, index) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
5086
+ index > 0 ? /* @__PURE__ */ jsx14(
5087
+ "div",
5088
+ {
5089
+ className: "agg-open-order-divider h-px w-full shrink-0 bg-agg-separator",
5090
+ "aria-hidden": true
5091
+ }
5092
+ ) : null,
5093
+ /* @__PURE__ */ jsx14(
5094
+ OpenOrderRow,
5095
+ {
5096
+ order,
5097
+ href: getOpenOrderHref == null ? void 0 : getOpenOrderHref(order),
5098
+ onClick: onOpenOrderClick,
5099
+ onCancel: onCancelOrder,
5100
+ isCancelling: Boolean(cancellingOrderIds == null ? void 0 : cancellingOrderIds[order.id]),
5101
+ cancelLabel: openOrdersLabels.cancel,
5102
+ cancelAriaLabel: openOrdersLabels.cancelOrderAria(order.id),
5103
+ limitPriceHeader: openOrdersLabels.limitPriceHeader,
5104
+ filledHeader: openOrdersLabels.filledHeader,
5105
+ totalHeader: openOrdersLabels.totalHeader,
5106
+ expirationHeader: openOrdersLabels.expirationHeader
5107
+ }
5108
+ )
5109
+ ] }, order.id)) : /* @__PURE__ */ jsx14(
5110
+ EmptyState,
5111
+ {
5112
+ title: openOrdersLabels.emptyTitle,
5113
+ description: openOrdersLabels.emptyDescription
5114
+ }
5115
+ ),
5116
+ isLoadingMoreOpenOrders ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: openOrdersLabels.loadingMore }) : null,
5117
+ hasMoreOpenOrders ? /* @__PURE__ */ jsx14(
5118
+ "div",
5119
+ {
5120
+ ref: openOrdersLoadMoreRef,
5121
+ className: "agg-open-orders-sentinel h-px w-full",
5122
+ "aria-hidden": true
5123
+ }
5124
+ ) : null
5125
+ ] }) : /* @__PURE__ */ jsxs13("div", { className: "agg-activity-list flex flex-col gap-5", children: [
5126
+ isLoadingActivities && filteredActivities.length === 0 ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: "Loading activity" }) : activitiesError && filteredActivities.length === 0 ? /* @__PURE__ */ jsx14(
4864
5127
  EmptyState,
4865
5128
  {
4866
5129
  title: "Unable to load activity",
4867
5130
  description: "Please try again in a moment."
4868
5131
  }
4869
- ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ jsxs12(Fragment4, { children: [
4870
- index > 0 ? /* @__PURE__ */ jsx13(
5132
+ ) : filteredActivities.length > 0 ? filteredActivities.map((activity, index) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
5133
+ index > 0 ? /* @__PURE__ */ jsx14(
4871
5134
  "div",
4872
5135
  {
4873
5136
  className: "agg-activity-divider h-px w-full shrink-0 bg-agg-separator",
4874
5137
  "aria-hidden": true
4875
5138
  }
4876
5139
  ) : null,
4877
- /* @__PURE__ */ jsx13(
5140
+ /* @__PURE__ */ jsx14(
4878
5141
  ActivityRow,
4879
5142
  {
4880
5143
  activity,
@@ -4882,15 +5145,15 @@ var PositionsActivity = ({
4882
5145
  onClick: onActivityClick
4883
5146
  }
4884
5147
  )
4885
- ] }, activity.id)) : /* @__PURE__ */ jsx13(
5148
+ ] }, activity.id)) : /* @__PURE__ */ jsx14(
4886
5149
  EmptyState,
4887
5150
  {
4888
5151
  title: "No activity yet",
4889
5152
  description: "Your trading activity will appear here."
4890
5153
  }
4891
5154
  ),
4892
- isLoadingMoreActivities ? /* @__PURE__ */ jsx13(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
4893
- hasMoreActivities ? /* @__PURE__ */ jsx13(
5155
+ isLoadingMoreActivities ? /* @__PURE__ */ jsx14(TabRowsSkeleton, { ariaLabel: "Loading more activity" }) : null,
5156
+ hasMoreActivities ? /* @__PURE__ */ jsx14(
4894
5157
  "div",
4895
5158
  {
4896
5159
  ref: activitiesLoadMoreRef,
@@ -4912,14 +5175,15 @@ var PositionsActivity = ({
4912
5175
  PositionsActivity.displayName = "PositionsActivity";
4913
5176
 
4914
5177
  // src/pages/user-profile/components/positions-value-card.tsx
4915
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
5178
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4916
5179
  var PositionsValueCard = ({
4917
- label = "Positions Value",
5180
+ label,
4918
5181
  valueLabel,
4919
5182
  isLoading = false,
4920
- className
5183
+ className,
5184
+ icon
4921
5185
  }) => {
4922
- return /* @__PURE__ */ jsxs13(
5186
+ return /* @__PURE__ */ jsxs14(
4923
5187
  "div",
4924
5188
  {
4925
5189
  className: cn(
@@ -4928,8 +5192,8 @@ var PositionsValueCard = ({
4928
5192
  className
4929
5193
  ),
4930
5194
  children: [
4931
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
4932
- /* @__PURE__ */ jsx14(
5195
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
5196
+ icon != null ? icon : /* @__PURE__ */ jsx15(
4933
5197
  "svg",
4934
5198
  {
4935
5199
  xmlns: "http://www.w3.org/2000/svg",
@@ -4937,18 +5201,19 @@ var PositionsValueCard = ({
4937
5201
  height: "16",
4938
5202
  viewBox: "0 0 16 16",
4939
5203
  fill: "none",
4940
- children: /* @__PURE__ */ jsx14(
5204
+ "aria-hidden": "true",
5205
+ children: /* @__PURE__ */ jsx15(
4941
5206
  "path",
4942
5207
  {
4943
5208
  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",
4944
- fill: "#9D9FAF"
5209
+ className: "fill-agg-muted-foreground"
4945
5210
  }
4946
5211
  )
4947
5212
  }
4948
5213
  ),
4949
- /* @__PURE__ */ jsx14("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
5214
+ /* @__PURE__ */ jsx15("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
4950
5215
  ] }),
4951
- /* @__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 })
5216
+ /* @__PURE__ */ jsx15("div", { className: "agg-portfolio-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ jsx15("div", { role: "status", "aria-label": "Loading positions value", children: /* @__PURE__ */ jsx15(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel })
4952
5217
  ]
4953
5218
  }
4954
5219
  );
@@ -4977,7 +5242,7 @@ var buildAggTxExplorerHref = (chainId, txHash) => {
4977
5242
  };
4978
5243
 
4979
5244
  // src/pages/user-profile/components/user-info-card.tsx
4980
- import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels9 } from "@agg-build/hooks";
5245
+ import { optimizedImageUrl as optimizedImageUrl4, useLabels as useLabels10 } from "@agg-build/hooks";
4981
5246
 
4982
5247
  // src/primitives/conditional-wrapper.tsx
4983
5248
  var ConditionalWrapper = ({
@@ -4988,9 +5253,9 @@ var ConditionalWrapper = ({
4988
5253
  ConditionalWrapper.displayName = "ConditionalWrapper";
4989
5254
 
4990
5255
  // src/pages/user-profile/components/default-avatar.tsx
4991
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5256
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
4992
5257
  var DefaultAvatar = ({ className }) => {
4993
- return /* @__PURE__ */ jsxs14(
5258
+ return /* @__PURE__ */ jsxs15(
4994
5259
  "svg",
4995
5260
  {
4996
5261
  xmlns: "http://www.w3.org/2000/svg",
@@ -5001,15 +5266,15 @@ var DefaultAvatar = ({ className }) => {
5001
5266
  className: cn("shrink-0 text-agg-muted-foreground", className),
5002
5267
  "aria-hidden": true,
5003
5268
  children: [
5004
- /* @__PURE__ */ jsxs14("g", { clipPath: "url(#clip0_default_avatar)", children: [
5005
- /* @__PURE__ */ jsx15(
5269
+ /* @__PURE__ */ jsxs15("g", { clipPath: "url(#clip0_default_avatar)", children: [
5270
+ /* @__PURE__ */ jsx16(
5006
5271
  "path",
5007
5272
  {
5008
5273
  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",
5009
5274
  fill: "var(--agg-color-secondary-hover)"
5010
5275
  }
5011
5276
  ),
5012
- /* @__PURE__ */ jsx15(
5277
+ /* @__PURE__ */ jsx16(
5013
5278
  "path",
5014
5279
  {
5015
5280
  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",
@@ -5017,7 +5282,7 @@ var DefaultAvatar = ({ className }) => {
5017
5282
  fillOpacity: "0.12"
5018
5283
  }
5019
5284
  ),
5020
- /* @__PURE__ */ jsx15(
5285
+ /* @__PURE__ */ jsx16(
5021
5286
  "path",
5022
5287
  {
5023
5288
  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",
@@ -5026,7 +5291,7 @@ var DefaultAvatar = ({ className }) => {
5026
5291
  }
5027
5292
  )
5028
5293
  ] }),
5029
- /* @__PURE__ */ jsx15("defs", { children: /* @__PURE__ */ jsx15("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx15("rect", { width: "120", height: "120", fill: "white" }) }) })
5294
+ /* @__PURE__ */ jsx16("defs", { children: /* @__PURE__ */ jsx16("clipPath", { id: "clip0_default_avatar", children: /* @__PURE__ */ jsx16("rect", { width: "120", height: "120", fill: "white" }) }) })
5030
5295
  ]
5031
5296
  }
5032
5297
  );
@@ -5034,7 +5299,7 @@ var DefaultAvatar = ({ className }) => {
5034
5299
  DefaultAvatar.displayName = "DefaultAvatar";
5035
5300
 
5036
5301
  // src/pages/user-profile/components/user-info-card.tsx
5037
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
5302
+ import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
5038
5303
  var UserInfoCard = ({
5039
5304
  user,
5040
5305
  onEditProfile,
@@ -5044,10 +5309,10 @@ var UserInfoCard = ({
5044
5309
  className
5045
5310
  }) => {
5046
5311
  var _a;
5047
- const labels = useLabels9();
5312
+ const labels = useLabels10();
5048
5313
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
5049
5314
  const hasWallets = wallets.length > 0;
5050
- return /* @__PURE__ */ jsxs15(
5315
+ return /* @__PURE__ */ jsxs16(
5051
5316
  "div",
5052
5317
  {
5053
5318
  className: cn(
@@ -5056,26 +5321,26 @@ var UserInfoCard = ({
5056
5321
  className
5057
5322
  ),
5058
5323
  children: [
5059
- /* @__PURE__ */ jsxs15("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
5060
- /* @__PURE__ */ jsx16("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ jsx16(
5324
+ /* @__PURE__ */ jsxs16("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
5325
+ /* @__PURE__ */ jsx17("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ jsx17(
5061
5326
  RemoteImage,
5062
5327
  {
5063
- src: optimizedImageUrl3(user.avatarUrl, 120),
5328
+ src: optimizedImageUrl4(user.avatarUrl, 120),
5064
5329
  alt: user.username,
5065
5330
  className: "h-20 w-20 rounded-full object-cover sm:h-[120px] sm:w-[120px]"
5066
5331
  }
5067
- ) : /* @__PURE__ */ jsx16(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
5068
- /* @__PURE__ */ jsxs15("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
5069
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
5070
- /* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-center gap-2", children: [
5071
- /* @__PURE__ */ jsx16("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
5072
- user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ jsx16("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
5332
+ ) : /* @__PURE__ */ jsx17(DefaultAvatar, { className: "h-20 w-20 rounded-full sm:h-[120px] sm:w-[120px]" }) }),
5333
+ /* @__PURE__ */ jsxs16("div", { className: "agg-profile-details flex min-w-0 w-full flex-1 flex-col gap-3 sm:gap-4", children: [
5334
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center justify-between gap-3 sm:gap-4", children: [
5335
+ /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 items-center gap-2", children: [
5336
+ /* @__PURE__ */ jsx17("h2", { className: "truncate text-[22px] leading-7 font-agg-bold text-agg-foreground sm:agg-type-heading", children: user.username }),
5337
+ user.socialLinks && user.socialLinks.length > 0 ? /* @__PURE__ */ jsx17("div", { className: "agg-profile-social-links flex items-center gap-2", children: user.socialLinks.map((social) => {
5073
5338
  const iconName = social.platform === "twitter" ? "twitter" : social.platform === "discord" ? "discord" : "telegram";
5074
- 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" }) });
5339
+ const iconNode = /* @__PURE__ */ jsx17("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__ */ jsx17(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) });
5075
5340
  if (!social.handle) {
5076
- return /* @__PURE__ */ jsx16("span", { children: iconNode }, `${social.platform}-icon`);
5341
+ return /* @__PURE__ */ jsx17("span", { children: iconNode }, `${social.platform}-icon`);
5077
5342
  }
5078
- return /* @__PURE__ */ jsx16(
5343
+ return /* @__PURE__ */ jsx17(
5079
5344
  "a",
5080
5345
  {
5081
5346
  href: social.handle,
@@ -5088,55 +5353,55 @@ var UserInfoCard = ({
5088
5353
  );
5089
5354
  }) }) : null
5090
5355
  ] }),
5091
- onEditProfile ? /* @__PURE__ */ jsxs15(
5356
+ onEditProfile ? /* @__PURE__ */ jsxs16(
5092
5357
  "button",
5093
5358
  {
5094
5359
  type: "button",
5095
5360
  onClick: onEditProfile,
5096
5361
  className: "hidden sm:flex shrink-0 cursor-pointer items-center gap-1.5 bg-transparent text-agg-primary hover:opacity-80",
5097
5362
  children: [
5098
- /* @__PURE__ */ jsx16(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
5099
- /* @__PURE__ */ jsx16("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
5363
+ /* @__PURE__ */ jsx17(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
5364
+ /* @__PURE__ */ jsx17("span", { className: "text-agg-base font-agg-bold leading-6", children: "Edit" })
5100
5365
  ]
5101
5366
  }
5102
5367
  ) : null
5103
5368
  ] }),
5104
- hasWallets || !!user.socialHandle ? /* @__PURE__ */ jsxs15("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
5369
+ hasWallets || !!user.socialHandle ? /* @__PURE__ */ jsxs16("div", { className: "agg-profile-accounts flex w-full flex-col gap-2.5 sm:gap-3", children: [
5105
5370
  wallets.map((wallet, idx) => {
5106
5371
  const chainLower = wallet.chain.toLowerCase();
5107
5372
  const iconName = chainLower === "solana" || chainLower === "svm" ? "solana" : "ethereum";
5108
- return /* @__PURE__ */ jsxs15(
5373
+ return /* @__PURE__ */ jsxs16(
5109
5374
  "div",
5110
5375
  {
5111
5376
  className: "flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",
5112
5377
  children: [
5113
- /* @__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" }) }),
5114
- /* @__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 })
5378
+ /* @__PURE__ */ jsx17("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx17(Icon, { name: iconName, size: "small", className: "text-agg-foreground" }) }),
5379
+ /* @__PURE__ */ jsx17("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 })
5115
5380
  ]
5116
5381
  },
5117
5382
  `wallet-${idx}`
5118
5383
  );
5119
5384
  }),
5120
- 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
5385
+ user.socialHandle ? /* @__PURE__ */ jsx17("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: /* @__PURE__ */ jsx17("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
5121
5386
  ] }) : null
5122
5387
  ] })
5123
5388
  ] }),
5124
- (onDeposit || onWithdraw) && /* @__PURE__ */ jsxs15("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
5125
- onDeposit ? /* @__PURE__ */ jsx16(
5389
+ (onDeposit || onWithdraw) && /* @__PURE__ */ jsxs16("div", { className: "agg-profile-actions flex w-full flex-1 items-center gap-3 py-5", children: [
5390
+ onDeposit ? /* @__PURE__ */ jsx17(
5126
5391
  ConditionalWrapper,
5127
5392
  {
5128
5393
  condition: isDepositBlocked,
5129
- wrapper: (children) => /* @__PURE__ */ jsx16(
5394
+ wrapper: (children) => /* @__PURE__ */ jsx17(
5130
5395
  Tooltip,
5131
5396
  {
5132
- content: /* @__PURE__ */ jsx16("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
5397
+ content: /* @__PURE__ */ jsx17("p", { className: "text-center", children: labels.auth.depositGeoBlocked }),
5133
5398
  size: "small",
5134
5399
  side: "bottom",
5135
5400
  sideOffset: 4,
5136
5401
  children
5137
5402
  }
5138
5403
  ),
5139
- children: /* @__PURE__ */ jsx16(
5404
+ children: /* @__PURE__ */ jsx17(
5140
5405
  Button,
5141
5406
  __spreadProps(__spreadValues({
5142
5407
  variant: "primary",
@@ -5148,7 +5413,7 @@ var UserInfoCard = ({
5148
5413
  )
5149
5414
  }
5150
5415
  ) : null,
5151
- onWithdraw ? /* @__PURE__ */ jsx16(
5416
+ onWithdraw ? /* @__PURE__ */ jsx17(
5152
5417
  Button,
5153
5418
  {
5154
5419
  variant: "secondary",
@@ -5158,15 +5423,15 @@ var UserInfoCard = ({
5158
5423
  children: labels.auth.withdraw
5159
5424
  }
5160
5425
  ) : null,
5161
- onEditProfile ? /* @__PURE__ */ jsxs15(
5426
+ onEditProfile ? /* @__PURE__ */ jsxs16(
5162
5427
  "button",
5163
5428
  {
5164
5429
  type: "button",
5165
5430
  onClick: onEditProfile,
5166
5431
  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",
5167
5432
  children: [
5168
- /* @__PURE__ */ jsx16(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
5169
- /* @__PURE__ */ jsx16("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
5433
+ /* @__PURE__ */ jsx17(Icon, { name: "pencil", size: "small", className: "text-agg-primary" }),
5434
+ /* @__PURE__ */ jsx17("span", { className: "text-agg-sm font-agg-bold leading-5", children: "Edit" })
5170
5435
  ]
5171
5436
  }
5172
5437
  ) : null
@@ -5178,7 +5443,7 @@ var UserInfoCard = ({
5178
5443
  UserInfoCard.displayName = "UserInfoCard";
5179
5444
 
5180
5445
  // src/pages/user-profile/index.tsx
5181
- import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
5446
+ import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
5182
5447
  var currencyFormatter = new Intl.NumberFormat("en-US", {
5183
5448
  style: "currency",
5184
5449
  currency: "USD",
@@ -5202,6 +5467,9 @@ var twoDecimalUsdFormatter = new Intl.NumberFormat("en-US", {
5202
5467
  minimumFractionDigits: 2,
5203
5468
  maximumFractionDigits: 2
5204
5469
  });
5470
+ var limitPriceCentsFormatter = new Intl.NumberFormat("en-US", {
5471
+ maximumFractionDigits: 1
5472
+ });
5205
5473
  var DEFAULT_TOKEN_DECIMALS = 6;
5206
5474
  var LEGACY_TWELVE_DECIMAL_SCALE = BigInt("1000000000000");
5207
5475
  var TOKEN_DECIMALS_BY_SYMBOL = {
@@ -5241,6 +5509,29 @@ var formatScaledNumberTwoDecimals = (value) => {
5241
5509
  if (parsed == null) return "0.00";
5242
5510
  return twoDecimalNumberFormatter.format(parsed);
5243
5511
  };
5512
+ var formatLimitPriceLabel = (value) => {
5513
+ const parsed = parseRawMicroValue(value);
5514
+ if (parsed == null) return void 0;
5515
+ return `${limitPriceCentsFormatter.format(parsed * 100)}\xA2`;
5516
+ };
5517
+ var formatOpenOrderExpirationLabel = ({
5518
+ timeInForce,
5519
+ expiresAt,
5520
+ goodTilCanceledLabel,
5521
+ expiredLabel
5522
+ }) => {
5523
+ if (timeInForce === "GTC") return goodTilCanceledLabel;
5524
+ if (!expiresAt) return void 0;
5525
+ const expiration = dayjs(expiresAt);
5526
+ if (!expiration.isValid()) return void 0;
5527
+ const now = dayjs();
5528
+ const remainingMinutes = expiration.diff(now, "minute", true);
5529
+ if (remainingMinutes <= 0) return expiredLabel;
5530
+ if (remainingMinutes < 60) return `${Math.ceil(remainingMinutes)}m`;
5531
+ const remainingHours = expiration.diff(now, "hour", true);
5532
+ if (remainingHours < 24) return `${Math.ceil(remainingHours)}h`;
5533
+ return `${Math.ceil(expiration.diff(now, "day", true))}d`;
5534
+ };
5244
5535
  var getTokenDecimals = (tokenSymbol, chainId) => {
5245
5536
  var _a;
5246
5537
  const normalizedSymbol = tokenSymbol.trim().toUpperCase();
@@ -5374,8 +5665,21 @@ var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set([
5374
5665
  "signing",
5375
5666
  "pending_bridge",
5376
5667
  "submitting",
5377
- "submitted"
5668
+ "submitted",
5669
+ "open",
5670
+ "partially_filled_open",
5671
+ "cancel_pending"
5378
5672
  ]);
5673
+ var OPEN_ORDER_QUERY_STATUSES = [
5674
+ "pending",
5675
+ "signing",
5676
+ "pending_bridge",
5677
+ "submitting",
5678
+ "submitted",
5679
+ "open",
5680
+ "partially_filled_open",
5681
+ "cancel_pending"
5682
+ ];
5379
5683
  var SHOW_SOLD_POSITIONS = false;
5380
5684
  var SOLD_POSITION_SHARES_THRESHOLD = 0.1;
5381
5685
  var isOpenOrderStatus = (status) => OPEN_ORDER_STATUSES.has(status.toLowerCase());
@@ -5452,7 +5756,8 @@ var isVisibleActivityItem = (item) => {
5452
5756
  if (item.type === "trade") {
5453
5757
  const tradeItem = item;
5454
5758
  if (isOpenOrderStatus(tradeItem.status)) return false;
5455
- if (tradeItem.status.toLowerCase() === "failed" && ((_a = parseRawMicroValue(tradeItem.filledAmountRaw)) != null ? _a : 0) <= 0)
5759
+ const normalizedStatus = tradeItem.status.toLowerCase();
5760
+ if ((normalizedStatus === "failed" || TRANSFER_CANCELED_STATUSES.has(normalizedStatus)) && ((_a = parseRawMicroValue(tradeItem.filledAmountRaw)) != null ? _a : 0) <= 0)
5456
5761
  return false;
5457
5762
  }
5458
5763
  return true;
@@ -5610,6 +5915,7 @@ var UserProfilePage = ({
5610
5915
  onActivityClick,
5611
5916
  getActivityHref,
5612
5917
  onOpenOrderClick,
5918
+ getOpenOrderHref,
5613
5919
  onCancelOrder,
5614
5920
  cancellingOrderIds,
5615
5921
  isLoadingPositions,
@@ -5634,6 +5940,7 @@ var UserProfilePage = ({
5634
5940
  classNames,
5635
5941
  onError
5636
5942
  }) => {
5943
+ var _a, _b;
5637
5944
  const [isHydrated, setIsHydrated] = useState11(false);
5638
5945
  useEffect10(() => {
5639
5946
  setIsHydrated(true);
@@ -5641,12 +5948,14 @@ var UserProfilePage = ({
5641
5948
  const { user: currentUser, isAuthenticated } = useAggAuthState();
5642
5949
  const { isDepositBlocked } = useGeoBlock();
5643
5950
  const balanceState = useAggBalance();
5644
- const client = useAggClient();
5645
- const labels = useLabels10();
5951
+ const labels = useLabels11();
5646
5952
  const {
5953
+ features: { showLimitOrders },
5647
5954
  trading: { executionMode: configuredExecutionMode }
5648
5955
  } = useSdkUiConfig5();
5649
- const queryClient = useQueryClient();
5956
+ const client = useAggClient();
5957
+ const cancelOrderMutation = useCancelManagedOrder();
5958
+ const toastContext = useOptionalToast();
5650
5959
  const [internalCancellingIds, setInternalCancellingIds] = useState11({});
5651
5960
  const { claim: startClaim, claimingKeys } = useClaimWinnings({
5652
5961
  onClaim,
@@ -5657,9 +5966,9 @@ var UserProfilePage = ({
5657
5966
  const [profileUser, setProfileUser] = useState11(void 0);
5658
5967
  const shouldUseHookData = !user;
5659
5968
  const connectedVenues = useMemo7(() => {
5660
- var _a;
5969
+ var _a2;
5661
5970
  if (!shouldUseHookData) return [];
5662
- const fromBalance = (_a = balanceState.connectedVenues) != null ? _a : [];
5971
+ const fromBalance = (_a2 = balanceState.connectedVenues) != null ? _a2 : [];
5663
5972
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
5664
5973
  }, [balanceState, shouldUseHookData]);
5665
5974
  const [positionFilter, setPositionFilter] = useState11(initialPositionFilter);
@@ -5691,8 +6000,79 @@ var UserProfilePage = ({
5691
6000
  const ordersQuery = useExecutionOrders({
5692
6001
  enabled: shouldUseHookData && isAuthenticated,
5693
6002
  limit: 25,
6003
+ mode: queryExecutionMode,
6004
+ refetchIntervalMs: 5e3
6005
+ });
6006
+ const pendingOpenOrdersQuery = useExecutionOrders({
6007
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6008
+ status: OPEN_ORDER_QUERY_STATUSES[0],
6009
+ limit: 25,
5694
6010
  mode: queryExecutionMode
5695
6011
  });
6012
+ const signingOpenOrdersQuery = useExecutionOrders({
6013
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6014
+ status: OPEN_ORDER_QUERY_STATUSES[1],
6015
+ limit: 25,
6016
+ mode: queryExecutionMode
6017
+ });
6018
+ const pendingBridgeOpenOrdersQuery = useExecutionOrders({
6019
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6020
+ status: OPEN_ORDER_QUERY_STATUSES[2],
6021
+ limit: 25,
6022
+ mode: queryExecutionMode
6023
+ });
6024
+ const submittingOpenOrdersQuery = useExecutionOrders({
6025
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6026
+ status: OPEN_ORDER_QUERY_STATUSES[3],
6027
+ limit: 25,
6028
+ mode: queryExecutionMode
6029
+ });
6030
+ const submittedOpenOrdersQuery = useExecutionOrders({
6031
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6032
+ status: OPEN_ORDER_QUERY_STATUSES[4],
6033
+ limit: 25,
6034
+ mode: queryExecutionMode
6035
+ });
6036
+ const openOpenOrdersQuery = useExecutionOrders({
6037
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6038
+ status: OPEN_ORDER_QUERY_STATUSES[5],
6039
+ limit: 25,
6040
+ mode: queryExecutionMode
6041
+ });
6042
+ const partiallyFilledOpenOrdersQuery = useExecutionOrders({
6043
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6044
+ status: OPEN_ORDER_QUERY_STATUSES[6],
6045
+ limit: 25,
6046
+ mode: queryExecutionMode
6047
+ });
6048
+ const cancelPendingOpenOrdersQuery = useExecutionOrders({
6049
+ enabled: shouldUseHookData && isAuthenticated && !openOrders,
6050
+ status: OPEN_ORDER_QUERY_STATUSES[7],
6051
+ limit: 25,
6052
+ mode: queryExecutionMode
6053
+ });
6054
+ const openOrderQueries = useMemo7(
6055
+ () => [
6056
+ pendingOpenOrdersQuery,
6057
+ signingOpenOrdersQuery,
6058
+ pendingBridgeOpenOrdersQuery,
6059
+ submittingOpenOrdersQuery,
6060
+ submittedOpenOrdersQuery,
6061
+ openOpenOrdersQuery,
6062
+ partiallyFilledOpenOrdersQuery,
6063
+ cancelPendingOpenOrdersQuery
6064
+ ],
6065
+ [
6066
+ cancelPendingOpenOrdersQuery,
6067
+ openOpenOrdersQuery,
6068
+ partiallyFilledOpenOrdersQuery,
6069
+ pendingBridgeOpenOrdersQuery,
6070
+ pendingOpenOrdersQuery,
6071
+ signingOpenOrdersQuery,
6072
+ submittedOpenOrdersQuery,
6073
+ submittingOpenOrdersQuery
6074
+ ]
6075
+ );
5696
6076
  const activityQuery = useUserActivity({
5697
6077
  enabled: shouldUseHookData && isAuthenticated,
5698
6078
  limit: 25
@@ -5705,24 +6085,37 @@ var UserProfilePage = ({
5705
6085
  }
5706
6086
  setInternalCancellingIds((prev) => __spreadProps(__spreadValues({}, prev), { [order.id]: true }));
5707
6087
  try {
5708
- yield client.cancelManagedOrder(order.id);
5709
- yield queryClient.invalidateQueries({ queryKey: ["execution-orders"] });
6088
+ const cancellationResult = yield cancelOrderMutation.mutateAsync(order.id);
6089
+ const isCancellationPending = cancellationResult.status === "cancel_pending";
6090
+ toastContext == null ? void 0 : toastContext.toast(
6091
+ isCancellationPending ? labels.notifications.order.cancelPendingMessage : labels.notifications.order.cancelledMessage,
6092
+ {
6093
+ title: isCancellationPending ? labels.notifications.order.cancelPendingTitle : labels.notifications.order.cancelledTitle,
6094
+ tone: "success"
6095
+ }
6096
+ );
6097
+ } catch (error) {
6098
+ const errorReason = error instanceof Error ? error.message : void 0;
6099
+ toastContext == null ? void 0 : toastContext.toast(labels.notifications.order.cancelFailedMessage(errorReason), {
6100
+ title: labels.notifications.order.cancelFailedTitle,
6101
+ tone: "error"
6102
+ });
5710
6103
  } finally {
5711
6104
  setInternalCancellingIds((prev) => {
5712
- var _a;
5713
- const _b = prev, { [_a = order.id]: _removed } = _b, rest = __objRest(_b, [__restKey(_a)]);
6105
+ var _a2;
6106
+ const _b2 = prev, { [_a2 = order.id]: _removed } = _b2, rest = __objRest(_b2, [__restKey(_a2)]);
5714
6107
  return rest;
5715
6108
  });
5716
6109
  }
5717
6110
  }),
5718
- [client, onCancelOrder, queryClient]
6111
+ [cancelOrderMutation, labels.notifications.order, onCancelOrder, toastContext]
5719
6112
  );
5720
6113
  const handleClaimPosition = useCallback5(
5721
6114
  (position) => {
5722
- var _a, _b;
6115
+ var _a2, _b2;
5723
6116
  return startClaim({
5724
- claimKey: (_a = position.marketId) != null ? _a : position.id,
5725
- winningOutcomeIds: (_b = position.winningOutcomeIds) != null ? _b : [],
6117
+ claimKey: (_a2 = position.marketId) != null ? _a2 : position.id,
6118
+ winningOutcomeIds: (_b2 = position.winningOutcomeIds) != null ? _b2 : [],
5726
6119
  payload: position
5727
6120
  });
5728
6121
  },
@@ -5764,22 +6157,22 @@ var UserProfilePage = ({
5764
6157
  };
5765
6158
  }, [client, currentUser, isAuthenticated, shouldUseHookData]);
5766
6159
  const resolvedUser = useMemo7(() => {
5767
- var _a, _b, _c, _d, _e, _f;
6160
+ var _a2, _b2, _c, _d, _e, _f;
5768
6161
  if (user) return user;
5769
6162
  const fullUser = profileUser != null ? profileUser : currentUser;
5770
6163
  const walletAddress = getWalletAddressFromUserProfile(fullUser);
5771
6164
  const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
5772
- const twitterAccount = (_a = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a.find(
6165
+ const twitterAccount = (_a2 = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a2.find(
5773
6166
  (account) => String(account.provider).toLowerCase() === "twitter"
5774
6167
  );
5775
- const normalizedTwitterHandle = (_b = twitterAccount == null ? void 0 : twitterAccount.providerAccountId) == null ? void 0 : _b.replace(/^@/, "");
6168
+ const normalizedTwitterHandle = (_b2 = twitterAccount == null ? void 0 : twitterAccount.providerAccountId) == null ? void 0 : _b2.replace(/^@/, "");
5776
6169
  const walletAccounts = (_d = (_c = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _c.filter((a) => a.provider === "wallet" || a.provider === "solana_wallet")) != null ? _d : [];
5777
6170
  const connectedWallets = walletAccounts.map((a) => {
5778
- var _a2;
6171
+ var _a3;
5779
6172
  const chain = a.provider === "solana_wallet" ? "solana" : "evm";
5780
6173
  return {
5781
6174
  chain,
5782
- displayAddress: (_a2 = shortenAddress(a.providerAccountId, { chain })) != null ? _a2 : a.providerAccountId
6175
+ displayAddress: (_a3 = shortenAddress(a.providerAccountId, { chain })) != null ? _a3 : a.providerAccountId
5783
6176
  };
5784
6177
  });
5785
6178
  return {
@@ -5806,24 +6199,35 @@ var UserProfilePage = ({
5806
6199
  }));
5807
6200
  }, [_venueBalances, balanceState.balanceBreakdown]);
5808
6201
  const positionsValueLabel = useMemo7(() => {
5809
- var _a;
6202
+ var _a2;
5810
6203
  if (balance == null ? void 0 : balance.totalLabel) return balance.totalLabel;
5811
6204
  const managed = balanceState.managedBalances;
5812
- const positions = (_a = managed == null ? void 0 : managed.positions) != null ? _a : [];
6205
+ const positions = (_a2 = managed == null ? void 0 : managed.positions) != null ? _a2 : [];
5813
6206
  const positionsValueTotal = positions.reduce((sum, p) => sum + (Number(p.balance) || 0), 0);
5814
6207
  return formatUsd(positionsValueTotal);
5815
6208
  }, [balance, balanceState]);
5816
6209
  const availableBalanceLabel = useMemo7(() => {
5817
- var _a;
5818
- return formatUsd((_a = balanceState.totalBalance) != null ? _a : 0);
5819
- }, [balanceState.totalBalance]);
6210
+ var _a2, _b2;
6211
+ return formatUsd((_b2 = (_a2 = balanceState.availableBalance) != null ? _a2 : balanceState.totalBalance) != null ? _b2 : 0);
6212
+ }, [balanceState.availableBalance, balanceState.totalBalance]);
6213
+ const reservedBalanceLabel = useMemo7(() => {
6214
+ var _a2;
6215
+ const reserved = (_a2 = balanceState.reservedBalance) != null ? _a2 : 0;
6216
+ return reserved > 0 ? formatUsd(reserved) : void 0;
6217
+ }, [balanceState.reservedBalance]);
6218
+ const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig2();
6219
+ const isKalshiAvailable = getVenueAvailabilityState({
6220
+ venueId: Venue2.kalshi,
6221
+ disabledVenues,
6222
+ isConfigLoading: isAppConfigLoading
6223
+ }) === "available";
5820
6224
  const isPositionsValueLoading = !(balance == null ? void 0 : balance.totalLabel) && balanceState.isLoading;
5821
6225
  const isAvailableBalanceLoading = balanceState.isLoading;
5822
6226
  const resolvedActivities = useMemo7(() => {
5823
6227
  if (activities) return activities.filter(isVisibleUserProfileActivity);
5824
6228
  const formatTime = isHydrated ? toRelativeTimeLabel : toAbsoluteTimeLabel;
5825
6229
  return activityQuery.activities.filter(isVisibleActivityItem).map((item, index) => {
5826
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G;
6230
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G;
5827
6231
  const timeLabel = formatTime(getRuntimeActivityCreatedAt(item));
5828
6232
  if (item.type === "trade") {
5829
6233
  const tradeItem = item;
@@ -5832,7 +6236,7 @@ var UserProfilePage = ({
5832
6236
  const status = normalizeTradeStatus(tradeItem.status);
5833
6237
  const isFailed = tradeItem.status.toLowerCase() === "failed";
5834
6238
  const hasError = hasActivityError(tradeItem);
5835
- const eventId = (_b = (_a = tradeItem.venueMarket) == null ? void 0 : _a.venueEventId) != null ? _b : void 0;
6239
+ const eventId = (_b2 = (_a2 = tradeItem.venueMarket) == null ? void 0 : _a2.venueEventId) != null ? _b2 : void 0;
5836
6240
  const marketId = (_d = (_c = tradeItem.venueMarket) == null ? void 0 : _c.id) != null ? _d : void 0;
5837
6241
  const marketQuestion = (_g = (_f = (_e = tradeItem.venueMarket) == null ? void 0 : _e.question) != null ? _f : tradeItem.marketQuestion) != null ? _g : "Market";
5838
6242
  const outcomeLabel = (_l = (_k = (_j = (_h = tradeItem.venueMarketOutcome) == null ? void 0 : _h.title) != null ? _j : (_i = tradeItem.venueMarketOutcome) == null ? void 0 : _i.label) != null ? _k : tradeItem.outcomeLabel) != null ? _l : "";
@@ -5972,35 +6376,82 @@ var UserProfilePage = ({
5972
6376
  }, [activities, activityQuery.activities, isHydrated, labels, ordersQuery.orders]);
5973
6377
  const resolvedOpenOrders = useMemo7(() => {
5974
6378
  if (openOrders) return openOrders;
5975
- return ordersQuery.orders.filter((order) => isOpenOrderStatus(order.status)).map((order) => {
5976
- var _a, _b, _c, _d, _e, _f, _g;
5977
- return {
6379
+ const orderRowsById = /* @__PURE__ */ new Map();
6380
+ for (const query of openOrderQueries) {
6381
+ for (const order of query.orders) {
6382
+ orderRowsById.set(order.id, order);
6383
+ }
6384
+ }
6385
+ return Array.from(orderRowsById.values()).filter((order) => isOpenOrderStatus(order.status)).sort(
6386
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
6387
+ ).map((order) => {
6388
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
6389
+ const isLimitOrder = order.orderType === "limit" || order.limitSizeRaw != null;
6390
+ const filledRaw = isLimitOrder ? order.filledSizeRaw : order.filledAmountRaw;
6391
+ const totalRaw = isLimitOrder ? order.limitSizeRaw : order.amountRaw;
6392
+ const totalCostRaw = isLimitOrder ? (_a2 = order.reservedCostRaw) != null ? _a2 : order.amountRaw : order.amountRaw;
6393
+ const limitPriceLabel = formatLimitPriceLabel(order.limitPriceRaw);
6394
+ const expirationLabel = formatOpenOrderExpirationLabel({
6395
+ timeInForce: order.timeInForce,
6396
+ expiresAt: order.expiresAt,
6397
+ goodTilCanceledLabel: labels.userProfile.openOrders.goodTilCanceled,
6398
+ expiredLabel: labels.userProfile.openOrders.expired
6399
+ });
6400
+ return __spreadProps(__spreadValues(__spreadProps(__spreadValues({
5978
6401
  id: order.id,
5979
- thumbnailSrc: (_b = (_a = order.venueMarket) == null ? void 0 : _a.image) != null ? _b : fallbackThumbnailSrc,
5980
- title: ((_c = order.venueMarket) == null ? void 0 : _c.question) || "Market",
5981
- outcomeLabel: ((_d = order.venueMarketOutcome) == null ? void 0 : _d.title) || ((_e = order.venueMarketOutcome) == null ? void 0 : _e.label) || "Outcome",
5982
- venue: order.venue,
5983
- filledLabel: `${formatScaledNumberTwoDecimals((_f = order.filledAmountRaw) != null ? _f : "0")}/${formatScaledNumberTwoDecimals(order.amountRaw)}`,
5984
- valueLabel: formatFilledUsdTwoDecimals(order.filledAmountRaw),
6402
+ eventId: (_c = (_b2 = order.venueMarket) == null ? void 0 : _b2.venueEventId) != null ? _c : void 0,
6403
+ marketId: (_e = (_d = order.venueMarket) == null ? void 0 : _d.id) != null ? _e : void 0,
6404
+ thumbnailSrc: (_g = (_f = order.venueMarket) == null ? void 0 : _f.image) != null ? _g : fallbackThumbnailSrc,
6405
+ title: ((_h = order.venueMarket) == null ? void 0 : _h.question) || "Market",
6406
+ outcomeLabel: ((_i = order.venueMarketOutcome) == null ? void 0 : _i.title) || ((_j = order.venueMarketOutcome) == null ? void 0 : _j.label) || "Outcome",
6407
+ venue: order.venue
6408
+ }, limitPriceLabel ? { limitPriceLabel } : {}), {
6409
+ filledLabel: `${formatScaledNumberTwoDecimals(filledRaw != null ? filledRaw : "0")}/${formatScaledNumberTwoDecimals(totalRaw)}`,
6410
+ valueLabel: formatFilledUsdTwoDecimals(totalCostRaw)
6411
+ }), expirationLabel ? { expirationLabel } : {}), {
5985
6412
  status: order.status,
5986
- dagRunId: (_g = order.dagRunId) != null ? _g : null
5987
- };
6413
+ orderType: isLimitOrder ? "limit" : "market",
6414
+ dagRunId: (_k = order.dagRunId) != null ? _k : null
6415
+ });
5988
6416
  });
5989
- }, [openOrders, ordersQuery.orders]);
6417
+ }, [labels, openOrderQueries, openOrders]);
6418
+ const isOpenOrdersQueryLoading = useMemo7(
6419
+ () => openOrderQueries.some((query) => query.isLoading),
6420
+ [openOrderQueries]
6421
+ );
6422
+ const hasOpenOrdersQueryError = useMemo7(
6423
+ () => openOrderQueries.some((query) => query.error),
6424
+ [openOrderQueries]
6425
+ );
6426
+ const hasMoreOpenOrdersQuery = useMemo7(
6427
+ () => openOrderQueries.some((query) => query.hasNextPage),
6428
+ [openOrderQueries]
6429
+ );
6430
+ const isLoadingMoreOpenOrdersQuery = useMemo7(
6431
+ () => openOrderQueries.some((query) => query.isFetchingNextPage),
6432
+ [openOrderQueries]
6433
+ );
6434
+ const handleLoadMoreOpenOrders = useCallback5(() => {
6435
+ for (const query of openOrderQueries) {
6436
+ if (query.hasNextPage) {
6437
+ void query.fetchNextPage();
6438
+ }
6439
+ }
6440
+ }, [openOrderQueries]);
5990
6441
  const adaptPositionGroups = useCallback5(
5991
6442
  (groups) => {
5992
6443
  return groups.flatMap((group) => {
5993
- var _a, _b, _c, _d;
6444
+ var _a2, _b2, _c, _d;
5994
6445
  const closedTotals = computeClosedPositionTotals(group);
5995
6446
  const winningOutcome = group.venueMarket.venueMarketOutcomes.find(
5996
6447
  (outcome) => outcome.winner === true
5997
6448
  );
5998
- const winningOutcomeLabel = (_b = (_a = winningOutcome == null ? void 0 : winningOutcome.title) != null ? _a : winningOutcome == null ? void 0 : winningOutcome.label) != null ? _b : null;
6449
+ const winningOutcomeLabel = (_b2 = (_a2 = winningOutcome == null ? void 0 : winningOutcome.title) != null ? _a2 : winningOutcome == null ? void 0 : winningOutcome.label) != null ? _b2 : null;
5999
6450
  const venueEventId = (_c = group.venueMarket.venueEventId) != null ? _c : void 0;
6000
6451
  const eventId = (_d = group.eventId) != null ? _d : venueEventId;
6001
6452
  const marketId = group.targetMarketId;
6002
6453
  return group.venueMarket.venueMarketOutcomes.map((outcome) => {
6003
- var _a2, _b2, _c2, _d2;
6454
+ var _a3, _b3, _c2, _d2;
6004
6455
  const isResolved = group.venueMarket.status === "resolved";
6005
6456
  const isUnpriced = outcome.priceSource === "entry";
6006
6457
  const averagePriceCents = Math.round(outcome.avgEntryPrice * 100);
@@ -6018,10 +6469,10 @@ var UserProfilePage = ({
6018
6469
  const pnlPercent = displayPnlPercent == null ? null : displayPnlPercent.toFixed(2);
6019
6470
  const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId) : [];
6020
6471
  return {
6021
- id: `${group.targetMarketId}-${outcome.label}-${(_a2 = outcome.title) != null ? _a2 : ""}`,
6472
+ id: `${group.targetMarketId}-${outcome.label}-${(_a3 = outcome.title) != null ? _a3 : ""}`,
6022
6473
  eventId,
6023
6474
  marketId,
6024
- thumbnailSrc: (_b2 = group.venueMarket.image) != null ? _b2 : fallbackThumbnailSrc,
6475
+ thumbnailSrc: (_b3 = group.venueMarket.image) != null ? _b3 : fallbackThumbnailSrc,
6025
6476
  title: group.venueMarket.question,
6026
6477
  outcomeLabel: ((_c2 = outcome.title) == null ? void 0 : _c2.trim()) || outcome.label,
6027
6478
  resolutionLabel: winningOutcomeLabel,
@@ -6065,7 +6516,7 @@ var UserProfilePage = ({
6065
6516
  const source = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
6066
6517
  return source.filter(shouldIncludeByShares);
6067
6518
  }, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
6068
- return /* @__PURE__ */ jsx17(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx17(
6519
+ return /* @__PURE__ */ jsx18(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx18(
6069
6520
  "section",
6070
6521
  {
6071
6522
  className: cn(
@@ -6073,7 +6524,7 @@ var UserProfilePage = ({
6073
6524
  "w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
6074
6525
  classNames == null ? void 0 : classNames.root
6075
6526
  ),
6076
- children: /* @__PURE__ */ jsxs16(
6527
+ children: /* @__PURE__ */ jsxs17(
6077
6528
  "div",
6078
6529
  {
6079
6530
  className: cn(
@@ -6083,8 +6534,8 @@ var UserProfilePage = ({
6083
6534
  classNames == null ? void 0 : classNames.topRow
6084
6535
  ),
6085
6536
  children: [
6086
- /* @__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: [
6087
- /* @__PURE__ */ jsx17(
6537
+ /* @__PURE__ */ jsxs17("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: [
6538
+ /* @__PURE__ */ jsx18(
6088
6539
  "div",
6089
6540
  {
6090
6541
  className: cn(
@@ -6092,7 +6543,7 @@ var UserProfilePage = ({
6092
6543
  "flex min-w-0 flex-1 flex-col gap-4 sm:gap-6 h-full",
6093
6544
  classNames == null ? void 0 : classNames.leftColumn
6094
6545
  ),
6095
- children: /* @__PURE__ */ jsx17(
6546
+ children: /* @__PURE__ */ jsx18(
6096
6547
  UserInfoCard,
6097
6548
  {
6098
6549
  user: resolvedUser,
@@ -6105,7 +6556,7 @@ var UserProfilePage = ({
6105
6556
  )
6106
6557
  }
6107
6558
  ),
6108
- /* @__PURE__ */ jsxs16(
6559
+ /* @__PURE__ */ jsxs17(
6109
6560
  "div",
6110
6561
  {
6111
6562
  className: cn(
@@ -6113,19 +6564,40 @@ var UserProfilePage = ({
6113
6564
  classNames == null ? void 0 : classNames.rightColumn
6114
6565
  ),
6115
6566
  children: [
6116
- /* @__PURE__ */ jsx17(
6117
- PositionsValueCard,
6567
+ /* @__PURE__ */ jsxs17(
6568
+ "div",
6118
6569
  {
6119
- valueLabel: positionsValueLabel,
6120
- isLoading: isPositionsValueLoading
6570
+ className: cn(
6571
+ "grid gap-4",
6572
+ isKalshiAvailable ? "grid-cols-1 sm:grid-cols-2" : "grid-cols-1"
6573
+ ),
6574
+ children: [
6575
+ /* @__PURE__ */ jsx18(
6576
+ PositionsValueCard,
6577
+ {
6578
+ label: labels.userProfile.balance.positionsValue,
6579
+ valueLabel: positionsValueLabel,
6580
+ isLoading: isPositionsValueLoading
6581
+ }
6582
+ ),
6583
+ isKalshiAvailable ? /* @__PURE__ */ jsx18(
6584
+ PositionsValueCard,
6585
+ {
6586
+ label: labels.userProfile.balance.kalshiBalance,
6587
+ valueLabel: formatUsd((_a = balanceState.kalshiBalance) != null ? _a : 0),
6588
+ icon: /* @__PURE__ */ jsx18(VenueLogo, { venue: Venue2.kalshi, size: "small", className: "size-4" })
6589
+ }
6590
+ ) : null
6591
+ ]
6121
6592
  }
6122
6593
  ),
6123
- /* @__PURE__ */ jsx17(
6594
+ /* @__PURE__ */ jsx18(
6124
6595
  AvailableBalanceCard,
6125
6596
  {
6126
6597
  valueLabel: availableBalanceLabel,
6598
+ reservedValueLabel: reservedBalanceLabel,
6127
6599
  isLoading: isAvailableBalanceLoading,
6128
- chains: (balanceChainsOverride != null ? balanceChainsOverride : balanceState.balanceBreakdown).map((b) => ({
6600
+ chains: ((_b = balanceChainsOverride != null ? balanceChainsOverride : balanceState.availableBalanceBreakdown) != null ? _b : balanceState.balanceBreakdown).map((b) => ({
6129
6601
  key: b.key,
6130
6602
  label: b.label,
6131
6603
  balance: b.balance,
@@ -6138,11 +6610,12 @@ var UserProfilePage = ({
6138
6610
  }
6139
6611
  )
6140
6612
  ] }),
6141
- /* @__PURE__ */ jsx17(
6613
+ /* @__PURE__ */ jsx18(
6142
6614
  PositionsActivity,
6143
6615
  {
6144
6616
  tab,
6145
6617
  onTabChange,
6618
+ showOpenOrders: showLimitOrders,
6146
6619
  activePositions: resolvedActivePositions,
6147
6620
  closedPositions: resolvedClosedPositions,
6148
6621
  activities: resolvedActivities,
@@ -6157,14 +6630,15 @@ var UserProfilePage = ({
6157
6630
  return getActivityHref == null ? void 0 : getActivityHref(activity);
6158
6631
  },
6159
6632
  onOpenOrderClick,
6633
+ getOpenOrderHref,
6160
6634
  onCancelOrder: handleCancelOrder,
6161
6635
  cancellingOrderIds: cancellingOrderIds != null ? cancellingOrderIds : internalCancellingIds,
6162
6636
  isLoadingPositions: isLoadingPositions != null ? isLoadingPositions : !!shouldUseHookData && (positionFilter === "active" ? activePositionsQuery.isLoading : closedPositionsQuery.isLoading),
6163
6637
  isLoadingActivities: isLoadingActivities != null ? isLoadingActivities : !!shouldUseHookData && activityQuery.isLoading,
6164
- isLoadingOpenOrders: isLoadingOpenOrders != null ? isLoadingOpenOrders : !!shouldUseHookData && ordersQuery.isLoading,
6638
+ isLoadingOpenOrders: isLoadingOpenOrders != null ? isLoadingOpenOrders : !!shouldUseHookData && isOpenOrdersQueryLoading,
6165
6639
  positionsError: positionsError != null ? positionsError : !!shouldUseHookData && (positionFilter === "active" ? !!activePositionsQuery.error : !!closedPositionsQuery.error),
6166
6640
  activitiesError: activitiesError != null ? activitiesError : !!shouldUseHookData && !!activityQuery.error,
6167
- openOrdersError: openOrdersError != null ? openOrdersError : !!shouldUseHookData && !!ordersQuery.error,
6641
+ openOrdersError: openOrdersError != null ? openOrdersError : !!shouldUseHookData && hasOpenOrdersQueryError,
6168
6642
  hasMoreActivePositions: hasMoreActivePositions != null ? hasMoreActivePositions : !!shouldUseHookData && !!activePositionsQuery.hasNextPage,
6169
6643
  isLoadingMoreActivePositions: isLoadingMoreActivePositions != null ? isLoadingMoreActivePositions : !!shouldUseHookData && !!activePositionsQuery.isFetchingNextPage,
6170
6644
  onLoadMoreActivePositions: onLoadMoreActivePositions != null ? onLoadMoreActivePositions : shouldUseHookData && activePositionsQuery.hasNextPage ? () => {
@@ -6182,15 +6656,13 @@ var UserProfilePage = ({
6182
6656
  onLoadMoreActivities: onLoadMoreActivities != null ? onLoadMoreActivities : shouldUseHookData && activityQuery.hasNextPage ? () => {
6183
6657
  void activityQuery.fetchNextPage();
6184
6658
  } : void 0,
6185
- hasMoreOpenOrders: hasMoreOpenOrders != null ? hasMoreOpenOrders : !!shouldUseHookData && !!ordersQuery.hasNextPage,
6186
- isLoadingMoreOpenOrders: isLoadingMoreOpenOrders != null ? isLoadingMoreOpenOrders : !!shouldUseHookData && !!ordersQuery.isFetchingNextPage,
6187
- onLoadMoreOpenOrders: onLoadMoreOpenOrders != null ? onLoadMoreOpenOrders : shouldUseHookData && ordersQuery.hasNextPage ? () => {
6188
- void ordersQuery.fetchNextPage();
6189
- } : void 0,
6659
+ hasMoreOpenOrders: hasMoreOpenOrders != null ? hasMoreOpenOrders : !!shouldUseHookData && hasMoreOpenOrdersQuery,
6660
+ isLoadingMoreOpenOrders: isLoadingMoreOpenOrders != null ? isLoadingMoreOpenOrders : !!shouldUseHookData && isLoadingMoreOpenOrdersQuery,
6661
+ onLoadMoreOpenOrders: onLoadMoreOpenOrders != null ? onLoadMoreOpenOrders : shouldUseHookData && hasMoreOpenOrdersQuery ? handleLoadMoreOpenOrders : void 0,
6190
6662
  className: classNames == null ? void 0 : classNames.positionsActivity
6191
6663
  }
6192
6664
  ),
6193
- /* @__PURE__ */ jsx17(
6665
+ /* @__PURE__ */ jsx18(
6194
6666
  ClaimActivityBreakdownModal,
6195
6667
  {
6196
6668
  activity: selectedClaimActivity,