@agg-market/ui 12.0.0 → 14.0.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-AKR2ZSBQ.mjs → chunk-4AK5XMOS.mjs} +341 -243
- package/dist/{chunk-XUML4ZJQ.mjs → chunk-B56YA2YQ.mjs} +246 -215
- package/dist/{chunk-TA74OXPL.mjs → chunk-CHVTY3OB.mjs} +1310 -1115
- package/dist/{chunk-VOYSFL6U.mjs → chunk-GQ4P3AHJ.mjs} +1 -1
- package/dist/{chunk-VMJGQKKU.mjs → chunk-T4WFRR6D.mjs} +1 -1
- package/dist/events.js +556 -526
- package/dist/events.mjs +2 -2
- package/dist/index.js +2310 -1984
- package/dist/index.mjs +7 -5
- package/dist/modals.js +2551 -2319
- package/dist/modals.mjs +2 -2
- package/dist/pages.js +1173 -1042
- package/dist/pages.mjs +4 -4
- package/dist/primitives.js +247 -215
- package/dist/primitives.mjs +3 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +427 -397
- package/dist/trading.mjs +2 -2
- package/dist/types/deposit/deposit-modal.constants.d.mts +0 -4
- package/dist/types/deposit/deposit-modal.constants.d.ts +0 -4
- package/dist/types/deposit/deposit-modal.types.d.mts +110 -14
- package/dist/types/deposit/deposit-modal.types.d.ts +110 -14
- package/dist/types/deposit/index.d.mts +1 -1
- package/dist/types/deposit/index.d.ts +1 -1
- package/dist/types/deposit/steps/card-deposit.d.mts +13 -3
- package/dist/types/deposit/steps/card-deposit.d.ts +13 -3
- package/dist/types/deposit/steps/card-provider.d.mts +10 -0
- package/dist/types/deposit/steps/card-provider.d.ts +10 -0
- package/dist/types/deposit/steps/card-purchase-success.d.mts +7 -0
- package/dist/types/deposit/steps/card-purchase-success.d.ts +7 -0
- package/dist/types/deposit/steps/crypto-transfer.d.mts +13 -3
- package/dist/types/deposit/steps/crypto-transfer.d.ts +13 -3
- package/dist/types/deposit/steps/deposit-method.d.mts +6 -4
- package/dist/types/deposit/steps/deposit-method.d.ts +6 -4
- package/dist/types/deposit/steps/wallet-form.d.mts +20 -0
- package/dist/types/deposit/steps/wallet-form.d.ts +20 -0
- package/dist/types/deposit/steps/wallet-processing.d.mts +6 -0
- package/dist/types/deposit/steps/wallet-processing.d.ts +6 -0
- package/dist/types/deposit/steps/wallet-success.d.mts +7 -0
- package/dist/types/deposit/steps/wallet-success.d.ts +7 -0
- package/dist/types/pages/user-profile/index.d.mts +2 -2
- package/dist/types/pages/user-profile/index.d.ts +2 -2
- package/dist/types/pages/user-profile/user-profile.types.d.mts +16 -5
- package/dist/types/pages/user-profile/user-profile.types.d.ts +16 -5
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +4 -0
- package/dist/types/primitives/icon/registry.d.ts +4 -0
- package/dist/types/primitives/icon/svg/success-check.d.mts +5 -0
- package/dist/types/primitives/icon/svg/success-check.d.ts +5 -0
- package/dist/types/withdraw/index.d.mts +2 -2
- package/dist/types/withdraw/index.d.ts +2 -2
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +14 -5
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +14 -5
- package/dist/types/withdraw/steps/withdraw-method.d.mts +3 -4
- package/dist/types/withdraw/steps/withdraw-method.d.ts +3 -4
- package/dist/types/withdraw/steps/withdraw-provider.d.mts +10 -0
- package/dist/types/withdraw/steps/withdraw-provider.d.ts +10 -0
- package/dist/types/withdraw/steps/withdraw-success.d.mts +7 -0
- package/dist/types/withdraw/steps/withdraw-success.d.ts +7 -0
- package/dist/types/withdraw/withdraw-modal.constants.d.mts +0 -4
- package/dist/types/withdraw/withdraw-modal.constants.d.ts +0 -4
- package/dist/types/withdraw/withdraw-modal.types.d.mts +47 -23
- package/dist/types/withdraw/withdraw-modal.types.d.ts +47 -23
- package/package.json +2 -2
- package/dist/types/deposit/steps/kalshi-deposit.d.mts +0 -5
- package/dist/types/deposit/steps/kalshi-deposit.d.ts +0 -5
- package/dist/types/withdraw/steps/kalshi-withdraw.d.mts +0 -5
- package/dist/types/withdraw/steps/kalshi-withdraw.d.ts +0 -5
- package/dist/types/withdraw/steps/venue-selection.d.mts +0 -6
- package/dist/types/withdraw/steps/venue-selection.d.ts +0 -6
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Badge,
|
|
3
|
-
BankIcon,
|
|
4
3
|
BestPricesIcon,
|
|
5
4
|
BoltIcon,
|
|
6
5
|
Button,
|
|
7
6
|
CheckCircleIcon,
|
|
8
7
|
ChevronLeftIcon,
|
|
9
8
|
ChevronRightIcon,
|
|
9
|
+
CloseIcon,
|
|
10
10
|
CopyIcon,
|
|
11
11
|
CreateAccountIcon,
|
|
12
12
|
CreditCardIcon,
|
|
13
13
|
DocumentIcon,
|
|
14
|
-
ExternalLinkIcon,
|
|
15
14
|
Icon,
|
|
16
15
|
InlineAlert,
|
|
17
16
|
LinkAccountsIcon,
|
|
@@ -23,9 +22,9 @@ import {
|
|
|
23
22
|
Select,
|
|
24
23
|
StateMessage,
|
|
25
24
|
StayInControlIcon,
|
|
25
|
+
SuccessCheckIcon,
|
|
26
26
|
VenueLogo,
|
|
27
27
|
WalletIcon,
|
|
28
|
-
WarningFilledIcon,
|
|
29
28
|
WarningIcon,
|
|
30
29
|
__async,
|
|
31
30
|
__spreadProps,
|
|
@@ -34,99 +33,30 @@ import {
|
|
|
34
33
|
formatAmountDisplay,
|
|
35
34
|
formatCompactUsd,
|
|
36
35
|
venueLogoLabels
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-B56YA2YQ.mjs";
|
|
38
37
|
|
|
39
38
|
// src/deposit/index.tsx
|
|
40
39
|
import { useState as useState3 } from "react";
|
|
41
40
|
|
|
42
|
-
// src/deposit/deposit-modal.constants.ts
|
|
43
|
-
var KALSHI_VENUE = "kalshi";
|
|
44
|
-
var KALSHI_DEPOSIT_URL_DEFAULT = "https://kalshi.com/account/deposit";
|
|
45
|
-
|
|
46
|
-
// src/deposit/steps/venue-selection.tsx
|
|
47
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
48
|
-
var VenueRow = ({ venue, onSelect }) => {
|
|
49
|
-
var _a;
|
|
50
|
-
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
51
|
-
const hasShortfall = venue.shortfall != null && venue.shortfall > 0;
|
|
52
|
-
return /* @__PURE__ */ jsxs(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: cn(
|
|
56
|
-
"flex items-center gap-3 sm:gap-4",
|
|
57
|
-
"rounded-xl border border-agg-separator",
|
|
58
|
-
"p-3 sm:p-4",
|
|
59
|
-
"hover:bg-agg-secondary-hover transition-colors cursor-pointer"
|
|
60
|
-
),
|
|
61
|
-
role: "button",
|
|
62
|
-
tabIndex: 0,
|
|
63
|
-
onClick: () => onSelect(venue.venue),
|
|
64
|
-
onKeyDown: (e) => {
|
|
65
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
onSelect(venue.venue);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(VenueLogo, { venue: venue.venue, size: "large", className: "rounded-lg" }) }),
|
|
72
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
73
|
-
/* @__PURE__ */ jsx("p", { className: "agg-type-body-strong text-agg-foreground", children: displayName }),
|
|
74
|
-
/* @__PURE__ */ jsxs("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
75
|
-
"Balance ",
|
|
76
|
-
formatCompactUsd(venue.balance)
|
|
77
|
-
] })
|
|
78
|
-
] }),
|
|
79
|
-
hasShortfall ? /* @__PURE__ */ jsxs("div", { className: "hidden sm:flex items-center gap-1.5 shrink-0", children: [
|
|
80
|
-
/* @__PURE__ */ jsx(WarningFilledIcon, { className: "h-4 w-4 text-agg-warning" }),
|
|
81
|
-
/* @__PURE__ */ jsxs("span", { className: "agg-type-label-strong whitespace-nowrap text-agg-warning", children: [
|
|
82
|
-
"Short ",
|
|
83
|
-
formatCompactUsd(venue.shortfall)
|
|
84
|
-
] })
|
|
85
|
-
] }) : null,
|
|
86
|
-
/* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(
|
|
87
|
-
Button,
|
|
88
|
-
{
|
|
89
|
-
variant: "secondary",
|
|
90
|
-
size: "small",
|
|
91
|
-
suffix: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
92
|
-
onClick: (e) => {
|
|
93
|
-
e.stopPropagation();
|
|
94
|
-
onSelect(venue.venue);
|
|
95
|
-
},
|
|
96
|
-
children: hasShortfall ? "Continue" : "Select"
|
|
97
|
-
}
|
|
98
|
-
) })
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
var VenueSelectionStep = ({
|
|
104
|
-
venues,
|
|
105
|
-
hasAnyShortfall,
|
|
106
|
-
onSelectVenue
|
|
107
|
-
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
-
/* @__PURE__ */ jsx(Modal.Header, { title: "Deposit", hideBorder: true }),
|
|
109
|
-
/* @__PURE__ */ jsx(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
110
|
-
!hasAnyShortfall ? /* @__PURE__ */ jsx("p", { className: "agg-type-body text-agg-foreground", children: "Choose where to deposit funds:" }) : null,
|
|
111
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: venues.map((venue) => /* @__PURE__ */ jsx(VenueRow, { venue, onSelect: onSelectVenue }, venue.venue)) })
|
|
112
|
-
] }) })
|
|
113
|
-
] });
|
|
114
|
-
|
|
115
41
|
// src/deposit/steps/deposit-method.tsx
|
|
116
|
-
import {
|
|
42
|
+
import { useLabels } from "@agg-market/hooks";
|
|
43
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
117
44
|
var DepositMethodCard = ({
|
|
118
45
|
icon,
|
|
119
46
|
title,
|
|
120
47
|
description,
|
|
48
|
+
value,
|
|
49
|
+
highlighted = false,
|
|
121
50
|
onContinue
|
|
122
|
-
}) => /* @__PURE__ */
|
|
51
|
+
}) => /* @__PURE__ */ jsxs(
|
|
123
52
|
"div",
|
|
124
53
|
{
|
|
125
54
|
className: cn(
|
|
126
55
|
"flex items-center gap-3 sm:gap-4",
|
|
127
56
|
"rounded-xl border border-agg-separator",
|
|
128
57
|
"p-3 sm:p-4",
|
|
129
|
-
"hover:bg-agg-secondary-hover
|
|
58
|
+
"transition-colors cursor-pointer hover:bg-agg-secondary-hover",
|
|
59
|
+
highlighted ? "" : ""
|
|
130
60
|
),
|
|
131
61
|
role: "button",
|
|
132
62
|
tabIndex: 0,
|
|
@@ -138,77 +68,61 @@ var DepositMethodCard = ({
|
|
|
138
68
|
}
|
|
139
69
|
},
|
|
140
70
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("p", { className: "agg-type-body-strong text-agg-foreground", children: title }),
|
|
74
|
+
/* @__PURE__ */ jsx("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
145
75
|
] }),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
148
|
-
{
|
|
149
|
-
variant: "secondary",
|
|
150
|
-
size: "small",
|
|
151
|
-
suffix: /* @__PURE__ */ jsx2(ChevronRightIcon, {}),
|
|
152
|
-
onClick: (e) => {
|
|
153
|
-
e.stopPropagation();
|
|
154
|
-
onContinue();
|
|
155
|
-
},
|
|
156
|
-
children: "Continue"
|
|
157
|
-
}
|
|
158
|
-
) })
|
|
76
|
+
value ? /* @__PURE__ */ jsx("p", { className: "agg-type-label text-agg-muted-foreground", children: value }) : null,
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
159
78
|
]
|
|
160
79
|
}
|
|
161
80
|
);
|
|
162
81
|
var DepositMethodStep = ({
|
|
163
|
-
|
|
164
|
-
|
|
82
|
+
balance,
|
|
83
|
+
walletLabel,
|
|
84
|
+
walletBalance,
|
|
85
|
+
highlightedMethod,
|
|
165
86
|
onSelectMethod
|
|
166
87
|
}) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
88
|
+
const labels = useLabels();
|
|
89
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
90
|
+
/* @__PURE__ */ jsx(Modal.Header, { title: labels.deposit.title, hideBorder: true }),
|
|
91
|
+
/* @__PURE__ */ jsx(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
93
|
+
labels.deposit.balancePrefix,
|
|
94
|
+
" ",
|
|
95
|
+
formatCompactUsd(balance)
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
DepositMethodCard,
|
|
177
100
|
{
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
101
|
+
icon: /* @__PURE__ */ jsx(WalletIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
102
|
+
title: labels.deposit.methods.walletTitle(walletLabel),
|
|
103
|
+
description: labels.deposit.methods.walletDescription,
|
|
104
|
+
value: formatCompactUsd(walletBalance),
|
|
105
|
+
highlighted: highlightedMethod === "wallet",
|
|
106
|
+
onContinue: () => onSelectMethod("wallet")
|
|
183
107
|
}
|
|
184
|
-
)
|
|
185
|
-
|
|
186
|
-
),
|
|
187
|
-
/* @__PURE__ */ jsx2(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-4", children: [
|
|
188
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
189
|
-
/* @__PURE__ */ jsx2(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
190
|
-
/* @__PURE__ */ jsxs2("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
191
|
-
displayName,
|
|
192
|
-
" balance: ",
|
|
193
|
-
formatCompactUsd(venue.balance)
|
|
194
|
-
] })
|
|
195
|
-
] }),
|
|
196
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-3", children: [
|
|
197
|
-
/* @__PURE__ */ jsx2(
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
198
110
|
DepositMethodCard,
|
|
199
111
|
{
|
|
200
|
-
icon: /* @__PURE__ */
|
|
201
|
-
title:
|
|
202
|
-
description:
|
|
112
|
+
icon: /* @__PURE__ */ jsx(BoltIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
113
|
+
title: labels.deposit.methods.cryptoTitle,
|
|
114
|
+
description: labels.deposit.methods.cryptoDescription,
|
|
115
|
+
highlighted: highlightedMethod === "crypto",
|
|
203
116
|
onContinue: () => onSelectMethod("crypto")
|
|
204
117
|
}
|
|
205
118
|
),
|
|
206
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
207
120
|
DepositMethodCard,
|
|
208
121
|
{
|
|
209
|
-
icon: /* @__PURE__ */
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
122
|
+
icon: /* @__PURE__ */ jsx(CreditCardIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
123
|
+
title: labels.deposit.methods.cardTitle,
|
|
124
|
+
description: labels.deposit.methods.cardDescription,
|
|
125
|
+
highlighted: highlightedMethod === "card",
|
|
212
126
|
onContinue: () => onSelectMethod("card")
|
|
213
127
|
}
|
|
214
128
|
)
|
|
@@ -218,114 +132,125 @@ var DepositMethodStep = ({
|
|
|
218
132
|
};
|
|
219
133
|
|
|
220
134
|
// src/deposit/steps/card-deposit.tsx
|
|
221
|
-
import {
|
|
222
|
-
import {
|
|
135
|
+
import { useLabels as useLabels2 } from "@agg-market/hooks";
|
|
136
|
+
import { useEffect, useState } from "react";
|
|
137
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
223
138
|
var CardDepositStep = ({
|
|
224
|
-
|
|
139
|
+
amount,
|
|
140
|
+
currency,
|
|
141
|
+
destinationWallet,
|
|
142
|
+
tokenOptions,
|
|
143
|
+
networkOptions,
|
|
144
|
+
selectedToken,
|
|
145
|
+
selectedNetwork,
|
|
225
146
|
onBack,
|
|
147
|
+
onAmountChange,
|
|
148
|
+
onCurrencyChange,
|
|
149
|
+
onTokenChange,
|
|
150
|
+
onNetworkChange,
|
|
226
151
|
onContinue
|
|
227
152
|
}) => {
|
|
228
|
-
|
|
229
|
-
const [
|
|
230
|
-
|
|
231
|
-
|
|
153
|
+
const labels = useLabels2();
|
|
154
|
+
const [localAmount, setLocalAmount] = useState(amount);
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
setLocalAmount(amount);
|
|
157
|
+
}, [amount]);
|
|
158
|
+
const numericAmount = Number(localAmount) || 0;
|
|
232
159
|
const isValid = numericAmount > 0;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const parts = v.split(".");
|
|
236
|
-
const sanitized = parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v;
|
|
237
|
-
setRawAmount(sanitized);
|
|
238
|
-
}, []);
|
|
239
|
-
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
240
|
-
/* @__PURE__ */ jsx3(
|
|
160
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
161
|
+
/* @__PURE__ */ jsx2(
|
|
241
162
|
Modal.Header,
|
|
242
163
|
{
|
|
243
|
-
title:
|
|
164
|
+
title: labels.deposit.cardFlow.title,
|
|
244
165
|
hideBorder: true,
|
|
245
|
-
leftElement: /* @__PURE__ */
|
|
166
|
+
leftElement: /* @__PURE__ */ jsx2(
|
|
246
167
|
"button",
|
|
247
168
|
{
|
|
248
169
|
type: "button",
|
|
249
170
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
250
171
|
onClick: onBack,
|
|
251
172
|
"aria-label": "Go back",
|
|
252
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ jsx2(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
253
174
|
}
|
|
254
175
|
)
|
|
255
176
|
}
|
|
256
177
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
178
|
+
/* @__PURE__ */ jsx2(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-5", children: [
|
|
179
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex gap-3 items-end", children: [
|
|
180
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 flex flex-col gap-2", children: [
|
|
181
|
+
/* @__PURE__ */ jsx2("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.amountLabel }),
|
|
182
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3", children: [
|
|
183
|
+
/* @__PURE__ */ jsx2(
|
|
184
|
+
"input",
|
|
185
|
+
{
|
|
186
|
+
type: "text",
|
|
187
|
+
inputMode: "decimal",
|
|
188
|
+
"aria-label": labels.deposit.cardFlow.amountLabel,
|
|
189
|
+
className: cn(
|
|
190
|
+
"agg-type-body w-full bg-transparent outline-none",
|
|
191
|
+
isValid ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
192
|
+
),
|
|
193
|
+
placeholder: "0.00",
|
|
194
|
+
value: localAmount,
|
|
195
|
+
onChange: (event) => {
|
|
196
|
+
const next = event.target.value;
|
|
197
|
+
setLocalAmount(next);
|
|
198
|
+
onAmountChange(next);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsx2("span", { className: "agg-type-body text-agg-muted-foreground", children: "$" })
|
|
203
|
+
] })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ jsx2("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx2(
|
|
268
206
|
Select,
|
|
269
207
|
{
|
|
270
|
-
items: [{ value:
|
|
271
|
-
value:
|
|
272
|
-
onChange:
|
|
273
|
-
|
|
274
|
-
ariaLabel: "Currency",
|
|
275
|
-
className: "w-auto"
|
|
208
|
+
items: [{ value: currency, label: currency }],
|
|
209
|
+
value: currency,
|
|
210
|
+
onChange: onCurrencyChange,
|
|
211
|
+
ariaLabel: labels.deposit.cardFlow.currencyLabel
|
|
276
212
|
}
|
|
277
|
-
) })
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
213
|
+
) })
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex gap-5", children: [
|
|
216
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
217
|
+
/* @__PURE__ */ jsx2("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.tokenLabel }),
|
|
218
|
+
/* @__PURE__ */ jsx2(
|
|
219
|
+
Select,
|
|
282
220
|
{
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
"agg-type-display w-full bg-transparent outline-none",
|
|
288
|
-
isValid ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
289
|
-
),
|
|
290
|
-
placeholder: "0",
|
|
291
|
-
value: rawAmount ? formatAmountDisplay(rawAmount) : "",
|
|
292
|
-
onChange: handleAmountChange
|
|
221
|
+
items: tokenOptions,
|
|
222
|
+
value: selectedToken,
|
|
223
|
+
onChange: onTokenChange,
|
|
224
|
+
ariaLabel: labels.deposit.cardFlow.tokenLabel
|
|
293
225
|
}
|
|
294
226
|
)
|
|
295
|
-
] })
|
|
227
|
+
] }),
|
|
228
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
229
|
+
/* @__PURE__ */ jsx2("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.networkLabel }),
|
|
230
|
+
/* @__PURE__ */ jsx2(
|
|
231
|
+
Select,
|
|
232
|
+
{
|
|
233
|
+
items: networkOptions,
|
|
234
|
+
value: selectedNetwork,
|
|
235
|
+
onChange: onNetworkChange,
|
|
236
|
+
ariaLabel: labels.deposit.cardFlow.networkLabel
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] })
|
|
296
240
|
] }),
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
"
|
|
299
|
-
{
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
"rounded-xl border border-agg-separator",
|
|
303
|
-
"p-3 sm:p-4",
|
|
304
|
-
"hover:bg-agg-secondary-hover transition-colors cursor-pointer"
|
|
305
|
-
),
|
|
306
|
-
role: "button",
|
|
307
|
-
tabIndex: 0,
|
|
308
|
-
children: [
|
|
309
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
|
|
310
|
-
/* @__PURE__ */ jsx3("p", { className: "agg-type-body-strong text-agg-foreground", children: "Provider" }),
|
|
311
|
-
/* @__PURE__ */ jsx3("p", { className: "agg-type-label text-agg-muted-foreground", children: "Auto-picked for you" })
|
|
312
|
-
] }),
|
|
313
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
314
|
-
/* @__PURE__ */ jsx3("span", { className: "agg-type-label-strong text-agg-foreground", children: "Swapped" }),
|
|
315
|
-
/* @__PURE__ */ jsx3(ChevronRightIcon, { className: "h-4 w-4 text-agg-foreground" })
|
|
316
|
-
] })
|
|
317
|
-
]
|
|
318
|
-
}
|
|
319
|
-
),
|
|
320
|
-
/* @__PURE__ */ jsx3(
|
|
241
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-2", children: [
|
|
242
|
+
/* @__PURE__ */ jsx2("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.cardFlow.destinationWalletLabel }),
|
|
243
|
+
/* @__PURE__ */ jsx2("div", { className: "flex h-10 items-center rounded border border-agg-separator bg-agg-secondary px-3", children: /* @__PURE__ */ jsx2("p", { className: "agg-type-body truncate text-agg-foreground", children: destinationWallet }) })
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ jsx2(
|
|
321
246
|
Button,
|
|
322
247
|
{
|
|
323
|
-
variant: "primary",
|
|
248
|
+
variant: isValid ? "primary" : "secondary",
|
|
324
249
|
size: "large",
|
|
325
250
|
className: "w-full",
|
|
326
251
|
disabled: !isValid,
|
|
327
252
|
onClick: () => onContinue(numericAmount),
|
|
328
|
-
children:
|
|
253
|
+
children: labels.deposit.cardFlow.getQuotes
|
|
329
254
|
}
|
|
330
255
|
)
|
|
331
256
|
] }) })
|
|
@@ -333,95 +258,135 @@ var CardDepositStep = ({
|
|
|
333
258
|
};
|
|
334
259
|
|
|
335
260
|
// src/deposit/steps/crypto-transfer.tsx
|
|
336
|
-
import {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
261
|
+
import { useLabels as useLabels3 } from "@agg-market/hooks";
|
|
262
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
263
|
+
var CryptoTransferStep = ({
|
|
264
|
+
tokenOptions,
|
|
265
|
+
networkOptions,
|
|
266
|
+
selectedToken,
|
|
267
|
+
selectedNetwork,
|
|
268
|
+
depositAddress,
|
|
269
|
+
minDeposit,
|
|
270
|
+
feeEstimate,
|
|
271
|
+
eta,
|
|
272
|
+
onBack,
|
|
273
|
+
onTokenChange,
|
|
274
|
+
onNetworkChange,
|
|
275
|
+
onCopyAddress,
|
|
276
|
+
onDone
|
|
277
|
+
}) => {
|
|
278
|
+
const labels = useLabels3();
|
|
279
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
280
|
+
/* @__PURE__ */ jsx3(
|
|
281
|
+
Modal.Header,
|
|
282
|
+
{
|
|
283
|
+
title: labels.deposit.sendCrypto.title,
|
|
284
|
+
hideBorder: true,
|
|
285
|
+
leftElement: /* @__PURE__ */ jsx3(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
type: "button",
|
|
289
|
+
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
290
|
+
onClick: onBack,
|
|
291
|
+
"aria-label": "Go back",
|
|
292
|
+
children: /* @__PURE__ */ jsx3(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
/* @__PURE__ */ jsx3(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-7", children: [
|
|
298
|
+
/* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-5", children: /* @__PURE__ */ jsxs3("div", { className: "flex gap-5", children: [
|
|
299
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
300
|
+
/* @__PURE__ */ jsx3("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.tokenLabel }),
|
|
301
|
+
/* @__PURE__ */ jsx3(
|
|
302
|
+
Select,
|
|
303
|
+
{
|
|
304
|
+
items: tokenOptions,
|
|
305
|
+
value: selectedToken,
|
|
306
|
+
onChange: onTokenChange,
|
|
307
|
+
ariaLabel: labels.deposit.sendCrypto.tokenLabel
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] }),
|
|
311
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
312
|
+
/* @__PURE__ */ jsx3("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.networkLabel }),
|
|
313
|
+
/* @__PURE__ */ jsx3(
|
|
314
|
+
Select,
|
|
315
|
+
{
|
|
316
|
+
items: networkOptions,
|
|
317
|
+
value: selectedNetwork,
|
|
318
|
+
onChange: onNetworkChange,
|
|
319
|
+
ariaLabel: labels.deposit.sendCrypto.networkLabel
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
] })
|
|
323
|
+
] }) }),
|
|
324
|
+
/* @__PURE__ */ jsx3("div", { className: "mx-auto flex h-[160px] w-[160px] items-center justify-center rounded-xl border border-agg-separator bg-agg-secondary-hover", children: /* @__PURE__ */ jsx3("p", { className: "agg-type-label text-agg-muted-foreground", children: labels.deposit.sendCrypto.qrPlaceholder }) }),
|
|
325
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-3", children: [
|
|
326
|
+
/* @__PURE__ */ jsx3("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.sendCrypto.depositAddressLabel }),
|
|
327
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 rounded border border-agg-separator bg-agg-secondary h-10 px-3", children: [
|
|
328
|
+
/* @__PURE__ */ jsx3("p", { className: "agg-type-body flex-1 min-w-0 truncate text-agg-foreground", children: depositAddress }),
|
|
329
|
+
/* @__PURE__ */ jsxs3(
|
|
330
|
+
"button",
|
|
331
|
+
{
|
|
332
|
+
type: "button",
|
|
333
|
+
className: "shrink-0 inline-flex items-center gap-1 text-agg-primary hover:text-agg-primary/80 transition-colors",
|
|
334
|
+
onClick: onCopyAddress,
|
|
335
|
+
children: [
|
|
336
|
+
/* @__PURE__ */ jsx3(CopyIcon, { className: "h-4 w-4" }),
|
|
337
|
+
/* @__PURE__ */ jsx3("span", { className: "agg-type-label-strong", children: labels.deposit.sendCrypto.copy })
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ jsx3("p", { className: "agg-type-label text-agg-foreground", children: `${labels.deposit.sendCrypto.minDepositPrefix} ${minDeposit} \xB7 ${labels.deposit.walletFlow.feePrefix} ${feeEstimate} \xB7 ${eta}` })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3 rounded-lg bg-agg-secondary-hover p-3", children: [
|
|
345
|
+
/* @__PURE__ */ jsx3(WarningIcon, { className: "h-4 w-4 text-agg-muted-foreground mt-0.5" }),
|
|
346
|
+
/* @__PURE__ */ jsx3("p", { className: "text-agg-xs leading-agg-4 text-agg-foreground", children: labels.deposit.sendCrypto.warning })
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsx3(
|
|
349
|
+
Button,
|
|
350
|
+
{
|
|
351
|
+
variant: "secondary",
|
|
352
|
+
size: "large",
|
|
353
|
+
className: "w-[120px] self-center",
|
|
354
|
+
onClick: onDone,
|
|
355
|
+
children: labels.deposit.done
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
] }) })
|
|
359
|
+
] });
|
|
380
360
|
};
|
|
381
361
|
|
|
382
|
-
// src/deposit/steps/
|
|
362
|
+
// src/deposit/steps/wallet-form.tsx
|
|
363
|
+
import { useLabels as useLabels4 } from "@agg-market/hooks";
|
|
383
364
|
import { Fragment as Fragment4, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
384
|
-
var
|
|
385
|
-
|
|
365
|
+
var WalletFormStep = ({
|
|
366
|
+
walletLabel,
|
|
367
|
+
walletBalance,
|
|
368
|
+
tokenOptions,
|
|
369
|
+
networkOptions,
|
|
370
|
+
selectedToken,
|
|
371
|
+
selectedNetwork,
|
|
372
|
+
amount,
|
|
373
|
+
estimatedReceive,
|
|
374
|
+
feeEstimate,
|
|
375
|
+
eta,
|
|
386
376
|
onBack,
|
|
387
|
-
|
|
377
|
+
onTokenChange,
|
|
378
|
+
onNetworkChange,
|
|
379
|
+
onAmountChange,
|
|
380
|
+
onMax,
|
|
381
|
+
onConfirm
|
|
388
382
|
}) => {
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
const defaultNetwork = (_c = (_b = SUPPORTED_NETWORKS[0]) == null ? void 0 : _b.value) != null ? _c : "";
|
|
392
|
-
const [selectedNetwork, setSelectedNetwork] = useState2(defaultNetwork);
|
|
393
|
-
const tokenItems = useMemo(() => {
|
|
394
|
-
const tokens = getTokensForNetwork(selectedNetwork);
|
|
395
|
-
return tokens.map((t) => ({
|
|
396
|
-
value: t.value,
|
|
397
|
-
label: t.label,
|
|
398
|
-
iconUrl: t.iconUrl
|
|
399
|
-
}));
|
|
400
|
-
}, [selectedNetwork]);
|
|
401
|
-
const [selectedToken, setSelectedToken] = useState2((_e = (_d = tokenItems[0]) == null ? void 0 : _d.value) != null ? _e : "");
|
|
402
|
-
const networkItems = useMemo(
|
|
403
|
-
() => SUPPORTED_NETWORKS.map((n) => ({
|
|
404
|
-
value: n.value,
|
|
405
|
-
label: n.label,
|
|
406
|
-
iconUrl: n.iconUrl
|
|
407
|
-
})),
|
|
408
|
-
[]
|
|
409
|
-
);
|
|
410
|
-
const handleNetworkChange = useCallback2((networkValue) => {
|
|
411
|
-
var _a2, _b2;
|
|
412
|
-
setSelectedNetwork(networkValue);
|
|
413
|
-
const tokens = getTokensForNetwork(networkValue);
|
|
414
|
-
setSelectedToken((_b2 = (_a2 = tokens[0]) == null ? void 0 : _a2.value) != null ? _b2 : "");
|
|
415
|
-
}, []);
|
|
416
|
-
const depositAddress = "82nbtQamxV3KPZtyRMXjrQ4xwQJMRcXn2PYmpfQyq5UK";
|
|
417
|
-
const handleCopyAddress = useCallback2(() => {
|
|
418
|
-
void navigator.clipboard.writeText(depositAddress);
|
|
419
|
-
}, [depositAddress]);
|
|
383
|
+
const labels = useLabels4();
|
|
384
|
+
const isConfirmEnabled = Number(amount) > 0;
|
|
420
385
|
return /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
421
386
|
/* @__PURE__ */ jsx4(
|
|
422
387
|
Modal.Header,
|
|
423
388
|
{
|
|
424
|
-
title:
|
|
389
|
+
title: labels.deposit.walletFlow.title,
|
|
425
390
|
hideBorder: true,
|
|
426
391
|
leftElement: /* @__PURE__ */ jsx4(
|
|
427
392
|
"button",
|
|
@@ -436,35 +401,43 @@ var CryptoTransferStep = ({
|
|
|
436
401
|
}
|
|
437
402
|
),
|
|
438
403
|
/* @__PURE__ */ jsx4(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-7", children: [
|
|
404
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between", children: [
|
|
405
|
+
/* @__PURE__ */ jsx4("p", { className: "agg-type-label text-agg-foreground", children: walletLabel }),
|
|
406
|
+
/* @__PURE__ */ jsxs4("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
407
|
+
labels.deposit.balanceLabel,
|
|
408
|
+
" ",
|
|
409
|
+
formatCompactUsd(walletBalance)
|
|
410
|
+
] })
|
|
411
|
+
] }),
|
|
439
412
|
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-5", children: [
|
|
440
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex gap-
|
|
413
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex gap-5", children: [
|
|
441
414
|
/* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
442
|
-
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children:
|
|
415
|
+
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.tokenLabel }),
|
|
443
416
|
/* @__PURE__ */ jsx4(
|
|
444
417
|
Select,
|
|
445
418
|
{
|
|
446
|
-
items:
|
|
419
|
+
items: tokenOptions,
|
|
447
420
|
value: selectedToken,
|
|
448
|
-
onChange:
|
|
449
|
-
ariaLabel:
|
|
421
|
+
onChange: onTokenChange,
|
|
422
|
+
ariaLabel: labels.deposit.walletFlow.tokenLabel
|
|
450
423
|
}
|
|
451
424
|
)
|
|
452
425
|
] }),
|
|
453
426
|
/* @__PURE__ */ jsxs4("div", { className: "flex flex-1 flex-col gap-2 min-w-0", children: [
|
|
454
|
-
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children:
|
|
427
|
+
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.networkLabel }),
|
|
455
428
|
/* @__PURE__ */ jsx4(
|
|
456
429
|
Select,
|
|
457
430
|
{
|
|
458
|
-
items:
|
|
431
|
+
items: networkOptions,
|
|
459
432
|
value: selectedNetwork,
|
|
460
|
-
onChange:
|
|
461
|
-
ariaLabel:
|
|
433
|
+
onChange: onNetworkChange,
|
|
434
|
+
ariaLabel: labels.deposit.walletFlow.networkLabel
|
|
462
435
|
}
|
|
463
436
|
)
|
|
464
437
|
] })
|
|
465
438
|
] }),
|
|
466
439
|
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
|
|
467
|
-
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children:
|
|
440
|
+
/* @__PURE__ */ jsx4("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.deposit.walletFlow.amountLabel }),
|
|
468
441
|
/* @__PURE__ */ jsxs4(
|
|
469
442
|
"div",
|
|
470
443
|
{
|
|
@@ -474,210 +447,473 @@ var CryptoTransferStep = ({
|
|
|
474
447
|
"h-10 px-3"
|
|
475
448
|
),
|
|
476
449
|
children: [
|
|
477
|
-
/* @__PURE__ */ jsx4(
|
|
450
|
+
/* @__PURE__ */ jsx4(
|
|
451
|
+
"input",
|
|
452
|
+
{
|
|
453
|
+
type: "text",
|
|
454
|
+
inputMode: "decimal",
|
|
455
|
+
"aria-label": labels.deposit.walletFlow.amountLabel,
|
|
456
|
+
className: "agg-type-body w-full bg-transparent outline-none text-agg-foreground",
|
|
457
|
+
placeholder: "0.00",
|
|
458
|
+
value: amount,
|
|
459
|
+
onChange: (event) => onAmountChange(event.target.value)
|
|
460
|
+
}
|
|
461
|
+
),
|
|
478
462
|
/* @__PURE__ */ jsx4(
|
|
479
463
|
"button",
|
|
480
464
|
{
|
|
481
465
|
type: "button",
|
|
482
|
-
className: "shrink-0 text-agg-
|
|
483
|
-
onClick:
|
|
484
|
-
"aria-label":
|
|
485
|
-
children:
|
|
466
|
+
className: "shrink-0 text-agg-primary transition-colors hover:text-agg-primary/80",
|
|
467
|
+
onClick: onMax,
|
|
468
|
+
"aria-label": labels.deposit.walletFlow.max,
|
|
469
|
+
children: labels.deposit.walletFlow.max
|
|
486
470
|
}
|
|
487
471
|
)
|
|
488
472
|
]
|
|
489
473
|
}
|
|
490
474
|
)
|
|
491
|
-
] })
|
|
475
|
+
] }),
|
|
476
|
+
estimatedReceive && feeEstimate && eta ? /* @__PURE__ */ jsx4("p", { className: "agg-type-label text-agg-foreground", children: `\u2248 ${estimatedReceive} \xB7 ${labels.deposit.walletFlow.feePrefix} ${feeEstimate} \xB7 ${eta}` }) : null
|
|
492
477
|
] }),
|
|
493
|
-
/* @__PURE__ */ jsx4(
|
|
478
|
+
/* @__PURE__ */ jsx4(
|
|
479
|
+
Button,
|
|
480
|
+
{
|
|
481
|
+
variant: isConfirmEnabled ? "primary" : "secondary",
|
|
482
|
+
size: "large",
|
|
483
|
+
className: "w-full",
|
|
484
|
+
disabled: !isConfirmEnabled,
|
|
485
|
+
onClick: onConfirm,
|
|
486
|
+
children: labels.deposit.walletFlow.confirm
|
|
487
|
+
}
|
|
488
|
+
)
|
|
494
489
|
] }) })
|
|
495
490
|
] });
|
|
496
491
|
};
|
|
497
492
|
|
|
498
|
-
// src/deposit/steps/
|
|
493
|
+
// src/deposit/steps/card-provider.tsx
|
|
494
|
+
import { useLabels as useLabels5 } from "@agg-market/hooks";
|
|
499
495
|
import { Fragment as Fragment5, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
500
|
-
var
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
] }
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
496
|
+
var CardProviderItem = ({ provider, onSelect }) => {
|
|
497
|
+
const labels = useLabels5();
|
|
498
|
+
const badgeText = provider.badge === "best" ? labels.deposit.cardFlow.providerBadges.best : provider.badge === "low-kyc" ? labels.deposit.cardFlow.providerBadges.lowKyc : void 0;
|
|
499
|
+
return /* @__PURE__ */ jsx5(
|
|
500
|
+
"button",
|
|
501
|
+
{
|
|
502
|
+
type: "button",
|
|
503
|
+
className: "w-full rounded-xl border border-agg-separator px-4 py-3 text-left bg-agg-secondary hover:bg-agg-secondary-hover transition-colors cursor-pointer",
|
|
504
|
+
onClick: () => onSelect(provider.id),
|
|
505
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-4", children: [
|
|
506
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
507
|
+
/* @__PURE__ */ jsx5("p", { className: "text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: provider.name }),
|
|
508
|
+
badgeText ? /* @__PURE__ */ jsx5(
|
|
509
|
+
"span",
|
|
510
|
+
{
|
|
511
|
+
className: `rounded border px-2 py-[2px] text-[10px] leading-[14px] font-agg-bold uppercase ${provider.badge === "best" ? "border-agg-primary/50 text-agg-primary bg-agg-secondary" : "border-agg-separator text-agg-foreground bg-agg-secondary"}`,
|
|
512
|
+
children: badgeText
|
|
513
|
+
}
|
|
514
|
+
) : null
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-4", children: [
|
|
517
|
+
/* @__PURE__ */ jsxs5("div", { className: "text-right", children: [
|
|
518
|
+
/* @__PURE__ */ jsx5("p", { className: "agg-type-body text-agg-foreground", children: provider.quote }),
|
|
519
|
+
/* @__PURE__ */ jsxs5("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
520
|
+
labels.deposit.cardFlow.feeLabel,
|
|
521
|
+
" ",
|
|
522
|
+
provider.fee
|
|
523
|
+
] })
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ jsx5(ChevronRightIcon, { className: "h-5 w-5 text-agg-muted-foreground" })
|
|
526
|
+
] })
|
|
527
|
+
] })
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
};
|
|
531
|
+
var CardProviderStep = ({
|
|
532
|
+
token,
|
|
533
|
+
amount,
|
|
534
|
+
currency,
|
|
535
|
+
providers,
|
|
536
|
+
onBack,
|
|
537
|
+
onSelectProvider
|
|
538
|
+
}) => {
|
|
539
|
+
const labels = useLabels5();
|
|
540
|
+
return /* @__PURE__ */ jsxs5(Fragment5, { children: [
|
|
519
541
|
/* @__PURE__ */ jsx5(
|
|
520
|
-
|
|
542
|
+
Modal.Header,
|
|
521
543
|
{
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
544
|
+
title: labels.deposit.cardFlow.selectProviderTitle,
|
|
545
|
+
hideBorder: true,
|
|
546
|
+
leftElement: /* @__PURE__ */ jsx5(
|
|
547
|
+
"button",
|
|
548
|
+
{
|
|
549
|
+
type: "button",
|
|
550
|
+
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
551
|
+
onClick: onBack,
|
|
552
|
+
"aria-label": labels.deposit.back,
|
|
553
|
+
children: /* @__PURE__ */ jsx5(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
554
|
+
}
|
|
555
|
+
)
|
|
525
556
|
}
|
|
526
557
|
),
|
|
527
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col
|
|
528
|
-
/* @__PURE__ */
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
558
|
+
/* @__PURE__ */ jsx5(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-4", children: [
|
|
559
|
+
/* @__PURE__ */ jsxs5("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
560
|
+
/* @__PURE__ */ jsx5("span", { className: "font-agg-bold", children: token }),
|
|
561
|
+
" ",
|
|
562
|
+
amount,
|
|
563
|
+
" ",
|
|
564
|
+
currency
|
|
565
|
+
] }),
|
|
566
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-4", children: providers.map((provider) => /* @__PURE__ */ jsx5(CardProviderItem, { provider, onSelect: onSelectProvider }, provider.id)) })
|
|
567
|
+
] }) })
|
|
568
|
+
] });
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
// src/deposit/steps/card-purchase-success.tsx
|
|
572
|
+
import { useLabels as useLabels6 } from "@agg-market/hooks";
|
|
573
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
574
|
+
var SummaryRow = ({ label, value }) => /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
575
|
+
/* @__PURE__ */ jsx6("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
576
|
+
/* @__PURE__ */ jsx6("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
577
|
+
] });
|
|
578
|
+
var CardPurchaseSuccessStep = ({
|
|
579
|
+
summary,
|
|
580
|
+
onDone,
|
|
581
|
+
onClose
|
|
582
|
+
}) => {
|
|
583
|
+
const labels = useLabels6();
|
|
584
|
+
return /* @__PURE__ */ jsx6("div", { className: "relative", children: /* @__PURE__ */ jsxs6(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
585
|
+
/* @__PURE__ */ jsx6(
|
|
586
|
+
"button",
|
|
587
|
+
{
|
|
588
|
+
type: "button",
|
|
589
|
+
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
590
|
+
onClick: onClose,
|
|
591
|
+
"aria-label": labels.common.close,
|
|
592
|
+
children: /* @__PURE__ */ jsx6(CloseIcon, { className: "h-6 w-6" })
|
|
593
|
+
}
|
|
594
|
+
),
|
|
595
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-8", children: [
|
|
596
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full border border-[#18C15C80] bg-[#18C15C26]", children: /* @__PURE__ */ jsx6(SuccessCheckIcon, { className: "h-6 w-6 text-[#18C15C]" }) }),
|
|
597
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
598
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.cardFlow.successTitle }),
|
|
599
|
+
/* @__PURE__ */ jsx6("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.cardFlow.successDescription })
|
|
600
|
+
] }),
|
|
601
|
+
/* @__PURE__ */ jsxs6("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
602
|
+
/* @__PURE__ */ jsx6(
|
|
603
|
+
SummaryRow,
|
|
604
|
+
{
|
|
605
|
+
label: labels.deposit.summary.amountReceived,
|
|
606
|
+
value: summary.amountReceived
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
/* @__PURE__ */ jsx6(SummaryRow, { label: labels.deposit.summary.network, value: summary.network }),
|
|
610
|
+
/* @__PURE__ */ jsx6(SummaryRow, { label: labels.deposit.cardFlow.summary.provider, value: summary.provider }),
|
|
611
|
+
/* @__PURE__ */ jsx6(SummaryRow, { label: labels.deposit.cardFlow.summary.fees, value: summary.fees })
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsx6(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.deposit.done })
|
|
614
|
+
] })
|
|
615
|
+
] }) });
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/deposit/steps/wallet-processing.tsx
|
|
619
|
+
import { useLabels as useLabels7 } from "@agg-market/hooks";
|
|
620
|
+
import { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
|
|
621
|
+
import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
622
|
+
var WalletProcessingStep = ({
|
|
623
|
+
steps,
|
|
624
|
+
onClose
|
|
625
|
+
}) => {
|
|
626
|
+
const labels = useLabels7();
|
|
627
|
+
const [progress, setProgress] = useState2(
|
|
628
|
+
() => steps.map((s) => __spreadValues({}, s))
|
|
629
|
+
);
|
|
630
|
+
const timeoutsRef = useRef([]);
|
|
631
|
+
const activeIndex = useMemo(() => progress.findIndex((s) => s.status === "active"), [progress]);
|
|
632
|
+
useEffect2(() => {
|
|
633
|
+
if (activeIndex === -1) return;
|
|
634
|
+
const id = window.setTimeout(() => {
|
|
635
|
+
setProgress((prev) => {
|
|
636
|
+
const next = prev.map((s) => __spreadValues({}, s));
|
|
637
|
+
const i = next.findIndex((s) => s.status === "active");
|
|
638
|
+
if (i !== -1) {
|
|
639
|
+
next[i].status = "complete";
|
|
640
|
+
if (i + 1 < next.length) {
|
|
641
|
+
next[i + 1].status = "active";
|
|
642
|
+
}
|
|
566
643
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
644
|
+
return next;
|
|
645
|
+
});
|
|
646
|
+
}, 500);
|
|
647
|
+
timeoutsRef.current.push(id);
|
|
648
|
+
return () => {
|
|
649
|
+
window.clearTimeout(id);
|
|
650
|
+
};
|
|
651
|
+
}, [activeIndex]);
|
|
652
|
+
useEffect2(() => {
|
|
653
|
+
const allDone = progress.every((s) => s.status === "complete");
|
|
654
|
+
if (allDone) {
|
|
655
|
+
onClose();
|
|
656
|
+
}
|
|
657
|
+
}, [progress, onClose]);
|
|
658
|
+
useEffect2(() => {
|
|
659
|
+
return () => {
|
|
660
|
+
timeoutsRef.current.forEach((id) => window.clearTimeout(id));
|
|
661
|
+
timeoutsRef.current = [];
|
|
662
|
+
};
|
|
663
|
+
}, []);
|
|
664
|
+
return /* @__PURE__ */ jsxs7(Fragment6, { children: [
|
|
665
|
+
/* @__PURE__ */ jsx7(Modal.Header, { title: labels.deposit.processingTitle, hideBorder: true }),
|
|
666
|
+
/* @__PURE__ */ jsx7(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-5", children: progress.map((step) => {
|
|
667
|
+
const isComplete = step.status === "complete";
|
|
668
|
+
const isActive = step.status === "active";
|
|
669
|
+
return /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-3", children: [
|
|
670
|
+
isComplete ? /* @__PURE__ */ jsx7(CheckCircleIcon, { className: "h-4 w-4 text-agg-primary" }) : /* @__PURE__ */ jsx7(
|
|
671
|
+
"span",
|
|
672
|
+
{
|
|
673
|
+
className: [
|
|
674
|
+
"inline-block h-4 w-4 rounded-full border",
|
|
675
|
+
isActive ? "border-2 border-agg-primary border-r-transparent animate-spin" : "",
|
|
676
|
+
!isActive ? "border-agg-separator" : ""
|
|
677
|
+
].join(" ")
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ jsx7(
|
|
681
|
+
"p",
|
|
682
|
+
{
|
|
683
|
+
className: isComplete || isActive ? "agg-type-body text-agg-foreground" : "agg-type-body text-agg-muted-foreground",
|
|
684
|
+
children: step.label
|
|
685
|
+
}
|
|
686
|
+
)
|
|
687
|
+
] }, step.id);
|
|
688
|
+
}) }) })
|
|
689
|
+
] });
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
// src/deposit/steps/wallet-success.tsx
|
|
693
|
+
import { useLabels as useLabels8 } from "@agg-market/hooks";
|
|
694
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
695
|
+
var SummaryRow2 = ({ label, value }) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
696
|
+
/* @__PURE__ */ jsx8("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
697
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
571
698
|
] });
|
|
699
|
+
var WalletSuccessStep = ({
|
|
700
|
+
summary,
|
|
701
|
+
onDone,
|
|
702
|
+
onClose
|
|
703
|
+
}) => {
|
|
704
|
+
const labels = useLabels8();
|
|
705
|
+
return /* @__PURE__ */ jsx8("div", { className: "relative", children: /* @__PURE__ */ jsxs8(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
706
|
+
/* @__PURE__ */ jsx8(
|
|
707
|
+
"button",
|
|
708
|
+
{
|
|
709
|
+
type: "button",
|
|
710
|
+
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
711
|
+
onClick: onClose,
|
|
712
|
+
"aria-label": labels.common.close,
|
|
713
|
+
children: /* @__PURE__ */ jsx8(CloseIcon, { className: "h-6 w-6" })
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col items-center gap-8", children: [
|
|
717
|
+
/* @__PURE__ */ jsx8("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full border border-[#18C15C80] bg-[#18C15C26]", children: /* @__PURE__ */ jsx8(SuccessCheckIcon, { className: "h-6 w-6 text-[#18C15C]" }) }),
|
|
718
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
719
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.deposit.successTitle }),
|
|
720
|
+
/* @__PURE__ */ jsx8("p", { className: "agg-type-body text-agg-foreground", children: labels.deposit.successDescription })
|
|
721
|
+
] }),
|
|
722
|
+
/* @__PURE__ */ jsxs8("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
723
|
+
/* @__PURE__ */ jsx8(
|
|
724
|
+
SummaryRow2,
|
|
725
|
+
{
|
|
726
|
+
label: labels.deposit.summary.amountReceived,
|
|
727
|
+
value: summary.amountReceived
|
|
728
|
+
}
|
|
729
|
+
),
|
|
730
|
+
/* @__PURE__ */ jsx8(SummaryRow2, { label: labels.deposit.summary.network, value: summary.network }),
|
|
731
|
+
/* @__PURE__ */ jsx8(SummaryRow2, { label: labels.deposit.summary.fromWallet, value: summary.fromWallet }),
|
|
732
|
+
/* @__PURE__ */ jsx8(SummaryRow2, { label: labels.deposit.summary.gasFee, value: summary.gasFee })
|
|
733
|
+
] }),
|
|
734
|
+
/* @__PURE__ */ jsx8(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.deposit.done })
|
|
735
|
+
] })
|
|
736
|
+
] }) });
|
|
737
|
+
};
|
|
572
738
|
|
|
573
739
|
// src/deposit/index.tsx
|
|
574
|
-
import { jsx as
|
|
740
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
575
741
|
var DepositModal = ({
|
|
576
742
|
open,
|
|
577
743
|
onOpenChange,
|
|
578
|
-
venues,
|
|
579
|
-
onSelectVenue,
|
|
580
744
|
onSelectDepositMethod,
|
|
581
745
|
onContinueCardDeposit,
|
|
582
746
|
onDoneCryptoTransfer,
|
|
583
|
-
|
|
584
|
-
|
|
747
|
+
walletFlow,
|
|
748
|
+
onWalletTokenChange,
|
|
749
|
+
onWalletNetworkChange,
|
|
750
|
+
onWalletAmountChange,
|
|
751
|
+
onWalletMax,
|
|
752
|
+
onConfirmWalletDeposit,
|
|
753
|
+
onDoneWalletDeposit,
|
|
754
|
+
sendCryptoFlow,
|
|
755
|
+
onSendCryptoTokenChange,
|
|
756
|
+
onSendCryptoNetworkChange,
|
|
757
|
+
onCopySendCryptoAddress,
|
|
758
|
+
onDoneSendCrypto,
|
|
759
|
+
cardFlow,
|
|
760
|
+
onCardAmountChange,
|
|
761
|
+
onCardCurrencyChange,
|
|
762
|
+
onCardTokenChange,
|
|
763
|
+
onCardNetworkChange,
|
|
764
|
+
onSelectCardProvider,
|
|
765
|
+
onDoneCardPurchase
|
|
585
766
|
}) => {
|
|
586
|
-
const [step, setStep] = useState3("
|
|
587
|
-
const [
|
|
588
|
-
const hasAnyShortfall = venues.some((v) => v.shortfall != null && v.shortfall > 0);
|
|
589
|
-
const handleSelectVenue = (venueSlug) => {
|
|
590
|
-
onSelectVenue(venueSlug);
|
|
591
|
-
if (venueSlug === KALSHI_VENUE) {
|
|
592
|
-
setStep("kalshi");
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
const venueData = venues.find((v) => v.venue === venueSlug);
|
|
596
|
-
if (venueData) {
|
|
597
|
-
setSelectedVenue(venueData);
|
|
598
|
-
setStep("method");
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
const handleBackToVenues = () => {
|
|
602
|
-
setStep("venues");
|
|
603
|
-
setSelectedVenue(null);
|
|
604
|
-
};
|
|
767
|
+
const [step, setStep] = useState3("method");
|
|
768
|
+
const [highlightedMethod, setHighlightedMethod] = useState3("wallet");
|
|
605
769
|
const handleBackToMethod = () => {
|
|
606
770
|
setStep("method");
|
|
607
771
|
};
|
|
608
772
|
const handleSelectMethod = (method) => {
|
|
609
|
-
|
|
773
|
+
setHighlightedMethod(method);
|
|
774
|
+
onSelectDepositMethod == null ? void 0 : onSelectDepositMethod(method);
|
|
775
|
+
if (method === "wallet") {
|
|
776
|
+
setStep("wallet-form");
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
610
779
|
if (method === "card") {
|
|
611
780
|
setStep("card-deposit");
|
|
612
|
-
} else {
|
|
781
|
+
} else if (method === "crypto") {
|
|
613
782
|
setStep("crypto-transfer");
|
|
614
|
-
onSelectDepositMethod == null ? void 0 : onSelectDepositMethod(selectedVenue.venue, method);
|
|
615
783
|
}
|
|
616
784
|
};
|
|
617
785
|
const handleContinueCardDeposit = (amount) => {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
786
|
+
onContinueCardDeposit == null ? void 0 : onContinueCardDeposit(amount);
|
|
787
|
+
setStep("card-provider");
|
|
621
788
|
};
|
|
622
789
|
const handleDoneCryptoTransfer = () => {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
const handleDoneKalshi = () => {
|
|
628
|
-
onDoneKalshi == null ? void 0 : onDoneKalshi();
|
|
629
|
-
onOpenChange(false);
|
|
790
|
+
onDoneCryptoTransfer == null ? void 0 : onDoneCryptoTransfer();
|
|
791
|
+
onDoneSendCrypto();
|
|
630
792
|
};
|
|
631
793
|
const handleOpenChange = (isOpen) => {
|
|
632
794
|
if (!isOpen) {
|
|
633
|
-
setStep("
|
|
634
|
-
|
|
795
|
+
setStep("method");
|
|
796
|
+
setHighlightedMethod("wallet");
|
|
635
797
|
}
|
|
636
798
|
onOpenChange(isOpen);
|
|
637
799
|
};
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
step === "
|
|
640
|
-
|
|
800
|
+
return /* @__PURE__ */ jsx9(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs9(Modal.Container, { maxWidth: "600px", "aria-label": "Deposit", children: [
|
|
801
|
+
step === "method" ? /* @__PURE__ */ jsx9(
|
|
802
|
+
DepositMethodStep,
|
|
803
|
+
{
|
|
804
|
+
balance: walletFlow.balance,
|
|
805
|
+
walletLabel: walletFlow.walletLabel,
|
|
806
|
+
walletBalance: walletFlow.walletBalance,
|
|
807
|
+
highlightedMethod,
|
|
808
|
+
onSelectMethod: handleSelectMethod
|
|
809
|
+
}
|
|
810
|
+
) : null,
|
|
811
|
+
step === "wallet-form" ? /* @__PURE__ */ jsx9(
|
|
812
|
+
WalletFormStep,
|
|
813
|
+
{
|
|
814
|
+
walletLabel: walletFlow.walletLabel,
|
|
815
|
+
walletBalance: walletFlow.walletBalance,
|
|
816
|
+
tokenOptions: walletFlow.tokenOptions,
|
|
817
|
+
networkOptions: walletFlow.networkOptions,
|
|
818
|
+
selectedToken: walletFlow.selectedToken,
|
|
819
|
+
selectedNetwork: walletFlow.selectedNetwork,
|
|
820
|
+
amount: walletFlow.amount,
|
|
821
|
+
estimatedReceive: walletFlow.estimatedReceive,
|
|
822
|
+
feeEstimate: walletFlow.feeEstimate,
|
|
823
|
+
eta: walletFlow.eta,
|
|
824
|
+
onBack: handleBackToMethod,
|
|
825
|
+
onTokenChange: onWalletTokenChange,
|
|
826
|
+
onNetworkChange: onWalletNetworkChange,
|
|
827
|
+
onAmountChange: onWalletAmountChange,
|
|
828
|
+
onMax: onWalletMax,
|
|
829
|
+
onConfirm: () => {
|
|
830
|
+
onConfirmWalletDeposit();
|
|
831
|
+
setStep("wallet-processing");
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
) : null,
|
|
835
|
+
step === "wallet-processing" ? /* @__PURE__ */ jsx9(
|
|
836
|
+
WalletProcessingStep,
|
|
641
837
|
{
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
onSelectVenue: handleSelectVenue
|
|
838
|
+
steps: walletFlow.processingSteps,
|
|
839
|
+
onClose: () => setStep("wallet-success")
|
|
645
840
|
}
|
|
646
841
|
) : null,
|
|
647
|
-
step === "
|
|
648
|
-
|
|
842
|
+
step === "wallet-success" ? /* @__PURE__ */ jsx9(
|
|
843
|
+
WalletSuccessStep,
|
|
649
844
|
{
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
845
|
+
summary: walletFlow.successSummary,
|
|
846
|
+
onDone: onDoneWalletDeposit,
|
|
847
|
+
onClose: () => onOpenChange(false)
|
|
653
848
|
}
|
|
654
849
|
) : null,
|
|
655
|
-
step === "card-deposit"
|
|
850
|
+
step === "card-deposit" ? /* @__PURE__ */ jsx9(
|
|
656
851
|
CardDepositStep,
|
|
657
852
|
{
|
|
658
|
-
|
|
853
|
+
amount: cardFlow.amount,
|
|
854
|
+
currency: cardFlow.currency,
|
|
855
|
+
destinationWallet: cardFlow.destinationWallet,
|
|
856
|
+
tokenOptions: cardFlow.tokenOptions,
|
|
857
|
+
networkOptions: cardFlow.networkOptions,
|
|
858
|
+
selectedToken: cardFlow.selectedToken,
|
|
859
|
+
selectedNetwork: cardFlow.selectedNetwork,
|
|
659
860
|
onBack: handleBackToMethod,
|
|
861
|
+
onAmountChange: onCardAmountChange,
|
|
862
|
+
onCurrencyChange: onCardCurrencyChange,
|
|
863
|
+
onTokenChange: onCardTokenChange,
|
|
864
|
+
onNetworkChange: onCardNetworkChange,
|
|
660
865
|
onContinue: handleContinueCardDeposit
|
|
661
866
|
}
|
|
662
867
|
) : null,
|
|
663
|
-
step === "
|
|
868
|
+
step === "card-provider" ? /* @__PURE__ */ jsx9(
|
|
869
|
+
CardProviderStep,
|
|
870
|
+
{
|
|
871
|
+
amount: cardFlow.amount,
|
|
872
|
+
currency: cardFlow.currency,
|
|
873
|
+
token: cardFlow.selectedToken,
|
|
874
|
+
providers: cardFlow.providers,
|
|
875
|
+
onBack: () => setStep("card-deposit"),
|
|
876
|
+
onSelectProvider: (providerId) => {
|
|
877
|
+
onSelectCardProvider(providerId);
|
|
878
|
+
setStep("card-success");
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
) : null,
|
|
882
|
+
step === "card-success" ? /* @__PURE__ */ jsx9(
|
|
883
|
+
CardPurchaseSuccessStep,
|
|
884
|
+
{
|
|
885
|
+
summary: cardFlow.purchaseSummary,
|
|
886
|
+
onClose: () => onOpenChange(false),
|
|
887
|
+
onDone: onDoneCardPurchase
|
|
888
|
+
}
|
|
889
|
+
) : null,
|
|
890
|
+
step === "crypto-transfer" ? /* @__PURE__ */ jsx9(
|
|
664
891
|
CryptoTransferStep,
|
|
665
892
|
{
|
|
666
|
-
|
|
893
|
+
tokenOptions: sendCryptoFlow.tokenOptions,
|
|
894
|
+
networkOptions: sendCryptoFlow.networkOptions,
|
|
895
|
+
selectedToken: sendCryptoFlow.selectedToken,
|
|
896
|
+
selectedNetwork: sendCryptoFlow.selectedNetwork,
|
|
897
|
+
depositAddress: sendCryptoFlow.depositAddress,
|
|
898
|
+
minDeposit: sendCryptoFlow.minDeposit,
|
|
899
|
+
feeEstimate: sendCryptoFlow.feeEstimate,
|
|
900
|
+
eta: sendCryptoFlow.eta,
|
|
667
901
|
onBack: handleBackToMethod,
|
|
902
|
+
onTokenChange: onSendCryptoTokenChange,
|
|
903
|
+
onNetworkChange: onSendCryptoNetworkChange,
|
|
904
|
+
onCopyAddress: onCopySendCryptoAddress,
|
|
668
905
|
onDone: handleDoneCryptoTransfer
|
|
669
906
|
}
|
|
670
|
-
) : null
|
|
671
|
-
step === "kalshi" ? /* @__PURE__ */ jsx6(KalshiDepositStep, { depositUrl: kalshiDepositUrl, onDone: handleDoneKalshi }) : null
|
|
907
|
+
) : null
|
|
672
908
|
] }) });
|
|
673
909
|
};
|
|
674
910
|
DepositModal.displayName = "DepositModal";
|
|
675
911
|
|
|
676
912
|
// src/onramp/index.tsx
|
|
677
|
-
import { useCallback as
|
|
913
|
+
import { useCallback as useCallback2, useState as useState4 } from "react";
|
|
678
914
|
|
|
679
915
|
// src/onramp/steps/quote-form.tsx
|
|
680
|
-
import { useCallback
|
|
916
|
+
import { useCallback } from "react";
|
|
681
917
|
|
|
682
918
|
// src/onramp/onramp-modal.constants.ts
|
|
683
919
|
var FIAT_OPTIONS = [
|
|
@@ -699,7 +935,7 @@ var CRYPTO_OPTIONS = [
|
|
|
699
935
|
];
|
|
700
936
|
|
|
701
937
|
// src/onramp/steps/quote-form.tsx
|
|
702
|
-
import { Fragment as
|
|
938
|
+
import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
703
939
|
var QuoteFormStep = ({
|
|
704
940
|
title,
|
|
705
941
|
values,
|
|
@@ -712,7 +948,7 @@ var QuoteFormStep = ({
|
|
|
712
948
|
var _a;
|
|
713
949
|
const numericAmount = Number(values.amount) || 0;
|
|
714
950
|
const isFormValid = numericAmount > 0 && values.walletAddress.length > 0;
|
|
715
|
-
const handleAmountChange =
|
|
951
|
+
const handleAmountChange = useCallback(
|
|
716
952
|
(e) => {
|
|
717
953
|
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
718
954
|
const parts = v.split(".");
|
|
@@ -720,13 +956,13 @@ var QuoteFormStep = ({
|
|
|
720
956
|
},
|
|
721
957
|
[onAmountChange]
|
|
722
958
|
);
|
|
723
|
-
return /* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
/* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
960
|
+
/* @__PURE__ */ jsx10(Modal.Header, { title, hideBorder: true }),
|
|
961
|
+
/* @__PURE__ */ jsx10(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-6", children: [
|
|
962
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2", children: [
|
|
963
|
+
/* @__PURE__ */ jsx10("p", { className: "agg-type-label text-agg-muted-foreground", children: "You pay" }),
|
|
964
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-3", children: [
|
|
965
|
+
/* @__PURE__ */ jsx10("div", { className: "shrink-0", children: /* @__PURE__ */ jsx10(
|
|
730
966
|
Select,
|
|
731
967
|
{
|
|
732
968
|
items: FIAT_OPTIONS,
|
|
@@ -736,9 +972,9 @@ var QuoteFormStep = ({
|
|
|
736
972
|
className: "w-auto"
|
|
737
973
|
}
|
|
738
974
|
) }),
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ jsx10("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxs10("div", { className: "flex items-baseline", children: [
|
|
976
|
+
/* @__PURE__ */ jsx10("span", { className: "agg-type-display text-agg-foreground", children: (_a = FIAT_SYMBOLS[values.fiatCurrency]) != null ? _a : "$" }),
|
|
977
|
+
/* @__PURE__ */ jsx10(
|
|
742
978
|
"input",
|
|
743
979
|
{
|
|
744
980
|
type: "text",
|
|
@@ -756,10 +992,10 @@ var QuoteFormStep = ({
|
|
|
756
992
|
] }) })
|
|
757
993
|
] })
|
|
758
994
|
] }),
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ jsx10("div", { className: "border-t border-agg-separator" }),
|
|
996
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2", children: [
|
|
997
|
+
/* @__PURE__ */ jsx10("p", { className: "agg-type-label text-agg-muted-foreground", children: "You receive" }),
|
|
998
|
+
/* @__PURE__ */ jsx10(
|
|
763
999
|
Select,
|
|
764
1000
|
{
|
|
765
1001
|
items: CRYPTO_OPTIONS,
|
|
@@ -769,10 +1005,10 @@ var QuoteFormStep = ({
|
|
|
769
1005
|
}
|
|
770
1006
|
)
|
|
771
1007
|
] }),
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ jsx10("div", { className: "border-t border-agg-separator" }),
|
|
1009
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2", children: [
|
|
1010
|
+
/* @__PURE__ */ jsx10("p", { className: "agg-type-label text-agg-muted-foreground", children: "Destination wallet" }),
|
|
1011
|
+
/* @__PURE__ */ jsx10(
|
|
776
1012
|
"input",
|
|
777
1013
|
{
|
|
778
1014
|
type: "text",
|
|
@@ -790,7 +1026,7 @@ var QuoteFormStep = ({
|
|
|
790
1026
|
}
|
|
791
1027
|
)
|
|
792
1028
|
] }),
|
|
793
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx10(
|
|
794
1030
|
Button,
|
|
795
1031
|
{
|
|
796
1032
|
variant: "primary",
|
|
@@ -806,11 +1042,11 @@ var QuoteFormStep = ({
|
|
|
806
1042
|
};
|
|
807
1043
|
|
|
808
1044
|
// src/onramp/steps/quote-card.tsx
|
|
809
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
810
1046
|
var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
811
1047
|
var _a;
|
|
812
1048
|
const isBest = rank === 1;
|
|
813
|
-
return /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ jsxs11(
|
|
814
1050
|
"div",
|
|
815
1051
|
{
|
|
816
1052
|
className: cn(
|
|
@@ -830,14 +1066,14 @@ var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
|
830
1066
|
}
|
|
831
1067
|
},
|
|
832
1068
|
children: [
|
|
833
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ jsx11(
|
|
834
1070
|
"div",
|
|
835
1071
|
{
|
|
836
1072
|
className: cn(
|
|
837
1073
|
"shrink-0 flex items-center justify-center h-10 w-10 rounded-lg",
|
|
838
1074
|
isBest ? "bg-agg-primary/10" : "bg-agg-secondary-hover"
|
|
839
1075
|
),
|
|
840
|
-
children: /* @__PURE__ */
|
|
1076
|
+
children: /* @__PURE__ */ jsx11(
|
|
841
1077
|
"span",
|
|
842
1078
|
{
|
|
843
1079
|
className: cn(
|
|
@@ -849,10 +1085,10 @@ var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
|
849
1085
|
)
|
|
850
1086
|
}
|
|
851
1087
|
),
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
isBest ? /* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
|
|
1089
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
1090
|
+
/* @__PURE__ */ jsx11("p", { className: "agg-type-body-strong text-agg-foreground", children: quote.serviceProvider }),
|
|
1091
|
+
isBest ? /* @__PURE__ */ jsx11(
|
|
856
1092
|
Badge,
|
|
857
1093
|
{
|
|
858
1094
|
text: "Best",
|
|
@@ -860,28 +1096,28 @@ var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
|
860
1096
|
classNames: { root: "bg-agg-primary! text-white! border-agg-primary!" }
|
|
861
1097
|
}
|
|
862
1098
|
) : null,
|
|
863
|
-
quote.lowKyc ? /* @__PURE__ */
|
|
1099
|
+
quote.lowKyc ? /* @__PURE__ */ jsx11(Badge, { text: "Low KYC", size: "small" }) : null
|
|
864
1100
|
] }),
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
1102
|
+
/* @__PURE__ */ jsxs11("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
867
1103
|
quote.destinationAmount.toFixed(6),
|
|
868
1104
|
" ",
|
|
869
1105
|
quote.destinationCurrencyCode.split("_")[0]
|
|
870
1106
|
] }),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ jsx11("span", { className: "text-agg-muted-foreground", children: "\xB7" }),
|
|
1108
|
+
/* @__PURE__ */ jsxs11("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
873
1109
|
"Fee ",
|
|
874
1110
|
(_a = FIAT_SYMBOLS[quote.sourceCurrencyCode]) != null ? _a : "",
|
|
875
1111
|
quote.totalFee.toFixed(2)
|
|
876
1112
|
] })
|
|
877
1113
|
] })
|
|
878
1114
|
] }),
|
|
879
|
-
/* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ jsx11("div", { className: "shrink-0", children: /* @__PURE__ */ jsx11(
|
|
880
1116
|
Button,
|
|
881
1117
|
{
|
|
882
1118
|
variant: "secondary",
|
|
883
1119
|
size: "small",
|
|
884
|
-
suffix: /* @__PURE__ */
|
|
1120
|
+
suffix: /* @__PURE__ */ jsx11(ChevronRightIcon, {}),
|
|
885
1121
|
onClick: (e) => {
|
|
886
1122
|
e.stopPropagation();
|
|
887
1123
|
onSelect();
|
|
@@ -895,9 +1131,9 @@ var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
|
895
1131
|
};
|
|
896
1132
|
|
|
897
1133
|
// src/onramp/steps/quote-selection.tsx
|
|
898
|
-
import { Fragment as
|
|
1134
|
+
import { Fragment as Fragment8, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
899
1135
|
var BACK_BUTTON_CLASS = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
900
|
-
var BackButton = ({ onClick }) => /* @__PURE__ */
|
|
1136
|
+
var BackButton = ({ onClick }) => /* @__PURE__ */ jsx12("button", { type: "button", className: BACK_BUTTON_CLASS, onClick, "aria-label": "Go back", children: /* @__PURE__ */ jsx12(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
901
1137
|
var QuoteSelectionStep = ({
|
|
902
1138
|
quotes,
|
|
903
1139
|
isLoading,
|
|
@@ -911,23 +1147,23 @@ var QuoteSelectionStep = ({
|
|
|
911
1147
|
}) => {
|
|
912
1148
|
var _a;
|
|
913
1149
|
const subtitle = `${cryptoCurrency.split("_")[0]} \xB7 ${(_a = FIAT_SYMBOLS[fiatCurrency]) != null ? _a : ""}${amount.toLocaleString()} ${fiatCurrency}`;
|
|
914
|
-
return /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ jsxs12(Fragment8, { children: [
|
|
1151
|
+
/* @__PURE__ */ jsx12(
|
|
916
1152
|
Modal.Header,
|
|
917
1153
|
{
|
|
918
1154
|
title: "Select Provider",
|
|
919
1155
|
subtitle,
|
|
920
1156
|
hideBorder: true,
|
|
921
|
-
leftElement: /* @__PURE__ */
|
|
1157
|
+
leftElement: /* @__PURE__ */ jsx12(BackButton, { onClick: onBack })
|
|
922
1158
|
}
|
|
923
1159
|
),
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
isLoading ? /* @__PURE__ */
|
|
926
|
-
!isLoading && error ? /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
1160
|
+
/* @__PURE__ */ jsxs12(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: [
|
|
1161
|
+
isLoading ? /* @__PURE__ */ jsx12("div", { className: "flex min-h-[240px] items-center justify-center", children: /* @__PURE__ */ jsx12(LoadingIcon, { size: "large" }) }) : null,
|
|
1162
|
+
!isLoading && error ? /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-4", children: [
|
|
1163
|
+
/* @__PURE__ */ jsx12(InlineAlert, { tone: "error", message: error }),
|
|
1164
|
+
/* @__PURE__ */ jsx12(Button, { variant: "secondary", size: "medium", className: "w-full", onClick: onRetry, children: "Retry" })
|
|
929
1165
|
] }) : null,
|
|
930
|
-
!isLoading && !error && quotes.length === 0 ? /* @__PURE__ */
|
|
1166
|
+
!isLoading && !error && quotes.length === 0 ? /* @__PURE__ */ jsx12(
|
|
931
1167
|
StateMessage,
|
|
932
1168
|
{
|
|
933
1169
|
tone: "empty",
|
|
@@ -937,7 +1173,7 @@ var QuoteSelectionStep = ({
|
|
|
937
1173
|
onAction: onBack
|
|
938
1174
|
}
|
|
939
1175
|
) : null,
|
|
940
|
-
!isLoading && quotes.length > 0 ? /* @__PURE__ */
|
|
1176
|
+
!isLoading && quotes.length > 0 ? /* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3", children: quotes.map((quote, i) => /* @__PURE__ */ jsx12(
|
|
941
1177
|
QuoteCard,
|
|
942
1178
|
{
|
|
943
1179
|
quote,
|
|
@@ -951,24 +1187,24 @@ var QuoteSelectionStep = ({
|
|
|
951
1187
|
};
|
|
952
1188
|
|
|
953
1189
|
// src/onramp/steps/widget.tsx
|
|
954
|
-
import { useRef } from "react";
|
|
955
|
-
import { Fragment as
|
|
1190
|
+
import { useRef as useRef2 } from "react";
|
|
1191
|
+
import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
956
1192
|
var BACK_BUTTON_CLASS2 = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
957
|
-
var BackButton2 = ({ onClick }) => /* @__PURE__ */
|
|
1193
|
+
var BackButton2 = ({ onClick }) => /* @__PURE__ */ jsx13("button", { type: "button", className: BACK_BUTTON_CLASS2, onClick, "aria-label": "Go back", children: /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
958
1194
|
var WidgetStep = ({ widgetUrl, isLoading, onBack }) => {
|
|
959
|
-
const iframeRef =
|
|
960
|
-
return /* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
1195
|
+
const iframeRef = useRef2(null);
|
|
1196
|
+
return /* @__PURE__ */ jsxs13(Fragment9, { children: [
|
|
1197
|
+
/* @__PURE__ */ jsx13(
|
|
962
1198
|
Modal.Header,
|
|
963
1199
|
{
|
|
964
1200
|
title: "Complete Purchase",
|
|
965
1201
|
hideBorder: true,
|
|
966
|
-
leftElement: /* @__PURE__ */
|
|
1202
|
+
leftElement: /* @__PURE__ */ jsx13(BackButton2, { onClick: onBack })
|
|
967
1203
|
}
|
|
968
1204
|
),
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
isLoading ? /* @__PURE__ */
|
|
971
|
-
widgetUrl ? /* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ jsxs13(Modal.Body, { classNames: { root: "p-0! sm:p-0! overflow-hidden" }, children: [
|
|
1206
|
+
isLoading ? /* @__PURE__ */ jsx13("div", { className: "flex min-h-[400px] items-center justify-center", children: /* @__PURE__ */ jsx13(LoadingIcon, { size: "large" }) }) : null,
|
|
1207
|
+
widgetUrl ? /* @__PURE__ */ jsx13(
|
|
972
1208
|
"iframe",
|
|
973
1209
|
{
|
|
974
1210
|
ref: iframeRef,
|
|
@@ -983,7 +1219,7 @@ var WidgetStep = ({ widgetUrl, isLoading, onBack }) => {
|
|
|
983
1219
|
};
|
|
984
1220
|
|
|
985
1221
|
// src/onramp/index.tsx
|
|
986
|
-
import { jsx as
|
|
1222
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
987
1223
|
var OnrampModal = ({
|
|
988
1224
|
open,
|
|
989
1225
|
onOpenChange,
|
|
@@ -1006,7 +1242,7 @@ var OnrampModal = ({
|
|
|
1006
1242
|
const [quoteError, setQuoteError] = useState4(null);
|
|
1007
1243
|
const [widgetUrl, setWidgetUrl] = useState4(null);
|
|
1008
1244
|
const [isCreatingSession, setIsCreatingSession] = useState4(false);
|
|
1009
|
-
const handleOpenChange =
|
|
1245
|
+
const handleOpenChange = useCallback2(
|
|
1010
1246
|
(isOpen) => {
|
|
1011
1247
|
if (!isOpen) {
|
|
1012
1248
|
setStep("form");
|
|
@@ -1018,7 +1254,7 @@ var OnrampModal = ({
|
|
|
1018
1254
|
},
|
|
1019
1255
|
[onOpenChange]
|
|
1020
1256
|
);
|
|
1021
|
-
const handleGetQuotes =
|
|
1257
|
+
const handleGetQuotes = useCallback2(() => __async(null, null, function* () {
|
|
1022
1258
|
const numericAmount2 = Number(formValues.amount);
|
|
1023
1259
|
if (!numericAmount2 || numericAmount2 <= 0) return;
|
|
1024
1260
|
setStep("quotes");
|
|
@@ -1039,7 +1275,7 @@ var OnrampModal = ({
|
|
|
1039
1275
|
setIsLoadingQuotes(false);
|
|
1040
1276
|
}
|
|
1041
1277
|
}), [formValues, transactionType, onGetQuotes]);
|
|
1042
|
-
const handleSelectQuote =
|
|
1278
|
+
const handleSelectQuote = useCallback2(
|
|
1043
1279
|
(quote) => __async(null, null, function* () {
|
|
1044
1280
|
setStep("widget");
|
|
1045
1281
|
setIsCreatingSession(true);
|
|
@@ -1063,13 +1299,13 @@ var OnrampModal = ({
|
|
|
1063
1299
|
[transactionType, formValues.walletAddress, onSelectQuote]
|
|
1064
1300
|
);
|
|
1065
1301
|
const numericAmount = Number(formValues.amount) || 0;
|
|
1066
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ jsx14(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs14(
|
|
1067
1303
|
Modal.Container,
|
|
1068
1304
|
{
|
|
1069
1305
|
maxWidth: "520px",
|
|
1070
1306
|
"aria-label": transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
1071
1307
|
children: [
|
|
1072
|
-
step === "form" ? /* @__PURE__ */
|
|
1308
|
+
step === "form" ? /* @__PURE__ */ jsx14(
|
|
1073
1309
|
QuoteFormStep,
|
|
1074
1310
|
{
|
|
1075
1311
|
title: transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
@@ -1081,7 +1317,7 @@ var OnrampModal = ({
|
|
|
1081
1317
|
onSubmit: handleGetQuotes
|
|
1082
1318
|
}
|
|
1083
1319
|
) : null,
|
|
1084
|
-
step === "quotes" ? /* @__PURE__ */
|
|
1320
|
+
step === "quotes" ? /* @__PURE__ */ jsx14(
|
|
1085
1321
|
QuoteSelectionStep,
|
|
1086
1322
|
{
|
|
1087
1323
|
quotes,
|
|
@@ -1095,7 +1331,7 @@ var OnrampModal = ({
|
|
|
1095
1331
|
onRetry: handleGetQuotes
|
|
1096
1332
|
}
|
|
1097
1333
|
) : null,
|
|
1098
|
-
step === "widget" ? /* @__PURE__ */
|
|
1334
|
+
step === "widget" ? /* @__PURE__ */ jsx14(
|
|
1099
1335
|
WidgetStep,
|
|
1100
1336
|
{
|
|
1101
1337
|
widgetUrl,
|
|
@@ -1113,93 +1349,21 @@ var OnrampModal = ({
|
|
|
1113
1349
|
OnrampModal.displayName = "OnrampModal";
|
|
1114
1350
|
|
|
1115
1351
|
// src/withdraw/index.tsx
|
|
1116
|
-
import { useState as
|
|
1117
|
-
|
|
1118
|
-
// src/withdraw/withdraw-modal.constants.ts
|
|
1119
|
-
var KALSHI_VENUE2 = "kalshi";
|
|
1120
|
-
var KALSHI_WITHDRAW_URL_DEFAULT = "https://kalshi.com/account/withdraw";
|
|
1121
|
-
|
|
1122
|
-
// src/withdraw/steps/venue-selection.tsx
|
|
1123
|
-
import { Fragment as Fragment9, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1124
|
-
var VenueRow2 = ({ venue, onSelect }) => {
|
|
1125
|
-
var _a, _b;
|
|
1126
|
-
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
1127
|
-
const isDisabled = venue.disabled === true;
|
|
1128
|
-
return /* @__PURE__ */ jsxs12(
|
|
1129
|
-
"div",
|
|
1130
|
-
{
|
|
1131
|
-
className: cn(
|
|
1132
|
-
"flex items-center gap-3 sm:gap-4",
|
|
1133
|
-
"rounded-xl border border-agg-separator",
|
|
1134
|
-
"p-3 sm:p-4",
|
|
1135
|
-
"transition-colors",
|
|
1136
|
-
isDisabled ? "opacity-50 cursor-not-allowed" : "hover:bg-agg-secondary-hover cursor-pointer"
|
|
1137
|
-
),
|
|
1138
|
-
role: "button",
|
|
1139
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
1140
|
-
"aria-disabled": isDisabled,
|
|
1141
|
-
onClick: (e) => {
|
|
1142
|
-
e.stopPropagation();
|
|
1143
|
-
e.preventDefault();
|
|
1144
|
-
if (!isDisabled) onSelect(venue.venue);
|
|
1145
|
-
},
|
|
1146
|
-
onKeyDown: (e) => {
|
|
1147
|
-
if (!isDisabled && (e.key === "Enter" || e.key === " ")) {
|
|
1148
|
-
e.preventDefault();
|
|
1149
|
-
onSelect(venue.venue);
|
|
1150
|
-
}
|
|
1151
|
-
},
|
|
1152
|
-
children: [
|
|
1153
|
-
/* @__PURE__ */ jsx12("div", { className: "shrink-0", children: /* @__PURE__ */ jsx12(VenueLogo, { venue: venue.venue, size: "large", className: "rounded-lg" }) }),
|
|
1154
|
-
/* @__PURE__ */ jsxs12("div", { className: "flex-1 min-w-0", children: [
|
|
1155
|
-
/* @__PURE__ */ jsx12("p", { className: "agg-type-body-strong text-agg-foreground", children: displayName }),
|
|
1156
|
-
/* @__PURE__ */ jsxs12("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1157
|
-
"Balance ",
|
|
1158
|
-
formatCompactUsd(venue.balance)
|
|
1159
|
-
] })
|
|
1160
|
-
] }),
|
|
1161
|
-
isDisabled ? /* @__PURE__ */ jsx12("div", { className: "shrink-0", children: /* @__PURE__ */ jsx12("span", { className: "agg-type-label text-agg-muted-foreground", children: (_b = venue.disabledReason) != null ? _b : "Unavailable" }) }) : /* @__PURE__ */ jsx12("div", { className: "shrink-0", children: /* @__PURE__ */ jsx12(
|
|
1162
|
-
Button,
|
|
1163
|
-
{
|
|
1164
|
-
variant: "secondary",
|
|
1165
|
-
size: "small",
|
|
1166
|
-
suffix: /* @__PURE__ */ jsx12(ChevronRightIcon, {}),
|
|
1167
|
-
onClick: (e) => {
|
|
1168
|
-
e.stopPropagation();
|
|
1169
|
-
onSelect(venue.venue);
|
|
1170
|
-
},
|
|
1171
|
-
children: "Select"
|
|
1172
|
-
}
|
|
1173
|
-
) })
|
|
1174
|
-
]
|
|
1175
|
-
}
|
|
1176
|
-
);
|
|
1177
|
-
};
|
|
1178
|
-
var VenueSelectionStep2 = ({
|
|
1179
|
-
venues,
|
|
1180
|
-
onSelectVenue
|
|
1181
|
-
}) => /* @__PURE__ */ jsxs12(Fragment9, { children: [
|
|
1182
|
-
/* @__PURE__ */ jsx12(Modal.Header, { title: "Withdraw", hideBorder: true }),
|
|
1183
|
-
/* @__PURE__ */ jsx12(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-4", children: [
|
|
1184
|
-
/* @__PURE__ */ jsx12("p", { className: "agg-type-body text-agg-foreground", children: "Choose where to withdraw funds from:" }),
|
|
1185
|
-
/* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-3", children: venues.map((venue) => /* @__PURE__ */ jsx12(VenueRow2, { venue, onSelect: onSelectVenue }, venue.venue)) })
|
|
1186
|
-
] }) })
|
|
1187
|
-
] });
|
|
1352
|
+
import { useState as useState5 } from "react";
|
|
1188
1353
|
|
|
1189
1354
|
// src/withdraw/steps/withdraw-method.tsx
|
|
1190
|
-
import {
|
|
1355
|
+
import { useLabels as useLabels9 } from "@agg-market/hooks";
|
|
1356
|
+
import { Fragment as Fragment10, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1191
1357
|
var WithdrawMethodCard = ({
|
|
1192
1358
|
icon,
|
|
1193
1359
|
title,
|
|
1194
1360
|
description,
|
|
1195
1361
|
onContinue
|
|
1196
|
-
}) => /* @__PURE__ */
|
|
1362
|
+
}) => /* @__PURE__ */ jsxs15(
|
|
1197
1363
|
"div",
|
|
1198
1364
|
{
|
|
1199
1365
|
className: cn(
|
|
1200
|
-
"flex items-center gap-3 sm:gap-4",
|
|
1201
|
-
"rounded-xl border border-agg-separator",
|
|
1202
|
-
"p-3 sm:p-4",
|
|
1366
|
+
"flex items-center gap-3 sm:gap-4 rounded-xl border border-agg-separator bg-agg-secondary p-3 sm:p-4",
|
|
1203
1367
|
"hover:bg-agg-secondary-hover transition-colors cursor-pointer"
|
|
1204
1368
|
),
|
|
1205
1369
|
role: "button",
|
|
@@ -1212,352 +1376,383 @@ var WithdrawMethodCard = ({
|
|
|
1212
1376
|
}
|
|
1213
1377
|
},
|
|
1214
1378
|
children: [
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx15("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
1380
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex-1 min-w-0", children: [
|
|
1381
|
+
/* @__PURE__ */ jsx15("p", { className: "agg-type-body-strong text-agg-foreground", children: title }),
|
|
1382
|
+
/* @__PURE__ */ jsx15("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
1219
1383
|
] }),
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
Button,
|
|
1222
|
-
{
|
|
1223
|
-
variant: "secondary",
|
|
1224
|
-
size: "small",
|
|
1225
|
-
suffix: /* @__PURE__ */ jsx13(ChevronRightIcon, {}),
|
|
1226
|
-
onClick: (e) => {
|
|
1227
|
-
e.stopPropagation();
|
|
1228
|
-
onContinue();
|
|
1229
|
-
},
|
|
1230
|
-
children: "Continue"
|
|
1231
|
-
}
|
|
1232
|
-
) })
|
|
1384
|
+
/* @__PURE__ */ jsx15("div", { className: "shrink-0 text-agg-muted-foreground", children: /* @__PURE__ */ jsx15(ChevronRightIcon, { className: "h-5 w-5" }) })
|
|
1233
1385
|
]
|
|
1234
1386
|
}
|
|
1235
1387
|
);
|
|
1236
1388
|
var WithdrawMethodStep = ({
|
|
1237
|
-
|
|
1238
|
-
onBack,
|
|
1389
|
+
balance,
|
|
1239
1390
|
onSelectMethod
|
|
1240
1391
|
}) => {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
leftElement: /* @__PURE__ */ jsx13(
|
|
1250
|
-
"button",
|
|
1251
|
-
{
|
|
1252
|
-
type: "button",
|
|
1253
|
-
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1254
|
-
onClick: onBack,
|
|
1255
|
-
"aria-label": "Go back",
|
|
1256
|
-
children: /* @__PURE__ */ jsx13(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1257
|
-
}
|
|
1258
|
-
)
|
|
1259
|
-
}
|
|
1260
|
-
),
|
|
1261
|
-
/* @__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-4", children: [
|
|
1262
|
-
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
1263
|
-
/* @__PURE__ */ jsx13(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
1264
|
-
/* @__PURE__ */ jsxs13("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1265
|
-
displayName,
|
|
1266
|
-
" balance: ",
|
|
1267
|
-
formatCompactUsd(venue.balance)
|
|
1268
|
-
] })
|
|
1392
|
+
const labels = useLabels9();
|
|
1393
|
+
return /* @__PURE__ */ jsxs15(Fragment10, { children: [
|
|
1394
|
+
/* @__PURE__ */ jsx15(Modal.Header, { title: labels.withdraw.title, hideBorder: true }),
|
|
1395
|
+
/* @__PURE__ */ jsx15(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-5", children: [
|
|
1396
|
+
/* @__PURE__ */ jsxs15("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
1397
|
+
labels.withdraw.balancePrefix,
|
|
1398
|
+
" ",
|
|
1399
|
+
formatCompactUsd(balance)
|
|
1269
1400
|
] }),
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
{
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
),
|
|
1280
|
-
/* @__PURE__ */ jsx13(
|
|
1281
|
-
WithdrawMethodCard,
|
|
1282
|
-
{
|
|
1283
|
-
icon: /* @__PURE__ */ jsx13(BankIcon, { className: "h-6 w-6 text-agg-foreground" }),
|
|
1284
|
-
title: "Withdraw to Bank",
|
|
1285
|
-
description: "Transfer funds to your linked bank account.",
|
|
1286
|
-
onContinue: () => onSelectMethod("bank")
|
|
1287
|
-
}
|
|
1288
|
-
)
|
|
1289
|
-
] })
|
|
1401
|
+
/* @__PURE__ */ jsx15(
|
|
1402
|
+
WithdrawMethodCard,
|
|
1403
|
+
{
|
|
1404
|
+
icon: /* @__PURE__ */ jsx15(CreditCardIcon, { className: "h-6 w-6 text-agg-muted-foreground" }),
|
|
1405
|
+
title: labels.withdraw.methods.cardTitle,
|
|
1406
|
+
description: labels.withdraw.methods.cardDescription,
|
|
1407
|
+
onContinue: () => onSelectMethod("card")
|
|
1408
|
+
}
|
|
1409
|
+
)
|
|
1290
1410
|
] }) })
|
|
1291
1411
|
] });
|
|
1292
1412
|
};
|
|
1293
1413
|
|
|
1294
1414
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
1295
|
-
import {
|
|
1296
|
-
import { Fragment as Fragment11, jsx as
|
|
1415
|
+
import { useLabels as useLabels10 } from "@agg-market/hooks";
|
|
1416
|
+
import { Fragment as Fragment11, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1297
1417
|
var WithdrawAmountStep = ({
|
|
1298
|
-
|
|
1299
|
-
|
|
1418
|
+
amount,
|
|
1419
|
+
currency,
|
|
1420
|
+
destinationWallet,
|
|
1421
|
+
tokenOptions,
|
|
1422
|
+
networkOptions,
|
|
1423
|
+
selectedToken,
|
|
1424
|
+
selectedNetwork,
|
|
1300
1425
|
onBack,
|
|
1426
|
+
onAmountChange,
|
|
1427
|
+
onCurrencyChange,
|
|
1428
|
+
onTokenChange,
|
|
1429
|
+
onNetworkChange,
|
|
1301
1430
|
onContinue
|
|
1302
1431
|
}) => {
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
const isValid = numericAmount > 0 && numericAmount <= venue.balance;
|
|
1308
|
-
const exceedsBalance = numericAmount > venue.balance;
|
|
1309
|
-
const methodLabel = method === "wallet" ? "Wallet" : "Bank";
|
|
1310
|
-
const handleAmountChange = useCallback5((e) => {
|
|
1311
|
-
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
1312
|
-
const parts = v.split(".");
|
|
1313
|
-
const sanitized = parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v;
|
|
1314
|
-
setRawAmount(sanitized);
|
|
1315
|
-
}, []);
|
|
1316
|
-
const handleMax = useCallback5(() => {
|
|
1317
|
-
setRawAmount(venue.balance.toString());
|
|
1318
|
-
}, [venue.balance]);
|
|
1319
|
-
return /* @__PURE__ */ jsxs14(Fragment11, { children: [
|
|
1320
|
-
/* @__PURE__ */ jsx14(
|
|
1432
|
+
const labels = useLabels10();
|
|
1433
|
+
const isValid = Number(amount) > 0;
|
|
1434
|
+
return /* @__PURE__ */ jsxs16(Fragment11, { children: [
|
|
1435
|
+
/* @__PURE__ */ jsx16(
|
|
1321
1436
|
Modal.Header,
|
|
1322
1437
|
{
|
|
1323
|
-
title:
|
|
1438
|
+
title: labels.withdraw.cardFlow.title,
|
|
1324
1439
|
hideBorder: true,
|
|
1325
|
-
leftElement: /* @__PURE__ */
|
|
1440
|
+
leftElement: /* @__PURE__ */ jsx16(
|
|
1326
1441
|
"button",
|
|
1327
1442
|
{
|
|
1328
1443
|
type: "button",
|
|
1329
1444
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1330
1445
|
onClick: onBack,
|
|
1331
1446
|
"aria-label": "Go back",
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1447
|
+
children: /* @__PURE__ */ jsx16(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1333
1448
|
}
|
|
1334
1449
|
)
|
|
1335
1450
|
}
|
|
1336
1451
|
),
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1452
|
+
/* @__PURE__ */ jsx16(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-5", children: [
|
|
1453
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex gap-3 items-end", children: [
|
|
1454
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1 flex flex-col gap-2", children: [
|
|
1455
|
+
/* @__PURE__ */ jsx16("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.cardFlow.amountLabel }),
|
|
1456
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex h-10 items-center gap-2 rounded border border-agg-separator bg-agg-secondary px-3", children: [
|
|
1457
|
+
/* @__PURE__ */ jsx16(
|
|
1458
|
+
"input",
|
|
1459
|
+
{
|
|
1460
|
+
type: "text",
|
|
1461
|
+
inputMode: "decimal",
|
|
1462
|
+
"aria-label": labels.withdraw.cardFlow.amountLabel,
|
|
1463
|
+
className: cn(
|
|
1464
|
+
"agg-type-body w-full bg-transparent outline-none",
|
|
1465
|
+
isValid ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
1466
|
+
),
|
|
1467
|
+
placeholder: "0.00",
|
|
1468
|
+
value: amount,
|
|
1469
|
+
onChange: (event) => onAmountChange(event.target.value)
|
|
1470
|
+
}
|
|
1471
|
+
),
|
|
1472
|
+
/* @__PURE__ */ jsx16("span", { className: "agg-type-body text-agg-muted-foreground", children: "$" })
|
|
1345
1473
|
] })
|
|
1346
1474
|
] }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1475
|
+
/* @__PURE__ */ jsx16("div", { className: "w-[100px]", children: /* @__PURE__ */ jsx16(
|
|
1476
|
+
Select,
|
|
1349
1477
|
{
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1478
|
+
items: [{ value: currency, label: currency }],
|
|
1479
|
+
value: currency,
|
|
1480
|
+
onChange: onCurrencyChange,
|
|
1481
|
+
ariaLabel: labels.withdraw.cardFlow.currencyLabel
|
|
1354
1482
|
}
|
|
1355
|
-
)
|
|
1483
|
+
) })
|
|
1356
1484
|
] }),
|
|
1357
|
-
/* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
|
|
1485
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex gap-5", children: [
|
|
1486
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1487
|
+
/* @__PURE__ */ jsx16("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.cardFlow.tokenLabel }),
|
|
1488
|
+
/* @__PURE__ */ jsx16(
|
|
1489
|
+
Select,
|
|
1362
1490
|
{
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
"agg-type-display w-full bg-transparent outline-none",
|
|
1368
|
-
exceedsBalance ? "text-agg-error" : numericAmount > 0 ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
1369
|
-
),
|
|
1370
|
-
placeholder: "0",
|
|
1371
|
-
value: rawAmount ? formatAmountDisplay(rawAmount) : "",
|
|
1372
|
-
onChange: handleAmountChange
|
|
1491
|
+
items: tokenOptions,
|
|
1492
|
+
value: selectedToken,
|
|
1493
|
+
onChange: onTokenChange,
|
|
1494
|
+
ariaLabel: labels.withdraw.cardFlow.tokenLabel
|
|
1373
1495
|
}
|
|
1374
1496
|
)
|
|
1375
1497
|
] }),
|
|
1376
|
-
|
|
1498
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1 flex flex-col gap-2 min-w-0", children: [
|
|
1499
|
+
/* @__PURE__ */ jsx16("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.cardFlow.networkLabel }),
|
|
1500
|
+
/* @__PURE__ */ jsx16(
|
|
1501
|
+
Select,
|
|
1502
|
+
{
|
|
1503
|
+
items: networkOptions,
|
|
1504
|
+
value: selectedNetwork,
|
|
1505
|
+
onChange: onNetworkChange,
|
|
1506
|
+
ariaLabel: labels.withdraw.cardFlow.networkLabel
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1509
|
+
] })
|
|
1377
1510
|
] }),
|
|
1378
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
|
|
1512
|
+
/* @__PURE__ */ jsx16("p", { className: "agg-type-label-strong text-agg-foreground", children: labels.withdraw.cardFlow.destinationWalletLabel }),
|
|
1513
|
+
/* @__PURE__ */ jsx16("div", { className: "flex h-10 items-center rounded border border-agg-separator bg-agg-secondary px-3", children: /* @__PURE__ */ jsx16("p", { className: "agg-type-body truncate text-agg-foreground", children: destinationWallet }) })
|
|
1514
|
+
] }),
|
|
1515
|
+
/* @__PURE__ */ jsx16(
|
|
1379
1516
|
Button,
|
|
1380
1517
|
{
|
|
1381
|
-
variant: "primary",
|
|
1518
|
+
variant: isValid ? "primary" : "secondary",
|
|
1382
1519
|
size: "large",
|
|
1383
1520
|
className: "w-full",
|
|
1384
1521
|
disabled: !isValid,
|
|
1385
|
-
onClick:
|
|
1386
|
-
children:
|
|
1522
|
+
onClick: onContinue,
|
|
1523
|
+
children: labels.withdraw.cardFlow.getQuotes
|
|
1387
1524
|
}
|
|
1388
1525
|
)
|
|
1389
1526
|
] }) })
|
|
1390
1527
|
] });
|
|
1391
1528
|
};
|
|
1392
1529
|
|
|
1393
|
-
// src/withdraw/steps/
|
|
1394
|
-
import {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1530
|
+
// src/withdraw/steps/withdraw-provider.tsx
|
|
1531
|
+
import { useLabels as useLabels11 } from "@agg-market/hooks";
|
|
1532
|
+
import { Fragment as Fragment12, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1533
|
+
var WithdrawProviderItem = ({ provider, onSelect }) => {
|
|
1534
|
+
const labels = useLabels11();
|
|
1535
|
+
const badgeText = provider.badge === "best" ? labels.withdraw.cardFlow.providerBadges.best : provider.badge === "low-kyc" ? labels.withdraw.cardFlow.providerBadges.lowKyc : void 0;
|
|
1536
|
+
return /* @__PURE__ */ jsx17(
|
|
1537
|
+
"button",
|
|
1538
|
+
{
|
|
1539
|
+
type: "button",
|
|
1540
|
+
className: "w-full rounded-xl border border-agg-separator px-4 py-3 text-left bg-agg-secondary hover:bg-agg-secondary-hover transition-colors cursor-pointer",
|
|
1541
|
+
onClick: () => onSelect(provider.id),
|
|
1542
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between gap-4", children: [
|
|
1543
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
1544
|
+
/* @__PURE__ */ jsx17("p", { className: "text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: provider.name }),
|
|
1545
|
+
badgeText ? /* @__PURE__ */ jsx17(
|
|
1546
|
+
"span",
|
|
1547
|
+
{
|
|
1548
|
+
className: `rounded border px-2 py-[2px] text-[10px] leading-[14px] font-agg-bold uppercase ${provider.badge === "best" ? "border-agg-primary/50 text-agg-primary bg-agg-secondary" : "border-agg-separator text-agg-foreground bg-agg-secondary"}`,
|
|
1549
|
+
children: badgeText
|
|
1550
|
+
}
|
|
1551
|
+
) : null
|
|
1552
|
+
] }),
|
|
1553
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-4", children: [
|
|
1554
|
+
/* @__PURE__ */ jsxs17("div", { className: "text-right", children: [
|
|
1555
|
+
/* @__PURE__ */ jsx17("p", { className: "agg-type-body text-agg-foreground", children: provider.quote }),
|
|
1556
|
+
/* @__PURE__ */ jsxs17("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
1557
|
+
labels.withdraw.cardFlow.feeLabel,
|
|
1558
|
+
" ",
|
|
1559
|
+
provider.fee
|
|
1560
|
+
] })
|
|
1561
|
+
] }),
|
|
1562
|
+
/* @__PURE__ */ jsx17(ChevronRightIcon, { className: "h-5 w-5 text-agg-muted-foreground" })
|
|
1563
|
+
] })
|
|
1564
|
+
] })
|
|
1565
|
+
}
|
|
1566
|
+
);
|
|
1567
|
+
};
|
|
1568
|
+
var WithdrawProviderStep = ({
|
|
1569
|
+
token,
|
|
1570
|
+
amount,
|
|
1571
|
+
currency,
|
|
1572
|
+
providers,
|
|
1573
|
+
onBack,
|
|
1574
|
+
onSelectProvider
|
|
1575
|
+
}) => {
|
|
1576
|
+
const labels = useLabels11();
|
|
1577
|
+
return /* @__PURE__ */ jsxs17(Fragment12, { children: [
|
|
1578
|
+
/* @__PURE__ */ jsx17(
|
|
1579
|
+
Modal.Header,
|
|
1419
1580
|
{
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1581
|
+
title: labels.withdraw.cardFlow.selectProviderTitle,
|
|
1582
|
+
hideBorder: true,
|
|
1583
|
+
leftElement: /* @__PURE__ */ jsx17(
|
|
1584
|
+
"button",
|
|
1585
|
+
{
|
|
1586
|
+
type: "button",
|
|
1587
|
+
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
1588
|
+
onClick: onBack,
|
|
1589
|
+
"aria-label": labels.withdraw.back,
|
|
1590
|
+
children: /* @__PURE__ */ jsx17(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
1591
|
+
}
|
|
1592
|
+
)
|
|
1423
1593
|
}
|
|
1424
1594
|
),
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
description: "Sign in to your Kalshi account and go to Withdraw from your account menu.",
|
|
1436
|
-
children: /* @__PURE__ */ jsx15("div", { className: "mt-1", children: /* @__PURE__ */ jsx15(
|
|
1437
|
-
Button,
|
|
1438
|
-
{
|
|
1439
|
-
variant: "secondary",
|
|
1440
|
-
size: "small",
|
|
1441
|
-
suffix: /* @__PURE__ */ jsx15(ExternalLinkIcon, { className: "h-3.5 w-3.5" }),
|
|
1442
|
-
onClick: () => {
|
|
1443
|
-
window.open(withdrawUrl, "_blank", "noopener,noreferrer");
|
|
1444
|
-
},
|
|
1445
|
-
children: "Open Kalshi"
|
|
1446
|
-
}
|
|
1447
|
-
) })
|
|
1448
|
-
}
|
|
1449
|
-
),
|
|
1450
|
-
/* @__PURE__ */ jsx15(
|
|
1451
|
-
KalshiStepCard2,
|
|
1452
|
-
{
|
|
1453
|
-
step: 2,
|
|
1454
|
-
title: "Choose a Withdrawal Method",
|
|
1455
|
-
description: "Select a withdrawal method: Bank transfer (ACH), Wire, or USDC (crypto)."
|
|
1456
|
-
}
|
|
1457
|
-
),
|
|
1458
|
-
/* @__PURE__ */ jsx15(
|
|
1459
|
-
KalshiStepCard2,
|
|
1595
|
+
/* @__PURE__ */ jsx17(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-4", children: [
|
|
1596
|
+
/* @__PURE__ */ jsxs17("p", { className: "agg-type-body text-agg-foreground", children: [
|
|
1597
|
+
/* @__PURE__ */ jsx17("span", { className: "font-agg-bold", children: token }),
|
|
1598
|
+
" $",
|
|
1599
|
+
amount,
|
|
1600
|
+
" ",
|
|
1601
|
+
currency
|
|
1602
|
+
] }),
|
|
1603
|
+
/* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-4", children: providers.map((provider) => /* @__PURE__ */ jsx17(
|
|
1604
|
+
WithdrawProviderItem,
|
|
1460
1605
|
{
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
)
|
|
1466
|
-
] })
|
|
1467
|
-
|
|
1468
|
-
|
|
1606
|
+
provider,
|
|
1607
|
+
onSelect: onSelectProvider
|
|
1608
|
+
},
|
|
1609
|
+
provider.id
|
|
1610
|
+
)) })
|
|
1611
|
+
] }) })
|
|
1612
|
+
] });
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
// src/withdraw/steps/withdraw-success.tsx
|
|
1616
|
+
import { useLabels as useLabels12 } from "@agg-market/hooks";
|
|
1617
|
+
import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1618
|
+
var SummaryRow3 = ({ label, value }) => /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between border-b border-agg-separator py-2 last:border-b-0", children: [
|
|
1619
|
+
/* @__PURE__ */ jsx18("p", { className: "text-[12px] leading-4 font-agg-bold uppercase text-agg-muted-foreground", children: label }),
|
|
1620
|
+
/* @__PURE__ */ jsx18("p", { className: "agg-type-label text-agg-foreground", children: value })
|
|
1469
1621
|
] });
|
|
1622
|
+
var WithdrawSuccessStep = ({
|
|
1623
|
+
summary,
|
|
1624
|
+
onDone,
|
|
1625
|
+
onClose
|
|
1626
|
+
}) => {
|
|
1627
|
+
const labels = useLabels12();
|
|
1628
|
+
return /* @__PURE__ */ jsx18("div", { className: "relative", children: /* @__PURE__ */ jsxs18(Modal.Body, { classNames: { root: "px-5 py-8 sm:px-8 sm:py-10" }, children: [
|
|
1629
|
+
/* @__PURE__ */ jsx18(
|
|
1630
|
+
"button",
|
|
1631
|
+
{
|
|
1632
|
+
type: "button",
|
|
1633
|
+
className: "absolute right-8 top-7 flex items-center justify-center text-agg-foreground transition-colors hover:text-agg-foreground/80",
|
|
1634
|
+
onClick: onClose,
|
|
1635
|
+
"aria-label": labels.common.close,
|
|
1636
|
+
children: /* @__PURE__ */ jsx18(CloseIcon, { className: "h-6 w-6" })
|
|
1637
|
+
}
|
|
1638
|
+
),
|
|
1639
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center gap-8", children: [
|
|
1640
|
+
/* @__PURE__ */ jsx18("div", { className: "flex h-[60px] w-[60px] items-center justify-center rounded-full border border-[#18C15C80] bg-[#18C15C26]", children: /* @__PURE__ */ jsx18(SuccessCheckIcon, { className: "h-6 w-6 text-[#18C15C]" }) }),
|
|
1641
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center gap-3 text-center", children: [
|
|
1642
|
+
/* @__PURE__ */ jsx18("h3", { className: "text-agg-2xl leading-agg-8 font-agg-bold text-agg-foreground", children: labels.withdraw.cardFlow.successTitle }),
|
|
1643
|
+
/* @__PURE__ */ jsx18("p", { className: "agg-type-body text-agg-foreground", children: labels.withdraw.cardFlow.successDescription })
|
|
1644
|
+
] }),
|
|
1645
|
+
/* @__PURE__ */ jsxs18("div", { className: "w-full rounded-lg border border-agg-separator bg-agg-secondary px-3 py-1", children: [
|
|
1646
|
+
/* @__PURE__ */ jsx18(
|
|
1647
|
+
SummaryRow3,
|
|
1648
|
+
{
|
|
1649
|
+
label: labels.withdraw.summary.amountReceived,
|
|
1650
|
+
value: summary.amountReceived
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
/* @__PURE__ */ jsx18(SummaryRow3, { label: labels.withdraw.summary.network, value: summary.network }),
|
|
1654
|
+
/* @__PURE__ */ jsx18(
|
|
1655
|
+
SummaryRow3,
|
|
1656
|
+
{
|
|
1657
|
+
label: labels.withdraw.cardFlow.summary.provider,
|
|
1658
|
+
value: summary.provider
|
|
1659
|
+
}
|
|
1660
|
+
),
|
|
1661
|
+
/* @__PURE__ */ jsx18(
|
|
1662
|
+
SummaryRow3,
|
|
1663
|
+
{
|
|
1664
|
+
label: labels.withdraw.cardFlow.summary.toWallet,
|
|
1665
|
+
value: summary.toWallet
|
|
1666
|
+
}
|
|
1667
|
+
),
|
|
1668
|
+
/* @__PURE__ */ jsx18(SummaryRow3, { label: labels.withdraw.cardFlow.summary.fees, value: summary.fees })
|
|
1669
|
+
] }),
|
|
1670
|
+
/* @__PURE__ */ jsx18(Button, { variant: "secondary", size: "large", className: "w-[120px]", onClick: onDone, children: labels.withdraw.done })
|
|
1671
|
+
] })
|
|
1672
|
+
] }) });
|
|
1673
|
+
};
|
|
1470
1674
|
|
|
1471
1675
|
// src/withdraw/index.tsx
|
|
1472
|
-
import { jsx as
|
|
1676
|
+
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1473
1677
|
var WithdrawModal = ({
|
|
1474
1678
|
open,
|
|
1475
1679
|
onOpenChange,
|
|
1476
|
-
|
|
1477
|
-
onSelectVenue,
|
|
1680
|
+
withdrawFlow,
|
|
1478
1681
|
onSelectWithdrawMethod,
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1682
|
+
onWithdrawAmountChange,
|
|
1683
|
+
onWithdrawCurrencyChange,
|
|
1684
|
+
onWithdrawTokenChange,
|
|
1685
|
+
onWithdrawNetworkChange,
|
|
1686
|
+
onGetWithdrawQuotes,
|
|
1687
|
+
onSelectWithdrawProvider,
|
|
1688
|
+
onDoneWithdraw
|
|
1483
1689
|
}) => {
|
|
1484
|
-
const [step, setStep] =
|
|
1485
|
-
const [selectedVenue, setSelectedVenue] = useState6(null);
|
|
1486
|
-
const [selectedMethod, setSelectedMethod] = useState6(null);
|
|
1487
|
-
const handleSelectVenue = (venueSlug) => {
|
|
1488
|
-
onSelectVenue(venueSlug);
|
|
1489
|
-
if (venueSlug === KALSHI_VENUE2) {
|
|
1490
|
-
setStep("kalshi");
|
|
1491
|
-
return;
|
|
1492
|
-
}
|
|
1493
|
-
const venueData = venues.find((v) => v.venue === venueSlug);
|
|
1494
|
-
if (venueData) {
|
|
1495
|
-
setSelectedVenue(venueData);
|
|
1496
|
-
setStep("method");
|
|
1497
|
-
}
|
|
1498
|
-
};
|
|
1499
|
-
const handleBackToVenues = () => {
|
|
1500
|
-
setStep("venues");
|
|
1501
|
-
setSelectedVenue(null);
|
|
1502
|
-
setSelectedMethod(null);
|
|
1503
|
-
};
|
|
1690
|
+
const [step, setStep] = useState5("method");
|
|
1504
1691
|
const handleBackToMethod = () => {
|
|
1505
1692
|
setStep("method");
|
|
1506
|
-
setSelectedMethod(null);
|
|
1507
1693
|
};
|
|
1508
1694
|
const handleSelectMethod = (method) => {
|
|
1509
|
-
if (!selectedVenue) return;
|
|
1510
|
-
setSelectedMethod(method);
|
|
1511
1695
|
setStep("withdraw-amount");
|
|
1512
|
-
onSelectWithdrawMethod == null ? void 0 : onSelectWithdrawMethod(
|
|
1513
|
-
};
|
|
1514
|
-
const handleContinueWithdraw = (amount) => {
|
|
1515
|
-
if (!selectedVenue || !selectedMethod) return;
|
|
1516
|
-
if (selectedMethod === "wallet") {
|
|
1517
|
-
onContinueWalletWithdraw == null ? void 0 : onContinueWalletWithdraw(selectedVenue.venue, amount);
|
|
1518
|
-
} else {
|
|
1519
|
-
onContinueBankWithdraw == null ? void 0 : onContinueBankWithdraw(selectedVenue.venue, amount);
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
const handleDoneKalshi = () => {
|
|
1523
|
-
onDoneKalshi == null ? void 0 : onDoneKalshi();
|
|
1524
|
-
onOpenChange(false);
|
|
1696
|
+
onSelectWithdrawMethod == null ? void 0 : onSelectWithdrawMethod(method);
|
|
1525
1697
|
};
|
|
1526
1698
|
const handleOpenChange = (isOpen) => {
|
|
1527
1699
|
if (!isOpen) {
|
|
1528
|
-
setStep("
|
|
1529
|
-
setSelectedVenue(null);
|
|
1530
|
-
setSelectedMethod(null);
|
|
1700
|
+
setStep("method");
|
|
1531
1701
|
}
|
|
1532
1702
|
onOpenChange(isOpen);
|
|
1533
1703
|
};
|
|
1534
|
-
return /* @__PURE__ */
|
|
1535
|
-
step === "
|
|
1536
|
-
step === "
|
|
1537
|
-
|
|
1704
|
+
return /* @__PURE__ */ jsx19(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs19(Modal.Container, { maxWidth: "600px", "aria-label": "Withdraw", children: [
|
|
1705
|
+
step === "method" ? /* @__PURE__ */ jsx19(WithdrawMethodStep, { balance: withdrawFlow.balance, onSelectMethod: handleSelectMethod }) : null,
|
|
1706
|
+
step === "withdraw-amount" ? /* @__PURE__ */ jsx19(
|
|
1707
|
+
WithdrawAmountStep,
|
|
1538
1708
|
{
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1709
|
+
amount: withdrawFlow.amount,
|
|
1710
|
+
currency: withdrawFlow.currency,
|
|
1711
|
+
destinationWallet: withdrawFlow.destinationWallet,
|
|
1712
|
+
tokenOptions: withdrawFlow.tokenOptions,
|
|
1713
|
+
networkOptions: withdrawFlow.networkOptions,
|
|
1714
|
+
selectedToken: withdrawFlow.selectedToken,
|
|
1715
|
+
selectedNetwork: withdrawFlow.selectedNetwork,
|
|
1716
|
+
onBack: handleBackToMethod,
|
|
1717
|
+
onAmountChange: onWithdrawAmountChange,
|
|
1718
|
+
onCurrencyChange: onWithdrawCurrencyChange,
|
|
1719
|
+
onTokenChange: onWithdrawTokenChange,
|
|
1720
|
+
onNetworkChange: onWithdrawNetworkChange,
|
|
1721
|
+
onContinue: () => {
|
|
1722
|
+
onGetWithdrawQuotes == null ? void 0 : onGetWithdrawQuotes();
|
|
1723
|
+
setStep("provider");
|
|
1724
|
+
}
|
|
1542
1725
|
}
|
|
1543
1726
|
) : null,
|
|
1544
|
-
step === "
|
|
1545
|
-
|
|
1727
|
+
step === "provider" ? /* @__PURE__ */ jsx19(
|
|
1728
|
+
WithdrawProviderStep,
|
|
1546
1729
|
{
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1730
|
+
token: withdrawFlow.selectedToken,
|
|
1731
|
+
amount: withdrawFlow.amount,
|
|
1732
|
+
currency: withdrawFlow.currency,
|
|
1733
|
+
providers: withdrawFlow.providers,
|
|
1734
|
+
onBack: () => setStep("withdraw-amount"),
|
|
1735
|
+
onSelectProvider: (providerId) => {
|
|
1736
|
+
onSelectWithdrawProvider(providerId);
|
|
1737
|
+
setStep("success");
|
|
1738
|
+
}
|
|
1551
1739
|
}
|
|
1552
1740
|
) : null,
|
|
1553
|
-
step === "
|
|
1741
|
+
step === "success" ? /* @__PURE__ */ jsx19(
|
|
1742
|
+
WithdrawSuccessStep,
|
|
1743
|
+
{
|
|
1744
|
+
summary: withdrawFlow.purchaseSummary,
|
|
1745
|
+
onDone: onDoneWithdraw,
|
|
1746
|
+
onClose: () => onOpenChange(false)
|
|
1747
|
+
}
|
|
1748
|
+
) : null
|
|
1554
1749
|
] }) });
|
|
1555
1750
|
};
|
|
1556
1751
|
WithdrawModal.displayName = "WithdrawModal";
|
|
1557
1752
|
|
|
1558
1753
|
// src/onboarding/index.tsx
|
|
1559
|
-
import { useCallback as
|
|
1560
|
-
import { useLabels as
|
|
1754
|
+
import { useCallback as useCallback7, useEffect as useEffect3, useState as useState10 } from "react";
|
|
1755
|
+
import { useLabels as useLabels18 } from "@agg-market/hooks";
|
|
1561
1756
|
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
1562
1757
|
|
|
1563
1758
|
// src/onboarding/onboarding-modal.constants.ts
|
|
@@ -1579,30 +1774,30 @@ var ONCHAIN_VENUES = [
|
|
|
1579
1774
|
];
|
|
1580
1775
|
|
|
1581
1776
|
// src/onboarding/steps/how-it-works.tsx
|
|
1582
|
-
import { useCallback as
|
|
1583
|
-
import { useLabels } from "@agg-market/hooks";
|
|
1584
|
-
import { jsx as
|
|
1777
|
+
import { useCallback as useCallback3, useRef as useRef3, useState as useState6 } from "react";
|
|
1778
|
+
import { useLabels as useLabels13 } from "@agg-market/hooks";
|
|
1779
|
+
import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1585
1780
|
var defaultIcons = {
|
|
1586
|
-
createAccount: /* @__PURE__ */
|
|
1587
|
-
linkAccounts: /* @__PURE__ */
|
|
1588
|
-
bestPrices: /* @__PURE__ */
|
|
1589
|
-
stayInControl: /* @__PURE__ */
|
|
1781
|
+
createAccount: /* @__PURE__ */ jsx20(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
1782
|
+
linkAccounts: /* @__PURE__ */ jsx20(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
1783
|
+
bestPrices: /* @__PURE__ */ jsx20(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
1784
|
+
stayInControl: /* @__PURE__ */ jsx20(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
1590
1785
|
};
|
|
1591
1786
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
1592
|
-
const labels =
|
|
1593
|
-
const scrollRef =
|
|
1594
|
-
const [showTopGradient, setShowTopGradient] =
|
|
1595
|
-
const [showBottomGradient, setShowBottomGradient] =
|
|
1596
|
-
const handleScroll =
|
|
1787
|
+
const labels = useLabels13();
|
|
1788
|
+
const scrollRef = useRef3(null);
|
|
1789
|
+
const [showTopGradient, setShowTopGradient] = useState6(false);
|
|
1790
|
+
const [showBottomGradient, setShowBottomGradient] = useState6(true);
|
|
1791
|
+
const handleScroll = useCallback3(() => {
|
|
1597
1792
|
const el = scrollRef.current;
|
|
1598
1793
|
if (!el) return;
|
|
1599
1794
|
setShowTopGradient(el.scrollTop > 0);
|
|
1600
1795
|
setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
|
|
1601
1796
|
}, []);
|
|
1602
|
-
return /* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
/* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
|
|
1798
|
+
/* @__PURE__ */ jsx20("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
|
|
1799
|
+
/* @__PURE__ */ jsxs20("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
|
|
1800
|
+
/* @__PURE__ */ jsx20(
|
|
1606
1801
|
"div",
|
|
1607
1802
|
{
|
|
1608
1803
|
ref: scrollRef,
|
|
@@ -1612,7 +1807,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
1612
1807
|
var _a;
|
|
1613
1808
|
const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
|
|
1614
1809
|
const feature = labels.onboarding.howItWorks.features[featureKey];
|
|
1615
|
-
return /* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ jsxs20(
|
|
1616
1811
|
"div",
|
|
1617
1812
|
{
|
|
1618
1813
|
className: cn(
|
|
@@ -1621,11 +1816,11 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
1621
1816
|
"bg-agg-secondary-hover"
|
|
1622
1817
|
),
|
|
1623
1818
|
children: [
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
|
|
1820
|
+
/* @__PURE__ */ jsx20("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
|
|
1821
|
+
/* @__PURE__ */ jsx20("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
|
|
1627
1822
|
] }),
|
|
1628
|
-
icon ? /* @__PURE__ */
|
|
1823
|
+
icon ? /* @__PURE__ */ jsx20("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
|
|
1629
1824
|
]
|
|
1630
1825
|
},
|
|
1631
1826
|
featureKey
|
|
@@ -1633,7 +1828,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
1633
1828
|
})
|
|
1634
1829
|
}
|
|
1635
1830
|
),
|
|
1636
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsx20(
|
|
1637
1832
|
"div",
|
|
1638
1833
|
{
|
|
1639
1834
|
className: cn(
|
|
@@ -1644,7 +1839,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
1644
1839
|
)
|
|
1645
1840
|
}
|
|
1646
1841
|
),
|
|
1647
|
-
/* @__PURE__ */
|
|
1842
|
+
/* @__PURE__ */ jsx20(
|
|
1648
1843
|
"div",
|
|
1649
1844
|
{
|
|
1650
1845
|
className: cn(
|
|
@@ -1656,26 +1851,26 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
1656
1851
|
}
|
|
1657
1852
|
)
|
|
1658
1853
|
] }),
|
|
1659
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx20(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
|
|
1660
1855
|
] });
|
|
1661
1856
|
};
|
|
1662
1857
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
1663
1858
|
|
|
1664
1859
|
// src/onboarding/steps/profile-setup.tsx
|
|
1665
|
-
import { useCallback as
|
|
1666
|
-
import { useLabels as
|
|
1667
|
-
import { jsx as
|
|
1860
|
+
import { useCallback as useCallback4, useRef as useRef4, useState as useState7 } from "react";
|
|
1861
|
+
import { useLabels as useLabels14 } from "@agg-market/hooks";
|
|
1862
|
+
import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1668
1863
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
1669
|
-
const labels =
|
|
1670
|
-
const [username, setUsername] =
|
|
1671
|
-
const [avatarFile, setAvatarFile] =
|
|
1672
|
-
const [avatarPreview, setAvatarPreview] =
|
|
1673
|
-
const fileInputRef =
|
|
1674
|
-
const handleAvatarClick =
|
|
1864
|
+
const labels = useLabels14();
|
|
1865
|
+
const [username, setUsername] = useState7("");
|
|
1866
|
+
const [avatarFile, setAvatarFile] = useState7();
|
|
1867
|
+
const [avatarPreview, setAvatarPreview] = useState7();
|
|
1868
|
+
const fileInputRef = useRef4(null);
|
|
1869
|
+
const handleAvatarClick = useCallback4(() => {
|
|
1675
1870
|
var _a;
|
|
1676
1871
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
1677
1872
|
}, []);
|
|
1678
|
-
const handleFileChange =
|
|
1873
|
+
const handleFileChange = useCallback4((e) => {
|
|
1679
1874
|
var _a;
|
|
1680
1875
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
1681
1876
|
if (!file) return;
|
|
@@ -1687,18 +1882,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1687
1882
|
};
|
|
1688
1883
|
reader.readAsDataURL(file);
|
|
1689
1884
|
}, []);
|
|
1690
|
-
const handleContinue =
|
|
1885
|
+
const handleContinue = useCallback4(() => {
|
|
1691
1886
|
onContinue({
|
|
1692
1887
|
username,
|
|
1693
1888
|
avatarFile,
|
|
1694
1889
|
avatarPreview
|
|
1695
1890
|
});
|
|
1696
1891
|
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-7", children: [
|
|
1893
|
+
/* @__PURE__ */ jsx21("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
1894
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
1895
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-center", children: [
|
|
1896
|
+
/* @__PURE__ */ jsxs21(
|
|
1702
1897
|
"button",
|
|
1703
1898
|
{
|
|
1704
1899
|
type: "button",
|
|
@@ -1714,13 +1909,13 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1714
1909
|
),
|
|
1715
1910
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
1716
1911
|
children: [
|
|
1717
|
-
!avatarPreview ? /* @__PURE__ */
|
|
1912
|
+
!avatarPreview ? /* @__PURE__ */ jsx21(
|
|
1718
1913
|
"svg",
|
|
1719
1914
|
{
|
|
1720
1915
|
"aria-hidden": true,
|
|
1721
1916
|
viewBox: "0 0 80 80",
|
|
1722
1917
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
1723
|
-
children: /* @__PURE__ */
|
|
1918
|
+
children: /* @__PURE__ */ jsx21(
|
|
1724
1919
|
"circle",
|
|
1725
1920
|
{
|
|
1726
1921
|
cx: "40",
|
|
@@ -1734,18 +1929,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1734
1929
|
)
|
|
1735
1930
|
}
|
|
1736
1931
|
) : null,
|
|
1737
|
-
avatarPreview ? /* @__PURE__ */
|
|
1932
|
+
avatarPreview ? /* @__PURE__ */ jsx21(
|
|
1738
1933
|
RemoteImage,
|
|
1739
1934
|
{
|
|
1740
1935
|
src: avatarPreview,
|
|
1741
1936
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
1742
1937
|
className: "h-full w-full object-cover"
|
|
1743
1938
|
}
|
|
1744
|
-
) : /* @__PURE__ */
|
|
1939
|
+
) : /* @__PURE__ */ jsx21(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
1745
1940
|
]
|
|
1746
1941
|
}
|
|
1747
1942
|
),
|
|
1748
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ jsx21(
|
|
1749
1944
|
"input",
|
|
1750
1945
|
{
|
|
1751
1946
|
ref: fileInputRef,
|
|
@@ -1757,8 +1952,8 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1757
1952
|
}
|
|
1758
1953
|
)
|
|
1759
1954
|
] }),
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
1956
|
+
/* @__PURE__ */ jsx21(
|
|
1762
1957
|
"label",
|
|
1763
1958
|
{
|
|
1764
1959
|
htmlFor: "onboarding-username",
|
|
@@ -1766,7 +1961,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1766
1961
|
children: labels.onboarding.profileSetup.usernameLabel
|
|
1767
1962
|
}
|
|
1768
1963
|
),
|
|
1769
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx21(
|
|
1770
1965
|
"input",
|
|
1771
1966
|
{
|
|
1772
1967
|
id: "onboarding-username",
|
|
@@ -1790,16 +1985,16 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
1790
1985
|
)
|
|
1791
1986
|
] })
|
|
1792
1987
|
] }),
|
|
1793
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ jsx21(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
1794
1989
|
] });
|
|
1795
1990
|
};
|
|
1796
1991
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
1797
1992
|
|
|
1798
1993
|
// src/onboarding/steps/connect-accounts.tsx
|
|
1799
|
-
import { useLabels as
|
|
1800
|
-
import { jsx as
|
|
1994
|
+
import { useLabels as useLabels15 } from "@agg-market/hooks";
|
|
1995
|
+
import { jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1801
1996
|
var OnchainVenueLogos = () => {
|
|
1802
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ jsx22("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsx22("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ jsx22(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
1803
1998
|
};
|
|
1804
1999
|
var VenueCard = ({
|
|
1805
2000
|
logos,
|
|
@@ -1810,8 +2005,8 @@ var VenueCard = ({
|
|
|
1810
2005
|
onConnect,
|
|
1811
2006
|
connected = false
|
|
1812
2007
|
}) => {
|
|
1813
|
-
const labels =
|
|
1814
|
-
const action = connected ? /* @__PURE__ */
|
|
2008
|
+
const labels = useLabels15();
|
|
2009
|
+
const action = connected ? /* @__PURE__ */ jsx22(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx22(
|
|
1815
2010
|
Button,
|
|
1816
2011
|
{
|
|
1817
2012
|
variant: "tertiary",
|
|
@@ -1821,18 +2016,18 @@ var VenueCard = ({
|
|
|
1821
2016
|
children: labels.onboarding.connectAccounts.connect
|
|
1822
2017
|
}
|
|
1823
2018
|
);
|
|
1824
|
-
const mobileAction = connected ? /* @__PURE__ */
|
|
2019
|
+
const mobileAction = connected ? /* @__PURE__ */ jsx22(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx22(
|
|
1825
2020
|
Button,
|
|
1826
2021
|
{
|
|
1827
2022
|
variant: "tertiary",
|
|
1828
2023
|
size: "medium",
|
|
1829
2024
|
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
1830
2025
|
onClick: onConnect,
|
|
1831
|
-
suffix: /* @__PURE__ */
|
|
2026
|
+
suffix: /* @__PURE__ */ jsx22(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
1832
2027
|
children: labels.onboarding.connectAccounts.connectAccount
|
|
1833
2028
|
}
|
|
1834
2029
|
);
|
|
1835
|
-
return /* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ jsxs22(
|
|
1836
2031
|
"div",
|
|
1837
2032
|
{
|
|
1838
2033
|
className: cn(
|
|
@@ -1840,23 +2035,23 @@ var VenueCard = ({
|
|
|
1840
2035
|
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
1841
2036
|
),
|
|
1842
2037
|
children: [
|
|
1843
|
-
/* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ jsxs22("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
2039
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-5", children: [
|
|
2040
|
+
/* @__PURE__ */ jsx22("div", { className: "shrink-0", children: logos }),
|
|
2041
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-[2px]", children: [
|
|
2042
|
+
/* @__PURE__ */ jsx22("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title }),
|
|
2043
|
+
/* @__PURE__ */ jsx22("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
1849
2044
|
] })
|
|
1850
2045
|
] }),
|
|
1851
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx22("div", { className: "shrink-0", children: action })
|
|
1852
2047
|
] }),
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
2048
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
2049
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3", children: [
|
|
2050
|
+
/* @__PURE__ */ jsx22("div", { className: "shrink-0", children: logos }),
|
|
2051
|
+
/* @__PURE__ */ jsx22("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title })
|
|
1857
2052
|
] }),
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-start gap-2", children: [
|
|
2054
|
+
/* @__PURE__ */ jsx22("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
1860
2055
|
mobileAction
|
|
1861
2056
|
] })
|
|
1862
2057
|
] })
|
|
@@ -1871,15 +2066,15 @@ var ConnectAccountsStep = ({
|
|
|
1871
2066
|
connectedOnchain = false,
|
|
1872
2067
|
connectedKalshi = false
|
|
1873
2068
|
}) => {
|
|
1874
|
-
const labels =
|
|
2069
|
+
const labels = useLabels15();
|
|
1875
2070
|
const canContinue = connectedOnchain || connectedKalshi;
|
|
1876
|
-
return /* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
2071
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-6", children: [
|
|
2072
|
+
/* @__PURE__ */ jsx22("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
2073
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4", children: [
|
|
2074
|
+
/* @__PURE__ */ jsx22(
|
|
1880
2075
|
VenueCard,
|
|
1881
2076
|
{
|
|
1882
|
-
logos: /* @__PURE__ */
|
|
2077
|
+
logos: /* @__PURE__ */ jsx22(OnchainVenueLogos, {}),
|
|
1883
2078
|
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
1884
2079
|
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
1885
2080
|
ONCHAIN_VENUES.length - 1
|
|
@@ -1890,10 +2085,10 @@ var ConnectAccountsStep = ({
|
|
|
1890
2085
|
connected: connectedOnchain
|
|
1891
2086
|
}
|
|
1892
2087
|
),
|
|
1893
|
-
/* @__PURE__ */
|
|
2088
|
+
/* @__PURE__ */ jsx22(
|
|
1894
2089
|
VenueCard,
|
|
1895
2090
|
{
|
|
1896
|
-
logos: /* @__PURE__ */
|
|
2091
|
+
logos: /* @__PURE__ */ jsx22("div", { className: "sm:flex sm:w-14 sm:items-center sm:justify-center", children: /* @__PURE__ */ jsx22(
|
|
1897
2092
|
VenueLogo,
|
|
1898
2093
|
{
|
|
1899
2094
|
venue: "kalshi",
|
|
@@ -1911,7 +2106,7 @@ var ConnectAccountsStep = ({
|
|
|
1911
2106
|
}
|
|
1912
2107
|
)
|
|
1913
2108
|
] }),
|
|
1914
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx22(
|
|
1915
2110
|
Button,
|
|
1916
2111
|
{
|
|
1917
2112
|
variant: "primary",
|
|
@@ -1927,25 +2122,25 @@ var ConnectAccountsStep = ({
|
|
|
1927
2122
|
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
1928
2123
|
|
|
1929
2124
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
1930
|
-
import { useCallback as
|
|
1931
|
-
import { useLabels as
|
|
2125
|
+
import { useCallback as useCallback5, useState as useState8 } from "react";
|
|
2126
|
+
import { useLabels as useLabels16 } from "@agg-market/hooks";
|
|
1932
2127
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
1933
|
-
import { jsx as
|
|
2128
|
+
import { jsx as jsx23, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1934
2129
|
var ConnectKalshiModal = ({
|
|
1935
2130
|
open,
|
|
1936
2131
|
onOpenChange,
|
|
1937
2132
|
onVerify
|
|
1938
2133
|
}) => {
|
|
1939
|
-
const labels =
|
|
1940
|
-
const [apiKeyId, setApiKeyId] =
|
|
1941
|
-
const [privateKey, setPrivateKey] =
|
|
1942
|
-
const [verifying, setVerifying] =
|
|
1943
|
-
const [error, setError] =
|
|
2134
|
+
const labels = useLabels16();
|
|
2135
|
+
const [apiKeyId, setApiKeyId] = useState8("");
|
|
2136
|
+
const [privateKey, setPrivateKey] = useState8("");
|
|
2137
|
+
const [verifying, setVerifying] = useState8(false);
|
|
2138
|
+
const [error, setError] = useState8();
|
|
1944
2139
|
const canVerify = apiKeyId.trim().length > 0 && privateKey.trim().length > 0;
|
|
1945
|
-
const handleCancel =
|
|
2140
|
+
const handleCancel = useCallback5(() => {
|
|
1946
2141
|
onOpenChange(false);
|
|
1947
2142
|
}, [onOpenChange]);
|
|
1948
|
-
const handleVerify =
|
|
2143
|
+
const handleVerify = useCallback5(() => __async(null, null, function* () {
|
|
1949
2144
|
if (!canVerify || verifying) return;
|
|
1950
2145
|
setVerifying(true);
|
|
1951
2146
|
setError(void 0);
|
|
@@ -1974,7 +2169,7 @@ var ConnectKalshiModal = ({
|
|
|
1974
2169
|
privateKey,
|
|
1975
2170
|
verifying
|
|
1976
2171
|
]);
|
|
1977
|
-
const handleOpenChange =
|
|
2172
|
+
const handleOpenChange = useCallback5(
|
|
1978
2173
|
(value) => {
|
|
1979
2174
|
if (value) {
|
|
1980
2175
|
setApiKeyId("");
|
|
@@ -1986,15 +2181,15 @@ var ConnectKalshiModal = ({
|
|
|
1986
2181
|
},
|
|
1987
2182
|
[onOpenChange]
|
|
1988
2183
|
);
|
|
1989
|
-
return /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ jsx23(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs23(
|
|
1990
2185
|
Modal.Container,
|
|
1991
2186
|
{
|
|
1992
2187
|
maxWidth: "600px",
|
|
1993
2188
|
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
1994
2189
|
classNames: { container: "!rounded-agg-lg" },
|
|
1995
2190
|
children: [
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ jsx23(Dialog.Title, { className: "sr-only", children: labels.onboarding.connectKalshiModal.title }),
|
|
2192
|
+
/* @__PURE__ */ jsx23(
|
|
1998
2193
|
Modal.Header,
|
|
1999
2194
|
{
|
|
2000
2195
|
hideClose: false,
|
|
@@ -2005,8 +2200,8 @@ var ConnectKalshiModal = ({
|
|
|
2005
2200
|
}
|
|
2006
2201
|
}
|
|
2007
2202
|
),
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ jsx23(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
2204
|
+
/* @__PURE__ */ jsx23(
|
|
2010
2205
|
VenueLogo,
|
|
2011
2206
|
{
|
|
2012
2207
|
venue: "kalshi",
|
|
@@ -2015,54 +2210,54 @@ var ConnectKalshiModal = ({
|
|
|
2015
2210
|
className: "h-[60px] w-[60px]"
|
|
2016
2211
|
}
|
|
2017
2212
|
),
|
|
2018
|
-
/* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
2214
|
+
/* @__PURE__ */ jsx23("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
|
|
2215
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
|
|
2021
2216
|
] }),
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
/* @__PURE__ */
|
|
2025
|
-
/* @__PURE__ */
|
|
2026
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
2218
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
2219
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-1", children: [
|
|
2220
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
2221
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
2027
2222
|
] }),
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
2030
|
-
/* @__PURE__ */
|
|
2223
|
+
/* @__PURE__ */ jsxs23("div", { className: "space-y-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
2224
|
+
/* @__PURE__ */ jsx23("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
2225
|
+
/* @__PURE__ */ jsxs23("p", { children: [
|
|
2031
2226
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
2032
2227
|
" ",
|
|
2033
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsx23("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
2034
2229
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
2035
2230
|
" ",
|
|
2036
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ jsx23("span", { className: "text-agg-foreground underline", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl })
|
|
2037
2232
|
] }),
|
|
2038
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsxs23("p", { children: [
|
|
2039
2234
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
2040
2235
|
" ",
|
|
2041
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx23("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
2042
2237
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
2043
2238
|
] }),
|
|
2044
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsxs23("p", { children: [
|
|
2045
2240
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
2046
2241
|
" ",
|
|
2047
|
-
/* @__PURE__ */
|
|
2242
|
+
/* @__PURE__ */ jsx23("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
2048
2243
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
2049
2244
|
] }),
|
|
2050
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx23("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
2051
2246
|
] }),
|
|
2052
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ jsxs23("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
2053
2248
|
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
2054
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ jsx23("br", {}),
|
|
2055
2250
|
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
2056
2251
|
] })
|
|
2057
2252
|
] }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2061
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
2254
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-1", children: [
|
|
2255
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
2256
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
2062
2257
|
] }),
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
2259
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-2", children: [
|
|
2260
|
+
/* @__PURE__ */ jsx23(
|
|
2066
2261
|
"label",
|
|
2067
2262
|
{
|
|
2068
2263
|
htmlFor: "kalshi-api-key-id",
|
|
@@ -2070,7 +2265,7 @@ var ConnectKalshiModal = ({
|
|
|
2070
2265
|
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
2071
2266
|
}
|
|
2072
2267
|
),
|
|
2073
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx23(
|
|
2074
2269
|
"input",
|
|
2075
2270
|
{
|
|
2076
2271
|
id: "kalshi-api-key-id",
|
|
@@ -2090,8 +2285,8 @@ var ConnectKalshiModal = ({
|
|
|
2090
2285
|
}
|
|
2091
2286
|
)
|
|
2092
2287
|
] }),
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-2", children: [
|
|
2289
|
+
/* @__PURE__ */ jsx23(
|
|
2095
2290
|
"label",
|
|
2096
2291
|
{
|
|
2097
2292
|
htmlFor: "kalshi-private-key",
|
|
@@ -2099,7 +2294,7 @@ var ConnectKalshiModal = ({
|
|
|
2099
2294
|
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
2100
2295
|
}
|
|
2101
2296
|
),
|
|
2102
|
-
/* @__PURE__ */
|
|
2297
|
+
/* @__PURE__ */ jsx23(
|
|
2103
2298
|
"textarea",
|
|
2104
2299
|
{
|
|
2105
2300
|
id: "kalshi-private-key",
|
|
@@ -2121,42 +2316,42 @@ var ConnectKalshiModal = ({
|
|
|
2121
2316
|
] })
|
|
2122
2317
|
] })
|
|
2123
2318
|
] }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between w-full", children: [
|
|
2320
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
|
|
2321
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-3", children: [
|
|
2322
|
+
/* @__PURE__ */ jsxs23(
|
|
2128
2323
|
"a",
|
|
2129
2324
|
{
|
|
2130
2325
|
href: "#",
|
|
2131
2326
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
2132
2327
|
children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx23(DocumentIcon, { className: "h-4 w-4" }),
|
|
2134
2329
|
labels.onboarding.connectKalshiModal.help.docsLinkLabel
|
|
2135
2330
|
]
|
|
2136
2331
|
}
|
|
2137
2332
|
),
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ jsx23("span", { className: "h-3 w-px bg-agg-separator" }),
|
|
2334
|
+
/* @__PURE__ */ jsxs23(
|
|
2140
2335
|
"a",
|
|
2141
2336
|
{
|
|
2142
2337
|
href: "#",
|
|
2143
2338
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
2144
2339
|
children: [
|
|
2145
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ jsx23(PlaySquareIcon, { className: "h-4 w-4" }),
|
|
2146
2341
|
labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
|
|
2147
2342
|
]
|
|
2148
2343
|
}
|
|
2149
2344
|
)
|
|
2150
2345
|
] })
|
|
2151
2346
|
] }),
|
|
2152
|
-
/* @__PURE__ */
|
|
2153
|
-
error ? /* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-5 items-center", children: [
|
|
2348
|
+
error ? /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
2349
|
+
/* @__PURE__ */ jsx23(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
2350
|
+
/* @__PURE__ */ jsx23("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
2156
2351
|
] }) : null,
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-3 justify-center", children: [
|
|
2353
|
+
/* @__PURE__ */ jsx23(Button, { variant: "secondary", size: "large", onClick: handleCancel, children: labels.onboarding.connectKalshiModal.actions.cancel }),
|
|
2354
|
+
/* @__PURE__ */ jsx23(
|
|
2160
2355
|
Button,
|
|
2161
2356
|
{
|
|
2162
2357
|
variant: "primary",
|
|
@@ -2177,22 +2372,22 @@ var ConnectKalshiModal = ({
|
|
|
2177
2372
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
2178
2373
|
|
|
2179
2374
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
2180
|
-
import { useCallback as
|
|
2181
|
-
import { useLabels as
|
|
2375
|
+
import { useCallback as useCallback6, useState as useState9 } from "react";
|
|
2376
|
+
import { useLabels as useLabels17 } from "@agg-market/hooks";
|
|
2182
2377
|
import * as Dialog2 from "@radix-ui/react-dialog";
|
|
2183
|
-
import { jsx as
|
|
2378
|
+
import { jsx as jsx24, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2184
2379
|
var ConnectOnchainModal = ({
|
|
2185
2380
|
open,
|
|
2186
2381
|
onOpenChange,
|
|
2187
2382
|
onConnect
|
|
2188
2383
|
}) => {
|
|
2189
|
-
const labels =
|
|
2190
|
-
const [connecting, setConnecting] =
|
|
2191
|
-
const [error, setError] =
|
|
2192
|
-
const handleCancel =
|
|
2384
|
+
const labels = useLabels17();
|
|
2385
|
+
const [connecting, setConnecting] = useState9(false);
|
|
2386
|
+
const [error, setError] = useState9();
|
|
2387
|
+
const handleCancel = useCallback6(() => {
|
|
2193
2388
|
onOpenChange(false);
|
|
2194
2389
|
}, [onOpenChange]);
|
|
2195
|
-
const handleConnect =
|
|
2390
|
+
const handleConnect = useCallback6(() => __async(null, null, function* () {
|
|
2196
2391
|
if (connecting) return;
|
|
2197
2392
|
setConnecting(true);
|
|
2198
2393
|
setError(void 0);
|
|
@@ -2207,7 +2402,7 @@ var ConnectOnchainModal = ({
|
|
|
2207
2402
|
setConnecting(false);
|
|
2208
2403
|
}
|
|
2209
2404
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
2210
|
-
const handleOpenChange =
|
|
2405
|
+
const handleOpenChange = useCallback6(
|
|
2211
2406
|
(value) => {
|
|
2212
2407
|
if (value) {
|
|
2213
2408
|
setError(void 0);
|
|
@@ -2217,15 +2412,15 @@ var ConnectOnchainModal = ({
|
|
|
2217
2412
|
},
|
|
2218
2413
|
[onOpenChange]
|
|
2219
2414
|
);
|
|
2220
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ jsx24(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs24(
|
|
2221
2416
|
Modal.Container,
|
|
2222
2417
|
{
|
|
2223
2418
|
maxWidth: "600px",
|
|
2224
2419
|
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
2225
2420
|
classNames: { container: "!rounded-agg-lg" },
|
|
2226
2421
|
children: [
|
|
2227
|
-
/* @__PURE__ */
|
|
2228
|
-
/* @__PURE__ */
|
|
2422
|
+
/* @__PURE__ */ jsx24(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
2423
|
+
/* @__PURE__ */ jsx24(
|
|
2229
2424
|
Modal.Header,
|
|
2230
2425
|
{
|
|
2231
2426
|
hideClose: false,
|
|
@@ -2236,26 +2431,26 @@ var ConnectOnchainModal = ({
|
|
|
2236
2431
|
}
|
|
2237
2432
|
}
|
|
2238
2433
|
),
|
|
2239
|
-
/* @__PURE__ */
|
|
2240
|
-
/* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ jsx24(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
2435
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
2436
|
+
/* @__PURE__ */ jsx24("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
2437
|
+
/* @__PURE__ */ jsx24("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
2243
2438
|
] }),
|
|
2244
|
-
/* @__PURE__ */
|
|
2245
|
-
/* @__PURE__ */
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
index > 0 && /* @__PURE__ */
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
/* @__PURE__ */
|
|
2439
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
2440
|
+
/* @__PURE__ */ jsx24("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
2441
|
+
/* @__PURE__ */ jsx24("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-[6px]", children: [
|
|
2442
|
+
index > 0 && /* @__PURE__ */ jsx24("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
2443
|
+
/* @__PURE__ */ jsx24(VenueLogo, { venue, size: "medium" }),
|
|
2444
|
+
/* @__PURE__ */ jsx24("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
2250
2445
|
] }, venue)) })
|
|
2251
2446
|
] }),
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2254
|
-
error ? /* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2447
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
2448
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
2449
|
+
error ? /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2", children: [
|
|
2450
|
+
/* @__PURE__ */ jsx24(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
2451
|
+
/* @__PURE__ */ jsx24("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
2257
2452
|
] }) : null,
|
|
2258
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx24(
|
|
2259
2454
|
Button,
|
|
2260
2455
|
{
|
|
2261
2456
|
variant: "primary",
|
|
@@ -2266,7 +2461,7 @@ var ConnectOnchainModal = ({
|
|
|
2266
2461
|
}
|
|
2267
2462
|
)
|
|
2268
2463
|
] }),
|
|
2269
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsx24(
|
|
2270
2465
|
Button,
|
|
2271
2466
|
{
|
|
2272
2467
|
variant: "tertiary",
|
|
@@ -2285,7 +2480,7 @@ var ConnectOnchainModal = ({
|
|
|
2285
2480
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
2286
2481
|
|
|
2287
2482
|
// src/onboarding/index.tsx
|
|
2288
|
-
import { Fragment as Fragment13, jsx as
|
|
2483
|
+
import { Fragment as Fragment13, jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2289
2484
|
var OnboardingModal = ({
|
|
2290
2485
|
open,
|
|
2291
2486
|
onOpenChange,
|
|
@@ -2298,68 +2493,68 @@ var OnboardingModal = ({
|
|
|
2298
2493
|
connectedKalshi = false
|
|
2299
2494
|
}) => {
|
|
2300
2495
|
var _a;
|
|
2301
|
-
const labels =
|
|
2302
|
-
const [step, setStep] =
|
|
2496
|
+
const labels = useLabels18();
|
|
2497
|
+
const [step, setStep] = useState10(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
2303
2498
|
const stepLabels = {
|
|
2304
2499
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
2305
2500
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
2306
2501
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
2307
2502
|
};
|
|
2308
2503
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
2309
|
-
const [kalshiModalOpen, setKalshiModalOpen] =
|
|
2310
|
-
const [kalshiConnected, setKalshiConnected] =
|
|
2311
|
-
const [onchainModalOpen, setOnchainModalOpen] =
|
|
2312
|
-
const [onchainConnected, setOnchainConnected] =
|
|
2313
|
-
|
|
2504
|
+
const [kalshiModalOpen, setKalshiModalOpen] = useState10(false);
|
|
2505
|
+
const [kalshiConnected, setKalshiConnected] = useState10(false);
|
|
2506
|
+
const [onchainModalOpen, setOnchainModalOpen] = useState10(false);
|
|
2507
|
+
const [onchainConnected, setOnchainConnected] = useState10(false);
|
|
2508
|
+
useEffect3(() => {
|
|
2314
2509
|
if (open) {
|
|
2315
2510
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
2316
2511
|
setKalshiConnected(false);
|
|
2317
2512
|
setOnchainConnected(false);
|
|
2318
2513
|
}
|
|
2319
2514
|
}, [open]);
|
|
2320
|
-
const handleHowItWorksContinue =
|
|
2515
|
+
const handleHowItWorksContinue = useCallback7(() => {
|
|
2321
2516
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
2322
2517
|
}, []);
|
|
2323
|
-
const handleProfileContinue =
|
|
2518
|
+
const handleProfileContinue = useCallback7(
|
|
2324
2519
|
(data) => {
|
|
2325
2520
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
2326
2521
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
2327
2522
|
},
|
|
2328
2523
|
[onProfileSubmit]
|
|
2329
2524
|
);
|
|
2330
|
-
const handleConnectContinue =
|
|
2525
|
+
const handleConnectContinue = useCallback7(() => {
|
|
2331
2526
|
onComplete == null ? void 0 : onComplete();
|
|
2332
2527
|
}, [onComplete]);
|
|
2333
|
-
const handleOpenOnchainModal =
|
|
2528
|
+
const handleOpenOnchainModal = useCallback7(() => {
|
|
2334
2529
|
setOnchainModalOpen(true);
|
|
2335
2530
|
}, []);
|
|
2336
|
-
const handleOnchainConnect =
|
|
2531
|
+
const handleOnchainConnect = useCallback7(() => __async(null, null, function* () {
|
|
2337
2532
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
2338
2533
|
setOnchainConnected(true);
|
|
2339
2534
|
}), [onConnectOnchain]);
|
|
2340
|
-
const handleOpenKalshiModal =
|
|
2535
|
+
const handleOpenKalshiModal = useCallback7(() => {
|
|
2341
2536
|
setKalshiModalOpen(true);
|
|
2342
2537
|
}, []);
|
|
2343
|
-
const handleKalshiVerify =
|
|
2538
|
+
const handleKalshiVerify = useCallback7(
|
|
2344
2539
|
(credentials) => __async(null, null, function* () {
|
|
2345
2540
|
yield onConnectKalshi == null ? void 0 : onConnectKalshi(credentials);
|
|
2346
2541
|
setKalshiConnected(true);
|
|
2347
2542
|
}),
|
|
2348
2543
|
[onConnectKalshi]
|
|
2349
2544
|
);
|
|
2350
|
-
return /* @__PURE__ */
|
|
2351
|
-
/* @__PURE__ */
|
|
2545
|
+
return /* @__PURE__ */ jsxs25(Fragment13, { children: [
|
|
2546
|
+
/* @__PURE__ */ jsx25(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs25(
|
|
2352
2547
|
Modal.Container,
|
|
2353
2548
|
{
|
|
2354
2549
|
maxWidth: "600px",
|
|
2355
2550
|
"aria-label": resolvedTitle,
|
|
2356
2551
|
classNames: { container: "!rounded-agg-lg" },
|
|
2357
2552
|
children: [
|
|
2358
|
-
/* @__PURE__ */
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */
|
|
2361
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */
|
|
2362
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */
|
|
2553
|
+
/* @__PURE__ */ jsx25(Dialog3.Title, { className: "sr-only", children: resolvedTitle }),
|
|
2554
|
+
/* @__PURE__ */ jsxs25(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
2555
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ jsx25(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
2556
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ jsx25(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
2557
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ jsx25(
|
|
2363
2558
|
ConnectAccountsStep,
|
|
2364
2559
|
{
|
|
2365
2560
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -2373,7 +2568,7 @@ var OnboardingModal = ({
|
|
|
2373
2568
|
]
|
|
2374
2569
|
}
|
|
2375
2570
|
) }),
|
|
2376
|
-
/* @__PURE__ */
|
|
2571
|
+
/* @__PURE__ */ jsx25(
|
|
2377
2572
|
ConnectOnchainModal,
|
|
2378
2573
|
{
|
|
2379
2574
|
open: onchainModalOpen,
|
|
@@ -2381,7 +2576,7 @@ var OnboardingModal = ({
|
|
|
2381
2576
|
onConnect: handleOnchainConnect
|
|
2382
2577
|
}
|
|
2383
2578
|
),
|
|
2384
|
-
/* @__PURE__ */
|
|
2579
|
+
/* @__PURE__ */ jsx25(
|
|
2385
2580
|
ConnectKalshiModal,
|
|
2386
2581
|
{
|
|
2387
2582
|
open: kalshiModalOpen,
|
|
@@ -2394,7 +2589,7 @@ var OnboardingModal = ({
|
|
|
2394
2589
|
OnboardingModal.displayName = "OnboardingModal";
|
|
2395
2590
|
|
|
2396
2591
|
// src/profile/index.tsx
|
|
2397
|
-
import { useState as
|
|
2592
|
+
import { useState as useState11, useEffect as useEffect4, useCallback as useCallback9, useMemo as useMemo2 } from "react";
|
|
2398
2593
|
import { useAggClient, useAggAuthState } from "@agg-market/hooks";
|
|
2399
2594
|
|
|
2400
2595
|
// src/profile/profile-modal.constants.ts
|
|
@@ -2408,9 +2603,9 @@ var PROFILE_TAB_ITEMS = [
|
|
|
2408
2603
|
];
|
|
2409
2604
|
|
|
2410
2605
|
// src/profile/tabs/about-tab.tsx
|
|
2411
|
-
import { useCallback as
|
|
2412
|
-
import { useLabels as
|
|
2413
|
-
import { jsx as
|
|
2606
|
+
import { useCallback as useCallback8, useRef as useRef5 } from "react";
|
|
2607
|
+
import { useLabels as useLabels19 } from "@agg-market/hooks";
|
|
2608
|
+
import { jsx as jsx26, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2414
2609
|
var AboutTab = ({
|
|
2415
2610
|
avatarPreview,
|
|
2416
2611
|
onDeleteProfile: _onDeleteProfile,
|
|
@@ -2419,13 +2614,13 @@ var AboutTab = ({
|
|
|
2419
2614
|
onDraftAvatarChange,
|
|
2420
2615
|
draftAvatarPreview
|
|
2421
2616
|
}) => {
|
|
2422
|
-
const labels =
|
|
2423
|
-
const fileInputRef =
|
|
2424
|
-
const handleAvatarClick =
|
|
2617
|
+
const labels = useLabels19();
|
|
2618
|
+
const fileInputRef = useRef5(null);
|
|
2619
|
+
const handleAvatarClick = useCallback8(() => {
|
|
2425
2620
|
var _a;
|
|
2426
2621
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
2427
2622
|
}, []);
|
|
2428
|
-
const handleFileChange =
|
|
2623
|
+
const handleFileChange = useCallback8(
|
|
2429
2624
|
(e) => {
|
|
2430
2625
|
var _a;
|
|
2431
2626
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
@@ -2441,9 +2636,9 @@ var AboutTab = ({
|
|
|
2441
2636
|
);
|
|
2442
2637
|
const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
|
|
2443
2638
|
const hasAvatarPreview = Boolean(resolvedPreview);
|
|
2444
|
-
return /* @__PURE__ */
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-8", children: [
|
|
2640
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex justify-center", children: [
|
|
2641
|
+
/* @__PURE__ */ jsxs26(
|
|
2447
2642
|
"button",
|
|
2448
2643
|
{
|
|
2449
2644
|
type: "button",
|
|
@@ -2459,13 +2654,13 @@ var AboutTab = ({
|
|
|
2459
2654
|
),
|
|
2460
2655
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
2461
2656
|
children: [
|
|
2462
|
-
!hasAvatarPreview ? /* @__PURE__ */
|
|
2657
|
+
!hasAvatarPreview ? /* @__PURE__ */ jsx26(
|
|
2463
2658
|
"svg",
|
|
2464
2659
|
{
|
|
2465
2660
|
"aria-hidden": true,
|
|
2466
2661
|
viewBox: "0 0 80 80",
|
|
2467
2662
|
className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
|
|
2468
|
-
children: /* @__PURE__ */
|
|
2663
|
+
children: /* @__PURE__ */ jsx26(
|
|
2469
2664
|
"circle",
|
|
2470
2665
|
{
|
|
2471
2666
|
cx: "40",
|
|
@@ -2479,18 +2674,18 @@ var AboutTab = ({
|
|
|
2479
2674
|
)
|
|
2480
2675
|
}
|
|
2481
2676
|
) : null,
|
|
2482
|
-
resolvedPreview ? /* @__PURE__ */
|
|
2677
|
+
resolvedPreview ? /* @__PURE__ */ jsx26(
|
|
2483
2678
|
RemoteImage,
|
|
2484
2679
|
{
|
|
2485
2680
|
src: resolvedPreview,
|
|
2486
2681
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
2487
2682
|
className: "h-full w-full object-cover"
|
|
2488
2683
|
}
|
|
2489
|
-
) : /* @__PURE__ */
|
|
2684
|
+
) : /* @__PURE__ */ jsx26(ProfileIcon, { className: "h-8 w-8 text-agg-muted-foreground" })
|
|
2490
2685
|
]
|
|
2491
2686
|
}
|
|
2492
2687
|
),
|
|
2493
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ jsx26(
|
|
2494
2689
|
"input",
|
|
2495
2690
|
{
|
|
2496
2691
|
ref: fileInputRef,
|
|
@@ -2502,8 +2697,8 @@ var AboutTab = ({
|
|
|
2502
2697
|
}
|
|
2503
2698
|
)
|
|
2504
2699
|
] }),
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-2", children: [
|
|
2701
|
+
/* @__PURE__ */ jsx26(
|
|
2507
2702
|
"label",
|
|
2508
2703
|
{
|
|
2509
2704
|
htmlFor: "profile-username",
|
|
@@ -2511,7 +2706,7 @@ var AboutTab = ({
|
|
|
2511
2706
|
children: "Username"
|
|
2512
2707
|
}
|
|
2513
2708
|
),
|
|
2514
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ jsx26(
|
|
2515
2710
|
"input",
|
|
2516
2711
|
{
|
|
2517
2712
|
id: "profile-username",
|
|
@@ -2538,9 +2733,9 @@ var AboutTab = ({
|
|
|
2538
2733
|
AboutTab.displayName = "AboutTab";
|
|
2539
2734
|
|
|
2540
2735
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
2541
|
-
import { jsx as
|
|
2542
|
-
var SectionTitle = ({ children }) => /* @__PURE__ */
|
|
2543
|
-
var AccountRow = ({ children, className }) => /* @__PURE__ */
|
|
2736
|
+
import { jsx as jsx27, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2737
|
+
var SectionTitle = ({ children }) => /* @__PURE__ */ jsx27("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
2738
|
+
var AccountRow = ({ children, className }) => /* @__PURE__ */ jsx27(
|
|
2544
2739
|
"div",
|
|
2545
2740
|
{
|
|
2546
2741
|
className: cn(
|
|
@@ -2552,7 +2747,7 @@ var AccountRow = ({ children, className }) => /* @__PURE__ */ jsx24(
|
|
|
2552
2747
|
children
|
|
2553
2748
|
}
|
|
2554
2749
|
);
|
|
2555
|
-
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */
|
|
2750
|
+
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx27(
|
|
2556
2751
|
"button",
|
|
2557
2752
|
{
|
|
2558
2753
|
type: "button",
|
|
@@ -2561,7 +2756,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx24(
|
|
|
2561
2756
|
children: "Connect"
|
|
2562
2757
|
}
|
|
2563
2758
|
);
|
|
2564
|
-
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */
|
|
2759
|
+
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx27(
|
|
2565
2760
|
"button",
|
|
2566
2761
|
{
|
|
2567
2762
|
type: "button",
|
|
@@ -2584,19 +2779,19 @@ var AccountsWalletsTab = ({
|
|
|
2584
2779
|
onConnectEmail
|
|
2585
2780
|
}) => {
|
|
2586
2781
|
const twitter = socialAccounts == null ? void 0 : socialAccounts.twitter;
|
|
2587
|
-
return /* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
exchanges.length === 0 ? /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-8", children: [
|
|
2783
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-3", children: [
|
|
2784
|
+
/* @__PURE__ */ jsx27(SectionTitle, { children: "Exchanges" }),
|
|
2785
|
+
exchanges.length === 0 ? /* @__PURE__ */ jsx27("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: "No exchange accounts connected." }) : /* @__PURE__ */ jsx27("div", { className: "flex flex-col gap-2", children: exchanges.map((account) => {
|
|
2591
2786
|
var _a;
|
|
2592
2787
|
const displayName = (_a = venueLogoLabels[account.venue]) != null ? _a : account.venue;
|
|
2593
|
-
return /* @__PURE__ */
|
|
2594
|
-
/* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2596
|
-
/* @__PURE__ */
|
|
2597
|
-
/* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
account.verified ? /* @__PURE__ */
|
|
2788
|
+
return /* @__PURE__ */ jsxs27(AccountRow, { children: [
|
|
2789
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2790
|
+
/* @__PURE__ */ jsx27(VenueLogo, { venue: account.venue, size: "small" }),
|
|
2791
|
+
/* @__PURE__ */ jsx27("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: displayName }),
|
|
2792
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
2793
|
+
/* @__PURE__ */ jsx27("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: account.displayAddress }),
|
|
2794
|
+
account.verified ? /* @__PURE__ */ jsx27(
|
|
2600
2795
|
Icon,
|
|
2601
2796
|
{
|
|
2602
2797
|
name: "check-badge",
|
|
@@ -2606,23 +2801,23 @@ var AccountsWalletsTab = ({
|
|
|
2606
2801
|
) : null
|
|
2607
2802
|
] })
|
|
2608
2803
|
] }),
|
|
2609
|
-
/* @__PURE__ */
|
|
2804
|
+
/* @__PURE__ */ jsx27(DisconnectTextButton, { onClick: () => onDisconnectExchange(account.venue) })
|
|
2610
2805
|
] }, account.venue);
|
|
2611
2806
|
}) })
|
|
2612
2807
|
] }),
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */
|
|
2618
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-3", children: [
|
|
2809
|
+
/* @__PURE__ */ jsx27(SectionTitle, { children: "Social Accounts" }),
|
|
2810
|
+
/* @__PURE__ */ jsx27("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs27(AccountRow, { children: [
|
|
2811
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
2812
|
+
/* @__PURE__ */ jsx27("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ jsx27(Icon, { name: "twitter", size: "small", color: "currentColor" }) }),
|
|
2813
|
+
/* @__PURE__ */ jsx27("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "X (Twitter)" })
|
|
2619
2814
|
] }),
|
|
2620
|
-
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */
|
|
2815
|
+
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */ jsx27(DisconnectTextButton, { onClick: onDisconnectTwitter }) : /* @__PURE__ */ jsx27(ConnectTextButton, { onClick: onConnectTwitter })
|
|
2621
2816
|
] }) })
|
|
2622
2817
|
] }),
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-3", children: [
|
|
2819
|
+
/* @__PURE__ */ jsx27(SectionTitle, { children: "Email Address" }),
|
|
2820
|
+
/* @__PURE__ */ jsxs27(
|
|
2626
2821
|
"button",
|
|
2627
2822
|
{
|
|
2628
2823
|
type: "button",
|
|
@@ -2634,11 +2829,11 @@ var AccountsWalletsTab = ({
|
|
|
2634
2829
|
"cursor-pointer hover:bg-agg-secondary-hover"
|
|
2635
2830
|
),
|
|
2636
2831
|
children: [
|
|
2637
|
-
/* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
/* @__PURE__ */
|
|
2832
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
2833
|
+
/* @__PURE__ */ jsx27("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ jsx27(Icon, { name: "email", size: "small", color: "currentColor" }) }),
|
|
2834
|
+
/* @__PURE__ */ jsx27("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: email != null ? email : "Connect email" })
|
|
2640
2835
|
] }),
|
|
2641
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx27(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
2642
2837
|
]
|
|
2643
2838
|
}
|
|
2644
2839
|
)
|
|
@@ -2648,7 +2843,7 @@ var AccountsWalletsTab = ({
|
|
|
2648
2843
|
AccountsWalletsTab.displayName = "AccountsWalletsTab";
|
|
2649
2844
|
|
|
2650
2845
|
// src/profile/index.tsx
|
|
2651
|
-
import { jsx as
|
|
2846
|
+
import { jsx as jsx28, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2652
2847
|
var ProfileModal = ({
|
|
2653
2848
|
open,
|
|
2654
2849
|
onOpenChange,
|
|
@@ -2671,15 +2866,15 @@ var ProfileModal = ({
|
|
|
2671
2866
|
var _a, _b, _c, _d, _e, _f;
|
|
2672
2867
|
const client = useAggClient();
|
|
2673
2868
|
const { user, startAuth } = useAggAuthState();
|
|
2674
|
-
const [activeTab, setActiveTab] =
|
|
2675
|
-
const [draftUsername, setDraftUsername] =
|
|
2676
|
-
const [draftAvatarFile, setDraftAvatarFile] =
|
|
2677
|
-
const [draftAvatarPreview, setDraftAvatarPreview] =
|
|
2678
|
-
const [isSaving, setIsSaving] =
|
|
2679
|
-
|
|
2869
|
+
const [activeTab, setActiveTab] = useState11(PROFILE_TAB_KEYS.ABOUT);
|
|
2870
|
+
const [draftUsername, setDraftUsername] = useState11(username != null ? username : "");
|
|
2871
|
+
const [draftAvatarFile, setDraftAvatarFile] = useState11();
|
|
2872
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = useState11();
|
|
2873
|
+
const [isSaving, setIsSaving] = useState11(false);
|
|
2874
|
+
useEffect4(() => {
|
|
2680
2875
|
setDraftUsername(username != null ? username : "");
|
|
2681
2876
|
}, [username]);
|
|
2682
|
-
const handleOpenChange =
|
|
2877
|
+
const handleOpenChange = useCallback9(
|
|
2683
2878
|
(isOpen) => {
|
|
2684
2879
|
if (!isOpen) {
|
|
2685
2880
|
setActiveTab(PROFILE_TAB_KEYS.ABOUT);
|
|
@@ -2700,7 +2895,7 @@ var ProfileModal = ({
|
|
|
2700
2895
|
setDraftAvatarPreview
|
|
2701
2896
|
]
|
|
2702
2897
|
);
|
|
2703
|
-
const handleDraftAvatarChange =
|
|
2898
|
+
const handleDraftAvatarChange = useCallback9(
|
|
2704
2899
|
(file, preview) => {
|
|
2705
2900
|
setDraftAvatarFile(file);
|
|
2706
2901
|
setDraftAvatarPreview(preview);
|
|
@@ -2708,7 +2903,7 @@ var ProfileModal = ({
|
|
|
2708
2903
|
[]
|
|
2709
2904
|
);
|
|
2710
2905
|
const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
|
|
2711
|
-
const handleSave =
|
|
2906
|
+
const handleSave = useCallback9(() => __async(null, null, function* () {
|
|
2712
2907
|
setIsSaving(true);
|
|
2713
2908
|
try {
|
|
2714
2909
|
const normalizedUsername = draftUsername.trim();
|
|
@@ -2737,7 +2932,7 @@ var ProfileModal = ({
|
|
|
2737
2932
|
setIsSaving(false);
|
|
2738
2933
|
}
|
|
2739
2934
|
}), [client, draftAvatarFile, draftAvatarPreview, draftUsername, onOpenChange, onSave, username]);
|
|
2740
|
-
const handleCancel =
|
|
2935
|
+
const handleCancel = useCallback9(() => {
|
|
2741
2936
|
handleOpenChange(false);
|
|
2742
2937
|
}, [handleOpenChange]);
|
|
2743
2938
|
const isAccountConnected = (providers) => {
|
|
@@ -2770,7 +2965,7 @@ var ProfileModal = ({
|
|
|
2770
2965
|
if (typeof window === "undefined") return "http://localhost";
|
|
2771
2966
|
return `${window.location.origin}${window.location.pathname}${window.location.search}`;
|
|
2772
2967
|
};
|
|
2773
|
-
const handleConnectTwitter =
|
|
2968
|
+
const handleConnectTwitter = useCallback9(() => __async(null, null, function* () {
|
|
2774
2969
|
const result = yield startAuth({
|
|
2775
2970
|
provider: "twitter",
|
|
2776
2971
|
redirectUrl: resolveRedirectUrl()
|
|
@@ -2780,12 +2975,12 @@ var ProfileModal = ({
|
|
|
2780
2975
|
window.location.assign(result.url);
|
|
2781
2976
|
}
|
|
2782
2977
|
}), [onConnectTwitter, startAuth]);
|
|
2783
|
-
const handleDisconnectTwitter =
|
|
2978
|
+
const handleDisconnectTwitter = useCallback9(() => __async(null, null, function* () {
|
|
2784
2979
|
yield client.disconnectAccount("twitter");
|
|
2785
2980
|
yield client.getCurrentUser();
|
|
2786
2981
|
onDisconnectTwitter == null ? void 0 : onDisconnectTwitter();
|
|
2787
2982
|
}), [client, onDisconnectTwitter]);
|
|
2788
|
-
const handleConnectEmail =
|
|
2983
|
+
const handleConnectEmail = useCallback9(() => __async(null, null, function* () {
|
|
2789
2984
|
var _a2;
|
|
2790
2985
|
const typedEmail = typeof window !== "undefined" ? (_a2 = window.prompt("Enter your email to receive a magic link")) == null ? void 0 : _a2.trim() : void 0;
|
|
2791
2986
|
if (!typedEmail) return;
|
|
@@ -2814,13 +3009,13 @@ var ProfileModal = ({
|
|
|
2814
3009
|
}),
|
|
2815
3010
|
[handleConnectEmail, handleConnectTwitter, handleDisconnectTwitter]
|
|
2816
3011
|
);
|
|
2817
|
-
return /* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
3012
|
+
return /* @__PURE__ */ jsx28(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs28(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
|
|
3013
|
+
/* @__PURE__ */ jsx28(Modal.Header, { title: "Edit Profile" }),
|
|
3014
|
+
/* @__PURE__ */ jsx28(Modal.Body, { children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
|
|
3015
|
+
/* @__PURE__ */ jsxs28("div", { className: "shrink-0", children: [
|
|
3016
|
+
/* @__PURE__ */ jsx28("div", { className: "flex gap-2 sm:hidden mb-6", children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
2822
3017
|
const isActive = activeTab === tab.value;
|
|
2823
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ jsxs28(
|
|
2824
3019
|
"button",
|
|
2825
3020
|
{
|
|
2826
3021
|
type: "button",
|
|
@@ -2833,14 +3028,14 @@ var ProfileModal = ({
|
|
|
2833
3028
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover border-agg-primary" : "font-agg-normal text-agg-foreground border-transparent"
|
|
2834
3029
|
),
|
|
2835
3030
|
children: [
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ jsx28(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
3032
|
+
/* @__PURE__ */ jsx28("span", { className: "whitespace-nowrap", children: tab.label })
|
|
2838
3033
|
]
|
|
2839
3034
|
},
|
|
2840
3035
|
tab.value
|
|
2841
3036
|
);
|
|
2842
3037
|
}) }),
|
|
2843
|
-
/* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ jsx28(
|
|
2844
3039
|
"nav",
|
|
2845
3040
|
{
|
|
2846
3041
|
className: cn(
|
|
@@ -2855,7 +3050,7 @@ var ProfileModal = ({
|
|
|
2855
3050
|
"aria-label": "Profile sections",
|
|
2856
3051
|
children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
2857
3052
|
const isActive = activeTab === tab.value;
|
|
2858
|
-
return /* @__PURE__ */
|
|
3053
|
+
return /* @__PURE__ */ jsxs28(
|
|
2859
3054
|
"button",
|
|
2860
3055
|
{
|
|
2861
3056
|
type: "button",
|
|
@@ -2870,9 +3065,9 @@ var ProfileModal = ({
|
|
|
2870
3065
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
2871
3066
|
),
|
|
2872
3067
|
children: [
|
|
2873
|
-
isActive ? /* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
3068
|
+
isActive ? /* @__PURE__ */ jsx28("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
3069
|
+
/* @__PURE__ */ jsx28(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
3070
|
+
/* @__PURE__ */ jsx28("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
2876
3071
|
]
|
|
2877
3072
|
},
|
|
2878
3073
|
tab.value
|
|
@@ -2881,8 +3076,8 @@ var ProfileModal = ({
|
|
|
2881
3076
|
}
|
|
2882
3077
|
)
|
|
2883
3078
|
] }),
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsxs28("div", { className: "min-w-0 flex-1", children: [
|
|
3080
|
+
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */ jsx28(
|
|
2886
3081
|
AboutTab,
|
|
2887
3082
|
{
|
|
2888
3083
|
username,
|
|
@@ -2895,7 +3090,7 @@ var ProfileModal = ({
|
|
|
2895
3090
|
draftAvatarPreview
|
|
2896
3091
|
}
|
|
2897
3092
|
) : null,
|
|
2898
|
-
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */
|
|
3093
|
+
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */ jsx28(
|
|
2899
3094
|
AccountsWalletsTab,
|
|
2900
3095
|
{
|
|
2901
3096
|
exchanges,
|
|
@@ -2913,9 +3108,9 @@ var ProfileModal = ({
|
|
|
2913
3108
|
) : null
|
|
2914
3109
|
] })
|
|
2915
3110
|
] }) }),
|
|
2916
|
-
/* @__PURE__ */
|
|
2917
|
-
/* @__PURE__ */
|
|
2918
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsxs28(Modal.Footer, { children: [
|
|
3112
|
+
/* @__PURE__ */ jsx28(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
3113
|
+
/* @__PURE__ */ jsx28(
|
|
2919
3114
|
Button,
|
|
2920
3115
|
{
|
|
2921
3116
|
variant: "primary",
|