@agg-market/ui 9.0.0 → 10.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-N7U7QCSB.mjs → chunk-55YYUTBK.mjs} +807 -358
- package/dist/{chunk-3U4VHAP6.mjs → chunk-5G4T5R2H.mjs} +6 -2
- package/dist/{chunk-6CRY27SQ.mjs → chunk-GYOCLZGH.mjs} +538 -418
- package/dist/{chunk-HJ4UPYM7.mjs → chunk-RYQSVETG.mjs} +201 -165
- package/dist/{chunk-3G7C6WEC.mjs → chunk-XP7DREIX.mjs} +47 -15
- package/dist/events.js +575 -429
- package/dist/events.mjs +6 -4
- package/dist/index.js +1577 -948
- package/dist/index.mjs +10 -6
- package/dist/modals.js +1185 -374
- package/dist/modals.mjs +4 -2
- package/dist/pages.js +1400 -1010
- package/dist/pages.mjs +4 -4
- package/dist/primitives.js +46 -14
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +20 -4
- package/dist/trading.mjs +2 -2
- package/dist/types/events/item/event-list-item.types.d.mts +1 -2
- package/dist/types/events/item/event-list-item.types.d.ts +1 -2
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +1 -4
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +1 -4
- package/dist/types/events/item-details/event-list-item-details.utils.d.mts +42 -3
- package/dist/types/events/item-details/event-list-item-details.utils.d.ts +42 -3
- package/dist/types/events/list/event-list.types.d.mts +2 -1
- package/dist/types/events/list/event-list.types.d.ts +2 -1
- package/dist/types/events/list/index.d.mts +1 -1
- package/dist/types/events/list/index.d.ts +1 -1
- package/dist/types/events/market-details/index.d.mts +6 -2
- package/dist/types/events/market-details/index.d.ts +6 -2
- package/dist/types/events/market-details/market-details.types.d.mts +33 -9
- package/dist/types/events/market-details/market-details.types.d.ts +33 -9
- package/dist/types/events/market-details/market-details.utils.d.mts +15 -10
- package/dist/types/events/market-details/market-details.utils.d.ts +15 -10
- package/dist/types/modals/index.d.mts +1 -0
- package/dist/types/modals/index.d.ts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +2 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +2 -0
- package/dist/types/pages/home/home.constants.d.mts +1 -3
- package/dist/types/pages/home/home.constants.d.ts +1 -3
- package/dist/types/pages/home/home.types.d.mts +0 -2
- package/dist/types/pages/home/home.types.d.ts +0 -2
- package/dist/types/pages/home/home.utils.d.mts +4 -0
- package/dist/types/pages/home/home.utils.d.ts +4 -0
- package/dist/types/pages/home/index.d.mts +1 -1
- package/dist/types/pages/home/index.d.ts +1 -1
- package/dist/types/primitives/chart/index.d.mts +9 -1
- package/dist/types/primitives/chart/index.d.ts +9 -1
- package/dist/types/primitives/venue-logo/index.d.mts +1 -1
- package/dist/types/primitives/venue-logo/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/modals.js
CHANGED
|
@@ -85,6 +85,7 @@ __export(modals_exports, {
|
|
|
85
85
|
DepositModal: () => DepositModal,
|
|
86
86
|
HowItWorksStep: () => HowItWorksStep,
|
|
87
87
|
OnboardingModal: () => OnboardingModal,
|
|
88
|
+
OnrampModal: () => OnrampModal,
|
|
88
89
|
ProfileModal: () => ProfileModal,
|
|
89
90
|
ProfileSetupStep: () => ProfileSetupStep,
|
|
90
91
|
WithdrawModal: () => WithdrawModal
|
|
@@ -2549,9 +2550,12 @@ var VenueLogo = ({
|
|
|
2549
2550
|
title
|
|
2550
2551
|
}) => {
|
|
2551
2552
|
var _a;
|
|
2553
|
+
const { showVenueLogo = true } = (0, import_hooks4.useAggUiConfig)();
|
|
2552
2554
|
const labels = (0, import_hooks4.useLabels)();
|
|
2553
2555
|
const sizeClass = sizeClasses[size];
|
|
2554
2556
|
const resolvedLabel = (_a = ariaLabel != null ? ariaLabel : labels.venues[venue]) != null ? _a : venueLogoLabels[venue];
|
|
2557
|
+
if (!showVenueLogo)
|
|
2558
|
+
return null;
|
|
2555
2559
|
if (variant === "logo") {
|
|
2556
2560
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2557
2561
|
RemoteImage,
|
|
@@ -3367,20 +3371,824 @@ var DepositModal = ({
|
|
|
3367
3371
|
};
|
|
3368
3372
|
DepositModal.displayName = "DepositModal";
|
|
3369
3373
|
|
|
3370
|
-
// src/
|
|
3374
|
+
// src/onramp/index.tsx
|
|
3375
|
+
var import_react8 = require("react");
|
|
3376
|
+
|
|
3377
|
+
// src/onramp/steps/quote-form.tsx
|
|
3378
|
+
var import_react6 = require("react");
|
|
3379
|
+
|
|
3380
|
+
// src/onramp/onramp-modal.constants.ts
|
|
3381
|
+
var FIAT_OPTIONS = [
|
|
3382
|
+
{ value: "USD", label: "USD" },
|
|
3383
|
+
{ value: "EUR", label: "EUR" },
|
|
3384
|
+
{ value: "GBP", label: "GBP" }
|
|
3385
|
+
];
|
|
3386
|
+
var FIAT_SYMBOLS = {
|
|
3387
|
+
USD: "$",
|
|
3388
|
+
EUR: "\u20AC",
|
|
3389
|
+
GBP: "\xA3"
|
|
3390
|
+
};
|
|
3391
|
+
var CRYPTO_OPTIONS = [
|
|
3392
|
+
{ value: "USDC", label: "USDC (Ethereum)" },
|
|
3393
|
+
{ value: "USDC_BASE", label: "USDC (Base)" },
|
|
3394
|
+
{ value: "USDC_SOLANA", label: "USDC (Solana)" },
|
|
3395
|
+
{ value: "USDC_POLYGON", label: "USDC (Polygon)" },
|
|
3396
|
+
{ value: "USDC_ARBITRUM", label: "USDC (Arbitrum)" }
|
|
3397
|
+
];
|
|
3398
|
+
|
|
3399
|
+
// src/onramp/steps/quote-form.tsx
|
|
3400
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3401
|
+
var QuoteFormStep = ({
|
|
3402
|
+
title,
|
|
3403
|
+
values,
|
|
3404
|
+
onAmountChange,
|
|
3405
|
+
onFiatChange,
|
|
3406
|
+
onCryptoChange,
|
|
3407
|
+
onWalletAddressChange,
|
|
3408
|
+
onSubmit
|
|
3409
|
+
}) => {
|
|
3410
|
+
var _a;
|
|
3411
|
+
const numericAmount = Number(values.amount) || 0;
|
|
3412
|
+
const isFormValid = numericAmount > 0 && values.walletAddress.length > 0;
|
|
3413
|
+
const handleAmountChange = (0, import_react6.useCallback)(
|
|
3414
|
+
(e) => {
|
|
3415
|
+
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
3416
|
+
const parts = v.split(".");
|
|
3417
|
+
onAmountChange(parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v);
|
|
3418
|
+
},
|
|
3419
|
+
[onAmountChange]
|
|
3420
|
+
);
|
|
3421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Modal.Header, { title, hideBorder: true }),
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "You pay" }),
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3428
|
+
Select,
|
|
3429
|
+
{
|
|
3430
|
+
items: FIAT_OPTIONS,
|
|
3431
|
+
value: values.fiatCurrency,
|
|
3432
|
+
onChange: onFiatChange,
|
|
3433
|
+
ariaLabel: "Fiat currency",
|
|
3434
|
+
className: "w-auto"
|
|
3435
|
+
}
|
|
3436
|
+
) }),
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-baseline", children: [
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "agg-type-display text-agg-foreground", children: (_a = FIAT_SYMBOLS[values.fiatCurrency]) != null ? _a : "$" }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3440
|
+
"input",
|
|
3441
|
+
{
|
|
3442
|
+
type: "text",
|
|
3443
|
+
inputMode: "decimal",
|
|
3444
|
+
"aria-label": "Amount",
|
|
3445
|
+
className: cn(
|
|
3446
|
+
"agg-type-display w-full bg-transparent outline-none",
|
|
3447
|
+
numericAmount > 0 ? "text-agg-foreground" : "text-agg-muted-foreground"
|
|
3448
|
+
),
|
|
3449
|
+
placeholder: "0",
|
|
3450
|
+
value: values.amount ? formatAmountDisplay(values.amount) : "",
|
|
3451
|
+
onChange: handleAmountChange
|
|
3452
|
+
}
|
|
3453
|
+
)
|
|
3454
|
+
] }) })
|
|
3455
|
+
] })
|
|
3456
|
+
] }),
|
|
3457
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "border-t border-agg-separator" }),
|
|
3458
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3459
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "You receive" }),
|
|
3460
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3461
|
+
Select,
|
|
3462
|
+
{
|
|
3463
|
+
items: CRYPTO_OPTIONS,
|
|
3464
|
+
value: values.cryptoCurrency,
|
|
3465
|
+
onChange: onCryptoChange,
|
|
3466
|
+
ariaLabel: "Cryptocurrency"
|
|
3467
|
+
}
|
|
3468
|
+
)
|
|
3469
|
+
] }),
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "border-t border-agg-separator" }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: "Destination wallet" }),
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3474
|
+
"input",
|
|
3475
|
+
{
|
|
3476
|
+
type: "text",
|
|
3477
|
+
"aria-label": "Wallet address",
|
|
3478
|
+
className: cn(
|
|
3479
|
+
"w-full rounded-agg-md border border-agg-separator bg-agg-secondary",
|
|
3480
|
+
"px-4 py-2 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
|
|
3481
|
+
"placeholder:text-agg-muted-foreground",
|
|
3482
|
+
"transition-[border-color,box-shadow] duration-200 ease-in-out",
|
|
3483
|
+
"focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15"
|
|
3484
|
+
),
|
|
3485
|
+
placeholder: "0x...",
|
|
3486
|
+
value: values.walletAddress,
|
|
3487
|
+
onChange: (e) => onWalletAddressChange(e.target.value)
|
|
3488
|
+
}
|
|
3489
|
+
)
|
|
3490
|
+
] }),
|
|
3491
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3492
|
+
Button,
|
|
3493
|
+
{
|
|
3494
|
+
variant: "primary",
|
|
3495
|
+
size: "large",
|
|
3496
|
+
className: "w-full",
|
|
3497
|
+
disabled: !isFormValid,
|
|
3498
|
+
onClick: onSubmit,
|
|
3499
|
+
children: "Get Quotes"
|
|
3500
|
+
}
|
|
3501
|
+
)
|
|
3502
|
+
] }) })
|
|
3503
|
+
] });
|
|
3504
|
+
};
|
|
3505
|
+
|
|
3506
|
+
// src/primitives/loading-icon/index.tsx
|
|
3507
|
+
var import_hooks6 = require("@agg-market/hooks");
|
|
3508
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3509
|
+
var LoadingIcon = ({
|
|
3510
|
+
size = "medium",
|
|
3511
|
+
className,
|
|
3512
|
+
ariaLabel
|
|
3513
|
+
}) => {
|
|
3514
|
+
const labels = (0, import_hooks6.useLabels)();
|
|
3515
|
+
const { enableAnimations } = (0, import_hooks6.useSdkUiConfig)();
|
|
3516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3517
|
+
"span",
|
|
3518
|
+
{
|
|
3519
|
+
role: "status",
|
|
3520
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
|
|
3521
|
+
className: cn(
|
|
3522
|
+
"group/agg-loading-icon",
|
|
3523
|
+
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
3524
|
+
className
|
|
3525
|
+
),
|
|
3526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { viewBox: "0 0 44 44", className: cn("block", iconSizeClasses[size]), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("g", { children: [
|
|
3527
|
+
enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3528
|
+
"animateTransform",
|
|
3529
|
+
{
|
|
3530
|
+
attributeName: "transform",
|
|
3531
|
+
attributeType: "XML",
|
|
3532
|
+
type: "rotate",
|
|
3533
|
+
from: "0 22 22",
|
|
3534
|
+
to: "360 22 22",
|
|
3535
|
+
dur: "1.4s",
|
|
3536
|
+
repeatCount: "indefinite"
|
|
3537
|
+
}
|
|
3538
|
+
) : null,
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3540
|
+
"circle",
|
|
3541
|
+
{
|
|
3542
|
+
cx: "22",
|
|
3543
|
+
cy: "22",
|
|
3544
|
+
r: "16",
|
|
3545
|
+
fill: "none",
|
|
3546
|
+
stroke: "currentColor",
|
|
3547
|
+
strokeWidth: "6",
|
|
3548
|
+
strokeLinecap: "round",
|
|
3549
|
+
strokeDasharray: "60 100",
|
|
3550
|
+
strokeDashoffset: "0",
|
|
3551
|
+
children: enableAnimations ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
3552
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3553
|
+
"animate",
|
|
3554
|
+
{
|
|
3555
|
+
attributeName: "stroke-dasharray",
|
|
3556
|
+
values: "1 100;60 100;1 100",
|
|
3557
|
+
dur: "1.2s",
|
|
3558
|
+
repeatCount: "indefinite"
|
|
3559
|
+
}
|
|
3560
|
+
),
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3562
|
+
"animate",
|
|
3563
|
+
{
|
|
3564
|
+
attributeName: "stroke-dashoffset",
|
|
3565
|
+
values: "0;-25;-100",
|
|
3566
|
+
dur: "1.2s",
|
|
3567
|
+
repeatCount: "indefinite"
|
|
3568
|
+
}
|
|
3569
|
+
)
|
|
3570
|
+
] }) : null
|
|
3571
|
+
}
|
|
3572
|
+
)
|
|
3573
|
+
] }) }) })
|
|
3574
|
+
}
|
|
3575
|
+
);
|
|
3576
|
+
};
|
|
3577
|
+
LoadingIcon.displayName = "LoadingIcon";
|
|
3578
|
+
|
|
3579
|
+
// src/primitives/inline-alert/index.tsx
|
|
3580
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3581
|
+
var toneIconName = {
|
|
3582
|
+
error: "error-filled",
|
|
3583
|
+
warning: "warning-filled"
|
|
3584
|
+
};
|
|
3585
|
+
var toneIconClassName = {
|
|
3586
|
+
error: "text-agg-error",
|
|
3587
|
+
warning: "text-agg-warning"
|
|
3588
|
+
};
|
|
3589
|
+
var surfaceClassNames = {
|
|
3590
|
+
error: "rounded-agg-lg bg-agg-status-error-surface px-3 py-2.5",
|
|
3591
|
+
warning: "rounded-agg-lg border border-agg-separator bg-agg-secondary-hover px-3 py-2.5"
|
|
3592
|
+
};
|
|
3593
|
+
var liveRegionConfig = {
|
|
3594
|
+
error: {
|
|
3595
|
+
role: "alert",
|
|
3596
|
+
ariaLive: "assertive"
|
|
3597
|
+
},
|
|
3598
|
+
warning: {
|
|
3599
|
+
role: "status",
|
|
3600
|
+
ariaLive: "polite"
|
|
3601
|
+
}
|
|
3602
|
+
};
|
|
3603
|
+
var resolveVariant = ({
|
|
3604
|
+
tone,
|
|
3605
|
+
variant
|
|
3606
|
+
}) => {
|
|
3607
|
+
if (variant)
|
|
3608
|
+
return variant;
|
|
3609
|
+
return tone === "error" ? "surface" : "plain";
|
|
3610
|
+
};
|
|
3611
|
+
var InlineAlert = ({
|
|
3612
|
+
tone = "error",
|
|
3613
|
+
variant,
|
|
3614
|
+
title,
|
|
3615
|
+
message,
|
|
3616
|
+
actionLabel,
|
|
3617
|
+
onAction,
|
|
3618
|
+
className,
|
|
3619
|
+
"aria-label": ariaLabel
|
|
3620
|
+
}) => {
|
|
3621
|
+
const resolvedVariant = resolveVariant({
|
|
3622
|
+
tone,
|
|
3623
|
+
variant
|
|
3624
|
+
});
|
|
3625
|
+
const hasAction = !!actionLabel && !!onAction;
|
|
3626
|
+
const { ariaLive, role } = liveRegionConfig[tone];
|
|
3627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
3628
|
+
"div",
|
|
3629
|
+
{
|
|
3630
|
+
className: cn(
|
|
3631
|
+
"flex w-full gap-3",
|
|
3632
|
+
resolvedVariant === "plain" ? "items-center justify-center" : "items-start",
|
|
3633
|
+
resolvedVariant === "surface" ? surfaceClassNames[tone] : null,
|
|
3634
|
+
className
|
|
3635
|
+
),
|
|
3636
|
+
role,
|
|
3637
|
+
"aria-live": ariaLive,
|
|
3638
|
+
"aria-label": ariaLabel,
|
|
3639
|
+
children: [
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3641
|
+
Icon,
|
|
3642
|
+
{
|
|
3643
|
+
name: toneIconName[tone],
|
|
3644
|
+
className: cn("h-4 w-4 shrink-0", toneIconClassName[tone]),
|
|
3645
|
+
"aria-hidden": "true"
|
|
3646
|
+
}
|
|
3647
|
+
),
|
|
3648
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3649
|
+
"div",
|
|
3650
|
+
{
|
|
3651
|
+
className: cn(
|
|
3652
|
+
"min-w-0",
|
|
3653
|
+
resolvedVariant === "plain" && !hasAction ? "flex-none text-center" : "flex-1"
|
|
3654
|
+
),
|
|
3655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
3656
|
+
"div",
|
|
3657
|
+
{
|
|
3658
|
+
className: cn(
|
|
3659
|
+
"flex flex-col",
|
|
3660
|
+
title ? "gap-1" : null,
|
|
3661
|
+
resolvedVariant === "plain" && !hasAction ? "items-center" : null
|
|
3662
|
+
),
|
|
3663
|
+
children: [
|
|
3664
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: title }) : null,
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: message })
|
|
3666
|
+
]
|
|
3667
|
+
}
|
|
3668
|
+
)
|
|
3669
|
+
}
|
|
3670
|
+
),
|
|
3671
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3672
|
+
"button",
|
|
3673
|
+
{
|
|
3674
|
+
type: "button",
|
|
3675
|
+
className: cn(
|
|
3676
|
+
"shrink-0 text-agg-sm font-agg-bold leading-agg-5 text-agg-primary",
|
|
3677
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
|
|
3678
|
+
),
|
|
3679
|
+
"aria-label": actionLabel,
|
|
3680
|
+
onClick: onAction,
|
|
3681
|
+
children: actionLabel
|
|
3682
|
+
}
|
|
3683
|
+
) : null
|
|
3684
|
+
]
|
|
3685
|
+
}
|
|
3686
|
+
);
|
|
3687
|
+
};
|
|
3688
|
+
InlineAlert.displayName = "InlineAlert";
|
|
3689
|
+
|
|
3690
|
+
// src/primitives/search/search-empty-icon.tsx
|
|
3691
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3692
|
+
var SearchEmptyIcon = (_a) => {
|
|
3693
|
+
var _b = _a, { title, className } = _b, props = __objRest(_b, ["title", "className"]);
|
|
3694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
3695
|
+
"svg",
|
|
3696
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
3697
|
+
viewBox: "0 0 40 40",
|
|
3698
|
+
fill: "none",
|
|
3699
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3700
|
+
className
|
|
3701
|
+
}, getIconA11yProps(title)), props), {
|
|
3702
|
+
children: [
|
|
3703
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("title", { children: title }) : null,
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("circle", { cx: "19.9987", cy: "20.0013", r: "9.2", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3706
|
+
"ellipse",
|
|
3707
|
+
{
|
|
3708
|
+
cx: "19.9987",
|
|
3709
|
+
cy: "20.0012",
|
|
3710
|
+
rx: "17.2",
|
|
3711
|
+
ry: "6.6",
|
|
3712
|
+
transform: "rotate(-35 19.9987 20.0012)",
|
|
3713
|
+
stroke: "currentColor",
|
|
3714
|
+
strokeWidth: "1.6"
|
|
3715
|
+
}
|
|
3716
|
+
)
|
|
3717
|
+
]
|
|
3718
|
+
})
|
|
3719
|
+
);
|
|
3720
|
+
};
|
|
3721
|
+
SearchEmptyIcon.displayName = "SearchEmptyIcon";
|
|
3722
|
+
|
|
3723
|
+
// src/primitives/typography/typography.constants.ts
|
|
3724
|
+
var typographyVariantClasses = {
|
|
3725
|
+
display: cn("agg-type-display"),
|
|
3726
|
+
heading: cn("agg-type-heading"),
|
|
3727
|
+
title: cn("agg-type-title"),
|
|
3728
|
+
"title-strong": cn("agg-type-title-strong"),
|
|
3729
|
+
"body-large": cn("agg-type-body-large"),
|
|
3730
|
+
"body-large-strong": cn("agg-type-body-large-strong"),
|
|
3731
|
+
body: cn("agg-type-body"),
|
|
3732
|
+
"body-strong": cn("agg-type-body-strong"),
|
|
3733
|
+
label: cn("agg-type-label"),
|
|
3734
|
+
"label-strong": cn("agg-type-label-strong"),
|
|
3735
|
+
"label-caps": cn("agg-type-label-caps"),
|
|
3736
|
+
caption: cn("agg-type-caption"),
|
|
3737
|
+
"caption-strong": cn("agg-type-caption-strong"),
|
|
3738
|
+
"caption-caps": cn("agg-type-caption-caps"),
|
|
3739
|
+
overline: cn("agg-type-overline")
|
|
3740
|
+
};
|
|
3741
|
+
|
|
3742
|
+
// src/primitives/typography/index.tsx
|
|
3743
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3744
|
+
var Typography = ({
|
|
3745
|
+
as: Component = "p",
|
|
3746
|
+
variant = "body",
|
|
3747
|
+
className,
|
|
3748
|
+
children
|
|
3749
|
+
}) => {
|
|
3750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3751
|
+
Component,
|
|
3752
|
+
{
|
|
3753
|
+
className: cn(
|
|
3754
|
+
"group/agg-typography",
|
|
3755
|
+
"text-agg-foreground",
|
|
3756
|
+
typographyVariantClasses[variant],
|
|
3757
|
+
className
|
|
3758
|
+
),
|
|
3759
|
+
children
|
|
3760
|
+
}
|
|
3761
|
+
);
|
|
3762
|
+
};
|
|
3763
|
+
Typography.displayName = "Typography";
|
|
3764
|
+
|
|
3765
|
+
// src/primitives/state-message/index.tsx
|
|
3766
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3767
|
+
var iconClassName = "h-9 w-9 text-agg-muted-foreground";
|
|
3768
|
+
var StateMessage = ({
|
|
3769
|
+
ariaLabel,
|
|
3770
|
+
tone = "empty",
|
|
3771
|
+
title,
|
|
3772
|
+
description,
|
|
3773
|
+
actionLabel,
|
|
3774
|
+
onAction,
|
|
3775
|
+
className
|
|
3776
|
+
}) => {
|
|
3777
|
+
const icon = tone === "warning" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(WarningIcon, { className: iconClassName, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SearchEmptyIcon, { className: iconClassName, "aria-hidden": true });
|
|
3778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3779
|
+
"div",
|
|
3780
|
+
{
|
|
3781
|
+
className: cn(
|
|
3782
|
+
"flex min-h-[240px] w-full flex-col items-center justify-center px-5 py-10 text-center md:px-10",
|
|
3783
|
+
className
|
|
3784
|
+
),
|
|
3785
|
+
role: "status",
|
|
3786
|
+
"aria-live": "polite",
|
|
3787
|
+
"aria-label": ariaLabel,
|
|
3788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex max-w-[360px] flex-col items-center gap-6", children: [
|
|
3789
|
+
icon,
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Typography, { variant: "body-large-strong", children: title }),
|
|
3792
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Typography, { variant: "body", className: "whitespace-pre-line text-agg-muted-foreground", children: description }) : null
|
|
3793
|
+
] }),
|
|
3794
|
+
actionLabel && onAction ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3795
|
+
Button,
|
|
3796
|
+
{
|
|
3797
|
+
variant: "tertiary",
|
|
3798
|
+
size: "large",
|
|
3799
|
+
className: "text-agg-base leading-agg-6",
|
|
3800
|
+
"aria-label": actionLabel,
|
|
3801
|
+
onClick: (e) => {
|
|
3802
|
+
e.stopPropagation();
|
|
3803
|
+
e.preventDefault();
|
|
3804
|
+
onAction == null ? void 0 : onAction();
|
|
3805
|
+
},
|
|
3806
|
+
children: actionLabel
|
|
3807
|
+
}
|
|
3808
|
+
) : null
|
|
3809
|
+
] })
|
|
3810
|
+
}
|
|
3811
|
+
);
|
|
3812
|
+
};
|
|
3813
|
+
StateMessage.displayName = "StateMessage";
|
|
3814
|
+
|
|
3815
|
+
// src/primitives/badge/index.tsx
|
|
3816
|
+
var import_hooks7 = require("@agg-market/hooks");
|
|
3817
|
+
|
|
3818
|
+
// src/primitives/badge/badge.constants.ts
|
|
3819
|
+
var badgeSizeClasses = {
|
|
3820
|
+
small: cn("py-1.5 px-4 gap-1.5", "agg-type-label"),
|
|
3821
|
+
medium: cn("py-1.5 px-4 gap-2", "agg-type-body"),
|
|
3822
|
+
large: cn("py-2.5 px-6 gap-2", "agg-type-body")
|
|
3823
|
+
};
|
|
3824
|
+
var baseBadgeClasses = cn(
|
|
3825
|
+
"inline-flex items-center justify-center rounded-agg-full font-agg-sans",
|
|
3826
|
+
"bg-agg-secondary-hover text-agg-foreground whitespace-nowrap font-agg-normal"
|
|
3827
|
+
);
|
|
3828
|
+
|
|
3829
|
+
// src/primitives/badge/index.tsx
|
|
3830
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3831
|
+
function Badge({
|
|
3832
|
+
text,
|
|
3833
|
+
prefix,
|
|
3834
|
+
suffix,
|
|
3835
|
+
size = "medium",
|
|
3836
|
+
classNames,
|
|
3837
|
+
onClick,
|
|
3838
|
+
isActive = false
|
|
3839
|
+
}) {
|
|
3840
|
+
const { enableAnimations } = (0, import_hooks7.useSdkUiConfig)();
|
|
3841
|
+
const resolvedText = `${text}`;
|
|
3842
|
+
const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
|
|
3843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
3844
|
+
"span",
|
|
3845
|
+
__spreadProps(__spreadValues({
|
|
3846
|
+
"aria-label": resolvedAriaLabel,
|
|
3847
|
+
className: cn(
|
|
3848
|
+
"group/agg-badge",
|
|
3849
|
+
baseBadgeClasses,
|
|
3850
|
+
badgeSizeClasses[size],
|
|
3851
|
+
onClick ? "cursor-pointer hover:bg-agg-tertiary disabled:cursor-not-allowed" : "",
|
|
3852
|
+
getMotionClassName(
|
|
3853
|
+
enableAnimations,
|
|
3854
|
+
"transition-[border-color,background-color] duration-200 ease-in-out"
|
|
3855
|
+
),
|
|
3856
|
+
isActive ? "border-agg-primary bg-agg-secondary! font-agg-bold!" : "border-transparent font-agg-normal",
|
|
3857
|
+
classNames == null ? void 0 : classNames.root
|
|
3858
|
+
)
|
|
3859
|
+
}, onClick && { onClick }), {
|
|
3860
|
+
children: [
|
|
3861
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: cn(classNames == null ? void 0 : classNames.prefix, "empty:hidden"), children: prefix }) : null,
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
|
|
3863
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: cn(classNames == null ? void 0 : classNames.suffix, "empty:hidden"), children: suffix }) : null
|
|
3864
|
+
]
|
|
3865
|
+
})
|
|
3866
|
+
);
|
|
3867
|
+
}
|
|
3868
|
+
Badge.displayName = "Badge";
|
|
3869
|
+
|
|
3870
|
+
// src/onramp/steps/quote-card.tsx
|
|
3871
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3872
|
+
var QuoteCard = ({ quote, rank, onSelect }) => {
|
|
3873
|
+
var _a;
|
|
3874
|
+
const isBest = rank === 1;
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
3876
|
+
"div",
|
|
3877
|
+
{
|
|
3878
|
+
className: cn(
|
|
3879
|
+
"flex items-center gap-3 sm:gap-4",
|
|
3880
|
+
"rounded-xl border",
|
|
3881
|
+
"p-3 sm:p-4",
|
|
3882
|
+
"transition-colors cursor-pointer",
|
|
3883
|
+
isBest ? "border-agg-primary bg-agg-primary/5 hover:bg-agg-primary/10" : "border-agg-separator hover:bg-agg-secondary-hover"
|
|
3884
|
+
),
|
|
3885
|
+
role: "button",
|
|
3886
|
+
tabIndex: 0,
|
|
3887
|
+
onClick: onSelect,
|
|
3888
|
+
onKeyDown: (e) => {
|
|
3889
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3890
|
+
e.preventDefault();
|
|
3891
|
+
onSelect();
|
|
3892
|
+
}
|
|
3893
|
+
},
|
|
3894
|
+
children: [
|
|
3895
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3896
|
+
"div",
|
|
3897
|
+
{
|
|
3898
|
+
className: cn(
|
|
3899
|
+
"shrink-0 flex items-center justify-center h-10 w-10 rounded-lg",
|
|
3900
|
+
isBest ? "bg-agg-primary/10" : "bg-agg-secondary-hover"
|
|
3901
|
+
),
|
|
3902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3903
|
+
"span",
|
|
3904
|
+
{
|
|
3905
|
+
className: cn(
|
|
3906
|
+
"text-agg-lg font-agg-bold",
|
|
3907
|
+
isBest ? "text-agg-primary" : "text-agg-muted-foreground"
|
|
3908
|
+
),
|
|
3909
|
+
children: rank
|
|
3910
|
+
}
|
|
3911
|
+
)
|
|
3912
|
+
}
|
|
3913
|
+
),
|
|
3914
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: quote.serviceProvider }),
|
|
3917
|
+
isBest ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3918
|
+
Badge,
|
|
3919
|
+
{
|
|
3920
|
+
text: "Best",
|
|
3921
|
+
size: "small",
|
|
3922
|
+
classNames: { root: "bg-agg-primary! text-white! border-agg-primary!" }
|
|
3923
|
+
}
|
|
3924
|
+
) : null,
|
|
3925
|
+
quote.lowKyc ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Badge, { text: "Low KYC", size: "small" }) : null
|
|
3926
|
+
] }),
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
3928
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
3929
|
+
quote.destinationAmount.toFixed(6),
|
|
3930
|
+
" ",
|
|
3931
|
+
quote.destinationCurrencyCode.split("_")[0]
|
|
3932
|
+
] }),
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-agg-muted-foreground", children: "\xB7" }),
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
3935
|
+
"Fee ",
|
|
3936
|
+
(_a = FIAT_SYMBOLS[quote.sourceCurrencyCode]) != null ? _a : "",
|
|
3937
|
+
quote.totalFee.toFixed(2)
|
|
3938
|
+
] })
|
|
3939
|
+
] })
|
|
3940
|
+
] }),
|
|
3941
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3942
|
+
Button,
|
|
3943
|
+
{
|
|
3944
|
+
variant: "secondary",
|
|
3945
|
+
size: "small",
|
|
3946
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ChevronRightIcon, {}),
|
|
3947
|
+
onClick: (e) => {
|
|
3948
|
+
e.stopPropagation();
|
|
3949
|
+
onSelect();
|
|
3950
|
+
},
|
|
3951
|
+
children: "Select"
|
|
3952
|
+
}
|
|
3953
|
+
) })
|
|
3954
|
+
]
|
|
3955
|
+
}
|
|
3956
|
+
);
|
|
3957
|
+
};
|
|
3958
|
+
|
|
3959
|
+
// src/onramp/steps/quote-selection.tsx
|
|
3960
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3961
|
+
var BACK_BUTTON_CLASS = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
3962
|
+
var BackButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("button", { type: "button", className: BACK_BUTTON_CLASS, onClick, "aria-label": "Go back", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
3963
|
+
var QuoteSelectionStep = ({
|
|
3964
|
+
quotes,
|
|
3965
|
+
isLoading,
|
|
3966
|
+
error,
|
|
3967
|
+
fiatCurrency,
|
|
3968
|
+
cryptoCurrency,
|
|
3969
|
+
amount,
|
|
3970
|
+
onBack,
|
|
3971
|
+
onSelectQuote,
|
|
3972
|
+
onRetry
|
|
3973
|
+
}) => {
|
|
3974
|
+
var _a;
|
|
3975
|
+
const subtitle = `${cryptoCurrency.split("_")[0]} \xB7 ${(_a = FIAT_SYMBOLS[fiatCurrency]) != null ? _a : ""}${amount.toLocaleString()} ${fiatCurrency}`;
|
|
3976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
3977
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3978
|
+
Modal.Header,
|
|
3979
|
+
{
|
|
3980
|
+
title: "Select Provider",
|
|
3981
|
+
subtitle,
|
|
3982
|
+
hideBorder: true,
|
|
3983
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(BackButton, { onClick: onBack })
|
|
3984
|
+
}
|
|
3985
|
+
),
|
|
3986
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: [
|
|
3987
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "flex min-h-[240px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(LoadingIcon, { size: "large" }) }) : null,
|
|
3988
|
+
!isLoading && error ? /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(InlineAlert, { tone: "error", message: error }),
|
|
3990
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Button, { variant: "secondary", size: "medium", className: "w-full", onClick: onRetry, children: "Retry" })
|
|
3991
|
+
] }) : null,
|
|
3992
|
+
!isLoading && !error && quotes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3993
|
+
StateMessage,
|
|
3994
|
+
{
|
|
3995
|
+
tone: "empty",
|
|
3996
|
+
title: "No quotes available",
|
|
3997
|
+
description: "No providers returned quotes for this pair. Try a different amount or cryptocurrency.",
|
|
3998
|
+
actionLabel: "Go back",
|
|
3999
|
+
onAction: onBack
|
|
4000
|
+
}
|
|
4001
|
+
) : null,
|
|
4002
|
+
!isLoading && quotes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "flex flex-col gap-3", children: quotes.map((quote, i) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4003
|
+
QuoteCard,
|
|
4004
|
+
{
|
|
4005
|
+
quote,
|
|
4006
|
+
rank: i + 1,
|
|
4007
|
+
onSelect: () => onSelectQuote(quote)
|
|
4008
|
+
},
|
|
4009
|
+
`${quote.serviceProvider}-${quote.paymentMethodType}`
|
|
4010
|
+
)) }) : null
|
|
4011
|
+
] })
|
|
4012
|
+
] });
|
|
4013
|
+
};
|
|
4014
|
+
|
|
4015
|
+
// src/onramp/steps/widget.tsx
|
|
3371
4016
|
var import_react7 = require("react");
|
|
4017
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4018
|
+
var BACK_BUTTON_CLASS2 = "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80";
|
|
4019
|
+
var BackButton2 = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("button", { type: "button", className: BACK_BUTTON_CLASS2, onClick, "aria-label": "Go back", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ChevronLeftIcon, { className: "h-6 w-6" }) });
|
|
4020
|
+
var WidgetStep = ({ widgetUrl, isLoading, onBack }) => {
|
|
4021
|
+
const iframeRef = (0, import_react7.useRef)(null);
|
|
4022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4024
|
+
Modal.Header,
|
|
4025
|
+
{
|
|
4026
|
+
title: "Complete Purchase",
|
|
4027
|
+
hideBorder: true,
|
|
4028
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(BackButton2, { onClick: onBack })
|
|
4029
|
+
}
|
|
4030
|
+
),
|
|
4031
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Modal.Body, { classNames: { root: "p-0! sm:p-0! overflow-hidden" }, children: [
|
|
4032
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex min-h-[400px] items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(LoadingIcon, { size: "large" }) }) : null,
|
|
4033
|
+
widgetUrl ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4034
|
+
"iframe",
|
|
4035
|
+
{
|
|
4036
|
+
ref: iframeRef,
|
|
4037
|
+
src: widgetUrl,
|
|
4038
|
+
title: "Meld payment widget",
|
|
4039
|
+
className: "h-[700px] w-full border-0 block",
|
|
4040
|
+
allow: "camera; microphone; payment; encrypted-media"
|
|
4041
|
+
}
|
|
4042
|
+
) : null
|
|
4043
|
+
] })
|
|
4044
|
+
] });
|
|
4045
|
+
};
|
|
4046
|
+
|
|
4047
|
+
// src/onramp/index.tsx
|
|
4048
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4049
|
+
var OnrampModal = ({
|
|
4050
|
+
open,
|
|
4051
|
+
onOpenChange,
|
|
4052
|
+
transactionType,
|
|
4053
|
+
walletAddress: initialWalletAddress = "",
|
|
4054
|
+
defaultFiatCurrency = "USD",
|
|
4055
|
+
defaultCryptoCurrency = "USDC",
|
|
4056
|
+
onGetQuotes,
|
|
4057
|
+
onSelectQuote
|
|
4058
|
+
}) => {
|
|
4059
|
+
const [step, setStep] = (0, import_react8.useState)("form");
|
|
4060
|
+
const [formValues, setFormValues] = (0, import_react8.useState)({
|
|
4061
|
+
amount: "",
|
|
4062
|
+
fiatCurrency: defaultFiatCurrency,
|
|
4063
|
+
cryptoCurrency: defaultCryptoCurrency,
|
|
4064
|
+
walletAddress: initialWalletAddress
|
|
4065
|
+
});
|
|
4066
|
+
const [quotes, setQuotes] = (0, import_react8.useState)([]);
|
|
4067
|
+
const [isLoadingQuotes, setIsLoadingQuotes] = (0, import_react8.useState)(false);
|
|
4068
|
+
const [quoteError, setQuoteError] = (0, import_react8.useState)(null);
|
|
4069
|
+
const [widgetUrl, setWidgetUrl] = (0, import_react8.useState)(null);
|
|
4070
|
+
const [isCreatingSession, setIsCreatingSession] = (0, import_react8.useState)(false);
|
|
4071
|
+
const handleOpenChange = (0, import_react8.useCallback)(
|
|
4072
|
+
(isOpen) => {
|
|
4073
|
+
if (!isOpen) {
|
|
4074
|
+
setStep("form");
|
|
4075
|
+
setQuotes([]);
|
|
4076
|
+
setQuoteError(null);
|
|
4077
|
+
setWidgetUrl(null);
|
|
4078
|
+
}
|
|
4079
|
+
onOpenChange(isOpen);
|
|
4080
|
+
},
|
|
4081
|
+
[onOpenChange]
|
|
4082
|
+
);
|
|
4083
|
+
const handleGetQuotes = (0, import_react8.useCallback)(() => __async(void 0, null, function* () {
|
|
4084
|
+
const numericAmount2 = Number(formValues.amount);
|
|
4085
|
+
if (!numericAmount2 || numericAmount2 <= 0)
|
|
4086
|
+
return;
|
|
4087
|
+
setStep("quotes");
|
|
4088
|
+
setIsLoadingQuotes(true);
|
|
4089
|
+
setQuoteError(null);
|
|
4090
|
+
try {
|
|
4091
|
+
const result = yield onGetQuotes({
|
|
4092
|
+
transactionType,
|
|
4093
|
+
sourceAmount: numericAmount2,
|
|
4094
|
+
sourceCurrencyCode: formValues.fiatCurrency,
|
|
4095
|
+
destinationCurrencyCode: formValues.cryptoCurrency,
|
|
4096
|
+
countryCode: "US"
|
|
4097
|
+
});
|
|
4098
|
+
setQuotes(result);
|
|
4099
|
+
} catch (err) {
|
|
4100
|
+
setQuoteError(err instanceof Error ? err.message : "Failed to fetch quotes");
|
|
4101
|
+
} finally {
|
|
4102
|
+
setIsLoadingQuotes(false);
|
|
4103
|
+
}
|
|
4104
|
+
}), [formValues, transactionType, onGetQuotes]);
|
|
4105
|
+
const handleSelectQuote = (0, import_react8.useCallback)(
|
|
4106
|
+
(quote) => __async(void 0, null, function* () {
|
|
4107
|
+
setStep("widget");
|
|
4108
|
+
setIsCreatingSession(true);
|
|
4109
|
+
try {
|
|
4110
|
+
const session = yield onSelectQuote({
|
|
4111
|
+
transactionType,
|
|
4112
|
+
serviceProvider: quote.serviceProvider,
|
|
4113
|
+
sourceAmount: quote.sourceAmount,
|
|
4114
|
+
sourceCurrencyCode: quote.sourceCurrencyCode,
|
|
4115
|
+
destinationCurrencyCode: quote.destinationCurrencyCode,
|
|
4116
|
+
countryCode: quote.countryCode,
|
|
4117
|
+
walletAddress: formValues.walletAddress
|
|
4118
|
+
});
|
|
4119
|
+
setWidgetUrl(session.serviceProviderWidgetUrl);
|
|
4120
|
+
} catch (e) {
|
|
4121
|
+
setStep("quotes");
|
|
4122
|
+
} finally {
|
|
4123
|
+
setIsCreatingSession(false);
|
|
4124
|
+
}
|
|
4125
|
+
}),
|
|
4126
|
+
[transactionType, formValues.walletAddress, onSelectQuote]
|
|
4127
|
+
);
|
|
4128
|
+
const numericAmount = Number(formValues.amount) || 0;
|
|
4129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4130
|
+
Modal.Container,
|
|
4131
|
+
{
|
|
4132
|
+
maxWidth: "520px",
|
|
4133
|
+
"aria-label": transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
4134
|
+
children: [
|
|
4135
|
+
step === "form" ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4136
|
+
QuoteFormStep,
|
|
4137
|
+
{
|
|
4138
|
+
title: transactionType === "BUY" ? "Buy Crypto" : "Sell Crypto",
|
|
4139
|
+
values: formValues,
|
|
4140
|
+
onAmountChange: (amount) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { amount })),
|
|
4141
|
+
onFiatChange: (fiatCurrency) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { fiatCurrency })),
|
|
4142
|
+
onCryptoChange: (cryptoCurrency) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { cryptoCurrency })),
|
|
4143
|
+
onWalletAddressChange: (walletAddress) => setFormValues((prev) => __spreadProps(__spreadValues({}, prev), { walletAddress })),
|
|
4144
|
+
onSubmit: handleGetQuotes
|
|
4145
|
+
}
|
|
4146
|
+
) : null,
|
|
4147
|
+
step === "quotes" ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4148
|
+
QuoteSelectionStep,
|
|
4149
|
+
{
|
|
4150
|
+
quotes,
|
|
4151
|
+
isLoading: isLoadingQuotes,
|
|
4152
|
+
error: quoteError,
|
|
4153
|
+
fiatCurrency: formValues.fiatCurrency,
|
|
4154
|
+
cryptoCurrency: formValues.cryptoCurrency,
|
|
4155
|
+
amount: numericAmount,
|
|
4156
|
+
onBack: () => setStep("form"),
|
|
4157
|
+
onSelectQuote: handleSelectQuote,
|
|
4158
|
+
onRetry: handleGetQuotes
|
|
4159
|
+
}
|
|
4160
|
+
) : null,
|
|
4161
|
+
step === "widget" ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4162
|
+
WidgetStep,
|
|
4163
|
+
{
|
|
4164
|
+
widgetUrl,
|
|
4165
|
+
isLoading: isCreatingSession,
|
|
4166
|
+
onBack: () => {
|
|
4167
|
+
setWidgetUrl(null);
|
|
4168
|
+
setStep("quotes");
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
) : null
|
|
4172
|
+
]
|
|
4173
|
+
}
|
|
4174
|
+
) });
|
|
4175
|
+
};
|
|
4176
|
+
OnrampModal.displayName = "OnrampModal";
|
|
4177
|
+
|
|
4178
|
+
// src/withdraw/index.tsx
|
|
4179
|
+
var import_react10 = require("react");
|
|
3372
4180
|
|
|
3373
4181
|
// src/withdraw/withdraw-modal.constants.ts
|
|
3374
4182
|
var KALSHI_VENUE2 = "kalshi";
|
|
3375
4183
|
var KALSHI_WITHDRAW_URL_DEFAULT = "https://kalshi.com/account/withdraw";
|
|
3376
4184
|
|
|
3377
4185
|
// src/withdraw/steps/venue-selection.tsx
|
|
3378
|
-
var
|
|
4186
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3379
4187
|
var VenueRow2 = ({ venue, onSelect }) => {
|
|
3380
4188
|
var _a, _b;
|
|
3381
4189
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
3382
4190
|
const isDisabled = venue.disabled === true;
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
4191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
3384
4192
|
"div",
|
|
3385
4193
|
{
|
|
3386
4194
|
className: cn(
|
|
@@ -3393,7 +4201,9 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
3393
4201
|
role: "button",
|
|
3394
4202
|
tabIndex: isDisabled ? -1 : 0,
|
|
3395
4203
|
"aria-disabled": isDisabled,
|
|
3396
|
-
onClick: () => {
|
|
4204
|
+
onClick: (e) => {
|
|
4205
|
+
e.stopPropagation();
|
|
4206
|
+
e.preventDefault();
|
|
3397
4207
|
if (!isDisabled)
|
|
3398
4208
|
onSelect(venue.venue);
|
|
3399
4209
|
},
|
|
@@ -3404,20 +4214,20 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
3404
4214
|
}
|
|
3405
4215
|
},
|
|
3406
4216
|
children: [
|
|
3407
|
-
/* @__PURE__ */ (0,
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3410
|
-
/* @__PURE__ */ (0,
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(VenueLogo, { venue: venue.venue, size: "large", className: "rounded-lg" }) }),
|
|
4218
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: displayName }),
|
|
4220
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
3411
4221
|
"Balance ",
|
|
3412
4222
|
formatCompactUsd(venue.balance)
|
|
3413
4223
|
] })
|
|
3414
4224
|
] }),
|
|
3415
|
-
isDisabled ? /* @__PURE__ */ (0,
|
|
4225
|
+
isDisabled ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "agg-type-label text-agg-muted-foreground", children: (_b = venue.disabledReason) != null ? _b : "Unavailable" }) }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3416
4226
|
Button,
|
|
3417
4227
|
{
|
|
3418
4228
|
variant: "secondary",
|
|
3419
4229
|
size: "small",
|
|
3420
|
-
suffix: /* @__PURE__ */ (0,
|
|
4230
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ChevronRightIcon, {}),
|
|
3421
4231
|
onClick: (e) => {
|
|
3422
4232
|
e.stopPropagation();
|
|
3423
4233
|
onSelect(venue.venue);
|
|
@@ -3432,22 +4242,22 @@ var VenueRow2 = ({ venue, onSelect }) => {
|
|
|
3432
4242
|
var VenueSelectionStep2 = ({
|
|
3433
4243
|
venues,
|
|
3434
4244
|
onSelectVenue
|
|
3435
|
-
}) => /* @__PURE__ */ (0,
|
|
3436
|
-
/* @__PURE__ */ (0,
|
|
3437
|
-
/* @__PURE__ */ (0,
|
|
3438
|
-
/* @__PURE__ */ (0,
|
|
3439
|
-
/* @__PURE__ */ (0,
|
|
4245
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Modal.Header, { title: "Withdraw", hideBorder: true }),
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "agg-type-body text-agg-foreground", children: "Choose where to withdraw funds from:" }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "flex flex-col gap-3", children: venues.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(VenueRow2, { venue, onSelect: onSelectVenue }, venue.venue)) })
|
|
3440
4250
|
] }) })
|
|
3441
4251
|
] });
|
|
3442
4252
|
|
|
3443
4253
|
// src/withdraw/steps/withdraw-method.tsx
|
|
3444
|
-
var
|
|
4254
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3445
4255
|
var WithdrawMethodCard = ({
|
|
3446
4256
|
icon,
|
|
3447
4257
|
title,
|
|
3448
4258
|
description,
|
|
3449
4259
|
onContinue
|
|
3450
|
-
}) => /* @__PURE__ */ (0,
|
|
4260
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
3451
4261
|
"div",
|
|
3452
4262
|
{
|
|
3453
4263
|
className: cn(
|
|
@@ -3466,17 +4276,17 @@ var WithdrawMethodCard = ({
|
|
|
3466
4276
|
}
|
|
3467
4277
|
},
|
|
3468
4278
|
children: [
|
|
3469
|
-
/* @__PURE__ */ (0,
|
|
3470
|
-
/* @__PURE__ */ (0,
|
|
3471
|
-
/* @__PURE__ */ (0,
|
|
3472
|
-
/* @__PURE__ */ (0,
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "shrink-0 flex items-center justify-center h-10 w-10 rounded-lg bg-agg-secondary-hover", children: icon }),
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "agg-type-body-strong text-agg-foreground", children: title }),
|
|
4282
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "agg-type-label text-agg-muted-foreground", children: description })
|
|
3473
4283
|
] }),
|
|
3474
|
-
/* @__PURE__ */ (0,
|
|
4284
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3475
4285
|
Button,
|
|
3476
4286
|
{
|
|
3477
4287
|
variant: "secondary",
|
|
3478
4288
|
size: "small",
|
|
3479
|
-
suffix: /* @__PURE__ */ (0,
|
|
4289
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ChevronRightIcon, {}),
|
|
3480
4290
|
onClick: (e) => {
|
|
3481
4291
|
e.stopPropagation();
|
|
3482
4292
|
onContinue();
|
|
@@ -3494,47 +4304,47 @@ var WithdrawMethodStep = ({
|
|
|
3494
4304
|
}) => {
|
|
3495
4305
|
var _a;
|
|
3496
4306
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
3497
|
-
return /* @__PURE__ */ (0,
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
4307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3499
4309
|
Modal.Header,
|
|
3500
4310
|
{
|
|
3501
4311
|
title: `Withdraw from ${displayName}`,
|
|
3502
4312
|
hideBorder: true,
|
|
3503
|
-
leftElement: /* @__PURE__ */ (0,
|
|
4313
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3504
4314
|
"button",
|
|
3505
4315
|
{
|
|
3506
4316
|
type: "button",
|
|
3507
4317
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
3508
4318
|
onClick: onBack,
|
|
3509
4319
|
"aria-label": "Go back",
|
|
3510
|
-
children: /* @__PURE__ */ (0,
|
|
4320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
3511
4321
|
}
|
|
3512
4322
|
)
|
|
3513
4323
|
}
|
|
3514
4324
|
),
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
3517
|
-
/* @__PURE__ */ (0,
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
3519
4329
|
displayName,
|
|
3520
4330
|
" balance: ",
|
|
3521
4331
|
formatCompactUsd(venue.balance)
|
|
3522
4332
|
] })
|
|
3523
4333
|
] }),
|
|
3524
|
-
/* @__PURE__ */ (0,
|
|
3525
|
-
/* @__PURE__ */ (0,
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3526
4336
|
WithdrawMethodCard,
|
|
3527
4337
|
{
|
|
3528
|
-
icon: /* @__PURE__ */ (0,
|
|
4338
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(WalletIcon, { className: "h-6 w-6 text-agg-foreground" }),
|
|
3529
4339
|
title: "Withdraw to Wallet",
|
|
3530
4340
|
description: "Send funds to your crypto wallet as USDC.",
|
|
3531
4341
|
onContinue: () => onSelectMethod("wallet")
|
|
3532
4342
|
}
|
|
3533
4343
|
),
|
|
3534
|
-
/* @__PURE__ */ (0,
|
|
4344
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3535
4345
|
WithdrawMethodCard,
|
|
3536
4346
|
{
|
|
3537
|
-
icon: /* @__PURE__ */ (0,
|
|
4347
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BankIcon, { className: "h-6 w-6 text-agg-foreground" }),
|
|
3538
4348
|
title: "Withdraw to Bank",
|
|
3539
4349
|
description: "Transfer funds to your linked bank account.",
|
|
3540
4350
|
onContinue: () => onSelectMethod("bank")
|
|
@@ -3546,8 +4356,8 @@ var WithdrawMethodStep = ({
|
|
|
3546
4356
|
};
|
|
3547
4357
|
|
|
3548
4358
|
// src/withdraw/steps/withdraw-amount.tsx
|
|
3549
|
-
var
|
|
3550
|
-
var
|
|
4359
|
+
var import_react9 = require("react");
|
|
4360
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3551
4361
|
var WithdrawAmountStep = ({
|
|
3552
4362
|
venue,
|
|
3553
4363
|
method,
|
|
@@ -3555,50 +4365,50 @@ var WithdrawAmountStep = ({
|
|
|
3555
4365
|
onContinue
|
|
3556
4366
|
}) => {
|
|
3557
4367
|
var _a;
|
|
3558
|
-
const [rawAmount, setRawAmount] = (0,
|
|
4368
|
+
const [rawAmount, setRawAmount] = (0, import_react9.useState)("");
|
|
3559
4369
|
const displayName = (_a = venueLogoLabels[venue.venue]) != null ? _a : venue.venue;
|
|
3560
4370
|
const numericAmount = Number(rawAmount) || 0;
|
|
3561
4371
|
const isValid = numericAmount > 0 && numericAmount <= venue.balance;
|
|
3562
4372
|
const exceedsBalance = numericAmount > venue.balance;
|
|
3563
4373
|
const methodLabel = method === "wallet" ? "Wallet" : "Bank";
|
|
3564
|
-
const handleAmountChange = (0,
|
|
4374
|
+
const handleAmountChange = (0, import_react9.useCallback)((e) => {
|
|
3565
4375
|
const v = e.target.value.replace(/[^0-9.]/g, "");
|
|
3566
4376
|
const parts = v.split(".");
|
|
3567
4377
|
const sanitized = parts.length > 2 ? `${parts[0]}.${parts.slice(1).join("")}` : v;
|
|
3568
4378
|
setRawAmount(sanitized);
|
|
3569
4379
|
}, []);
|
|
3570
|
-
const handleMax = (0,
|
|
4380
|
+
const handleMax = (0, import_react9.useCallback)(() => {
|
|
3571
4381
|
setRawAmount(venue.balance.toString());
|
|
3572
4382
|
}, [venue.balance]);
|
|
3573
|
-
return /* @__PURE__ */ (0,
|
|
3574
|
-
/* @__PURE__ */ (0,
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
4384
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3575
4385
|
Modal.Header,
|
|
3576
4386
|
{
|
|
3577
4387
|
title: `Withdraw to ${methodLabel}`,
|
|
3578
4388
|
hideBorder: true,
|
|
3579
|
-
leftElement: /* @__PURE__ */ (0,
|
|
4389
|
+
leftElement: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3580
4390
|
"button",
|
|
3581
4391
|
{
|
|
3582
4392
|
type: "button",
|
|
3583
4393
|
className: "mr-2 flex items-center justify-center text-agg-foreground transition-colors hover:cursor-pointer hover:text-agg-foreground/80",
|
|
3584
4394
|
onClick: onBack,
|
|
3585
4395
|
"aria-label": "Go back",
|
|
3586
|
-
children: /* @__PURE__ */ (0,
|
|
4396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
3587
4397
|
}
|
|
3588
4398
|
)
|
|
3589
4399
|
}
|
|
3590
4400
|
),
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3593
|
-
/* @__PURE__ */ (0,
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3595
|
-
/* @__PURE__ */ (0,
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(VenueLogo, { venue: venue.venue, size: "small", className: "rounded-sm" }),
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("p", { className: "agg-type-label text-agg-muted-foreground", children: [
|
|
3596
4406
|
displayName,
|
|
3597
4407
|
" balance: ",
|
|
3598
4408
|
formatCompactUsd(venue.balance)
|
|
3599
4409
|
] })
|
|
3600
4410
|
] }),
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
4411
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3602
4412
|
"button",
|
|
3603
4413
|
{
|
|
3604
4414
|
type: "button",
|
|
@@ -3608,10 +4418,10 @@ var WithdrawAmountStep = ({
|
|
|
3608
4418
|
}
|
|
3609
4419
|
)
|
|
3610
4420
|
] }),
|
|
3611
|
-
/* @__PURE__ */ (0,
|
|
3612
|
-
/* @__PURE__ */ (0,
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
4421
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
4422
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-baseline", children: [
|
|
4423
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "agg-type-display text-agg-foreground", children: "$" }),
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3615
4425
|
"input",
|
|
3616
4426
|
{
|
|
3617
4427
|
type: "text",
|
|
@@ -3627,9 +4437,9 @@ var WithdrawAmountStep = ({
|
|
|
3627
4437
|
}
|
|
3628
4438
|
)
|
|
3629
4439
|
] }),
|
|
3630
|
-
exceedsBalance ? /* @__PURE__ */ (0,
|
|
4440
|
+
exceedsBalance ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("p", { className: "agg-type-label mt-2 text-agg-error", children: "Amount exceeds available balance" }) : null
|
|
3631
4441
|
] }),
|
|
3632
|
-
/* @__PURE__ */ (0,
|
|
4442
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3633
4443
|
Button,
|
|
3634
4444
|
{
|
|
3635
4445
|
variant: "primary",
|
|
@@ -3645,30 +4455,30 @@ var WithdrawAmountStep = ({
|
|
|
3645
4455
|
};
|
|
3646
4456
|
|
|
3647
4457
|
// src/withdraw/steps/kalshi-withdraw.tsx
|
|
3648
|
-
var
|
|
4458
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3649
4459
|
var KalshiStepCard2 = ({
|
|
3650
4460
|
step,
|
|
3651
4461
|
title,
|
|
3652
4462
|
description,
|
|
3653
4463
|
children
|
|
3654
|
-
}) => /* @__PURE__ */ (0,
|
|
3655
|
-
/* @__PURE__ */ (0,
|
|
4464
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col gap-2 rounded-xl bg-agg-secondary-hover p-4", children: [
|
|
4465
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("p", { className: "agg-type-caption-caps text-agg-muted-foreground", children: [
|
|
3656
4466
|
"Step ",
|
|
3657
4467
|
step
|
|
3658
4468
|
] }),
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
3660
|
-
/* @__PURE__ */ (0,
|
|
3661
|
-
/* @__PURE__ */ (0,
|
|
4469
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
4470
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "agg-type-label-strong text-agg-foreground", children: title }),
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "agg-type-label text-agg-foreground", children: description })
|
|
3662
4472
|
] }),
|
|
3663
4473
|
children
|
|
3664
4474
|
] });
|
|
3665
4475
|
var KalshiWithdrawStep = ({
|
|
3666
4476
|
withdrawUrl,
|
|
3667
4477
|
onDone
|
|
3668
|
-
}) => /* @__PURE__ */ (0,
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3671
|
-
/* @__PURE__ */ (0,
|
|
4478
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Modal.Header, { title: "", hideBorder: true }),
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Modal.Body, { classNames: { root: "px-5 pt-0 pb-6 sm:px-8 sm:pt-0 sm:pb-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col items-center gap-8", children: [
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3672
4482
|
VenueLogo,
|
|
3673
4483
|
{
|
|
3674
4484
|
venue: "kalshi",
|
|
@@ -3676,23 +4486,23 @@ var KalshiWithdrawStep = ({
|
|
|
3676
4486
|
className: "h-[60px] w-[60px] rounded-lg"
|
|
3677
4487
|
}
|
|
3678
4488
|
),
|
|
3679
|
-
/* @__PURE__ */ (0,
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
4489
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h2", { className: "agg-type-heading text-agg-foreground", children: "Withdraw from Kalshi" }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "agg-type-body text-agg-foreground", children: "To withdraw from Kalshi you'll need to initiate the withdrawal from your Kalshi account directly on Kalshi's site." })
|
|
3682
4492
|
] }),
|
|
3683
|
-
/* @__PURE__ */ (0,
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
4493
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3685
4495
|
KalshiStepCard2,
|
|
3686
4496
|
{
|
|
3687
4497
|
step: 1,
|
|
3688
4498
|
title: "Open Kalshi Withdraw Page",
|
|
3689
4499
|
description: "Sign in to your Kalshi account and go to Withdraw from your account menu.",
|
|
3690
|
-
children: /* @__PURE__ */ (0,
|
|
4500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3691
4501
|
Button,
|
|
3692
4502
|
{
|
|
3693
4503
|
variant: "secondary",
|
|
3694
4504
|
size: "small",
|
|
3695
|
-
suffix: /* @__PURE__ */ (0,
|
|
4505
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ExternalLinkIcon, { className: "h-3.5 w-3.5" }),
|
|
3696
4506
|
onClick: () => {
|
|
3697
4507
|
window.open(withdrawUrl, "_blank", "noopener,noreferrer");
|
|
3698
4508
|
},
|
|
@@ -3701,7 +4511,7 @@ var KalshiWithdrawStep = ({
|
|
|
3701
4511
|
) })
|
|
3702
4512
|
}
|
|
3703
4513
|
),
|
|
3704
|
-
/* @__PURE__ */ (0,
|
|
4514
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3705
4515
|
KalshiStepCard2,
|
|
3706
4516
|
{
|
|
3707
4517
|
step: 2,
|
|
@@ -3709,7 +4519,7 @@ var KalshiWithdrawStep = ({
|
|
|
3709
4519
|
description: "Select a withdrawal method: Bank transfer (ACH), Wire, or USDC (crypto)."
|
|
3710
4520
|
}
|
|
3711
4521
|
),
|
|
3712
|
-
/* @__PURE__ */ (0,
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3713
4523
|
KalshiStepCard2,
|
|
3714
4524
|
{
|
|
3715
4525
|
step: 3,
|
|
@@ -3718,12 +4528,12 @@ var KalshiWithdrawStep = ({
|
|
|
3718
4528
|
}
|
|
3719
4529
|
)
|
|
3720
4530
|
] }),
|
|
3721
|
-
/* @__PURE__ */ (0,
|
|
4531
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { variant: "secondary", size: "large", onClick: onDone, children: "Done" })
|
|
3722
4532
|
] }) })
|
|
3723
4533
|
] });
|
|
3724
4534
|
|
|
3725
4535
|
// src/withdraw/index.tsx
|
|
3726
|
-
var
|
|
4536
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3727
4537
|
var WithdrawModal = ({
|
|
3728
4538
|
open,
|
|
3729
4539
|
onOpenChange,
|
|
@@ -3735,9 +4545,9 @@ var WithdrawModal = ({
|
|
|
3735
4545
|
onDoneKalshi,
|
|
3736
4546
|
kalshiWithdrawUrl = KALSHI_WITHDRAW_URL_DEFAULT
|
|
3737
4547
|
}) => {
|
|
3738
|
-
const [step, setStep] = (0,
|
|
3739
|
-
const [selectedVenue, setSelectedVenue] = (0,
|
|
3740
|
-
const [selectedMethod, setSelectedMethod] = (0,
|
|
4548
|
+
const [step, setStep] = (0, import_react10.useState)("venues");
|
|
4549
|
+
const [selectedVenue, setSelectedVenue] = (0, import_react10.useState)(null);
|
|
4550
|
+
const [selectedMethod, setSelectedMethod] = (0, import_react10.useState)(null);
|
|
3741
4551
|
const handleSelectVenue = (venueSlug) => {
|
|
3742
4552
|
onSelectVenue(venueSlug);
|
|
3743
4553
|
if (venueSlug === KALSHI_VENUE2) {
|
|
@@ -3787,9 +4597,9 @@ var WithdrawModal = ({
|
|
|
3787
4597
|
}
|
|
3788
4598
|
onOpenChange(isOpen);
|
|
3789
4599
|
};
|
|
3790
|
-
return /* @__PURE__ */ (0,
|
|
3791
|
-
step === "venues" ? /* @__PURE__ */ (0,
|
|
3792
|
-
step === "method" && selectedVenue ? /* @__PURE__ */ (0,
|
|
4600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Modal.Container, { maxWidth: "600px", "aria-label": "Withdraw", children: [
|
|
4601
|
+
step === "venues" ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(VenueSelectionStep2, { venues, onSelectVenue: handleSelectVenue }) : null,
|
|
4602
|
+
step === "method" && selectedVenue ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
3793
4603
|
WithdrawMethodStep,
|
|
3794
4604
|
{
|
|
3795
4605
|
venue: selectedVenue,
|
|
@@ -3797,7 +4607,7 @@ var WithdrawModal = ({
|
|
|
3797
4607
|
onSelectMethod: handleSelectMethod
|
|
3798
4608
|
}
|
|
3799
4609
|
) : null,
|
|
3800
|
-
step === "withdraw-amount" && selectedVenue && selectedMethod ? /* @__PURE__ */ (0,
|
|
4610
|
+
step === "withdraw-amount" && selectedVenue && selectedMethod ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
3801
4611
|
WithdrawAmountStep,
|
|
3802
4612
|
{
|
|
3803
4613
|
venue: selectedVenue,
|
|
@@ -3806,14 +4616,14 @@ var WithdrawModal = ({
|
|
|
3806
4616
|
onContinue: handleContinueWithdraw
|
|
3807
4617
|
}
|
|
3808
4618
|
) : null,
|
|
3809
|
-
step === "kalshi" ? /* @__PURE__ */ (0,
|
|
4619
|
+
step === "kalshi" ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(KalshiWithdrawStep, { withdrawUrl: kalshiWithdrawUrl, onDone: handleDoneKalshi }) : null
|
|
3810
4620
|
] }) });
|
|
3811
4621
|
};
|
|
3812
4622
|
WithdrawModal.displayName = "WithdrawModal";
|
|
3813
4623
|
|
|
3814
4624
|
// src/onboarding/index.tsx
|
|
3815
|
-
var
|
|
3816
|
-
var
|
|
4625
|
+
var import_react15 = require("react");
|
|
4626
|
+
var import_hooks13 = require("@agg-market/hooks");
|
|
3817
4627
|
var Dialog4 = __toESM(require("@radix-ui/react-dialog"));
|
|
3818
4628
|
|
|
3819
4629
|
// src/onboarding/onboarding-modal.constants.ts
|
|
@@ -3835,31 +4645,31 @@ var ONCHAIN_VENUES = [
|
|
|
3835
4645
|
];
|
|
3836
4646
|
|
|
3837
4647
|
// src/onboarding/steps/how-it-works.tsx
|
|
3838
|
-
var
|
|
3839
|
-
var
|
|
3840
|
-
var
|
|
4648
|
+
var import_react11 = require("react");
|
|
4649
|
+
var import_hooks8 = require("@agg-market/hooks");
|
|
4650
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3841
4651
|
var defaultIcons = {
|
|
3842
|
-
createAccount: /* @__PURE__ */ (0,
|
|
3843
|
-
linkAccounts: /* @__PURE__ */ (0,
|
|
3844
|
-
bestPrices: /* @__PURE__ */ (0,
|
|
3845
|
-
stayInControl: /* @__PURE__ */ (0,
|
|
4652
|
+
createAccount: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
4653
|
+
linkAccounts: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
4654
|
+
bestPrices: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
|
|
4655
|
+
stayInControl: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
|
|
3846
4656
|
};
|
|
3847
4657
|
var HowItWorksStep = ({ onContinue, icons }) => {
|
|
3848
|
-
const labels = (0,
|
|
3849
|
-
const scrollRef = (0,
|
|
3850
|
-
const [showTopGradient, setShowTopGradient] = (0,
|
|
3851
|
-
const [showBottomGradient, setShowBottomGradient] = (0,
|
|
3852
|
-
const handleScroll = (0,
|
|
4658
|
+
const labels = (0, import_hooks8.useLabels)();
|
|
4659
|
+
const scrollRef = (0, import_react11.useRef)(null);
|
|
4660
|
+
const [showTopGradient, setShowTopGradient] = (0, import_react11.useState)(false);
|
|
4661
|
+
const [showBottomGradient, setShowBottomGradient] = (0, import_react11.useState)(true);
|
|
4662
|
+
const handleScroll = (0, import_react11.useCallback)(() => {
|
|
3853
4663
|
const el = scrollRef.current;
|
|
3854
4664
|
if (!el)
|
|
3855
4665
|
return;
|
|
3856
4666
|
setShowTopGradient(el.scrollTop > 0);
|
|
3857
4667
|
setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
|
|
3858
4668
|
}, []);
|
|
3859
|
-
return /* @__PURE__ */ (0,
|
|
3860
|
-
/* @__PURE__ */ (0,
|
|
3861
|
-
/* @__PURE__ */ (0,
|
|
3862
|
-
/* @__PURE__ */ (0,
|
|
4669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
|
|
4671
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
|
|
4672
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3863
4673
|
"div",
|
|
3864
4674
|
{
|
|
3865
4675
|
ref: scrollRef,
|
|
@@ -3869,7 +4679,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
3869
4679
|
var _a;
|
|
3870
4680
|
const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
|
|
3871
4681
|
const feature = labels.onboarding.howItWorks.features[featureKey];
|
|
3872
|
-
return /* @__PURE__ */ (0,
|
|
4682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
3873
4683
|
"div",
|
|
3874
4684
|
{
|
|
3875
4685
|
className: cn(
|
|
@@ -3878,11 +4688,11 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
3878
4688
|
"bg-agg-secondary-hover"
|
|
3879
4689
|
),
|
|
3880
4690
|
children: [
|
|
3881
|
-
/* @__PURE__ */ (0,
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
|
|
3884
4694
|
] }),
|
|
3885
|
-
icon ? /* @__PURE__ */ (0,
|
|
4695
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
|
|
3886
4696
|
]
|
|
3887
4697
|
},
|
|
3888
4698
|
featureKey
|
|
@@ -3890,7 +4700,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
3890
4700
|
})
|
|
3891
4701
|
}
|
|
3892
4702
|
),
|
|
3893
|
-
/* @__PURE__ */ (0,
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3894
4704
|
"div",
|
|
3895
4705
|
{
|
|
3896
4706
|
className: cn(
|
|
@@ -3901,7 +4711,7 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
3901
4711
|
)
|
|
3902
4712
|
}
|
|
3903
4713
|
),
|
|
3904
|
-
/* @__PURE__ */ (0,
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3905
4715
|
"div",
|
|
3906
4716
|
{
|
|
3907
4717
|
className: cn(
|
|
@@ -3913,26 +4723,26 @@ var HowItWorksStep = ({ onContinue, icons }) => {
|
|
|
3913
4723
|
}
|
|
3914
4724
|
)
|
|
3915
4725
|
] }),
|
|
3916
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
|
|
3917
4727
|
] });
|
|
3918
4728
|
};
|
|
3919
4729
|
HowItWorksStep.displayName = "HowItWorksStep";
|
|
3920
4730
|
|
|
3921
4731
|
// src/onboarding/steps/profile-setup.tsx
|
|
3922
|
-
var
|
|
3923
|
-
var
|
|
3924
|
-
var
|
|
4732
|
+
var import_react12 = require("react");
|
|
4733
|
+
var import_hooks9 = require("@agg-market/hooks");
|
|
4734
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3925
4735
|
var ProfileSetupStep = ({ onContinue }) => {
|
|
3926
|
-
const labels = (0,
|
|
3927
|
-
const [username, setUsername] = (0,
|
|
3928
|
-
const [avatarFile, setAvatarFile] = (0,
|
|
3929
|
-
const [avatarPreview, setAvatarPreview] = (0,
|
|
3930
|
-
const fileInputRef = (0,
|
|
3931
|
-
const handleAvatarClick = (0,
|
|
4736
|
+
const labels = (0, import_hooks9.useLabels)();
|
|
4737
|
+
const [username, setUsername] = (0, import_react12.useState)("");
|
|
4738
|
+
const [avatarFile, setAvatarFile] = (0, import_react12.useState)();
|
|
4739
|
+
const [avatarPreview, setAvatarPreview] = (0, import_react12.useState)();
|
|
4740
|
+
const fileInputRef = (0, import_react12.useRef)(null);
|
|
4741
|
+
const handleAvatarClick = (0, import_react12.useCallback)(() => {
|
|
3932
4742
|
var _a;
|
|
3933
4743
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
3934
4744
|
}, []);
|
|
3935
|
-
const handleFileChange = (0,
|
|
4745
|
+
const handleFileChange = (0, import_react12.useCallback)((e) => {
|
|
3936
4746
|
var _a;
|
|
3937
4747
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
3938
4748
|
if (!file)
|
|
@@ -3945,18 +4755,18 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
3945
4755
|
};
|
|
3946
4756
|
reader.readAsDataURL(file);
|
|
3947
4757
|
}, []);
|
|
3948
|
-
const handleContinue = (0,
|
|
4758
|
+
const handleContinue = (0, import_react12.useCallback)(() => {
|
|
3949
4759
|
onContinue({
|
|
3950
4760
|
username,
|
|
3951
4761
|
avatarFile,
|
|
3952
4762
|
avatarPreview
|
|
3953
4763
|
});
|
|
3954
4764
|
}, [username, avatarFile, avatarPreview, onContinue]);
|
|
3955
|
-
return /* @__PURE__ */ (0,
|
|
3956
|
-
/* @__PURE__ */ (0,
|
|
3957
|
-
/* @__PURE__ */ (0,
|
|
3958
|
-
/* @__PURE__ */ (0,
|
|
3959
|
-
/* @__PURE__ */ (0,
|
|
4765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-7", children: [
|
|
4766
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
|
|
4767
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-5 items-center w-full", children: [
|
|
4768
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex justify-center", children: [
|
|
4769
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3960
4770
|
"button",
|
|
3961
4771
|
{
|
|
3962
4772
|
type: "button",
|
|
@@ -3972,17 +4782,17 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
3972
4782
|
"overflow-hidden"
|
|
3973
4783
|
),
|
|
3974
4784
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
3975
|
-
children: avatarPreview ? /* @__PURE__ */ (0,
|
|
4785
|
+
children: avatarPreview ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3976
4786
|
RemoteImage,
|
|
3977
4787
|
{
|
|
3978
4788
|
src: avatarPreview,
|
|
3979
4789
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
3980
4790
|
className: "h-full w-full object-cover"
|
|
3981
4791
|
}
|
|
3982
|
-
) : /* @__PURE__ */ (0,
|
|
4792
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
|
|
3983
4793
|
}
|
|
3984
4794
|
),
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
4795
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3986
4796
|
"input",
|
|
3987
4797
|
{
|
|
3988
4798
|
ref: fileInputRef,
|
|
@@ -3994,8 +4804,8 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
3994
4804
|
}
|
|
3995
4805
|
)
|
|
3996
4806
|
] }),
|
|
3997
|
-
/* @__PURE__ */ (0,
|
|
3998
|
-
/* @__PURE__ */ (0,
|
|
4807
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3999
4809
|
"label",
|
|
4000
4810
|
{
|
|
4001
4811
|
htmlFor: "onboarding-username",
|
|
@@ -4003,7 +4813,7 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
4003
4813
|
children: labels.onboarding.profileSetup.usernameLabel
|
|
4004
4814
|
}
|
|
4005
4815
|
),
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4816
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4007
4817
|
"input",
|
|
4008
4818
|
{
|
|
4009
4819
|
id: "onboarding-username",
|
|
@@ -4027,16 +4837,16 @@ var ProfileSetupStep = ({ onContinue }) => {
|
|
|
4027
4837
|
)
|
|
4028
4838
|
] })
|
|
4029
4839
|
] }),
|
|
4030
|
-
/* @__PURE__ */ (0,
|
|
4840
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
|
|
4031
4841
|
] });
|
|
4032
4842
|
};
|
|
4033
4843
|
ProfileSetupStep.displayName = "ProfileSetupStep";
|
|
4034
4844
|
|
|
4035
4845
|
// src/onboarding/steps/connect-accounts.tsx
|
|
4036
|
-
var
|
|
4037
|
-
var
|
|
4846
|
+
var import_hooks10 = require("@agg-market/hooks");
|
|
4847
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
4038
4848
|
var OnchainVenueLogos = () => {
|
|
4039
|
-
return /* @__PURE__ */ (0,
|
|
4849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
|
|
4040
4850
|
};
|
|
4041
4851
|
var VenueCard = ({
|
|
4042
4852
|
logos,
|
|
@@ -4047,8 +4857,8 @@ var VenueCard = ({
|
|
|
4047
4857
|
onConnect,
|
|
4048
4858
|
connected = false
|
|
4049
4859
|
}) => {
|
|
4050
|
-
const labels = (0,
|
|
4051
|
-
const action = connected ? /* @__PURE__ */ (0,
|
|
4860
|
+
const labels = (0, import_hooks10.useLabels)();
|
|
4861
|
+
const action = connected ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4052
4862
|
Button,
|
|
4053
4863
|
{
|
|
4054
4864
|
variant: "tertiary",
|
|
@@ -4058,18 +4868,18 @@ var VenueCard = ({
|
|
|
4058
4868
|
children: labels.onboarding.connectAccounts.connect
|
|
4059
4869
|
}
|
|
4060
4870
|
);
|
|
4061
|
-
const mobileAction = connected ? /* @__PURE__ */ (0,
|
|
4871
|
+
const mobileAction = connected ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4062
4872
|
Button,
|
|
4063
4873
|
{
|
|
4064
4874
|
variant: "tertiary",
|
|
4065
4875
|
size: "medium",
|
|
4066
4876
|
className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
|
|
4067
4877
|
onClick: onConnect,
|
|
4068
|
-
suffix: /* @__PURE__ */ (0,
|
|
4878
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChevronRightIcon, { className: "h-4 w-4" }),
|
|
4069
4879
|
children: labels.onboarding.connectAccounts.connectAccount
|
|
4070
4880
|
}
|
|
4071
4881
|
);
|
|
4072
|
-
return /* @__PURE__ */ (0,
|
|
4882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
4073
4883
|
"div",
|
|
4074
4884
|
{
|
|
4075
4885
|
className: cn(
|
|
@@ -4077,23 +4887,23 @@ var VenueCard = ({
|
|
|
4077
4887
|
connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
|
|
4078
4888
|
),
|
|
4079
4889
|
children: [
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4890
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "hidden sm:flex items-center justify-between", children: [
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "shrink-0", children: logos }),
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-[2px]", children: [
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title }),
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { className: "text-agg-sm text-agg-foreground", children: description })
|
|
4086
4896
|
] })
|
|
4087
4897
|
] }),
|
|
4088
|
-
/* @__PURE__ */ (0,
|
|
4898
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "shrink-0", children: action })
|
|
4089
4899
|
] }),
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
/* @__PURE__ */ (0,
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4900
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-3 sm:hidden", children: [
|
|
4901
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
4902
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "shrink-0", children: logos }),
|
|
4903
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title })
|
|
4094
4904
|
] }),
|
|
4095
|
-
/* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col items-start gap-2", children: [
|
|
4906
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
|
|
4097
4907
|
mobileAction
|
|
4098
4908
|
] })
|
|
4099
4909
|
] })
|
|
@@ -4108,15 +4918,15 @@ var ConnectAccountsStep = ({
|
|
|
4108
4918
|
connectedOnchain = false,
|
|
4109
4919
|
connectedKalshi = false
|
|
4110
4920
|
}) => {
|
|
4111
|
-
const labels = (0,
|
|
4921
|
+
const labels = (0, import_hooks10.useLabels)();
|
|
4112
4922
|
const canContinue = connectedOnchain || connectedKalshi;
|
|
4113
|
-
return /* @__PURE__ */ (0,
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-6", children: [
|
|
4924
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
|
|
4925
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
4926
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4117
4927
|
VenueCard,
|
|
4118
4928
|
{
|
|
4119
|
-
logos: /* @__PURE__ */ (0,
|
|
4929
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(OnchainVenueLogos, {}),
|
|
4120
4930
|
title: labels.onboarding.connectAccounts.onchainTitle,
|
|
4121
4931
|
mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
|
|
4122
4932
|
ONCHAIN_VENUES.length - 1
|
|
@@ -4127,10 +4937,10 @@ var ConnectAccountsStep = ({
|
|
|
4127
4937
|
connected: connectedOnchain
|
|
4128
4938
|
}
|
|
4129
4939
|
),
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4940
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4131
4941
|
VenueCard,
|
|
4132
4942
|
{
|
|
4133
|
-
logos: /* @__PURE__ */ (0,
|
|
4943
|
+
logos: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "sm:flex sm:w-14 sm:items-center sm:justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4134
4944
|
VenueLogo,
|
|
4135
4945
|
{
|
|
4136
4946
|
venue: "kalshi",
|
|
@@ -4148,7 +4958,7 @@ var ConnectAccountsStep = ({
|
|
|
4148
4958
|
}
|
|
4149
4959
|
)
|
|
4150
4960
|
] }),
|
|
4151
|
-
/* @__PURE__ */ (0,
|
|
4961
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4152
4962
|
Button,
|
|
4153
4963
|
{
|
|
4154
4964
|
variant: "primary",
|
|
@@ -4164,25 +4974,25 @@ var ConnectAccountsStep = ({
|
|
|
4164
4974
|
ConnectAccountsStep.displayName = "ConnectAccountsStep";
|
|
4165
4975
|
|
|
4166
4976
|
// src/onboarding/steps/connect-kalshi-modal.tsx
|
|
4167
|
-
var
|
|
4168
|
-
var
|
|
4977
|
+
var import_react13 = require("react");
|
|
4978
|
+
var import_hooks11 = require("@agg-market/hooks");
|
|
4169
4979
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
4170
|
-
var
|
|
4980
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4171
4981
|
var ConnectKalshiModal = ({
|
|
4172
4982
|
open,
|
|
4173
4983
|
onOpenChange,
|
|
4174
4984
|
onVerify
|
|
4175
4985
|
}) => {
|
|
4176
|
-
const labels = (0,
|
|
4177
|
-
const [apiKeyId, setApiKeyId] = (0,
|
|
4178
|
-
const [privateKey, setPrivateKey] = (0,
|
|
4179
|
-
const [verifying, setVerifying] = (0,
|
|
4180
|
-
const [error, setError] = (0,
|
|
4986
|
+
const labels = (0, import_hooks11.useLabels)();
|
|
4987
|
+
const [apiKeyId, setApiKeyId] = (0, import_react13.useState)("");
|
|
4988
|
+
const [privateKey, setPrivateKey] = (0, import_react13.useState)("");
|
|
4989
|
+
const [verifying, setVerifying] = (0, import_react13.useState)(false);
|
|
4990
|
+
const [error, setError] = (0, import_react13.useState)();
|
|
4181
4991
|
const canVerify = apiKeyId.trim().length > 0 && privateKey.trim().length > 0;
|
|
4182
|
-
const handleCancel = (0,
|
|
4992
|
+
const handleCancel = (0, import_react13.useCallback)(() => {
|
|
4183
4993
|
onOpenChange(false);
|
|
4184
4994
|
}, [onOpenChange]);
|
|
4185
|
-
const handleVerify = (0,
|
|
4995
|
+
const handleVerify = (0, import_react13.useCallback)(() => __async(void 0, null, function* () {
|
|
4186
4996
|
if (!canVerify || verifying)
|
|
4187
4997
|
return;
|
|
4188
4998
|
setVerifying(true);
|
|
@@ -4212,7 +5022,7 @@ var ConnectKalshiModal = ({
|
|
|
4212
5022
|
privateKey,
|
|
4213
5023
|
verifying
|
|
4214
5024
|
]);
|
|
4215
|
-
const handleOpenChange = (0,
|
|
5025
|
+
const handleOpenChange = (0, import_react13.useCallback)(
|
|
4216
5026
|
(value) => {
|
|
4217
5027
|
if (value) {
|
|
4218
5028
|
setApiKeyId("");
|
|
@@ -4224,15 +5034,15 @@ var ConnectKalshiModal = ({
|
|
|
4224
5034
|
},
|
|
4225
5035
|
[onOpenChange]
|
|
4226
5036
|
);
|
|
4227
|
-
return /* @__PURE__ */ (0,
|
|
5037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4228
5038
|
Modal.Container,
|
|
4229
5039
|
{
|
|
4230
5040
|
maxWidth: "600px",
|
|
4231
5041
|
"aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
|
|
4232
5042
|
classNames: { container: "!rounded-agg-lg" },
|
|
4233
5043
|
children: [
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
5044
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectKalshiModal.title }),
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4236
5046
|
Modal.Header,
|
|
4237
5047
|
{
|
|
4238
5048
|
hideClose: false,
|
|
@@ -4243,8 +5053,8 @@ var ConnectKalshiModal = ({
|
|
|
4243
5053
|
}
|
|
4244
5054
|
}
|
|
4245
5055
|
),
|
|
4246
|
-
/* @__PURE__ */ (0,
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
5057
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4248
5058
|
VenueLogo,
|
|
4249
5059
|
{
|
|
4250
5060
|
venue: "kalshi",
|
|
@@ -4253,54 +5063,54 @@ var ConnectKalshiModal = ({
|
|
|
4253
5063
|
className: "h-[60px] w-[60px]"
|
|
4254
5064
|
}
|
|
4255
5065
|
),
|
|
4256
|
-
/* @__PURE__ */ (0,
|
|
4257
|
-
/* @__PURE__ */ (0,
|
|
4258
|
-
/* @__PURE__ */ (0,
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
5067
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
|
|
4259
5069
|
] }),
|
|
4260
|
-
/* @__PURE__ */ (0,
|
|
4261
|
-
/* @__PURE__ */ (0,
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
|
|
4265
5075
|
] }),
|
|
4266
|
-
/* @__PURE__ */ (0,
|
|
4267
|
-
/* @__PURE__ */ (0,
|
|
4268
|
-
/* @__PURE__ */ (0,
|
|
5076
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "space-y-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
|
|
5078
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { children: [
|
|
4269
5079
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
|
|
4270
5080
|
" ",
|
|
4271
|
-
/* @__PURE__ */ (0,
|
|
5081
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
|
|
4272
5082
|
labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
|
|
4273
5083
|
" ",
|
|
4274
|
-
/* @__PURE__ */ (0,
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-agg-foreground underline", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl })
|
|
4275
5085
|
] }),
|
|
4276
|
-
/* @__PURE__ */ (0,
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { children: [
|
|
4277
5087
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
|
|
4278
5088
|
" ",
|
|
4279
|
-
/* @__PURE__ */ (0,
|
|
5089
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
|
|
4280
5090
|
labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
|
|
4281
5091
|
] }),
|
|
4282
|
-
/* @__PURE__ */ (0,
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { children: [
|
|
4283
5093
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
|
|
4284
5094
|
" ",
|
|
4285
|
-
/* @__PURE__ */ (0,
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
|
|
4286
5096
|
labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
|
|
4287
5097
|
] }),
|
|
4288
|
-
/* @__PURE__ */ (0,
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
|
|
4289
5099
|
] }),
|
|
4290
|
-
/* @__PURE__ */ (0,
|
|
5100
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
|
|
4291
5101
|
labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
|
|
4292
|
-
/* @__PURE__ */ (0,
|
|
5102
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("br", {}),
|
|
4293
5103
|
labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
|
|
4294
5104
|
] })
|
|
4295
5105
|
] }),
|
|
4296
|
-
/* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4298
|
-
/* @__PURE__ */ (0,
|
|
4299
|
-
/* @__PURE__ */ (0,
|
|
5106
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
|
|
5107
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
|
|
4300
5110
|
] }),
|
|
4301
|
-
/* @__PURE__ */ (0,
|
|
4302
|
-
/* @__PURE__ */ (0,
|
|
4303
|
-
/* @__PURE__ */ (0,
|
|
5111
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
|
|
5112
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5113
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4304
5114
|
"label",
|
|
4305
5115
|
{
|
|
4306
5116
|
htmlFor: "kalshi-api-key-id",
|
|
@@ -4308,7 +5118,7 @@ var ConnectKalshiModal = ({
|
|
|
4308
5118
|
children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
|
|
4309
5119
|
}
|
|
4310
5120
|
),
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4312
5122
|
"input",
|
|
4313
5123
|
{
|
|
4314
5124
|
id: "kalshi-api-key-id",
|
|
@@ -4328,8 +5138,8 @@ var ConnectKalshiModal = ({
|
|
|
4328
5138
|
}
|
|
4329
5139
|
)
|
|
4330
5140
|
] }),
|
|
4331
|
-
/* @__PURE__ */ (0,
|
|
4332
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5142
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4333
5143
|
"label",
|
|
4334
5144
|
{
|
|
4335
5145
|
htmlFor: "kalshi-private-key",
|
|
@@ -4337,7 +5147,7 @@ var ConnectKalshiModal = ({
|
|
|
4337
5147
|
children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
|
|
4338
5148
|
}
|
|
4339
5149
|
),
|
|
4340
|
-
/* @__PURE__ */ (0,
|
|
5150
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4341
5151
|
"textarea",
|
|
4342
5152
|
{
|
|
4343
5153
|
id: "kalshi-private-key",
|
|
@@ -4359,42 +5169,42 @@ var ConnectKalshiModal = ({
|
|
|
4359
5169
|
] })
|
|
4360
5170
|
] })
|
|
4361
5171
|
] }),
|
|
4362
|
-
/* @__PURE__ */ (0,
|
|
4363
|
-
/* @__PURE__ */ (0,
|
|
4364
|
-
/* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
5172
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center justify-between w-full", children: [
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
|
|
5174
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4366
5176
|
"a",
|
|
4367
5177
|
{
|
|
4368
5178
|
href: "#",
|
|
4369
5179
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
4370
5180
|
children: [
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
5181
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(DocumentIcon, { className: "h-4 w-4" }),
|
|
4372
5182
|
labels.onboarding.connectKalshiModal.help.docsLinkLabel
|
|
4373
5183
|
]
|
|
4374
5184
|
}
|
|
4375
5185
|
),
|
|
4376
|
-
/* @__PURE__ */ (0,
|
|
4377
|
-
/* @__PURE__ */ (0,
|
|
5186
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "h-3 w-px bg-agg-separator" }),
|
|
5187
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4378
5188
|
"a",
|
|
4379
5189
|
{
|
|
4380
5190
|
href: "#",
|
|
4381
5191
|
className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
|
|
4382
5192
|
children: [
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
5193
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(PlaySquareIcon, { className: "h-4 w-4" }),
|
|
4384
5194
|
labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
|
|
4385
5195
|
]
|
|
4386
5196
|
}
|
|
4387
5197
|
)
|
|
4388
5198
|
] })
|
|
4389
5199
|
] }),
|
|
4390
|
-
/* @__PURE__ */ (0,
|
|
4391
|
-
error ? /* @__PURE__ */ (0,
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
4393
|
-
/* @__PURE__ */ (0,
|
|
5200
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-5 items-center", children: [
|
|
5201
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5202
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
5203
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
4394
5204
|
] }) : null,
|
|
4395
|
-
/* @__PURE__ */ (0,
|
|
4396
|
-
/* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
5205
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-3 justify-center", children: [
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { variant: "secondary", size: "large", onClick: handleCancel, children: labels.onboarding.connectKalshiModal.actions.cancel }),
|
|
5207
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4398
5208
|
Button,
|
|
4399
5209
|
{
|
|
4400
5210
|
variant: "primary",
|
|
@@ -4415,22 +5225,22 @@ var ConnectKalshiModal = ({
|
|
|
4415
5225
|
ConnectKalshiModal.displayName = "ConnectKalshiModal";
|
|
4416
5226
|
|
|
4417
5227
|
// src/onboarding/steps/connect-onchain-modal.tsx
|
|
4418
|
-
var
|
|
4419
|
-
var
|
|
5228
|
+
var import_react14 = require("react");
|
|
5229
|
+
var import_hooks12 = require("@agg-market/hooks");
|
|
4420
5230
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
4421
|
-
var
|
|
5231
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4422
5232
|
var ConnectOnchainModal = ({
|
|
4423
5233
|
open,
|
|
4424
5234
|
onOpenChange,
|
|
4425
5235
|
onConnect
|
|
4426
5236
|
}) => {
|
|
4427
|
-
const labels = (0,
|
|
4428
|
-
const [connecting, setConnecting] = (0,
|
|
4429
|
-
const [error, setError] = (0,
|
|
4430
|
-
const handleCancel = (0,
|
|
5237
|
+
const labels = (0, import_hooks12.useLabels)();
|
|
5238
|
+
const [connecting, setConnecting] = (0, import_react14.useState)(false);
|
|
5239
|
+
const [error, setError] = (0, import_react14.useState)();
|
|
5240
|
+
const handleCancel = (0, import_react14.useCallback)(() => {
|
|
4431
5241
|
onOpenChange(false);
|
|
4432
5242
|
}, [onOpenChange]);
|
|
4433
|
-
const handleConnect = (0,
|
|
5243
|
+
const handleConnect = (0, import_react14.useCallback)(() => __async(void 0, null, function* () {
|
|
4434
5244
|
if (connecting)
|
|
4435
5245
|
return;
|
|
4436
5246
|
setConnecting(true);
|
|
@@ -4446,7 +5256,7 @@ var ConnectOnchainModal = ({
|
|
|
4446
5256
|
setConnecting(false);
|
|
4447
5257
|
}
|
|
4448
5258
|
}), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
|
|
4449
|
-
const handleOpenChange = (0,
|
|
5259
|
+
const handleOpenChange = (0, import_react14.useCallback)(
|
|
4450
5260
|
(value) => {
|
|
4451
5261
|
if (value) {
|
|
4452
5262
|
setError(void 0);
|
|
@@ -4456,15 +5266,15 @@ var ConnectOnchainModal = ({
|
|
|
4456
5266
|
},
|
|
4457
5267
|
[onOpenChange]
|
|
4458
5268
|
);
|
|
4459
|
-
return /* @__PURE__ */ (0,
|
|
5269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
4460
5270
|
Modal.Container,
|
|
4461
5271
|
{
|
|
4462
5272
|
maxWidth: "600px",
|
|
4463
5273
|
"aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
|
|
4464
5274
|
classNames: { container: "!rounded-agg-lg" },
|
|
4465
5275
|
children: [
|
|
4466
|
-
/* @__PURE__ */ (0,
|
|
4467
|
-
/* @__PURE__ */ (0,
|
|
5276
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Dialog3.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
|
|
5277
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4468
5278
|
Modal.Header,
|
|
4469
5279
|
{
|
|
4470
5280
|
hideClose: false,
|
|
@@ -4475,26 +5285,26 @@ var ConnectOnchainModal = ({
|
|
|
4475
5285
|
}
|
|
4476
5286
|
}
|
|
4477
5287
|
),
|
|
4478
|
-
/* @__PURE__ */ (0,
|
|
4479
|
-
/* @__PURE__ */ (0,
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4481
|
-
/* @__PURE__ */ (0,
|
|
5288
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col gap-8 items-center", children: [
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col gap-4 items-center text-center", children: [
|
|
5290
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
|
|
5291
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
|
|
4482
5292
|
] }),
|
|
4483
|
-
/* @__PURE__ */ (0,
|
|
4484
|
-
/* @__PURE__ */ (0,
|
|
4485
|
-
/* @__PURE__ */ (0,
|
|
4486
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
4487
|
-
/* @__PURE__ */ (0,
|
|
4488
|
-
/* @__PURE__ */ (0,
|
|
5293
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
|
|
5294
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
|
|
5295
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex items-center gap-[6px]", children: [
|
|
5296
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(VenueLogo, { venue, size: "medium" }),
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
|
|
4489
5299
|
] }, venue)) })
|
|
4490
5300
|
] }),
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4493
|
-
error ? /* @__PURE__ */ (0,
|
|
4494
|
-
/* @__PURE__ */ (0,
|
|
4495
|
-
/* @__PURE__ */ (0,
|
|
5301
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col gap-6 items-center", children: [
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex flex-col gap-3 items-center", children: [
|
|
5303
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5304
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
|
|
5305
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
|
|
4496
5306
|
] }) : null,
|
|
4497
|
-
/* @__PURE__ */ (0,
|
|
5307
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4498
5308
|
Button,
|
|
4499
5309
|
{
|
|
4500
5310
|
variant: "primary",
|
|
@@ -4505,7 +5315,7 @@ var ConnectOnchainModal = ({
|
|
|
4505
5315
|
}
|
|
4506
5316
|
)
|
|
4507
5317
|
] }),
|
|
4508
|
-
/* @__PURE__ */ (0,
|
|
5318
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4509
5319
|
Button,
|
|
4510
5320
|
{
|
|
4511
5321
|
variant: "tertiary",
|
|
@@ -4524,7 +5334,7 @@ var ConnectOnchainModal = ({
|
|
|
4524
5334
|
ConnectOnchainModal.displayName = "ConnectOnchainModal";
|
|
4525
5335
|
|
|
4526
5336
|
// src/onboarding/index.tsx
|
|
4527
|
-
var
|
|
5337
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4528
5338
|
var OnboardingModal = ({
|
|
4529
5339
|
open,
|
|
4530
5340
|
onOpenChange,
|
|
@@ -4537,68 +5347,68 @@ var OnboardingModal = ({
|
|
|
4537
5347
|
connectedKalshi = false
|
|
4538
5348
|
}) => {
|
|
4539
5349
|
var _a;
|
|
4540
|
-
const labels = (0,
|
|
4541
|
-
const [step, setStep] = (0,
|
|
5350
|
+
const labels = (0, import_hooks13.useLabels)();
|
|
5351
|
+
const [step, setStep] = (0, import_react15.useState)(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
4542
5352
|
const stepLabels = {
|
|
4543
5353
|
[ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
|
|
4544
5354
|
[ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
|
|
4545
5355
|
[ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
|
|
4546
5356
|
};
|
|
4547
5357
|
const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
|
|
4548
|
-
const [kalshiModalOpen, setKalshiModalOpen] = (0,
|
|
4549
|
-
const [kalshiConnected, setKalshiConnected] = (0,
|
|
4550
|
-
const [onchainModalOpen, setOnchainModalOpen] = (0,
|
|
4551
|
-
const [onchainConnected, setOnchainConnected] = (0,
|
|
4552
|
-
(0,
|
|
5358
|
+
const [kalshiModalOpen, setKalshiModalOpen] = (0, import_react15.useState)(false);
|
|
5359
|
+
const [kalshiConnected, setKalshiConnected] = (0, import_react15.useState)(false);
|
|
5360
|
+
const [onchainModalOpen, setOnchainModalOpen] = (0, import_react15.useState)(false);
|
|
5361
|
+
const [onchainConnected, setOnchainConnected] = (0, import_react15.useState)(false);
|
|
5362
|
+
(0, import_react15.useEffect)(() => {
|
|
4553
5363
|
if (open) {
|
|
4554
5364
|
setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
|
|
4555
5365
|
setKalshiConnected(false);
|
|
4556
5366
|
setOnchainConnected(false);
|
|
4557
5367
|
}
|
|
4558
5368
|
}, [open]);
|
|
4559
|
-
const handleHowItWorksContinue = (0,
|
|
5369
|
+
const handleHowItWorksContinue = (0, import_react15.useCallback)(() => {
|
|
4560
5370
|
setStep(ONBOARDING_STEPS.PROFILE_SETUP);
|
|
4561
5371
|
}, []);
|
|
4562
|
-
const handleProfileContinue = (0,
|
|
5372
|
+
const handleProfileContinue = (0, import_react15.useCallback)(
|
|
4563
5373
|
(data) => {
|
|
4564
5374
|
onProfileSubmit == null ? void 0 : onProfileSubmit(data);
|
|
4565
5375
|
setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
|
|
4566
5376
|
},
|
|
4567
5377
|
[onProfileSubmit]
|
|
4568
5378
|
);
|
|
4569
|
-
const handleConnectContinue = (0,
|
|
5379
|
+
const handleConnectContinue = (0, import_react15.useCallback)(() => {
|
|
4570
5380
|
onComplete == null ? void 0 : onComplete();
|
|
4571
5381
|
}, [onComplete]);
|
|
4572
|
-
const handleOpenOnchainModal = (0,
|
|
5382
|
+
const handleOpenOnchainModal = (0, import_react15.useCallback)(() => {
|
|
4573
5383
|
setOnchainModalOpen(true);
|
|
4574
5384
|
}, []);
|
|
4575
|
-
const handleOnchainConnect = (0,
|
|
5385
|
+
const handleOnchainConnect = (0, import_react15.useCallback)(() => __async(void 0, null, function* () {
|
|
4576
5386
|
yield onConnectOnchain == null ? void 0 : onConnectOnchain();
|
|
4577
5387
|
setOnchainConnected(true);
|
|
4578
5388
|
}), [onConnectOnchain]);
|
|
4579
|
-
const handleOpenKalshiModal = (0,
|
|
5389
|
+
const handleOpenKalshiModal = (0, import_react15.useCallback)(() => {
|
|
4580
5390
|
setKalshiModalOpen(true);
|
|
4581
5391
|
}, []);
|
|
4582
|
-
const handleKalshiVerify = (0,
|
|
5392
|
+
const handleKalshiVerify = (0, import_react15.useCallback)(
|
|
4583
5393
|
(credentials) => __async(void 0, null, function* () {
|
|
4584
5394
|
yield onConnectKalshi == null ? void 0 : onConnectKalshi(credentials);
|
|
4585
5395
|
setKalshiConnected(true);
|
|
4586
5396
|
}),
|
|
4587
5397
|
[onConnectKalshi]
|
|
4588
5398
|
);
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
4590
|
-
/* @__PURE__ */ (0,
|
|
5399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
5400
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
4591
5401
|
Modal.Container,
|
|
4592
5402
|
{
|
|
4593
5403
|
maxWidth: "600px",
|
|
4594
5404
|
"aria-label": resolvedTitle,
|
|
4595
5405
|
classNames: { container: "!rounded-agg-lg" },
|
|
4596
5406
|
children: [
|
|
4597
|
-
/* @__PURE__ */ (0,
|
|
4598
|
-
/* @__PURE__ */ (0,
|
|
4599
|
-
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0,
|
|
4600
|
-
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0,
|
|
4601
|
-
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0,
|
|
5407
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Dialog4.Title, { className: "sr-only", children: resolvedTitle }),
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
|
|
5409
|
+
step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
|
|
5410
|
+
step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ProfileSetupStep, { onContinue: handleProfileContinue }),
|
|
5411
|
+
step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4602
5412
|
ConnectAccountsStep,
|
|
4603
5413
|
{
|
|
4604
5414
|
onConnectOnchain: handleOpenOnchainModal,
|
|
@@ -4612,7 +5422,7 @@ var OnboardingModal = ({
|
|
|
4612
5422
|
]
|
|
4613
5423
|
}
|
|
4614
5424
|
) }),
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4616
5426
|
ConnectOnchainModal,
|
|
4617
5427
|
{
|
|
4618
5428
|
open: onchainModalOpen,
|
|
@@ -4620,7 +5430,7 @@ var OnboardingModal = ({
|
|
|
4620
5430
|
onConnect: handleOnchainConnect
|
|
4621
5431
|
}
|
|
4622
5432
|
),
|
|
4623
|
-
/* @__PURE__ */ (0,
|
|
5433
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4624
5434
|
ConnectKalshiModal,
|
|
4625
5435
|
{
|
|
4626
5436
|
open: kalshiModalOpen,
|
|
@@ -4633,7 +5443,7 @@ var OnboardingModal = ({
|
|
|
4633
5443
|
OnboardingModal.displayName = "OnboardingModal";
|
|
4634
5444
|
|
|
4635
5445
|
// src/profile/index.tsx
|
|
4636
|
-
var
|
|
5446
|
+
var import_react17 = require("react");
|
|
4637
5447
|
|
|
4638
5448
|
// src/profile/profile-modal.constants.ts
|
|
4639
5449
|
var PROFILE_TAB_KEYS = {
|
|
@@ -4646,9 +5456,9 @@ var PROFILE_TAB_ITEMS = [
|
|
|
4646
5456
|
];
|
|
4647
5457
|
|
|
4648
5458
|
// src/profile/tabs/about-tab.tsx
|
|
4649
|
-
var
|
|
4650
|
-
var
|
|
4651
|
-
var
|
|
5459
|
+
var import_react16 = require("react");
|
|
5460
|
+
var import_hooks14 = require("@agg-market/hooks");
|
|
5461
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4652
5462
|
var AboutTab = ({
|
|
4653
5463
|
avatarPreview,
|
|
4654
5464
|
onDeleteProfile,
|
|
@@ -4657,13 +5467,13 @@ var AboutTab = ({
|
|
|
4657
5467
|
onDraftAvatarChange,
|
|
4658
5468
|
draftAvatarPreview
|
|
4659
5469
|
}) => {
|
|
4660
|
-
const labels = (0,
|
|
4661
|
-
const fileInputRef = (0,
|
|
4662
|
-
const handleAvatarClick = (0,
|
|
5470
|
+
const labels = (0, import_hooks14.useLabels)();
|
|
5471
|
+
const fileInputRef = (0, import_react16.useRef)(null);
|
|
5472
|
+
const handleAvatarClick = (0, import_react16.useCallback)(() => {
|
|
4663
5473
|
var _a;
|
|
4664
5474
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
4665
5475
|
}, []);
|
|
4666
|
-
const handleFileChange = (0,
|
|
5476
|
+
const handleFileChange = (0, import_react16.useCallback)(
|
|
4667
5477
|
(e) => {
|
|
4668
5478
|
var _a;
|
|
4669
5479
|
const file = (_a = e.target.files) == null ? void 0 : _a[0];
|
|
@@ -4679,9 +5489,9 @@ var AboutTab = ({
|
|
|
4679
5489
|
[onDraftAvatarChange]
|
|
4680
5490
|
);
|
|
4681
5491
|
const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
|
|
4682
|
-
return /* @__PURE__ */ (0,
|
|
4683
|
-
/* @__PURE__ */ (0,
|
|
4684
|
-
/* @__PURE__ */ (0,
|
|
5492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
5493
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex justify-center", children: [
|
|
5494
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4685
5495
|
"button",
|
|
4686
5496
|
{
|
|
4687
5497
|
type: "button",
|
|
@@ -4697,17 +5507,17 @@ var AboutTab = ({
|
|
|
4697
5507
|
"overflow-hidden"
|
|
4698
5508
|
),
|
|
4699
5509
|
"aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
|
|
4700
|
-
children: resolvedPreview ? /* @__PURE__ */ (0,
|
|
5510
|
+
children: resolvedPreview ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4701
5511
|
RemoteImage,
|
|
4702
5512
|
{
|
|
4703
5513
|
src: resolvedPreview,
|
|
4704
5514
|
alt: labels.onboarding.profileSetup.profilePreviewAlt,
|
|
4705
5515
|
className: "h-full w-full object-cover"
|
|
4706
5516
|
}
|
|
4707
|
-
) : /* @__PURE__ */ (0,
|
|
5517
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ProfileIcon, { className: "h-8 w-8 text-agg-muted-foreground" })
|
|
4708
5518
|
}
|
|
4709
5519
|
),
|
|
4710
|
-
/* @__PURE__ */ (0,
|
|
5520
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4711
5521
|
"input",
|
|
4712
5522
|
{
|
|
4713
5523
|
ref: fileInputRef,
|
|
@@ -4719,8 +5529,8 @@ var AboutTab = ({
|
|
|
4719
5529
|
}
|
|
4720
5530
|
)
|
|
4721
5531
|
] }),
|
|
4722
|
-
/* @__PURE__ */ (0,
|
|
4723
|
-
/* @__PURE__ */ (0,
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5533
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4724
5534
|
"label",
|
|
4725
5535
|
{
|
|
4726
5536
|
htmlFor: "profile-username",
|
|
@@ -4728,7 +5538,7 @@ var AboutTab = ({
|
|
|
4728
5538
|
children: "Username"
|
|
4729
5539
|
}
|
|
4730
5540
|
),
|
|
4731
|
-
/* @__PURE__ */ (0,
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4732
5542
|
"input",
|
|
4733
5543
|
{
|
|
4734
5544
|
id: "profile-username",
|
|
@@ -4750,12 +5560,12 @@ var AboutTab = ({
|
|
|
4750
5560
|
}
|
|
4751
5561
|
)
|
|
4752
5562
|
] }),
|
|
4753
|
-
/* @__PURE__ */ (0,
|
|
4754
|
-
/* @__PURE__ */ (0,
|
|
4755
|
-
/* @__PURE__ */ (0,
|
|
4756
|
-
/* @__PURE__ */ (0,
|
|
5563
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
5564
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
5565
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: "Delete your profile" }),
|
|
5566
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: "This will permanently delete your account and all of its data. You will not be able to reactivate this account." })
|
|
4757
5567
|
] }),
|
|
4758
|
-
/* @__PURE__ */ (0,
|
|
5568
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4759
5569
|
"button",
|
|
4760
5570
|
{
|
|
4761
5571
|
type: "button",
|
|
@@ -4777,9 +5587,9 @@ var AboutTab = ({
|
|
|
4777
5587
|
AboutTab.displayName = "AboutTab";
|
|
4778
5588
|
|
|
4779
5589
|
// src/profile/tabs/accounts-wallets-tab.tsx
|
|
4780
|
-
var
|
|
4781
|
-
var SectionTitle = ({ children }) => /* @__PURE__ */ (0,
|
|
4782
|
-
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0,
|
|
5590
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
5591
|
+
var SectionTitle = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
|
|
5592
|
+
var AccountRow = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4783
5593
|
"div",
|
|
4784
5594
|
{
|
|
4785
5595
|
className: cn(
|
|
@@ -4791,7 +5601,7 @@ var AccountRow = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
4791
5601
|
children
|
|
4792
5602
|
}
|
|
4793
5603
|
);
|
|
4794
|
-
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
5604
|
+
var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4795
5605
|
"button",
|
|
4796
5606
|
{
|
|
4797
5607
|
type: "button",
|
|
@@ -4800,7 +5610,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime8
|
|
|
4800
5610
|
children: "Connect"
|
|
4801
5611
|
}
|
|
4802
5612
|
);
|
|
4803
|
-
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0,
|
|
5613
|
+
var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4804
5614
|
"button",
|
|
4805
5615
|
{
|
|
4806
5616
|
type: "button",
|
|
@@ -4825,19 +5635,19 @@ var AccountsWalletsTab = ({
|
|
|
4825
5635
|
const twitter = socialAccounts == null ? void 0 : socialAccounts.twitter;
|
|
4826
5636
|
const discord = socialAccounts == null ? void 0 : socialAccounts.discord;
|
|
4827
5637
|
const telegram = socialAccounts == null ? void 0 : socialAccounts.telegram;
|
|
4828
|
-
return /* @__PURE__ */ (0,
|
|
4829
|
-
/* @__PURE__ */ (0,
|
|
4830
|
-
/* @__PURE__ */ (0,
|
|
4831
|
-
exchanges.length === 0 ? /* @__PURE__ */ (0,
|
|
5638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-8", children: [
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
5640
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SectionTitle, { children: "Exchanges" }),
|
|
5641
|
+
exchanges.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: "No exchange accounts connected." }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "flex flex-col gap-2", children: exchanges.map((account) => {
|
|
4832
5642
|
var _a;
|
|
4833
5643
|
const displayName = (_a = venueLogoLabels[account.venue]) != null ? _a : account.venue;
|
|
4834
|
-
return /* @__PURE__ */ (0,
|
|
4835
|
-
/* @__PURE__ */ (0,
|
|
4836
|
-
/* @__PURE__ */ (0,
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4838
|
-
/* @__PURE__ */ (0,
|
|
4839
|
-
/* @__PURE__ */ (0,
|
|
4840
|
-
account.verified ? /* @__PURE__ */ (0,
|
|
5644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(AccountRow, { children: [
|
|
5645
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
5646
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(VenueLogo, { venue: account.venue, size: "small" }),
|
|
5647
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: displayName }),
|
|
5648
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
5649
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: account.displayAddress }),
|
|
5650
|
+
account.verified ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4841
5651
|
Icon,
|
|
4842
5652
|
{
|
|
4843
5653
|
name: "check-badge",
|
|
@@ -4847,39 +5657,39 @@ var AccountsWalletsTab = ({
|
|
|
4847
5657
|
) : null
|
|
4848
5658
|
] })
|
|
4849
5659
|
] }),
|
|
4850
|
-
/* @__PURE__ */ (0,
|
|
5660
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DisconnectTextButton, { onClick: () => onDisconnectExchange(account.venue) })
|
|
4851
5661
|
] }, account.venue);
|
|
4852
5662
|
}) })
|
|
4853
5663
|
] }),
|
|
4854
|
-
/* @__PURE__ */ (0,
|
|
4855
|
-
/* @__PURE__ */ (0,
|
|
4856
|
-
/* @__PURE__ */ (0,
|
|
4857
|
-
/* @__PURE__ */ (0,
|
|
4858
|
-
/* @__PURE__ */ (0,
|
|
4859
|
-
/* @__PURE__ */ (0,
|
|
4860
|
-
/* @__PURE__ */ (0,
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SectionTitle, { children: "Social Accounts" }),
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-2", children: [
|
|
5667
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(AccountRow, { children: [
|
|
5668
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: "twitter", size: "small", color: "currentColor" }) }),
|
|
5670
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "X (Twitter)" })
|
|
4861
5671
|
] }),
|
|
4862
|
-
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */ (0,
|
|
5672
|
+
(twitter == null ? void 0 : twitter.connected) ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DisconnectTextButton, { onClick: onDisconnectTwitter }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ConnectTextButton, { onClick: onConnectTwitter })
|
|
4863
5673
|
] }),
|
|
4864
|
-
/* @__PURE__ */ (0,
|
|
4865
|
-
/* @__PURE__ */ (0,
|
|
4866
|
-
/* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
5674
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(AccountRow, { children: [
|
|
5675
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5676
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[#5865F2]", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: "discord", size: "small", color: "currentColor" }) }),
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "Discord" })
|
|
4868
5678
|
] }),
|
|
4869
|
-
(discord == null ? void 0 : discord.connected) ? /* @__PURE__ */ (0,
|
|
5679
|
+
(discord == null ? void 0 : discord.connected) ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DisconnectTextButton, { onClick: onDisconnectDiscord }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ConnectTextButton, { onClick: onConnectDiscord })
|
|
4870
5680
|
] }),
|
|
4871
|
-
/* @__PURE__ */ (0,
|
|
4872
|
-
/* @__PURE__ */ (0,
|
|
4873
|
-
/* @__PURE__ */ (0,
|
|
4874
|
-
/* @__PURE__ */ (0,
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(AccountRow, { children: [
|
|
5682
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5683
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-[#26A5E4]", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: "telegram", size: "small", color: "currentColor" }) }),
|
|
5684
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: "Telegram" })
|
|
4875
5685
|
] }),
|
|
4876
|
-
(telegram == null ? void 0 : telegram.connected) ? /* @__PURE__ */ (0,
|
|
5686
|
+
(telegram == null ? void 0 : telegram.connected) ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DisconnectTextButton, { onClick: onDisconnectTelegram }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ConnectTextButton, { onClick: onConnectTelegram })
|
|
4877
5687
|
] })
|
|
4878
5688
|
] })
|
|
4879
5689
|
] }),
|
|
4880
|
-
/* @__PURE__ */ (0,
|
|
4881
|
-
/* @__PURE__ */ (0,
|
|
4882
|
-
/* @__PURE__ */ (0,
|
|
5690
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
5691
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SectionTitle, { children: "Email Address" }),
|
|
5692
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
4883
5693
|
"button",
|
|
4884
5694
|
{
|
|
4885
5695
|
type: "button",
|
|
@@ -4891,11 +5701,11 @@ var AccountsWalletsTab = ({
|
|
|
4891
5701
|
"cursor-pointer hover:bg-agg-secondary-hover"
|
|
4892
5702
|
),
|
|
4893
5703
|
children: [
|
|
4894
|
-
/* @__PURE__ */ (0,
|
|
4895
|
-
/* @__PURE__ */ (0,
|
|
4896
|
-
/* @__PURE__ */ (0,
|
|
5704
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5705
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-agg-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: "email", size: "small", color: "currentColor" }) }),
|
|
5706
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-agg-base font-agg-normal leading-6 text-agg-foreground whitespace-nowrap", children: email != null ? email : "Connect email" })
|
|
4897
5707
|
] }),
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Icon, { name: "chevron-right", size: "small", color: "currentColor" })
|
|
4899
5709
|
]
|
|
4900
5710
|
}
|
|
4901
5711
|
)
|
|
@@ -4905,7 +5715,7 @@ var AccountsWalletsTab = ({
|
|
|
4905
5715
|
AccountsWalletsTab.displayName = "AccountsWalletsTab";
|
|
4906
5716
|
|
|
4907
5717
|
// src/profile/index.tsx
|
|
4908
|
-
var
|
|
5718
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4909
5719
|
var ProfileModal = ({
|
|
4910
5720
|
open,
|
|
4911
5721
|
onOpenChange,
|
|
@@ -4925,15 +5735,15 @@ var ProfileModal = ({
|
|
|
4925
5735
|
onDisconnectTelegram,
|
|
4926
5736
|
onConnectEmail
|
|
4927
5737
|
}) => {
|
|
4928
|
-
const [activeTab, setActiveTab] = (0,
|
|
4929
|
-
const [draftUsername, setDraftUsername] = (0,
|
|
4930
|
-
const [draftAvatarFile, setDraftAvatarFile] = (0,
|
|
4931
|
-
const [draftAvatarPreview, setDraftAvatarPreview] = (0,
|
|
4932
|
-
const [isSaving, setIsSaving] = (0,
|
|
4933
|
-
(0,
|
|
5738
|
+
const [activeTab, setActiveTab] = (0, import_react17.useState)(PROFILE_TAB_KEYS.ABOUT);
|
|
5739
|
+
const [draftUsername, setDraftUsername] = (0, import_react17.useState)(username != null ? username : "");
|
|
5740
|
+
const [draftAvatarFile, setDraftAvatarFile] = (0, import_react17.useState)();
|
|
5741
|
+
const [draftAvatarPreview, setDraftAvatarPreview] = (0, import_react17.useState)();
|
|
5742
|
+
const [isSaving, setIsSaving] = (0, import_react17.useState)(false);
|
|
5743
|
+
(0, import_react17.useEffect)(() => {
|
|
4934
5744
|
setDraftUsername(username != null ? username : "");
|
|
4935
5745
|
}, [username]);
|
|
4936
|
-
const handleOpenChange = (0,
|
|
5746
|
+
const handleOpenChange = (0, import_react17.useCallback)(
|
|
4937
5747
|
(isOpen) => {
|
|
4938
5748
|
if (!isOpen) {
|
|
4939
5749
|
setActiveTab(PROFILE_TAB_KEYS.ABOUT);
|
|
@@ -4954,7 +5764,7 @@ var ProfileModal = ({
|
|
|
4954
5764
|
setDraftAvatarPreview
|
|
4955
5765
|
]
|
|
4956
5766
|
);
|
|
4957
|
-
const handleDraftAvatarChange = (0,
|
|
5767
|
+
const handleDraftAvatarChange = (0, import_react17.useCallback)(
|
|
4958
5768
|
(file, preview) => {
|
|
4959
5769
|
setDraftAvatarFile(file);
|
|
4960
5770
|
setDraftAvatarPreview(preview);
|
|
@@ -4962,7 +5772,7 @@ var ProfileModal = ({
|
|
|
4962
5772
|
[]
|
|
4963
5773
|
);
|
|
4964
5774
|
const hasChanges = draftUsername !== (username != null ? username : "") || draftAvatarFile !== void 0;
|
|
4965
|
-
const handleSave = (0,
|
|
5775
|
+
const handleSave = (0, import_react17.useCallback)(() => {
|
|
4966
5776
|
setIsSaving(true);
|
|
4967
5777
|
onSave({
|
|
4968
5778
|
username: draftUsername || void 0,
|
|
@@ -4974,16 +5784,16 @@ var ProfileModal = ({
|
|
|
4974
5784
|
onOpenChange(false);
|
|
4975
5785
|
}, 500);
|
|
4976
5786
|
}, [draftUsername, draftAvatarFile, draftAvatarPreview, onSave, onOpenChange]);
|
|
4977
|
-
const handleCancel = (0,
|
|
5787
|
+
const handleCancel = (0, import_react17.useCallback)(() => {
|
|
4978
5788
|
handleOpenChange(false);
|
|
4979
5789
|
}, [handleOpenChange]);
|
|
4980
|
-
return /* @__PURE__ */ (0,
|
|
4981
|
-
/* @__PURE__ */ (0,
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
4983
|
-
/* @__PURE__ */ (0,
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
5790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Modal.Container, { maxWidth: "800px", "aria-label": "Edit Profile", children: [
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Modal.Header, { title: "Edit Profile" }),
|
|
5792
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-col sm:flex-row sm:gap-10", children: [
|
|
5793
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "shrink-0", children: [
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "flex gap-2 sm:hidden mb-6", children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
4985
5795
|
const isActive = activeTab === tab.value;
|
|
4986
|
-
return /* @__PURE__ */ (0,
|
|
5796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
4987
5797
|
"button",
|
|
4988
5798
|
{
|
|
4989
5799
|
type: "button",
|
|
@@ -4996,14 +5806,14 @@ var ProfileModal = ({
|
|
|
4996
5806
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover border-agg-primary" : "font-agg-normal text-agg-foreground border-transparent"
|
|
4997
5807
|
),
|
|
4998
5808
|
children: [
|
|
4999
|
-
/* @__PURE__ */ (0,
|
|
5000
|
-
/* @__PURE__ */ (0,
|
|
5809
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "whitespace-nowrap", children: tab.label })
|
|
5001
5811
|
]
|
|
5002
5812
|
},
|
|
5003
5813
|
tab.value
|
|
5004
5814
|
);
|
|
5005
5815
|
}) }),
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5816
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
5007
5817
|
"nav",
|
|
5008
5818
|
{
|
|
5009
5819
|
className: cn(
|
|
@@ -5018,7 +5828,7 @@ var ProfileModal = ({
|
|
|
5018
5828
|
"aria-label": "Profile sections",
|
|
5019
5829
|
children: PROFILE_TAB_ITEMS.map((tab) => {
|
|
5020
5830
|
const isActive = activeTab === tab.value;
|
|
5021
|
-
return /* @__PURE__ */ (0,
|
|
5831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
5022
5832
|
"button",
|
|
5023
5833
|
{
|
|
5024
5834
|
type: "button",
|
|
@@ -5033,9 +5843,9 @@ var ProfileModal = ({
|
|
|
5033
5843
|
isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
|
|
5034
5844
|
),
|
|
5035
5845
|
children: [
|
|
5036
|
-
isActive ? /* @__PURE__ */ (0,
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
isActive ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
|
|
5848
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
|
|
5039
5849
|
]
|
|
5040
5850
|
},
|
|
5041
5851
|
tab.value
|
|
@@ -5044,8 +5854,8 @@ var ProfileModal = ({
|
|
|
5044
5854
|
}
|
|
5045
5855
|
)
|
|
5046
5856
|
] }),
|
|
5047
|
-
/* @__PURE__ */ (0,
|
|
5048
|
-
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */ (0,
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5858
|
+
activeTab === PROFILE_TAB_KEYS.ABOUT ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
5049
5859
|
AboutTab,
|
|
5050
5860
|
{
|
|
5051
5861
|
username,
|
|
@@ -5058,7 +5868,7 @@ var ProfileModal = ({
|
|
|
5058
5868
|
draftAvatarPreview
|
|
5059
5869
|
}
|
|
5060
5870
|
) : null,
|
|
5061
|
-
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */ (0,
|
|
5871
|
+
activeTab === PROFILE_TAB_KEYS.ACCOUNTS_WALLETS ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
5062
5872
|
AccountsWalletsTab,
|
|
5063
5873
|
{
|
|
5064
5874
|
exchanges,
|
|
@@ -5076,9 +5886,9 @@ var ProfileModal = ({
|
|
|
5076
5886
|
) : null
|
|
5077
5887
|
] })
|
|
5078
5888
|
] }) }),
|
|
5079
|
-
/* @__PURE__ */ (0,
|
|
5080
|
-
/* @__PURE__ */ (0,
|
|
5081
|
-
/* @__PURE__ */ (0,
|
|
5889
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Modal.Footer, { children: [
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
5082
5892
|
Button,
|
|
5083
5893
|
{
|
|
5084
5894
|
variant: "primary",
|
|
@@ -5101,6 +5911,7 @@ ProfileModal.displayName = "ProfileModal";
|
|
|
5101
5911
|
DepositModal,
|
|
5102
5912
|
HowItWorksStep,
|
|
5103
5913
|
OnboardingModal,
|
|
5914
|
+
OnrampModal,
|
|
5104
5915
|
ProfileModal,
|
|
5105
5916
|
ProfileSetupStep,
|
|
5106
5917
|
WithdrawModal
|