@agg-build/ui 2.4.6 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/chunk-AHQA3B7D.mjs +947 -0
  2. package/dist/{chunk-CXSIXL7M.mjs → chunk-AJJ73RM4.mjs} +698 -257
  3. package/dist/{chunk-TEBAR55W.mjs → chunk-EDQ64EKO.mjs} +339 -1084
  4. package/dist/{chunk-GWRFSQQK.mjs → chunk-FAU2VOL6.mjs} +1594 -700
  5. package/dist/{chunk-PTNFXXOV.mjs → chunk-FMYYPNZZ.mjs} +904 -788
  6. package/dist/{chunk-UH3DUTMG.mjs → chunk-JQKJDSTW.mjs} +1 -1
  7. package/dist/{chunk-I4X5UNCT.mjs → chunk-XAG432PJ.mjs} +12 -6
  8. package/dist/events.js +1077 -999
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +16499 -14884
  11. package/dist/index.mjs +56 -18
  12. package/dist/modals.js +1292 -1084
  13. package/dist/modals.mjs +10 -10
  14. package/dist/pages.js +4954 -2639
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +905 -788
  17. package/dist/primitives.mjs +3 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +3383 -1508
  21. package/dist/trading.mjs +6 -4
  22. package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +2 -0
  23. package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +2 -0
  24. package/dist/types/auth/connect-button-view/index.d.mts +1 -1
  25. package/dist/types/auth/connect-button-view/index.d.ts +1 -1
  26. package/dist/types/onboarding/steps/connect-kalshi-modal.d.mts +1 -1
  27. package/dist/types/onboarding/steps/connect-kalshi-modal.d.ts +1 -1
  28. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +2 -1
  29. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +2 -1
  30. package/dist/types/pages/user-profile/components/open-order-row.d.mts +10 -1
  31. package/dist/types/pages/user-profile/components/open-order-row.d.ts +10 -1
  32. package/dist/types/pages/user-profile/components/positions-activity.d.mts +4 -1
  33. package/dist/types/pages/user-profile/components/positions-activity.d.ts +4 -1
  34. package/dist/types/pages/user-profile/components/positions-value-card.d.mts +4 -2
  35. package/dist/types/pages/user-profile/components/positions-value-card.d.ts +4 -2
  36. package/dist/types/pages/user-profile/index.d.mts +2 -2
  37. package/dist/types/pages/user-profile/index.d.ts +2 -2
  38. package/dist/types/pages/user-profile/user-profile.types.d.mts +12 -0
  39. package/dist/types/pages/user-profile/user-profile.types.d.ts +12 -0
  40. package/dist/types/primitives/calendar/index.d.mts +8 -0
  41. package/dist/types/primitives/calendar/index.d.ts +8 -0
  42. package/dist/types/primitives/icon/registry.d.mts +3 -0
  43. package/dist/types/primitives/icon/registry.d.ts +3 -0
  44. package/dist/types/primitives/icon/svg/calendar.d.mts +2 -0
  45. package/dist/types/primitives/icon/svg/calendar.d.ts +2 -0
  46. package/dist/types/primitives/icon/svg/minus.d.mts +2 -0
  47. package/dist/types/primitives/icon/svg/minus.d.ts +2 -0
  48. package/dist/types/primitives/icon/svg/plus.d.mts +2 -0
  49. package/dist/types/primitives/icon/svg/plus.d.ts +2 -0
  50. package/dist/types/primitives/index.d.mts +1 -0
  51. package/dist/types/primitives/index.d.ts +1 -0
  52. package/dist/types/profile/index.d.mts +1 -1
  53. package/dist/types/profile/index.d.ts +1 -1
  54. package/dist/types/profile/profile-modal.types.d.mts +6 -0
  55. package/dist/types/profile/profile-modal.types.d.ts +6 -0
  56. package/dist/types/profile/tabs/trading-access-tab.d.mts +3 -1
  57. package/dist/types/profile/tabs/trading-access-tab.d.ts +3 -1
  58. package/dist/types/trading/fund-kalshi-modal.d.mts +8 -0
  59. package/dist/types/trading/fund-kalshi-modal.d.ts +8 -0
  60. package/dist/types/trading/index.d.mts +1 -0
  61. package/dist/types/trading/index.d.ts +1 -0
  62. package/dist/types/trading/place-order/index.d.mts +1 -1
  63. package/dist/types/trading/place-order/index.d.ts +1 -1
  64. package/dist/types/trading/place-order/index.place-order.types.d.mts +13 -1
  65. package/dist/types/trading/place-order/index.place-order.types.d.ts +13 -1
  66. package/dist/types/trading/place-order/index.place-order.utils.d.mts +18 -1
  67. package/dist/types/trading/place-order/index.place-order.utils.d.ts +18 -1
  68. package/package.json +7 -4
  69. package/dist/chunk-JVRTJQPZ.mjs +0 -59
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
+ ConnectKalshiModal,
3
4
  dispatchAggDepositNotification
