@agg-build/ui 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4ILR2YH3.mjs → chunk-7JEJIGG4.mjs} +2 -2
- package/dist/{chunk-WFS772A3.mjs → chunk-F3SU7BRE.mjs} +1 -1
- package/dist/{chunk-3IY2GA2D.mjs → chunk-IT2Y62MG.mjs} +25 -23
- package/dist/{chunk-YSCHNVBZ.mjs → chunk-JDYZJKTE.mjs} +2 -2
- package/dist/{chunk-PEVG67XU.mjs → chunk-KDMNFHPL.mjs} +1 -1
- package/dist/{chunk-XDZLCWUZ.mjs → chunk-OHEZGKFM.mjs} +44 -26
- package/dist/{chunk-TLGQ4LID.mjs → chunk-R6DETAZ6.mjs} +732 -695
- package/dist/events.js +843 -807
- package/dist/events.mjs +3 -3
- package/dist/index.js +2266 -2207
- package/dist/index.mjs +9 -7
- package/dist/modals.js +755 -719
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1549 -1492
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +733 -695
- package/dist/primitives.mjs +3 -1
- package/dist/trading.js +525 -471
- package/dist/trading.mjs +4 -4
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +0 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +0 -1
- package/dist/types/primitives/icon/icon.types.d.mts +1 -2
- package/dist/types/primitives/icon/icon.types.d.ts +1 -2
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +4 -0
- package/dist/types/primitives/icon/registry.d.ts +4 -0
- package/dist/types/primitives/icon/svg/lock.d.mts +5 -0
- package/dist/types/primitives/icon/svg/lock.d.ts +5 -0
- package/package.json +3 -3
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
resolveUnifiedOrderBookEntries,
|
|
22
22
|
sortOutcomeSelectorOutcomes,
|
|
23
23
|
useEventTradingContext
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KDMNFHPL.mjs";
|
|
25
25
|
import {
|
|
26
26
|
AutocompleteSelect,
|
|
27
27
|
Badge,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
sortMarketsByYesOddsDesc,
|
|
74
74
|
sortOutcomes,
|
|
75
75
|
splitEventsByLifecycle
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-R6DETAZ6.mjs";
|
|
77
77
|
|
|
78
78
|
// src/events/item/index.tsx
|
|
79
79
|
import {
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
getMotionClassName,
|
|
41
41
|
shortenAddress,
|
|
42
42
|
venueLogoLabels
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-R6DETAZ6.mjs";
|
|
44
44
|
|
|
45
45
|
// src/deposit/index.tsx
|
|
46
46
|
import { useEffect as useEffect3, useMemo, useRef, useState as useState2 } from "react";
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
isErrorWithStatus,
|
|
10
10
|
useEventListTabs,
|
|
11
11
|
useEventListTabsHeaderOverflow
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7JEJIGG4.mjs";
|
|
13
13
|
import {
|
|
14
14
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
15
15
|
PlaceOrder,
|
|
16
16
|
SettlementDetails,
|
|
17
17
|
WITHDRAW_MODAL_OPEN_EVENT
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OHEZGKFM.mjs";
|
|
19
19
|
import {
|
|
20
20
|
AggErrorBoundary,
|
|
21
21
|
Button,
|
|
@@ -43,9 +43,8 @@ import {
|
|
|
43
43
|
cn,
|
|
44
44
|
filterOpenEvents,
|
|
45
45
|
resolveTabVenus,
|
|
46
|
-
shortenAddress
|
|
47
|
-
|
|
48
|
-
} from "./chunk-TLGQ4LID.mjs";
|
|
46
|
+
shortenAddress
|
|
47
|
+
} from "./chunk-R6DETAZ6.mjs";
|
|
49
48
|
|
|
50
49
|
// src/pages/home/index.tsx
|
|
51
50
|
import {
|
|
@@ -1135,6 +1134,14 @@ var CHAIN_ID_TO_ICON = {
|
|
|
1135
1134
|
"42161": "arbitrum",
|
|
1136
1135
|
"792703809": "solana"
|
|
1137
1136
|
};
|
|
1137
|
+
var CHAIN_VENUE_MAP = {
|
|
1138
|
+
"137": ["polymarket"],
|
|
1139
|
+
// Polygon
|
|
1140
|
+
"792703809": ["kalshi"],
|
|
1141
|
+
// Solana
|
|
1142
|
+
"56": ["limitless", "opinion"]
|
|
1143
|
+
// BNB
|
|
1144
|
+
};
|
|
1138
1145
|
var chainIconName = (label, key) => {
|
|
1139
1146
|
if (key && CHAIN_ID_TO_ICON[key]) return CHAIN_ID_TO_ICON[key];
|
|
1140
1147
|
const k = label.trim().toLowerCase();
|
|
@@ -1148,14 +1155,6 @@ var chainIconName = (label, key) => {
|
|
|
1148
1155
|
if (k.includes("ethereum") || k.includes("eth")) return "ethereum";
|
|
1149
1156
|
return void 0;
|
|
1150
1157
|
};
|
|
1151
|
-
var venueNameSet = new Set(venueLogoNames);
|
|
1152
|
-
var isKnownVenueName = (venue) => {
|
|
1153
|
-
return venueNameSet.has(venue);
|
|
1154
|
-
};
|
|
1155
|
-
var getDisplayVenues = (venues) => {
|
|
1156
|
-
if (!Array.isArray(venues) || venues.length === 0) return [];
|
|
1157
|
-
return venues.filter(isKnownVenueName);
|
|
1158
|
-
};
|
|
1159
1158
|
var AvailableBalanceCard = ({
|
|
1160
1159
|
label = "Available Balance",
|
|
1161
1160
|
valueLabel,
|
|
@@ -1204,6 +1203,7 @@ var AvailableBalanceCard = ({
|
|
|
1204
1203
|
content: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-4 items-start justify-start", children: [
|
|
1205
1204
|
/* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: "Balance by network" }),
|
|
1206
1205
|
/* @__PURE__ */ jsx3("div", { role: "list", className: "agg-balance-list flex flex-col gap-3 w-full", children: chains.map((row) => {
|
|
1206
|
+
var _a;
|
|
1207
1207
|
const icon = chainIconName(row.label, row.key);
|
|
1208
1208
|
return /* @__PURE__ */ jsxs3(
|
|
1209
1209
|
"div",
|
|
@@ -1221,7 +1221,7 @@ var AvailableBalanceCard = ({
|
|
|
1221
1221
|
minimumFractionDigits: Number.isInteger(row.balance) ? 0 : 1,
|
|
1222
1222
|
maximumFractionDigits: 2
|
|
1223
1223
|
}) }),
|
|
1224
|
-
/* @__PURE__ */ jsx3("div", { className: "flex w-12 shrink-0 items-center justify-end gap-1 empty:hidden", children:
|
|
1224
|
+
/* @__PURE__ */ jsx3("div", { className: "flex w-12 shrink-0 items-center justify-end gap-1 empty:hidden", children: ((_a = CHAIN_VENUE_MAP[row.key]) != null ? _a : []).slice(0, 2).map((venue, venueIndex) => /* @__PURE__ */ jsx3(
|
|
1225
1225
|
VenueLogo,
|
|
1226
1226
|
{
|
|
1227
1227
|
venue,
|
|
@@ -2511,7 +2511,7 @@ var UserInfoCard = ({
|
|
|
2511
2511
|
className
|
|
2512
2512
|
),
|
|
2513
2513
|
children: [
|
|
2514
|
-
/* @__PURE__ */ jsxs10("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-
|
|
2514
|
+
/* @__PURE__ */ jsxs10("div", { className: "agg-profile-header flex w-full flex-row flex-wrap items-center gap-4 sm:gap-5 pt-5", children: [
|
|
2515
2515
|
/* @__PURE__ */ jsx10("div", { className: "agg-profile-avatar shrink-0", children: user.avatarUrl ? /* @__PURE__ */ jsx10(
|
|
2516
2516
|
RemoteImage,
|
|
2517
2517
|
{
|
|
@@ -3085,7 +3085,8 @@ var UserProfilePage = ({
|
|
|
3085
3085
|
var _a, _b, _c, _d, _e, _f;
|
|
3086
3086
|
if (user) return user;
|
|
3087
3087
|
const fullUser = profileUser != null ? profileUser : currentUser;
|
|
3088
|
-
const
|
|
3088
|
+
const walletAddress = getWalletAddressFromUserProfile(fullUser);
|
|
3089
|
+
const fallbackUsername = walletAddress && shortenAddress(walletAddress) || "username";
|
|
3089
3090
|
const twitterAccount = (_a = fullUser == null ? void 0 : fullUser.accounts) == null ? void 0 : _a.find(
|
|
3090
3091
|
(account) => String(account.provider).toLowerCase() === "twitter"
|
|
3091
3092
|
);
|
|
@@ -3110,7 +3111,7 @@ var UserProfilePage = ({
|
|
|
3110
3111
|
] : [],
|
|
3111
3112
|
connectedExchanges: connectedVenues.map((venue) => ({ venue })),
|
|
3112
3113
|
connectedWallets,
|
|
3113
|
-
displayAddress: shortenAddress(
|
|
3114
|
+
displayAddress: shortenAddress(walletAddress),
|
|
3114
3115
|
socialHandle: normalizedTwitterHandle != null ? normalizedTwitterHandle : void 0
|
|
3115
3116
|
};
|
|
3116
3117
|
}, [connectedVenues, currentUser, profileUser, user]);
|
|
@@ -3266,6 +3267,7 @@ var UserProfilePage = ({
|
|
|
3266
3267
|
const marketId = group.targetMarketId;
|
|
3267
3268
|
return group.venueMarket.venueMarketOutcomes.map((outcome) => {
|
|
3268
3269
|
var _a2, _b2, _c, _d;
|
|
3270
|
+
const isUnpriced = outcome.priceSource === "entry";
|
|
3269
3271
|
const currentPriceCents = Math.round(outcome.currentPrice * 100);
|
|
3270
3272
|
const averagePriceCents = Math.round(outcome.avgEntryPrice * 100);
|
|
3271
3273
|
const pnlPrefix = outcome.unrealizedPnl >= 0 ? "+" : "";
|
|
@@ -3279,10 +3281,10 @@ var UserProfilePage = ({
|
|
|
3279
3281
|
outcomeLabel: ((_c = outcome.title) == null ? void 0 : _c.trim()) || outcome.label,
|
|
3280
3282
|
venueShareBreakdown: buildVenueShareBreakdown(outcome),
|
|
3281
3283
|
averageLabel: `${averagePriceCents}\xA2`,
|
|
3282
|
-
currentLabel: `${currentPriceCents}\xA2`,
|
|
3283
|
-
valueLabel: formatUsd(outcome.totalValue),
|
|
3284
|
-
pnlLabel: `${pnlPrefix}${formatUsd(outcome.unrealizedPnl)} (${pnlPrefix}${pnlPercent}%)`,
|
|
3285
|
-
isPnlPositive: outcome.unrealizedPnl >= 0,
|
|
3284
|
+
currentLabel: isUnpriced ? "\u2014" : `${currentPriceCents}\xA2`,
|
|
3285
|
+
valueLabel: isUnpriced ? "\u2014" : formatUsd(outcome.totalValue),
|
|
3286
|
+
pnlLabel: isUnpriced ? "\u2014" : `${pnlPrefix}${formatUsd(outcome.unrealizedPnl)} (${pnlPrefix}${pnlPercent}%)`,
|
|
3287
|
+
isPnlPositive: !isUnpriced && outcome.unrealizedPnl >= 0,
|
|
3286
3288
|
status: group.status,
|
|
3287
3289
|
marketStatus: group.venueMarket.status,
|
|
3288
3290
|
winner: (_d = outcome.winner) != null ? _d : null,
|
|
@@ -3303,8 +3305,8 @@ var UserProfilePage = ({
|
|
|
3303
3305
|
return adaptPositionGroups(activePositionsQuery.positions);
|
|
3304
3306
|
}, [activePositions, activePositionsQuery.positions, adaptPositionGroups]);
|
|
3305
3307
|
const resolvedClosedPositions = useMemo3(() => {
|
|
3306
|
-
|
|
3307
|
-
return
|
|
3308
|
+
const base = closedPositions != null ? closedPositions : adaptPositionGroups(closedPositionsQuery.positions);
|
|
3309
|
+
return base.filter((p) => p.marketStatus === "resolved");
|
|
3308
3310
|
}, [closedPositions, closedPositionsQuery.positions, adaptPositionGroups]);
|
|
3309
3311
|
return /* @__PURE__ */ jsx11(AggErrorBoundary, { onError, children: /* @__PURE__ */ jsx11(
|
|
3310
3312
|
"section",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AGG_TERMS_OF_SERVICE_URL,
|
|
4
4
|
Icon,
|
|
5
5
|
cn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-R6DETAZ6.mjs";
|
|
7
7
|
|
|
8
8
|
// src/geo-block-banner/index.tsx
|
|
9
9
|
import { useLabels } from "@agg-build/hooks";
|
|
@@ -18,7 +18,7 @@ var GeoBlockBanner = ({
|
|
|
18
18
|
return /* @__PURE__ */ jsxs(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
|
-
className: cn("flex items-center gap-5 rounded-agg-
|
|
21
|
+
className: cn("flex items-center gap-5 rounded-agg-lg bg-agg-secondary-hover p-3", className),
|
|
22
22
|
role: "status",
|
|
23
23
|
children: [
|
|
24
24
|
/* @__PURE__ */ jsxs("p", { className: "min-w-0 flex-1 text-agg-xs leading-agg-4 text-agg-foreground", children: [
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
getTradingValueLabel,
|
|
8
8
|
getTradingVenueLabel,
|
|
9
9
|
resolveOrderEligibilityMessage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KDMNFHPL.mjs";
|
|
11
11
|
import {
|
|
12
12
|
GeoBlockBanner
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JDYZJKTE.mjs";
|
|
14
14
|
import {
|
|
15
15
|
AGG_TERMS_OF_SERVICE_URL,
|
|
16
16
|
Button,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getMotionClassName,
|
|
37
37
|
normalizeVenueMarketCluster,
|
|
38
38
|
skeletonViews
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-R6DETAZ6.mjs";
|
|
40
40
|
|
|
41
41
|
// src/trading/types.ts
|
|
42
42
|
import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
|
|
@@ -456,14 +456,14 @@ var buildLiveRouteCards = ({
|
|
|
456
456
|
const isPrimaryRouteGeoBlocked = quoteData.fills.length > 0 && quoteData.fills.every((f) => geoBlockedVenues.has(f.venue));
|
|
457
457
|
const primaryCard = primaryResult ? isPrimaryRouteGeoBlocked ? {
|
|
458
458
|
id: "live-route",
|
|
459
|
-
hint:
|
|
459
|
+
hint: labels.venueUnavailableInRegion,
|
|
460
460
|
kind: "venue",
|
|
461
461
|
label: getTradingVenueLabel(
|
|
462
462
|
parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
463
463
|
),
|
|
464
|
-
numericValue:
|
|
464
|
+
numericValue: tradeSide === "sell" ? quoteData.rawExecCost : quoteData.totalFilled,
|
|
465
465
|
quoteData,
|
|
466
|
-
value:
|
|
466
|
+
value: primaryResult.value,
|
|
467
467
|
venue: parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0,
|
|
468
468
|
isUnavailable: true
|
|
469
469
|
} : {
|
|
@@ -488,12 +488,16 @@ var buildLiveRouteCards = ({
|
|
|
488
488
|
if (geoBlockedVenues.has(sq.venue)) {
|
|
489
489
|
return {
|
|
490
490
|
id: `live-unavailable-${sq.venue}`,
|
|
491
|
-
hint:
|
|
491
|
+
hint: labels.venueUnavailableInRegion,
|
|
492
492
|
kind: "venue",
|
|
493
493
|
label: getTradingVenueLabel(venue),
|
|
494
|
-
numericValue:
|
|
494
|
+
numericValue: sq.filledQty,
|
|
495
495
|
quoteData,
|
|
496
|
-
value:
|
|
496
|
+
value: getTradingValueLabel({
|
|
497
|
+
amount: sq.filledQty,
|
|
498
|
+
minimumFractionDigits: 2,
|
|
499
|
+
maximumFractionDigits: 2
|
|
500
|
+
}),
|
|
497
501
|
venue,
|
|
498
502
|
isUnavailable: true
|
|
499
503
|
};
|
|
@@ -533,7 +537,7 @@ var buildLiveRouteCards = ({
|
|
|
533
537
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
534
538
|
return {
|
|
535
539
|
id: `live-unavailable-${sq.venue}`,
|
|
536
|
-
hint:
|
|
540
|
+
hint: labels.venueUnavailableInRegion,
|
|
537
541
|
kind: "venue",
|
|
538
542
|
label: getTradingVenueLabel(venue),
|
|
539
543
|
numericValue: 0,
|
|
@@ -553,7 +557,7 @@ var buildLiveRouteCards = ({
|
|
|
553
557
|
return [
|
|
554
558
|
{
|
|
555
559
|
id: "live-geo-blocked-kalshi",
|
|
556
|
-
hint:
|
|
560
|
+
hint: labels.venueUnavailableInRegion,
|
|
557
561
|
kind: "venue",
|
|
558
562
|
label: getTradingVenueLabel(kalshiVenue),
|
|
559
563
|
numericValue: 0,
|
|
@@ -1857,8 +1861,7 @@ var renderRouteCard = ({
|
|
|
1857
1861
|
}) => {
|
|
1858
1862
|
var _a, _b;
|
|
1859
1863
|
const showSplitDetails = isSelected && isExpanded && card.kind === "split" && !!((_a = card.rows) == null ? void 0 : _a.length);
|
|
1860
|
-
const
|
|
1861
|
-
const ariaLabel = [card.label, card.hint, valueLabel].filter(Boolean).join(" ");
|
|
1864
|
+
const ariaLabel = [card.label, card.hint, card.value].filter(Boolean).join(" ");
|
|
1862
1865
|
return /* @__PURE__ */ jsxs3(
|
|
1863
1866
|
"button",
|
|
1864
1867
|
{
|
|
@@ -1868,14 +1871,14 @@ var renderRouteCard = ({
|
|
|
1868
1871
|
disabled: card.isUnavailable,
|
|
1869
1872
|
className: cn(
|
|
1870
1873
|
"agg-route-card",
|
|
1871
|
-
"relative w-full
|
|
1874
|
+
"relative w-full overflow-hidden rounded-agg-lg p-3 text-left",
|
|
1872
1875
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-0 focus-visible:ring-offset-agg-secondary",
|
|
1873
1876
|
getMotionClassName(
|
|
1874
1877
|
enableAnimations,
|
|
1875
1878
|
"transition-[background-color,border-color,color] duration-200 ease-in-out"
|
|
1876
1879
|
),
|
|
1877
|
-
|
|
1878
|
-
card.isUnavailable
|
|
1880
|
+
card.isUnavailable ? "cursor-not-allowed" : "cursor-pointer",
|
|
1881
|
+
isSelected && !card.isUnavailable ? "border border-agg-trade-highlight-border bg-gradient-to-b from-agg-trade-highlight-surface-from to-agg-trade-highlight-surface-to" : "border-transparent bg-agg-secondary-hover"
|
|
1879
1882
|
),
|
|
1880
1883
|
onClick: () => onSelect(card.id),
|
|
1881
1884
|
children: [
|
|
@@ -1905,7 +1908,15 @@ var renderRouteCard = ({
|
|
|
1905
1908
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
1906
1909
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
|
|
1907
1910
|
/* @__PURE__ */ jsx4("p", { className: "agg-route-card-title truncate text-agg-sm leading-agg-5 text-agg-foreground", children: card.label }),
|
|
1908
|
-
card.
|
|
1911
|
+
card.isUnavailable ? /* @__PURE__ */ jsx4(
|
|
1912
|
+
Icon,
|
|
1913
|
+
{
|
|
1914
|
+
name: "lock",
|
|
1915
|
+
size: "xs",
|
|
1916
|
+
className: "shrink-0 text-agg-muted-foreground",
|
|
1917
|
+
"aria-hidden": "true"
|
|
1918
|
+
}
|
|
1919
|
+
) : card.kind === "split" && isSelected ? /* @__PURE__ */ jsx4(
|
|
1909
1920
|
Icon,
|
|
1910
1921
|
{
|
|
1911
1922
|
name: showSplitDetails ? "chevron-up" : "chevron-down",
|
|
@@ -1924,9 +1935,9 @@ var renderRouteCard = ({
|
|
|
1924
1935
|
className: cn(
|
|
1925
1936
|
"agg-route-card-value",
|
|
1926
1937
|
"shrink-0 whitespace-nowrap",
|
|
1927
|
-
card.isUnavailable ? "text-agg-
|
|
1938
|
+
isSelected && !card.isUnavailable ? "text-agg-lg font-agg-bold leading-agg-7 text-agg-trade-highlight-accent" : "text-agg-base leading-agg-6 text-agg-foreground"
|
|
1928
1939
|
),
|
|
1929
|
-
children:
|
|
1940
|
+
children: card.value
|
|
1930
1941
|
}
|
|
1931
1942
|
)
|
|
1932
1943
|
] }),
|
|
@@ -2225,7 +2236,7 @@ var PlaceOrder = ({
|
|
|
2225
2236
|
onExecutionStateChange,
|
|
2226
2237
|
resolvedClaim
|
|
2227
2238
|
}) => {
|
|
2228
|
-
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
|
|
2239
|
+
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;
|
|
2229
2240
|
const {
|
|
2230
2241
|
features: { enableAnimations },
|
|
2231
2242
|
general: { locale }
|
|
@@ -2736,16 +2747,24 @@ var PlaceOrder = ({
|
|
|
2736
2747
|
submissionProgressState,
|
|
2737
2748
|
tradingLabels
|
|
2738
2749
|
]);
|
|
2739
|
-
const displayedToWinHint = (
|
|
2740
|
-
|
|
2750
|
+
const displayedToWinHint = useMemo2(() => {
|
|
2751
|
+
var _a2, _b2, _c2, _d2;
|
|
2752
|
+
if (!selectedRouteCard) return "";
|
|
2753
|
+
if (selectedRouteCard.isUnavailable) {
|
|
2754
|
+
const avgPrice = (_c2 = (_b2 = (_a2 = selectedRouteCard.quoteData) == null ? void 0 : _a2.fills) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.avgPrice;
|
|
2755
|
+
return avgPrice != null ? tradingLabels.averagePrice(avgPrice) : "";
|
|
2756
|
+
}
|
|
2757
|
+
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
2758
|
+
}, [selectedRouteCard, tradingLabels]);
|
|
2759
|
+
const displayedToWinValue = (_B = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _B : 0;
|
|
2741
2760
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending;
|
|
2742
|
-
const selectedRouteGeoBlocked = (
|
|
2761
|
+
const selectedRouteGeoBlocked = (_C = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _C : false;
|
|
2743
2762
|
const geoBlockedVenuesFromWarnings = useMemo2(
|
|
2744
2763
|
() => {
|
|
2745
2764
|
var _a2;
|
|
2746
2765
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
2747
2766
|
},
|
|
2748
|
-
[(
|
|
2767
|
+
[(_D = smartRoute.data) == null ? void 0 : _D.warnings]
|
|
2749
2768
|
);
|
|
2750
2769
|
const isPrimaryVenueGeoBlocked = useMemo2(() => {
|
|
2751
2770
|
var _a2, _b2;
|
|
@@ -2754,7 +2773,6 @@ var PlaceOrder = ({
|
|
|
2754
2773
|
return fills.length > 0 && fills.every((f) => geoBlockedVenuesFromWarnings.has(f.venue));
|
|
2755
2774
|
}, [selectedRouteCard, geoBlockedVenuesFromWarnings]);
|
|
2756
2775
|
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked;
|
|
2757
|
-
const geoBlockVenueLabel = isTradingBlocked ? void 0 : selectedRouteGeoBlocked ? selectedRouteCard == null ? void 0 : selectedRouteCard.label : isPrimaryVenueGeoBlocked && (selectedRouteCard == null ? void 0 : selectedRouteCard.venue) ? getTradingVenueLabel(selectedRouteCard.venue) : void 0;
|
|
2758
2776
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
2759
2777
|
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isBelowMinimum || !selectedRouteCard || !selectedRouteCard.quoteData.quoteId || selectedRouteGeoBlocked || !isAuthenticated || quoteStatus !== void 0;
|
|
2760
2778
|
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && (orderedRouteCards.length > 0 || smartRoute.isFetching);
|
|
@@ -3367,7 +3385,7 @@ var PlaceOrder = ({
|
|
|
3367
3385
|
children: actionLabel
|
|
3368
3386
|
}
|
|
3369
3387
|
),
|
|
3370
|
-
shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(GeoBlockBanner, {
|
|
3388
|
+
shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(GeoBlockBanner, { termsUrl: AGG_TERMS_OF_SERVICE_URL }) : null,
|
|
3371
3389
|
!shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4("p", { className: "agg-order-disclaimer text-center text-agg-xs leading-agg-4 text-agg-muted-foreground", children: tradingLabels.disclaimer }) : null
|
|
3372
3390
|
]
|
|
3373
3391
|
}
|