@agg-build/ui 4.19.0 → 4.21.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-GT3DCFIT.mjs → chunk-5PA5KLXN.mjs} +17 -9
- package/dist/chunk-CKHECAKV.mjs +2724 -0
- package/dist/{chunk-NSQQ62QK.mjs → chunk-DONMO42Q.mjs} +1 -1
- package/dist/{chunk-DXASFSVL.mjs → chunk-JLO2BGSF.mjs} +546 -225
- package/dist/{chunk-5YHKIJ23.mjs → chunk-NV6WT3TN.mjs} +481 -826
- package/dist/{chunk-47CCGQH6.mjs → chunk-UXLC3FFY.mjs} +451 -1349
- package/dist/{event-market-2BAMDM5I.mjs → event-market-UREM3ZE7.mjs} +3 -3
- package/dist/events.js +419 -99
- package/dist/events.mjs +4 -2
- package/dist/index.js +22571 -21972
- package/dist/index.mjs +12 -10
- package/dist/modals.js +898 -335
- package/dist/modals.mjs +5 -5
- package/dist/pages.js +4328 -2833
- package/dist/pages.mjs +5 -5
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1746 -643
- package/dist/trading.mjs +2 -2
- package/dist/types/events/list/event-list-venue-strip.d.mts +29 -0
- package/dist/types/events/list/event-list-venue-strip.d.ts +29 -0
- package/dist/types/events/list/index.d.mts +2 -0
- package/dist/types/events/list/index.d.ts +2 -0
- package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
- package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.mts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-card.d.ts +3 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.mts +2 -1
- package/dist/types/pages/user-profile/components/betdex-account-transfers.d.ts +2 -1
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.mts +6 -0
- package/dist/types/pages/user-profile/components/betdex-wallet-deposit.d.ts +6 -0
- package/dist/types/profile/tabs/trading-access-tab.d.mts +2 -1
- package/dist/types/profile/tabs/trading-access-tab.d.ts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.mts +2 -1
- package/dist/types/trading/manage-betdex-account-modal.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +1 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +1 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +2 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +3 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +3 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
- package/dist/chunk-ROA5K67W.mjs +0 -1237
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
ConnectKalshiModal,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
DEFAULT_CURRENCY_OPTIONS,
|
|
5
|
+
ManageBetdexAccountModal,
|
|
6
|
+
TransferFeeSummary,
|
|
7
|
+
dispatchAggDepositNotification,
|
|
8
|
+
mapNetworksToOptions,
|
|
9
|
+
mergeSelectOptionsUnique,
|
|
10
|
+
withNetworkIcons,
|
|
11
|
+
withTokenIcons
|
|
12
|
+
} from "./chunk-CKHECAKV.mjs";
|
|
6
13
|
import {
|
|
7
14
|
BoltIcon,
|
|
8
15
|
Button,
|
|
@@ -32,212 +39,16 @@ import {
|
|
|
32
39
|
formatCompactUsd,
|
|
33
40
|
formatTokenAmount,
|
|
34
41
|
formatUsd,
|
|
35
|
-
getMotionClassName,
|
|
36
42
|
shortenAddress,
|
|
37
43
|
useOptionalToast,
|
|
38
44
|
venueLogoLabels
|
|
39
45
|
} from "./chunk-XZVGHKMW.mjs";
|
|
40
46
|
|
|
41
47
|
// src/deposit/index.tsx
|
|
42
|
-
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as
|
|
48
|
+
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels10 } from "@agg-build/hooks";
|
|
43
49
|
import { SVM_CHAIN_IDS, useDepositFlow } from "@agg-build/hooks/deposit";
|
|
44
50
|
import { useCallback, useEffect as useEffect3, useMemo, useRef, useState as useState2 } from "react";
|
|
45
51
|
|
|
46
|
-
// src/shared/constants.ts
|
|
47
|
-
var USDC = {
|
|
48
|
-
value: "USDC",
|
|
49
|
-
label: "USDC",
|
|
50
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdc.svg"
|
|
51
|
-
};
|
|
52
|
-
var SUPPORTED_NETWORKS = [
|
|
53
|
-
{
|
|
54
|
-
value: "abstract",
|
|
55
|
-
label: "Abstract",
|
|
56
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Abstract.svg",
|
|
57
|
-
tokens: [USDC]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: "arbitrum",
|
|
61
|
-
label: "Arbitrum One",
|
|
62
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Arbitrum.svg",
|
|
63
|
-
tokens: [USDC]
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
value: "base",
|
|
67
|
-
label: "Base",
|
|
68
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Base.svg",
|
|
69
|
-
tokens: [USDC]
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
value: "bnb",
|
|
73
|
-
label: "BNB Chain",
|
|
74
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/BNB.svg",
|
|
75
|
-
tokens: [USDC]
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
value: "flow",
|
|
79
|
-
label: "Flow",
|
|
80
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Flow.svg",
|
|
81
|
-
tokens: [USDC]
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
value: "hyperliquid",
|
|
85
|
-
label: "Hyperliquid",
|
|
86
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/hyperliquid.png",
|
|
87
|
-
tokens: [USDC]
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: "mainnet",
|
|
91
|
-
label: "Ethereum",
|
|
92
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/ETH.svg",
|
|
93
|
-
tokens: [USDC]
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
value: "optimism",
|
|
97
|
-
label: "Optimism",
|
|
98
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/optimism/colored.svg",
|
|
99
|
-
tokens: [USDC]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
value: "polygon",
|
|
103
|
-
label: "Polygon Mainnet",
|
|
104
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Polygon.svg",
|
|
105
|
-
tokens: [USDC]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
value: "solana",
|
|
109
|
-
label: "Solana",
|
|
110
|
-
iconUrl: "https://assets.snagsolutions.io/public/prediction-markets/logos/Solana.svg",
|
|
111
|
-
tokens: [USDC]
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
value: "zksync",
|
|
115
|
-
label: "zkSync Era",
|
|
116
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/chains/zksync/colored.svg",
|
|
117
|
-
tokens: [USDC]
|
|
118
|
-
}
|
|
119
|
-
];
|
|
120
|
-
var mapNetworksToOptions = () => {
|
|
121
|
-
return SUPPORTED_NETWORKS.map((n) => ({
|
|
122
|
-
value: n.value,
|
|
123
|
-
label: n.label,
|
|
124
|
-
iconUrl: n.iconUrl
|
|
125
|
-
}));
|
|
126
|
-
};
|
|
127
|
-
var USDC_ICON_URL = "https://assets.snagsolutions.io/public/web/icons/usdc.svg";
|
|
128
|
-
var DEFAULT_CURRENCY_OPTIONS = [
|
|
129
|
-
{
|
|
130
|
-
value: "USDC",
|
|
131
|
-
label: "USDC",
|
|
132
|
-
iconUrl: USDC_ICON_URL
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
value: "USDC.e",
|
|
136
|
-
label: "USDC.e",
|
|
137
|
-
iconUrl: USDC_ICON_URL
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
value: "USDH",
|
|
141
|
-
label: "USDH",
|
|
142
|
-
iconUrl: USDC_ICON_URL
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
value: "pUSD",
|
|
146
|
-
label: "pUSD",
|
|
147
|
-
iconUrl: USDC_ICON_URL
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
value: "USDT",
|
|
151
|
-
label: "USDT",
|
|
152
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdt.svg"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
value: "USDT",
|
|
156
|
-
label: "USDT",
|
|
157
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/usdt.svg"
|
|
158
|
-
},
|
|
159
|
-
// Add commonly-used tokens with icons. These can be overridden by props.
|
|
160
|
-
{
|
|
161
|
-
value: "ARB",
|
|
162
|
-
label: "ARB",
|
|
163
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/arb.svg"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
value: "BNB",
|
|
167
|
-
label: "BNB",
|
|
168
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/bnb.svg"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
value: "BTC",
|
|
172
|
-
label: "BTC",
|
|
173
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/btc.svg"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
value: "MATIC",
|
|
177
|
-
label: "MATIC",
|
|
178
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/matic.svg"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
value: "ETH",
|
|
182
|
-
label: "ETH",
|
|
183
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/eth.svg"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
value: "SOL",
|
|
187
|
-
label: "SOL",
|
|
188
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/sol.svg"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
value: "OP",
|
|
192
|
-
label: "OP",
|
|
193
|
-
iconUrl: "https://assets.snagsolutions.io/public/web/icons/tokens/op.svg"
|
|
194
|
-
}
|
|
195
|
-
];
|
|
196
|
-
var withTokenIcons = (options) => {
|
|
197
|
-
const byValue = new Map(DEFAULT_CURRENCY_OPTIONS.map((o) => [o.value, o.iconUrl]));
|
|
198
|
-
return options.map((o) => o.iconUrl ? o : __spreadProps(__spreadValues({}, o), { iconUrl: byValue.get(o.value) }));
|
|
199
|
-
};
|
|
200
|
-
var CHAIN_ID_TO_SLUG = {
|
|
201
|
-
"1": "mainnet",
|
|
202
|
-
"10": "optimism",
|
|
203
|
-
"56": "bnb",
|
|
204
|
-
"137": "polygon",
|
|
205
|
-
"324": "zksync",
|
|
206
|
-
"747": "flow",
|
|
207
|
-
"1337": "hyperliquid",
|
|
208
|
-
"8453": "base",
|
|
209
|
-
"42161": "arbitrum",
|
|
210
|
-
"2741": "abstract",
|
|
211
|
-
"792703809": "solana"
|
|
212
|
-
};
|
|
213
|
-
var withNetworkIcons = (options) => {
|
|
214
|
-
const bySlug = new Map(SUPPORTED_NETWORKS.map((n) => [n.value, n.iconUrl]));
|
|
215
|
-
return options.map((o) => {
|
|
216
|
-
var _a, _b;
|
|
217
|
-
const slug = (_a = CHAIN_ID_TO_SLUG[o.value]) != null ? _a : o.value;
|
|
218
|
-
return __spreadProps(__spreadValues({}, o), {
|
|
219
|
-
iconUrl: (_b = o.iconUrl) != null ? _b : bySlug.get(slug)
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
};
|
|
223
|
-
var mergeSelectOptionsUnique = (base, fill) => {
|
|
224
|
-
const seen = /* @__PURE__ */ new Set();
|
|
225
|
-
const out = [];
|
|
226
|
-
for (const opt of base != null ? base : []) {
|
|
227
|
-
if (!seen.has(opt.value)) {
|
|
228
|
-
out.push(opt);
|
|
229
|
-
seen.add(opt.value);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
for (const opt of fill) {
|
|
233
|
-
if (!seen.has(opt.value)) {
|
|
234
|
-
out.push(opt);
|
|
235
|
-
seen.add(opt.value);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return out;
|
|
239
|
-
};
|
|
240
|
-
|
|
241
52
|
// src/deposit/deposit-modal.constants.ts
|
|
242
53
|
var BASE_URL = "https://assets.snagsolutions.io";
|
|
243
54
|
var CARD_NETWORK_OPTIONS = [
|
|
@@ -625,94 +436,25 @@ var CardPurchaseSuccessStep = ({
|
|
|
625
436
|
};
|
|
626
437
|
|
|
627
438
|
// src/deposit/steps/crypto-transfer.tsx
|
|
628
|
-
import { useLabels as
|
|
629
|
-
|
|
630
|
-
// src/shared/transfer-fee-summary.tsx
|
|
631
|
-
import { useLabels as useLabels5 } from "@agg-build/hooks";
|
|
632
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
633
|
-
var separator = /* @__PURE__ */ jsx5("span", { className: "text-agg-muted-foreground", "aria-hidden": "true", children: "\xB7" });
|
|
634
|
-
var normalizeFeeLabel = (label) => label.replace(/\s*~\s*$/, "");
|
|
635
|
-
var TransferFeeSummary = ({
|
|
636
|
-
estimate,
|
|
637
|
-
view,
|
|
638
|
-
minDeposit,
|
|
639
|
-
eta
|
|
640
|
-
}) => {
|
|
641
|
-
const labels = useLabels5();
|
|
642
|
-
if (!estimate) return null;
|
|
643
|
-
if (view === "deposit") {
|
|
644
|
-
return /* @__PURE__ */ jsxs5("p", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
645
|
-
minDeposit ? /* @__PURE__ */ jsxs5("span", { children: [
|
|
646
|
-
labels.deposit.sendCrypto.minDepositPrefix,
|
|
647
|
-
" ",
|
|
648
|
-
minDeposit
|
|
649
|
-
] }) : null,
|
|
650
|
-
minDeposit ? separator : null,
|
|
651
|
-
/* @__PURE__ */ jsxs5("span", { children: [
|
|
652
|
-
normalizeFeeLabel(labels.deposit.walletFlow.feePrefix),
|
|
653
|
-
": ",
|
|
654
|
-
estimate.estimatedFees
|
|
655
|
-
] }),
|
|
656
|
-
eta ? separator : null,
|
|
657
|
-
eta ? /* @__PURE__ */ jsx5("span", { children: eta }) : null
|
|
658
|
-
] });
|
|
659
|
-
}
|
|
660
|
-
return /* @__PURE__ */ jsxs5("div", { className: "agg-type-label flex flex-wrap items-center gap-x-2 gap-y-1 text-agg-foreground", children: [
|
|
661
|
-
/* @__PURE__ */ jsxs5("span", { children: [
|
|
662
|
-
labels.withdraw.walletFlow.estimatedFees,
|
|
663
|
-
": ",
|
|
664
|
-
estimate.estimatedFees
|
|
665
|
-
] }),
|
|
666
|
-
separator,
|
|
667
|
-
/* @__PURE__ */ jsxs5("span", { className: "inline-flex items-center gap-1", children: [
|
|
668
|
-
/* @__PURE__ */ jsxs5("span", { children: [
|
|
669
|
-
labels.withdraw.walletFlow.networkReserve,
|
|
670
|
-
": ",
|
|
671
|
-
estimate.networkReserve
|
|
672
|
-
] }),
|
|
673
|
-
/* @__PURE__ */ jsx5(
|
|
674
|
-
Tooltip,
|
|
675
|
-
{
|
|
676
|
-
"aria-label": labels.withdraw.walletFlow.networkReserveTooltipAria,
|
|
677
|
-
size: "medium",
|
|
678
|
-
content: /* @__PURE__ */ jsxs5("div", { className: "text-center", children: [
|
|
679
|
-
/* @__PURE__ */ jsx5("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineOne }),
|
|
680
|
-
/* @__PURE__ */ jsx5("p", { children: labels.withdraw.walletFlow.networkReserveTooltipLineTwo })
|
|
681
|
-
] }),
|
|
682
|
-
classNames: {
|
|
683
|
-
content: "min-w-96 max-w-none!",
|
|
684
|
-
arrow: "[&_polygon]:fill-agg-background",
|
|
685
|
-
icon: "text-agg-foreground! h-3! w-3!"
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
)
|
|
689
|
-
] }),
|
|
690
|
-
separator,
|
|
691
|
-
/* @__PURE__ */ jsxs5("span", { children: [
|
|
692
|
-
labels.withdraw.walletFlow.youReceive,
|
|
693
|
-
": ",
|
|
694
|
-
estimate.youReceive
|
|
695
|
-
] })
|
|
696
|
-
] });
|
|
697
|
-
};
|
|
439
|
+
import { useLabels as useLabels5, useWithdrawEstimate } from "@agg-build/hooks";
|
|
698
440
|
|
|
699
441
|
// src/deposit/components/DepositQRCode.tsx
|
|
700
442
|
import { QRCodeSVG } from "qrcode.react";
|
|
701
|
-
import { jsx as
|
|
443
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
702
444
|
function DepositQRCode({
|
|
703
445
|
depositAddress,
|
|
704
446
|
networkLogoUrl,
|
|
705
447
|
networkLogo,
|
|
706
448
|
size = 160
|
|
707
449
|
}) {
|
|
708
|
-
const logoOverlay = networkLogo ? /* @__PURE__ */
|
|
450
|
+
const logoOverlay = networkLogo ? /* @__PURE__ */ jsx5(
|
|
709
451
|
"div",
|
|
710
452
|
{
|
|
711
453
|
className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-sm",
|
|
712
454
|
style: { width: 32, height: 32, backgroundColor: "#FFFFFF", padding: 2 },
|
|
713
455
|
children: networkLogo
|
|
714
456
|
}
|
|
715
|
-
) : networkLogoUrl ? /* @__PURE__ */
|
|
457
|
+
) : networkLogoUrl ? /* @__PURE__ */ jsx5(
|
|
716
458
|
"img",
|
|
717
459
|
{
|
|
718
460
|
src: networkLogoUrl,
|
|
@@ -723,7 +465,7 @@ function DepositQRCode({
|
|
|
723
465
|
style: { backgroundColor: "#FFFFFF", padding: 2 }
|
|
724
466
|
}
|
|
725
467
|
) : null;
|
|
726
|
-
return /* @__PURE__ */
|
|
468
|
+
return /* @__PURE__ */ jsx5(
|
|
727
469
|
"div",
|
|
728
470
|
{
|
|
729
471
|
className: "inline-flex items-center justify-center rounded-xl border",
|
|
@@ -732,8 +474,8 @@ function DepositQRCode({
|
|
|
732
474
|
borderColor: "#E5E7EB",
|
|
733
475
|
backgroundColor: "#FFFFFF"
|
|
734
476
|
},
|
|
735
|
-
children: /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
477
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
478
|
+
/* @__PURE__ */ jsx5(QRCodeSVG, { value: depositAddress, size, level: "H" }),
|
|
737
479
|
logoOverlay
|
|
738
480
|
] })
|
|
739
481
|
}
|
|
@@ -742,27 +484,27 @@ function DepositQRCode({
|
|
|
742
484
|
DepositQRCode.displayName = "DepositQRCode";
|
|
743
485
|
|
|
744
486
|
// src/deposit/steps/crypto-transfer.tsx
|
|
745
|
-
import { Fragment as Fragment3, jsx as
|
|
487
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
746
488
|
var CryptoAddressLoadingState = () => {
|
|
747
|
-
const labels =
|
|
489
|
+
const labels = useLabels5();
|
|
748
490
|
const sendCryptoLabels = labels.deposit.sendCrypto;
|
|
749
|
-
return /* @__PURE__ */
|
|
491
|
+
return /* @__PURE__ */ jsxs6(
|
|
750
492
|
"div",
|
|
751
493
|
{
|
|
752
494
|
className: "flex w-full flex-col items-center justify-center gap-6 py-10 text-center text-agg-foreground",
|
|
753
495
|
role: "status",
|
|
754
496
|
"aria-live": "polite",
|
|
755
497
|
children: [
|
|
756
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ jsx6(
|
|
757
499
|
"span",
|
|
758
500
|
{
|
|
759
501
|
className: "h-9 w-9 animate-spin rounded-full border-2 border-agg-primary/25 border-t-agg-primary",
|
|
760
502
|
"aria-hidden": "true"
|
|
761
503
|
}
|
|
762
504
|
),
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex w-full flex-col items-center gap-2", children: [
|
|
506
|
+
/* @__PURE__ */ jsx6("p", { className: "text-agg-base font-agg-bold leading-agg-6", children: sendCryptoLabels.addressLoadingTitle }),
|
|
507
|
+
/* @__PURE__ */ jsx6("p", { className: "max-w-[300px] text-agg-sm leading-agg-5", children: sendCryptoLabels.addressLoadingDescription })
|
|
766
508
|
] })
|
|
767
509
|
]
|
|
768
510
|
}
|
|
@@ -789,7 +531,7 @@ var CryptoTransferStep = ({
|
|
|
789
531
|
onDone
|
|
790
532
|
}) => {
|
|
791
533
|
var _a;
|
|
792
|
-
const labels =
|
|
534
|
+
const labels = useLabels5();
|
|
793
535
|
const selectedNetworkOption = networkOptions.find((n) => n.value === selectedNetwork);
|
|
794
536
|
const networkLogoUrl = (_a = selectedNetworkOption == null ? void 0 : selectedNetworkOption.iconUrl) != null ? _a : "";
|
|
795
537
|
const networkLogo = selectedNetworkOption == null ? void 0 : selectedNetworkOption.icon;
|
|
@@ -798,29 +540,29 @@ var CryptoTransferStep = ({
|
|
|
798
540
|
selectedToken,
|
|
799
541
|
selectedNetwork
|
|
800
542
|
});
|
|
801
|
-
return /* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
543
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
544
|
+
/* @__PURE__ */ jsx6(
|
|
803
545
|
Modal.Header,
|
|
804
546
|
{
|
|
805
547
|
title: labels.deposit.sendCrypto.title,
|
|
806
548
|
hideBorder: true,
|
|
807
|
-
leftElement: /* @__PURE__ */
|
|
549
|
+
leftElement: /* @__PURE__ */ jsx6(
|
|
808
550
|
"button",
|
|
809
551
|
{
|
|
810
552
|
type: "button",
|
|
811
553
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
812
554
|
onClick: onBack,
|
|
813
555
|
"aria-label": "Go back",
|
|
814
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ jsx6(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
815
557
|
}
|
|
816
558
|
)
|
|
817
559
|
}
|
|
818
560
|
),
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ jsx6(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-7", children: [
|
|
562
|
+
/* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-5", children: /* @__PURE__ */ jsxs6("div", { className: "flex gap-5", children: [
|
|
563
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
564
|
+
/* @__PURE__ */ jsx6("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.tokenLabel }),
|
|
565
|
+
/* @__PURE__ */ jsx6(
|
|
824
566
|
Select,
|
|
825
567
|
{
|
|
826
568
|
items: tokenOptions,
|
|
@@ -830,9 +572,9 @@ var CryptoTransferStep = ({
|
|
|
830
572
|
}
|
|
831
573
|
)
|
|
832
574
|
] }),
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
576
|
+
/* @__PURE__ */ jsx6("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.networkLabel }),
|
|
577
|
+
/* @__PURE__ */ jsx6(
|
|
836
578
|
Select,
|
|
837
579
|
{
|
|
838
580
|
items: networkOptions,
|
|
@@ -843,7 +585,7 @@ var CryptoTransferStep = ({
|
|
|
843
585
|
)
|
|
844
586
|
] })
|
|
845
587
|
] }) }),
|
|
846
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ jsx6("div", { className: "mx-auto", children: isLoadingAddress ? /* @__PURE__ */ jsx6(CryptoAddressLoadingState, {}) : addressError ? /* @__PURE__ */ jsx6("div", { className: "flex h-[192px] w-[192px] items-center justify-center rounded-xl border border-agg-separator bg-agg-secondary", children: /* @__PURE__ */ jsx6("p", { className: "agg-type-label text-center text-agg-error px-3", children: addressError }) }) : /* @__PURE__ */ jsx6(
|
|
847
589
|
DepositQRCode,
|
|
848
590
|
{
|
|
849
591
|
depositAddress,
|
|
@@ -851,11 +593,11 @@ var CryptoTransferStep = ({
|
|
|
851
593
|
networkLogo
|
|
852
594
|
}
|
|
853
595
|
) }),
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
-
isLoadingAddress ? /* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-3", children: [
|
|
597
|
+
/* @__PURE__ */ jsx6("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.depositAddressLabel }),
|
|
598
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 rounded border border-agg-separator bg-agg-secondary h-10 px-3", children: [
|
|
599
|
+
isLoadingAddress ? /* @__PURE__ */ jsx6("div", { className: "h-4 flex-1 animate-pulse rounded bg-agg-muted-foreground/20" }) : /* @__PURE__ */ jsx6("p", { className: "agg-type-body flex-1 min-w-0 truncate text-agg-foreground", children: depositAddress }),
|
|
600
|
+
/* @__PURE__ */ jsx6(
|
|
859
601
|
CopyButton,
|
|
860
602
|
{
|
|
861
603
|
value: depositAddress,
|
|
@@ -867,7 +609,7 @@ var CryptoTransferStep = ({
|
|
|
867
609
|
}
|
|
868
610
|
)
|
|
869
611
|
] }),
|
|
870
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ jsx6(
|
|
871
613
|
TransferFeeSummary,
|
|
872
614
|
{
|
|
873
615
|
estimate: transferFeeEstimate,
|
|
@@ -877,11 +619,11 @@ var CryptoTransferStep = ({
|
|
|
877
619
|
}
|
|
878
620
|
)
|
|
879
621
|
] }),
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3 rounded-lg bg-agg-secondary-hover p-3", children: [
|
|
623
|
+
/* @__PURE__ */ jsx6(WarningIcon, { className: "h-4 w-4 text-agg-muted-foreground mt-0.5" }),
|
|
624
|
+
/* @__PURE__ */ jsx6("p", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: labels.deposit.sendCrypto.warning })
|
|
883
625
|
] }),
|
|
884
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ jsx6(
|
|
885
627
|
Button,
|
|
886
628
|
{
|
|
887
629
|
variant: "secondary",
|
|
@@ -896,8 +638,8 @@ var CryptoTransferStep = ({
|
|
|
896
638
|
};
|
|
897
639
|
|
|
898
640
|
// src/deposit/steps/deposit-method.tsx
|
|
899
|
-
import { useLabels as
|
|
900
|
-
import { Fragment as Fragment4, jsx as
|
|
641
|
+
import { useLabels as useLabels6 } from "@agg-build/hooks";
|
|
642
|
+
import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
901
643
|
var DepositMethodCard = ({
|
|
902
644
|
icon,
|
|
903
645
|
title,
|
|
@@ -906,7 +648,7 @@ var DepositMethodCard = ({
|
|
|
906
648
|
highlighted = false,
|
|
907
649
|
disabled = false,
|
|
908
650
|
onContinue
|
|
909
|
-
}) => /* @__PURE__ */
|
|
651
|
+
}) => /* @__PURE__ */ jsxs7(
|
|
910
652
|
"div",
|
|
911
653
|
{
|
|
912
654
|
className: cn(
|
|
@@ -928,13 +670,13 @@ var DepositMethodCard = ({
|
|
|
928
670
|
}
|
|
929
671
|
},
|
|
930
672
|
children: [
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ jsx7("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
674
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex-1 min-w-0", children: [
|
|
675
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-type-body-strong text-agg-foreground", children: title }),
|
|
676
|
+
/* @__PURE__ */ jsx7("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
935
677
|
] }),
|
|
936
|
-
value ? /* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
678
|
+
value ? /* @__PURE__ */ jsx7("p", { className: "agg-type-label text-agg-muted-foreground", children: value }) : null,
|
|
679
|
+
/* @__PURE__ */ jsx7("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx7(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
938
680
|
]
|
|
939
681
|
}
|
|
940
682
|
);
|
|
@@ -949,32 +691,32 @@ var DepositMethodStep = ({
|
|
|
949
691
|
depositAddressesReady = true,
|
|
950
692
|
onSelectMethod
|
|
951
693
|
}) => {
|
|
952
|
-
const labels =
|
|
953
|
-
return /* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
694
|
+
const labels = useLabels6();
|
|
695
|
+
return /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
696
|
+
/* @__PURE__ */ jsx7(Modal.Header, { title: labels.deposit.title, hideBorder: true }),
|
|
697
|
+
/* @__PURE__ */ jsx7(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-5", children: [
|
|
698
|
+
/* @__PURE__ */ jsxs7("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
957
699
|
labels.deposit.balancePrefix,
|
|
958
700
|
" ",
|
|
959
701
|
formatCompactUsd(balance)
|
|
960
702
|
] }),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
showWalletMethod ? /* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-4", children: [
|
|
704
|
+
showWalletMethod ? /* @__PURE__ */ jsx7(
|
|
963
705
|
DepositMethodCard,
|
|
964
706
|
{
|
|
965
|
-
icon: /* @__PURE__ */
|
|
707
|
+
icon: /* @__PURE__ */ jsx7(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
966
708
|
title: labels.deposit.methods.walletTitle(walletLabel),
|
|
967
709
|
description: labels.deposit.methods.walletDescription,
|
|
968
|
-
value: isWalletBalanceLoading ? /* @__PURE__ */
|
|
710
|
+
value: isWalletBalanceLoading ? /* @__PURE__ */ jsx7(LoadingIcon, { size: "small" }) : formatTokenAmount(walletBalance, walletToken),
|
|
969
711
|
highlighted: highlightedMethod === "wallet",
|
|
970
712
|
disabled: !depositAddressesReady,
|
|
971
713
|
onContinue: () => onSelectMethod("wallet")
|
|
972
714
|
}
|
|
973
715
|
) : null,
|
|
974
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ jsx7(
|
|
975
717
|
DepositMethodCard,
|
|
976
718
|
{
|
|
977
|
-
icon: /* @__PURE__ */
|
|
719
|
+
icon: /* @__PURE__ */ jsx7(BoltIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
978
720
|
title: labels.deposit.methods.cryptoTitle,
|
|
979
721
|
description: labels.deposit.methods.cryptoDescription,
|
|
980
722
|
highlighted: highlightedMethod === "crypto",
|
|
@@ -982,10 +724,10 @@ var DepositMethodStep = ({
|
|
|
982
724
|
onContinue: () => onSelectMethod("crypto")
|
|
983
725
|
}
|
|
984
726
|
),
|
|
985
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ jsx7(
|
|
986
728
|
DepositMethodCard,
|
|
987
729
|
{
|
|
988
|
-
icon: /* @__PURE__ */
|
|
730
|
+
icon: /* @__PURE__ */ jsx7(CreditCardIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
989
731
|
title: labels.deposit.methods.cardTitle,
|
|
990
732
|
description: labels.deposit.methods.cardDescription,
|
|
991
733
|
highlighted: highlightedMethod === "card",
|
|
@@ -998,8 +740,8 @@ var DepositMethodStep = ({
|
|
|
998
740
|
};
|
|
999
741
|
|
|
1000
742
|
// src/deposit/steps/wallet-form.tsx
|
|
1001
|
-
import { useLabels as
|
|
1002
|
-
import { Fragment as Fragment5, jsx as
|
|
743
|
+
import { useLabels as useLabels7 } from "@agg-build/hooks";
|
|
744
|
+
import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1003
745
|
var WalletFormStep = ({
|
|
1004
746
|
walletLabel,
|
|
1005
747
|
walletBalance,
|
|
@@ -1022,40 +764,40 @@ var WalletFormStep = ({
|
|
|
1022
764
|
onMax,
|
|
1023
765
|
onConfirm
|
|
1024
766
|
}) => {
|
|
1025
|
-
const labels =
|
|
767
|
+
const labels = useLabels7();
|
|
1026
768
|
const isConfirmEnabled = !isSubmitting && !isBalanceLoading && Number(amount) > 0 && Number(amount) <= walletBalance;
|
|
1027
|
-
return /* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
770
|
+
/* @__PURE__ */ jsx8(
|
|
1029
771
|
Modal.Header,
|
|
1030
772
|
{
|
|
1031
773
|
title: labels.deposit.walletFlow.title,
|
|
1032
774
|
hideBorder: true,
|
|
1033
|
-
leftElement: /* @__PURE__ */
|
|
775
|
+
leftElement: /* @__PURE__ */ jsx8(
|
|
1034
776
|
"button",
|
|
1035
777
|
{
|
|
1036
778
|
type: "button",
|
|
1037
779
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1038
780
|
onClick: onBack,
|
|
1039
781
|
"aria-label": "Go back",
|
|
1040
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */ jsx8(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1041
783
|
}
|
|
1042
784
|
)
|
|
1043
785
|
}
|
|
1044
786
|
),
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ jsx8(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-7", children: [
|
|
788
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
789
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label text-agg-foreground", children: walletLabel }),
|
|
790
|
+
/* @__PURE__ */ jsxs8("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1049
791
|
labels.deposit.balanceLabel,
|
|
1050
792
|
" ",
|
|
1051
|
-
isBalanceLoading ? /* @__PURE__ */
|
|
793
|
+
isBalanceLoading ? /* @__PURE__ */ jsx8(LoadingIcon, { size: "small" }) : formatTokenAmount(walletBalance, selectedToken)
|
|
1052
794
|
] })
|
|
1053
795
|
] }),
|
|
1054
|
-
/* @__PURE__ */
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-5", children: [
|
|
797
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex gap-5", children: [
|
|
798
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
799
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.tokenLabel }),
|
|
800
|
+
/* @__PURE__ */ jsx8(
|
|
1059
801
|
Select,
|
|
1060
802
|
{
|
|
1061
803
|
items: tokenOptions,
|
|
@@ -1065,9 +807,9 @@ var WalletFormStep = ({
|
|
|
1065
807
|
}
|
|
1066
808
|
)
|
|
1067
809
|
] }),
|
|
1068
|
-
networkOptions.length >= 1 ? /* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
810
|
+
networkOptions.length >= 1 ? /* @__PURE__ */ jsxs8("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
811
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.networkLabel }),
|
|
812
|
+
/* @__PURE__ */ jsx8(
|
|
1071
813
|
Select,
|
|
1072
814
|
{
|
|
1073
815
|
items: networkOptions,
|
|
@@ -1078,9 +820,9 @@ var WalletFormStep = ({
|
|
|
1078
820
|
)
|
|
1079
821
|
] }) : null
|
|
1080
822
|
] }),
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-2", children: [
|
|
824
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.amountLabel }),
|
|
825
|
+
/* @__PURE__ */ jsxs8(
|
|
1084
826
|
"div",
|
|
1085
827
|
{
|
|
1086
828
|
className: cn(
|
|
@@ -1089,7 +831,7 @@ var WalletFormStep = ({
|
|
|
1089
831
|
"h-10 px-3"
|
|
1090
832
|
),
|
|
1091
833
|
children: [
|
|
1092
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ jsx8(
|
|
1093
835
|
"input",
|
|
1094
836
|
{
|
|
1095
837
|
type: "text",
|
|
@@ -1101,7 +843,7 @@ var WalletFormStep = ({
|
|
|
1101
843
|
onChange: (event) => onAmountChange(event.target.value)
|
|
1102
844
|
}
|
|
1103
845
|
),
|
|
1104
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ jsx8(
|
|
1105
847
|
"button",
|
|
1106
848
|
{
|
|
1107
849
|
type: "button",
|
|
@@ -1115,8 +857,8 @@ var WalletFormStep = ({
|
|
|
1115
857
|
}
|
|
1116
858
|
)
|
|
1117
859
|
] }),
|
|
1118
|
-
estimatedReceive && feeEstimate && eta ? /* @__PURE__ */
|
|
1119
|
-
formErrorMessage ? /* @__PURE__ */
|
|
860
|
+
estimatedReceive && feeEstimate && eta ? /* @__PURE__ */ jsx8("p", { className: "agg-type-label text-agg-foreground", children: `\u2248 ${estimatedReceive} \xB7 ${labels.deposit.walletFlow.feePrefix} ${feeEstimate} \xB7 ${eta}` }) : null,
|
|
861
|
+
formErrorMessage ? /* @__PURE__ */ jsxs8(
|
|
1120
862
|
"div",
|
|
1121
863
|
{
|
|
1122
864
|
className: cn(
|
|
@@ -1124,13 +866,13 @@ var WalletFormStep = ({
|
|
|
1124
866
|
formErrorTone === "warning" ? "text-agg-warning" : "text-agg-error"
|
|
1125
867
|
),
|
|
1126
868
|
children: [
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ jsx8(WarningIcon, { className: "mt-0.5 h-4 w-4 shrink-0" }),
|
|
870
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label", children: formErrorMessage })
|
|
1129
871
|
]
|
|
1130
872
|
}
|
|
1131
873
|
) : null
|
|
1132
874
|
] }),
|
|
1133
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ jsx8(
|
|
1134
876
|
Button,
|
|
1135
877
|
{
|
|
1136
878
|
variant: isConfirmEnabled ? "primary" : "secondary",
|
|
@@ -1148,29 +890,29 @@ var WalletFormStep = ({
|
|
|
1148
890
|
};
|
|
1149
891
|
|
|
1150
892
|
// src/deposit/steps/wallet-processing.tsx
|
|
1151
|
-
import { useLabels as
|
|
893
|
+
import { useLabels as useLabels8 } from "@agg-build/hooks";
|
|
1152
894
|
import { useEffect as useEffect2 } from "react";
|
|
1153
|
-
import { Fragment as Fragment6, jsx as
|
|
895
|
+
import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1154
896
|
var WalletProcessingStep = ({
|
|
1155
897
|
steps,
|
|
1156
898
|
errorMessage,
|
|
1157
899
|
onComplete
|
|
1158
900
|
}) => {
|
|
1159
|
-
const labels =
|
|
901
|
+
const labels = useLabels8();
|
|
1160
902
|
useEffect2(() => {
|
|
1161
903
|
const allDone = steps.length > 0 && steps.every((s) => s.status === "complete");
|
|
1162
904
|
if (allDone) {
|
|
1163
905
|
onComplete();
|
|
1164
906
|
}
|
|
1165
907
|
}, [steps, onComplete]);
|
|
1166
|
-
return /* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
909
|
+
/* @__PURE__ */ jsx9(Modal.Header, { title: labels.deposit.processingTitle, hideBorder: true }),
|
|
910
|
+
/* @__PURE__ */ jsx9(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-5", children: [
|
|
1169
911
|
steps.map((step) => {
|
|
1170
912
|
const isComplete = step.status === "complete";
|
|
1171
913
|
const isActive = step.status === "active";
|
|
1172
|
-
return /* @__PURE__ */
|
|
1173
|
-
isComplete ? /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
915
|
+
isComplete ? /* @__PURE__ */ jsx9(CheckCircleIcon, { className: "h-4 w-4 text-agg-primary" }) : /* @__PURE__ */ jsx9(
|
|
1174
916
|
"span",
|
|
1175
917
|
{
|
|
1176
918
|
className: [
|
|
@@ -1180,7 +922,7 @@ var WalletProcessingStep = ({
|
|
|
1180
922
|
].join(" ")
|
|
1181
923
|
}
|
|
1182
924
|
),
|
|
1183
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ jsx9(
|
|
1184
926
|
"p",
|
|
1185
927
|
{
|
|
1186
928
|
className: isComplete || isActive ? "agg-type-body text-agg-foreground" : "agg-type-body text-agg-muted-foreground",
|
|
@@ -1189,60 +931,60 @@ var WalletProcessingStep = ({
|
|
|
1189
931
|
)
|
|
1190
932
|
] }, step.id);
|
|
1191
933
|
}),
|
|
1192
|
-
errorMessage ? /* @__PURE__ */
|
|
934
|
+
errorMessage ? /* @__PURE__ */ jsx9("p", { className: "agg-type-body text-agg-destructive", children: errorMessage }) : null
|
|
1193
935
|
] }) })
|
|
1194
936
|
] });
|
|
1195
937
|
};
|
|
1196
938
|
|
|
1197
939
|
// src/deposit/steps/wallet-success.tsx
|
|
1198
|
-
import { useLabels as
|
|
1199
|
-
import { jsx as
|
|
1200
|
-
var SummaryRow2 = ({ label, value }) => /* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
940
|
+
import { useLabels as useLabels9 } from "@agg-build/hooks";
|
|
941
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
942
|
+
var SummaryRow2 = ({ label, value }) => /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
943
|
+
/* @__PURE__ */ jsx10("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
944
|
+
/* @__PURE__ */ jsx10("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
1203
945
|
] });
|
|
1204
946
|
var WalletSuccessStep = ({
|
|
1205
947
|
summary,
|
|
1206
948
|
onDone,
|
|
1207
949
|
onClose
|
|
1208
950
|
}) => {
|
|
1209
|
-
const labels =
|
|
1210
|
-
return /* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
951
|
+
const labels = useLabels9();
|
|
952
|
+
return /* @__PURE__ */ jsx10("div", { className: "relative", children: /* @__PURE__ */ jsxs10(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
953
|
+
/* @__PURE__ */ jsx10(
|
|
1212
954
|
"button",
|
|
1213
955
|
{
|
|
1214
956
|
type: "button",
|
|
1215
957
|
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
1216
958
|
onClick: onClose,
|
|
1217
959
|
"aria-label": labels.common.close,
|
|
1218
|
-
children: /* @__PURE__ */
|
|
960
|
+
children: /* @__PURE__ */ jsx10(CloseIcon, { className: "h-6 w-6" })
|
|
1219
961
|
}
|
|
1220
962
|
),
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center gap-8", children: [
|
|
964
|
+
/* @__PURE__ */ jsx10("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full bg-agg-success/15", children: /* @__PURE__ */ jsx10(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" }) }),
|
|
965
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
966
|
+
/* @__PURE__ */ jsx10("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.successTitle }),
|
|
967
|
+
/* @__PURE__ */ jsx10("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.successDescription })
|
|
1226
968
|
] }),
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ jsxs10("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
970
|
+
/* @__PURE__ */ jsx10(
|
|
1229
971
|
SummaryRow2,
|
|
1230
972
|
{
|
|
1231
973
|
label: labels.deposit.summary.amountReceived,
|
|
1232
974
|
value: summary.amountReceived
|
|
1233
975
|
}
|
|
1234
976
|
),
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ jsx10(SummaryRow2, { label: labels.deposit.summary.network, value: summary.network }),
|
|
978
|
+
/* @__PURE__ */ jsx10(SummaryRow2, { label: labels.deposit.summary.fromWallet, value: summary.fromWallet }),
|
|
979
|
+
/* @__PURE__ */ jsx10(SummaryRow2, { label: labels.deposit.summary.gasFee, value: summary.gasFee })
|
|
1238
980
|
] }),
|
|
1239
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ jsx10(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.deposit.done })
|
|
1240
982
|
] })
|
|
1241
983
|
] }) });
|
|
1242
984
|
};
|
|
1243
985
|
|
|
1244
986
|
// src/deposit/index.tsx
|
|
1245
|
-
import { jsx as
|
|
987
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1246
988
|
var PENDING_CARD_SESSION_KEY = "agg-pending-card-session";
|
|
1247
989
|
var DEFAULT_WALLET_CHAIN_ID = "1";
|
|
1248
990
|
var DEFAULT_WALLET_TOKEN = "USDC";
|
|
@@ -1292,7 +1034,7 @@ function isControlledDepositModalProps(props) {
|
|
|
1292
1034
|
}
|
|
1293
1035
|
function DepositModalSelfDriven({ open, onOpenChange }) {
|
|
1294
1036
|
const depositProps = useDepositFlow({ open, onOpenChange });
|
|
1295
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ jsx11(DepositModalControlled, __spreadValues({}, depositProps));
|
|
1296
1038
|
}
|
|
1297
1039
|
function DepositModalControlled({
|
|
1298
1040
|
open,
|
|
@@ -1328,7 +1070,7 @@ function DepositModalControlled({
|
|
|
1328
1070
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1329
1071
|
const { isWeb3User } = useAggAuthState();
|
|
1330
1072
|
const { walletActions } = useAggUiConfig();
|
|
1331
|
-
const labels =
|
|
1073
|
+
const labels = useLabels10();
|
|
1332
1074
|
const defaultMethod = isWeb3User ? "wallet" : "crypto";
|
|
1333
1075
|
const [step, setStep] = useState2(
|
|
1334
1076
|
() => pendingCardPurchaseSummary ? "card-success" : "method"
|
|
@@ -1612,8 +1354,8 @@ function DepositModalControlled({
|
|
|
1612
1354
|
onOpenChange(isOpen);
|
|
1613
1355
|
};
|
|
1614
1356
|
const depositModalMaxWidth = step === "method" ? "600px" : "480px";
|
|
1615
|
-
return /* @__PURE__ */
|
|
1616
|
-
step === "method" ? /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ jsx11(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs11(Modal.Container, { maxWidth: depositModalMaxWidth, "aria-label": "Deposit", children: [
|
|
1358
|
+
step === "method" ? /* @__PURE__ */ jsx11(
|
|
1617
1359
|
DepositMethodStep,
|
|
1618
1360
|
{
|
|
1619
1361
|
balance: walletFlow.balance,
|
|
@@ -1627,7 +1369,7 @@ function DepositModalControlled({
|
|
|
1627
1369
|
onSelectMethod: handleSelectMethod
|
|
1628
1370
|
}
|
|
1629
1371
|
) : null,
|
|
1630
|
-
step === "wallet-form" ? /* @__PURE__ */
|
|
1372
|
+
step === "wallet-form" ? /* @__PURE__ */ jsx11(
|
|
1631
1373
|
WalletFormStep,
|
|
1632
1374
|
{
|
|
1633
1375
|
walletLabel: walletFlow.walletLabel,
|
|
@@ -1693,7 +1435,7 @@ function DepositModalControlled({
|
|
|
1693
1435
|
})
|
|
1694
1436
|
}
|
|
1695
1437
|
) : null,
|
|
1696
|
-
step === "wallet-processing" ? /* @__PURE__ */
|
|
1438
|
+
step === "wallet-processing" ? /* @__PURE__ */ jsx11(
|
|
1697
1439
|
WalletProcessingStep,
|
|
1698
1440
|
{
|
|
1699
1441
|
steps: processingSteps,
|
|
@@ -1701,7 +1443,7 @@ function DepositModalControlled({
|
|
|
1701
1443
|
onComplete: () => setStep("wallet-success")
|
|
1702
1444
|
}
|
|
1703
1445
|
) : null,
|
|
1704
|
-
step === "wallet-success" ? /* @__PURE__ */
|
|
1446
|
+
step === "wallet-success" ? /* @__PURE__ */ jsx11(
|
|
1705
1447
|
WalletSuccessStep,
|
|
1706
1448
|
{
|
|
1707
1449
|
summary: resolvedSuccessSummary,
|
|
@@ -1709,7 +1451,7 @@ function DepositModalControlled({
|
|
|
1709
1451
|
onClose: () => handleOpenChange(false)
|
|
1710
1452
|
}
|
|
1711
1453
|
) : null,
|
|
1712
|
-
step === "card-deposit" && cardFlow ? /* @__PURE__ */
|
|
1454
|
+
step === "card-deposit" && cardFlow ? /* @__PURE__ */ jsx11(
|
|
1713
1455
|
CardDepositStep,
|
|
1714
1456
|
{
|
|
1715
1457
|
amount: cardFlow.amount,
|
|
@@ -1727,7 +1469,7 @@ function DepositModalControlled({
|
|
|
1727
1469
|
onContinue: handleContinueCardDeposit
|
|
1728
1470
|
}
|
|
1729
1471
|
) : null,
|
|
1730
|
-
step === "card-provider" && cardFlow ? /* @__PURE__ */
|
|
1472
|
+
step === "card-provider" && cardFlow ? /* @__PURE__ */ jsx11(
|
|
1731
1473
|
CardProviderStep,
|
|
1732
1474
|
{
|
|
1733
1475
|
amount: cardFlow.amount,
|
|
@@ -1742,7 +1484,7 @@ function DepositModalControlled({
|
|
|
1742
1484
|
onRetry: handleRetryQuotes
|
|
1743
1485
|
}
|
|
1744
1486
|
) : null,
|
|
1745
|
-
step === "card-payment-pending" ? /* @__PURE__ */
|
|
1487
|
+
step === "card-payment-pending" ? /* @__PURE__ */ jsx11(
|
|
1746
1488
|
CardPaymentPendingStep,
|
|
1747
1489
|
{
|
|
1748
1490
|
providerName: pendingProviderName,
|
|
@@ -1752,7 +1494,7 @@ function DepositModalControlled({
|
|
|
1752
1494
|
onChooseAnotherProvider: handleChooseAnotherProvider
|
|
1753
1495
|
}
|
|
1754
1496
|
) : null,
|
|
1755
|
-
step === "card-success" ? /* @__PURE__ */
|
|
1497
|
+
step === "card-success" ? /* @__PURE__ */ jsx11(
|
|
1756
1498
|
CardPurchaseSuccessStep,
|
|
1757
1499
|
{
|
|
1758
1500
|
summary: (_g = pendingCardPurchaseSummary != null ? pendingCardPurchaseSummary : cardFlow == null ? void 0 : cardFlow.purchaseSummary) != null ? _g : {
|
|
@@ -1764,7 +1506,7 @@ function DepositModalControlled({
|
|
|
1764
1506
|
onDone: handleDoneCardPurchase
|
|
1765
1507
|
}
|
|
1766
1508
|
) : null,
|
|
1767
|
-
step === "crypto-transfer" ? /* @__PURE__ */
|
|
1509
|
+
step === "crypto-transfer" ? /* @__PURE__ */ jsx11(
|
|
1768
1510
|
CryptoTransferStep,
|
|
1769
1511
|
{
|
|
1770
1512
|
tokenOptions: sendTokenOptions,
|
|
@@ -1793,696 +1535,15 @@ var ignoreCardChange = (_value) => {
|
|
|
1793
1535
|
};
|
|
1794
1536
|
var DepositModal = (props) => {
|
|
1795
1537
|
if (!isControlledDepositModalProps(props)) {
|
|
1796
|
-
return /* @__PURE__ */
|
|
1538
|
+
return /* @__PURE__ */ jsx11(DepositModalSelfDriven, __spreadValues({}, props));
|
|
1797
1539
|
}
|
|
1798
|
-
return /* @__PURE__ */
|
|
1540
|
+
return /* @__PURE__ */ jsx11(DepositModalControlled, __spreadValues({}, props));
|
|
1799
1541
|
};
|
|
1800
1542
|
DepositModal.displayName = "DepositModal";
|
|
1801
1543
|
|
|
1802
|
-
// src/withdraw/index.tsx
|
|
1803
|
-
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
1804
|
-
import { useWithdrawalLifecycle, useWithdrawFlow } from "@agg-build/hooks/withdraw";
|
|
1805
|
-
|
|
1806
|
-
// src/withdraw/steps/withdraw-method.tsx
|
|
1807
|
-
import { useLabels as useLabels12 } from "@agg-build/hooks";
|
|
1808
|
-
import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1809
|
-
var WithdrawMethodStep = ({
|
|
1810
|
-
balance,
|
|
1811
|
-
onSelectMethod
|
|
1812
|
-
}) => {
|
|
1813
|
-
const labels = useLabels12();
|
|
1814
|
-
return /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
1815
|
-
/* @__PURE__ */ jsx13(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
|
|
1816
|
-
/* @__PURE__ */ jsx13(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-5", children: [
|
|
1817
|
-
/* @__PURE__ */ jsxs13("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
1818
|
-
labels.withdraw.balancePrefix,
|
|
1819
|
-
" ",
|
|
1820
|
-
formatCompactUsd(balance)
|
|
1821
|
-
] }),
|
|
1822
|
-
/* @__PURE__ */ jsxs13(
|
|
1823
|
-
"div",
|
|
1824
|
-
{
|
|
1825
|
-
className: cn(
|
|
1826
|
-
"flex items-center gap-3 sm:gap-4 rounded-xl border border-agg-separator bg-agg-secondary p-3 sm:p-4",
|
|
1827
|
-
"hover:bg-agg-secondary-hover transition-colors cursor-pointer"
|
|
1828
|
-
),
|
|
1829
|
-
role: "button",
|
|
1830
|
-
tabIndex: 0,
|
|
1831
|
-
onClick: () => onSelectMethod("wallet"),
|
|
1832
|
-
onKeyDown: (e) => {
|
|
1833
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1834
|
-
e.preventDefault();
|
|
1835
|
-
onSelectMethod("wallet");
|
|
1836
|
-
}
|
|
1837
|
-
},
|
|
1838
|
-
children: [
|
|
1839
|
-
/* @__PURE__ */ jsx13("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: /* @__PURE__ */ jsx13(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }) }),
|
|
1840
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
1841
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-body-strong text-agg-foreground", children: labels.withdraw.methods.walletTitle }),
|
|
1842
|
-
/* @__PURE__ */ jsx13("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.withdraw.methods.walletDescription })
|
|
1843
|
-
] }),
|
|
1844
|
-
/* @__PURE__ */ jsx13("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx13(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
1845
|
-
]
|
|
1846
|
-
}
|
|
1847
|
-
)
|
|
1848
|
-
] }) })
|
|
1849
|
-
] });
|
|
1850
|
-
};
|
|
1851
|
-
|
|
1852
|
-
// src/withdraw/steps/withdraw-amount.tsx
|
|
1853
|
-
import { useLabels as useLabels13, useWithdrawPreview } from "@agg-build/hooks";
|
|
1854
|
-
import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1855
|
-
var formatRawTokenAmount = (rawAmount, decimals) => {
|
|
1856
|
-
if (!rawAmount) return "0";
|
|
1857
|
-
const raw = BigInt(rawAmount);
|
|
1858
|
-
const divisor = BigInt(`1${"0".repeat(decimals)}`);
|
|
1859
|
-
const whole = raw / divisor;
|
|
1860
|
-
const remainder = raw % divisor;
|
|
1861
|
-
if (remainder === BigInt(0)) return whole.toString();
|
|
1862
|
-
return `${whole.toString()}.${remainder.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
1863
|
-
};
|
|
1864
|
-
var parseTokenAmountToRaw = (amount, decimals) => {
|
|
1865
|
-
const normalizedAmount = amount.trim();
|
|
1866
|
-
if (!normalizedAmount || !/^\d*(?:\.\d*)?$/.test(normalizedAmount)) return null;
|
|
1867
|
-
const [wholePart = "0", fractionalPart = ""] = normalizedAmount.split(".");
|
|
1868
|
-
if (fractionalPart.length > decimals) return null;
|
|
1869
|
-
const normalizedWhole = wholePart === "" ? "0" : wholePart;
|
|
1870
|
-
const normalizedFraction = fractionalPart.padEnd(decimals, "0");
|
|
1871
|
-
try {
|
|
1872
|
-
return `${BigInt(normalizedWhole)}${normalizedFraction}`.replace(/^0+(?=\d)/, "");
|
|
1873
|
-
} catch (e) {
|
|
1874
|
-
return null;
|
|
1875
|
-
}
|
|
1876
|
-
};
|
|
1877
|
-
var WithdrawAmountStep = ({
|
|
1878
|
-
amount,
|
|
1879
|
-
destinationWallet,
|
|
1880
|
-
balanceDisplay,
|
|
1881
|
-
tokenOptions,
|
|
1882
|
-
networkOptions,
|
|
1883
|
-
selectedToken,
|
|
1884
|
-
selectedNetwork,
|
|
1885
|
-
destDecimals,
|
|
1886
|
-
isConfirming = false,
|
|
1887
|
-
error,
|
|
1888
|
-
max = false,
|
|
1889
|
-
onBack,
|
|
1890
|
-
onAmountChange,
|
|
1891
|
-
onDestinationChange,
|
|
1892
|
-
onTokenChange,
|
|
1893
|
-
onNetworkChange,
|
|
1894
|
-
onMaxClick,
|
|
1895
|
-
onContinue
|
|
1896
|
-
}) => {
|
|
1897
|
-
var _a, _b, _c, _d;
|
|
1898
|
-
const labels = useLabels13();
|
|
1899
|
-
const SOLANA_CHAIN_ID = "792703809";
|
|
1900
|
-
const isSolanaDest = selectedNetwork === SOLANA_CHAIN_ID;
|
|
1901
|
-
const trimmedDestination = destinationWallet.trim();
|
|
1902
|
-
const isValidAddress = isSolanaDest ? /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(trimmedDestination) : /^0x[a-fA-F0-9]{40}$/.test(trimmedDestination);
|
|
1903
|
-
const isValid = Number(amount) > 0 && isValidAddress;
|
|
1904
|
-
const amountRaw = amount && Number(amount) > 0 ? parseTokenAmountToRaw(amount, destDecimals) : null;
|
|
1905
|
-
const destinationChainId = Number(selectedNetwork) || null;
|
|
1906
|
-
const preview = useWithdrawPreview({
|
|
1907
|
-
amountRaw,
|
|
1908
|
-
tokenSymbol: selectedToken || null,
|
|
1909
|
-
destinationChainId,
|
|
1910
|
-
destinationAddress: trimmedDestination || null,
|
|
1911
|
-
max
|
|
1912
|
-
});
|
|
1913
|
-
const previewUnviable = ((_a = preview.data) == null ? void 0 : _a.pricingStatus) === "unviable";
|
|
1914
|
-
const previewUnviableMessage = previewUnviable ? ((_b = preview.data) == null ? void 0 : _b.maxDeliverableRaw) != null && BigInt(preview.data.maxDeliverableRaw) > BigInt(0) ? `Amount exceeds your withdrawable balance. Max: ~${formatRawTokenAmount(preview.data.maxDeliverableRaw, destDecimals)} ${selectedToken}` : (_d = (_c = preview.data) == null ? void 0 : _c.unviableReason) != null ? _d : "This amount can't be withdrawn right now." : null;
|
|
1915
|
-
const previewLoading = preview.isFetching;
|
|
1916
|
-
const isDisabled = !isValid || isConfirming || previewUnviable || previewLoading;
|
|
1917
|
-
const withdrawEstimate = preview.data && preview.data.pricingStatus === "quoted" ? {
|
|
1918
|
-
estimatedFees: preview.data.feeRaw != null ? `~${formatRawTokenAmount(preview.data.feeRaw, destDecimals)} ${selectedToken}` : "\u2014",
|
|
1919
|
-
networkReserve: preview.data.networkFeeRaw != null ? `~${formatRawTokenAmount(preview.data.networkFeeRaw, destDecimals)} ${selectedToken}` : "\u2014",
|
|
1920
|
-
youReceive: preview.data.receiveAmountRaw != null ? `~${formatRawTokenAmount(preview.data.receiveAmountRaw, destDecimals)} ${selectedToken}` : "\u2014"
|
|
1921
|
-
} : null;
|
|
1922
|
-
const shouldShowWithdrawEstimate = Boolean(withdrawEstimate);
|
|
1923
|
-
return /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
1924
|
-
/* @__PURE__ */ jsx14(
|
|
1925
|
-
Modal.Header,
|
|
1926
|
-
{
|
|
1927
|
-
title: labels.withdraw.walletFlow.title,
|
|
1928
|
-
hideBorder: true,
|
|
1929
|
-
leftElement: /* @__PURE__ */ jsx14(
|
|
1930
|
-
"button",
|
|
1931
|
-
{
|
|
1932
|
-
type: "button",
|
|
1933
|
-
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1934
|
-
onClick: onBack,
|
|
1935
|
-
"aria-label": labels.withdraw.back,
|
|
1936
|
-
children: /* @__PURE__ */ jsx14(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1937
|
-
}
|
|
1938
|
-
)
|
|
1939
|
-
}
|
|
1940
|
-
),
|
|
1941
|
-
/* @__PURE__ */ jsx14(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-5", children: [
|
|
1942
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-5", children: [
|
|
1943
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-2", children: [
|
|
1944
|
-
/* @__PURE__ */ jsx14("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.recipientAddressLabel }),
|
|
1945
|
-
/* @__PURE__ */ jsx14(
|
|
1946
|
-
"input",
|
|
1947
|
-
{
|
|
1948
|
-
type: "text",
|
|
1949
|
-
"aria-label": labels.withdraw.walletFlow.recipientAddressLabel,
|
|
1950
|
-
className: cn(
|
|
1951
|
-
"agg-type-body w-full h-10 rounded border border-agg-separator bg-agg-secondary px-3 outline-none",
|
|
1952
|
-
"text-agg-foreground placeholder:text-agg-muted-foreground",
|
|
1953
|
-
"focus:border-agg-primary transition-colors"
|
|
1954
|
-
),
|
|
1955
|
-
placeholder: isSolanaDest ? "FwR3..." : "0x971d...",
|
|
1956
|
-
value: destinationWallet,
|
|
1957
|
-
onChange: (e) => onDestinationChange(e.target.value)
|
|
1958
|
-
}
|
|
1959
|
-
)
|
|
1960
|
-
] }),
|
|
1961
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-2", children: [
|
|
1962
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
1963
|
-
/* @__PURE__ */ jsx14("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.amountLabel }),
|
|
1964
|
-
/* @__PURE__ */ jsxs14("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1965
|
-
labels.withdraw.balancePrefix,
|
|
1966
|
-
" ",
|
|
1967
|
-
balanceDisplay
|
|
1968
|
-
] })
|
|
1969
|
-
] }),
|
|
1970
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3 focus-within:border-agg-primary transition-colors", children: [
|
|
1971
|
-
/* @__PURE__ */ jsx14(
|
|
1972
|
-
"input",
|
|
1973
|
-
{
|
|
1974
|
-
type: "text",
|
|
1975
|
-
inputMode: "decimal",
|
|
1976
|
-
"aria-label": labels.withdraw.walletFlow.amountLabel,
|
|
1977
|
-
className: cn(
|
|
1978
|
-
"agg-type-body flex-1 min-w-0 bg-transparent outline-none",
|
|
1979
|
-
Number(amount) > 0 ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
1980
|
-
),
|
|
1981
|
-
placeholder: "0.00",
|
|
1982
|
-
value: amount,
|
|
1983
|
-
onChange: (e) => onAmountChange(e.target.value)
|
|
1984
|
-
}
|
|
1985
|
-
),
|
|
1986
|
-
/* @__PURE__ */ jsx14("span", { className: "agg-type-body text-agg-muted-foreground shrink-0", children: selectedToken }),
|
|
1987
|
-
onMaxClick ? /* @__PURE__ */ jsx14(
|
|
1988
|
-
"button",
|
|
1989
|
-
{
|
|
1990
|
-
type: "button",
|
|
1991
|
-
className: "agg-type-label-strong text-agg-primary hover:opacity-80 transition-opacity cursor-pointer shrink-0",
|
|
1992
|
-
onClick: onMaxClick,
|
|
1993
|
-
children: labels.withdraw.walletFlow.max
|
|
1994
|
-
}
|
|
1995
|
-
) : null
|
|
1996
|
-
] })
|
|
1997
|
-
] }),
|
|
1998
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 sm:flex-row sm:gap-5", children: [
|
|
1999
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
2000
|
-
/* @__PURE__ */ jsx14("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.tokenLabel }),
|
|
2001
|
-
/* @__PURE__ */ jsx14(
|
|
2002
|
-
Select,
|
|
2003
|
-
{
|
|
2004
|
-
items: tokenOptions,
|
|
2005
|
-
value: selectedToken,
|
|
2006
|
-
onChange: onTokenChange,
|
|
2007
|
-
ariaLabel: labels.withdraw.walletFlow.tokenLabel
|
|
2008
|
-
}
|
|
2009
|
-
)
|
|
2010
|
-
] }),
|
|
2011
|
-
/* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
2012
|
-
/* @__PURE__ */ jsx14("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.walletFlow.networkLabel }),
|
|
2013
|
-
/* @__PURE__ */ jsx14(
|
|
2014
|
-
Select,
|
|
2015
|
-
{
|
|
2016
|
-
items: networkOptions,
|
|
2017
|
-
value: selectedNetwork,
|
|
2018
|
-
onChange: onNetworkChange,
|
|
2019
|
-
ariaLabel: labels.withdraw.walletFlow.networkLabel
|
|
2020
|
-
}
|
|
2021
|
-
)
|
|
2022
|
-
] })
|
|
2023
|
-
] }),
|
|
2024
|
-
shouldShowWithdrawEstimate && withdrawEstimate ? /* @__PURE__ */ jsx14(TransferFeeSummary, { estimate: withdrawEstimate, view: "withdraw" }) : null,
|
|
2025
|
-
previewUnviableMessage ? /* @__PURE__ */ jsx14("p", { className: "agg-type-label text-agg-error", role: "alert", children: previewUnviableMessage }) : null
|
|
2026
|
-
] }),
|
|
2027
|
-
/* @__PURE__ */ jsx14(
|
|
2028
|
-
Button,
|
|
2029
|
-
{
|
|
2030
|
-
variant: isValid && !isConfirming && !previewUnviable && !previewLoading ? "primary" : "secondary",
|
|
2031
|
-
size: "large",
|
|
2032
|
-
className: "w-full",
|
|
2033
|
-
disabled: isDisabled,
|
|
2034
|
-
prefix: previewLoading && !isConfirming ? /* @__PURE__ */ jsx14(LoadingIcon, { size: "small", className: "mr-2 text-current" }) : void 0,
|
|
2035
|
-
onClick: onContinue,
|
|
2036
|
-
children: isConfirming ? labels.common.loading : previewLoading ? labels.withdraw.walletFlow.calculatingFees : labels.withdraw.walletFlow.confirm
|
|
2037
|
-
}
|
|
2038
|
-
),
|
|
2039
|
-
error ? /* @__PURE__ */ jsx14("p", { className: "agg-type-label text-agg-error text-center", role: "alert", children: error }) : null
|
|
2040
|
-
] }) })
|
|
2041
|
-
] });
|
|
2042
|
-
};
|
|
2043
|
-
|
|
2044
|
-
// src/withdraw/steps/withdraw-success.tsx
|
|
2045
|
-
import { useLabels as useLabels14, useSdkUiConfig } from "@agg-build/hooks";
|
|
2046
|
-
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2047
|
-
var SummaryRow3 = ({ label, value }) => /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between gap-4 border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
2048
|
-
/* @__PURE__ */ jsx15("p", { className: "min-w-0 text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
2049
|
-
/* @__PURE__ */ jsx15("p", { className: "min-w-0 text-right text-[14px] leading-5 text-agg-foreground", children: value })
|
|
2050
|
-
] });
|
|
2051
|
-
var WithdrawCloseButton = ({ onClose, label }) => /* @__PURE__ */ jsx15(
|
|
2052
|
-
"button",
|
|
2053
|
-
{
|
|
2054
|
-
type: "button",
|
|
2055
|
-
className: "absolute right-8 top-7 flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
2056
|
-
onClick: onClose,
|
|
2057
|
-
"aria-label": label,
|
|
2058
|
-
children: /* @__PURE__ */ jsx15(CloseIcon, { className: "h-6 w-6" })
|
|
2059
|
-
}
|
|
2060
|
-
);
|
|
2061
|
-
var LoadingGlyph = ({
|
|
2062
|
-
className,
|
|
2063
|
-
enableAnimations
|
|
2064
|
-
}) => /* @__PURE__ */ jsx15(
|
|
2065
|
-
"span",
|
|
2066
|
-
{
|
|
2067
|
-
"aria-hidden": "true",
|
|
2068
|
-
className: cn(
|
|
2069
|
-
"inline-block rounded-full border-2 border-current border-r-transparent",
|
|
2070
|
-
getMotionClassName(enableAnimations, "animate-spin"),
|
|
2071
|
-
className
|
|
2072
|
-
)
|
|
2073
|
-
}
|
|
2074
|
-
);
|
|
2075
|
-
var loadingActiveIndexFor = (state) => {
|
|
2076
|
-
if (state.status === "transferring") return 2;
|
|
2077
|
-
if (state.status === "bridging") return 1;
|
|
2078
|
-
return 0;
|
|
2079
|
-
};
|
|
2080
|
-
var getLoadingSteps = (labels) => [
|
|
2081
|
-
{ id: "preparing", label: labels.lifecycle.loadingSteps.preparing },
|
|
2082
|
-
{ id: "bridging", label: labels.lifecycle.loadingSteps.bridging },
|
|
2083
|
-
{ id: "sending", label: labels.lifecycle.loadingSteps.sending },
|
|
2084
|
-
{ id: "confirming", label: labels.lifecycle.loadingSteps.confirming }
|
|
2085
|
-
];
|
|
2086
|
-
var WithdrawLoadingStep = ({
|
|
2087
|
-
lifecycleState,
|
|
2088
|
-
onClose
|
|
2089
|
-
}) => {
|
|
2090
|
-
const labels = useLabels14();
|
|
2091
|
-
const {
|
|
2092
|
-
features: { enableAnimations }
|
|
2093
|
-
} = useSdkUiConfig();
|
|
2094
|
-
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
2095
|
-
const activeIndex = loadingActiveIndexFor(lifecycleState);
|
|
2096
|
-
const loadingSteps = getLoadingSteps(walletFlowLabels);
|
|
2097
|
-
return /* @__PURE__ */ jsx15("div", { className: "relative", children: /* @__PURE__ */ jsx15(Modal.Body, { classNames: { root: "px-8 py-7" }, children: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-7", children: [
|
|
2098
|
-
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2099
|
-
/* @__PURE__ */ jsx15("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: walletFlowLabels.successTitle }),
|
|
2100
|
-
/* @__PURE__ */ jsx15(
|
|
2101
|
-
"button",
|
|
2102
|
-
{
|
|
2103
|
-
type: "button",
|
|
2104
|
-
className: "flex cursor-pointer items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
|
|
2105
|
-
onClick: onClose,
|
|
2106
|
-
"aria-label": labels.common.close,
|
|
2107
|
-
children: /* @__PURE__ */ jsx15(CloseIcon, { className: "h-6 w-6" })
|
|
2108
|
-
}
|
|
2109
|
-
)
|
|
2110
|
-
] }),
|
|
2111
|
-
/* @__PURE__ */ jsx15("div", { className: "flex flex-col gap-5", role: "status", "aria-live": "polite", children: loadingSteps.map((step, index) => {
|
|
2112
|
-
const isComplete = index < activeIndex;
|
|
2113
|
-
const isActive = index === activeIndex;
|
|
2114
|
-
const textClassName = isActive || isComplete ? "text-agg-foreground" : "text-agg-muted-foreground";
|
|
2115
|
-
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-3", children: [
|
|
2116
|
-
isComplete ? /* @__PURE__ */ jsx15(
|
|
2117
|
-
Icon,
|
|
2118
|
-
{
|
|
2119
|
-
name: "check-circle",
|
|
2120
|
-
size: "small",
|
|
2121
|
-
className: "h-4 w-4 shrink-0 text-agg-primary",
|
|
2122
|
-
"aria-hidden": "true"
|
|
2123
|
-
}
|
|
2124
|
-
) : null,
|
|
2125
|
-
isActive ? /* @__PURE__ */ jsx15(
|
|
2126
|
-
LoadingGlyph,
|
|
2127
|
-
{
|
|
2128
|
-
enableAnimations,
|
|
2129
|
-
className: "h-4 w-4 shrink-0 text-agg-primary"
|
|
2130
|
-
}
|
|
2131
|
-
) : null,
|
|
2132
|
-
!isComplete && !isActive ? /* @__PURE__ */ jsx15(
|
|
2133
|
-
"span",
|
|
2134
|
-
{
|
|
2135
|
-
"aria-hidden": "true",
|
|
2136
|
-
className: "h-4 w-4 shrink-0 rounded-full border border-agg-separator"
|
|
2137
|
-
}
|
|
2138
|
-
) : null,
|
|
2139
|
-
/* @__PURE__ */ jsx15("p", { className: cn("min-w-0 flex-1 text-agg-base leading-agg-6", textClassName), children: step.label })
|
|
2140
|
-
] }, step.id);
|
|
2141
|
-
}) }),
|
|
2142
|
-
/* @__PURE__ */ jsx15("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: walletFlowLabels.loadingDescription })
|
|
2143
|
-
] }) }) });
|
|
2144
|
-
};
|
|
2145
|
-
var resultCopyFor = ({
|
|
2146
|
-
status,
|
|
2147
|
-
tokenSymbol,
|
|
2148
|
-
labels
|
|
2149
|
-
}) => {
|
|
2150
|
-
if (status === "failed") {
|
|
2151
|
-
return {
|
|
2152
|
-
title: labels.successTitleFailed,
|
|
2153
|
-
description: labels.successDescriptionFailed(tokenSymbol)
|
|
2154
|
-
};
|
|
2155
|
-
}
|
|
2156
|
-
if (status === "partial_success") {
|
|
2157
|
-
return {
|
|
2158
|
-
title: labels.successTitlePartial,
|
|
2159
|
-
description: labels.successDescriptionPartial(tokenSymbol)
|
|
2160
|
-
};
|
|
2161
|
-
}
|
|
2162
|
-
return {
|
|
2163
|
-
title: labels.successTitleCompleted,
|
|
2164
|
-
description: labels.successDescriptionCompleted(tokenSymbol)
|
|
2165
|
-
};
|
|
2166
|
-
};
|
|
2167
|
-
var WithdrawSuccessStep = ({
|
|
2168
|
-
summary,
|
|
2169
|
-
tokenSymbol,
|
|
2170
|
-
requestedWithdrawal,
|
|
2171
|
-
resultStatus,
|
|
2172
|
-
errorMessage,
|
|
2173
|
-
onDone,
|
|
2174
|
-
onRetry,
|
|
2175
|
-
onClose
|
|
2176
|
-
}) => {
|
|
2177
|
-
const labels = useLabels14();
|
|
2178
|
-
const walletFlowLabels = labels.withdraw.walletFlow;
|
|
2179
|
-
const { title, description } = resultCopyFor({
|
|
2180
|
-
status: resultStatus,
|
|
2181
|
-
tokenSymbol,
|
|
2182
|
-
labels: walletFlowLabels
|
|
2183
|
-
});
|
|
2184
|
-
const isFailed = resultStatus === "failed";
|
|
2185
|
-
return /* @__PURE__ */ jsx15("div", { className: "relative", children: /* @__PURE__ */ jsxs15(Modal.Body, { classNames: { root: "px-10 py-12" }, children: [
|
|
2186
|
-
/* @__PURE__ */ jsx15(WithdrawCloseButton, { onClose, label: labels.common.close }),
|
|
2187
|
-
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col items-center justify-center gap-8 text-center", children: [
|
|
2188
|
-
/* @__PURE__ */ jsx15(
|
|
2189
|
-
"div",
|
|
2190
|
-
{
|
|
2191
|
-
className: cn(
|
|
2192
|
-
"flex h-[60px] w-[60px] items-center justify-center rounded-full",
|
|
2193
|
-
isFailed ? "bg-agg-error/15" : "bg-agg-success/15"
|
|
2194
|
-
),
|
|
2195
|
-
"aria-hidden": "true",
|
|
2196
|
-
children: isFailed ? /* @__PURE__ */ jsx15(CloseIcon, { className: "h-6 w-6 text-agg-error" }) : /* @__PURE__ */ jsx15(SuccessCheckIcon, { className: "h-6 w-6 text-agg-success" })
|
|
2197
|
-
}
|
|
2198
|
-
),
|
|
2199
|
-
/* @__PURE__ */ jsxs15("div", { className: "flex w-full flex-col items-center gap-3 text-center text-agg-foreground", children: [
|
|
2200
|
-
/* @__PURE__ */ jsx15("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold", children: title }),
|
|
2201
|
-
/* @__PURE__ */ jsx15(
|
|
2202
|
-
"p",
|
|
2203
|
-
{
|
|
2204
|
-
className: "max-w-[400px] text-agg-base leading-agg-6",
|
|
2205
|
-
"data-withdraw-result-status": resultStatus,
|
|
2206
|
-
children: errorMessage && isFailed ? errorMessage : description
|
|
2207
|
-
}
|
|
2208
|
-
)
|
|
2209
|
-
] }),
|
|
2210
|
-
!isFailed ? /* @__PURE__ */ jsxs15("div", { className: "flex w-full max-w-[400px] flex-col rounded-agg-lg border border-agg-separator bg-agg-secondary px-3 py-1 text-left", children: [
|
|
2211
|
-
/* @__PURE__ */ jsx15(
|
|
2212
|
-
SummaryRow3,
|
|
2213
|
-
{
|
|
2214
|
-
label: walletFlowLabels.summary.requestedWithdrawal,
|
|
2215
|
-
value: requestedWithdrawal
|
|
2216
|
-
}
|
|
2217
|
-
),
|
|
2218
|
-
/* @__PURE__ */ jsx15(
|
|
2219
|
-
SummaryRow3,
|
|
2220
|
-
{
|
|
2221
|
-
label: walletFlowLabels.summary.amountReceived,
|
|
2222
|
-
value: summary.amountReceived
|
|
2223
|
-
}
|
|
2224
|
-
),
|
|
2225
|
-
/* @__PURE__ */ jsx15(SummaryRow3, { label: walletFlowLabels.summary.fees, value: summary.fees }),
|
|
2226
|
-
/* @__PURE__ */ jsx15(SummaryRow3, { label: walletFlowLabels.summary.network, value: summary.network }),
|
|
2227
|
-
/* @__PURE__ */ jsx15(SummaryRow3, { label: walletFlowLabels.summary.toWallet, value: summary.toWallet })
|
|
2228
|
-
] }) : null,
|
|
2229
|
-
isFailed ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-center gap-3", children: [
|
|
2230
|
-
/* @__PURE__ */ jsx15(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onClose, children: walletFlowLabels.close }),
|
|
2231
|
-
/* @__PURE__ */ jsx15(Button, { variant: "primary", size: "large", className: "w-[123px]", onClick: onRetry, children: walletFlowLabels.retry })
|
|
2232
|
-
] }) : /* @__PURE__ */ jsx15(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
|
|
2233
|
-
] })
|
|
2234
|
-
] }) });
|
|
2235
|
-
};
|
|
2236
|
-
|
|
2237
|
-
// src/withdraw/index.tsx
|
|
2238
|
-
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2239
|
-
var DEFAULT_TOKEN_DECIMALS = 6;
|
|
2240
|
-
var TOKEN_DECIMALS_BY_SYMBOL = {
|
|
2241
|
-
BNB: 18,
|
|
2242
|
-
ETH: 18,
|
|
2243
|
-
MATIC: 18,
|
|
2244
|
-
POL: 18,
|
|
2245
|
-
WETH: 18,
|
|
2246
|
-
USDC: 6,
|
|
2247
|
-
USDT: 6
|
|
2248
|
-
};
|
|
2249
|
-
var TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL = {
|
|
2250
|
-
"56": {
|
|
2251
|
-
USDC: 18,
|
|
2252
|
-
USDT: 18
|
|
2253
|
-
}
|
|
2254
|
-
};
|
|
2255
|
-
var getTokenDecimals = (tokenSymbol, chainId) => {
|
|
2256
|
-
var _a;
|
|
2257
|
-
const normalizedSymbol = tokenSymbol.trim().toUpperCase();
|
|
2258
|
-
const normalizedChainId = chainId == null ? void 0 : chainId.trim();
|
|
2259
|
-
if (normalizedChainId) {
|
|
2260
|
-
const chainDecimals = TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL[normalizedChainId];
|
|
2261
|
-
const chainTokenDecimals = chainDecimals == null ? void 0 : chainDecimals[normalizedSymbol];
|
|
2262
|
-
if (chainTokenDecimals != null) return chainTokenDecimals;
|
|
2263
|
-
}
|
|
2264
|
-
return (_a = TOKEN_DECIMALS_BY_SYMBOL[normalizedSymbol]) != null ? _a : DEFAULT_TOKEN_DECIMALS;
|
|
2265
|
-
};
|
|
2266
|
-
var formatRawTokenAmount2 = (rawAmount, decimals) => {
|
|
2267
|
-
const raw = BigInt(rawAmount);
|
|
2268
|
-
const divisor = BigInt(`1${"0".repeat(decimals)}`);
|
|
2269
|
-
const whole = raw / divisor;
|
|
2270
|
-
const remainder = raw % divisor;
|
|
2271
|
-
if (remainder === BigInt(0)) return whole.toString();
|
|
2272
|
-
return `${whole.toString()}.${remainder.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
2273
|
-
};
|
|
2274
|
-
var formatLifecycleTokenAmount = ({
|
|
2275
|
-
rawAmount,
|
|
2276
|
-
tokenSymbol,
|
|
2277
|
-
chainId
|
|
2278
|
-
}) => `${formatRawTokenAmount2(rawAmount, getTokenDecimals(tokenSymbol, chainId))} ${tokenSymbol}`;
|
|
2279
|
-
var buildTerminalSummary = ({
|
|
2280
|
-
fallbackSummary,
|
|
2281
|
-
lifecycleCompletedAmountRaw,
|
|
2282
|
-
lifecycleRequestedAmountRaw,
|
|
2283
|
-
lifecycleFeeRaw,
|
|
2284
|
-
tokenSymbol,
|
|
2285
|
-
chainId
|
|
2286
|
-
}) => {
|
|
2287
|
-
if (!lifecycleCompletedAmountRaw) return fallbackSummary;
|
|
2288
|
-
const amountReceived = formatLifecycleTokenAmount({
|
|
2289
|
-
rawAmount: lifecycleCompletedAmountRaw,
|
|
2290
|
-
tokenSymbol,
|
|
2291
|
-
chainId
|
|
2292
|
-
});
|
|
2293
|
-
let feeRaw = lifecycleFeeRaw;
|
|
2294
|
-
if (feeRaw == null && lifecycleRequestedAmountRaw) {
|
|
2295
|
-
try {
|
|
2296
|
-
const r = BigInt(lifecycleRequestedAmountRaw);
|
|
2297
|
-
const c = BigInt(lifecycleCompletedAmountRaw);
|
|
2298
|
-
feeRaw = (r > c ? r - c : BigInt(0)).toString();
|
|
2299
|
-
} catch (e) {
|
|
2300
|
-
feeRaw = null;
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
return __spreadValues(__spreadProps(__spreadValues({}, fallbackSummary), {
|
|
2304
|
-
amountReceived
|
|
2305
|
-
}), feeRaw != null ? {
|
|
2306
|
-
fees: formatLifecycleTokenAmount({
|
|
2307
|
-
rawAmount: feeRaw,
|
|
2308
|
-
tokenSymbol,
|
|
2309
|
-
chainId
|
|
2310
|
-
})
|
|
2311
|
-
} : {});
|
|
2312
|
-
};
|
|
2313
|
-
function isControlledWithdrawModalProps(props) {
|
|
2314
|
-
return "withdrawFlow" in props;
|
|
2315
|
-
}
|
|
2316
|
-
function WithdrawModalSelfDriven({
|
|
2317
|
-
open,
|
|
2318
|
-
onOpenChange
|
|
2319
|
-
}) {
|
|
2320
|
-
const withdrawProps = useWithdrawFlow({ open, onOpenChange });
|
|
2321
|
-
return /* @__PURE__ */ jsx16(WithdrawModalControlled, __spreadValues({}, withdrawProps));
|
|
2322
|
-
}
|
|
2323
|
-
function WithdrawModalControlled({
|
|
2324
|
-
open,
|
|
2325
|
-
onOpenChange,
|
|
2326
|
-
withdrawFlow,
|
|
2327
|
-
onWithdrawDestinationChange,
|
|
2328
|
-
onWithdrawAmountChange,
|
|
2329
|
-
onWithdrawTokenChange,
|
|
2330
|
-
onWithdrawNetworkChange,
|
|
2331
|
-
onMaxClick,
|
|
2332
|
-
onSelectWithdrawProvider,
|
|
2333
|
-
onDoneWithdraw
|
|
2334
|
-
}) {
|
|
2335
|
-
const [flowState, setFlowState] = useState3({
|
|
2336
|
-
status: "form",
|
|
2337
|
-
formStep: "method"
|
|
2338
|
-
});
|
|
2339
|
-
const [isConfirming, setIsConfirming] = useState3(false);
|
|
2340
|
-
const [confirmError, setConfirmError] = useState3(null);
|
|
2341
|
-
const { state: withdrawalLifecycleState, reset: resetWithdrawalLifecycle } = useWithdrawalLifecycle(withdrawFlow.withdrawalId);
|
|
2342
|
-
useEffect4(() => {
|
|
2343
|
-
if (!open) {
|
|
2344
|
-
setFlowState({ status: "form", formStep: "method" });
|
|
2345
|
-
setIsConfirming(false);
|
|
2346
|
-
setConfirmError(null);
|
|
2347
|
-
resetWithdrawalLifecycle();
|
|
2348
|
-
}
|
|
2349
|
-
}, [open, resetWithdrawalLifecycle]);
|
|
2350
|
-
useEffect4(() => {
|
|
2351
|
-
if (flowState.status !== "loading") return;
|
|
2352
|
-
if (!withdrawalLifecycleState.terminal) return;
|
|
2353
|
-
if (withdrawalLifecycleState.status === "completed") {
|
|
2354
|
-
setFlowState({ status: "success" });
|
|
2355
|
-
return;
|
|
2356
|
-
}
|
|
2357
|
-
if (withdrawalLifecycleState.status === "partial") {
|
|
2358
|
-
setFlowState({ status: "partial_success" });
|
|
2359
|
-
return;
|
|
2360
|
-
}
|
|
2361
|
-
if (withdrawalLifecycleState.status === "failed") {
|
|
2362
|
-
setFlowState({
|
|
2363
|
-
status: "failed",
|
|
2364
|
-
errorMessage: withdrawalLifecycleState.errorMessage
|
|
2365
|
-
});
|
|
2366
|
-
}
|
|
2367
|
-
}, [
|
|
2368
|
-
flowState.status,
|
|
2369
|
-
withdrawalLifecycleState.errorMessage,
|
|
2370
|
-
withdrawalLifecycleState.status,
|
|
2371
|
-
withdrawalLifecycleState.terminal
|
|
2372
|
-
]);
|
|
2373
|
-
const handleOpenChange = (isOpen) => {
|
|
2374
|
-
if (!isOpen) {
|
|
2375
|
-
setFlowState({ status: "form", formStep: "method" });
|
|
2376
|
-
setIsConfirming(false);
|
|
2377
|
-
setConfirmError(null);
|
|
2378
|
-
resetWithdrawalLifecycle();
|
|
2379
|
-
}
|
|
2380
|
-
onOpenChange(isOpen);
|
|
2381
|
-
};
|
|
2382
|
-
const handleBack = () => {
|
|
2383
|
-
setConfirmError(null);
|
|
2384
|
-
setFlowState({ status: "form", formStep: "method" });
|
|
2385
|
-
};
|
|
2386
|
-
const handleRetry = () => {
|
|
2387
|
-
setConfirmError(null);
|
|
2388
|
-
setIsConfirming(false);
|
|
2389
|
-
resetWithdrawalLifecycle();
|
|
2390
|
-
setFlowState({ status: "form", formStep: "withdraw-amount" });
|
|
2391
|
-
};
|
|
2392
|
-
const handleConfirm = () => __async(null, null, function* () {
|
|
2393
|
-
setFlowState({ status: "loading" });
|
|
2394
|
-
setIsConfirming(true);
|
|
2395
|
-
setConfirmError(null);
|
|
2396
|
-
try {
|
|
2397
|
-
yield onSelectWithdrawProvider("wallet");
|
|
2398
|
-
} catch (err) {
|
|
2399
|
-
const errorMessage = err instanceof Error ? err.message : "Withdrawal failed. Please try again.";
|
|
2400
|
-
setConfirmError(errorMessage);
|
|
2401
|
-
setFlowState({ status: "failed", errorMessage });
|
|
2402
|
-
} finally {
|
|
2403
|
-
setIsConfirming(false);
|
|
2404
|
-
}
|
|
2405
|
-
});
|
|
2406
|
-
const withdrawTokenOptions = withTokenIcons(withdrawFlow.tokenOptions);
|
|
2407
|
-
const withdrawNetworkOptions = withNetworkIcons(withdrawFlow.networkOptions);
|
|
2408
|
-
const requestedWithdrawal = `${withdrawFlow.amount} ${withdrawFlow.selectedToken}`.trim();
|
|
2409
|
-
const modalMaxWidth = flowState.status === "form" && flowState.formStep === "method" ? "600px" : "480px";
|
|
2410
|
-
const resultStatus = flowState.status;
|
|
2411
|
-
const terminalSummary = buildTerminalSummary({
|
|
2412
|
-
fallbackSummary: withdrawFlow.purchaseSummary,
|
|
2413
|
-
lifecycleCompletedAmountRaw: withdrawalLifecycleState.completedAmountRaw,
|
|
2414
|
-
lifecycleRequestedAmountRaw: withdrawalLifecycleState.requestedAmountRaw,
|
|
2415
|
-
lifecycleFeeRaw: withdrawalLifecycleState.feeRaw,
|
|
2416
|
-
tokenSymbol: withdrawFlow.selectedToken,
|
|
2417
|
-
chainId: withdrawFlow.selectedNetwork
|
|
2418
|
-
});
|
|
2419
|
-
return /* @__PURE__ */ jsx16(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs16(Modal.Container, { maxWidth: modalMaxWidth, "aria-label": "Withdraw", children: [
|
|
2420
|
-
flowState.status === "form" && flowState.formStep === "method" ? /* @__PURE__ */ jsx16(
|
|
2421
|
-
WithdrawMethodStep,
|
|
2422
|
-
{
|
|
2423
|
-
balance: withdrawFlow.balance,
|
|
2424
|
-
onSelectMethod: () => setFlowState({ status: "form", formStep: "withdraw-amount" })
|
|
2425
|
-
}
|
|
2426
|
-
) : null,
|
|
2427
|
-
flowState.status === "form" && flowState.formStep === "withdraw-amount" ? /* @__PURE__ */ jsx16(
|
|
2428
|
-
WithdrawAmountStep,
|
|
2429
|
-
{
|
|
2430
|
-
amount: withdrawFlow.amount,
|
|
2431
|
-
destinationWallet: withdrawFlow.destinationWallet,
|
|
2432
|
-
balanceDisplay: withdrawFlow.balanceDisplay,
|
|
2433
|
-
tokenOptions: withdrawTokenOptions,
|
|
2434
|
-
networkOptions: withdrawNetworkOptions,
|
|
2435
|
-
selectedToken: withdrawFlow.selectedToken,
|
|
2436
|
-
selectedNetwork: withdrawFlow.selectedNetwork,
|
|
2437
|
-
destDecimals: getTokenDecimals(
|
|
2438
|
-
withdrawFlow.selectedToken,
|
|
2439
|
-
withdrawFlow.selectedNetwork
|
|
2440
|
-
),
|
|
2441
|
-
isConfirming,
|
|
2442
|
-
error: confirmError,
|
|
2443
|
-
max: withdrawFlow.isMax,
|
|
2444
|
-
onBack: handleBack,
|
|
2445
|
-
onAmountChange: onWithdrawAmountChange,
|
|
2446
|
-
onDestinationChange: onWithdrawDestinationChange,
|
|
2447
|
-
onTokenChange: onWithdrawTokenChange,
|
|
2448
|
-
onNetworkChange: onWithdrawNetworkChange,
|
|
2449
|
-
onMaxClick,
|
|
2450
|
-
onContinue: handleConfirm
|
|
2451
|
-
}
|
|
2452
|
-
) : null,
|
|
2453
|
-
flowState.status === "loading" ? /* @__PURE__ */ jsx16(
|
|
2454
|
-
WithdrawLoadingStep,
|
|
2455
|
-
{
|
|
2456
|
-
lifecycleState: withdrawalLifecycleState,
|
|
2457
|
-
onClose: () => handleOpenChange(false)
|
|
2458
|
-
}
|
|
2459
|
-
) : null,
|
|
2460
|
-
flowState.status === "success" || flowState.status === "partial_success" || flowState.status === "failed" ? /* @__PURE__ */ jsx16(
|
|
2461
|
-
WithdrawSuccessStep,
|
|
2462
|
-
{
|
|
2463
|
-
summary: terminalSummary,
|
|
2464
|
-
tokenSymbol: withdrawFlow.selectedToken,
|
|
2465
|
-
requestedWithdrawal,
|
|
2466
|
-
resultStatus,
|
|
2467
|
-
errorMessage: flowState.status === "failed" ? flowState.errorMessage : null,
|
|
2468
|
-
onDone: onDoneWithdraw,
|
|
2469
|
-
onRetry: handleRetry,
|
|
2470
|
-
onClose: () => handleOpenChange(false)
|
|
2471
|
-
}
|
|
2472
|
-
) : null
|
|
2473
|
-
] }) });
|
|
2474
|
-
}
|
|
2475
|
-
var WithdrawModal = (props) => {
|
|
2476
|
-
if (isControlledWithdrawModalProps(props)) {
|
|
2477
|
-
return /* @__PURE__ */ jsx16(WithdrawModalControlled, __spreadValues({}, props));
|
|
2478
|
-
}
|
|
2479
|
-
return /* @__PURE__ */ jsx16(WithdrawModalSelfDriven, __spreadValues({}, props));
|
|
2480
|
-
};
|
|
2481
|
-
WithdrawModal.displayName = "WithdrawModal";
|
|
2482
|
-
|
|
2483
1544
|
// src/paper-trading/paper-trading-badge.tsx
|
|
2484
|
-
import { useLabels as
|
|
2485
|
-
import { jsx as
|
|
1545
|
+
import { useLabels as useLabels11, useResolvedExecutionMode } from "@agg-build/hooks";
|
|
1546
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2486
1547
|
var PaperTradingBadge = ({
|
|
2487
1548
|
placement = "chip",
|
|
2488
1549
|
isAuthenticated = false,
|
|
@@ -2491,7 +1552,7 @@ var PaperTradingBadge = ({
|
|
|
2491
1552
|
showWhenAuthenticated = false,
|
|
2492
1553
|
classNames
|
|
2493
1554
|
}) => {
|
|
2494
|
-
const labels =
|
|
1555
|
+
const labels = useLabels11();
|
|
2495
1556
|
const { isPaperMode, isResolving } = useResolvedExecutionMode();
|
|
2496
1557
|
if (!forceVisible && (isResolving || !isPaperMode)) return null;
|
|
2497
1558
|
if (placement === "brand" && isAuthenticated && !forceVisible && !showWhenAuthenticated) {
|
|
@@ -2502,7 +1563,7 @@ var PaperTradingBadge = ({
|
|
|
2502
1563
|
chip: "inline-flex",
|
|
2503
1564
|
signedOut: "hidden md:inline-flex"
|
|
2504
1565
|
}[placement];
|
|
2505
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsx12(
|
|
2506
1567
|
Tooltip,
|
|
2507
1568
|
{
|
|
2508
1569
|
content: labels.paperTrading.badgeTooltip,
|
|
@@ -2520,13 +1581,13 @@ var PaperTradingBadge = ({
|
|
|
2520
1581
|
classNames == null ? void 0 : classNames.tooltip
|
|
2521
1582
|
)
|
|
2522
1583
|
},
|
|
2523
|
-
children: /* @__PURE__ */
|
|
1584
|
+
children: /* @__PURE__ */ jsx12(
|
|
2524
1585
|
"span",
|
|
2525
1586
|
{
|
|
2526
1587
|
className: cn("agg-paper-trading-badge items-center", placementClassName, classNames == null ? void 0 : classNames.root),
|
|
2527
1588
|
"data-testid": "agg-paper-trading-badge",
|
|
2528
1589
|
"data-placement": placement,
|
|
2529
|
-
children: /* @__PURE__ */
|
|
1590
|
+
children: /* @__PURE__ */ jsx12(
|
|
2530
1591
|
"span",
|
|
2531
1592
|
{
|
|
2532
1593
|
className: cn(
|
|
@@ -2554,18 +1615,18 @@ PaperTradingBadge.displayName = "PaperTradingBadge";
|
|
|
2554
1615
|
import { useAppConfig, usePaperOnboarding } from "@agg-build/hooks";
|
|
2555
1616
|
|
|
2556
1617
|
// src/paper-trading/paper-onboarding-modal.tsx
|
|
2557
|
-
import { useCallback as useCallback2, useMemo as useMemo2, useState as
|
|
2558
|
-
import { useLabels as
|
|
2559
|
-
import { jsx as
|
|
1618
|
+
import { useCallback as useCallback2, useMemo as useMemo2, useState as useState3 } from "react";
|
|
1619
|
+
import { useLabels as useLabels12 } from "@agg-build/hooks";
|
|
1620
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2560
1621
|
var PaperOnboardingModal = ({
|
|
2561
1622
|
open,
|
|
2562
1623
|
onDismiss,
|
|
2563
1624
|
startingBalanceLabel,
|
|
2564
1625
|
classNames
|
|
2565
1626
|
}) => {
|
|
2566
|
-
const labels =
|
|
1627
|
+
const labels = useLabels12();
|
|
2567
1628
|
const copy = labels.paperTrading.onboarding;
|
|
2568
|
-
const [stepIndex, setStepIndex] =
|
|
1629
|
+
const [stepIndex, setStepIndex] = useState3(0);
|
|
2569
1630
|
const steps = useMemo2(
|
|
2570
1631
|
() => [
|
|
2571
1632
|
{
|
|
@@ -2611,7 +1672,7 @@ var PaperOnboardingModal = ({
|
|
|
2611
1672
|
},
|
|
2612
1673
|
[onDismiss]
|
|
2613
1674
|
);
|
|
2614
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ jsx13(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsx13(
|
|
2615
1676
|
Modal.Container,
|
|
2616
1677
|
{
|
|
2617
1678
|
maxWidth: "480px",
|
|
@@ -2629,9 +1690,9 @@ var PaperOnboardingModal = ({
|
|
|
2629
1690
|
// Only the radius needs overriding, from the container's default 16.
|
|
2630
1691
|
container: cn("rounded-agg-xl! md:rounded-agg-xl!", classNames == null ? void 0 : classNames.card)
|
|
2631
1692
|
},
|
|
2632
|
-
children: /* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
1693
|
+
children: /* @__PURE__ */ jsxs12("div", { className: cn("agg-paper-onboarding", "flex w-full flex-col gap-5 p-6"), children: [
|
|
1694
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex w-full items-start justify-center gap-5", children: [
|
|
1695
|
+
/* @__PURE__ */ jsx13(
|
|
2635
1696
|
"div",
|
|
2636
1697
|
{
|
|
2637
1698
|
className: cn(
|
|
@@ -2639,12 +1700,12 @@ var PaperOnboardingModal = ({
|
|
|
2639
1700
|
"rounded-agg-lg bg-agg-primary/10 text-agg-primary",
|
|
2640
1701
|
classNames == null ? void 0 : classNames.icon
|
|
2641
1702
|
),
|
|
2642
|
-
children: /* @__PURE__ */
|
|
1703
|
+
children: /* @__PURE__ */ jsx13(Icon, { name: step.icon, className: "!h-6 !w-6", "aria-hidden": "true" })
|
|
2643
1704
|
}
|
|
2644
1705
|
),
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex min-w-0 flex-1 flex-col gap-2 break-words", children: [
|
|
1707
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
|
|
1708
|
+
/* @__PURE__ */ jsx13(
|
|
2648
1709
|
"p",
|
|
2649
1710
|
{
|
|
2650
1711
|
className: cn(
|
|
@@ -2657,7 +1718,7 @@ var PaperOnboardingModal = ({
|
|
|
2657
1718
|
children: copy.stepEyebrow({ current: stepIndex + 1, total })
|
|
2658
1719
|
}
|
|
2659
1720
|
),
|
|
2660
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ jsx13(
|
|
2661
1722
|
"p",
|
|
2662
1723
|
{
|
|
2663
1724
|
className: cn(
|
|
@@ -2668,11 +1729,11 @@ var PaperOnboardingModal = ({
|
|
|
2668
1729
|
}
|
|
2669
1730
|
)
|
|
2670
1731
|
] }),
|
|
2671
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx13("p", { className: cn("text-agg-sm leading-agg-5 text-agg-foreground", classNames == null ? void 0 : classNames.body), children: step.body })
|
|
2672
1733
|
] })
|
|
2673
1734
|
] }),
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsxs12("div", { className: cn("flex w-full items-center justify-between", classNames == null ? void 0 : classNames.footer), children: [
|
|
1736
|
+
/* @__PURE__ */ jsx13("div", { className: cn("flex items-center gap-1", classNames == null ? void 0 : classNames.dots), "aria-hidden": "true", children: steps.map((dotStep, index) => /* @__PURE__ */ jsx13(
|
|
2676
1737
|
"span",
|
|
2677
1738
|
{
|
|
2678
1739
|
className: cn(
|
|
@@ -2682,8 +1743,8 @@ var PaperOnboardingModal = ({
|
|
|
2682
1743
|
},
|
|
2683
1744
|
dotStep.key
|
|
2684
1745
|
)) }),
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-3", children: [
|
|
1747
|
+
/* @__PURE__ */ jsx13(
|
|
2687
1748
|
Button,
|
|
2688
1749
|
{
|
|
2689
1750
|
variant: "secondary",
|
|
@@ -2693,7 +1754,7 @@ var PaperOnboardingModal = ({
|
|
|
2693
1754
|
children: isFirst ? copy.skip : copy.back
|
|
2694
1755
|
}
|
|
2695
1756
|
),
|
|
2696
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ jsx13(
|
|
2697
1758
|
Button,
|
|
2698
1759
|
{
|
|
2699
1760
|
variant: "primary",
|
|
@@ -2712,7 +1773,7 @@ var PaperOnboardingModal = ({
|
|
|
2712
1773
|
PaperOnboardingModal.displayName = "PaperOnboardingModal";
|
|
2713
1774
|
|
|
2714
1775
|
// src/paper-trading/paper-trading-onboarding.tsx
|
|
2715
|
-
import { jsx as
|
|
1776
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2716
1777
|
var FALLBACK_STARTING_BALANCE = 1e4;
|
|
2717
1778
|
var PaperTradingOnboarding = ({
|
|
2718
1779
|
classNames
|
|
@@ -2720,7 +1781,7 @@ var PaperTradingOnboarding = ({
|
|
|
2720
1781
|
const { isOpen, dismiss } = usePaperOnboarding();
|
|
2721
1782
|
const { paperStartingBalance } = useAppConfig();
|
|
2722
1783
|
if (!isOpen) return null;
|
|
2723
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx14(
|
|
2724
1785
|
PaperOnboardingModal,
|
|
2725
1786
|
{
|
|
2726
1787
|
open: true,
|
|
@@ -2735,7 +1796,7 @@ var PaperTradingOnboarding = ({
|
|
|
2735
1796
|
PaperTradingOnboarding.displayName = "PaperTradingOnboarding";
|
|
2736
1797
|
|
|
2737
1798
|
// src/profile/index.tsx
|
|
2738
|
-
import { useState as
|
|
1799
|
+
import { useState as useState4, useEffect as useEffect4, useCallback as useCallback4, useMemo as useMemo4 } from "react";
|
|
2739
1800
|
import { useAggClient, useAggAuthState as useAggAuthState2, useVenueKeyStatus } from "@agg-build/hooks";
|
|
2740
1801
|
import { Venue } from "@agg-build/sdk";
|
|
2741
1802
|
|
|
@@ -2755,8 +1816,8 @@ var getProfileTabItems = () => [
|
|
|
2755
1816
|
|
|
2756
1817
|
// src/profile/tabs/about-tab.tsx
|
|
2757
1818
|
import { useCallback as useCallback3, useRef as useRef2 } from "react";
|
|
2758
|
-
import { useLabels as
|
|
2759
|
-
import { jsx as
|
|
1819
|
+
import { useLabels as useLabels13 } from "@agg-build/hooks";
|
|
1820
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2760
1821
|
var AboutTab = ({
|
|
2761
1822
|
avatarPreview,
|
|
2762
1823
|
onDeleteProfile: _onDeleteProfile,
|
|
@@ -2766,7 +1827,7 @@ var AboutTab = ({
|
|
|
2766
1827
|
draftAvatarPreview,
|
|
2767
1828
|
avatarError: _avatarError
|
|
2768
1829
|
}) => {
|
|
2769
|
-
const labels =
|
|
1830
|
+
const labels = useLabels13();
|
|
2770
1831
|
const fileInputRef = useRef2(null);
|
|
2771
1832
|
const handleAvatarClick = useCallback3(() => {
|
|
2772
1833
|
var _a;
|
|
@@ -2788,8 +1849,8 @@ var AboutTab = ({
|
|
|
2788
1849
|
);
|
|
2789
1850
|
const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
|
|
2790
1851
|
const hasAvatarPreview = Boolean(resolvedPreview);
|
|
2791
|
-
return /* @__PURE__ */
|
|
2792
|
-
/* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsx15("div", { className: "agg-profile-about flex flex-col gap-8", children: /* @__PURE__ */ jsxs13("div", { className: "agg-profile-avatar-section flex w-full items-center gap-6", children: [
|
|
1853
|
+
/* @__PURE__ */ jsxs13(
|
|
2793
1854
|
"button",
|
|
2794
1855
|
{
|
|
2795
1856
|
type: "button",
|
|
@@ -2806,13 +1867,13 @@ var AboutTab = ({
|
|
|
2806
1867
|
),
|
|
2807
1868
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
2808
1869
|
children: [
|
|
2809
|
-
!hasAvatarPreview ? /* @__PURE__ */
|
|
1870
|
+
!hasAvatarPreview ? /* @__PURE__ */ jsx15(
|
|
2810
1871
|
"svg",
|
|
2811
1872
|
{
|
|
2812
1873
|
"aria-hidden": true,
|
|
2813
1874
|
viewBox: "0 0 80 80",
|
|
2814
1875
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
2815
|
-
children: /* @__PURE__ */
|
|
1876
|
+
children: /* @__PURE__ */ jsx15(
|
|
2816
1877
|
"circle",
|
|
2817
1878
|
{
|
|
2818
1879
|
cx: "40",
|
|
@@ -2826,18 +1887,18 @@ var AboutTab = ({
|
|
|
2826
1887
|
)
|
|
2827
1888
|
}
|
|
2828
1889
|
) : null,
|
|
2829
|
-
resolvedPreview ? /* @__PURE__ */
|
|
1890
|
+
resolvedPreview ? /* @__PURE__ */ jsx15(
|
|
2830
1891
|
RemoteImage,
|
|
2831
1892
|
{
|
|
2832
1893
|
src: resolvedPreview,
|
|
2833
1894
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
2834
1895
|
className: "h-full w-full object-cover"
|
|
2835
1896
|
}
|
|
2836
|
-
) : /* @__PURE__ */
|
|
1897
|
+
) : /* @__PURE__ */ jsx15(Icon, { name: "profile", className: "h-7 w-7 text-agg-muted-foreground" })
|
|
2837
1898
|
]
|
|
2838
1899
|
}
|
|
2839
1900
|
),
|
|
2840
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsx15(
|
|
2841
1902
|
"input",
|
|
2842
1903
|
{
|
|
2843
1904
|
ref: fileInputRef,
|
|
@@ -2848,8 +1909,8 @@ var AboutTab = ({
|
|
|
2848
1909
|
"aria-hidden": "true"
|
|
2849
1910
|
}
|
|
2850
1911
|
),
|
|
2851
|
-
/* @__PURE__ */
|
|
2852
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ jsxs13("div", { className: "agg-form-section flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1913
|
+
/* @__PURE__ */ jsx15(
|
|
2853
1914
|
"label",
|
|
2854
1915
|
{
|
|
2855
1916
|
htmlFor: "profile-username",
|
|
@@ -2857,7 +1918,7 @@ var AboutTab = ({
|
|
|
2857
1918
|
children: "Username"
|
|
2858
1919
|
}
|
|
2859
1920
|
),
|
|
2860
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ jsx15(
|
|
2861
1922
|
"input",
|
|
2862
1923
|
{
|
|
2863
1924
|
id: "profile-username",
|
|
@@ -2884,9 +1945,9 @@ var AboutTab = ({
|
|
|
2884
1945
|
AboutTab.displayName = "AboutTab";
|
|
2885
1946
|
|
|
2886
1947
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
2887
|
-
import { jsx as
|
|
2888
|
-
var SectionTitle = ({ children }) => /* @__PURE__ */
|
|
2889
|
-
var AccountRow = ({ children, className }) => /* @__PURE__ */
|
|
1948
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1949
|
+
var SectionTitle = ({ children }) => /* @__PURE__ */ jsx16("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
1950
|
+
var AccountRow = ({ children, className }) => /* @__PURE__ */ jsx16(
|
|
2890
1951
|
"div",
|
|
2891
1952
|
{
|
|
2892
1953
|
className: cn(
|
|
@@ -2902,11 +1963,11 @@ var AccountIdentity = ({
|
|
|
2902
1963
|
icon,
|
|
2903
1964
|
label,
|
|
2904
1965
|
iconClassName
|
|
2905
|
-
}) => /* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
1966
|
+
}) => /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
1967
|
+
/* @__PURE__ */ jsx16("span", { className: cn("flex h-5 w-5 shrink-0 items-center justify-center", iconClassName), children: /* @__PURE__ */ jsx16(Icon, { name: icon, size: "small", color: "currentColor" }) }),
|
|
1968
|
+
/* @__PURE__ */ jsx16("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: label })
|
|
2908
1969
|
] });
|
|
2909
|
-
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */
|
|
1970
|
+
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx16(
|
|
2910
1971
|
"button",
|
|
2911
1972
|
{
|
|
2912
1973
|
type: "button",
|
|
@@ -2915,7 +1976,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx21(
|
|
|
2915
1976
|
children: "Connect"
|
|
2916
1977
|
}
|
|
2917
1978
|
);
|
|
2918
|
-
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */
|
|
1979
|
+
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx16(
|
|
2919
1980
|
"button",
|
|
2920
1981
|
{
|
|
2921
1982
|
type: "button",
|
|
@@ -2924,7 +1985,7 @@ var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx21(
|
|
|
2924
1985
|
children: "Disconnect"
|
|
2925
1986
|
}
|
|
2926
1987
|
);
|
|
2927
|
-
var VerifiedBadge = () => /* @__PURE__ */
|
|
1988
|
+
var VerifiedBadge = () => /* @__PURE__ */ jsx16(Icon, { name: "check-badge", size: "small", color: "var(--agg-color-primary, #536dfe)" });
|
|
2928
1989
|
var getWalletIconName = (wallet) => {
|
|
2929
1990
|
const chain = wallet.chain.toLowerCase();
|
|
2930
1991
|
if (chain === "solana" || chain === "svm") {
|
|
@@ -2942,12 +2003,12 @@ var ConnectedAccountRow = ({
|
|
|
2942
2003
|
onDisconnect
|
|
2943
2004
|
}) => {
|
|
2944
2005
|
const displayLabel = connected ? connectedLabel != null ? connectedLabel : label : label;
|
|
2945
|
-
return /* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
connected ? /* @__PURE__ */
|
|
2006
|
+
return /* @__PURE__ */ jsxs14(AccountRow, { className: "agg-social-account-row gap-4", children: [
|
|
2007
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2008
|
+
/* @__PURE__ */ jsx16(AccountIdentity, { icon, label: displayLabel, iconClassName }),
|
|
2009
|
+
connected ? /* @__PURE__ */ jsx16(VerifiedBadge, {}) : null
|
|
2949
2010
|
] }),
|
|
2950
|
-
connected ? /* @__PURE__ */
|
|
2011
|
+
connected ? /* @__PURE__ */ jsx16(DisconnectTextButton, { onClick: onDisconnect }) : /* @__PURE__ */ jsx16(ConnectTextButton, { onClick: onConnect })
|
|
2951
2012
|
] });
|
|
2952
2013
|
};
|
|
2953
2014
|
var AccountsWalletsTab = ({
|
|
@@ -2966,11 +2027,11 @@ var AccountsWalletsTab = ({
|
|
|
2966
2027
|
const google = socialAccounts == null ? void 0 : socialAccounts.google;
|
|
2967
2028
|
const apple = socialAccounts == null ? void 0 : socialAccounts.apple;
|
|
2968
2029
|
const hasEmail = Boolean(email);
|
|
2969
|
-
return /* @__PURE__ */
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ jsxs14("div", { className: "agg-accounts-wallets-tab flex flex-col gap-6", children: [
|
|
2031
|
+
/* @__PURE__ */ jsxs14("div", { className: "agg-social-accounts-section flex flex-col gap-3", children: [
|
|
2032
|
+
/* @__PURE__ */ jsx16(SectionTitle, { children: "Connected accounts" }),
|
|
2033
|
+
/* @__PURE__ */ jsxs14("div", { className: "agg-social-accounts-list flex flex-col gap-4", children: [
|
|
2034
|
+
/* @__PURE__ */ jsx16(
|
|
2974
2035
|
ConnectedAccountRow,
|
|
2975
2036
|
{
|
|
2976
2037
|
icon: "google",
|
|
@@ -2982,7 +2043,7 @@ var AccountsWalletsTab = ({
|
|
|
2982
2043
|
onDisconnect: onDisconnectGoogle
|
|
2983
2044
|
}
|
|
2984
2045
|
),
|
|
2985
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx16(
|
|
2986
2047
|
ConnectedAccountRow,
|
|
2987
2048
|
{
|
|
2988
2049
|
icon: "apple",
|
|
@@ -2994,7 +2055,7 @@ var AccountsWalletsTab = ({
|
|
|
2994
2055
|
onDisconnect: onDisconnectApple
|
|
2995
2056
|
}
|
|
2996
2057
|
),
|
|
2997
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ jsx16(
|
|
2998
2059
|
ConnectedAccountRow,
|
|
2999
2060
|
{
|
|
3000
2061
|
icon: "twitter",
|
|
@@ -3006,7 +2067,7 @@ var AccountsWalletsTab = ({
|
|
|
3006
2067
|
onDisconnect: onDisconnectTwitter
|
|
3007
2068
|
}
|
|
3008
2069
|
),
|
|
3009
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsx16(
|
|
3010
2071
|
ConnectedAccountRow,
|
|
3011
2072
|
{
|
|
3012
2073
|
icon: "email",
|
|
@@ -3019,12 +2080,12 @@ var AccountsWalletsTab = ({
|
|
|
3019
2080
|
)
|
|
3020
2081
|
] })
|
|
3021
2082
|
] }),
|
|
3022
|
-
wallets.length > 0 ? /* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
2083
|
+
wallets.length > 0 ? /* @__PURE__ */ jsxs14("div", { className: "agg-wallets-section flex flex-col gap-3", children: [
|
|
2084
|
+
/* @__PURE__ */ jsx16(SectionTitle, { children: "Wallets" }),
|
|
2085
|
+
/* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-2", children: wallets.map((wallet) => {
|
|
3025
2086
|
var _a;
|
|
3026
|
-
return /* @__PURE__ */
|
|
3027
|
-
/* @__PURE__ */
|
|
2087
|
+
return /* @__PURE__ */ jsx16(AccountRow, { className: "gap-4", children: /* @__PURE__ */ jsxs14("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2088
|
+
/* @__PURE__ */ jsx16(
|
|
3028
2089
|
AccountIdentity,
|
|
3029
2090
|
{
|
|
3030
2091
|
icon: getWalletIconName(wallet),
|
|
@@ -3032,7 +2093,7 @@ var AccountsWalletsTab = ({
|
|
|
3032
2093
|
label: (_a = wallet.displayAddress) != null ? _a : wallet.address
|
|
3033
2094
|
}
|
|
3034
2095
|
),
|
|
3035
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx16(VerifiedBadge, {})
|
|
3036
2097
|
] }) }, `${wallet.chain}:${wallet.address}`);
|
|
3037
2098
|
}) })
|
|
3038
2099
|
] }) : null
|
|
@@ -3046,12 +2107,14 @@ import {
|
|
|
3046
2107
|
getVisibleVenuesByConfig,
|
|
3047
2108
|
useAppConfig as useAppConfig2,
|
|
3048
2109
|
useGeoBlock,
|
|
3049
|
-
useLabels as
|
|
2110
|
+
useLabels as useLabels14
|
|
3050
2111
|
} from "@agg-build/hooks";
|
|
3051
2112
|
import { useMemo as useMemo3 } from "react";
|
|
3052
|
-
import { jsx as
|
|
2113
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3053
2114
|
var TRADING_ACCESS_VENUES = [
|
|
3054
2115
|
"kalshi",
|
|
2116
|
+
"betdex",
|
|
2117
|
+
"tiprun",
|
|
3055
2118
|
"polymarket",
|
|
3056
2119
|
"opinion",
|
|
3057
2120
|
"probable",
|
|
@@ -3064,8 +2127,8 @@ var TRADING_ACCESS_VENUES = [
|
|
|
3064
2127
|
"pred"
|
|
3065
2128
|
];
|
|
3066
2129
|
var TRADING_ACCESS_VENUE_ITEMS = TRADING_ACCESS_VENUES.map((id) => ({ id }));
|
|
3067
|
-
var SectionTitle2 = ({ children }) => /* @__PURE__ */
|
|
3068
|
-
var AccessRow = ({ children }) => /* @__PURE__ */
|
|
2130
|
+
var SectionTitle2 = ({ children }) => /* @__PURE__ */ jsx17("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
2131
|
+
var AccessRow = ({ children }) => /* @__PURE__ */ jsx17(
|
|
3069
2132
|
"div",
|
|
3070
2133
|
{
|
|
3071
2134
|
className: cn(
|
|
@@ -3077,52 +2140,69 @@ var AccessRow = ({ children }) => /* @__PURE__ */ jsx22(
|
|
|
3077
2140
|
}
|
|
3078
2141
|
);
|
|
3079
2142
|
var AvailableStatus = () => {
|
|
3080
|
-
const labels =
|
|
3081
|
-
return /* @__PURE__ */
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
/* @__PURE__ */
|
|
2143
|
+
const labels = useLabels14();
|
|
2144
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2145
|
+
/* @__PURE__ */ jsx17(Icon, { name: "check-badge", size: "small", className: "text-agg-primary" }),
|
|
2146
|
+
/* @__PURE__ */ jsx17("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground whitespace-nowrap", children: labels.trading.tradingAccessAvailable })
|
|
3084
2147
|
] });
|
|
3085
2148
|
};
|
|
3086
2149
|
var GeoblockedStatus = () => {
|
|
3087
|
-
const labels =
|
|
3088
|
-
return /* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
/* @__PURE__ */
|
|
2150
|
+
const labels = useLabels14();
|
|
2151
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-agg-muted-foreground", children: [
|
|
2152
|
+
/* @__PURE__ */ jsx17(Icon, { name: "warning-filled", size: "small", color: "currentColor" }),
|
|
2153
|
+
/* @__PURE__ */ jsx17("span", { className: "text-agg-sm font-agg-normal leading-agg-5 whitespace-nowrap", children: labels.trading.venueUnavailableInRegion })
|
|
3091
2154
|
] });
|
|
3092
2155
|
};
|
|
3093
2156
|
var TradingAccessTab = ({
|
|
3094
2157
|
venueAccounts,
|
|
3095
2158
|
onConnectKalshi,
|
|
3096
|
-
onDisconnectKalshi
|
|
2159
|
+
onDisconnectKalshi,
|
|
2160
|
+
onConfigureBetdex
|
|
3097
2161
|
}) => {
|
|
3098
|
-
|
|
2162
|
+
var _a;
|
|
2163
|
+
const labels = useLabels14();
|
|
3099
2164
|
const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig2();
|
|
3100
2165
|
const { isLocationBlocked } = useGeoBlock();
|
|
3101
|
-
const
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
2166
|
+
const hasBetdexAccount = (_a = venueAccounts == null ? void 0 : venueAccounts.some((account) => account.venue === "betdex")) != null ? _a : false;
|
|
2167
|
+
const visibleVenues = useMemo3(() => {
|
|
2168
|
+
const visible = getVisibleVenuesByConfig(TRADING_ACCESS_VENUE_ITEMS, disabledVenues);
|
|
2169
|
+
return TRADING_ACCESS_VENUE_ITEMS.filter(
|
|
2170
|
+
(item) => visible.includes(item) || item.id === "betdex" && hasBetdexAccount
|
|
2171
|
+
);
|
|
2172
|
+
}, [disabledVenues, hasBetdexAccount]);
|
|
2173
|
+
return /* @__PURE__ */ jsxs15("div", { className: "agg-trading-access-section flex flex-col gap-4", children: [
|
|
2174
|
+
/* @__PURE__ */ jsx17(SectionTitle2, { children: labels.trading.tradingAccessVenues }),
|
|
2175
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-3", children: visibleVenues.map(({ id: venue }) => {
|
|
2176
|
+
var _a2;
|
|
3109
2177
|
const venueAccount = venueAccounts == null ? void 0 : venueAccounts.find((account) => account.venue === venue);
|
|
3110
2178
|
const isKalshi = venue === "kalshi";
|
|
2179
|
+
const isBetdex = venue === "betdex";
|
|
2180
|
+
const canManageBetdex = isBetdex && hasBetdexAccount && !isAppConfigLoading;
|
|
3111
2181
|
const isConnected = (venueAccount == null ? void 0 : venueAccount.status) === "active";
|
|
3112
2182
|
const availabilityState = getVenueAvailabilityState({
|
|
3113
2183
|
venueId: venue,
|
|
3114
2184
|
disabledVenues,
|
|
3115
|
-
isConfigLoading: isKalshi && isAppConfigLoading,
|
|
2185
|
+
isConfigLoading: (isKalshi || isBetdex) && isAppConfigLoading,
|
|
3116
2186
|
isLocationBlocked
|
|
3117
2187
|
});
|
|
3118
|
-
const displayName = (
|
|
3119
|
-
if (availabilityState === "hidden") return null;
|
|
3120
|
-
return /* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
/* @__PURE__ */
|
|
2188
|
+
const displayName = (_a2 = venueLogoLabels[venue]) != null ? _a2 : venue;
|
|
2189
|
+
if (availabilityState === "hidden" && !canManageBetdex) return null;
|
|
2190
|
+
return /* @__PURE__ */ jsxs15(AccessRow, { children: [
|
|
2191
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2192
|
+
/* @__PURE__ */ jsx17(VenueLogo, { venue, size: "small" }),
|
|
2193
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: displayName })
|
|
3124
2194
|
] }),
|
|
3125
|
-
availabilityState === "
|
|
2195
|
+
isBetdex && (availabilityState === "available" || canManageBetdex) ? /* @__PURE__ */ jsx17(
|
|
2196
|
+
"button",
|
|
2197
|
+
{
|
|
2198
|
+
type: "button",
|
|
2199
|
+
onClick: onConfigureBetdex,
|
|
2200
|
+
disabled: !onConfigureBetdex,
|
|
2201
|
+
"aria-label": labels.trading.manageBetdexAccount,
|
|
2202
|
+
className: "min-h-11 shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-60",
|
|
2203
|
+
children: labels.trading.configureBetdexAccount
|
|
2204
|
+
}
|
|
2205
|
+
) : availabilityState === "geoblocked" ? /* @__PURE__ */ jsx17(GeoblockedStatus, {}) : isKalshi && !isConnected ? /* @__PURE__ */ jsx17(
|
|
3126
2206
|
"button",
|
|
3127
2207
|
{
|
|
3128
2208
|
type: "button",
|
|
@@ -3131,9 +2211,9 @@ var TradingAccessTab = ({
|
|
|
3131
2211
|
className: "shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-60",
|
|
3132
2212
|
children: labels.trading.tradingAccessAddKalshiAccount
|
|
3133
2213
|
}
|
|
3134
|
-
) : isKalshi ? /* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3136
|
-
onDisconnectKalshi ? /* @__PURE__ */
|
|
2214
|
+
) : isKalshi ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-4", children: [
|
|
2215
|
+
/* @__PURE__ */ jsx17(AvailableStatus, {}),
|
|
2216
|
+
onDisconnectKalshi ? /* @__PURE__ */ jsx17(
|
|
3137
2217
|
"button",
|
|
3138
2218
|
{
|
|
3139
2219
|
type: "button",
|
|
@@ -3142,7 +2222,7 @@ var TradingAccessTab = ({
|
|
|
3142
2222
|
children: labels.auth.disconnect
|
|
3143
2223
|
}
|
|
3144
2224
|
) : null
|
|
3145
|
-
] }) : /* @__PURE__ */
|
|
2225
|
+
] }) : /* @__PURE__ */ jsx17(AvailableStatus, {})
|
|
3146
2226
|
] }, venue);
|
|
3147
2227
|
}) })
|
|
3148
2228
|
] });
|
|
@@ -3150,7 +2230,7 @@ var TradingAccessTab = ({
|
|
|
3150
2230
|
TradingAccessTab.displayName = "TradingAccessTab";
|
|
3151
2231
|
|
|
3152
2232
|
// src/profile/index.tsx
|
|
3153
|
-
import { jsx as
|
|
2233
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3154
2234
|
var ProfileModal = ({
|
|
3155
2235
|
open,
|
|
3156
2236
|
onOpenChange,
|
|
@@ -3173,31 +2253,35 @@ var ProfileModal = ({
|
|
|
3173
2253
|
onConnectKalshi,
|
|
3174
2254
|
onDisconnectExchange
|
|
3175
2255
|
}) => {
|
|
3176
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3177
2257
|
const client = useAggClient();
|
|
3178
2258
|
const { user } = useAggAuthState2();
|
|
3179
2259
|
const toastCtx = useOptionalToast();
|
|
3180
|
-
const [activeTab, setActiveTab] =
|
|
2260
|
+
const [activeTab, setActiveTab] = useState4(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
|
|
3181
2261
|
const profileTabItems = useMemo4(() => getProfileTabItems(), []);
|
|
3182
2262
|
const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
|
|
3183
|
-
const [draftUsername, setDraftUsername] =
|
|
3184
|
-
const [draftAvatarFile, setDraftAvatarFile] =
|
|
3185
|
-
const [draftAvatarPreview, setDraftAvatarPreview] =
|
|
3186
|
-
const [isSaving, setIsSaving] =
|
|
3187
|
-
const [avatarTypeError, setAvatarTypeError] =
|
|
3188
|
-
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] =
|
|
2263
|
+
const [draftUsername, setDraftUsername] = useState4(resolvedInitialUsername);
|
|
2264
|
+
const [draftAvatarFile, setDraftAvatarFile] = useState4();
|
|
2265
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = useState4();
|
|
2266
|
+
const [isSaving, setIsSaving] = useState4(false);
|
|
2267
|
+
const [avatarTypeError, setAvatarTypeError] = useState4(null);
|
|
2268
|
+
const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = useState4(false);
|
|
2269
|
+
const [betdexAccountUserId, setBetdexAccountUserId] = useState4(null);
|
|
2270
|
+
const isBetdexAccountModalOpen = !!(user == null ? void 0 : user.id) && betdexAccountUserId === user.id;
|
|
3189
2271
|
const { data: kalshiStatus, refetch: refetchKalshiStatus } = useVenueKeyStatus(
|
|
3190
2272
|
Venue.kalshi,
|
|
3191
2273
|
open
|
|
3192
2274
|
);
|
|
3193
|
-
|
|
2275
|
+
useEffect4(() => {
|
|
3194
2276
|
var _a2;
|
|
3195
2277
|
setDraftUsername((_a2 = username != null ? username : user == null ? void 0 : user.username) != null ? _a2 : "");
|
|
3196
2278
|
}, [username, user == null ? void 0 : user.username]);
|
|
3197
|
-
|
|
2279
|
+
useEffect4(() => {
|
|
3198
2280
|
if (open) return;
|
|
3199
2281
|
setIsConnectKalshiModalOpen(false);
|
|
2282
|
+
setBetdexAccountUserId(null);
|
|
3200
2283
|
}, [open]);
|
|
2284
|
+
useEffect4(() => setBetdexAccountUserId(null), [user == null ? void 0 : user.id]);
|
|
3201
2285
|
const handleOpenChange = useCallback4(
|
|
3202
2286
|
(isOpen) => {
|
|
3203
2287
|
var _a2;
|
|
@@ -3548,178 +2632,198 @@ var ProfileModal = ({
|
|
|
3548
2632
|
};
|
|
3549
2633
|
});
|
|
3550
2634
|
}, [user == null ? void 0 : user.accounts, wallets]);
|
|
3551
|
-
return /* @__PURE__ */
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
"
|
|
3585
|
-
"overflow-hidden rounded-agg-lg",
|
|
3586
|
-
"border border-agg-separator",
|
|
3587
|
-
"bg-agg-secondary",
|
|
3588
|
-
"py-3"
|
|
3589
|
-
),
|
|
3590
|
-
role: "tablist",
|
|
3591
|
-
"aria-label": "Profile sections",
|
|
3592
|
-
children: profileTabItems.map((tab) => {
|
|
3593
|
-
const isActive = activeTab === tab.value;
|
|
3594
|
-
return /* @__PURE__ */ jsxs21(
|
|
3595
|
-
"button",
|
|
3596
|
-
{
|
|
3597
|
-
type: "button",
|
|
3598
|
-
role: "tab",
|
|
3599
|
-
"aria-selected": isActive,
|
|
3600
|
-
onClick: () => setActiveTab(tab.value),
|
|
3601
|
-
className: cn(
|
|
3602
|
-
"agg-profile-tab-trigger",
|
|
3603
|
-
"relative flex items-center gap-3",
|
|
3604
|
-
"h-[49px] px-6 py-4",
|
|
3605
|
-
"text-agg-sm leading-agg-5 font-agg-sans",
|
|
3606
|
-
"transition-colors cursor-pointer",
|
|
3607
|
-
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
3608
|
-
),
|
|
3609
|
-
children: [
|
|
3610
|
-
isActive ? /* @__PURE__ */ jsx23("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
3611
|
-
/* @__PURE__ */ jsx23(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
3612
|
-
/* @__PURE__ */ jsx23("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
3613
|
-
]
|
|
3614
|
-
},
|
|
3615
|
-
tab.value
|
|
3616
|
-
);
|
|
3617
|
-
})
|
|
3618
|
-
}
|
|
3619
|
-
) }),
|
|
3620
|
-
/* @__PURE__ */ jsxs21("div", { className: "agg-profile-content min-w-0 flex-1", children: [
|
|
3621
|
-
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ jsxs21("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
|
|
3622
|
-
/* @__PURE__ */ jsx23(
|
|
3623
|
-
AboutTab,
|
|
2635
|
+
return /* @__PURE__ */ jsxs16(
|
|
2636
|
+
Modal,
|
|
2637
|
+
{
|
|
2638
|
+
open: open && !isConnectKalshiModalOpen && !isBetdexAccountModalOpen,
|
|
2639
|
+
onOpenChange: handleOpenChange,
|
|
2640
|
+
children: [
|
|
2641
|
+
/* @__PURE__ */ jsxs16(
|
|
2642
|
+
Modal.Container,
|
|
2643
|
+
{
|
|
2644
|
+
maxWidth: "800px",
|
|
2645
|
+
"aria-label": "Edit Profile",
|
|
2646
|
+
classNames: {
|
|
2647
|
+
container: cn("agg-profile-modal", "min-h-[37.5rem]")
|
|
2648
|
+
},
|
|
2649
|
+
children: [
|
|
2650
|
+
/* @__PURE__ */ jsx18(Modal.Header, { title: "Edit Profile", classNames: { root: "agg-profile-modal-header" } }),
|
|
2651
|
+
/* @__PURE__ */ jsx18("div", { className: "agg-profile-tabs sm:hidden w-full", children: /* @__PURE__ */ jsx18(
|
|
2652
|
+
Tabs,
|
|
2653
|
+
{
|
|
2654
|
+
className: "w-full [&>div]:w-full",
|
|
2655
|
+
variant: "underline",
|
|
2656
|
+
classNames: { tabList: "w-full" },
|
|
2657
|
+
items: profileTabItems.map((tab) => ({
|
|
2658
|
+
value: tab.value,
|
|
2659
|
+
label: tab.label,
|
|
2660
|
+
icon: /* @__PURE__ */ jsx18(Icon, { name: tab.icon, size: "small" })
|
|
2661
|
+
})),
|
|
2662
|
+
value: activeTab,
|
|
2663
|
+
onChange: (val) => setActiveTab(val)
|
|
2664
|
+
}
|
|
2665
|
+
) }),
|
|
2666
|
+
/* @__PURE__ */ jsx18(Modal.Body, { classNames: { root: cn("agg-profile-modal-body", "overflow-x-visible") }, children: /* @__PURE__ */ jsxs16("div", { className: "agg-profile-layout flex flex-col sm:flex-row sm:gap-10", children: [
|
|
2667
|
+
/* @__PURE__ */ jsx18("div", { className: "shrink-0", children: /* @__PURE__ */ jsx18(
|
|
2668
|
+
"nav",
|
|
3624
2669
|
{
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
2670
|
+
className: cn(
|
|
2671
|
+
"agg-profile-sidebar",
|
|
2672
|
+
"hidden sm:sticky sm:top-0 sm:self-start sm:flex sm:flex-col",
|
|
2673
|
+
"w-[240px]",
|
|
2674
|
+
"overflow-hidden rounded-agg-lg",
|
|
2675
|
+
"border border-agg-separator",
|
|
2676
|
+
"bg-agg-secondary",
|
|
2677
|
+
"py-3"
|
|
2678
|
+
),
|
|
2679
|
+
role: "tablist",
|
|
2680
|
+
"aria-label": "Profile sections",
|
|
2681
|
+
children: profileTabItems.map((tab) => {
|
|
2682
|
+
const isActive = activeTab === tab.value;
|
|
2683
|
+
return /* @__PURE__ */ jsxs16(
|
|
2684
|
+
"button",
|
|
2685
|
+
{
|
|
2686
|
+
type: "button",
|
|
2687
|
+
role: "tab",
|
|
2688
|
+
"aria-selected": isActive,
|
|
2689
|
+
onClick: () => setActiveTab(tab.value),
|
|
2690
|
+
className: cn(
|
|
2691
|
+
"agg-profile-tab-trigger",
|
|
2692
|
+
"relative flex items-center gap-3",
|
|
2693
|
+
"h-[49px] px-6 py-4",
|
|
2694
|
+
"text-agg-sm leading-agg-5 font-agg-sans",
|
|
2695
|
+
"transition-colors cursor-pointer",
|
|
2696
|
+
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
2697
|
+
),
|
|
2698
|
+
children: [
|
|
2699
|
+
isActive ? /* @__PURE__ */ jsx18("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
2700
|
+
/* @__PURE__ */ jsx18(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
2701
|
+
/* @__PURE__ */ jsx18("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
2702
|
+
]
|
|
2703
|
+
},
|
|
2704
|
+
tab.value
|
|
2705
|
+
);
|
|
2706
|
+
})
|
|
3634
2707
|
}
|
|
3635
|
-
),
|
|
3636
|
-
/* @__PURE__ */
|
|
3637
|
-
|
|
2708
|
+
) }),
|
|
2709
|
+
/* @__PURE__ */ jsxs16("div", { className: "agg-profile-content min-w-0 flex-1", children: [
|
|
2710
|
+
activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ jsxs16("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
|
|
2711
|
+
/* @__PURE__ */ jsx18(
|
|
2712
|
+
AboutTab,
|
|
2713
|
+
{
|
|
2714
|
+
username: username != null ? username : user == null ? void 0 : user.username,
|
|
2715
|
+
avatarPreview: (_i = user == null ? void 0 : user.avatarUrl) != null ? _i : avatarPreview,
|
|
2716
|
+
onDeleteProfile,
|
|
2717
|
+
draftUsername,
|
|
2718
|
+
onDraftUsernameChange: setDraftUsername,
|
|
2719
|
+
draftAvatarFile,
|
|
2720
|
+
onDraftAvatarChange: handleDraftAvatarChange,
|
|
2721
|
+
draftAvatarPreview,
|
|
2722
|
+
avatarError: avatarTypeError
|
|
2723
|
+
}
|
|
2724
|
+
),
|
|
2725
|
+
/* @__PURE__ */ jsx18(
|
|
2726
|
+
AccountsWalletsTab,
|
|
2727
|
+
{
|
|
2728
|
+
socialAccounts: resolvedSocialAccounts,
|
|
2729
|
+
wallets: resolvedWallets,
|
|
2730
|
+
email: resolvedEmail,
|
|
2731
|
+
onConnectTwitter: providerActionMap.twitter.connect,
|
|
2732
|
+
onDisconnectTwitter: providerActionMap.twitter.disconnect,
|
|
2733
|
+
onConnectGoogle: providerActionMap.google.connect,
|
|
2734
|
+
onDisconnectGoogle: providerActionMap.google.disconnect,
|
|
2735
|
+
onConnectApple: providerActionMap.apple.connect,
|
|
2736
|
+
onDisconnectApple: providerActionMap.apple.disconnect,
|
|
2737
|
+
onDisconnectWallet: (wallet) => {
|
|
2738
|
+
void handleDisconnectWallet(wallet);
|
|
2739
|
+
},
|
|
2740
|
+
onConnectEmail: providerActionMap.email.connect
|
|
2741
|
+
}
|
|
2742
|
+
)
|
|
2743
|
+
] }) : null,
|
|
2744
|
+
activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ jsx18(
|
|
2745
|
+
TradingAccessTab,
|
|
2746
|
+
{
|
|
2747
|
+
venueAccounts: resolvedVenueAccounts,
|
|
2748
|
+
onConnectKalshi: () => setIsConnectKalshiModalOpen(true),
|
|
2749
|
+
onConfigureBetdex: (user == null ? void 0 : user.id) ? () => setBetdexAccountUserId(user.id) : void 0,
|
|
2750
|
+
onDisconnectKalshi: handleDisconnectKalshi,
|
|
2751
|
+
onKycError
|
|
2752
|
+
}
|
|
2753
|
+
) : null
|
|
2754
|
+
] })
|
|
2755
|
+
] }) }),
|
|
2756
|
+
/* @__PURE__ */ jsxs16(Modal.Footer, { classNames: { root: "agg-profile-modal-footer" }, children: [
|
|
2757
|
+
/* @__PURE__ */ jsx18(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
2758
|
+
/* @__PURE__ */ jsx18(
|
|
2759
|
+
Button,
|
|
3638
2760
|
{
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
onDisconnectGoogle: providerActionMap.google.disconnect,
|
|
3646
|
-
onConnectApple: providerActionMap.apple.connect,
|
|
3647
|
-
onDisconnectApple: providerActionMap.apple.disconnect,
|
|
3648
|
-
onDisconnectWallet: (wallet) => {
|
|
3649
|
-
void handleDisconnectWallet(wallet);
|
|
3650
|
-
},
|
|
3651
|
-
onConnectEmail: providerActionMap.email.connect
|
|
2761
|
+
variant: "primary",
|
|
2762
|
+
size: "large",
|
|
2763
|
+
disabled: !hasChanges,
|
|
2764
|
+
isLoading: isSaving,
|
|
2765
|
+
onClick: handleSave,
|
|
2766
|
+
children: "Save changes"
|
|
3652
2767
|
}
|
|
3653
2768
|
)
|
|
3654
|
-
] })
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
}
|
|
3682
|
-
),
|
|
3683
|
-
/* @__PURE__ */ jsx23(
|
|
3684
|
-
ConnectKalshiModal,
|
|
3685
|
-
{
|
|
3686
|
-
open: open && isConnectKalshiModalOpen,
|
|
3687
|
-
onOpenChange: setIsConnectKalshiModalOpen,
|
|
3688
|
-
onVerify: handleVerifyKalshi
|
|
3689
|
-
}
|
|
3690
|
-
)
|
|
3691
|
-
] });
|
|
2769
|
+
] })
|
|
2770
|
+
]
|
|
2771
|
+
}
|
|
2772
|
+
),
|
|
2773
|
+
/* @__PURE__ */ jsx18(
|
|
2774
|
+
ManageBetdexAccountModal,
|
|
2775
|
+
{
|
|
2776
|
+
userId: user == null ? void 0 : user.id,
|
|
2777
|
+
open: open && isBetdexAccountModalOpen,
|
|
2778
|
+
onOpenChange: (isOpen) => {
|
|
2779
|
+
var _a2;
|
|
2780
|
+
return setBetdexAccountUserId(isOpen ? (_a2 = user == null ? void 0 : user.id) != null ? _a2 : null : null);
|
|
2781
|
+
}
|
|
2782
|
+
},
|
|
2783
|
+
(_j = user == null ? void 0 : user.id) != null ? _j : "signed-out"
|
|
2784
|
+
),
|
|
2785
|
+
/* @__PURE__ */ jsx18(
|
|
2786
|
+
ConnectKalshiModal,
|
|
2787
|
+
{
|
|
2788
|
+
open: open && isConnectKalshiModalOpen,
|
|
2789
|
+
onOpenChange: setIsConnectKalshiModalOpen,
|
|
2790
|
+
onVerify: handleVerifyKalshi
|
|
2791
|
+
}
|
|
2792
|
+
)
|
|
2793
|
+
]
|
|
2794
|
+
}
|
|
2795
|
+
);
|
|
3692
2796
|
};
|
|
3693
2797
|
ProfileModal.displayName = "ProfileModal";
|
|
3694
2798
|
|
|
3695
2799
|
// src/geo-block-modal/index.tsx
|
|
3696
|
-
import { useLabels as
|
|
2800
|
+
import { useLabels as useLabels15 } from "@agg-build/hooks";
|
|
3697
2801
|
import { useCallback as useCallback5 } from "react";
|
|
3698
|
-
import { jsx as
|
|
2802
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3699
2803
|
var GeoBlockModal = ({
|
|
3700
2804
|
open,
|
|
3701
2805
|
onOpenChange,
|
|
3702
2806
|
onConfirm,
|
|
3703
2807
|
classNames
|
|
3704
2808
|
}) => {
|
|
3705
|
-
const labels =
|
|
2809
|
+
const labels = useLabels15();
|
|
3706
2810
|
const handleConfirm = useCallback5(() => {
|
|
3707
2811
|
onConfirm == null ? void 0 : onConfirm();
|
|
3708
2812
|
onOpenChange(false);
|
|
3709
2813
|
}, [onConfirm, onOpenChange]);
|
|
3710
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ jsx19(
|
|
3711
2815
|
Modal,
|
|
3712
2816
|
{
|
|
3713
2817
|
open,
|
|
3714
2818
|
onOpenChange,
|
|
3715
2819
|
"aria-label": labels.trading.geoBlockModalAriaLabel,
|
|
3716
|
-
children: /* @__PURE__ */
|
|
2820
|
+
children: /* @__PURE__ */ jsxs17(
|
|
3717
2821
|
Modal.Container,
|
|
3718
2822
|
{
|
|
3719
2823
|
maxWidth: "480px",
|
|
3720
2824
|
classNames: { container: cn("!rounded-agg-2xl", classNames == null ? void 0 : classNames.container) },
|
|
3721
2825
|
children: [
|
|
3722
|
-
/* @__PURE__ */
|
|
2826
|
+
/* @__PURE__ */ jsx19(
|
|
3723
2827
|
Modal.Header,
|
|
3724
2828
|
{
|
|
3725
2829
|
title: "",
|
|
@@ -3731,19 +2835,19 @@ var GeoBlockModal = ({
|
|
|
3731
2835
|
}
|
|
3732
2836
|
}
|
|
3733
2837
|
),
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ jsx19(Modal.Body, { classNames: { root: cn("!px-10 !pt-0 !pb-12", classNames == null ? void 0 : classNames.body) }, children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col items-center gap-8", children: [
|
|
2839
|
+
/* @__PURE__ */ jsx19(
|
|
3736
2840
|
Icon,
|
|
3737
2841
|
{
|
|
3738
2842
|
name: "internet-security",
|
|
3739
2843
|
className: "h-[60px] w-[60px] text-agg-muted-foreground"
|
|
3740
2844
|
}
|
|
3741
2845
|
),
|
|
3742
|
-
/* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */
|
|
3744
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
2847
|
+
/* @__PURE__ */ jsx19("h2", { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.trading.geoBlockModalTitle }),
|
|
2848
|
+
/* @__PURE__ */ jsx19("p", { className: "text-agg-base font-agg-normal leading-agg-6 text-agg-foreground", children: labels.trading.geoBlockModalDescription })
|
|
3745
2849
|
] }),
|
|
3746
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ jsx19(
|
|
3747
2851
|
Button,
|
|
3748
2852
|
{
|
|
3749
2853
|
variant: "secondary",
|
|
@@ -3768,8 +2872,6 @@ export {
|
|
|
3768
2872
|
clearPendingCardSession,
|
|
3769
2873
|
getPendingCardSession,
|
|
3770
2874
|
DepositModal,
|
|
3771
|
-
buildTerminalSummary,
|
|
3772
|
-
WithdrawModal,
|
|
3773
2875
|
PaperOnboardingModal,
|
|
3774
2876
|
PaperTradingOnboarding,
|
|
3775
2877
|
ProfileModal,
|