4
- } from "./chunk-JVRTJQPZ.mjs";
5
+ } from "./chunk-AHQA3B7D.mjs";
5
6
  import {
6
- BestPricesIcon,
7
7
  BoltIcon,
8
8
  Button,
9
9
  CheckCircleIcon,
@@ -11,19 +11,13 @@ import {
11
11
  ChevronRightIcon,
12
12
  CloseIcon,
13
13
  CopyButton,
14
- CreateAccountIcon,
15
14
  CreditCardIcon,
16
- DocumentIcon,
17
15
  ExternalLinkIcon,
18
16
  Icon,
19
- LinkAccountsIcon,
20
17
  LoadingIcon,
21
18
  Modal,
22
- PlaySquareIcon,
23
- ProfileIcon,
24
19
  RemoteImage,
25
20
  Select,
26
- StayInControlIcon,
27
21
  SuccessCheckIcon,
28
22
  Tabs,
29
23
  Tooltip,
@@ -41,7 +35,7 @@ import {
41
35
  shortenAddress,
42
36
  useOptionalToast,
43
37
  venueLogoLabels
44
- } from "./chunk-PTNFXXOV.mjs";
38
+ } from "./chunk-FMYYPNZZ.mjs";
45
39
 
46
40
  // src/deposit/index.tsx
47
41
  import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
@@ -2487,800 +2481,10 @@ var WithdrawModal = (props) => {
2487
2481
  };
2488
2482
  WithdrawModal.displayName = "WithdrawModal";
2489
2483
 
2490
- // src/onboarding/index.tsx
2491
- import { useCallback as useCallback6, useEffect as useEffect5, useState as useState8 } from "react";
2492
- import { useLabels as useLabels20 } from "@agg-build/hooks";
2493
- import * as Dialog3 from "@radix-ui/react-dialog";
2494
-
2495
- // src/onboarding/onboarding-modal.constants.ts
2496
- import { isVenueActive, Venue } from "@agg-build/sdk";
2497
- var HOW_IT_WORKS_FEATURE_KEYS = [
2498
- "createAccount",
2499
- "linkAccounts",
2500
- "bestPrices",
2501
- "stayInControl"
2502
- ];
2503
- var ONBOARDING_STEPS = {
2504
- HOW_IT_WORKS: 0,
2505
- PROFILE_SETUP: 1,
2506
- CONNECT_ACCOUNTS: 2
2507
- };
2508
- var ONCHAIN_VENUES = [
2509
- Venue.polymarket,
2510
- Venue.opinion,
2511
- Venue.predict
2512
- ].filter(isVenueActive);
2513
-
2514
- // src/onboarding/steps/how-it-works.tsx
2515
- import { useCallback as useCallback2, useRef as useRef2, useState as useState4 } from "react";
2516
- import { useLabels as useLabels15 } from "@agg-build/hooks";
2517
- import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
2518
- var defaultIcons = {
2519
- createAccount: /* @__PURE__ */ jsx17(CreateAccountIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
2520
- linkAccounts: /* @__PURE__ */ jsx17(LinkAccountsIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
2521
- bestPrices: /* @__PURE__ */ jsx17(BestPricesIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" }),
2522
- stayInControl: /* @__PURE__ */ jsx17(StayInControlIcon, { className: "h-[28px] w-[28px] text-agg-muted-foreground" })
2523
- };
2524
- var HowItWorksStep = ({ onContinue, icons }) => {
2525
- const labels = useLabels15();
2526
- const scrollRef = useRef2(null);
2527
- const [showTopGradient, setShowTopGradient] = useState4(false);
2528
- const [showBottomGradient, setShowBottomGradient] = useState4(true);
2529
- const handleScroll = useCallback2(() => {
2530
- const el = scrollRef.current;
2531
- if (!el) return;
2532
- setShowTopGradient(el.scrollTop > 0);
2533
- setShowBottomGradient(el.scrollTop + el.clientHeight < el.scrollHeight - 1);
2534
- }, []);
2535
- return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-6 h-[600px] sm:h-auto", children: [
2536
- /* @__PURE__ */ jsx17("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.howItWorks.title }),
2537
- /* @__PURE__ */ jsxs17("div", { className: "relative flex-1 min-h-0 sm:flex-initial", children: [
2538
- /* @__PURE__ */ jsx17(
2539
- "div",
2540
- {
2541
- ref: scrollRef,
2542
- onScroll: handleScroll,
2543
- className: "flex flex-col gap-4 overflow-y-auto sm:overflow-visible h-full",
2544
- children: HOW_IT_WORKS_FEATURE_KEYS.map((featureKey) => {
2545
- var _a;
2546
- const icon = (_a = icons == null ? void 0 : icons[featureKey]) != null ? _a : defaultIcons[featureKey];
2547
- const feature = labels.onboarding.howItWorks.features[featureKey];
2548
- return /* @__PURE__ */ jsxs17(
2549
- "div",
2550
- {
2551
- className: cn(
2552
- "flex items-center gap-4 py-4 px-5 sm:px-4",
2553
- "rounded-agg-md",
2554
- "bg-agg-secondary-hover"
2555
- ),
2556
- children: [
2557
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-col flex-1 min-w-0 gap-[6px]", children: [
2558
- /* @__PURE__ */ jsx17("p", { className: "text-agg-base font-agg-bold leading-agg-6 text-agg-foreground", children: feature.title }),
2559
- /* @__PURE__ */ jsx17("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: feature.description })
2560
- ] }),
2561
- icon ? /* @__PURE__ */ jsx17("div", { className: "hidden shrink-0 items-center justify-center text-agg-muted-foreground sm:flex", children: icon }) : null
2562
- ]
2563
- },
2564
- featureKey
2565
- );
2566
- })
2567
- }
2568
- ),
2569
- /* @__PURE__ */ jsx17(
2570
- "div",
2571
- {
2572
- className: cn(
2573
- "pointer-events-none absolute inset-x-0 top-0 h-20",
2574
- "bg-gradient-to-b from-agg-secondary to-transparent",
2575
- "sm:hidden transition-opacity",
2576
- showTopGradient ? "opacity-100" : "opacity-0"
2577
- )
2578
- }
2579
- ),
2580
- /* @__PURE__ */ jsx17(
2581
- "div",
2582
- {
2583
- className: cn(
2584
- "pointer-events-none absolute inset-x-0 bottom-0 h-20",
2585
- "bg-gradient-to-t from-agg-secondary to-transparent",
2586
- "sm:hidden transition-opacity",
2587
- showBottomGradient ? "opacity-100" : "opacity-0"
2588
- )
2589
- }
2590
- )
2591
- ] }),
2592
- /* @__PURE__ */ jsx17(Button, { variant: "primary", size: "large", className: "w-full", onClick: onContinue, children: labels.onboarding.howItWorks.continue })
2593
- ] });
2594
- };
2595
- HowItWorksStep.displayName = "HowItWorksStep";
2596
-
2597
- // src/onboarding/steps/profile-setup.tsx
2598
- import { useCallback as useCallback3, useRef as useRef3, useState as useState5 } from "react";
2599
- import { useLabels as useLabels16 } from "@agg-build/hooks";
2600
- import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
2601
- var ProfileSetupStep = ({ onContinue }) => {
2602
- const labels = useLabels16();
2603
- const [username, setUsername] = useState5("");
2604
- const [avatarFile, setAvatarFile] = useState5();
2605
- const [avatarPreview, setAvatarPreview] = useState5();
2606
- const fileInputRef = useRef3(null);
2607
- const handleAvatarClick = useCallback3(() => {
2608
- var _a;
2609
- (_a = fileInputRef.current) == null ? void 0 : _a.click();
2610
- }, []);
2611
- const handleFileChange = useCallback3((e) => {
2612
- var _a;
2613
- const file = (_a = e.target.files) == null ? void 0 : _a[0];
2614
- if (!file) return;
2615
- setAvatarFile(file);
2616
- const reader = new FileReader();
2617
- reader.onload = (event) => {
2618
- var _a2;
2619
- setAvatarPreview((_a2 = event.target) == null ? void 0 : _a2.result);
2620
- };
2621
- reader.readAsDataURL(file);
2622
- }, []);
2623
- const handleContinue = useCallback3(() => {
2624
- onContinue({
2625
- username,
2626
- avatarFile,
2627
- avatarPreview
2628
- });
2629
- }, [username, avatarFile, avatarPreview, onContinue]);
2630
- return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-7", children: [
2631
- /* @__PURE__ */ jsx18("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.profileSetup.title }),
2632
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-5 items-center w-full", children: [
2633
- /* @__PURE__ */ jsxs18("div", { className: "flex justify-center", children: [
2634
- /* @__PURE__ */ jsxs18(
2635
- "button",
2636
- {
2637
- type: "button",
2638
- onClick: handleAvatarClick,
2639
- className: cn(
2640
- "group relative flex items-center justify-center",
2641
- "h-[80px] w-[80px]",
2642
- "rounded-agg-full",
2643
- "bg-agg-secondary-hover",
2644
- !avatarPreview && "hover:bg-agg-tertiary",
2645
- "transition-colors cursor-pointer",
2646
- "overflow-hidden"
2647
- ),
2648
- "aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
2649
- children: [
2650
- !avatarPreview ? /* @__PURE__ */ jsx18(
2651
- "svg",
2652
- {
2653
- "aria-hidden": true,
2654
- viewBox: "0 0 80 80",
2655
- className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
2656
- children: /* @__PURE__ */ jsx18(
2657
- "circle",
2658
- {
2659
- cx: "40",
2660
- cy: "40",
2661
- r: "39.5",
2662
- fill: "none",
2663
- stroke: "currentColor",
2664
- strokeWidth: "1",
2665
- strokeDasharray: "8 8"
2666
- }
2667
- )
2668
- }
2669
- ) : null,
2670
- avatarPreview ? /* @__PURE__ */ jsx18(
2671
- RemoteImage,
2672
- {
2673
- src: avatarPreview,
2674
- alt: labels.onboarding.profileSetup.profilePreviewAlt,
2675
- className: "h-full w-full object-cover"
2676
- }
2677
- ) : /* @__PURE__ */ jsx18(ProfileIcon, { className: "h-7 w-7 text-agg-muted-foreground" })
2678
- ]
2679
- }
2680
- ),
2681
- /* @__PURE__ */ jsx18(
2682
- "input",
2683
- {
2684
- ref: fileInputRef,
2685
- type: "file",
2686
- accept: "image/*",
2687
- onChange: handleFileChange,
2688
- className: "hidden",
2689
- "aria-hidden": "true"
2690
- }
2691
- )
2692
- ] }),
2693
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2 w-full", children: [
2694
- /* @__PURE__ */ jsx18(
2695
- "label",
2696
- {
2697
- htmlFor: "onboarding-username",
2698
- className: "text-agg-sm font-agg-bold text-agg-foreground",
2699
- children: labels.onboarding.profileSetup.usernameLabel
2700
- }
2701
- ),
2702
- /* @__PURE__ */ jsx18(
2703
- "input",
2704
- {
2705
- id: "onboarding-username",
2706
- type: "text",
2707
- value: username,
2708
- onChange: (e) => setUsername(e.target.value),
2709
- placeholder: labels.onboarding.profileSetup.usernamePlaceholder,
2710
- className: cn(
2711
- "w-full px-3 py-2.5",
2712
- "rounded-[4px]",
2713
- "border border-agg-separator",
2714
- "bg-agg-secondary text-agg-foreground",
2715
- "placeholder:text-agg-muted-foreground",
2716
- "outline-none",
2717
- "hover:bg-agg-secondary-hover",
2718
- "focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
2719
- "transition-colors",
2720
- "text-agg-sm sm:text-agg-base"
2721
- )
2722
- }
2723
- )
2724
- ] })
2725
- ] }),
2726
- /* @__PURE__ */ jsx18(Button, { variant: "primary", size: "large", className: "w-full", onClick: handleContinue, children: labels.onboarding.profileSetup.continue })
2727
- ] });
2728
- };
2729
- ProfileSetupStep.displayName = "ProfileSetupStep";
2730
-
2731
- // src/onboarding/steps/connect-accounts.tsx
2732
- import { useLabels as useLabels17 } from "@agg-build/hooks";
2733
- import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
2734
- var OnchainVenueLogos = () => {
2735
- return /* @__PURE__ */ jsx19("div", { className: "flex gap-1 sm:gap-0 sm:-space-x-5", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsx19("div", { style: { zIndex: ONCHAIN_VENUES.length - index }, children: /* @__PURE__ */ jsx19(VenueLogo, { venue, variant: "logo", size: "medium", className: "sm:h-8 sm:w-8" }) }, venue)) });
2736
- };
2737
- var VenueCard = ({
2738
- logos,
2739
- title,
2740
- mobileTitle,
2741
- description,
2742
- mobileDescription,
2743
- onConnect,
2744
- connected = false
2745
- }) => {
2746
- const labels = useLabels17();
2747
- const action = connected ? /* @__PURE__ */ jsx19(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx19(
2748
- Button,
2749
- {
2750
- variant: "tertiary",
2751
- size: "large",
2752
- className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
2753
- onClick: onConnect,
2754
- children: labels.onboarding.connectAccounts.connect
2755
- }
2756
- );
2757
- const mobileAction = connected ? /* @__PURE__ */ jsx19(CheckCircleIcon, { className: "h-6 w-6 text-agg-success" }) : /* @__PURE__ */ jsx19(
2758
- Button,
2759
- {
2760
- variant: "tertiary",
2761
- size: "medium",
2762
- className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
2763
- onClick: onConnect,
2764
- suffix: /* @__PURE__ */ jsx19(ChevronRightIcon, { className: "h-4 w-4" }),
2765
- children: labels.onboarding.connectAccounts.connectAccount
2766
- }
2767
- );
2768
- return /* @__PURE__ */ jsxs19(
2769
- "div",
2770
- {
2771
- className: cn(
2772
- "rounded-agg-md p-5 transition-colors",
2773
- connected ? "bg-agg-success/5" : "bg-agg-secondary-hover hover:bg-agg-tertiary"
2774
- ),
2775
- children: [
2776
- /* @__PURE__ */ jsxs19("div", { className: "hidden sm:flex items-center justify-between", children: [
2777
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-5", children: [
2778
- /* @__PURE__ */ jsx19("div", { className: "shrink-0", children: logos }),
2779
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-[2px]", children: [
2780
- /* @__PURE__ */ jsx19("p", { className: "text-agg-base font-agg-bold text-agg-foreground", children: title }),
2781
- /* @__PURE__ */ jsx19("p", { className: "text-agg-sm text-agg-foreground", children: description })
2782
- ] })
2783
- ] }),
2784
- /* @__PURE__ */ jsx19("div", { className: "shrink-0", children: action })
2785
- ] }),
2786
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 sm:hidden", children: [
2787
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3", children: [
2788
- /* @__PURE__ */ jsx19("div", { className: "shrink-0", children: logos }),
2789
- /* @__PURE__ */ jsx19("p", { className: "text-agg-lg font-agg-bold text-agg-foreground", children: mobileTitle != null ? mobileTitle : title })
2790
- ] }),
2791
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-col items-start gap-2", children: [
2792
- /* @__PURE__ */ jsx19("p", { className: "text-agg-base text-agg-foreground", children: mobileDescription != null ? mobileDescription : description }),
2793
- mobileAction
2794
- ] })
2795
- ] })
2796
- ]
2797
- }
2798
- );
2799
- };
2800
- var ConnectAccountsStep = ({
2801
- onConnectOnchain,
2802
- onContinue,
2803
- connectedOnchain = false
2804
- }) => {
2805
- const labels = useLabels17();
2806
- const canContinue = connectedOnchain;
2807
- return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-6", children: [
2808
- /* @__PURE__ */ jsx19("h2", { className: "text-center text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectAccounts.title }),
2809
- /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-4", children: /* @__PURE__ */ jsx19(
2810
- VenueCard,
2811
- {
2812
- logos: /* @__PURE__ */ jsx19(OnchainVenueLogos, {}),
2813
- title: labels.onboarding.connectAccounts.onchainTitle,
2814
- mobileTitle: labels.onboarding.connectAccounts.onchainMobileTitle(
2815
- ONCHAIN_VENUES.length - 1
2816
- ),
2817
- description: labels.onboarding.connectAccounts.onchainDescription,
2818
- mobileDescription: labels.onboarding.connectAccounts.onchainMobileDescription,
2819
- onConnect: onConnectOnchain,
2820
- connected: connectedOnchain
2821
- }
2822
- ) }),
2823
- /* @__PURE__ */ jsx19(
2824
- Button,
2825
- {
2826
- variant: "primary",
2827
- size: "large",
2828
- className: "w-full",
2829
- onClick: onContinue,
2830
- disabled: !canContinue,
2831
- children: labels.onboarding.connectAccounts.continue
2832
- }
2833
- )
2834
- ] });
2835
- };
2836
- ConnectAccountsStep.displayName = "ConnectAccountsStep";
2837
-
2838
- // src/onboarding/steps/connect-onchain-modal.tsx
2839
- import { useCallback as useCallback4, useState as useState6 } from "react";
2840
- import { useLabels as useLabels18 } from "@agg-build/hooks";
2841
- import * as Dialog from "@radix-ui/react-dialog";
2842
- import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
2843
- var ConnectOnchainModal = ({
2844
- open,
2845
- onOpenChange,
2846
- onConnect
2847
- }) => {
2848
- const labels = useLabels18();
2849
- const [connecting, setConnecting] = useState6(false);
2850
- const [error, setError] = useState6();
2851
- const handleCancel = useCallback4(() => {
2852
- onOpenChange(false);
2853
- }, [onOpenChange]);
2854
- const handleConnect = useCallback4(() => __async(null, null, function* () {
2855
- if (connecting) return;
2856
- setConnecting(true);
2857
- setError(void 0);
2858
- try {
2859
- yield onConnect();
2860
- onOpenChange(false);
2861
- } catch (err) {
2862
- setError(
2863
- err instanceof Error ? err.message : labels.onboarding.connectOnchainModal.fallbackError
2864
- );
2865
- } finally {
2866
- setConnecting(false);
2867
- }
2868
- }), [connecting, labels.onboarding.connectOnchainModal.fallbackError, onConnect, onOpenChange]);
2869
- const handleOpenChange = useCallback4(
2870
- (value) => {
2871
- if (value) {
2872
- setError(void 0);
2873
- setConnecting(false);
2874
- }
2875
- onOpenChange(value);
2876
- },
2877
- [onOpenChange]
2878
- );
2879
- return /* @__PURE__ */ jsx20(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs20(
2880
- Modal.Container,
2881
- {
2882
- maxWidth: "600px",
2883
- "aria-label": labels.onboarding.connectOnchainModal.ariaLabel,
2884
- classNames: { container: "!rounded-agg-lg" },
2885
- children: [
2886
- /* @__PURE__ */ jsx20(Dialog.Title, { className: "sr-only", children: labels.onboarding.connectOnchainModal.title }),
2887
- /* @__PURE__ */ jsx20(
2888
- Modal.Header,
2889
- {
2890
- hideClose: false,
2891
- hideBorder: true,
2892
- classNames: {
2893
- root: "!min-h-0",
2894
- container: "!py-[18px] !px-8"
2895
- }
2896
- }
2897
- ),
2898
- /* @__PURE__ */ jsx20(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-8 items-center", children: [
2899
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-4 items-center text-center", children: [
2900
- /* @__PURE__ */ jsx20("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectOnchainModal.title }),
2901
- /* @__PURE__ */ jsx20("p", { className: "text-agg-base text-center leading-agg-6 text-agg-foreground whitespace-pre-line", children: labels.onboarding.connectOnchainModal.description })
2902
- ] }),
2903
- /* @__PURE__ */ jsxs20("div", { className: "flex w-full flex-col items-center gap-4 rounded-agg-xl bg-agg-secondary-hover p-6", children: [
2904
- /* @__PURE__ */ jsx20("p", { className: "text-agg-sm font-agg-bold uppercase leading-agg-5 text-agg-muted-foreground", children: labels.onboarding.connectOnchainModal.supportedVenuesLabel }),
2905
- /* @__PURE__ */ jsx20("div", { className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-3", children: ONCHAIN_VENUES.map((venue, index) => /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-[6px]", children: [
2906
- index > 0 && /* @__PURE__ */ jsx20("span", { className: "mr-2.5 h-3 w-px bg-agg-separator" }),
2907
- /* @__PURE__ */ jsx20(VenueLogo, { venue, size: "medium" }),
2908
- /* @__PURE__ */ jsx20("span", { className: "text-agg-base text-agg-foreground", children: labels.venues[venue] })
2909
- ] }, venue)) })
2910
- ] }),
2911
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-6 items-center", children: [
2912
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-3 items-center", children: [
2913
- error ? /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
2914
- /* @__PURE__ */ jsx20(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
2915
- /* @__PURE__ */ jsx20("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
2916
- ] }) : null,
2917
- /* @__PURE__ */ jsx20(
2918
- Button,
2919
- {
2920
- variant: "primary",
2921
- size: "large",
2922
- onClick: handleConnect,
2923
- isLoading: connecting,
2924
- children: labels.onboarding.connectOnchainModal.connect
2925
- }
2926
- )
2927
- ] }),
2928
- /* @__PURE__ */ jsx20(
2929
- Button,
2930
- {
2931
- variant: "tertiary",
2932
- size: "medium",
2933
- className: "!h-auto !px-0 !py-0 text-agg-primary hover:bg-transparent hover:text-agg-primary-hover",
2934
- onClick: handleCancel,
2935
- children: labels.onboarding.connectOnchainModal.cancel
2936
- }
2937
- )
2938
- ] })
2939
- ] }) })
2940
- ]
2941
- }
2942
- ) });
2943
- };
2944
- ConnectOnchainModal.displayName = "ConnectOnchainModal";
2945
-
2946
- // src/onboarding/steps/connect-kalshi-modal.tsx
2947
- import { Venue as Venue2 } from "@agg-build/sdk";
2948
- import { useCallback as useCallback5, useState as useState7 } from "react";
2949
- import { useLabels as useLabels19 } from "@agg-build/hooks";
2950
- import * as Dialog2 from "@radix-ui/react-dialog";
2951
- import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
2952
- var ConnectKalshiModal = ({
2953
- open,
2954
- onOpenChange,
2955
- onVerify
2956
- }) => {
2957
- const labels = useLabels19();
2958
- const [apiKeyId, setApiKeyId] = useState7("");
2959
- const [privateKey, setPrivateKey] = useState7("");
2960
- const [verifying, setVerifying] = useState7(false);
2961
- const [error, setError] = useState7();
2962
- const canVerify = apiKeyId.trim().length > 0 && privateKey.trim().length > 0;
2963
- const handleCancel = useCallback5(() => {
2964
- onOpenChange(false);
2965
- }, [onOpenChange]);
2966
- const handleVerify = useCallback5(() => __async(null, null, function* () {
2967
- if (!canVerify || verifying) return;
2968
- setVerifying(true);
2969
- setError(void 0);
2970
- try {
2971
- const credentials = {
2972
- apiKeyId: apiKeyId.trim(),
2973
- privateKey: privateKey.trim()
2974
- };
2975
- yield onVerify(credentials);
2976
- setApiKeyId("");
2977
- setPrivateKey("");
2978
- onOpenChange(false);
2979
- } catch (err) {
2980
- setError(
2981
- err instanceof Error ? err.message : labels.onboarding.connectKalshiModal.fallbackError
2982
- );
2983
- } finally {
2984
- setVerifying(false);
2985
- }
2986
- }), [
2987
- apiKeyId,
2988
- canVerify,
2989
- labels.onboarding.connectKalshiModal.fallbackError,
2990
- onOpenChange,
2991
- onVerify,
2992
- privateKey,
2993
- verifying
2994
- ]);
2995
- const handleOpenChange = useCallback5(
2996
- (value) => {
2997
- if (value) {
2998
- setApiKeyId("");
2999
- setPrivateKey("");
3000
- setError(void 0);
3001
- setVerifying(false);
3002
- }
3003
- onOpenChange(value);
3004
- },
3005
- [onOpenChange]
3006
- );
3007
- return /* @__PURE__ */ jsx21(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs21(
3008
- Modal.Container,
3009
- {
3010
- maxWidth: "600px",
3011
- "aria-label": labels.onboarding.connectKalshiModal.ariaLabel,
3012
- classNames: { container: "!rounded-agg-lg" },
3013
- children: [
3014
- /* @__PURE__ */ jsx21(Dialog2.Title, { className: "sr-only", children: labels.onboarding.connectKalshiModal.title }),
3015
- /* @__PURE__ */ jsx21(
3016
- Modal.Header,
3017
- {
3018
- hideClose: false,
3019
- hideBorder: true,
3020
- classNames: {
3021
- root: "!min-h-0",
3022
- container: "!py-[18px] !px-8"
3023
- }
3024
- }
3025
- ),
3026
- /* @__PURE__ */ jsx21(Modal.Body, { classNames: { root: "!px-5 !pt-0 !pb-[60px] sm:!px-8" }, children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-8 items-center", children: [
3027
- /* @__PURE__ */ jsx21(
3028
- VenueLogo,
3029
- {
3030
- venue: Venue2.kalshi,
3031
- variant: "logo",
3032
- size: "large",
3033
- className: "h-[60px] w-[60px]"
3034
- }
3035
- ),
3036
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 items-center text-center", children: [
3037
- /* @__PURE__ */ jsx21("h2", { className: "text-agg-2xl font-agg-bold text-agg-foreground", children: labels.onboarding.connectKalshiModal.title }),
3038
- /* @__PURE__ */ jsx21("p", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: labels.onboarding.connectKalshiModal.description })
3039
- ] }),
3040
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 w-full", children: [
3041
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
3042
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
3043
- /* @__PURE__ */ jsx21("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepOne.label }),
3044
- /* @__PURE__ */ jsx21("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepOne.title })
3045
- ] }),
3046
- /* @__PURE__ */ jsxs21("div", { className: "space-y-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
3047
- /* @__PURE__ */ jsx21("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.signIn }),
3048
- /* @__PURE__ */ jsxs21("p", { children: [
3049
- labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfilePrefix,
3050
- " ",
3051
- /* @__PURE__ */ jsx21("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileText }),
3052
- labels.onboarding.connectKalshiModal.stepOne.instructions.goToProfileSeparator,
3053
- " ",
3054
- /* @__PURE__ */ jsx21("span", { className: "text-agg-foreground underline", children: labels.onboarding.connectKalshiModal.stepOne.instructions.profileUrl })
3055
- ] }),
3056
- /* @__PURE__ */ jsxs21("p", { children: [
3057
- labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeyPrefix,
3058
- " ",
3059
- /* @__PURE__ */ jsx21("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKeyText }),
3060
- labels.onboarding.connectKalshiModal.stepOne.instructions.clickCreateKeySuffix
3061
- ] }),
3062
- /* @__PURE__ */ jsxs21("p", { children: [
3063
- labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsPrefix,
3064
- " ",
3065
- /* @__PURE__ */ jsx21("span", { className: "font-agg-bold", children: labels.onboarding.connectKalshiModal.stepOne.instructions.readWriteText }),
3066
- labels.onboarding.connectKalshiModal.stepOne.instructions.selectPermissionsSuffix
3067
- ] }),
3068
- /* @__PURE__ */ jsx21("p", { children: labels.onboarding.connectKalshiModal.stepOne.instructions.createKey })
3069
- ] }),
3070
- /* @__PURE__ */ jsxs21("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
3071
- labels.onboarding.connectKalshiModal.stepOne.footerLineOne,
3072
- /* @__PURE__ */ jsx21("br", {}),
3073
- labels.onboarding.connectKalshiModal.stepOne.footerLineTwo
3074
- ] })
3075
- ] }),
3076
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 rounded-agg-lg bg-agg-secondary-hover p-4", children: [
3077
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
3078
- /* @__PURE__ */ jsx21("p", { className: "text-agg-xs font-agg-bold uppercase leading-agg-4 text-agg-muted-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.label }),
3079
- /* @__PURE__ */ jsx21("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.title })
3080
- ] }),
3081
- /* @__PURE__ */ jsx21("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: labels.onboarding.connectKalshiModal.stepTwo.description }),
3082
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2", children: [
3083
- /* @__PURE__ */ jsx21(
3084
- "label",
3085
- {
3086
- htmlFor: "kalshi-api-key-id",
3087
- className: "text-agg-sm font-agg-bold text-agg-foreground",
3088
- children: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdLabel
3089
- }
3090
- ),
3091
- /* @__PURE__ */ jsx21(
3092
- "input",
3093
- {
3094
- id: "kalshi-api-key-id",
3095
- type: "text",
3096
- value: apiKeyId,
3097
- onChange: (e) => setApiKeyId(e.target.value),
3098
- placeholder: labels.onboarding.connectKalshiModal.stepTwo.apiKeyIdPlaceholder,
3099
- className: cn(
3100
- "w-full px-3 py-2.5 h-10",
3101
- "rounded border border-agg-separator",
3102
- "bg-agg-secondary text-agg-base text-agg-foreground",
3103
- "placeholder:text-agg-muted-foreground",
3104
- "outline-none",
3105
- "focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
3106
- "transition-colors"
3107
- )
3108
- }
3109
- )
3110
- ] }),
3111
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-2", children: [
3112
- /* @__PURE__ */ jsx21(
3113
- "label",
3114
- {
3115
- htmlFor: "kalshi-private-key",
3116
- className: "text-agg-sm font-agg-bold text-agg-foreground",
3117
- children: labels.onboarding.connectKalshiModal.stepTwo.privateKeyLabel
3118
- }
3119
- ),
3120
- /* @__PURE__ */ jsx21(
3121
- "textarea",
3122
- {
3123
- id: "kalshi-private-key",
3124
- value: privateKey,
3125
- onChange: (e) => setPrivateKey(e.target.value),
3126
- placeholder: labels.onboarding.connectKalshiModal.stepTwo.privateKeyPlaceholder,
3127
- rows: 3,
3128
- className: cn(
3129
- "w-full px-3 py-2.5",
3130
- "rounded border border-agg-separator",
3131
- "bg-agg-secondary text-agg-base text-agg-foreground",
3132
- "placeholder:text-agg-muted-foreground",
3133
- "outline-none resize-none",
3134
- "focus:border-agg-primary focus:ring-1 focus:ring-agg-primary",
3135
- "transition-colors"
3136
- )
3137
- }
3138
- )
3139
- ] })
3140
- ] })
3141
- ] }),
3142
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between w-full", children: [
3143
- /* @__PURE__ */ jsx21("p", { className: "text-agg-base text-agg-foreground", children: labels.onboarding.connectKalshiModal.help.label }),
3144
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-3", children: [
3145
- /* @__PURE__ */ jsxs21(
3146
- "a",
3147
- {
3148
- href: "#",
3149
- className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
3150
- children: [
3151
- /* @__PURE__ */ jsx21(DocumentIcon, { className: "h-4 w-4" }),
3152
- labels.onboarding.connectKalshiModal.help.docsLinkLabel
3153
- ]
3154
- }
3155
- ),
3156
- /* @__PURE__ */ jsx21("span", { className: "h-3 w-px bg-agg-separator" }),
3157
- /* @__PURE__ */ jsxs21(
3158
- "a",
3159
- {
3160
- href: "#",
3161
- className: "flex items-center gap-2 text-agg-base font-agg-bold text-agg-primary hover:text-agg-primary-hover",
3162
- children: [
3163
- /* @__PURE__ */ jsx21(PlaySquareIcon, { className: "h-4 w-4" }),
3164
- labels.onboarding.connectKalshiModal.help.tutorialLinkLabel
3165
- ]
3166
- }
3167
- )
3168
- ] })
3169
- ] }),
3170
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-5 items-center", children: [
3171
- error ? /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
3172
- /* @__PURE__ */ jsx21(WarningIcon, { className: "h-3.5 w-3.5 shrink-0 text-agg-error" }),
3173
- /* @__PURE__ */ jsx21("p", { className: "text-agg-sm leading-agg-5 text-agg-error", children: error })
3174
- ] }) : null,
3175
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-3 justify-center", children: [
3176
- /* @__PURE__ */ jsx21(Button, { variant: "secondary", size: "large", onClick: handleCancel, children: labels.onboarding.connectKalshiModal.actions.cancel }),
3177
- /* @__PURE__ */ jsx21(
3178
- Button,
3179
- {
3180
- variant: "primary",
3181
- size: "large",
3182
- onClick: handleVerify,
3183
- disabled: !canVerify,
3184
- isLoading: verifying,
3185
- children: labels.onboarding.connectKalshiModal.actions.verifyConnection
3186
- }
3187
- )
3188
- ] })
3189
- ] })
3190
- ] }) })
3191
- ]
3192
- }
3193
- ) });
3194
- };
3195
- ConnectKalshiModal.displayName = "ConnectKalshiModal";
3196
-
3197
- // src/onboarding/index.tsx
3198
- import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
3199
- var OnboardingModal = ({
3200
- open,
3201
- onOpenChange,
3202
- onProfileSubmit,
3203
- onConnectOnchain,
3204
- onComplete,
3205
- howItWorksIcons,
3206
- connectedOnchain = false
3207
- }) => {
3208
- var _a;
3209
- const labels = useLabels20();
3210
- const [step, setStep] = useState8(ONBOARDING_STEPS.HOW_IT_WORKS);
3211
- const stepLabels = {
3212
- [ONBOARDING_STEPS.HOW_IT_WORKS]: labels.onboarding.modal.stepHowItWorks,
3213
- [ONBOARDING_STEPS.PROFILE_SETUP]: labels.onboarding.modal.stepProfileSetup,
3214
- [ONBOARDING_STEPS.CONNECT_ACCOUNTS]: labels.onboarding.modal.stepConnectAccounts
3215
- };
3216
- const resolvedTitle = (_a = stepLabels[step]) != null ? _a : labels.onboarding.modal.title;
3217
- const [onchainModalOpen, setOnchainModalOpen] = useState8(false);
3218
- const [onchainConnected, setOnchainConnected] = useState8(false);
3219
- useEffect5(() => {
3220
- if (open) {
3221
- setStep(ONBOARDING_STEPS.HOW_IT_WORKS);
3222
- setOnchainConnected(false);
3223
- }
3224
- }, [open]);
3225
- const handleHowItWorksContinue = useCallback6(() => {
3226
- setStep(ONBOARDING_STEPS.PROFILE_SETUP);
3227
- }, []);
3228
- const handleProfileContinue = useCallback6(
3229
- (data) => {
3230
- onProfileSubmit == null ? void 0 : onProfileSubmit(data);
3231
- setStep(ONBOARDING_STEPS.CONNECT_ACCOUNTS);
3232
- },
3233
- [onProfileSubmit]
3234
- );
3235
- const handleConnectContinue = useCallback6(() => {
3236
- onComplete == null ? void 0 : onComplete();
3237
- }, [onComplete]);
3238
- const handleOpenOnchainModal = useCallback6(() => {
3239
- setOnchainModalOpen(true);
3240
- }, []);
3241
- const handleOnchainConnect = useCallback6(() => __async(null, null, function* () {
3242
- yield onConnectOnchain == null ? void 0 : onConnectOnchain();
3243
- setOnchainConnected(true);
3244
- }), [onConnectOnchain]);
3245
- return /* @__PURE__ */ jsxs22(Fragment9, { children: [
3246
- /* @__PURE__ */ jsx22(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs22(
3247
- Modal.Container,
3248
- {
3249
- maxWidth: "600px",
3250
- "aria-label": resolvedTitle,
3251
- classNames: { container: "!rounded-agg-lg" },
3252
- children: [
3253
- /* @__PURE__ */ jsx22(Dialog3.Title, { className: "sr-only", children: resolvedTitle }),
3254
- /* @__PURE__ */ jsxs22(Modal.Body, { classNames: { root: "px-5 py-6 sm:px-10 sm:py-8" }, children: [
3255
- step === ONBOARDING_STEPS.HOW_IT_WORKS && /* @__PURE__ */ jsx22(HowItWorksStep, { onContinue: handleHowItWorksContinue, icons: howItWorksIcons }),
3256
- step === ONBOARDING_STEPS.PROFILE_SETUP && /* @__PURE__ */ jsx22(ProfileSetupStep, { onContinue: handleProfileContinue }),
3257
- step === ONBOARDING_STEPS.CONNECT_ACCOUNTS && /* @__PURE__ */ jsx22(
3258
- ConnectAccountsStep,
3259
- {
3260
- onConnectOnchain: handleOpenOnchainModal,
3261
- onContinue: handleConnectContinue,
3262
- connectedOnchain: connectedOnchain || onchainConnected
3263
- }
3264
- )
3265
- ] })
3266
- ]
3267
- }
3268
- ) }),
3269
- /* @__PURE__ */ jsx22(
3270
- ConnectOnchainModal,
3271
- {
3272
- open: onchainModalOpen,
3273
- onOpenChange: setOnchainModalOpen,
3274
- onConnect: handleOnchainConnect
3275
- }
3276
- )
3277
- ] });
3278
- };
3279
- OnboardingModal.displayName = "OnboardingModal";
3280
-
3281
2484
  // src/profile/index.tsx
3282
- import { useState as useState10, useEffect as useEffect7, useCallback as useCallback9, useMemo as useMemo3 } from "react";
3283
- import { useAggClient as useAggClient2, useAggAuthState as useAggAuthState2 } from "@agg-build/hooks";
2485
+ import { useState as useState4, useEffect as useEffect5, useCallback as useCallback3, useMemo as useMemo3 } from "react";
2486
+ import { useAggClient, useAggAuthState as useAggAuthState2, useVenueKeyStatus } from "@agg-build/hooks";
2487
+ import { Venue } from "@agg-build/sdk";
3284
2488
 
3285
2489
  // src/profile/profile-modal.constants.ts
3286
2490
  var PROFILE_TAB_KEYS = {
@@ -3297,9 +2501,9 @@ var PROFILE_TAB_ITEMS = [
3297
2501
  ];
3298
2502
 
3299
2503
  // src/profile/tabs/about-tab.tsx
3300
- import { useCallback as useCallback7, useRef as useRef4 } from "react";
3301
- import { useLabels as useLabels21 } from "@agg-build/hooks";
3302
- import { jsx as jsx23, jsxs as jsxs23 } from "react/jsx-runtime";
2504
+ import { useCallback as useCallback2, useRef as useRef2 } from "react";
2505
+ import { useLabels as useLabels15 } from "@agg-build/hooks";
2506
+ import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
3303
2507
  var AboutTab = ({
3304
2508
  avatarPreview,
3305
2509
  onDeleteProfile: _onDeleteProfile,
@@ -3309,13 +2513,13 @@ var AboutTab = ({
3309
2513
  draftAvatarPreview,
3310
2514
  avatarError: _avatarError
3311
2515
  }) => {
3312
- const labels = useLabels21();
3313
- const fileInputRef = useRef4(null);
3314
- const handleAvatarClick = useCallback7(() => {
2516
+ const labels = useLabels15();
2517
+ const fileInputRef = useRef2(null);
2518
+ const handleAvatarClick = useCallback2(() => {
3315
2519
  var _a;
3316
2520
  (_a = fileInputRef.current) == null ? void 0 : _a.click();
3317
2521
  }, []);
3318
- const handleFileChange = useCallback7(
2522
+ const handleFileChange = useCallback2(
3319
2523
  (e) => {
3320
2524
  var _a;
3321
2525
  const file = (_a = e.target.files) == null ? void 0 : _a[0];
@@ -3331,8 +2535,8 @@ var AboutTab = ({
3331
2535
  );
3332
2536
  const resolvedPreview = draftAvatarPreview != null ? draftAvatarPreview : avatarPreview;
3333
2537
  const hasAvatarPreview = Boolean(resolvedPreview);
3334
- return /* @__PURE__ */ jsx23("div", { className: "agg-profile-about flex flex-col gap-8", children: /* @__PURE__ */ jsxs23("div", { className: "agg-profile-avatar-section flex w-full items-center gap-6", children: [
3335
- /* @__PURE__ */ jsxs23(
2538
+ return /* @__PURE__ */ jsx17("div", { className: "agg-profile-about flex flex-col gap-8", children: /* @__PURE__ */ jsxs17("div", { className: "agg-profile-avatar-section flex w-full items-center gap-6", children: [
2539
+ /* @__PURE__ */ jsxs17(
3336
2540
  "button",
3337
2541
  {
3338
2542
  type: "button",
@@ -3349,13 +2553,13 @@ var AboutTab = ({
3349
2553
  ),
3350
2554
  "aria-label": labels.onboarding.profileSetup.uploadProfilePictureAria,
3351
2555
  children: [
3352
- !hasAvatarPreview ? /* @__PURE__ */ jsx23(
2556
+ !hasAvatarPreview ? /* @__PURE__ */ jsx17(
3353
2557
  "svg",
3354
2558
  {
3355
2559
  "aria-hidden": true,
3356
2560
  viewBox: "0 0 80 80",
3357
2561
  className: "pointer-events-none absolute inset-0 h-full w-full text-agg-separator group-hover:text-agg-muted-foreground",
3358
- children: /* @__PURE__ */ jsx23(
2562
+ children: /* @__PURE__ */ jsx17(
3359
2563
  "circle",
3360
2564
  {
3361
2565
  cx: "40",
@@ -3369,18 +2573,18 @@ var AboutTab = ({
3369
2573
  )
3370
2574
  }
3371
2575
  ) : null,
3372
- resolvedPreview ? /* @__PURE__ */ jsx23(
2576
+ resolvedPreview ? /* @__PURE__ */ jsx17(
3373
2577
  RemoteImage,
3374
2578
  {
3375
2579
  src: resolvedPreview,
3376
2580
  alt: labels.onboarding.profileSetup.profilePreviewAlt,
3377
2581
  className: "h-full w-full object-cover"
3378
2582
  }
3379
- ) : /* @__PURE__ */ jsx23(Icon, { name: "profile", className: "h-7 w-7 text-agg-muted-foreground" })
2583
+ ) : /* @__PURE__ */ jsx17(Icon, { name: "profile", className: "h-7 w-7 text-agg-muted-foreground" })
3380
2584
  ]
3381
2585
  }
3382
2586
  ),
3383
- /* @__PURE__ */ jsx23(
2587
+ /* @__PURE__ */ jsx17(
3384
2588
  "input",
3385
2589
  {
3386
2590
  ref: fileInputRef,
@@ -3391,8 +2595,8 @@ var AboutTab = ({
3391
2595
  "aria-hidden": "true"
3392
2596
  }
3393
2597
  ),
3394
- /* @__PURE__ */ jsxs23("div", { className: "agg-form-section flex min-w-0 flex-1 flex-col gap-2", children: [
3395
- /* @__PURE__ */ jsx23(
2598
+ /* @__PURE__ */ jsxs17("div", { className: "agg-form-section flex min-w-0 flex-1 flex-col gap-2", children: [
2599
+ /* @__PURE__ */ jsx17(
3396
2600
  "label",
3397
2601
  {
3398
2602
  htmlFor: "profile-username",
@@ -3400,7 +2604,7 @@ var AboutTab = ({
3400
2604
  children: "Username"
3401
2605
  }
3402
2606
  ),
3403
- /* @__PURE__ */ jsx23(
2607
+ /* @__PURE__ */ jsx17(
3404
2608
  "input",
3405
2609
  {
3406
2610
  id: "profile-username",
@@ -3427,9 +2631,9 @@ var AboutTab = ({
3427
2631
  AboutTab.displayName = "AboutTab";
3428
2632
 
3429
2633
  // src/profile/tabs/accounts-wallets-tab.tsx
3430
- import { jsx as jsx24, jsxs as jsxs24 } from "react/jsx-runtime";
3431
- var SectionTitle = ({ children }) => /* @__PURE__ */ jsx24("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
3432
- var AccountRow = ({ children, className }) => /* @__PURE__ */ jsx24(
2634
+ import { jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
2635
+ var SectionTitle = ({ children }) => /* @__PURE__ */ jsx18("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
2636
+ var AccountRow = ({ children, className }) => /* @__PURE__ */ jsx18(
3433
2637
  "div",
3434
2638
  {
3435
2639
  className: cn(
@@ -3445,11 +2649,11 @@ var AccountIdentity = ({
3445
2649
  icon,
3446
2650
  label,
3447
2651
  iconClassName
3448
- }) => /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-3", children: [
3449
- /* @__PURE__ */ jsx24("span", { className: cn("flex h-5 w-5 shrink-0 items-center justify-center", iconClassName), children: /* @__PURE__ */ jsx24(Icon, { name: icon, size: "small", color: "currentColor" }) }),
3450
- /* @__PURE__ */ jsx24("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: label })
2652
+ }) => /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 items-center gap-3", children: [
2653
+ /* @__PURE__ */ jsx18("span", { className: cn("flex h-5 w-5 shrink-0 items-center justify-center", iconClassName), children: /* @__PURE__ */ jsx18(Icon, { name: icon, size: "small", color: "currentColor" }) }),
2654
+ /* @__PURE__ */ jsx18("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: label })
3451
2655
  ] });
3452
- var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx24(
2656
+ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx18(
3453
2657
  "button",
3454
2658
  {
3455
2659
  type: "button",
@@ -3458,7 +2662,7 @@ var ConnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx24(
3458
2662
  children: "Connect"
3459
2663
  }
3460
2664
  );
3461
- var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx24(
2665
+ var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx18(
3462
2666
  "button",
3463
2667
  {
3464
2668
  type: "button",
@@ -3467,7 +2671,7 @@ var DisconnectTextButton = ({ onClick }) => /* @__PURE__ */ jsx24(
3467
2671
  children: "Disconnect"
3468
2672
  }
3469
2673
  );
3470
- var VerifiedBadge = () => /* @__PURE__ */ jsx24(Icon, { name: "check-badge", size: "small", color: "var(--agg-color-primary, #536dfe)" });
2674
+ var VerifiedBadge = () => /* @__PURE__ */ jsx18(Icon, { name: "check-badge", size: "small", color: "var(--agg-color-primary, #536dfe)" });
3471
2675
  var getWalletIconName = (wallet) => {
3472
2676
  const chain = wallet.chain.toLowerCase();
3473
2677
  if (chain === "solana" || chain === "svm") {
@@ -3485,12 +2689,12 @@ var ConnectedAccountRow = ({
3485
2689
  onDisconnect
3486
2690
  }) => {
3487
2691
  const displayLabel = connected ? connectedLabel != null ? connectedLabel : label : label;
3488
- return /* @__PURE__ */ jsxs24(AccountRow, { className: "agg-social-account-row gap-4", children: [
3489
- /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-3", children: [
3490
- /* @__PURE__ */ jsx24(AccountIdentity, { icon, label: displayLabel, iconClassName }),
3491
- connected ? /* @__PURE__ */ jsx24(VerifiedBadge, {}) : null
2692
+ return /* @__PURE__ */ jsxs18(AccountRow, { className: "agg-social-account-row gap-4", children: [
2693
+ /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 items-center gap-3", children: [
2694
+ /* @__PURE__ */ jsx18(AccountIdentity, { icon, label: displayLabel, iconClassName }),
2695
+ connected ? /* @__PURE__ */ jsx18(VerifiedBadge, {}) : null
3492
2696
  ] }),
3493
- connected ? /* @__PURE__ */ jsx24(DisconnectTextButton, { onClick: onDisconnect }) : /* @__PURE__ */ jsx24(ConnectTextButton, { onClick: onConnect })
2697
+ connected ? /* @__PURE__ */ jsx18(DisconnectTextButton, { onClick: onDisconnect }) : /* @__PURE__ */ jsx18(ConnectTextButton, { onClick: onConnect })
3494
2698
  ] });
3495
2699
  };
3496
2700
  var AccountsWalletsTab = ({
@@ -3509,11 +2713,11 @@ var AccountsWalletsTab = ({
3509
2713
  const google = socialAccounts == null ? void 0 : socialAccounts.google;
3510
2714
  const apple = socialAccounts == null ? void 0 : socialAccounts.apple;
3511
2715
  const hasEmail = Boolean(email);
3512
- return /* @__PURE__ */ jsxs24("div", { className: "agg-accounts-wallets-tab flex flex-col gap-6", children: [
3513
- /* @__PURE__ */ jsxs24("div", { className: "agg-social-accounts-section flex flex-col gap-3", children: [
3514
- /* @__PURE__ */ jsx24(SectionTitle, { children: "Connected accounts" }),
3515
- /* @__PURE__ */ jsxs24("div", { className: "agg-social-accounts-list flex flex-col gap-4", children: [
3516
- /* @__PURE__ */ jsx24(
2716
+ return /* @__PURE__ */ jsxs18("div", { className: "agg-accounts-wallets-tab flex flex-col gap-6", children: [
2717
+ /* @__PURE__ */ jsxs18("div", { className: "agg-social-accounts-section flex flex-col gap-3", children: [
2718
+ /* @__PURE__ */ jsx18(SectionTitle, { children: "Connected accounts" }),
2719
+ /* @__PURE__ */ jsxs18("div", { className: "agg-social-accounts-list flex flex-col gap-4", children: [
2720
+ /* @__PURE__ */ jsx18(
3517
2721
  ConnectedAccountRow,
3518
2722
  {
3519
2723
  icon: "google",
@@ -3525,7 +2729,7 @@ var AccountsWalletsTab = ({
3525
2729
  onDisconnect: onDisconnectGoogle
3526
2730
  }
3527
2731
  ),
3528
- /* @__PURE__ */ jsx24(
2732
+ /* @__PURE__ */ jsx18(
3529
2733
  ConnectedAccountRow,
3530
2734
  {
3531
2735
  icon: "apple",
@@ -3537,7 +2741,7 @@ var AccountsWalletsTab = ({
3537
2741
  onDisconnect: onDisconnectApple
3538
2742
  }
3539
2743
  ),
3540
- /* @__PURE__ */ jsx24(
2744
+ /* @__PURE__ */ jsx18(
3541
2745
  ConnectedAccountRow,
3542
2746
  {
3543
2747
  icon: "twitter",
@@ -3549,7 +2753,7 @@ var AccountsWalletsTab = ({
3549
2753
  onDisconnect: onDisconnectTwitter
3550
2754
  }
3551
2755
  ),
3552
- /* @__PURE__ */ jsx24(
2756
+ /* @__PURE__ */ jsx18(
3553
2757
  ConnectedAccountRow,
3554
2758
  {
3555
2759
  icon: "email",
@@ -3562,12 +2766,12 @@ var AccountsWalletsTab = ({
3562
2766
  )
3563
2767
  ] })
3564
2768
  ] }),
3565
- wallets.length > 0 ? /* @__PURE__ */ jsxs24("div", { className: "agg-wallets-section flex flex-col gap-3", children: [
3566
- /* @__PURE__ */ jsx24(SectionTitle, { children: "Wallets" }),
3567
- /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-2", children: wallets.map((wallet) => {
2769
+ wallets.length > 0 ? /* @__PURE__ */ jsxs18("div", { className: "agg-wallets-section flex flex-col gap-3", children: [
2770
+ /* @__PURE__ */ jsx18(SectionTitle, { children: "Wallets" }),
2771
+ /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-2", children: wallets.map((wallet) => {
3568
2772
  var _a;
3569
- return /* @__PURE__ */ jsx24(AccountRow, { className: "gap-4", children: /* @__PURE__ */ jsxs24("div", { className: "flex min-w-0 items-center gap-3", children: [
3570
- /* @__PURE__ */ jsx24(
2773
+ return /* @__PURE__ */ jsx18(AccountRow, { className: "gap-4", children: /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 items-center gap-3", children: [
2774
+ /* @__PURE__ */ jsx18(
3571
2775
  AccountIdentity,
3572
2776
  {
3573
2777
  icon: getWalletIconName(wallet),
@@ -3575,7 +2779,7 @@ var AccountsWalletsTab = ({
3575
2779
  label: (_a = wallet.displayAddress) != null ? _a : wallet.address
3576
2780
  }
3577
2781
  ),
3578
- /* @__PURE__ */ jsx24(VerifiedBadge, {})
2782
+ /* @__PURE__ */ jsx18(VerifiedBadge, {})
3579
2783
  ] }) }, `${wallet.chain}:${wallet.address}`);
3580
2784
  }) })
3581
2785
  ] }) : null
@@ -3587,14 +2791,12 @@ AccountsWalletsTab.displayName = "AccountsWalletsTab";
3587
2791
  import {
3588
2792
  getVenueAvailabilityState,
3589
2793
  getVisibleVenuesByConfig,
3590
- useAggClient,
3591
2794
  useAppConfig,
3592
- useDepositAddresses as useDepositAddresses2,
3593
2795
  useGeoBlock,
3594
- useLabels as useLabels22
2796
+ useLabels as useLabels16
3595
2797
  } from "@agg-build/hooks";
3596
- import { useCallback as useCallback8, useEffect as useEffect6, useMemo as useMemo2, useState as useState9 } from "react";
3597
- import { jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
2798
+ import { useMemo as useMemo2 } from "react";
2799
+ import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
3598
2800
  var TRADING_ACCESS_VENUES = [
3599
2801
  "kalshi",
3600
2802
  "polymarket",
@@ -3606,8 +2808,8 @@ var TRADING_ACCESS_VENUES = [
3606
2808
  "hyperliquid"
3607
2809
  ];
3608
2810
  var TRADING_ACCESS_VENUE_ITEMS = TRADING_ACCESS_VENUES.map((id) => ({ id }));
3609
- var SectionTitle2 = ({ children }) => /* @__PURE__ */ jsx25("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
3610
- var AccessRow = ({ children }) => /* @__PURE__ */ jsx25(
2811
+ var SectionTitle2 = ({ children }) => /* @__PURE__ */ jsx19("h3", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children });
2812
+ var AccessRow = ({ children }) => /* @__PURE__ */ jsx19(
3611
2813
  "div",
3612
2814
  {
3613
2815
  className: cn(
@@ -3618,97 +2820,89 @@ var AccessRow = ({ children }) => /* @__PURE__ */ jsx25(
3618
2820
  children
3619
2821
  }
3620
2822
  );
3621
- var VerifyIdentityButton = ({ onError }) => {
3622
- const labels = useLabels22();
3623
- const client = useAggClient();
3624
- const [isInitiating, setIsInitiating] = useState9(false);
3625
- const [needsDepositAddress, setNeedsDepositAddress] = useState9(false);
3626
- const { isReady, isTimedOut } = useDepositAddresses2({
3627
- enabled: needsDepositAddress,
3628
- poll: true
3629
- });
3630
- useEffect6(() => {
3631
- if (!isInitiating || !isReady) return;
3632
- const redirectUri = window.location.href;
3633
- client.initiateKyc("kalshi", redirectUri).then((res) => {
3634
- if (res.kycUrl) {
3635
- window.location.assign(res.kycUrl);
3636
- }
3637
- }).catch((err) => {
3638
- onError == null ? void 0 : onError(err instanceof Error ? err : new Error(String(err)));
3639
- }).finally(() => {
3640
- setIsInitiating(false);
3641
- setNeedsDepositAddress(false);
3642
- });
3643
- }, [isReady, isInitiating, client, onError]);
3644
- useEffect6(() => {
3645
- if (!isTimedOut || !isInitiating) return;
3646
- setIsInitiating(false);
3647
- setNeedsDepositAddress(false);
3648
- onError == null ? void 0 : onError(new Error("Deposit address provisioning timed out"));
3649
- }, [isTimedOut, isInitiating, onError]);
3650
- const handleClick = useCallback8(() => {
3651
- setIsInitiating(true);
3652
- setNeedsDepositAddress(true);
3653
- }, []);
3654
- return /* @__PURE__ */ jsx25(
3655
- "button",
3656
- {
3657
- type: "button",
3658
- disabled: isInitiating,
3659
- onClick: handleClick,
3660
- className: "shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap disabled:cursor-not-allowed disabled:opacity-60",
3661
- children: isInitiating ? /* @__PURE__ */ jsx25("span", { className: "inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }) : labels.trading.kycVerify
3662
- }
3663
- );
2823
+ var AvailableStatus = () => {
2824
+ const labels = useLabels16();
2825
+ return /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
2826
+ /* @__PURE__ */ jsx19(Icon, { name: "check-badge", size: "small", className: "text-agg-primary" }),
2827
+ /* @__PURE__ */ jsx19("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground whitespace-nowrap", children: labels.trading.tradingAccessAvailable })
2828
+ ] });
3664
2829
  };
3665
- var AvailableStatus = () => /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
3666
- /* @__PURE__ */ jsx25(Icon, { name: "check-badge", size: "small", color: "var(--agg-color-primary, #536dfe)" }),
3667
- /* @__PURE__ */ jsx25("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground whitespace-nowrap", children: "Available" })
3668
- ] });
3669
2830
  var GeoblockedStatus = () => {
3670
- const labels = useLabels22();
3671
- return /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2 text-agg-muted-foreground", children: [
3672
- /* @__PURE__ */ jsx25(Icon, { name: "warning-filled", size: "small", color: "currentColor" }),
3673
- /* @__PURE__ */ jsx25("span", { className: "text-agg-sm font-agg-normal leading-agg-5 whitespace-nowrap", children: labels.trading.venueUnavailableInRegion })
2831
+ const labels = useLabels16();
2832
+ return /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 text-agg-muted-foreground", children: [
2833
+ /* @__PURE__ */ jsx19(Icon, { name: "warning-filled", size: "small", color: "currentColor" }),
2834
+ /* @__PURE__ */ jsx19("span", { className: "text-agg-sm font-agg-normal leading-agg-5 whitespace-nowrap", children: labels.trading.venueUnavailableInRegion })
3674
2835
  ] });
3675
2836
  };
3676
2837
  var TradingAccessTab = ({
3677
2838
  venueAccounts,
3678
- onKycError
2839
+ onConnectKalshi,
2840
+ onDisconnectKalshi
3679
2841
  }) => {
3680
- const labels = useLabels22();
3681
- const { disabledVenues } = useAppConfig();
2842
+ var _a, _b, _c, _d;
2843
+ const labels = useLabels16();
2844
+ const verifyConnectionLabel = (_d = (_c = (_b = (_a = labels.onboarding) == null ? void 0 : _a.connectKalshiModal) == null ? void 0 : _b.actions) == null ? void 0 : _c.verifyConnection) != null ? _d : labels.trading.kycVerify;
2845
+ const { disabledVenues, isLoading: isAppConfigLoading } = useAppConfig();
3682
2846
  const { isLocationBlocked } = useGeoBlock();
3683
2847
  const visibleVenues = useMemo2(
3684
2848
  () => getVisibleVenuesByConfig(TRADING_ACCESS_VENUE_ITEMS, disabledVenues),
3685
2849
  [disabledVenues]
3686
2850
  );
3687
- return /* @__PURE__ */ jsxs25("div", { className: "agg-trading-access-section flex flex-col gap-4", children: [
3688
- /* @__PURE__ */ jsx25(SectionTitle2, { children: "Venues" }),
3689
- /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-3", children: visibleVenues.map(({ id: venue }) => {
3690
- var _a;
2851
+ return /* @__PURE__ */ jsxs19("div", { className: "agg-trading-access-section flex flex-col gap-4", children: [
2852
+ /* @__PURE__ */ jsx19(SectionTitle2, { children: labels.trading.tradingAccessVenues }),
2853
+ /* @__PURE__ */ jsx19("div", { className: "flex flex-col gap-3", children: visibleVenues.map(({ id: venue }) => {
2854
+ var _a2;
3691
2855
  const venueAccount = venueAccounts == null ? void 0 : venueAccounts.find((account) => account.venue === venue);
3692
2856
  const isKalshi = venue === "kalshi";
2857
+ const isConnected = (venueAccount == null ? void 0 : venueAccount.status) === "active";
3693
2858
  const isVerified = (venueAccount == null ? void 0 : venueAccount.kycStatus) === "verified";
3694
2859
  const availabilityState = getVenueAvailabilityState({
3695
2860
  venueId: venue,
3696
2861
  disabledVenues,
2862
+ isConfigLoading: isKalshi && isAppConfigLoading,
3697
2863
  isLocationBlocked
3698
2864
  });
3699
- const displayName = (_a = venueLogoLabels[venue]) != null ? _a : venue;
3700
- return /* @__PURE__ */ jsxs25(AccessRow, { children: [
3701
- /* @__PURE__ */ jsxs25("div", { className: "flex min-w-0 items-center gap-3", children: [
3702
- /* @__PURE__ */ jsx25(VenueLogo, { venue, size: "small" }),
3703
- /* @__PURE__ */ jsx25("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: displayName })
2865
+ const displayName = (_a2 = venueLogoLabels[venue]) != null ? _a2 : venue;
2866
+ if (availabilityState === "hidden") return null;
2867
+ return /* @__PURE__ */ jsxs19(AccessRow, { children: [
2868
+ /* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 items-center gap-3", children: [
2869
+ /* @__PURE__ */ jsx19(VenueLogo, { venue, size: "small" }),
2870
+ /* @__PURE__ */ jsx19("span", { className: "truncate text-agg-base font-agg-normal leading-6 text-agg-foreground", children: displayName })
3704
2871
  ] }),
3705
- availabilityState === "geoblocked" ? /* @__PURE__ */ jsx25(GeoblockedStatus, {}) : isKalshi && !isVerified ? /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-4", children: [
3706
- /* @__PURE__ */ jsx25("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground whitespace-nowrap", children: labels.trading.kycRequired }),
3707
- /* @__PURE__ */ jsx25(VerifyIdentityButton, { onError: onKycError })
3708
- ] }) : isKalshi && isVerified ? /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-4", children: [
3709
- /* @__PURE__ */ jsx25("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground whitespace-nowrap", children: labels.trading.verified }),
3710
- /* @__PURE__ */ jsx25(AvailableStatus, {})
3711
- ] }) : /* @__PURE__ */ jsx25(AvailableStatus, {})
2872
+ availabilityState === "geoblocked" ? /* @__PURE__ */ jsx19(GeoblockedStatus, {}) : isKalshi && !isConnected ? /* @__PURE__ */ jsx19(
2873
+ "button",
2874
+ {
2875
+ type: "button",
2876
+ onClick: onConnectKalshi,
2877
+ disabled: !onConnectKalshi,
2878
+ className: "shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-60",
2879
+ children: labels.trading.tradingAccessAddKalshiAccount
2880
+ }
2881
+ ) : isKalshi && !isVerified ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-4", children: [
2882
+ /* @__PURE__ */ jsx19("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground whitespace-nowrap", children: labels.trading.kycRequired }),
2883
+ /* @__PURE__ */ jsx19(
2884
+ "button",
2885
+ {
2886
+ type: "button",
2887
+ onClick: onConnectKalshi,
2888
+ disabled: !onConnectKalshi,
2889
+ className: "min-h-11 shrink-0 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-primary whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary disabled:cursor-not-allowed disabled:opacity-60",
2890
+ children: verifyConnectionLabel
2891
+ }
2892
+ )
2893
+ ] }) : isKalshi && isVerified ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-4", children: [
2894
+ /* @__PURE__ */ jsx19("span", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground whitespace-nowrap", children: labels.trading.verified }),
2895
+ /* @__PURE__ */ jsx19(AvailableStatus, {}),
2896
+ onDisconnectKalshi ? /* @__PURE__ */ jsx19(
2897
+ "button",
2898
+ {
2899
+ type: "button",
2900
+ onClick: onDisconnectKalshi,
2901
+ className: "min-h-11 cursor-pointer text-agg-sm font-agg-bold leading-agg-5 text-agg-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary",
2902
+ children: labels.auth.disconnect
2903
+ }
2904
+ ) : null
2905
+ ] }) : /* @__PURE__ */ jsx19(AvailableStatus, {})
3712
2906
  ] }, venue);
3713
2907
  }) })
3714
2908
  ] });
@@ -3716,7 +2910,7 @@ var TradingAccessTab = ({
3716
2910
  TradingAccessTab.displayName = "TradingAccessTab";
3717
2911
 
3718
2912
  // src/profile/index.tsx
3719
- import { jsx as jsx26, jsxs as jsxs26 } from "react/jsx-runtime";
2913
+ import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
3720
2914
  var ProfileModal = ({
3721
2915
  open,
3722
2916
  onOpenChange,
@@ -3735,24 +2929,35 @@ var ProfileModal = ({
3735
2929
  onDisconnectApple,
3736
2930
  onDisconnectWallet,
3737
2931
  onConnectEmail,
3738
- onKycError
2932
+ onKycError,
2933
+ onConnectKalshi,
2934
+ onDisconnectExchange
3739
2935
  }) => {
3740
2936
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3741
- const client = useAggClient2();
2937
+ const client = useAggClient();
3742
2938
  const { user } = useAggAuthState2();
3743
2939
  const toastCtx = useOptionalToast();
3744
- const [activeTab, setActiveTab] = useState10(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
2940
+ const [activeTab, setActiveTab] = useState4(PROFILE_TAB_KEYS.PROFILE_ACCOUNTS);
3745
2941
  const resolvedInitialUsername = (_a = username != null ? username : user == null ? void 0 : user.username) != null ? _a : "";
3746
- const [draftUsername, setDraftUsername] = useState10(resolvedInitialUsername);
3747
- const [draftAvatarFile, setDraftAvatarFile] = useState10();
3748
- const [draftAvatarPreview, setDraftAvatarPreview] = useState10();
3749
- const [isSaving, setIsSaving] = useState10(false);
3750
- const [avatarTypeError, setAvatarTypeError] = useState10(null);
3751
- useEffect7(() => {
2942
+ const [draftUsername, setDraftUsername] = useState4(resolvedInitialUsername);
2943
+ const [draftAvatarFile, setDraftAvatarFile] = useState4();
2944
+ const [draftAvatarPreview, setDraftAvatarPreview] = useState4();
2945
+ const [isSaving, setIsSaving] = useState4(false);
2946
+ const [avatarTypeError, setAvatarTypeError] = useState4(null);
2947
+ const [isConnectKalshiModalOpen, setIsConnectKalshiModalOpen] = useState4(false);
2948
+ const { data: kalshiStatus, refetch: refetchKalshiStatus } = useVenueKeyStatus(
2949
+ Venue.kalshi,
2950
+ open
2951
+ );
2952
+ useEffect5(() => {
3752
2953
  var _a2;
3753
2954
  setDraftUsername((_a2 = username != null ? username : user == null ? void 0 : user.username) != null ? _a2 : "");
3754
2955
  }, [username, user == null ? void 0 : user.username]);
3755
- const handleOpenChange = useCallback9(
2956
+ useEffect5(() => {
2957
+ if (open) return;
2958
+ setIsConnectKalshiModalOpen(false);
2959
+ }, [open]);
2960
+ const handleOpenChange = useCallback3(
3756
2961
  (isOpen) => {
3757
2962
  var _a2;
3758
2963
  if (!isOpen) {
@@ -3776,7 +2981,7 @@ var ProfileModal = ({
3776
2981
  setDraftAvatarPreview
3777
2982
  ]
3778
2983
  );
3779
- const handleDraftAvatarChange = useCallback9(
2984
+ const handleDraftAvatarChange = useCallback3(
3780
2985
  (file, preview) => {
3781
2986
  const ACCEPTED_AVATAR_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
3782
2987
  if (file && !ACCEPTED_AVATAR_TYPES.includes(file.type)) {
@@ -3791,7 +2996,7 @@ var ProfileModal = ({
3791
2996
  );
3792
2997
  const originalUsername = (_b = username != null ? username : user == null ? void 0 : user.username) != null ? _b : "";
3793
2998
  const hasChanges = draftUsername !== originalUsername || draftAvatarFile !== void 0;
3794
- const handleSave = useCallback9(() => __async(null, null, function* () {
2999
+ const handleSave = useCallback3(() => __async(null, null, function* () {
3795
3000
  var _a2, _b2, _c2;
3796
3001
  setIsSaving(true);
3797
3002
  try {
@@ -3846,9 +3051,47 @@ var ProfileModal = ({
3846
3051
  originalUsername,
3847
3052
  toastCtx
3848
3053
  ]);
3849
- const handleCancel = useCallback9(() => {
3054
+ const handleCancel = useCallback3(() => {
3850
3055
  handleOpenChange(false);
3851
3056
  }, [handleOpenChange]);
3057
+ const handleVerifyKalshi = useCallback3(
3058
+ (credentials) => __async(null, null, function* () {
3059
+ if (onConnectKalshi) {
3060
+ yield onConnectKalshi(credentials);
3061
+ } else {
3062
+ yield client.upsertVenueKey({
3063
+ venue: Venue.kalshi,
3064
+ credentials: {
3065
+ keyId: credentials.apiKeyId,
3066
+ privateKey: credentials.privateKey
3067
+ }
3068
+ });
3069
+ }
3070
+ yield refetchKalshiStatus();
3071
+ yield client.getCurrentUser();
3072
+ }),
3073
+ [client, onConnectKalshi, refetchKalshiStatus]
3074
+ );
3075
+ const handleDisconnectKalshi = useCallback3(() => __async(null, null, function* () {
3076
+ yield client.deleteVenueKey(Venue.kalshi);
3077
+ yield refetchKalshiStatus();
3078
+ onDisconnectExchange == null ? void 0 : onDisconnectExchange(Venue.kalshi);
3079
+ }), [client, onDisconnectExchange, refetchKalshiStatus]);
3080
+ const resolvedVenueAccounts = useMemo3(() => {
3081
+ var _a2;
3082
+ const nonKalshiAccounts = (_a2 = user == null ? void 0 : user.venueAccounts) == null ? void 0 : _a2.filter((account) => account.venue !== "kalshi");
3083
+ if (!kalshiStatus) return user == null ? void 0 : user.venueAccounts;
3084
+ if (!(kalshiStatus == null ? void 0 : kalshiStatus.connected)) return nonKalshiAccounts;
3085
+ return [
3086
+ ...nonKalshiAccounts != null ? nonKalshiAccounts : [],
3087
+ {
3088
+ id: "kalshi-venue-key",
3089
+ venue: Venue.kalshi,
3090
+ status: "active",
3091
+ kycStatus: kalshiStatus.kycStatus
3092
+ }
3093
+ ];
3094
+ }, [kalshiStatus, user == null ? void 0 : user.venueAccounts]);
3852
3095
  const isAccountConnected = (providers) => {
3853
3096
  var _a2, _b2, _c2;
3854
3097
  const normalizedProviders = providers.map((provider) => provider.toLowerCase());
@@ -3890,7 +3133,7 @@ var ProfileModal = ({
3890
3133
  if (typeof window === "undefined") return;
3891
3134
  ((_a2 = window.top) != null ? _a2 : window).location.assign(url);
3892
3135
  };
3893
- const surfaceError = useCallback9(
3136
+ const surfaceError = useCallback3(
3894
3137
  (err, title) => {
3895
3138
  const message = (err == null ? void 0 : err.message) || "Something went wrong. Please try again.";
3896
3139
  if (toastCtx) {
@@ -3901,7 +3144,7 @@ var ProfileModal = ({
3901
3144
  },
3902
3145
  [toastCtx]
3903
3146
  );
3904
- const handleConnectTwitter = useCallback9(() => __async(null, null, function* () {
3147
+ const handleConnectTwitter = useCallback3(() => __async(null, null, function* () {
3905
3148
  try {
3906
3149
  const result = yield client.linkAccount({
3907
3150
  provider: "twitter",
@@ -3915,7 +3158,7 @@ var ProfileModal = ({
3915
3158
  surfaceError(err, "Could not connect X (Twitter)");
3916
3159
  }
3917
3160
  }), [client, onConnectTwitter, surfaceError]);
3918
- const handleConnectGoogle = useCallback9(() => __async(null, null, function* () {
3161
+ const handleConnectGoogle = useCallback3(() => __async(null, null, function* () {
3919
3162
  try {
3920
3163
  const result = yield client.linkAccount({
3921
3164
  provider: "google",
@@ -3929,7 +3172,7 @@ var ProfileModal = ({
3929
3172
  surfaceError(err, "Could not connect Google");
3930
3173
  }
3931
3174
  }), [client, onConnectGoogle, surfaceError]);
3932
- const handleConnectApple = useCallback9(() => __async(null, null, function* () {
3175
+ const handleConnectApple = useCallback3(() => __async(null, null, function* () {
3933
3176
  try {
3934
3177
  const result = yield client.linkAccount({
3935
3178
  provider: "apple",
@@ -3943,7 +3186,7 @@ var ProfileModal = ({
3943
3186
  surfaceError(err, "Could not connect Apple");
3944
3187
  }
3945
3188
  }), [client, onConnectApple, surfaceError]);
3946
- const handleDisconnectTwitter = useCallback9(() => __async(null, null, function* () {
3189
+ const handleDisconnectTwitter = useCallback3(() => __async(null, null, function* () {
3947
3190
  try {
3948
3191
  yield client.disconnectAccount("twitter");
3949
3192
  yield client.getCurrentUser();
@@ -3952,7 +3195,7 @@ var ProfileModal = ({
3952
3195
  surfaceError(err, "Could not disconnect X (Twitter)");
3953
3196
  }
3954
3197
  }), [client, onDisconnectTwitter, surfaceError]);
3955
- const handleDisconnectGoogle = useCallback9(() => __async(null, null, function* () {
3198
+ const handleDisconnectGoogle = useCallback3(() => __async(null, null, function* () {
3956
3199
  try {
3957
3200
  yield client.disconnectAccount("google");
3958
3201
  yield client.getCurrentUser();
@@ -3961,7 +3204,7 @@ var ProfileModal = ({
3961
3204
  surfaceError(err, "Could not disconnect Google");
3962
3205
  }
3963
3206
  }), [client, onDisconnectGoogle, surfaceError]);
3964
- const handleDisconnectApple = useCallback9(() => __async(null, null, function* () {
3207
+ const handleDisconnectApple = useCallback3(() => __async(null, null, function* () {
3965
3208
  try {
3966
3209
  yield client.disconnectAccount("apple");
3967
3210
  yield client.getCurrentUser();
@@ -3970,7 +3213,7 @@ var ProfileModal = ({
3970
3213
  surfaceError(err, "Could not disconnect Apple");
3971
3214
  }
3972
3215
  }), [client, onDisconnectApple, surfaceError]);
3973
- const handleConnectEmail = useCallback9(() => __async(null, null, function* () {
3216
+ const handleConnectEmail = useCallback3(() => __async(null, null, function* () {
3974
3217
  var _a2;
3975
3218
  const typedEmail = typeof window !== "undefined" ? (_a2 = window.prompt("Enter your email to receive a magic link")) == null ? void 0 : _a2.trim() : void 0;
3976
3219
  if (!typedEmail) return;
@@ -3989,7 +3232,7 @@ var ProfileModal = ({
3989
3232
  surfaceError(err, "Could not connect email");
3990
3233
  }
3991
3234
  }), [client, onConnectEmail, surfaceError, toastCtx]);
3992
- const handleDisconnectWallet = useCallback9(
3235
+ const handleDisconnectWallet = useCallback3(
3993
3236
  (wallet) => __async(null, null, function* () {
3994
3237
  const normalizedChain = wallet.chain.toLowerCase();
3995
3238
  const provider = normalizedChain === "solana" || normalizedChain === "svm" ? "solana_wallet" : "wallet";
@@ -4064,160 +3307,178 @@ var ProfileModal = ({
4064
3307
  };
4065
3308
  });
4066
3309
  }, [user == null ? void 0 : user.accounts, wallets]);
4067
- return /* @__PURE__ */ jsx26(Modal, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs26(
4068
- Modal.Container,
4069
- {
4070
- maxWidth: "800px",
4071
- "aria-label": "Edit Profile",
4072
- classNames: {
4073
- container: cn("agg-profile-modal", "min-h-[37.5rem]")
4074
- },
4075
- children: [
4076
- /* @__PURE__ */ jsx26(Modal.Header, { title: "Edit Profile", classNames: { root: "agg-profile-modal-header" } }),
4077
- /* @__PURE__ */ jsx26("div", { className: "agg-profile-tabs sm:hidden w-full", children: /* @__PURE__ */ jsx26(
4078
- Tabs,
4079
- {
4080
- className: "w-full [&>div]:w-full",
4081
- variant: "underline",
4082
- classNames: { tabList: "w-full" },
4083
- items: PROFILE_TAB_ITEMS.map((tab) => ({
4084
- value: tab.value,
4085
- label: tab.label,
4086
- icon: /* @__PURE__ */ jsx26(Icon, { name: tab.icon, size: "small" })
4087
- })),
4088
- value: activeTab,
4089
- onChange: (val) => setActiveTab(val)
4090
- }
4091
- ) }),
4092
- /* @__PURE__ */ jsx26(Modal.Body, { classNames: { root: cn("agg-profile-modal-body", "overflow-x-visible") }, children: /* @__PURE__ */ jsxs26("div", { className: "agg-profile-layout flex flex-col sm:flex-row sm:gap-10", children: [
4093
- /* @__PURE__ */ jsx26("div", { className: "shrink-0", children: /* @__PURE__ */ jsx26(
4094
- "nav",
3310
+ return /* @__PURE__ */ jsxs20(Modal, { open: open && !isConnectKalshiModalOpen, onOpenChange: handleOpenChange, children: [
3311
+ /* @__PURE__ */ jsxs20(
3312
+ Modal.Container,
3313
+ {
3314
+ maxWidth: "800px",
3315
+ "aria-label": "Edit Profile",
3316
+ classNames: {
3317
+ container: cn("agg-profile-modal", "min-h-[37.5rem]")
3318
+ },
3319
+ children: [
3320
+ /* @__PURE__ */ jsx20(Modal.Header, { title: "Edit Profile", classNames: { root: "agg-profile-modal-header" } }),
3321
+ /* @__PURE__ */ jsx20("div", { className: "agg-profile-tabs sm:hidden w-full", children: /* @__PURE__ */ jsx20(
3322
+ Tabs,
4095
3323
  {
4096
- className: cn(
4097
- "agg-profile-sidebar",
4098
- "hidden sm:sticky sm:top-0 sm:self-start sm:flex sm:flex-col",
4099
- "w-[240px]",
4100
- "overflow-hidden rounded-agg-lg",
4101
- "border border-agg-separator",
4102
- "bg-agg-secondary",
4103
- "py-3"
4104
- ),
4105
- role: "tablist",
4106
- "aria-label": "Profile sections",
4107
- children: PROFILE_TAB_ITEMS.map((tab) => {
4108
- const isActive = activeTab === tab.value;
4109
- return /* @__PURE__ */ jsxs26(
4110
- "button",
4111
- {
4112
- type: "button",
4113
- role: "tab",
4114
- "aria-selected": isActive,
4115
- onClick: () => setActiveTab(tab.value),
4116
- className: cn(
4117
- "agg-profile-tab-trigger",
4118
- "relative flex items-center gap-3",
4119
- "h-[49px] px-6 py-4",
4120
- "text-agg-sm leading-agg-5 font-agg-sans",
4121
- "transition-colors cursor-pointer",
4122
- isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
4123
- ),
4124
- children: [
4125
- isActive ? /* @__PURE__ */ jsx26("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
4126
- /* @__PURE__ */ jsx26(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
4127
- /* @__PURE__ */ jsx26("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
4128
- ]
4129
- },
4130
- tab.value
4131
- );
4132
- })
3324
+ className: "w-full [&>div]:w-full",
3325
+ variant: "underline",
3326
+ classNames: { tabList: "w-full" },
3327
+ items: PROFILE_TAB_ITEMS.map((tab) => ({
3328
+ value: tab.value,
3329
+ label: tab.label,
3330
+ icon: /* @__PURE__ */ jsx20(Icon, { name: tab.icon, size: "small" })
3331
+ })),
3332
+ value: activeTab,
3333
+ onChange: (val) => setActiveTab(val)
4133
3334
  }
4134
3335
  ) }),
4135
- /* @__PURE__ */ jsxs26("div", { className: "agg-profile-content min-w-0 flex-1", children: [
4136
- activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ jsxs26("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
4137
- /* @__PURE__ */ jsx26(
4138
- AboutTab,
4139
- {
4140
- username: username != null ? username : user == null ? void 0 : user.username,
4141
- avatarPreview: (_i = user == null ? void 0 : user.avatarUrl) != null ? _i : avatarPreview,
4142
- onDeleteProfile,
4143
- draftUsername,
4144
- onDraftUsernameChange: setDraftUsername,
4145
- draftAvatarFile,
4146
- onDraftAvatarChange: handleDraftAvatarChange,
4147
- draftAvatarPreview,
4148
- avatarError: avatarTypeError
4149
- }
4150
- ),
4151
- /* @__PURE__ */ jsx26(
4152
- AccountsWalletsTab,
3336
+ /* @__PURE__ */ jsx20(Modal.Body, { classNames: { root: cn("agg-profile-modal-body", "overflow-x-visible") }, children: /* @__PURE__ */ jsxs20("div", { className: "agg-profile-layout flex flex-col sm:flex-row sm:gap-10", children: [
3337
+ /* @__PURE__ */ jsx20("div", { className: "shrink-0", children: /* @__PURE__ */ jsx20(
3338
+ "nav",
3339
+ {
3340
+ className: cn(
3341
+ "agg-profile-sidebar",
3342
+ "hidden sm:sticky sm:top-0 sm:self-start sm:flex sm:flex-col",
3343
+ "w-[240px]",
3344
+ "overflow-hidden rounded-agg-lg",
3345
+ "border border-agg-separator",
3346
+ "bg-agg-secondary",
3347
+ "py-3"
3348
+ ),
3349
+ role: "tablist",
3350
+ "aria-label": "Profile sections",
3351
+ children: PROFILE_TAB_ITEMS.map((tab) => {
3352
+ const isActive = activeTab === tab.value;
3353
+ return /* @__PURE__ */ jsxs20(
3354
+ "button",
3355
+ {
3356
+ type: "button",
3357
+ role: "tab",
3358
+ "aria-selected": isActive,
3359
+ onClick: () => setActiveTab(tab.value),
3360
+ className: cn(
3361
+ "agg-profile-tab-trigger",
3362
+ "relative flex items-center gap-3",
3363
+ "h-[49px] px-6 py-4",
3364
+ "text-agg-sm leading-agg-5 font-agg-sans",
3365
+ "transition-colors cursor-pointer",
3366
+ isActive ? "font-agg-normal text-agg-foreground bg-agg-secondary-hover" : "font-agg-normal text-agg-foreground"
3367
+ ),
3368
+ children: [
3369
+ isActive ? /* @__PURE__ */ jsx20("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-agg-primary" }) : null,
3370
+ /* @__PURE__ */ jsx20(Icon, { name: tab.icon, size: "small", color: "currentColor" }),
3371
+ /* @__PURE__ */ jsx20("span", { className: "shrink-0 whitespace-nowrap", children: tab.label })
3372
+ ]
3373
+ },
3374
+ tab.value
3375
+ );
3376
+ })
3377
+ }
3378
+ ) }),
3379
+ /* @__PURE__ */ jsxs20("div", { className: "agg-profile-content min-w-0 flex-1", children: [
3380
+ activeTab === PROFILE_TAB_KEYS.PROFILE_ACCOUNTS ? /* @__PURE__ */ jsxs20("div", { className: "agg-profile-accounts-tab flex flex-col gap-8", children: [
3381
+ /* @__PURE__ */ jsx20(
3382
+ AboutTab,
3383
+ {
3384
+ username: username != null ? username : user == null ? void 0 : user.username,
3385
+ avatarPreview: (_i = user == null ? void 0 : user.avatarUrl) != null ? _i : avatarPreview,
3386
+ onDeleteProfile,
3387
+ draftUsername,
3388
+ onDraftUsernameChange: setDraftUsername,
3389
+ draftAvatarFile,
3390
+ onDraftAvatarChange: handleDraftAvatarChange,
3391
+ draftAvatarPreview,
3392
+ avatarError: avatarTypeError
3393
+ }
3394
+ ),
3395
+ /* @__PURE__ */ jsx20(
3396
+ AccountsWalletsTab,
3397
+ {
3398
+ socialAccounts: resolvedSocialAccounts,
3399
+ wallets: resolvedWallets,
3400
+ email: resolvedEmail,
3401
+ onConnectTwitter: providerActionMap.twitter.connect,
3402
+ onDisconnectTwitter: providerActionMap.twitter.disconnect,
3403
+ onConnectGoogle: providerActionMap.google.connect,
3404
+ onDisconnectGoogle: providerActionMap.google.disconnect,
3405
+ onConnectApple: providerActionMap.apple.connect,
3406
+ onDisconnectApple: providerActionMap.apple.disconnect,
3407
+ onDisconnectWallet: (wallet) => {
3408
+ void handleDisconnectWallet(wallet);
3409
+ },
3410
+ onConnectEmail: providerActionMap.email.connect
3411
+ }
3412
+ )
3413
+ ] }) : null,
3414
+ activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ jsx20(
3415
+ TradingAccessTab,
4153
3416
  {
4154
- socialAccounts: resolvedSocialAccounts,
4155
- wallets: resolvedWallets,
4156
- email: resolvedEmail,
4157
- onConnectTwitter: providerActionMap.twitter.connect,
4158
- onDisconnectTwitter: providerActionMap.twitter.disconnect,
4159
- onConnectGoogle: providerActionMap.google.connect,
4160
- onDisconnectGoogle: providerActionMap.google.disconnect,
4161
- onConnectApple: providerActionMap.apple.connect,
4162
- onDisconnectApple: providerActionMap.apple.disconnect,
4163
- onDisconnectWallet: (wallet) => {
4164
- void handleDisconnectWallet(wallet);
4165
- },
4166
- onConnectEmail: providerActionMap.email.connect
3417
+ venueAccounts: resolvedVenueAccounts,
3418
+ onConnectKalshi: () => setIsConnectKalshiModalOpen(true),
3419
+ onDisconnectKalshi: handleDisconnectKalshi,
3420
+ onKycError
4167
3421
  }
4168
- )
4169
- ] }) : null,
4170
- activeTab === PROFILE_TAB_KEYS.TRADING_ACCESS ? /* @__PURE__ */ jsx26(TradingAccessTab, { venueAccounts: user == null ? void 0 : user.venueAccounts, onKycError }) : null
3422
+ ) : null
3423
+ ] })
3424
+ ] }) }),
3425
+ /* @__PURE__ */ jsxs20(Modal.Footer, { classNames: { root: "agg-profile-modal-footer" }, children: [
3426
+ /* @__PURE__ */ jsx20(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
3427
+ /* @__PURE__ */ jsx20(
3428
+ Button,
3429
+ {
3430
+ variant: "primary",
3431
+ size: "large",
3432
+ disabled: !hasChanges,
3433
+ isLoading: isSaving,
3434
+ onClick: handleSave,
3435
+ children: "Save changes"
3436
+ }
3437
+ )
4171
3438
  ] })
4172
- ] }) }),
4173
- /* @__PURE__ */ jsxs26(Modal.Footer, { classNames: { root: "agg-profile-modal-footer" }, children: [
4174
- /* @__PURE__ */ jsx26(Button, { variant: "secondary", size: "large", onClick: handleCancel, className: "min-w-[120px]", children: "Cancel" }),
4175
- /* @__PURE__ */ jsx26(
4176
- Button,
4177
- {
4178
- variant: "primary",
4179
- size: "large",
4180
- disabled: !hasChanges,
4181
- isLoading: isSaving,
4182
- onClick: handleSave,
4183
- children: "Save changes"
4184
- }
4185
- )
4186
- ] })
4187
- ]
4188
- }
4189
- ) });
3439
+ ]
3440
+ }
3441
+ ),
3442
+ /* @__PURE__ */ jsx20(
3443
+ ConnectKalshiModal,
3444
+ {
3445
+ open: open && isConnectKalshiModalOpen,
3446
+ onOpenChange: setIsConnectKalshiModalOpen,
3447
+ onVerify: handleVerifyKalshi
3448
+ }
3449
+ )
3450
+ ] });
4190
3451
  };
4191
3452
  ProfileModal.displayName = "ProfileModal";
4192
3453
 
4193
3454
  // src/geo-block-modal/index.tsx
4194
- import { useLabels as useLabels23 } from "@agg-build/hooks";
4195
- import { useCallback as useCallback10 } from "react";
4196
- import { jsx as jsx27, jsxs as jsxs27 } from "react/jsx-runtime";
3455
+ import { useLabels as useLabels17 } from "@agg-build/hooks";
3456
+ import { useCallback as useCallback4 } from "react";
3457
+ import { jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
4197
3458
  var GeoBlockModal = ({
4198
3459
  open,
4199
3460
  onOpenChange,
4200
3461
  onConfirm,
4201
3462
  classNames
4202
3463
  }) => {
4203
- const labels = useLabels23();
4204
- const handleConfirm = useCallback10(() => {
3464
+ const labels = useLabels17();
3465
+ const handleConfirm = useCallback4(() => {
4205
3466
  onConfirm == null ? void 0 : onConfirm();
4206
3467
  onOpenChange(false);
4207
3468
  }, [onConfirm, onOpenChange]);
4208
- return /* @__PURE__ */ jsx27(
3469
+ return /* @__PURE__ */ jsx21(
4209
3470
  Modal,
4210
3471
  {
4211
3472
  open,
4212
3473
  onOpenChange,
4213
3474
  "aria-label": labels.trading.geoBlockModalAriaLabel,
4214
- children: /* @__PURE__ */ jsxs27(
3475
+ children: /* @__PURE__ */ jsxs21(
4215
3476
  Modal.Container,
4216
3477
  {
4217
3478
  maxWidth: "480px",
4218
3479
  classNames: { container: cn("!rounded-agg-2xl", classNames == null ? void 0 : classNames.container) },
4219
3480
  children: [
4220
- /* @__PURE__ */ jsx27(
3481
+ /* @__PURE__ */ jsx21(
4221
3482
  Modal.Header,
4222
3483
  {
4223
3484
  title: "",
@@ -4229,19 +3490,19 @@ var GeoBlockModal = ({
4229
3490
  }
4230
3491
  }
4231
3492
  ),
4232
- /* @__PURE__ */ jsx27(Modal.Body, { classNames: { root: cn("!px-10 !pt-0 !pb-12", classNames == null ? void 0 : classNames.body) }, children: /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center gap-8", children: [
4233
- /* @__PURE__ */ jsx27(
3493
+ /* @__PURE__ */ jsx21(Modal.Body, { classNames: { root: cn("!px-10 !pt-0 !pb-12", classNames == null ? void 0 : classNames.body) }, children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-8", children: [
3494
+ /* @__PURE__ */ jsx21(
4234
3495
  Icon,
4235
3496
  {
4236
3497
  name: "internet-security",
4237
3498
  className: "h-[60px] w-[60px] text-agg-muted-foreground"
4238
3499
  }
4239
3500
  ),
4240
- /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center gap-3 text-center", children: [
4241
- /* @__PURE__ */ jsx27("h2", { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.trading.geoBlockModalTitle }),
4242
- /* @__PURE__ */ jsx27("p", { className: "text-agg-base font-agg-normal leading-agg-6 text-agg-foreground", children: labels.trading.geoBlockModalDescription })
3501
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center gap-3 text-center", children: [
3502
+ /* @__PURE__ */ jsx21("h2", { className: "text-agg-2xl font-agg-bold leading-agg-8 text-agg-foreground", children: labels.trading.geoBlockModalTitle }),
3503
+ /* @__PURE__ */ jsx21("p", { className: "text-agg-base font-agg-normal leading-agg-6 text-agg-foreground", children: labels.trading.geoBlockModalDescription })
4243
3504
  ] }),
4244
- /* @__PURE__ */ jsx27(
3505
+ /* @__PURE__ */ jsx21(
4245
3506
  Button,
4246
3507
  {
4247
3508
  variant: "secondary",
@@ -4267,12 +3528,6 @@ export {
4267
3528
  DepositModal,
4268
3529
  buildTerminalSummary,
4269
3530
  WithdrawModal,
4270
- HowItWorksStep,
4271
- ProfileSetupStep,
4272
- ConnectAccountsStep,
4273
- ConnectOnchainModal,
4274
- ConnectKalshiModal,
4275
- OnboardingModal,
4276
3531
  ProfileModal,
4277
3532
  GeoBlockModal
4278
3533
  };