@embarkai/ui-kit 0.4.93 → 0.4.94

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/index.cjs CHANGED
@@ -5021,11 +5021,12 @@ var init_cn = __esm({
5021
5021
  });
5022
5022
 
5023
5023
  // src/internal/constants.ts
5024
- var import_lucide_react, LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
5024
+ var import_lucide_react, EMBARKAI_DIALOG_ONBOARDING_ID, LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
5025
5025
  var init_constants = __esm({
5026
5026
  "src/internal/constants.ts"() {
5027
5027
  import_lucide_react = require("lucide-react");
5028
5028
  init_assets();
5029
+ EMBARKAI_DIALOG_ONBOARDING_ID = "embark-main-dialog-content";
5029
5030
  LOCAL_COLOR_MODE_KEY = "passport-theme-mode";
5030
5031
  LOOCAL_BACKUP_STATUS_KEY = "passport-backup-status";
5031
5032
  DEFAULT_AUTH_MENU_HEIGHT = 253;
@@ -5061,25 +5062,16 @@ var init_useLayoutStore = __esm({
5061
5062
  colorMode: "light",
5062
5063
  isMobileView: false,
5063
5064
  maxScrollHeight: MAX_CONTENT_HEIGHT,
5064
- isDialogClosing: false,
5065
5065
  isDialogOpen: false,
5066
+ isDialogAnimating: false,
5066
5067
  isDialogForced: false,
5067
- dialogTitle: null,
5068
- dialogDescription: null,
5069
5068
  dialogContent: null,
5070
5069
  isSettings: false,
5071
5070
  setColorMode: (colorMode) => set({ colorMode }),
5072
- // setLayoutView: (layoutView) => set(() => ({ layoutView })),
5073
- // setDeviceType: (deviceType) => set(() => ({ deviceType })),
5074
5071
  setIsMobileView: (isMobileView) => set({ isMobileView }),
5075
5072
  setMaxScrollHeight: (maxScrollHeight) => set({ maxScrollHeight }),
5076
- setIsDialogClosing: (isDialogClosing) => set({ isDialogClosing }),
5077
- setIsDialogOpen: (isDialogOpen) => set({ isDialogOpen }),
5078
- setIsDialogForced: (isDialogForced) => set({ isDialogForced }),
5079
- setDialogTitle: (dialogTitle) => set({ dialogTitle }),
5080
- setDialogDescription: (dialogDescription) => set({ dialogDescription }),
5081
- setDialogContent: (dialogContent) => set({ dialogContent }),
5082
- setIsSettings: (isSettings) => set({ isSettings })
5073
+ /** dedicated setter for dialog forced state */
5074
+ setIsDialogForced: (isDialogForced) => set({ isDialogForced })
5083
5075
  }));
5084
5076
  }
5085
5077
  });
@@ -11113,7 +11105,6 @@ var init_AuthMenu = __esm({
11113
11105
  init_auth();
11114
11106
  init_constants();
11115
11107
  init_useLayoutDataStore();
11116
- init_useLayoutStore();
11117
11108
  init_Expandable2();
11118
11109
  init_button();
11119
11110
  init_highlight();
@@ -11128,16 +11119,14 @@ var init_AuthMenu = __esm({
11128
11119
  AuthMenu = () => {
11129
11120
  const { t } = useT();
11130
11121
  const isIframeReady = useSession((st) => st.isIframeReady);
11131
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
11132
- const setTransitionPageHeight = useLayoutDataStore((st) => st.setTransitionPageHeight);
11133
11122
  const pendingWalletLogin = useLayoutDataStore((st) => st.pendingWalletLogin);
11134
- const setPendingWalletLogin = useLayoutDataStore((st) => st.setPendingWalletLogin);
11135
- const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setEmailChallenge, setAlert } = useAuthStore();
11123
+ const step = useAuthStore((st) => st.step);
11124
+ const alert2 = useAuthStore((st) => st.alert);
11136
11125
  const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn } = useAuthMenuHandlers();
11137
11126
  (0, import_react23.useEffect)(() => {
11138
11127
  if (!pendingWalletLogin) return;
11139
11128
  const loginResponse = pendingWalletLogin;
11140
- setPendingWalletLogin(null);
11129
+ useLayoutDataStore.getState().setPendingWalletLogin(null);
11141
11130
  console.log("[AuthMenu] Processing wallet login response:", loginResponse);
11142
11131
  import_auth23.jwtTokenManager.clearTokens().then(() => {
11143
11132
  pendingLoginResponseRef.current = loginResponse;
@@ -11145,8 +11134,9 @@ var init_AuthMenu = __esm({
11145
11134
  });
11146
11135
  }, [pendingWalletLogin]);
11147
11136
  (0, import_react23.useEffect)(() => {
11148
- setTransitionPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
11137
+ useLayoutDataStore.getState().setTransitionPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
11149
11138
  return () => {
11139
+ const { setStep, setPasskeyStatus, setEmail, setEmailChallenge, setAlert } = useAuthStore.getState();
11150
11140
  setStep("signin");
11151
11141
  setEmail("");
11152
11142
  setEmailChallenge(null);
@@ -11155,7 +11145,7 @@ var init_AuthMenu = __esm({
11155
11145
  };
11156
11146
  }, []);
11157
11147
  if (!isIframeReady) {
11158
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full p-8 flex flex-col justify-center items-center gap-[var(--ui-kit-gap)]", children: [
11148
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Expandable, { isExpanded: true, className: "w-full p-8 flex flex-col justify-center items-center gap-[var(--ui-kit-gap)]", children: [
11159
11149
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react9.Loader, { className: "w-4 h-4 animate-spin" }),
11160
11150
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-sm text-[var(--ui-kit-fg-muted)]", children: "Initializing wallet..." })
11161
11151
  ] });
@@ -11177,26 +11167,25 @@ var init_AuthMenu = __esm({
11177
11167
  }),
11178
11168
  [onAuthSuccess, goBackToSignIn]
11179
11169
  );
11180
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11181
- "div",
11182
- {
11183
- style: {
11184
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
11185
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
11186
- },
11187
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
11188
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
11189
- stepContent[step],
11190
- alert2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Highlight, { type: "error", children: [
11191
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "block w-full flex flex-col gap-1 flex-1 mb-2", children: [
11192
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block font-bold leading-5", children: alert2.title }),
11193
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block whitespace-pre-line", children: alert2.message || "Unknown error" })
11194
- ] }),
11195
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button, { variant: "default", size: "medium", className: "w-full", onClick: () => setAlert(null), children: t("passport:common.hide") })
11196
- ] })
11197
- ] })
11198
- }
11199
- );
11170
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
11171
+ stepContent[step],
11172
+ alert2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Highlight, { type: "error", children: [
11173
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "block w-full flex flex-col gap-1 flex-1 mb-2", children: [
11174
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block font-bold leading-5", children: alert2.title }),
11175
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block whitespace-pre-line", children: alert2.message || "Unknown error" })
11176
+ ] }),
11177
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11178
+ Button,
11179
+ {
11180
+ variant: "default",
11181
+ size: "medium",
11182
+ className: "w-full",
11183
+ onClick: () => useAuthStore.getState().setAlert(null),
11184
+ children: t("passport:common.hide")
11185
+ }
11186
+ )
11187
+ ] })
11188
+ ] });
11200
11189
  };
11201
11190
  }
11202
11191
  });
@@ -12688,11 +12677,12 @@ var init_components = __esm({
12688
12677
  var BUY_MENU_BINANCE_TOUR;
12689
12678
  var init_onboarding_setup = __esm({
12690
12679
  "src/internal/components/BuyMenu/onboarding.setup.ts"() {
12680
+ init_constants();
12691
12681
  init_useBinanceStore();
12692
12682
  init_useBuyMenuStore();
12693
12683
  BUY_MENU_BINANCE_TOUR = [
12694
12684
  {
12695
- elId: "buymenu-page" /* buymenu */,
12685
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"buy" /* BUY */}`,
12696
12686
  title: "passport:buyMenu.onboarding.buyMenu.title",
12697
12687
  description: "passport:buyMenu.onboarding.buyMenu.description",
12698
12688
  waitSecs: 6,
@@ -14499,7 +14489,6 @@ var init_useHandleInputAmount = __esm({
14499
14489
  function BuyMenu() {
14500
14490
  const { t } = useT();
14501
14491
  const walletAddress = useSession((st) => st.address);
14502
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
14503
14492
  useBuyMenuParams();
14504
14493
  useHandleInputAmount();
14505
14494
  const rampProvider = useBuyMenuStore((st) => st.rampProvider);
@@ -14515,103 +14504,92 @@ function BuyMenu() {
14515
14504
  const showExtras = !isCryptoSelector && !isFiatSelector && !isProviderSummary && !isProviderSelector && !isPaymentModeSelector;
14516
14505
  const showProviderTrigger = showExtras && !isTransactionHistory;
14517
14506
  useOnboardingTourAvailable(showProviderTrigger);
14518
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14519
- "div",
14520
- {
14521
- ref: (inst) => onboarder.registerElement("buymenu-page" /* buymenu */, inst),
14522
- style: {
14523
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
14524
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
14525
- },
14526
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
14527
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Expandable, { isExpanded: true, contentClassName: "relative w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
14528
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
14529
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14530
- Button,
14531
- {
14532
- variant: "ghost",
14533
- size: "icon",
14534
- className: "flex-none",
14535
- onClick: () => {
14536
- const {
14537
- setIsProviderSummary,
14538
- setIsTransactionHistory,
14539
- setIsProviderSelector,
14540
- setIsCryptoSelector,
14541
- setIsFiatSelector,
14542
- setIsPaymentModeSelector,
14543
- setError
14544
- } = useBuyMenuStore.getState();
14545
- setError(null);
14546
- if (isProviderSummary) {
14547
- setIsProviderSummary(false);
14548
- return;
14549
- }
14550
- if (isTransactionHistory) {
14551
- setIsTransactionHistory(false);
14552
- return;
14553
- }
14554
- if (isProviderSelector) {
14555
- setIsProviderSelector(false);
14556
- return;
14557
- }
14558
- if (isCryptoSelector) {
14559
- setIsCryptoSelector(false);
14560
- return;
14561
- }
14562
- if (isFiatSelector) {
14563
- setIsFiatSelector(false);
14564
- return;
14565
- }
14566
- if (isPaymentModeSelector) {
14567
- setIsPaymentModeSelector(false);
14568
- return;
14569
- }
14570
- useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */);
14571
- },
14572
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react20.ArrowLeft, { className: "h-4 w-4" })
14507
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Expandable, { isExpanded: true, contentClassName: "relative w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
14508
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
14509
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14510
+ Button,
14511
+ {
14512
+ variant: "ghost",
14513
+ size: "icon",
14514
+ className: "flex-none",
14515
+ onClick: () => {
14516
+ const {
14517
+ setIsProviderSummary,
14518
+ setIsTransactionHistory,
14519
+ setIsProviderSelector,
14520
+ setIsCryptoSelector,
14521
+ setIsFiatSelector,
14522
+ setIsPaymentModeSelector,
14523
+ setError
14524
+ } = useBuyMenuStore.getState();
14525
+ setError(null);
14526
+ if (isProviderSummary) {
14527
+ setIsProviderSummary(false);
14528
+ return;
14573
14529
  }
14574
- ),
14575
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block flex-none text-xl font-semibold", children: t("passport:buyMenu.title") }),
14576
- showExtras && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex-1 h-8 flex items-center justify-end gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14577
- Switch,
14578
- {
14579
- labels: { checked: "PURCHASE", unchecked: "HISTORY" },
14580
- checked: isTransactionHistory,
14581
- onChange: () => {
14582
- useBuyMenuStore.getState().setError(null);
14583
- useBuyMenuStore.getState().setIsTransactionHistory();
14584
- }
14530
+ if (isTransactionHistory) {
14531
+ setIsTransactionHistory(false);
14532
+ return;
14585
14533
  }
14586
- ) })
14587
- ] }),
14588
- showProviderTrigger && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
14589
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:buyMenu.selectProvider") }),
14590
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14591
- Button,
14592
- {
14593
- ref: (inst) => onboarder.registerElement("buymenu-provider-selector" /* providerSelector */, inst),
14594
- variant: !!selectedProvider?.id ? "default" : "secondary",
14595
- onClick: () => {
14596
- useBuyMenuStore.getState().setError(null);
14597
- useBuyMenuStore.getState().setIsProviderSelector(true);
14598
- },
14599
- className: cn2("w-full justify-center", {
14600
- [ACTIVE_PROVIDER_CNS[selectedProvider?.id]]: rampProvider === selectedProvider?.id,
14601
- [IDLE_PROVIDERS_CNS[selectedProvider?.id]]: rampProvider !== selectedProvider?.id
14602
- }),
14603
- children: [
14604
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(selectedProvider.icon, {}),
14605
- !selectedProvider.icon && t("passport:buyMenu.selectProvider")
14606
- ]
14534
+ if (isProviderSelector) {
14535
+ setIsProviderSelector(false);
14536
+ return;
14607
14537
  }
14608
- )
14609
- ] }),
14610
- isProviderSelector ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ProviderSelector, { providers: AVAILABLE_RAMP_PROVIDERS.map((el) => ({ ...el, Icon: el.icon })) }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ProviderComponent, { walletAddress }),
14611
- error && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Highlight, { type: "error", children: error })
14612
- ] })
14613
- }
14614
- );
14538
+ if (isCryptoSelector) {
14539
+ setIsCryptoSelector(false);
14540
+ return;
14541
+ }
14542
+ if (isFiatSelector) {
14543
+ setIsFiatSelector(false);
14544
+ return;
14545
+ }
14546
+ if (isPaymentModeSelector) {
14547
+ setIsPaymentModeSelector(false);
14548
+ return;
14549
+ }
14550
+ useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */);
14551
+ },
14552
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react20.ArrowLeft, { className: "h-4 w-4" })
14553
+ }
14554
+ ),
14555
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block flex-none text-xl font-semibold", children: t("passport:buyMenu.title") }),
14556
+ showExtras && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex-1 h-8 flex items-center justify-end gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
14557
+ Switch,
14558
+ {
14559
+ labels: { checked: "PURCHASE", unchecked: "HISTORY" },
14560
+ checked: isTransactionHistory,
14561
+ onChange: () => {
14562
+ useBuyMenuStore.getState().setError(null);
14563
+ useBuyMenuStore.getState().setIsTransactionHistory();
14564
+ }
14565
+ }
14566
+ ) })
14567
+ ] }),
14568
+ showProviderTrigger && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
14569
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:buyMenu.selectProvider") }),
14570
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
14571
+ Button,
14572
+ {
14573
+ ref: (inst) => onboarder.registerElement("buymenu-provider-selector" /* providerSelector */, inst),
14574
+ variant: !!selectedProvider?.id ? "default" : "secondary",
14575
+ onClick: () => {
14576
+ useBuyMenuStore.getState().setError(null);
14577
+ useBuyMenuStore.getState().setIsProviderSelector(true);
14578
+ },
14579
+ className: cn2("w-full justify-center", {
14580
+ [ACTIVE_PROVIDER_CNS[selectedProvider?.id]]: rampProvider === selectedProvider?.id,
14581
+ [IDLE_PROVIDERS_CNS[selectedProvider?.id]]: rampProvider !== selectedProvider?.id
14582
+ }),
14583
+ children: [
14584
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(selectedProvider.icon, {}),
14585
+ !selectedProvider.icon && t("passport:buyMenu.selectProvider")
14586
+ ]
14587
+ }
14588
+ )
14589
+ ] }),
14590
+ isProviderSelector ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ProviderSelector, { providers: AVAILABLE_RAMP_PROVIDERS.map((el) => ({ ...el, Icon: el.icon })) }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ProviderComponent, { walletAddress }),
14591
+ error && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Highlight, { type: "error", children: error })
14592
+ ] });
14615
14593
  }
14616
14594
  var import_lucide_react20, import_jsx_runtime50;
14617
14595
  var init_BuyMenu = __esm({
@@ -14621,7 +14599,6 @@ var init_BuyMenu = __esm({
14621
14599
  init_i18n();
14622
14600
  import_lucide_react20 = require("lucide-react");
14623
14601
  init_useLayoutDataStore();
14624
- init_useLayoutStore();
14625
14602
  init_Expandable2();
14626
14603
  init_Onboarding();
14627
14604
  init_button();
@@ -14975,26 +14952,11 @@ var init_ChainItem = __esm({
14975
14952
  }
14976
14953
  });
14977
14954
 
14978
- // src/internal/components/ChainsMenu/onboarding.setup.ts
14979
- var CHAIN_MENU_TOUR;
14980
- var init_onboarding_setup2 = __esm({
14981
- "src/internal/components/ChainsMenu/onboarding.setup.ts"() {
14982
- CHAIN_MENU_TOUR = [
14983
- {
14984
- elId: "embarkai-chain-menu-onboarding" /* chainMenu */,
14985
- title: "passport:chainMenu.onboarding.chainMenu.title",
14986
- description: "passport:chainMenu.onboarding.chainMenu.description"
14987
- }
14988
- ];
14989
- }
14990
- });
14991
-
14992
14955
  // src/internal/components/ChainsMenu/ChainsMenu.tsx
14993
14956
  function ChainsMenu() {
14994
14957
  const { t } = useT();
14995
14958
  const config = useProviderConfig().config;
14996
14959
  const activeChainId = useSession((st) => st.activeChainId);
14997
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
14998
14960
  const [isTestnets, setIsTestnets] = (0, import_react37.useState)(false);
14999
14961
  const [nextChainId, setNextChainId] = (0, import_react37.useState)(null);
15000
14962
  useOnboardingTourAvailable(true);
@@ -15025,56 +14987,45 @@ function ChainsMenu() {
15025
14987
  chainId: activeChainId
15026
14988
  } : void 0
15027
14989
  });
15028
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15029
- "div",
15030
- {
15031
- ref: (inst) => onboarder.registerElement("embarkai-chain-menu-onboarding" /* chainMenu */, inst),
15032
- style: {
15033
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
15034
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
15035
- },
15036
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
15037
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
15038
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center justify-between gap-[var(--ui-kit-gap)]", children: [
15039
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
15040
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15041
- Button,
15042
- {
15043
- size: "icon",
15044
- variant: "ghost",
15045
- title: t("passport:common.back"),
15046
- onClick: () => {
15047
- const chainMenuOpenedFrom = useLayoutDataStore.getState().chainMenuOpenedFrom;
15048
- useLayoutDataStore.getState().setPage(chainMenuOpenedFrom || "settings" /* SETTINGS */);
15049
- },
15050
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react22.ArrowLeft, { className: "h-4 w-4" })
15051
- }
15052
- ),
15053
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-xl font-semibold", children: t("passport:chainMenu.title") })
15054
- ] }),
15055
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15056
- Switch,
15057
- {
15058
- labels: { checked: "MAINNETS", unchecked: "ALL" },
15059
- checked: isTestnets,
15060
- onChange: () => setIsTestnets(!isTestnets)
15061
- }
15062
- )
15063
- ] }),
15064
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: visibleNetworks.map((network, networkIdx) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15065
- ChainItem,
14990
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
14991
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center justify-between gap-[var(--ui-kit-gap)]", children: [
14992
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
14993
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
14994
+ Button,
15066
14995
  {
15067
- ...network,
15068
- nextChainId,
15069
- setNextChainId,
15070
- isActivePaymasterDataLoading,
15071
- activePaymasterData
15072
- },
15073
- `chain-${network.chainId}-${networkIdx}`
15074
- )) })
15075
- ] })
15076
- }
15077
- );
14996
+ size: "icon",
14997
+ variant: "ghost",
14998
+ title: t("passport:common.back"),
14999
+ onClick: () => {
15000
+ const chainMenuOpenedFrom = useLayoutDataStore.getState().chainMenuOpenedFrom;
15001
+ useLayoutDataStore.getState().setPage(chainMenuOpenedFrom || "settings" /* SETTINGS */);
15002
+ },
15003
+ children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react22.ArrowLeft, { className: "h-4 w-4" })
15004
+ }
15005
+ ),
15006
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-xl font-semibold", children: t("passport:chainMenu.title") })
15007
+ ] }),
15008
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15009
+ Switch,
15010
+ {
15011
+ labels: { checked: "MAINNETS", unchecked: "ALL" },
15012
+ checked: isTestnets,
15013
+ onChange: () => setIsTestnets(!isTestnets)
15014
+ }
15015
+ )
15016
+ ] }),
15017
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: visibleNetworks.map((network, networkIdx) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
15018
+ ChainItem,
15019
+ {
15020
+ ...network,
15021
+ nextChainId,
15022
+ setNextChainId,
15023
+ isActivePaymasterDataLoading,
15024
+ activePaymasterData
15025
+ },
15026
+ `chain-${network.chainId}-${networkIdx}`
15027
+ )) })
15028
+ ] });
15078
15029
  }
15079
15030
  var import_core3, import_read15, import_react_query15, import_lucide_react22, import_react37, import_jsx_runtime58;
15080
15031
  var init_ChainsMenu = __esm({
@@ -15090,7 +15041,6 @@ var init_ChainsMenu = __esm({
15090
15041
  import_react37 = require("react");
15091
15042
  init_resolve_paymaster();
15092
15043
  init_useLayoutDataStore();
15093
- init_useLayoutStore();
15094
15044
  init_Expandable2();
15095
15045
  init_Onboarding();
15096
15046
  init_button();
@@ -15106,71 +15056,60 @@ function ChainSwitchRequest() {
15106
15056
  const config = useProviderConfig().config;
15107
15057
  const isLoading = useSession((st) => st.isLoading);
15108
15058
  const chainConfig = useSession((st) => st.chainConfig);
15109
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
15110
15059
  const prefferedChain = NETWORK_OPTIONS.find((ch) => ch.chainId === config.current?.network?.chainId) || null;
15111
15060
  const PrefferedChainIcon = prefferedChain?.Icon || (() => null);
15112
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
15113
- "div",
15114
- {
15115
- style: {
15116
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
15117
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
15118
- },
15119
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
15120
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
15121
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
15122
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
15123
- Button,
15124
- {
15125
- size: "icon",
15126
- variant: "ghost",
15127
- title: t("passport:common.back"),
15128
- onClick: () => useLayoutDataStore.getState().setPage("settings" /* SETTINGS */),
15129
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.ArrowLeft, { className: "h-4 w-4" })
15130
- }
15131
- ),
15132
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-xl font-semibold", children: t("passport:chainMenu.chainSwitchRequest.title") })
15133
- ] }),
15134
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Highlight, { type: "info", className: "flex gap-[var(--ui-kit-gap)]", children: [
15135
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.Info, { className: "w-4 h-4 flex-none" }),
15136
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "block", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
15137
- import_react_i18next2.Trans,
15138
- {
15139
- i18nKey: "passport:chainMenu.chainSwitchRequest.description",
15140
- values: {
15141
- preferredChain: `${prefferedChain?.name || "N/A"}`,
15142
- currentChain: `${chainConfig?.name || "N/A"}`
15143
- },
15144
- components: {
15145
- br: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("br", {}),
15146
- b: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "font-bold" })
15147
- }
15148
- }
15149
- ) })
15150
- ] }),
15151
- /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
15152
- Button,
15153
- {
15154
- size: "large",
15155
- variant: "default",
15156
- className: "w-full",
15157
- disabled: isLoading,
15158
- onClick: () => {
15159
- if (!config.current?.network?.chainId) return;
15160
- useSession.getState().setActiveChainId(config.current.network.chainId);
15161
- useLayoutDataStore.getState().setPage("chain" /* CHAIN */);
15162
- },
15163
- children: [
15164
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.Loader, { className: "w-6 h-6 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(PrefferedChainIcon, { className: "w-6 h-6" }),
15165
- t("passport:chainMenu.chainSwitchRequest.confirmButton", {
15166
- chain: `${prefferedChain?.name || "N/A"}`
15167
- })
15168
- ]
15061
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
15062
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
15063
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
15064
+ Button,
15065
+ {
15066
+ size: "icon",
15067
+ variant: "ghost",
15068
+ title: t("passport:common.back"),
15069
+ onClick: () => useLayoutDataStore.getState().setPage("settings" /* SETTINGS */),
15070
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.ArrowLeft, { className: "h-4 w-4" })
15071
+ }
15072
+ ),
15073
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-xl font-semibold", children: t("passport:chainMenu.chainSwitchRequest.title") })
15074
+ ] }),
15075
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Highlight, { type: "info", className: "flex gap-[var(--ui-kit-gap)]", children: [
15076
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.Info, { className: "w-4 h-4 flex-none" }),
15077
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "block", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
15078
+ import_react_i18next2.Trans,
15079
+ {
15080
+ i18nKey: "passport:chainMenu.chainSwitchRequest.description",
15081
+ values: {
15082
+ preferredChain: `${prefferedChain?.name || "N/A"}`,
15083
+ currentChain: `${chainConfig?.name || "N/A"}`
15084
+ },
15085
+ components: {
15086
+ br: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("br", {}),
15087
+ b: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "font-bold" })
15169
15088
  }
15170
- )
15171
- ] })
15172
- }
15173
- );
15089
+ }
15090
+ ) })
15091
+ ] }),
15092
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
15093
+ Button,
15094
+ {
15095
+ size: "large",
15096
+ variant: "default",
15097
+ className: "w-full",
15098
+ disabled: isLoading,
15099
+ onClick: () => {
15100
+ if (!config.current?.network?.chainId) return;
15101
+ useSession.getState().setActiveChainId(config.current.network.chainId);
15102
+ useLayoutDataStore.getState().setPage("chain" /* CHAIN */);
15103
+ },
15104
+ children: [
15105
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react23.Loader, { className: "w-6 h-6 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(PrefferedChainIcon, { className: "w-6 h-6" }),
15106
+ t("passport:chainMenu.chainSwitchRequest.confirmButton", {
15107
+ chain: `${prefferedChain?.name || "N/A"}`
15108
+ })
15109
+ ]
15110
+ }
15111
+ )
15112
+ ] });
15174
15113
  }
15175
15114
  var import_lucide_react23, import_react_i18next2, import_jsx_runtime59;
15176
15115
  var init_ChainSwitchRequest = __esm({
@@ -15182,7 +15121,6 @@ var init_ChainSwitchRequest = __esm({
15182
15121
  import_lucide_react23 = require("lucide-react");
15183
15122
  import_react_i18next2 = require("react-i18next");
15184
15123
  init_useLayoutDataStore();
15185
- init_useLayoutStore();
15186
15124
  init_Expandable2();
15187
15125
  init_button();
15188
15126
  init_highlight();
@@ -15190,6 +15128,21 @@ var init_ChainSwitchRequest = __esm({
15190
15128
  }
15191
15129
  });
15192
15130
 
15131
+ // src/internal/components/ChainsMenu/onboarding.setup.ts
15132
+ var CHAIN_MENU_TOUR;
15133
+ var init_onboarding_setup2 = __esm({
15134
+ "src/internal/components/ChainsMenu/onboarding.setup.ts"() {
15135
+ init_constants();
15136
+ CHAIN_MENU_TOUR = [
15137
+ {
15138
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"chain" /* CHAIN */}`,
15139
+ title: "passport:chainMenu.onboarding.chainMenu.title",
15140
+ description: "passport:chainMenu.onboarding.chainMenu.description"
15141
+ }
15142
+ ];
15143
+ }
15144
+ });
15145
+
15193
15146
  // src/internal/components/ChainsMenu/index.ts
15194
15147
  var init_ChainsMenu2 = __esm({
15195
15148
  "src/internal/components/ChainsMenu/index.ts"() {
@@ -16406,20 +16359,6 @@ var init_useLinkTelegram = __esm({
16406
16359
  }
16407
16360
  });
16408
16361
 
16409
- // src/internal/components/ManageWalletMenu/onboarding.setup.ts
16410
- var MANAGE_WALLET_MENU_TOUR;
16411
- var init_onboarding_setup3 = __esm({
16412
- "src/internal/components/ManageWalletMenu/onboarding.setup.ts"() {
16413
- MANAGE_WALLET_MENU_TOUR = [
16414
- {
16415
- elId: "embarkai-profiles-menu-onboarding" /* profilesMenu */,
16416
- title: "passport:profilesMenu.onboarding.profilesMenu.title",
16417
- description: "passport:profilesMenu.onboarding.profilesMenu.description"
16418
- }
16419
- ];
16420
- }
16421
- });
16422
-
16423
16362
  // src/internal/components/ManageWalletMenu/ProviderCard.tsx
16424
16363
  function getProviderCaption(provider) {
16425
16364
  const providerName = provider.provider;
@@ -16594,7 +16533,6 @@ function ManageWalletMenu() {
16594
16533
  const config = useProviderConfig().config;
16595
16534
  const { t } = useT();
16596
16535
  const { open: openEmbarkAI } = useOpenPage();
16597
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
16598
16536
  const {
16599
16537
  alert: alert2,
16600
16538
  providerType,
@@ -16689,66 +16627,54 @@ function ManageWalletMenu() {
16689
16627
  const showExtraProvidersUi = !isProvidersLoading && !providersError && (providerType === "email" || providerType === "passkey");
16690
16628
  useOnboardingTourAvailable(!showExtraProvidersUi && providerType === null);
16691
16629
  const combinedAlertMessage = alert2?.message || providersError?.message || null;
16692
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
16693
- "div",
16694
- {
16695
- ref: (inst) => onboarder.registerElement("embarkai-profiles-menu-onboarding" /* profilesMenu */, inst),
16696
- style: {
16697
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
16698
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
16699
- },
16700
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
16701
- children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
16702
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] w-full justify-between", children: [
16703
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
16704
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
16705
- Button,
16706
- {
16707
- variant: "ghost",
16708
- size: "icon",
16709
- title: t("passport:common.back"),
16710
- disabled: linkIsLoading,
16711
- onClick: () => {
16712
- setAlert(null);
16713
- if (providerType === "email") {
16714
- setEmail("");
16715
- setEmailCode("");
16716
- setEmailStep("input");
16717
- setEmailCodeExpiresAt(0);
16718
- }
16719
- if (!providerType) useLayoutDataStore.getState().setPage("settings" /* SETTINGS */);
16720
- setProviderType(null);
16721
- },
16722
- children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.ArrowLeft, { className: "h-4 w-4" })
16630
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
16631
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] w-full justify-between", children: [
16632
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
16633
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
16634
+ Button,
16635
+ {
16636
+ variant: "ghost",
16637
+ size: "icon",
16638
+ title: t("passport:common.back"),
16639
+ disabled: linkIsLoading,
16640
+ onClick: () => {
16641
+ setAlert(null);
16642
+ if (providerType === "email") {
16643
+ setEmail("");
16644
+ setEmailCode("");
16645
+ setEmailStep("input");
16646
+ setEmailCodeExpiresAt(0);
16723
16647
  }
16724
- ),
16725
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-xl font-semibold", children: t("passport:profilesMenu.title") })
16726
- ] }),
16727
- linkIsLoading && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.LoaderIcon, { className: "w-4 h-4 animate-spin text-[var(--ui-kit-fg-muted)]" })
16728
- ] }),
16729
- isProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center justify-center p-4 text-[var(--ui-kit-fg-muted)]", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.Loader, { className: "w-4 h-4 animate-spin" }) }),
16730
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EmailNotConnectedWarning, {}),
16731
- showCurrentProviders && renderProviders.map((node) => node),
16732
- showExtraProvidersUi && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(AddProvider, {}),
16733
- combinedAlertMessage && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Highlight, { type: "error", children: [
16734
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "break-words whitespace-pre-wrap mb-4", children: [
16735
- alert2?.title && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
16736
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("strong", { children: alert2.title }),
16737
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("br", {})
16738
- ] }),
16739
- combinedAlertMessage
16740
- ] }),
16741
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { variant: "default", size: "medium", className: "w-full", onClick: () => setAlert(null), children: t("passport:common.hide") })
16742
- ] })
16743
- ] })
16744
- }
16745
- );
16648
+ if (!providerType) useLayoutDataStore.getState().setPage("settings" /* SETTINGS */);
16649
+ setProviderType(null);
16650
+ },
16651
+ children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.ArrowLeft, { className: "h-4 w-4" })
16652
+ }
16653
+ ),
16654
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-xl font-semibold", children: t("passport:profilesMenu.title") })
16655
+ ] }),
16656
+ linkIsLoading && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.LoaderIcon, { className: "w-4 h-4 animate-spin text-[var(--ui-kit-fg-muted)]" })
16657
+ ] }),
16658
+ isProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center justify-center p-4 text-[var(--ui-kit-fg-muted)]", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react29.Loader, { className: "w-4 h-4 animate-spin" }) }),
16659
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EmailNotConnectedWarning, {}),
16660
+ showCurrentProviders && renderProviders.map((node) => node),
16661
+ showExtraProvidersUi && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(AddProvider, {}),
16662
+ combinedAlertMessage && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Highlight, { type: "error", children: [
16663
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "break-words whitespace-pre-wrap mb-4", children: [
16664
+ alert2?.title && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
16665
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("strong", { children: alert2.title }),
16666
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("br", {})
16667
+ ] }),
16668
+ combinedAlertMessage
16669
+ ] }),
16670
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Button, { variant: "default", size: "medium", className: "w-full", onClick: () => setAlert(null), children: t("passport:common.hide") })
16671
+ ] })
16672
+ ] });
16746
16673
  }
16747
16674
  var import_lodash_es8, import_lucide_react29, import_react41, import_jsx_runtime69, POSSIBLE_PROVIDERS, MULTI_PROVIDERS;
16748
16675
  var init_ManageWallet = __esm({
16749
16676
  "src/internal/components/ManageWalletMenu/ManageWallet.tsx"() {
16750
16677
  init_useLayoutDataStore();
16751
- init_useLayoutStore();
16752
16678
  init_ProviderContext();
16753
16679
  init_useOpenPage();
16754
16680
  init_i18n();
@@ -16896,6 +16822,21 @@ var init_UnlinkProviderMenu = __esm({
16896
16822
  }
16897
16823
  });
16898
16824
 
16825
+ // src/internal/components/ManageWalletMenu/onboarding.setup.ts
16826
+ var MANAGE_WALLET_MENU_TOUR;
16827
+ var init_onboarding_setup3 = __esm({
16828
+ "src/internal/components/ManageWalletMenu/onboarding.setup.ts"() {
16829
+ init_constants();
16830
+ MANAGE_WALLET_MENU_TOUR = [
16831
+ {
16832
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"manage-wallet" /* MANAGE_WALLET */}`,
16833
+ title: "passport:profilesMenu.onboarding.profilesMenu.title",
16834
+ description: "passport:profilesMenu.onboarding.profilesMenu.description"
16835
+ }
16836
+ ];
16837
+ }
16838
+ });
16839
+
16899
16840
  // src/internal/components/ManageWalletMenu/index.ts
16900
16841
  var init_ManageWalletMenu = __esm({
16901
16842
  "src/internal/components/ManageWalletMenu/index.ts"() {
@@ -16946,7 +16887,6 @@ function ConnectExternalWalletMenu() {
16946
16887
  const { isConnected: isExternalWalletConnected } = (0, import_wagmi2.useConnection)();
16947
16888
  const { mutate: disconnect } = (0, import_wagmi2.useDisconnect)();
16948
16889
  const { mutateAsync: signMessageAsync } = (0, import_wagmi2.useSignMessage)();
16949
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
16950
16890
  const walletMenuOpenedFrom = useLayoutDataStore((st) => st.walletMenuOpenedFrom);
16951
16891
  const { data: providers = [] } = (0, import_react_query24.useQuery)({
16952
16892
  retry: false,
@@ -17162,69 +17102,59 @@ function ConnectExternalWalletMenu() {
17162
17102
  return t("passport:connectMenu.instructions.confirm");
17163
17103
  }
17164
17104
  }, [embarkAiAddress, t]);
17165
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
17166
- "div",
17167
- {
17168
- style: {
17169
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
17170
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
17171
- },
17172
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
17173
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
17174
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
17175
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
17176
- Button,
17177
- {
17178
- variant: "ghost",
17179
- size: "icon",
17180
- title: t("passport:common.back"),
17181
- disabled: isConnectingExternalWallet || isLoginOrLinkOrConnectWallet,
17182
- onClick: () => useLayoutDataStore.getState().setPage(walletMenuOpenedFrom ?? "main-menu" /* MAIN_MENU */),
17183
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react31.ArrowLeft, { className: "h-4 w-4" })
17105
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
17106
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
17107
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
17108
+ Button,
17109
+ {
17110
+ variant: "ghost",
17111
+ size: "icon",
17112
+ title: t("passport:common.back"),
17113
+ disabled: isConnectingExternalWallet || isLoginOrLinkOrConnectWallet,
17114
+ onClick: () => useLayoutDataStore.getState().setPage(walletMenuOpenedFrom ?? "main-menu" /* MAIN_MENU */),
17115
+ children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react31.ArrowLeft, { className: "h-4 w-4" })
17116
+ }
17117
+ ),
17118
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-xl font-semibold", children: t("passport:connectMenu.connectWallet") })
17119
+ ] }),
17120
+ visibleConnectors.map((connector) => {
17121
+ const isConnectingThis = isConnectingExternalWallet && //@ts-expect-error uid exists
17122
+ pendingConnectVariables?.connector?.uid === connector.uid;
17123
+ const WalletIcon = WALLET_ICONS[connector.id] || import_lucide_react31.Wallet2Icon;
17124
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
17125
+ Button,
17126
+ {
17127
+ variant: "secondary",
17128
+ size: "large",
17129
+ className: "w-full justify-center",
17130
+ disabled: isConnectingExternalWallet,
17131
+ onClick: async () => {
17132
+ if (isExternalWalletConnected) {
17133
+ disconnect();
17134
+ await new Promise((resolve) => setTimeout(resolve, 500));
17184
17135
  }
17185
- ),
17186
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-xl font-semibold", children: t("passport:connectMenu.connectWallet") })
17187
- ] }),
17188
- visibleConnectors.map((connector) => {
17189
- const isConnectingThis = isConnectingExternalWallet && //@ts-expect-error uid exists
17190
- pendingConnectVariables?.connector?.uid === connector.uid;
17191
- const WalletIcon = WALLET_ICONS[connector.id] || import_lucide_react31.Wallet2Icon;
17192
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
17193
- Button,
17194
- {
17195
- variant: "secondary",
17196
- size: "large",
17197
- className: "w-full justify-center",
17198
- disabled: isConnectingExternalWallet,
17199
- onClick: async () => {
17200
- if (isExternalWalletConnected) {
17201
- disconnect();
17202
- await new Promise((resolve) => setTimeout(resolve, 500));
17203
- }
17204
- useLayoutStore.getState().setIsDialogForced(true);
17205
- connect({ connector });
17206
- },
17207
- children: [
17208
- isConnectingThis ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "w-6 h-6 flex-none flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react31.Loader, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WalletIcon, { className: "w-6 h-6 flex-none" }),
17209
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { children: connector.name })
17210
- ]
17211
- },
17212
- connector.uid
17213
- );
17214
- }),
17215
- isConnectingExternalWallet && !!pendingConnectVariables?.connector && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, {
17216
- type: "warning",
17217
- // @ts-expect-error i18n typing
17218
- children: t("passport:connectMenu.instructions.follow", {
17219
- wallet: pendingConnectVariables.connector.name,
17220
- steps: getInstructionSteps()
17221
- })
17222
- }),
17223
- visibleConnectors.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, { type: "info", children: t("passport:connectMenu.noWallets") }),
17224
- error && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, { type: "error", children: error.message })
17225
- ] })
17226
- }
17227
- );
17136
+ useLayoutStore.getState().setIsDialogForced(true);
17137
+ connect({ connector });
17138
+ },
17139
+ children: [
17140
+ isConnectingThis ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "w-6 h-6 flex-none flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react31.Loader, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WalletIcon, { className: "w-6 h-6 flex-none" }),
17141
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { children: connector.name })
17142
+ ]
17143
+ },
17144
+ connector.uid
17145
+ );
17146
+ }),
17147
+ isConnectingExternalWallet && !!pendingConnectVariables?.connector && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, {
17148
+ type: "warning",
17149
+ // @ts-expect-error i18n typing
17150
+ children: t("passport:connectMenu.instructions.follow", {
17151
+ wallet: pendingConnectVariables.connector.name,
17152
+ steps: getInstructionSteps()
17153
+ })
17154
+ }),
17155
+ visibleConnectors.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, { type: "info", children: t("passport:connectMenu.noWallets") }),
17156
+ error && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Highlight, { type: "error", children: error.message })
17157
+ ] });
17228
17158
  }
17229
17159
  var import_react_query24, import_lucide_react31, import_react44, import_wagmi2, import_jsx_runtime71;
17230
17160
  var init_ConnectExternalWalletMenu = __esm({
@@ -17404,7 +17334,6 @@ function getErrorMessage(err) {
17404
17334
  }
17405
17335
  function DeviceLinkScreen() {
17406
17336
  const setPage = useLayoutDataStore((s) => s.setPage);
17407
- const maxScrollHeight = useLayoutStore((s) => s.maxScrollHeight);
17408
17337
  const { mutate: link, isPending } = useLinkDevice();
17409
17338
  const [code, setCode] = (0, import_react46.useState)("");
17410
17339
  const [error, setError] = (0, import_react46.useState)(null);
@@ -17426,56 +17355,38 @@ function DeviceLinkScreen() {
17426
17355
  }
17427
17356
  });
17428
17357
  }
17429
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
17430
- "div",
17431
- {
17432
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
17433
- className: "list-scrollbar-y w-full",
17434
- children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
17435
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
17436
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("devices" /* DEVICES */), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react32.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
17437
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "text-xl font-semibold", children: "Link Device" })
17438
- ] }),
17439
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-sm text-[var(--ui-kit-fg-muted)]", children: "On your device: Long press to link smart wallet. Then enter the 6-character code shown on screen." }),
17440
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
17441
- "input",
17442
- {
17443
- type: "text",
17444
- value: code,
17445
- onChange: (e) => handleCodeChange(e.target.value),
17446
- onKeyDown: (e) => e.key === "Enter" && handleLink(),
17447
- placeholder: "XXXXXX",
17448
- autoFocus: true,
17449
- maxLength: 6,
17450
- className: "w-full text-center text-2xl tracking-[0.3em] font-mono px-4 py-3 rounded-lg\n bg-[var(--ui-kit-bg)] text-[var(--ui-kit-fg)]\n border border-[var(--ui-kit-bd)] focus:outline-none focus:border-[var(--ui-kit-primary)]\n uppercase"
17451
- }
17452
- ),
17453
- error && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-sm text-[var(--ui-kit-bg-error)]", children: error }),
17454
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
17455
- Button,
17456
- {
17457
- variant: "default",
17458
- size: "large",
17459
- className: "w-full",
17460
- disabled: !isValid || isPending,
17461
- onClick: handleLink,
17462
- children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react32.Loader2, { className: "w-4 h-4 animate-spin" }) : "Link"
17463
- }
17464
- )
17465
- ] })
17466
- }
17467
- );
17358
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
17359
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
17360
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("devices" /* DEVICES */), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react32.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
17361
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "text-xl font-semibold", children: "Link Device" })
17362
+ ] }),
17363
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-sm text-[var(--ui-kit-fg-muted)]", children: "On your device: Long press to link smart wallet. Then enter the 6-character code shown on screen." }),
17364
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
17365
+ "input",
17366
+ {
17367
+ type: "text",
17368
+ value: code,
17369
+ onChange: (e) => handleCodeChange(e.target.value),
17370
+ onKeyDown: (e) => e.key === "Enter" && handleLink(),
17371
+ placeholder: "XXXXXX",
17372
+ autoFocus: true,
17373
+ maxLength: 6,
17374
+ className: "w-full text-center text-2xl tracking-[0.3em] font-mono px-4 py-3 rounded-lg\n bg-[var(--ui-kit-bg)] text-[var(--ui-kit-fg)]\n border border-[var(--ui-kit-bd)] focus:outline-none focus:border-[var(--ui-kit-primary)]\n uppercase"
17375
+ }
17376
+ ),
17377
+ error && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "text-sm text-[var(--ui-kit-bg-error)]", children: error }),
17378
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "default", size: "large", className: "w-full", disabled: !isValid || isPending, onClick: handleLink, children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react32.Loader2, { className: "w-4 h-4 animate-spin" }) : "Link" })
17379
+ ] });
17468
17380
  }
17469
- var import_react46, import_lucide_react32, import_jsx_runtime72, VALID_CHARS;
17381
+ var import_lucide_react32, import_react46, import_jsx_runtime72, VALID_CHARS;
17470
17382
  var init_DeviceLinkScreen = __esm({
17471
17383
  "src/internal/components/DevicesMenu/DeviceLinkScreen.tsx"() {
17472
- import_react46 = require("react");
17473
17384
  import_lucide_react32 = require("lucide-react");
17385
+ import_react46 = require("react");
17386
+ init_devices();
17387
+ init_useLayoutDataStore();
17474
17388
  init_Expandable2();
17475
17389
  init_button();
17476
- init_useLayoutDataStore();
17477
- init_useLayoutStore();
17478
- init_devices();
17479
17390
  import_jsx_runtime72 = require("react/jsx-runtime");
17480
17391
  VALID_CHARS = /^[A-HJ-NP-Z2-9]*$/;
17481
17392
  }
@@ -18006,7 +17917,6 @@ function formatSize(bytes) {
18006
17917
  function DeviceManageScreen() {
18007
17918
  const setPage = useLayoutDataStore((s) => s.setPage);
18008
17919
  const pageParams = useLayoutDataStore((s) => s.pageParams);
18009
- const maxScrollHeight = useLayoutStore((s) => s.maxScrollHeight);
18010
17920
  const session = useSession((st) => st.session);
18011
17921
  const userId = session?.mpcUserId || "";
18012
17922
  const deviceId = pageParams?.deviceId;
@@ -18108,185 +18018,204 @@ function DeviceManageScreen() {
18108
18018
  setActionState(null);
18109
18019
  }
18110
18020
  }, [password, userId, refreshList]);
18111
- const handleDelete = (0, import_react47.useCallback)(async (keyshareId) => {
18112
- const guardian = guardianRef.current;
18113
- if (!guardian) return;
18114
- setActionState({ action: "delete", keyshareId, substep: "confirm-device" });
18115
- setErrorMessage(null);
18116
- setWaitingConfirm(true);
18117
- try {
18118
- await deleteFromGuardian(guardian, keyshareId);
18119
- setWaitingConfirm(false);
18120
- setStatusMessage("Keyshare deleted.");
18121
- setActionState(null);
18122
- await refreshList();
18123
- } catch (err) {
18124
- setWaitingConfirm(false);
18125
- setErrorMessage(err.message);
18126
- setActionState(null);
18127
- }
18128
- }, [refreshList]);
18021
+ const handleDelete = (0, import_react47.useCallback)(
18022
+ async (keyshareId) => {
18023
+ const guardian = guardianRef.current;
18024
+ if (!guardian) return;
18025
+ setActionState({ action: "delete", keyshareId, substep: "confirm-device" });
18026
+ setErrorMessage(null);
18027
+ setWaitingConfirm(true);
18028
+ try {
18029
+ await deleteFromGuardian(guardian, keyshareId);
18030
+ setWaitingConfirm(false);
18031
+ setStatusMessage("Keyshare deleted.");
18032
+ setActionState(null);
18033
+ await refreshList();
18034
+ } catch (err) {
18035
+ setWaitingConfirm(false);
18036
+ setErrorMessage(err.message);
18037
+ setActionState(null);
18038
+ }
18039
+ },
18040
+ [refreshList]
18041
+ );
18129
18042
  const isWorking = actionState?.substep === "working" || actionState?.substep === "confirm-device";
18130
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18131
- "div",
18132
- {
18133
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
18134
- className: "list-scrollbar-y w-full",
18135
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18136
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18137
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => {
18043
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18044
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18045
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18046
+ Button,
18047
+ {
18048
+ variant: "ghost",
18049
+ size: "icon",
18050
+ onClick: () => {
18138
18051
  guardianRef.current?.close();
18139
18052
  setPage("devices" /* DEVICES */);
18140
- }, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
18141
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.HardDrive, { className: "h-5 w-5 flex-none" }),
18142
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xl font-semibold", children: deviceName || "Guardian" }),
18143
- screen.step === "connected" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)] ml-auto", children: [
18144
- "v",
18145
- screen.info.fwVer
18146
- ] })
18147
- ] }),
18148
- waitingConfirm && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-[var(--ui-kit-bg)] text-sm animate-pulse", children: [
18149
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-4 h-4 animate-spin" }),
18150
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: "Confirm on your device..." })
18053
+ },
18054
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.ArrowLeft, { className: "h-4 w-4 flex-none" })
18055
+ }
18056
+ ),
18057
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.HardDrive, { className: "h-5 w-5 flex-none" }),
18058
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xl font-semibold", children: deviceName || "Guardian" }),
18059
+ screen.step === "connected" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)] ml-auto", children: [
18060
+ "v",
18061
+ screen.info.fwVer
18062
+ ] })
18063
+ ] }),
18064
+ waitingConfirm && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded-lg bg-[var(--ui-kit-bg)] text-sm animate-pulse", children: [
18065
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-4 h-4 animate-spin" }),
18066
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: "Confirm on your device..." })
18067
+ ] }),
18068
+ statusMessage && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-green-500 p-2", children: statusMessage }),
18069
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] p-2", children: errorMessage }),
18070
+ screen.step === "connecting" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-6 h-6 animate-spin text-[var(--ui-kit-fg-muted)]" }) }),
18071
+ screen.step === "error" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] text-center py-8", children: screen.message }),
18072
+ screen.step === "new-device" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col items-center gap-4 py-8", children: [
18073
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Cpu, { className: "w-10 h-10 text-[var(--ui-kit-fg-muted)]" }),
18074
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-center", children: [
18075
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-sm font-semibold", children: "New device detected" }),
18076
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { className: "text-xs text-[var(--ui-kit-fg-muted)] mt-1", children: [
18077
+ screen.info.deviceId,
18078
+ " \xB7 v",
18079
+ screen.info.fwVer
18080
+ ] })
18081
+ ] }),
18082
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18083
+ Button,
18084
+ {
18085
+ variant: "default",
18086
+ size: "large",
18087
+ className: "w-full",
18088
+ onClick: () => {
18089
+ setPage("device-link" /* DEVICE_LINK */);
18090
+ },
18091
+ children: "Link Device"
18092
+ }
18093
+ )
18094
+ ] }),
18095
+ screen.step === "connected" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
18096
+ screen.keyshares.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-fg-muted)] text-center py-4", children: "No keyshares stored on this device" }),
18097
+ screen.keyshares.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-xs text-[var(--ui-kit-fg-muted)] text-right", children: [
18098
+ screen.keyshares.length,
18099
+ " keyshare",
18100
+ screen.keyshares.length > 1 ? "s" : "",
18101
+ " \xB7",
18102
+ " ",
18103
+ formatSize(screen.keyshares.reduce((s, e) => s + e.size, 0))
18104
+ ] }),
18105
+ screen.keyshares.map(({ id, size }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-3 p-3 rounded-lg bg-[var(--ui-kit-bg)]", children: [
18106
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Cpu, { className: "w-5 h-5 text-[var(--ui-kit-fg-muted)] shrink-0" }),
18107
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex-1 min-w-0", children: [
18108
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-sm font-mono truncate block text-[var(--ui-kit-fg)]", children: id }),
18109
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)]", children: formatSize(size) })
18151
18110
  ] }),
18152
- statusMessage && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-green-500 p-2", children: statusMessage }),
18153
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] p-2", children: errorMessage }),
18154
- screen.step === "connecting" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-6 h-6 animate-spin text-[var(--ui-kit-fg-muted)]" }) }),
18155
- screen.step === "error" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] text-center py-8", children: screen.message }),
18156
- screen.step === "new-device" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col items-center gap-4 py-8", children: [
18157
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Cpu, { className: "w-10 h-10 text-[var(--ui-kit-fg-muted)]" }),
18158
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-center", children: [
18159
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-sm font-semibold", children: "New device detected" }),
18160
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("p", { className: "text-xs text-[var(--ui-kit-fg-muted)] mt-1", children: [
18161
- screen.info.deviceId,
18162
- " \xB7 v",
18163
- screen.info.fwVer
18164
- ] })
18165
- ] }),
18111
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18112
+ Button,
18113
+ {
18114
+ variant: "ghost",
18115
+ size: "icon",
18116
+ disabled: isWorking,
18117
+ onClick: () => {
18118
+ guardianRef.current?.close();
18119
+ const store = useLayoutDataStore.getState();
18120
+ store.setPageParams({ key: "device-restore" /* DEVICE_RESTORE */, keyshareId: id, deviceId, deviceName });
18121
+ store.setPage("device-restore" /* DEVICE_RESTORE */);
18122
+ },
18123
+ title: "Restore",
18124
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Download, { className: "w-4 h-4" })
18125
+ }
18126
+ ),
18127
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18128
+ Button,
18129
+ {
18130
+ variant: "ghost",
18131
+ size: "icon",
18132
+ disabled: isWorking,
18133
+ onClick: () => handleDelete(id),
18134
+ title: "Delete",
18135
+ className: "text-[var(--ui-kit-bg-error)]",
18136
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Trash2, { className: "w-4 h-4" })
18137
+ }
18138
+ )
18139
+ ] }, id)),
18140
+ actionState?.action === "overwrite" && actionState.substep === "confirm" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center justify-between gap-2 p-3 rounded-lg bg-[var(--ui-kit-bg)]", children: [
18141
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-sm", children: "Keyshare exists. Overwrite? (requires button press on device)" }),
18142
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex gap-2", children: [
18166
18143
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18167
18144
  Button,
18168
18145
  {
18169
- variant: "default",
18170
- size: "large",
18171
- className: "w-full",
18146
+ variant: "ghost",
18147
+ size: "small",
18172
18148
  onClick: () => {
18173
- setPage("device-link" /* DEVICE_LINK */);
18174
- },
18175
- children: "Link Device"
18176
- }
18177
- )
18178
- ] }),
18179
- screen.step === "connected" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
18180
- screen.keyshares.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "text-sm text-[var(--ui-kit-fg-muted)] text-center py-4", children: "No keyshares stored on this device" }),
18181
- screen.keyshares.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-xs text-[var(--ui-kit-fg-muted)] text-right", children: [
18182
- screen.keyshares.length,
18183
- " keyshare",
18184
- screen.keyshares.length > 1 ? "s" : "",
18185
- " \xB7 ",
18186
- formatSize(screen.keyshares.reduce((s, e) => s + e.size, 0))
18187
- ] }),
18188
- screen.keyshares.map(({ id, size }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-3 p-3 rounded-lg bg-[var(--ui-kit-bg)]", children: [
18189
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Cpu, { className: "w-5 h-5 text-[var(--ui-kit-fg-muted)] shrink-0" }),
18190
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex-1 min-w-0", children: [
18191
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-sm font-mono truncate block text-[var(--ui-kit-fg)]", children: id }),
18192
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)]", children: formatSize(size) })
18193
- ] }),
18194
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18195
- Button,
18196
- {
18197
- variant: "ghost",
18198
- size: "icon",
18199
- disabled: isWorking,
18200
- onClick: () => {
18201
- guardianRef.current?.close();
18202
- const store = useLayoutDataStore.getState();
18203
- store.setPageParams({ key: "device-restore" /* DEVICE_RESTORE */, keyshareId: id, deviceId, deviceName });
18204
- store.setPage("device-restore" /* DEVICE_RESTORE */);
18205
- },
18206
- title: "Restore",
18207
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Download, { className: "w-4 h-4" })
18208
- }
18209
- ),
18210
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18211
- Button,
18212
- {
18213
- variant: "ghost",
18214
- size: "icon",
18215
- disabled: isWorking,
18216
- onClick: () => handleDelete(id),
18217
- title: "Delete",
18218
- className: "text-[var(--ui-kit-bg-error)]",
18219
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Trash2, { className: "w-4 h-4" })
18220
- }
18221
- )
18222
- ] }, id)),
18223
- actionState?.action === "overwrite" && actionState.substep === "confirm" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center justify-between gap-2 p-3 rounded-lg bg-[var(--ui-kit-bg)]", children: [
18224
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-sm", children: "Keyshare exists. Overwrite? (requires button press on device)" }),
18225
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex gap-2", children: [
18226
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "ghost", size: "small", onClick: () => {
18227
18149
  setActionState(null);
18228
18150
  setPassword("");
18229
- }, children: "Cancel" }),
18230
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "outline", size: "small", onClick: handleOverwrite, children: "Overwrite" })
18231
- ] })
18232
- ] }),
18233
- actionState?.action === "backup" && actionState.substep === "password" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex gap-2", children: [
18234
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18235
- "input",
18236
- {
18237
- type: "password",
18238
- autoComplete: "one-time-code",
18239
- "data-1p-ignore": true,
18240
- "data-lpignore": "true",
18241
- value: password,
18242
- onChange: (e) => setPassword(e.target.value),
18243
- onKeyDown: (e) => e.key === "Enter" && password && handleBackup(),
18244
- placeholder: "Encryption password",
18245
- className: "flex-1 text-sm px-3 py-2 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bd)] text-[var(--ui-kit-fg)] focus:outline-none focus:border-[var(--ui-kit-primary)]",
18246
- autoFocus: true
18247
- }
18248
- ),
18249
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "default", disabled: !password, onClick: handleBackup, children: "Backup" }),
18250
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "ghost", onClick: () => {
18251
- setActionState(null);
18252
- setPassword("");
18253
- }, children: "Cancel" })
18254
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
18255
- Button,
18256
- {
18257
- variant: "default",
18258
- size: "large",
18259
- className: "w-full",
18260
- disabled: isWorking,
18261
- onClick: () => {
18262
- setStatusMessage(null);
18263
- setErrorMessage(null);
18264
- setActionState({ action: "backup", substep: "password" });
18265
18151
  },
18266
- children: [
18267
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Upload, { className: "w-4 h-4" }),
18268
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: "Backup Current Keyshare" })
18269
- ]
18152
+ children: "Cancel"
18270
18153
  }
18271
18154
  ),
18272
- actionState?.substep === "working" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-5 h-5 animate-spin" }) })
18155
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "outline", size: "small", onClick: handleOverwrite, children: "Overwrite" })
18273
18156
  ] })
18274
- ] })
18275
- }
18276
- );
18157
+ ] }),
18158
+ actionState?.action === "backup" && actionState.substep === "password" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex gap-2", children: [
18159
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18160
+ "input",
18161
+ {
18162
+ type: "password",
18163
+ autoComplete: "one-time-code",
18164
+ "data-1p-ignore": true,
18165
+ "data-lpignore": "true",
18166
+ value: password,
18167
+ onChange: (e) => setPassword(e.target.value),
18168
+ onKeyDown: (e) => e.key === "Enter" && password && handleBackup(),
18169
+ placeholder: "Encryption password",
18170
+ className: "flex-1 text-sm px-3 py-2 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bd)] text-[var(--ui-kit-fg)] focus:outline-none focus:border-[var(--ui-kit-primary)]",
18171
+ autoFocus: true
18172
+ }
18173
+ ),
18174
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Button, { variant: "default", disabled: !password, onClick: handleBackup, children: "Backup" }),
18175
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
18176
+ Button,
18177
+ {
18178
+ variant: "ghost",
18179
+ onClick: () => {
18180
+ setActionState(null);
18181
+ setPassword("");
18182
+ },
18183
+ children: "Cancel"
18184
+ }
18185
+ )
18186
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
18187
+ Button,
18188
+ {
18189
+ variant: "default",
18190
+ size: "large",
18191
+ className: "w-full",
18192
+ disabled: isWorking,
18193
+ onClick: () => {
18194
+ setStatusMessage(null);
18195
+ setErrorMessage(null);
18196
+ setActionState({ action: "backup", substep: "password" });
18197
+ },
18198
+ children: [
18199
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Upload, { className: "w-4 h-4" }),
18200
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: "Backup Current Keyshare" })
18201
+ ]
18202
+ }
18203
+ ),
18204
+ actionState?.substep === "working" && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react33.Loader2, { className: "w-5 h-5 animate-spin" }) })
18205
+ ] })
18206
+ ] });
18277
18207
  }
18278
- var import_react47, import_lucide_react33, import_jsx_runtime73;
18208
+ var import_lucide_react33, import_react47, import_jsx_runtime73;
18279
18209
  var init_DeviceManageScreen = __esm({
18280
18210
  "src/internal/components/DevicesMenu/DeviceManageScreen.tsx"() {
18281
- import_react47 = require("react");
18211
+ init_SessionContext();
18282
18212
  import_lucide_react33 = require("lucide-react");
18283
- init_Expandable2();
18284
- init_button();
18213
+ import_react47 = require("react");
18214
+ init_guardian_backup();
18285
18215
  init_useLayoutDataStore();
18286
- init_useLayoutStore();
18287
- init_SessionContext();
18288
18216
  init_iframe_manager();
18289
- init_guardian_backup();
18217
+ init_Expandable2();
18218
+ init_button();
18290
18219
  import_jsx_runtime73 = require("react/jsx-runtime");
18291
18220
  }
18292
18221
  });
@@ -18295,7 +18224,6 @@ var init_DeviceManageScreen = __esm({
18295
18224
  function DeviceRestoreScreen() {
18296
18225
  const setPage = useLayoutDataStore((s) => s.setPage);
18297
18226
  const pageParams = useLayoutDataStore((s) => s.pageParams);
18298
- const maxScrollHeight = useLayoutStore((s) => s.maxScrollHeight);
18299
18227
  const session = useSession((st) => st.session);
18300
18228
  const userId = session?.mpcUserId || "";
18301
18229
  const keyshareId = pageParams?.keyshareId;
@@ -18331,79 +18259,71 @@ function DeviceRestoreScreen() {
18331
18259
  setIsWorking(false);
18332
18260
  }
18333
18261
  }, [password, keyshareId, userId, deviceId]);
18334
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
18335
- "div",
18336
- {
18337
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
18338
- className: "list-scrollbar-y w-full",
18339
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18340
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18341
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("device-manage" /* DEVICE_MANAGE */), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
18342
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "text-xl font-semibold", children: "Restore Keyshare" })
18343
- ] }),
18344
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex gap-3 p-3 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bg-error)]", children: [
18345
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.AlertTriangle, { className: "w-5 h-5 text-[var(--ui-kit-bg-error)] shrink-0 mt-0.5" }),
18346
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "text-sm", children: [
18347
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "font-semibold text-[var(--ui-kit-bg-error)]", children: "This will replace your current keyshare" }),
18348
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "text-[var(--ui-kit-fg-muted)] mt-1", children: [
18349
- "Your existing keyshare will be overwritten with the backup from ",
18350
- deviceName || "Guardian",
18351
- " device. Make sure you have a backup of your current keyshare before proceeding."
18352
- ] })
18353
- ] })
18354
- ] }),
18355
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-xs text-[var(--ui-kit-fg-muted)] font-mono truncate px-1", children: keyshareId }),
18356
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
18357
- "input",
18358
- {
18359
- type: "password",
18360
- autoComplete: "one-time-code",
18361
- "data-1p-ignore": true,
18362
- "data-lpignore": "true",
18363
- value: password,
18364
- onChange: (e) => setPassword(e.target.value),
18365
- onKeyDown: (e) => e.key === "Enter" && password && !isWorking && handleRestore(),
18366
- placeholder: "Encryption password",
18367
- className: "w-full text-sm px-3 py-2 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bd)] text-[var(--ui-kit-fg)] focus:outline-none focus:border-[var(--ui-kit-primary)]",
18368
- autoFocus: true,
18369
- disabled: isWorking
18370
- }
18371
- ),
18372
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
18373
- Button,
18374
- {
18375
- variant: "default",
18376
- size: "large",
18377
- className: "w-full",
18378
- disabled: !password || isWorking,
18379
- onClick: handleRestore,
18380
- children: isWorking ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
18381
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.Loader2, { className: "w-4 h-4 animate-spin" }),
18382
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: "Restoring \u2014 confirm on your device..." })
18383
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
18384
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.Download, { className: "w-4 h-4" }),
18385
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: "Restore from Guardian" })
18386
- ] })
18387
- }
18388
- ),
18389
- statusMessage && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-sm text-green-500 p-2 text-center", children: statusMessage }),
18390
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] p-2 text-center", children: errorMessage })
18262
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18263
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18264
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("device-manage" /* DEVICE_MANAGE */), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
18265
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "text-xl font-semibold", children: "Restore Keyshare" })
18266
+ ] }),
18267
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex gap-3 p-3 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bg-error)]", children: [
18268
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.AlertTriangle, { className: "w-5 h-5 text-[var(--ui-kit-bg-error)] shrink-0 mt-0.5" }),
18269
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "text-sm", children: [
18270
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "font-semibold text-[var(--ui-kit-bg-error)]", children: "This will replace your current keyshare" }),
18271
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "text-[var(--ui-kit-fg-muted)] mt-1", children: [
18272
+ "Your existing keyshare will be overwritten with the backup from ",
18273
+ deviceName || "Guardian",
18274
+ " device. Make sure you have a backup of your current keyshare before proceeding."
18275
+ ] })
18391
18276
  ] })
18392
- }
18393
- );
18277
+ ] }),
18278
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-xs text-[var(--ui-kit-fg-muted)] font-mono truncate px-1", children: keyshareId }),
18279
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
18280
+ "input",
18281
+ {
18282
+ type: "password",
18283
+ autoComplete: "one-time-code",
18284
+ "data-1p-ignore": true,
18285
+ "data-lpignore": "true",
18286
+ value: password,
18287
+ onChange: (e) => setPassword(e.target.value),
18288
+ onKeyDown: (e) => e.key === "Enter" && password && !isWorking && handleRestore(),
18289
+ placeholder: "Encryption password",
18290
+ className: "w-full text-sm px-3 py-2 rounded-lg bg-[var(--ui-kit-bg)] border border-[var(--ui-kit-bd)] text-[var(--ui-kit-fg)] focus:outline-none focus:border-[var(--ui-kit-primary)]",
18291
+ autoFocus: true,
18292
+ disabled: isWorking
18293
+ }
18294
+ ),
18295
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
18296
+ Button,
18297
+ {
18298
+ variant: "default",
18299
+ size: "large",
18300
+ className: "w-full",
18301
+ disabled: !password || isWorking,
18302
+ onClick: handleRestore,
18303
+ children: isWorking ? /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
18304
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.Loader2, { className: "w-4 h-4 animate-spin" }),
18305
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: "Restoring \u2014 confirm on your device..." })
18306
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
18307
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react34.Download, { className: "w-4 h-4" }),
18308
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: "Restore from Guardian" })
18309
+ ] })
18310
+ }
18311
+ ),
18312
+ statusMessage && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-sm text-green-500 p-2 text-center", children: statusMessage }),
18313
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] p-2 text-center", children: errorMessage })
18314
+ ] });
18394
18315
  }
18395
- var import_react48, import_lucide_react34, import_jsx_runtime74;
18316
+ var import_lucide_react34, import_react48, import_jsx_runtime74;
18396
18317
  var init_DeviceRestoreScreen = __esm({
18397
18318
  "src/internal/components/DevicesMenu/DeviceRestoreScreen.tsx"() {
18398
- import_react48 = require("react");
18319
+ init_SessionContext();
18399
18320
  import_lucide_react34 = require("lucide-react");
18400
- init_Expandable2();
18401
- init_button();
18321
+ import_react48 = require("react");
18322
+ init_guardian_backup();
18402
18323
  init_useLayoutDataStore();
18403
- init_useLayoutStore();
18404
- init_SessionContext();
18405
18324
  init_iframe_manager();
18406
- init_guardian_backup();
18325
+ init_Expandable2();
18326
+ init_button();
18407
18327
  import_jsx_runtime74 = require("react/jsx-runtime");
18408
18328
  }
18409
18329
  });
@@ -18477,7 +18397,11 @@ function DeviceRow({ device }) {
18477
18397
  {
18478
18398
  onClick: () => {
18479
18399
  const store = useLayoutDataStore.getState();
18480
- store.setPageParams({ key: "device-manage" /* DEVICE_MANAGE */, deviceId: device.deviceId, deviceName: device.deviceName });
18400
+ store.setPageParams({
18401
+ key: "device-manage" /* DEVICE_MANAGE */,
18402
+ deviceId: device.deviceId,
18403
+ deviceName: device.deviceName
18404
+ });
18481
18405
  store.setPage("device-manage" /* DEVICE_MANAGE */);
18482
18406
  },
18483
18407
  className: "text-[var(--ui-kit-fg-muted)] hover:text-[var(--ui-kit-fg)] transition-colors shrink-0",
@@ -18497,53 +18421,35 @@ function DeviceRow({ device }) {
18497
18421
  }
18498
18422
  function DevicesMenu() {
18499
18423
  const setPage = useLayoutDataStore((s) => s.setPage);
18500
- const maxScrollHeight = useLayoutStore((s) => s.maxScrollHeight);
18501
18424
  const { data, isLoading, error, refetch, isFetching } = useDevices();
18502
18425
  const devices = data?.devices ?? [];
18503
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18504
- "div",
18505
- {
18506
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
18507
- className: "list-scrollbar-y w-full",
18508
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18509
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18510
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
18511
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-xl font-semibold", children: "Devices" }),
18512
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.Loader2, { className: "w-4 h-4 animate-spin" }),
18513
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-1" }),
18514
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => refetch(), disabled: isFetching, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.RefreshCw, { className: `h-4 w-4 flex-none ${isFetching ? "animate-spin" : ""}` }) })
18515
- ] }),
18516
- error && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] text-center py-4", children: "Failed to load devices" }),
18517
- !isLoading && !error && devices.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-sm text-[var(--ui-kit-fg-muted)] text-center py-8", children: "No linked devices" }),
18518
- devices.map((device) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DeviceRow, { device }, device.deviceId)),
18519
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
18520
- Button,
18521
- {
18522
- variant: "default",
18523
- size: "large",
18524
- className: "w-full",
18525
- onClick: () => setPage("device-link" /* DEVICE_LINK */),
18526
- children: [
18527
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.Cpu, { className: "w-4 h-4" }),
18528
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: "Add Device" })
18529
- ]
18530
- }
18531
- )
18532
- ] })
18533
- }
18534
- );
18426
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
18427
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
18428
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.ArrowLeft, { className: "h-4 w-4 flex-none" }) }),
18429
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-xl font-semibold", children: "Devices" }),
18430
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.Loader2, { className: "w-4 h-4 animate-spin" }),
18431
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-1" }),
18432
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button, { variant: "ghost", size: "icon", onClick: () => refetch(), disabled: isFetching, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.RefreshCw, { className: `h-4 w-4 flex-none ${isFetching ? "animate-spin" : ""}` }) })
18433
+ ] }),
18434
+ error && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-sm text-[var(--ui-kit-bg-error)] text-center py-4", children: "Failed to load devices" }),
18435
+ !isLoading && !error && devices.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "text-sm text-[var(--ui-kit-fg-muted)] text-center py-8", children: "No linked devices" }),
18436
+ devices.map((device) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DeviceRow, { device }, device.deviceId)),
18437
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Button, { variant: "default", size: "large", className: "w-full", onClick: () => setPage("device-link" /* DEVICE_LINK */), children: [
18438
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react35.Cpu, { className: "w-4 h-4" }),
18439
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: "Add Device" })
18440
+ ] })
18441
+ ] });
18535
18442
  }
18536
- var import_react49, import_lucide_react35, import_jsx_runtime75;
18443
+ var import_lucide_react35, import_react49, import_jsx_runtime75;
18537
18444
  var init_DevicesMenu = __esm({
18538
18445
  "src/internal/components/DevicesMenu/DevicesMenu.tsx"() {
18539
- import_react49 = require("react");
18540
18446
  import_lucide_react35 = require("lucide-react");
18541
- init_Expandable2();
18542
- init_button();
18543
- init_useLayoutDataStore();
18544
- init_useLayoutStore();
18447
+ import_react49 = require("react");
18545
18448
  init_devices();
18546
18449
  init_guardian_backup();
18450
+ init_useLayoutDataStore();
18451
+ init_Expandable2();
18452
+ init_button();
18547
18453
  import_jsx_runtime75 = require("react/jsx-runtime");
18548
18454
  }
18549
18455
  });
@@ -19426,10 +19332,11 @@ var init_MethodSelector = __esm({
19426
19332
  var KEYSHARE_BACKUP_MENU_TOUR, KEYSHARE_BACKUP_MENU_TOUR_NO_PASSKEY;
19427
19333
  var init_onboarding_setup4 = __esm({
19428
19334
  "src/internal/components/KeyshareRestoreMenu/onboarding.setup.ts"() {
19335
+ init_constants();
19429
19336
  init_hooks();
19430
19337
  KEYSHARE_BACKUP_MENU_TOUR = [
19431
19338
  {
19432
- elId: "embarkai-keyshare-backup-menu-onboarding" /* backupMenu */,
19339
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"keysare-backup" /* KEYSARE_BACKUP */}`,
19433
19340
  title: "passport:backupMenu.onboarding.backupMenu.title",
19434
19341
  description: "passport:backupMenu.onboarding.backupMenu.description",
19435
19342
  onNext: () => {
@@ -19454,7 +19361,7 @@ var init_onboarding_setup4 = __esm({
19454
19361
  }
19455
19362
  },
19456
19363
  {
19457
- elId: "embarkai-keyshare-backup-menu-onboarding" /* backupMenu */,
19364
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"keysare-backup" /* KEYSARE_BACKUP */}`,
19458
19365
  title: "passport:backupMenu.onboarding.backupEncryptionPassword.title",
19459
19366
  description: "passport:backupMenu.onboarding.backupEncryptionPassword.description",
19460
19367
  onNext: () => {
@@ -19465,7 +19372,7 @@ var init_onboarding_setup4 = __esm({
19465
19372
  }
19466
19373
  },
19467
19374
  {
19468
- elId: "embarkai-keyshare-backup-menu-onboarding" /* backupMenu */,
19375
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"keysare-backup" /* KEYSARE_BACKUP */}`,
19469
19376
  title: "passport:backupMenu.onboarding.backupEncryptionPasskey.title",
19470
19377
  description: "passport:backupMenu.onboarding.backupEncryptionPasskey.description",
19471
19378
  onNext: () => {
@@ -19485,7 +19392,7 @@ var init_onboarding_setup4 = __esm({
19485
19392
  ];
19486
19393
  KEYSHARE_BACKUP_MENU_TOUR_NO_PASSKEY = [
19487
19394
  {
19488
- elId: "embarkai-keyshare-backup-menu-onboarding" /* backupMenu */,
19395
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"keysare-backup" /* KEYSARE_BACKUP */}`,
19489
19396
  title: "passport:backupMenu.onboarding.backupMenu.title",
19490
19397
  description: "passport:backupMenu.onboarding.backupMenu.description",
19491
19398
  onNext: () => {
@@ -19500,7 +19407,7 @@ var init_onboarding_setup4 = __esm({
19500
19407
  }
19501
19408
  },
19502
19409
  {
19503
- elId: "embarkai-keyshare-backup-menu-onboarding" /* backupMenu */,
19410
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"keysare-backup" /* KEYSARE_BACKUP */}`,
19504
19411
  title: "passport:backupMenu.onboarding.backupEncryptionPassword.title",
19505
19412
  description: "passport:backupMenu.onboarding.backupEncryptionPassword.description",
19506
19413
  onNext: () => {
@@ -20395,7 +20302,6 @@ var init_KeyshareRestoreMenu = __esm({
20395
20302
  const { callbacksRef } = useProviderConfig();
20396
20303
  const { t } = useT();
20397
20304
  const address = useSession((st) => st.address);
20398
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
20399
20305
  const error = useRestoreStore((st) => st.error);
20400
20306
  const success = useRestoreStore((st) => st.success);
20401
20307
  const currentRestoreMethod = useRestoreStore((st) => st.method);
@@ -20478,106 +20384,99 @@ var init_KeyshareRestoreMenu = __esm({
20478
20384
  }
20479
20385
  });
20480
20386
  const RestoreComponent = currentRestoreMethod ? RESTORE_COMPONENTS[currentRestoreMethod] : null;
20481
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20482
- "div",
20483
- {
20484
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
20485
- className: "list-scrollbar-y w-full",
20486
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
20487
- isBackupStatusLoading && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)] text-center justify-center items-center", children: [
20488
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }),
20489
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "block w-full text-xs leading-4", children: t("passport:restoreMenu.check") })
20387
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20388
+ isBackupStatusLoading && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)] text-center justify-center items-center", children: [
20389
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }),
20390
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "block w-full text-xs leading-4", children: t("passport:restoreMenu.check") })
20391
+ ] }),
20392
+ !success && !isBackupStatusLoading && !isDisconnecting && !hasServerBackup && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20393
+ NoBackupFound,
20394
+ {
20395
+ isLoading: isRestoringFromServer || isRestoringFromCloud || isRestoringFromFile || isDisconnecting,
20396
+ restoreFromFile
20397
+ }
20398
+ ),
20399
+ !success && !isBackupStatusLoading && !isDisconnecting && hasServerBackup && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
20400
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center justify-between gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
20401
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20402
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.CloudDownload, { className: "w-6 h-6" }),
20403
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "font-bold text-xl leading-6", children: t("passport:restoreMenu.title") })
20490
20404
  ] }),
20491
- !success && !isBackupStatusLoading && !isDisconnecting && !hasServerBackup && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20492
- NoBackupFound,
20405
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20406
+ Switch,
20493
20407
  {
20494
- isLoading: isRestoringFromServer || isRestoringFromCloud || isRestoringFromFile || isDisconnecting,
20495
- restoreFromFile
20496
- }
20497
- ),
20498
- !success && !isBackupStatusLoading && !isDisconnecting && hasServerBackup && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
20499
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center justify-between gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
20500
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20501
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.CloudDownload, { className: "w-6 h-6" }),
20502
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "font-bold text-xl leading-6", children: t("passport:restoreMenu.title") })
20503
- ] }),
20504
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20505
- Switch,
20506
- {
20507
- name: "advanced-restore-flow-toggle",
20508
- labels: { checked: t("passport:common.standard"), unchecked: t("passport:common.advanced") },
20509
- checked: currentRestoreMethod !== "server",
20510
- onChange: () => {
20511
- const { setError, setRestorePassword, setRestoreFile, setMethod } = useRestoreStore.getState();
20512
- if (!!error) setError(null);
20513
- if (currentRestoreMethod === "server") {
20514
- setRestorePassword("");
20515
- setMethod(null);
20516
- } else {
20517
- setRestoreFile(null);
20518
- setMethod("server");
20519
- }
20520
- }
20408
+ name: "advanced-restore-flow-toggle",
20409
+ labels: { checked: t("passport:common.standard"), unchecked: t("passport:common.advanced") },
20410
+ checked: currentRestoreMethod !== "server",
20411
+ onChange: () => {
20412
+ const { setError, setRestorePassword, setRestoreFile, setMethod } = useRestoreStore.getState();
20413
+ if (!!error) setError(null);
20414
+ if (currentRestoreMethod === "server") {
20415
+ setRestorePassword("");
20416
+ setMethod(null);
20417
+ } else {
20418
+ setRestoreFile(null);
20419
+ setMethod("server");
20521
20420
  }
20522
- )
20523
- ] }),
20524
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(MethodSelector, { mode: "restore", serverRecoveryStatus }),
20525
- !!currentRestoreMethod && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20526
- RestoreComponent,
20527
- {
20528
- isLoading: isRestoringFromFile || isRestoringFromServer || isRestoringFromCloud || isDisconnecting,
20529
- fileHandler: restoreFromFile,
20530
- serverHandler: restoreFromServer2,
20531
- cloudHandler: restoreFromCloud
20532
20421
  }
20533
- )
20534
- ] }),
20535
- !success && !isBackupStatusLoading && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
20536
- Button,
20537
- {
20538
- size: "large",
20539
- variant: "ghost",
20540
- onClick: () => {
20541
- const {
20542
- setError,
20543
- setShowPassword,
20544
- setUsePasskey,
20545
- setRestoreFile,
20546
- setRestorePassword,
20547
- setSuccess,
20548
- setMethod
20549
- } = useRestoreStore.getState();
20550
- setError(null);
20551
- setShowPassword(false);
20552
- setUsePasskey(false);
20553
- setRestoreFile(null);
20554
- setRestorePassword("");
20555
- setSuccess(null);
20556
- setMethod(null);
20557
- disconnect();
20558
- },
20559
- disabled: isDisconnecting || isRestoringFromFile || isRestoringFromServer,
20560
- className: "w-fit mx-auto",
20561
- children: [
20562
- isDisconnecting ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.UserCircle, { className: "w-4 h-4" }),
20563
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: t("passport:restoreMenu.tryAnotherAccount") })
20564
- ]
20565
20422
  }
20566
- ),
20567
- error && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
20568
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20569
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "w-full flex-1 block", children: error })
20570
- ] }),
20571
- success && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
20572
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Highlight, { type: "success", className: "flex gap-[var(--ui-kit-gap)]", children: [
20573
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
20574
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "w-full flex-1 block", children: success })
20575
- ] }),
20576
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button, { variant: "default", size: "large", className: "w-full", onClick: () => onRestoreSuccess(), children: "Done" })
20577
- ] })
20578
- ] })
20579
- }
20580
- );
20423
+ )
20424
+ ] }),
20425
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(MethodSelector, { mode: "restore", serverRecoveryStatus }),
20426
+ !!currentRestoreMethod && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
20427
+ RestoreComponent,
20428
+ {
20429
+ isLoading: isRestoringFromFile || isRestoringFromServer || isRestoringFromCloud || isDisconnecting,
20430
+ fileHandler: restoreFromFile,
20431
+ serverHandler: restoreFromServer2,
20432
+ cloudHandler: restoreFromCloud
20433
+ }
20434
+ )
20435
+ ] }),
20436
+ !success && !isBackupStatusLoading && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
20437
+ Button,
20438
+ {
20439
+ size: "large",
20440
+ variant: "ghost",
20441
+ onClick: () => {
20442
+ const {
20443
+ setError,
20444
+ setShowPassword,
20445
+ setUsePasskey,
20446
+ setRestoreFile,
20447
+ setRestorePassword,
20448
+ setSuccess,
20449
+ setMethod
20450
+ } = useRestoreStore.getState();
20451
+ setError(null);
20452
+ setShowPassword(false);
20453
+ setUsePasskey(false);
20454
+ setRestoreFile(null);
20455
+ setRestorePassword("");
20456
+ setSuccess(null);
20457
+ setMethod(null);
20458
+ disconnect();
20459
+ },
20460
+ disabled: isDisconnecting || isRestoringFromFile || isRestoringFromServer,
20461
+ className: "w-fit mx-auto",
20462
+ children: [
20463
+ isDisconnecting ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.UserCircle, { className: "w-4 h-4" }),
20464
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: t("passport:restoreMenu.tryAnotherAccount") })
20465
+ ]
20466
+ }
20467
+ ),
20468
+ error && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
20469
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20470
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "w-full flex-1 block", children: error })
20471
+ ] }),
20472
+ success && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
20473
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Highlight, { type: "success", className: "flex gap-[var(--ui-kit-gap)]", children: [
20474
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react44.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
20475
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "w-full flex-1 block", children: success })
20476
+ ] }),
20477
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Button, { variant: "default", size: "large", className: "w-full", onClick: () => onRestoreSuccess(), children: "Done" })
20478
+ ] })
20479
+ ] });
20581
20480
  };
20582
20481
  }
20583
20482
  });
@@ -20588,7 +20487,6 @@ function KeyshareBackupMenu() {
20588
20487
  const hasServerVault = useSession((st) => st.hasServerVault);
20589
20488
  const { t } = useT();
20590
20489
  const setPage = useLayoutDataStore((st) => st.setPage);
20591
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
20592
20490
  const currentBackupMethod = useRestoreStore((st) => st.method);
20593
20491
  const usePasskey = useRestoreStore((st) => st.usePasskey);
20594
20492
  const error = useRestoreStore((st) => st.error);
@@ -20627,118 +20525,110 @@ function KeyshareBackupMenu() {
20627
20525
  createPasskey
20628
20526
  } = useCreateBackup();
20629
20527
  const BackupComponent = !!currentBackupMethod ? COMPONENTS[currentBackupMethod] : null;
20630
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20631
- "div",
20632
- {
20633
- ref: (inst) => onboarder.registerElement("embarkai-keyshare-backup-menu-onboarding" /* backupMenu */, inst),
20634
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
20635
- className: "list-scrollbar-y w-full",
20636
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
20637
- !!isRecoveryLoading && (hasServerVault || !currentBackupMethod) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "w-full flex items-center justify-center p-[var(--ui-kit-pd)]", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.Loader, { className: "w-4 h-4 animate-spin" }) }),
20638
- (!isRecoveryLoading || !hasServerVault) && !hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 py-[var(--ui-kit-pd)]", children: [
20639
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.LockIcon, { className: "w-6 h-6" }),
20640
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "font-bold text-xl leading-6", children: t("passport:backupMenu.title") })
20641
- ] }),
20642
- !isRecoveryLoading && !!hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
20643
- "div",
20644
- {
20645
- ref: (inst) => onboarder.registerElement("embarkai-keyshare-backup-advanced-onboarding" /* backupAdvanced */, inst),
20646
- className: "flex items-center justify-between gap-[var(--ui-kit-gap)]",
20647
- children: [
20648
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20649
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20650
- Button,
20651
- {
20652
- variant: "ghost",
20653
- size: "icon",
20654
- title: "Back",
20655
- onClick: () => {
20656
- const {
20657
- setSuccess,
20658
- setError,
20659
- setRestorePassword,
20660
- setRestoreFile,
20661
- setShowPassword,
20662
- setUsePasskey,
20663
- setMethod,
20664
- setSelectedCloudProvider
20665
- } = useRestoreStore.getState();
20666
- setRestorePassword("");
20667
- setRestoreFile(null);
20668
- setShowPassword(false);
20669
- setSelectedCloudProvider(null);
20670
- setUsePasskey(false);
20671
- setError(null);
20672
- setSuccess(null);
20673
- setMethod(null);
20674
- setPage("settings" /* SETTINGS */);
20675
- },
20676
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.ArrowLeft, { className: "h-4 w-4" })
20677
- }
20678
- ),
20679
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-xl font-semibold leading-8", children: t("passport:backupMenu.title") })
20680
- ] }),
20681
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20682
- Switch,
20683
- {
20684
- name: "advanced-restore-flow-toggle",
20685
- labels: { checked: t("passport:common.standard"), unchecked: t("passport:common.advanced") },
20686
- checked: currentBackupMethod !== "server",
20687
- onChange: () => {
20688
- const { setError, setRestorePassword, setRestoreFile, setMethod } = useRestoreStore.getState();
20689
- if (!!error) setError(null);
20690
- if (currentBackupMethod === "server") {
20691
- setRestorePassword("");
20692
- setMethod(null);
20693
- } else {
20694
- setRestoreFile(null);
20695
- setMethod("server");
20696
- }
20697
- }
20698
- }
20699
- )
20700
- ]
20701
- }
20702
- ),
20703
- !isRecoveryLoading && !!hasRecoveryData2 && !currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MethodSelector, { mode: "backup", serverRecoveryStatus }),
20704
- (!isRecoveryLoading || !hasServerVault) && !!currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20705
- BackupComponent,
20706
- {
20707
- mode: "backup",
20708
- isLoading: isPasswordBackupCreating || isCloudBackupCreating || isLocalBackupCreating || isPasskeyCreating,
20709
- fileHandler: createLocalBackup,
20710
- serverHandler: createPasswordBackup,
20711
- cloudHandler: createCloudBackup,
20712
- createPasskeyHandler: createPasskey
20713
- }
20714
- ) }),
20715
- !isRecoveryLoading && !currentBackupMethod && !hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
20716
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20717
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block flex-1 font-semibold", children: "No Backup Found" })
20718
- ] }),
20719
- error && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
20720
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20721
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block w-full flex-1", children: error })
20722
- ] }),
20723
- success && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "success", className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20724
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "w-full flex gap-[var(--ui-kit-gap)]", children: [
20725
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
20726
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block w-full flex-1", children: success })
20528
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20529
+ !!isRecoveryLoading && (hasServerVault || !currentBackupMethod) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "w-full flex items-center justify-center p-[var(--ui-kit-pd)]", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.Loader, { className: "w-4 h-4 animate-spin" }) }),
20530
+ (!isRecoveryLoading || !hasServerVault) && !hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 py-[var(--ui-kit-pd)]", children: [
20531
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.LockIcon, { className: "w-6 h-6" }),
20532
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "font-bold text-xl leading-6", children: t("passport:backupMenu.title") })
20533
+ ] }),
20534
+ !isRecoveryLoading && !!hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
20535
+ "div",
20536
+ {
20537
+ ref: (inst) => onboarder.registerElement("embarkai-keyshare-backup-advanced-onboarding" /* backupAdvanced */, inst),
20538
+ className: "flex items-center justify-between gap-[var(--ui-kit-gap)]",
20539
+ children: [
20540
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20541
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20542
+ Button,
20543
+ {
20544
+ variant: "ghost",
20545
+ size: "icon",
20546
+ title: "Back",
20547
+ onClick: () => {
20548
+ const {
20549
+ setSuccess,
20550
+ setError,
20551
+ setRestorePassword,
20552
+ setRestoreFile,
20553
+ setShowPassword,
20554
+ setUsePasskey,
20555
+ setMethod,
20556
+ setSelectedCloudProvider
20557
+ } = useRestoreStore.getState();
20558
+ setRestorePassword("");
20559
+ setRestoreFile(null);
20560
+ setShowPassword(false);
20561
+ setSelectedCloudProvider(null);
20562
+ setUsePasskey(false);
20563
+ setError(null);
20564
+ setSuccess(null);
20565
+ setMethod(null);
20566
+ setPage("settings" /* SETTINGS */);
20567
+ },
20568
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.ArrowLeft, { className: "h-4 w-4" })
20569
+ }
20570
+ ),
20571
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-xl font-semibold leading-8", children: t("passport:backupMenu.title") })
20727
20572
  ] }),
20728
20573
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20729
- Button,
20574
+ Switch,
20730
20575
  {
20731
- variant: "default",
20732
- size: "large",
20733
- className: "w-full",
20734
- onClick: () => useRestoreStore.getState().setSuccess(null),
20735
- children: t("passport:common.continue")
20576
+ name: "advanced-restore-flow-toggle",
20577
+ labels: { checked: t("passport:common.standard"), unchecked: t("passport:common.advanced") },
20578
+ checked: currentBackupMethod !== "server",
20579
+ onChange: () => {
20580
+ const { setError, setRestorePassword, setRestoreFile, setMethod } = useRestoreStore.getState();
20581
+ if (!!error) setError(null);
20582
+ if (currentBackupMethod === "server") {
20583
+ setRestorePassword("");
20584
+ setMethod(null);
20585
+ } else {
20586
+ setRestoreFile(null);
20587
+ setMethod("server");
20588
+ }
20589
+ }
20736
20590
  }
20737
20591
  )
20738
- ] })
20739
- ] })
20740
- }
20741
- );
20592
+ ]
20593
+ }
20594
+ ),
20595
+ !isRecoveryLoading && !!hasRecoveryData2 && !currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MethodSelector, { mode: "backup", serverRecoveryStatus }),
20596
+ (!isRecoveryLoading || !hasServerVault) && !!currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_jsx_runtime85.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20597
+ BackupComponent,
20598
+ {
20599
+ mode: "backup",
20600
+ isLoading: isPasswordBackupCreating || isCloudBackupCreating || isLocalBackupCreating || isPasskeyCreating,
20601
+ fileHandler: createLocalBackup,
20602
+ serverHandler: createPasswordBackup,
20603
+ cloudHandler: createCloudBackup,
20604
+ createPasskeyHandler: createPasskey
20605
+ }
20606
+ ) }),
20607
+ !isRecoveryLoading && !currentBackupMethod && !hasRecoveryData2 && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
20608
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20609
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block flex-1 font-semibold", children: "No Backup Found" })
20610
+ ] }),
20611
+ error && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
20612
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
20613
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block w-full flex-1", children: error })
20614
+ ] }),
20615
+ success && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Highlight, { type: "success", className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20616
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "w-full flex gap-[var(--ui-kit-gap)]", children: [
20617
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react45.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
20618
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "block w-full flex-1", children: success })
20619
+ ] }),
20620
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
20621
+ Button,
20622
+ {
20623
+ variant: "default",
20624
+ size: "large",
20625
+ className: "w-full",
20626
+ onClick: () => useRestoreStore.getState().setSuccess(null),
20627
+ children: t("passport:common.continue")
20628
+ }
20629
+ )
20630
+ ] })
20631
+ ] });
20742
20632
  }
20743
20633
  var import_react_query31, import_lucide_react45, import_react59, import_jsx_runtime85, COMPONENTS;
20744
20634
  var init_KeyshareBackupMenu = __esm({
@@ -20749,7 +20639,6 @@ var init_KeyshareBackupMenu = __esm({
20749
20639
  import_lucide_react45 = require("lucide-react");
20750
20640
  import_react59 = require("react");
20751
20641
  init_useLayoutDataStore();
20752
- init_useLayoutStore();
20753
20642
  init_vaultClient();
20754
20643
  init_Expandable2();
20755
20644
  init_Onboarding();
@@ -20972,27 +20861,13 @@ var init_SumsubIframe = __esm({
20972
20861
  // src/internal/components/KYC/KycMenu.tsx
20973
20862
  function KycMenu() {
20974
20863
  const setPage = useLayoutDataStore((st) => st.setPage);
20975
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
20976
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
20977
- "div",
20978
- {
20979
- style: {
20980
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
20981
- "--ui-kit-list-scrollbar-pd-r": "4px",
20982
- "paddingTop": "var(--ui-kit-pd)",
20983
- "paddingBottom": "var(--ui-kit-pd)",
20984
- "paddingLeft": "4px"
20985
- },
20986
- className: "list-scrollbar-y w-full flex flex-col gap-[var(--ui-kit-gap)]",
20987
- children: [
20988
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20989
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react47.ArrowLeft, { className: "h-4 w-4" }) }),
20990
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-xl font-semibold", children: "KYC" })
20991
- ] }),
20992
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(KycContent, {})
20993
- ]
20994
- }
20995
- );
20864
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20865
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20866
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react47.ArrowLeft, { className: "h-4 w-4" }) }),
20867
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-xl font-semibold", children: "KYC" })
20868
+ ] }),
20869
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(KycContent, {})
20870
+ ] });
20996
20871
  }
20997
20872
  var import_lucide_react47, import_jsx_runtime87, KycContent;
20998
20873
  var init_KycMenu = __esm({
@@ -21000,7 +20875,7 @@ var init_KycMenu = __esm({
21000
20875
  init_ProviderContext();
21001
20876
  import_lucide_react47 = require("lucide-react");
21002
20877
  init_useLayoutDataStore();
21003
- init_useLayoutStore();
20878
+ init_Expandable2();
21004
20879
  init_button();
21005
20880
  init_SumsubIframe();
21006
20881
  import_jsx_runtime87 = require("react/jsx-runtime");
@@ -21080,44 +20955,41 @@ var init_KYC = __esm({
21080
20955
  function LanguagesMenu() {
21081
20956
  const config = useProviderConfig().config;
21082
20957
  const { t, i18n } = useT();
21083
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
21084
20958
  const langOpenedFromMenu = useLayoutDataStore((st) => st.langOpenedFromMenu);
21085
- const setPage = useLayoutDataStore((st) => st.setPage);
21086
20959
  const languageList = getAvailableLanguages(config.current.translations);
21087
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
21088
- "div",
21089
- {
21090
- style: {
21091
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
21092
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
20960
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
20961
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
20962
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
20963
+ Button,
20964
+ {
20965
+ variant: "ghost",
20966
+ size: "icon",
20967
+ title: "Back",
20968
+ onClick: () => useLayoutDataStore.getState().setPage(langOpenedFromMenu),
20969
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react48.ArrowLeft, { className: "h-4 w-4" })
20970
+ }
20971
+ ),
20972
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-xl font-semibold", children: t("passport:common.language") })
20973
+ ] }),
20974
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)] py-[var(--ui-kit-pd)]", children: languageList.map((langKey) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
20975
+ Button,
20976
+ {
20977
+ size: "large",
20978
+ variant: i18n.resolvedLanguage === langKey ? "default" : "ghost",
20979
+ className: "justify-between",
20980
+ onClick: () => {
20981
+ i18n.changeLanguage(langKey);
20982
+ localStorage.setItem(LOCAL_STORAGE_I18N_KEY, langKey);
20983
+ useLayoutDataStore.getState().setPage(langOpenedFromMenu);
20984
+ },
20985
+ children: [
20986
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: LANGUAGES[langKey]?.name }),
20987
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-2xl leading-6", children: LANGUAGES[langKey]?.flags })
20988
+ ]
21093
20989
  },
21094
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
21095
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
21096
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
21097
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage(langOpenedFromMenu), children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react48.ArrowLeft, { className: "h-4 w-4" }) }),
21098
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-xl font-semibold", children: t("passport:common.language") })
21099
- ] }),
21100
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)] py-[var(--ui-kit-pd)]", children: languageList.map((langKey) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
21101
- Button,
21102
- {
21103
- size: "large",
21104
- variant: i18n.resolvedLanguage === langKey ? "default" : "ghost",
21105
- className: "justify-between",
21106
- onClick: () => {
21107
- i18n.changeLanguage(langKey);
21108
- localStorage.setItem(LOCAL_STORAGE_I18N_KEY, langKey);
21109
- setPage(langOpenedFromMenu);
21110
- },
21111
- children: [
21112
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: LANGUAGES[langKey]?.name }),
21113
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-2xl leading-6", children: LANGUAGES[langKey]?.flags })
21114
- ]
21115
- },
21116
- langKey
21117
- )) })
21118
- ] })
21119
- }
21120
- );
20990
+ langKey
20991
+ )) })
20992
+ ] });
21121
20993
  }
21122
20994
  var import_lucide_react48, import_jsx_runtime89;
21123
20995
  var init_LanguagesMenu = __esm({
@@ -21126,7 +20998,6 @@ var init_LanguagesMenu = __esm({
21126
20998
  init_i18n();
21127
20999
  import_lucide_react48 = require("lucide-react");
21128
21000
  init_useLayoutDataStore();
21129
- init_useLayoutStore();
21130
21001
  init_Expandable2();
21131
21002
  init_button();
21132
21003
  import_jsx_runtime89 = require("react/jsx-runtime");
@@ -21173,12 +21044,16 @@ var init_onboarding_setup5 = __esm({
21173
21044
  function MainMenu() {
21174
21045
  const address = useSession((st) => st.address);
21175
21046
  const { t } = useT();
21176
- const setPage = useLayoutDataStore((st) => st.setPage);
21177
- const setTransitionPageHeight = useLayoutDataStore((st) => st.setTransitionPageHeight);
21178
- (0, import_react61.useEffect)(() => setTransitionPageHeight(DEFAULT_MAIN_MENU_HEIGHT), []);
21047
+ (0, import_react61.useEffect)(
21048
+ () => (
21049
+ // actual height measurement of the main menu on mount. prevents layout animations jumps
21050
+ useLayoutDataStore.getState().setTransitionPageHeight(DEFAULT_MAIN_MENU_HEIGHT)
21051
+ ),
21052
+ []
21053
+ );
21179
21054
  useOnboardingTourAvailable(true);
21180
21055
  useProvidersList();
21181
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "w-full p-[var(--ui-kit-pd)] flex flex-col gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "w-full grid grid-cols-4 gap-0 md:gap-[var(--ui-kit-gap)] py-[10px] md:py-1", children: MAIN_MENU_BUTTONS.map(({ id, onboardingId, label, icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
21056
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "w-full grid grid-cols-4 gap-0 md:gap-[var(--ui-kit-gap)] py-[10px] md:py-1", children: MAIN_MENU_BUTTONS.map(({ id, onboardingId, label, icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
21182
21057
  Button,
21183
21058
  {
21184
21059
  ref: (inst) => onboarder.registerElement(onboardingId, inst),
@@ -21186,7 +21061,7 @@ function MainMenu() {
21186
21061
  variant: "ghost",
21187
21062
  disabled: !address,
21188
21063
  className: "flex-col w-full h-fit p-0",
21189
- onClick: () => setPage(id),
21064
+ onClick: () => useLayoutDataStore.getState().setPage(id),
21190
21065
  children: [
21191
21066
  /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Icon2, { className: "w-5 h-5 md:w-8 md:h-8" }),
21192
21067
  /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xs font-semibold", children: t(label) })
@@ -21204,6 +21079,7 @@ var init_MainMenu = __esm({
21204
21079
  import_react61 = require("react");
21205
21080
  init_constants();
21206
21081
  init_useLayoutDataStore();
21082
+ init_Expandable2();
21207
21083
  init_useProvidersList();
21208
21084
  init_Onboarding();
21209
21085
  init_button();
@@ -21575,20 +21451,6 @@ var init_NicknameEditForm = __esm({
21575
21451
  }
21576
21452
  });
21577
21453
 
21578
- // src/internal/components/NicknameMenu/onboarding.setup.ts
21579
- var NICKNAME_MENU_TOUR;
21580
- var init_onboarding_setup6 = __esm({
21581
- "src/internal/components/NicknameMenu/onboarding.setup.ts"() {
21582
- NICKNAME_MENU_TOUR = [
21583
- {
21584
- elId: "embarkai-nickname-menu-onboarding" /* nicknameMenu */,
21585
- title: "passport:nicknameMenu.onboarding.nicknameMenu.title",
21586
- description: "passport:nicknameMenu.onboarding.nicknameMenu.description"
21587
- }
21588
- ];
21589
- }
21590
- });
21591
-
21592
21454
  // src/internal/components/NicknameMenu/NicknameMenu.tsx
21593
21455
  function NicknameMenu() {
21594
21456
  const { isInitialUser } = usePageParams().current;
@@ -21610,79 +21472,71 @@ function NicknameMenu() {
21610
21472
  });
21611
21473
  const resolvedError = nicknameError || nicknameInfoError?.message || null;
21612
21474
  (0, import_react64.useEffect)(() => () => useNicknameStore.getState().reset(), []);
21613
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
21614
- "div",
21615
- {
21616
- ref: (inst) => onboarder.registerElement("embarkai-nickname-menu-onboarding" /* nicknameMenu */, inst),
21617
- style: { "--ui-kit-scrollbar-mah": `${maxScrollHeight}px` },
21618
- className: "list-scrollbar-y w-full",
21619
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: [
21620
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] ", children: [
21621
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
21622
- Button,
21623
- {
21624
- variant: "ghost",
21625
- size: "icon",
21626
- title: t("passport:common.back"),
21627
- onClick: () => useLayoutDataStore.getState().setPage("settings" /* SETTINGS */),
21628
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react51.ArrowLeft, { className: "h-4 w-4 flex-none" })
21629
- }
21630
- ),
21631
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex gap-[var(--ui-kit-gap)] items-center w-fit", children: [
21632
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-xl font-semibold", children: t("passport:nicknameMenu.title") }),
21633
- isNicknameInfoLoading && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react51.Loader, { className: "w-4 h-4 animate-spin" })
21634
- ] })
21635
- ] }),
21636
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NicknameEditForm, { nicknameInfo, isInitialUser }),
21637
- !nicknameInfo?.canChange && nicknameInfo?.cooldownEndsAt && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "info", children: t("passport:nicknameMenu.cooldownMessage", {
21638
- canChangeAt: (0, import_dayjs4.default)(nicknameInfo.cooldownEndsAt).format("MMM D, YYYY"),
21639
- days: String(getDaysRemaining(nicknameInfo.cooldownEndsAt))
21640
- }) }),
21641
- !nicknameSuccess && !!nicknameInfo && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] justify-between text-[10px]", children: [
21642
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { children: [
21643
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: nicknameInfo.changedAt ? t("passport:nicknameMenu.lastChanged") : t("passport:common.created") }),
21644
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: ": " }),
21645
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("strong", { className: "text-[var(--ui-kit-fg)]", children: (0, import_dayjs4.default)(nicknameInfo.changedAt || nicknameInfo.createdAt).format("MMM D, YYYY") })
21646
- ] }),
21647
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { children: [
21648
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:nicknameMenu.timesChanged") }),
21649
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: ": " }),
21650
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("strong", { className: "text-[var(--ui-kit-fg)]", children: nicknameInfo.changeCount })
21651
- ] })
21652
- ] }),
21653
- !!nicknameSuccess && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "success", children: nicknameSuccess }),
21654
- isInitialUser && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Highlight, { type: "success", children: [
21655
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", {
21656
- //@ts-expect-error i18n typings
21657
- children: t("passport:nicknameMenu.initialUser.welcome", {
21658
- nickname: nicknameInfo?.handle || "N/A"
21659
- })
21660
- }),
21661
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { children: t("passport:nicknameMenu.initialUser.message") }),
21662
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
21663
- Button,
21664
- {
21665
- variant: "default",
21666
- size: "large",
21667
- title: t("passport:common.continue"),
21668
- onClick: () => {
21669
- const { openPostAuthNavigation, setPage } = useLayoutDataStore.getState();
21670
- if (!openPostAuthNavigation()) setPage(null);
21671
- },
21672
- className: "w-full",
21673
- children: [
21674
- t("passport:common.continue"),
21675
- " (",
21676
- nicknameInfo?.handle,
21677
- ")"
21678
- ]
21679
- }
21680
- )
21681
- ] }),
21682
- !!resolvedError?.length && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "error", children: resolvedError })
21475
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
21476
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] ", children: [
21477
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
21478
+ Button,
21479
+ {
21480
+ variant: "ghost",
21481
+ size: "icon",
21482
+ title: t("passport:common.back"),
21483
+ onClick: () => useLayoutDataStore.getState().setPage("settings" /* SETTINGS */),
21484
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react51.ArrowLeft, { className: "h-4 w-4 flex-none" })
21485
+ }
21486
+ ),
21487
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex gap-[var(--ui-kit-gap)] items-center w-fit", children: [
21488
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-xl font-semibold", children: t("passport:nicknameMenu.title") }),
21489
+ isNicknameInfoLoading && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react51.Loader, { className: "w-4 h-4 animate-spin" })
21683
21490
  ] })
21684
- }
21685
- );
21491
+ ] }),
21492
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NicknameEditForm, { nicknameInfo, isInitialUser }),
21493
+ !nicknameInfo?.canChange && nicknameInfo?.cooldownEndsAt && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "info", children: t("passport:nicknameMenu.cooldownMessage", {
21494
+ canChangeAt: (0, import_dayjs4.default)(nicknameInfo.cooldownEndsAt).format("MMM D, YYYY"),
21495
+ days: String(getDaysRemaining(nicknameInfo.cooldownEndsAt))
21496
+ }) }),
21497
+ !nicknameSuccess && !!nicknameInfo && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)] justify-between text-[10px]", children: [
21498
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { children: [
21499
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: nicknameInfo.changedAt ? t("passport:nicknameMenu.lastChanged") : t("passport:common.created") }),
21500
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: ": " }),
21501
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("strong", { className: "text-[var(--ui-kit-fg)]", children: (0, import_dayjs4.default)(nicknameInfo.changedAt || nicknameInfo.createdAt).format("MMM D, YYYY") })
21502
+ ] }),
21503
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("span", { children: [
21504
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:nicknameMenu.timesChanged") }),
21505
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: ": " }),
21506
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("strong", { className: "text-[var(--ui-kit-fg)]", children: nicknameInfo.changeCount })
21507
+ ] })
21508
+ ] }),
21509
+ !!nicknameSuccess && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "success", children: nicknameSuccess }),
21510
+ isInitialUser && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Highlight, { type: "success", children: [
21511
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", {
21512
+ //@ts-expect-error i18n typings
21513
+ children: t("passport:nicknameMenu.initialUser.welcome", {
21514
+ nickname: nicknameInfo?.handle || "N/A"
21515
+ })
21516
+ }),
21517
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { children: t("passport:nicknameMenu.initialUser.message") }),
21518
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
21519
+ Button,
21520
+ {
21521
+ variant: "default",
21522
+ size: "large",
21523
+ title: t("passport:common.continue"),
21524
+ onClick: () => {
21525
+ const { openPostAuthNavigation, setPage } = useLayoutDataStore.getState();
21526
+ if (!openPostAuthNavigation()) setPage(null);
21527
+ },
21528
+ className: "w-full",
21529
+ children: [
21530
+ t("passport:common.continue"),
21531
+ " (",
21532
+ nicknameInfo?.handle,
21533
+ ")"
21534
+ ]
21535
+ }
21536
+ )
21537
+ ] }),
21538
+ !!resolvedError?.length && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Highlight, { type: "error", children: resolvedError })
21539
+ ] });
21686
21540
  }
21687
21541
  var import_react_query35, import_dayjs4, import_lucide_react51, import_react64, import_jsx_runtime92;
21688
21542
  var init_NicknameMenu = __esm({
@@ -21709,6 +21563,21 @@ var init_NicknameMenu = __esm({
21709
21563
  }
21710
21564
  });
21711
21565
 
21566
+ // src/internal/components/NicknameMenu/onboarding.setup.ts
21567
+ var NICKNAME_MENU_TOUR;
21568
+ var init_onboarding_setup6 = __esm({
21569
+ "src/internal/components/NicknameMenu/onboarding.setup.ts"() {
21570
+ init_constants();
21571
+ NICKNAME_MENU_TOUR = [
21572
+ {
21573
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"nickname-settings" /* NICKNAME_SETTINGS */}`,
21574
+ title: "passport:nicknameMenu.onboarding.nicknameMenu.title",
21575
+ description: "passport:nicknameMenu.onboarding.nicknameMenu.description"
21576
+ }
21577
+ ];
21578
+ }
21579
+ });
21580
+
21712
21581
  // src/internal/components/NicknameMenu/index.ts
21713
21582
  var init_NicknameMenu2 = __esm({
21714
21583
  "src/internal/components/NicknameMenu/index.ts"() {
@@ -22614,7 +22483,6 @@ function PortfolioMenu() {
22614
22483
  const { t } = useT();
22615
22484
  const qc = (0, import_react_query40.useQueryClient)();
22616
22485
  const address = useSession((st) => st.address);
22617
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
22618
22486
  const {
22619
22487
  assets: blockscoutAssets,
22620
22488
  refreshBalances: refreshBlockscoutBalances,
@@ -22631,57 +22499,47 @@ function PortfolioMenu() {
22631
22499
  Promise.all(shownProjectAssets.map((asset) => qc.invalidateQueries({ queryKey: asset.balanceQueryKey })));
22632
22500
  refreshBlockscoutBalances();
22633
22501
  }, [qc, shownProjectAssets, refreshBlockscoutBalances]);
22634
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22635
- "div",
22636
- {
22637
- style: {
22638
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
22639
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
22502
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
22503
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
22504
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22505
+ Button,
22506
+ {
22507
+ variant: "ghost",
22508
+ size: "icon",
22509
+ title: "Back",
22510
+ onClick: () => useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */),
22511
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.ArrowLeft, { className: "h-4 w-4" })
22512
+ }
22513
+ ),
22514
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "text-xl font-semibold", children: t("passport:portfolioMenu.title") }),
22515
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22516
+ Button,
22517
+ {
22518
+ title: "Refresh balances",
22519
+ variant: "ghost",
22520
+ size: "icon",
22521
+ onClick: refreshAllAssetsBalances,
22522
+ disabled: isBlockscoutLoading || isBlockscoutFetching,
22523
+ children: isBlockscoutLoading || isBlockscoutFetching ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.RefreshCw, { className: "h-4 w-4" })
22524
+ }
22525
+ )
22526
+ ] }),
22527
+ isBlockscoutLoading && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "w-full flex items-center justify-center gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Loader, { className: "w-4 h-4 animate-spin" }) }),
22528
+ !isBlockscoutLoading && blockscoutAssets?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Highlight, { type: "info", className: "flex flex-col items-center justify-center gap-[var(--ui-kit-gap)]", children: [
22529
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Gem, { className: "w-8 h-8" }),
22530
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "block", children: t("passport:portfolioMenu.noAssets") })
22531
+ ] }),
22532
+ !isBlockscoutLoading && shownProjectAssets?.map((asset, index) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PortfolioItem, { isProjectAsset: true, address, asset }, `project-${asset.symbol}-${index}`)),
22533
+ !isBlockscoutLoading && blockscoutAssets?.length > 0 && blockscoutAssets.map((asset, index) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22534
+ PortfolioItem,
22535
+ {
22536
+ address,
22537
+ asset
22640
22538
  },
22641
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
22642
- children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
22643
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
22644
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22645
- Button,
22646
- {
22647
- variant: "ghost",
22648
- size: "icon",
22649
- title: "Back",
22650
- onClick: () => useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */),
22651
- children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.ArrowLeft, { className: "h-4 w-4" })
22652
- }
22653
- ),
22654
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "text-xl font-semibold", children: t("passport:portfolioMenu.title") }),
22655
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22656
- Button,
22657
- {
22658
- title: "Refresh balances",
22659
- variant: "ghost",
22660
- size: "icon",
22661
- onClick: refreshAllAssetsBalances,
22662
- disabled: isBlockscoutLoading || isBlockscoutFetching,
22663
- children: isBlockscoutLoading || isBlockscoutFetching ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.RefreshCw, { className: "h-4 w-4" })
22664
- }
22665
- )
22666
- ] }),
22667
- isBlockscoutLoading && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "w-full flex items-center justify-center gap-[var(--ui-kit-gap)] p-[var(--ui-kit-pd)]", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Loader, { className: "w-4 h-4 animate-spin" }) }),
22668
- !isBlockscoutLoading && blockscoutAssets?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Highlight, { type: "info", className: "flex flex-col items-center justify-center gap-[var(--ui-kit-gap)]", children: [
22669
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_lucide_react53.Gem, { className: "w-8 h-8" }),
22670
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "block", children: t("passport:portfolioMenu.noAssets") })
22671
- ] }),
22672
- !isBlockscoutLoading && shownProjectAssets?.map((asset, index) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PortfolioItem, { isProjectAsset: true, address, asset }, `project-${asset.symbol}-${index}`)),
22673
- !isBlockscoutLoading && blockscoutAssets?.length > 0 && blockscoutAssets.map((asset, index) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
22674
- PortfolioItem,
22675
- {
22676
- address,
22677
- asset
22678
- },
22679
- `${asset.type}-${asset.address || "native"}-${asset.tokenId || index}`
22680
- )),
22681
- blockscoutError && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Highlight, { type: "error", children: blockscoutError?.message })
22682
- ] })
22683
- }
22684
- );
22539
+ `${asset.type}-${asset.address || "native"}-${asset.tokenId || index}`
22540
+ )),
22541
+ blockscoutError && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Highlight, { type: "error", children: blockscoutError?.message })
22542
+ ] });
22685
22543
  }
22686
22544
  var import_react_query40, import_lucide_react53, import_react69, import_jsx_runtime95;
22687
22545
  var init_PortfolioMenu = __esm({
@@ -22694,7 +22552,6 @@ var init_PortfolioMenu = __esm({
22694
22552
  import_react69 = require("react");
22695
22553
  init_useBlockscoutAssets2();
22696
22554
  init_useLayoutDataStore();
22697
- init_useLayoutStore();
22698
22555
  init_Expandable2();
22699
22556
  init_button();
22700
22557
  init_highlight();
@@ -22790,21 +22647,6 @@ var init_nickname_fingerprint = __esm({
22790
22647
  }
22791
22648
  });
22792
22649
 
22793
- // src/internal/components/ReceiveMenu/onboarding.setup.ts
22794
- var RECEIVE_MENU_ONBOARDING_ID, RECEIVE_MENU_TOUR;
22795
- var init_onboarding_setup7 = __esm({
22796
- "src/internal/components/ReceiveMenu/onboarding.setup.ts"() {
22797
- RECEIVE_MENU_ONBOARDING_ID = "embarkai-receive-menu-onboarding";
22798
- RECEIVE_MENU_TOUR = [
22799
- {
22800
- elId: RECEIVE_MENU_ONBOARDING_ID,
22801
- title: "passport:receiveMenu.onboarding.receiveMenu.title",
22802
- description: "passport:receiveMenu.onboarding.receiveMenu.description"
22803
- }
22804
- ];
22805
- }
22806
- });
22807
-
22808
22650
  // src/internal/components/ReceiveMenu/ReceiveMenu.tsx
22809
22651
  function ReceiveMenu() {
22810
22652
  const { t } = useT();
@@ -22817,7 +22659,6 @@ function ReceiveMenu() {
22817
22659
  queryKey: [QUERY_KEYS.nicknameInfo, address],
22818
22660
  queryFn: async () => await getNicknameInfo()
22819
22661
  });
22820
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
22821
22662
  const [qrCodeUrl, setQrCodeUrl] = (0, import_react70.useState)("");
22822
22663
  const [isAddressCopied, setAddressCopied] = (0, import_react70.useState)(false);
22823
22664
  const [isNicknameCopied, setNicknameCopied] = (0, import_react70.useState)(false);
@@ -22839,107 +22680,96 @@ function ReceiveMenu() {
22839
22680
  color: { dark: "#000000", light: "#ffffff" }
22840
22681
  }).then((url) => setQrCodeUrl(url)).catch((err) => console.error("Failed to generate QR code:", err));
22841
22682
  }, [address]);
22842
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
22843
- "div",
22844
- {
22845
- ref: (inst) => onboarder.registerElement(RECEIVE_MENU_ONBOARDING_ID, inst),
22846
- style: {
22847
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
22848
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
22849
- },
22850
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)] flex flex-col gap-[var(--ui-kit-gap)]",
22851
- children: [
22852
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "w-full flex items-center gap-[var(--ui-kit-gap)]", children: [
22853
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
22854
- Button,
22855
- {
22856
- variant: "ghost",
22857
- size: "icon",
22858
- title: "Back",
22859
- onClick: () => useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */),
22860
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.ArrowLeft, { className: "h-4 w-4" })
22861
- }
22862
- ),
22863
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-xl font-semibold", children: t("passport:receiveMenu.title") })
22864
- ] }),
22865
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.scanQR") }),
22866
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Highlight, { className: "text-center", type: "warning", children: [
22867
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("strong", { className: "block w-full", children: `${t("passport:common.network")}: ${chainConfig.name}` }),
22868
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block w-full", children: t("passport:receiveMenu.warning") })
22869
- ] }),
22870
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "flex items-center justify-center p-[var(--ui-kit-pd)]", style: { minHeight: "216px" }, children: qrCodeUrl && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: qrCodeUrl, alt: "Wallet QR Code", className: "w-48 h-48" }) }),
22871
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.address") }),
22872
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
22873
- Button,
22874
- {
22875
- title: "Copy address",
22876
- variant: "secondary",
22877
- size: "medium",
22878
- className: "w-full",
22879
- onClick: () => {
22880
- if (!address) return;
22881
- navigator.clipboard.writeText(address);
22882
- setAddressCopied(true);
22883
- setTimeout(() => setAddressCopied(false), 2e3);
22884
- },
22885
- children: [
22886
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Wallet2Icon, { className: "h-4 w-4 flex-none" }),
22887
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: cn2("text-[10px] flex-1 block", { "text-[var(--ui-kit-bg-success)]": isAddressCopied }), children: [
22888
- address.slice(0, 10),
22889
- "...",
22890
- address.slice(-6)
22891
- ] }),
22892
- isAddressCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "h-4 w-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "h-4 w-4 flex-none" })
22893
- ]
22894
- }
22895
- ),
22896
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.nickname") }),
22897
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
22898
- Button,
22899
- {
22900
- title: "Copy nickname",
22901
- variant: "secondary",
22902
- size: "medium",
22903
- className: "w-full",
22904
- onClick: () => {
22905
- const nickname = nicknameInfo.handle;
22906
- navigator.clipboard.writeText(nickname);
22907
- setNicknameCopied(true);
22908
- setTimeout(() => setNicknameCopied(false), 2e3);
22909
- },
22910
- children: isNicknameInfoLoading ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.LoaderIcon, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
22911
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.AtSignIcon, { className: "h-4 w-4 flex-none" }),
22912
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: cn2("text-xs flex-1", { "text-[var(--ui-kit-bg-success)]": isNicknameCopied }), children: nicknameInfo.handle }),
22913
- isNicknameCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "h-4 w-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "h-4 w-4 flex-none" })
22914
- ] })
22915
- }
22916
- ),
22917
- fingerprint && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
22918
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.identity") }),
22919
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
22920
- Button,
22921
- {
22922
- title: "Copy fingerprint",
22923
- variant: "secondary",
22924
- size: "medium",
22925
- className: "w-full justify-between",
22926
- onClick: () => {
22927
- if (!fingerprint) return;
22928
- navigator.clipboard.writeText(fingerprint);
22929
- setFingerprintCopied(true);
22930
- setTimeout(() => setFingerprintCopied(false), 2e3);
22931
- },
22932
- children: [
22933
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.FingerprintIcon, { className: "w-4 h-4 flex-none" }),
22934
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: cn2("text-xs font-bold flex-1", { "text-[var(--ui-kit-bg-success)]": fingerprintCopied }), children: fingerprint }),
22935
- fingerprintCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "w-4 h-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "w-4 h-4 flex-none" })
22936
- ]
22937
- }
22938
- )
22683
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
22684
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "w-full flex items-center gap-[var(--ui-kit-gap)]", children: [
22685
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
22686
+ Button,
22687
+ {
22688
+ variant: "ghost",
22689
+ size: "icon",
22690
+ title: "Back",
22691
+ onClick: () => useLayoutDataStore.getState().setPage("main-menu" /* MAIN_MENU */),
22692
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.ArrowLeft, { className: "h-4 w-4" })
22693
+ }
22694
+ ),
22695
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-xl font-semibold", children: t("passport:receiveMenu.title") })
22696
+ ] }),
22697
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "text-xs text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.scanQR") }),
22698
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Highlight, { className: "text-center", type: "warning", children: [
22699
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("strong", { className: "block w-full", children: `${t("passport:common.network")}: ${chainConfig.name}` }),
22700
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block w-full", children: t("passport:receiveMenu.warning") })
22701
+ ] }),
22702
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "flex items-center justify-center p-[var(--ui-kit-pd)]", style: { minHeight: "216px" }, children: qrCodeUrl && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("img", { src: qrCodeUrl, alt: "Wallet QR Code", className: "w-48 h-48" }) }),
22703
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.address") }),
22704
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
22705
+ Button,
22706
+ {
22707
+ title: "Copy address",
22708
+ variant: "secondary",
22709
+ size: "medium",
22710
+ className: "w-full",
22711
+ onClick: () => {
22712
+ if (!address) return;
22713
+ navigator.clipboard.writeText(address);
22714
+ setAddressCopied(true);
22715
+ setTimeout(() => setAddressCopied(false), 2e3);
22716
+ },
22717
+ children: [
22718
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Wallet2Icon, { className: "h-4 w-4 flex-none" }),
22719
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: cn2("text-[10px] flex-1 block", { "text-[var(--ui-kit-bg-success)]": isAddressCopied }), children: [
22720
+ address.slice(0, 10),
22721
+ "...",
22722
+ address.slice(-6)
22723
+ ] }),
22724
+ isAddressCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "h-4 w-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "h-4 w-4 flex-none" })
22725
+ ]
22726
+ }
22727
+ ),
22728
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.nickname") }),
22729
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
22730
+ Button,
22731
+ {
22732
+ title: "Copy nickname",
22733
+ variant: "secondary",
22734
+ size: "medium",
22735
+ className: "w-full",
22736
+ onClick: () => {
22737
+ const nickname = nicknameInfo.handle;
22738
+ navigator.clipboard.writeText(nickname);
22739
+ setNicknameCopied(true);
22740
+ setTimeout(() => setNicknameCopied(false), 2e3);
22741
+ },
22742
+ children: isNicknameInfoLoading ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.LoaderIcon, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
22743
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.AtSignIcon, { className: "h-4 w-4 flex-none" }),
22744
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: cn2("text-xs flex-1", { "text-[var(--ui-kit-bg-success)]": isNicknameCopied }), children: nicknameInfo.handle }),
22745
+ isNicknameCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "h-4 w-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "h-4 w-4 flex-none" })
22939
22746
  ] })
22940
- ]
22941
- }
22942
- );
22747
+ }
22748
+ ),
22749
+ fingerprint && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
22750
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "block text-xs leading-4 text-[var(--ui-kit-fg-muted)]", children: t("passport:receiveMenu.share.identity") }),
22751
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
22752
+ Button,
22753
+ {
22754
+ title: "Copy fingerprint",
22755
+ variant: "secondary",
22756
+ size: "medium",
22757
+ className: "w-full justify-between",
22758
+ onClick: () => {
22759
+ if (!fingerprint) return;
22760
+ navigator.clipboard.writeText(fingerprint);
22761
+ setFingerprintCopied(true);
22762
+ setTimeout(() => setFingerprintCopied(false), 2e3);
22763
+ },
22764
+ children: [
22765
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.FingerprintIcon, { className: "w-4 h-4 flex-none" }),
22766
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: cn2("text-xs font-bold flex-1", { "text-[var(--ui-kit-bg-success)]": fingerprintCopied }), children: fingerprint }),
22767
+ fingerprintCopied ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckCircle2, { className: "w-4 h-4 text-[var(--ui-kit-bg-success)] flex-none" }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Copy, { className: "w-4 h-4 flex-none" })
22768
+ ]
22769
+ }
22770
+ )
22771
+ ] })
22772
+ ] });
22943
22773
  }
22944
22774
  var import_react_query41, import_lucide_react54, import_qrcode, import_react70, import_jsx_runtime96;
22945
22775
  var init_ReceiveMenu = __esm({
@@ -22953,17 +22783,31 @@ var init_ReceiveMenu = __esm({
22953
22783
  init_nickname();
22954
22784
  init_profile();
22955
22785
  init_useLayoutDataStore();
22956
- init_useLayoutStore();
22957
22786
  init_nickname_fingerprint();
22958
22787
  init_utils();
22788
+ init_Expandable2();
22959
22789
  init_Onboarding();
22960
22790
  init_button();
22961
22791
  init_highlight();
22962
- init_onboarding_setup7();
22963
22792
  import_jsx_runtime96 = require("react/jsx-runtime");
22964
22793
  }
22965
22794
  });
22966
22795
 
22796
+ // src/internal/components/ReceiveMenu/onboarding.setup.ts
22797
+ var RECEIVE_MENU_TOUR;
22798
+ var init_onboarding_setup7 = __esm({
22799
+ "src/internal/components/ReceiveMenu/onboarding.setup.ts"() {
22800
+ init_constants();
22801
+ RECEIVE_MENU_TOUR = [
22802
+ {
22803
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"receive" /* RECEIVE */}`,
22804
+ title: "passport:receiveMenu.onboarding.receiveMenu.title",
22805
+ description: "passport:receiveMenu.onboarding.receiveMenu.description"
22806
+ }
22807
+ ];
22808
+ }
22809
+ });
22810
+
22967
22811
  // src/internal/components/ReceiveMenu/index.ts
22968
22812
  var init_ReceiveMenu2 = __esm({
22969
22813
  "src/internal/components/ReceiveMenu/index.ts"() {
@@ -22976,9 +22820,10 @@ var init_ReceiveMenu2 = __esm({
22976
22820
  var SECURITY_MENU_TOUR;
22977
22821
  var init_onboarding_setup8 = __esm({
22978
22822
  "src/internal/components/SecurityMenu/onboarding.setup.ts"() {
22823
+ init_constants();
22979
22824
  SECURITY_MENU_TOUR = [
22980
22825
  {
22981
- elId: "embarkai-security-menu-onboarding" /* securityMenu */,
22826
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"security" /* SECURITY */}`,
22982
22827
  title: "passport:securityMenu.onboarding.securityMenu.title",
22983
22828
  description: "passport:securityMenu.onboarding.securityMenu.description"
22984
22829
  },
@@ -23595,47 +23440,35 @@ var init_Keyshare2 = __esm({
23595
23440
  // src/internal/components/SecurityMenu/SecurityMenu.tsx
23596
23441
  function SecurityMenu() {
23597
23442
  const { t } = useT();
23598
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
23599
23443
  const appToUntrust = useSecurityStore((st) => st.appToUntrust);
23600
23444
  useOnboardingTourAvailable(!appToUntrust);
23601
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
23602
- "div",
23603
- {
23604
- ref: (inst) => onboarder.registerElement("embarkai-security-menu-onboarding" /* securityMenu */, inst),
23605
- style: {
23606
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
23607
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
23608
- },
23609
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
23610
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
23611
- /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
23612
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
23613
- Button,
23614
- {
23615
- variant: "ghost",
23616
- size: "icon",
23617
- title: t("passport:common.back"),
23618
- onClick: () => {
23619
- const { appToUntrust: appToUntrust2, untrustApp } = useSecurityStore.getState();
23620
- if (!!appToUntrust2) {
23621
- untrustApp(null);
23622
- } else {
23623
- useLayoutDataStore.getState().setPage("settings" /* SETTINGS */);
23624
- }
23625
- },
23626
- children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_lucide_react60.ArrowLeft, { className: "h-4 w-4" })
23445
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
23446
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
23447
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
23448
+ Button,
23449
+ {
23450
+ variant: "ghost",
23451
+ size: "icon",
23452
+ title: t("passport:common.back"),
23453
+ onClick: () => {
23454
+ const { appToUntrust: appToUntrust2, untrustApp } = useSecurityStore.getState();
23455
+ if (!!appToUntrust2) {
23456
+ untrustApp(null);
23457
+ } else {
23458
+ useLayoutDataStore.getState().setPage("settings" /* SETTINGS */);
23627
23459
  }
23628
- ),
23629
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-xl font-semibold", children: t("passport:securityMenu.title") })
23630
- ] }),
23631
- appToUntrust && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(UntrustApplication, {}),
23632
- !appToUntrust && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
23633
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Keyshare, {}),
23634
- /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ConnectedApps, {})
23635
- ] })
23636
- ] })
23637
- }
23638
- );
23460
+ },
23461
+ children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_lucide_react60.ArrowLeft, { className: "h-4 w-4" })
23462
+ }
23463
+ ),
23464
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: "text-xl font-semibold", children: t("passport:securityMenu.title") })
23465
+ ] }),
23466
+ appToUntrust && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(UntrustApplication, {}),
23467
+ !appToUntrust && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
23468
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Keyshare, {}),
23469
+ /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ConnectedApps, {})
23470
+ ] })
23471
+ ] });
23639
23472
  }
23640
23473
  var import_lucide_react60, import_jsx_runtime102;
23641
23474
  var init_SecurityMenu = __esm({
@@ -23643,7 +23476,6 @@ var init_SecurityMenu = __esm({
23643
23476
  init_i18n();
23644
23477
  import_lucide_react60 = require("lucide-react");
23645
23478
  init_useLayoutDataStore();
23646
- init_useLayoutStore();
23647
23479
  init_Expandable2();
23648
23480
  init_Onboarding();
23649
23481
  init_button();
@@ -24699,6 +24531,7 @@ var init_useSendStore = __esm({
24699
24531
  var TOUR_SEND_ASSET, TOUR_BRIDGE_QUOTE, SEND_MENU_TOUR, BRIDGE_MENU_TOUR;
24700
24532
  var init_onboarding_setup9 = __esm({
24701
24533
  "src/internal/components/SendMenu/onboarding.setup.ts"() {
24534
+ init_constants();
24702
24535
  init_useBridgeStore();
24703
24536
  init_useSendStore();
24704
24537
  TOUR_SEND_ASSET = {
@@ -24718,7 +24551,7 @@ var init_onboarding_setup9 = __esm({
24718
24551
  };
24719
24552
  SEND_MENU_TOUR = [
24720
24553
  {
24721
- elId: "sendmenu-page" /* sendMenu */,
24554
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"send" /* SEND */}`,
24722
24555
  title: "passport:sendMenu.onboarding.sendMenu.title",
24723
24556
  description: "passport:sendMenu.onboarding.sendMenu.description",
24724
24557
  waitSecs: 4,
@@ -24747,7 +24580,7 @@ var init_onboarding_setup9 = __esm({
24747
24580
  ];
24748
24581
  BRIDGE_MENU_TOUR = [
24749
24582
  {
24750
- elId: "sendmenu-page" /* sendMenu */,
24583
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"send" /* SEND */}`,
24751
24584
  title: "passport:bridgeMenu.onboarding.bridgeMenu.title",
24752
24585
  description: "passport:bridgeMenu.onboarding.bridgeMenu.description",
24753
24586
  waitSecs: 5
@@ -27408,7 +27241,6 @@ function SendFlowSelector() {
27408
27241
  const { t } = useT();
27409
27242
  const { config } = useProviderConfig();
27410
27243
  useSendMenuParams();
27411
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
27412
27244
  const selectorFlow = useFlowSelectorStore((st) => st.flow);
27413
27245
  const menuTitle = useFlowSelectorStore((st) => st.menuTitle);
27414
27246
  const isUiLocked = useFlowSelectorStore((st) => st.isUiLocked);
@@ -27433,74 +27265,63 @@ function SendFlowSelector() {
27433
27265
  }, []);
27434
27266
  const isSendFlowInitialState = selectorFlow === "send" && sendStep === "input" || selectorFlow === "bridge" && bridgeStep === "select";
27435
27267
  const isFlowSelectorButtonsShown = !!config?.current?.features?.showAssetBridge && isSendFlowInitialState;
27436
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
27437
- "div",
27438
- {
27439
- ref: (inst) => onboarder.registerElement("sendmenu-page" /* sendMenu */, inst),
27440
- style: {
27441
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
27442
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
27443
- },
27444
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
27445
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
27446
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center justify-between", children: [
27447
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
27448
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
27449
- Button,
27450
- {
27451
- variant: "ghost",
27452
- size: "icon",
27453
- disabled: isUiLocked,
27454
- onClick: () => {
27455
- useFlowSelectorStore.getState().setError(null);
27456
- const { setPage } = useLayoutDataStore.getState();
27457
- if (selectorFlow === "bridge") {
27458
- const { bridgeStep: bridgeStep2, setBridgeStep } = useBridgeStore.getState();
27459
- switch (bridgeStep2) {
27460
- case "select":
27461
- return setPage("main-menu" /* MAIN_MENU */);
27462
- // case ''
27463
- case "tx-history-details":
27464
- return setBridgeStep("tx-history");
27465
- default:
27466
- return setBridgeStep("select");
27467
- }
27468
- }
27469
- if (selectorFlow === "send") {
27470
- const { txStep, setTxStep } = useSendStore.getState();
27471
- switch (txStep) {
27472
- case "input":
27473
- return setPage("main-menu" /* MAIN_MENU */);
27474
- default:
27475
- return setTxStep("input");
27476
- }
27477
- }
27478
- },
27479
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react73.ArrowLeft, { className: "h-4 w-4" })
27268
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
27269
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center justify-between", children: [
27270
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
27271
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
27272
+ Button,
27273
+ {
27274
+ variant: "ghost",
27275
+ size: "icon",
27276
+ disabled: isUiLocked,
27277
+ onClick: () => {
27278
+ useFlowSelectorStore.getState().setError(null);
27279
+ const { setPage } = useLayoutDataStore.getState();
27280
+ if (selectorFlow === "bridge") {
27281
+ const { bridgeStep: bridgeStep2, setBridgeStep } = useBridgeStore.getState();
27282
+ switch (bridgeStep2) {
27283
+ case "select":
27284
+ return setPage("main-menu" /* MAIN_MENU */);
27285
+ // case ''
27286
+ case "tx-history-details":
27287
+ return setBridgeStep("tx-history");
27288
+ default:
27289
+ return setBridgeStep("select");
27290
+ }
27480
27291
  }
27481
- ),
27482
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "text-xl font-semibold", children: menuTitle })
27483
- ] }),
27484
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(BridgeHistorySwitch, {}) })
27485
- ] }),
27486
- isFlowSelectorButtonsShown && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(SelectorFlowButtons, {}),
27487
- availableFlows[selectorFlow],
27488
- sendOrBridgeError && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Highlight, { type: "error", className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
27489
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { children: sendOrBridgeError }),
27490
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
27491
- Button,
27492
- {
27493
- variant: "default",
27494
- size: "medium",
27495
- className: "w-full",
27496
- onClick: () => useFlowSelectorStore.getState().setError(null),
27497
- children: t("passport:common.hide")
27498
- }
27499
- )
27500
- ] })
27501
- ] })
27502
- }
27503
- );
27292
+ if (selectorFlow === "send") {
27293
+ const { txStep, setTxStep } = useSendStore.getState();
27294
+ switch (txStep) {
27295
+ case "input":
27296
+ return setPage("main-menu" /* MAIN_MENU */);
27297
+ default:
27298
+ return setTxStep("input");
27299
+ }
27300
+ }
27301
+ },
27302
+ children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react73.ArrowLeft, { className: "h-4 w-4" })
27303
+ }
27304
+ ),
27305
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: "text-xl font-semibold", children: menuTitle })
27306
+ ] }),
27307
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(BridgeHistorySwitch, {}) })
27308
+ ] }),
27309
+ isFlowSelectorButtonsShown && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(SelectorFlowButtons, {}),
27310
+ availableFlows[selectorFlow],
27311
+ sendOrBridgeError && /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(Highlight, { type: "error", className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
27312
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { children: sendOrBridgeError }),
27313
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
27314
+ Button,
27315
+ {
27316
+ variant: "default",
27317
+ size: "medium",
27318
+ className: "w-full",
27319
+ onClick: () => useFlowSelectorStore.getState().setError(null),
27320
+ children: t("passport:common.hide")
27321
+ }
27322
+ )
27323
+ ] })
27324
+ ] });
27504
27325
  }
27505
27326
  var import_lucide_react73, import_react89, import_jsx_runtime120;
27506
27327
  var init_SendFlowSelector = __esm({
@@ -27510,7 +27331,6 @@ var init_SendFlowSelector = __esm({
27510
27331
  import_lucide_react73 = require("lucide-react");
27511
27332
  import_react89 = require("react");
27512
27333
  init_useLayoutDataStore();
27513
- init_useLayoutStore();
27514
27334
  init_utils();
27515
27335
  init_Expandable2();
27516
27336
  init_Onboarding();
@@ -28185,20 +28005,6 @@ var init_api4 = __esm({
28185
28005
  }
28186
28006
  });
28187
28007
 
28188
- // src/internal/components/TransactionsMenu/onboarding.setup.ts
28189
- var TRANSACTIONS_MENU_TOUR;
28190
- var init_onboarding_setup10 = __esm({
28191
- "src/internal/components/TransactionsMenu/onboarding.setup.ts"() {
28192
- TRANSACTIONS_MENU_TOUR = [
28193
- {
28194
- elId: "embarkai-transactions-menu-onboarding" /* transactionsMenu */,
28195
- title: "passport:transactionsMenu.onboarding.transactionsMenu.title",
28196
- description: "passport:transactionsMenu.onboarding.transactionsMenu.description"
28197
- }
28198
- ];
28199
- }
28200
- });
28201
-
28202
28008
  // src/internal/components/TransactionsMenu/utils.ts
28203
28009
  function formatIntl(price, fractionDigits) {
28204
28010
  const formatter = Intl.NumberFormat("en-US", {
@@ -28397,7 +28203,6 @@ function TransactionsMenu() {
28397
28203
  const { t } = useT();
28398
28204
  useOnboardingTourAvailable(true);
28399
28205
  const setPage = useLayoutDataStore((st) => st.setPage);
28400
- const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
28401
28206
  const [expandedGroups, setExpandedGroups] = (0, import_react91.useState)({});
28402
28207
  const historySupported = isTransactionHistorySupported(chainConfig?.id);
28403
28208
  const {
@@ -28416,50 +28221,39 @@ function TransactionsMenu() {
28416
28221
  [qc, chainConfig.id, address]
28417
28222
  );
28418
28223
  const txHistoryResolvedError = txHistoryError ? txHistoryError instanceof Error ? txHistoryError.message : "Failed to load transactions" : null;
28419
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
28420
- "div",
28421
- {
28422
- ref: (inst) => onboarder.registerElement("embarkai-transactions-menu-onboarding" /* transactionsMenu */, inst),
28423
- style: {
28424
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
28425
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
28224
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
28225
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
28226
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.ArrowLeft, { className: "h-4 w-4" }) }),
28227
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "text-xl font-semibold", children: t("passport:transactionsMenu.title") }),
28228
+ historySupported && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
28229
+ Button,
28230
+ {
28231
+ variant: "ghost",
28232
+ size: "icon",
28233
+ onClick: refreshTxHistory,
28234
+ disabled: isTxHistoryFetching,
28235
+ title: "Refresh transactions",
28236
+ children: isTxHistoryFetching ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.RefreshCw, { className: "h-4 w-4" })
28237
+ }
28238
+ )
28239
+ ] }),
28240
+ !historySupported && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Highlight, { type: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: t("passport:transactionsMenu.comingSoon") }) }),
28241
+ historySupported && isTxHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.Loader, { className: "w-4 h-4 animate-spin" }) }),
28242
+ historySupported && !isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Highlight, { type: "info", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: t("passport:transactionsMenu.noTransactions") }) }),
28243
+ historySupported && !isTxHistoryLoading && txHistoryResolvedError && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
28244
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.XCircle, { className: "w-4 h-4 flex-none" }),
28245
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "block w-full flex-1 text-center text-xs", children: txHistoryResolvedError })
28246
+ ] }),
28247
+ historySupported && !isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: txHistoryGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
28248
+ TransactionsGroup,
28249
+ {
28250
+ group,
28251
+ expanded: expandedGroups[group.id] ?? false,
28252
+ onToggleExpanded: (groupId) => setExpandedGroups((prev) => ({ ...prev, [groupId]: !prev[groupId] }))
28426
28253
  },
28427
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
28428
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
28429
- /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
28430
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.ArrowLeft, { className: "h-4 w-4" }) }),
28431
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "text-xl font-semibold", children: t("passport:transactionsMenu.title") }),
28432
- historySupported && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
28433
- Button,
28434
- {
28435
- variant: "ghost",
28436
- size: "icon",
28437
- onClick: refreshTxHistory,
28438
- disabled: isTxHistoryFetching,
28439
- title: "Refresh transactions",
28440
- children: isTxHistoryFetching ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.RefreshCw, { className: "h-4 w-4" })
28441
- }
28442
- )
28443
- ] }),
28444
- !historySupported && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Highlight, { type: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: t("passport:transactionsMenu.comingSoon") }) }),
28445
- historySupported && isTxHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.Loader, { className: "w-4 h-4 animate-spin" }) }),
28446
- historySupported && !isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Highlight, { type: "info", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: t("passport:transactionsMenu.noTransactions") }) }),
28447
- historySupported && !isTxHistoryLoading && txHistoryResolvedError && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
28448
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react75.XCircle, { className: "w-4 h-4 flex-none" }),
28449
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "block w-full flex-1 text-center text-xs", children: txHistoryResolvedError })
28450
- ] }),
28451
- historySupported && !isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: txHistoryGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
28452
- TransactionsGroup,
28453
- {
28454
- group,
28455
- expanded: expandedGroups[group.id] ?? false,
28456
- onToggleExpanded: (groupId) => setExpandedGroups((prev) => ({ ...prev, [groupId]: !prev[groupId] }))
28457
- },
28458
- group.id
28459
- )) })
28460
- ] })
28461
- }
28462
- );
28254
+ group.id
28255
+ )) })
28256
+ ] });
28463
28257
  }
28464
28258
  var import_react_query53, import_lucide_react75, import_react91, import_jsx_runtime122;
28465
28259
  var init_TransactionsMenu = __esm({
@@ -28470,7 +28264,6 @@ var init_TransactionsMenu = __esm({
28470
28264
  import_lucide_react75 = require("lucide-react");
28471
28265
  import_react91 = require("react");
28472
28266
  init_useLayoutDataStore();
28473
- init_useLayoutStore();
28474
28267
  init_Expandable2();
28475
28268
  init_Onboarding();
28476
28269
  init_button();
@@ -28482,6 +28275,21 @@ var init_TransactionsMenu = __esm({
28482
28275
  }
28483
28276
  });
28484
28277
 
28278
+ // src/internal/components/TransactionsMenu/onboarding.setup.ts
28279
+ var TRANSACTIONS_MENU_TOUR;
28280
+ var init_onboarding_setup10 = __esm({
28281
+ "src/internal/components/TransactionsMenu/onboarding.setup.ts"() {
28282
+ init_constants();
28283
+ TRANSACTIONS_MENU_TOUR = [
28284
+ {
28285
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"transactions" /* TRANSACTIONS */}`,
28286
+ title: "passport:transactionsMenu.onboarding.transactionsMenu.title",
28287
+ description: "passport:transactionsMenu.onboarding.transactionsMenu.description"
28288
+ }
28289
+ ];
28290
+ }
28291
+ });
28292
+
28485
28293
  // src/internal/components/TransactionsMenu/index.ts
28486
28294
  var init_TransactionsMenu2 = __esm({
28487
28295
  "src/internal/components/TransactionsMenu/index.ts"() {
@@ -28509,21 +28317,6 @@ var init_constants8 = __esm({
28509
28317
  }
28510
28318
  });
28511
28319
 
28512
- // src/internal/components/SettingsMenu/onboarding.setup.ts
28513
- var SETTINGS_MENU_ONBOARDING_ID, SETTINGS_MENU_TOUR;
28514
- var init_onboarding_setup11 = __esm({
28515
- "src/internal/components/SettingsMenu/onboarding.setup.ts"() {
28516
- SETTINGS_MENU_ONBOARDING_ID = "embarkai-settings-menu-onboarding";
28517
- SETTINGS_MENU_TOUR = [
28518
- {
28519
- elId: SETTINGS_MENU_ONBOARDING_ID,
28520
- title: "passport:common.onboarding.settingsMenu.title",
28521
- description: "passport:common.onboarding.settingsMenu.description"
28522
- }
28523
- ];
28524
- }
28525
- });
28526
-
28527
28320
  // src/internal/components/SettingsMenu/SettingsMenu.tsx
28528
28321
  function useSettingsButtons(chainId) {
28529
28322
  const config = useProviderConfig().config;
@@ -28576,41 +28369,30 @@ function SettingsMenu() {
28576
28369
  queryFn: getNicknameInfo
28577
28370
  });
28578
28371
  const highlightedKeys = settingsNotifications.map((n) => n.target);
28579
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
28580
- "div",
28581
- {
28582
- ref: (inst) => onboarder.registerElement(SETTINGS_MENU_ONBOARDING_ID, inst),
28583
- style: {
28584
- "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
28585
- "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
28372
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Expandable, { isExpanded: true, contentClassName: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
28373
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
28374
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react77.ArrowLeft, { className: "h-4 w-4" }) }),
28375
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "text-xl font-semibold", children: t("passport:common.settings") })
28376
+ ] }),
28377
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: settingsButtons.map((el) => ({ ...el, onClick: () => setPage(el.id) })).map(({ id, name, Icon: Icon2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
28378
+ Button,
28379
+ {
28380
+ variant: "secondary",
28381
+ size: "large",
28382
+ onClick,
28383
+ disabled: !address,
28384
+ className: cn2(
28385
+ "w-full items-center justify-start",
28386
+ highlightedKeys.includes(id) && "animate-glow-warning"
28387
+ ),
28388
+ children: [
28389
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon2, { className: "w-4 h-4" }),
28390
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: t(name) })
28391
+ ]
28586
28392
  },
28587
- className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)] flex flex-col gap-[var(--ui-kit-gap)]",
28588
- children: [
28589
- /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
28590
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react77.ArrowLeft, { className: "h-4 w-4" }) }),
28591
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "text-xl font-semibold", children: t("passport:common.settings") })
28592
- ] }),
28593
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: settingsButtons.map((el) => ({ ...el, onClick: () => setPage(el.id) })).map(({ id, name, Icon: Icon2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
28594
- Button,
28595
- {
28596
- variant: "secondary",
28597
- size: "large",
28598
- onClick,
28599
- disabled: !address,
28600
- className: cn2(
28601
- "w-full items-center justify-start",
28602
- highlightedKeys.includes(id) && "animate-glow-warning"
28603
- ),
28604
- children: [
28605
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon2, { className: "w-4 h-4" }),
28606
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: t(name) })
28607
- ]
28608
- },
28609
- id
28610
- )) })
28611
- ]
28612
- }
28613
- );
28393
+ id
28394
+ )) })
28395
+ ] });
28614
28396
  }
28615
28397
  var import_react_query54, import_lucide_react77, import_react92, import_jsx_runtime123;
28616
28398
  var init_SettingsMenu = __esm({
@@ -28627,16 +28409,31 @@ var init_SettingsMenu = __esm({
28627
28409
  init_useLayoutStore();
28628
28410
  init_pro_mode();
28629
28411
  init_utils();
28412
+ init_Expandable2();
28630
28413
  init_useProvidersList();
28631
28414
  init_Onboarding();
28632
28415
  init_TransactionsMenu2();
28633
28416
  init_button();
28634
28417
  init_constants8();
28635
- init_onboarding_setup11();
28636
28418
  import_jsx_runtime123 = require("react/jsx-runtime");
28637
28419
  }
28638
28420
  });
28639
28421
 
28422
+ // src/internal/components/SettingsMenu/onboarding.setup.ts
28423
+ var SETTINGS_MENU_TOUR;
28424
+ var init_onboarding_setup11 = __esm({
28425
+ "src/internal/components/SettingsMenu/onboarding.setup.ts"() {
28426
+ init_constants();
28427
+ SETTINGS_MENU_TOUR = [
28428
+ {
28429
+ elId: `${EMBARKAI_DIALOG_ONBOARDING_ID}-${"settings" /* SETTINGS */}`,
28430
+ title: "passport:common.onboarding.settingsMenu.title",
28431
+ description: "passport:common.onboarding.settingsMenu.description"
28432
+ }
28433
+ ];
28434
+ }
28435
+ });
28436
+
28640
28437
  // src/internal/components/SettingsMenu/index.ts
28641
28438
  var init_SettingsMenu2 = __esm({
28642
28439
  "src/internal/components/SettingsMenu/index.ts"() {
@@ -28858,35 +28655,25 @@ var init_PageMap = __esm({
28858
28655
  // src/internal/hooks/usePageMapper.tsx
28859
28656
  function usePageMapper() {
28860
28657
  const page = useLayoutDataStore((st) => st.page);
28861
- const {
28862
- setDialogTitle,
28863
- setDialogDescription,
28864
- setIsDialogForced,
28865
- setDialogContent,
28866
- setIsDialogOpen,
28867
- setIsDialogClosing
28868
- } = useLayoutStore();
28869
28658
  const closeDialog = (0, import_react93.useCallback)(() => {
28870
- setIsDialogClosing(true);
28659
+ useLayoutStore.setState({ isDialogAnimating: true });
28871
28660
  setTimeout(() => {
28872
- setDialogContent(null);
28873
- setDialogDescription(null);
28874
- setDialogTitle(null);
28875
- setIsDialogForced(false);
28876
- setIsDialogClosing(false);
28877
- setIsDialogOpen(false);
28661
+ useLayoutStore.setState({
28662
+ dialogContent: null,
28663
+ isDialogAnimating: false,
28664
+ isDialogOpen: false,
28665
+ isDialogForced: false
28666
+ // closing via page === null should reset forced state
28667
+ });
28878
28668
  }, CLEAR_DIALOG_TIMEOUT);
28879
- }, [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogForced, setIsDialogOpen, setIsDialogClosing]);
28880
- const openDialog = (0, import_react93.useCallback)(
28881
- (pageItem) => {
28882
- const PageContentComponent = pageItem.component;
28883
- setDialogTitle(pageItem.title);
28884
- setDialogDescription(pageItem.description);
28885
- setDialogContent(/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(PageContentComponent, {}));
28886
- setIsDialogOpen(true);
28887
- },
28888
- [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogOpen]
28889
- );
28669
+ }, []);
28670
+ const openDialog = (0, import_react93.useCallback)((pageItem) => {
28671
+ useLayoutStore.setState({
28672
+ dialogContent: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(pageItem.component, {}),
28673
+ isDialogOpen: true
28674
+ // isDialogAnimating: true
28675
+ });
28676
+ }, []);
28890
28677
  (0, import_react93.useEffect)(() => {
28891
28678
  if (page === null) return closeDialog();
28892
28679
  const pageItem = PAGE_MAP[page];
@@ -28957,7 +28744,7 @@ var init_package = __esm({
28957
28744
  "package.json"() {
28958
28745
  package_default = {
28959
28746
  name: "@embarkai/ui-kit",
28960
- version: "0.4.93",
28747
+ version: "0.4.94",
28961
28748
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
28962
28749
  type: "module",
28963
28750
  main: "./dist/index.cjs",
@@ -29220,9 +29007,9 @@ var init_Footer2 = __esm({
29220
29007
  var EMBARKAI_HEADER_ONBOARDING_ID, EMBARKAI_HEADER_TOUR_BUTTON_ID, ONBOARDING_TOURS;
29221
29008
  var init_onborading_setup = __esm({
29222
29009
  "src/internal/components/Header/onborading.setup.ts"() {
29010
+ init_constants();
29223
29011
  init_BuyMenu2();
29224
29012
  init_ChainsMenu2();
29225
- init_Dialog2();
29226
29013
  init_Footer2();
29227
29014
  init_KeyshareRestoreMenu2();
29228
29015
  init_MainMenu2();
@@ -29433,7 +29220,7 @@ var init_Header2 = __esm({
29433
29220
  // src/internal/components/ui/dialog.tsx
29434
29221
  function useDecideContentStyles() {
29435
29222
  const isMobileView = useLayoutStore((st) => st.isMobileView);
29436
- const isClosing = useLayoutStore((st) => !!st.isDialogOpen && !!st.isDialogClosing);
29223
+ const isClosing = useLayoutStore((st) => !!st.isDialogOpen && !!st.isDialogAnimating);
29437
29224
  const mobileStyles = isMobileView ? { "--ui-kit-bdrs": "20px 20px 0px 0px" } : {};
29438
29225
  return {
29439
29226
  isClosing,
@@ -29619,12 +29406,10 @@ function Dialog2() {
29619
29406
  const className = config.current?.ui?.dialogClassName;
29620
29407
  const session = useSession((st) => st.session);
29621
29408
  const hasServerVault = useSession((st) => st.hasServerVault);
29409
+ const { colorMode, maxScrollHeight, isDialogOpen, dialogContent, isDialogForced } = useLayoutStore();
29622
29410
  const page = useLayoutDataStore((st) => st.page);
29623
29411
  const transitionPageHeight = useLayoutDataStore((st) => st.transitionPageHeight);
29624
- const setPage = useLayoutDataStore((st) => st.setPage);
29625
- const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
29626
- const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
29627
- (0, import_react98.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
29412
+ (0, import_react98.useEffect)(() => useLayoutStore.setState({ isSettings: !!session }), [session]);
29628
29413
  usePageMapper();
29629
29414
  useAutoConnect();
29630
29415
  useBackupStatusChanges();
@@ -29639,6 +29424,7 @@ function Dialog2() {
29639
29424
  onOpenChange: (open) => {
29640
29425
  if (isDialogForced) return;
29641
29426
  if (!open) {
29427
+ const { setPostAuthNavigation, setPage } = useLayoutDataStore.getState();
29642
29428
  setPostAuthNavigation(null);
29643
29429
  setPage(null);
29644
29430
  }
@@ -29650,18 +29436,29 @@ function Dialog2() {
29650
29436
  colorMode,
29651
29437
  className,
29652
29438
  children: [
29653
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogTitle, { children: dialogTitle }) }),
29654
- /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogDescription, { className: "sr-only", children: dialogDescription }),
29439
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogTitle, { children: "embarkAI" }) }),
29440
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogDescription, { className: "sr-only", children: "embarkAI wallet" }),
29655
29441
  !isHeaderHidden && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Header, {}),
29656
29442
  /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react97.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
29657
29443
  import_react97.motion.div,
29658
29444
  {
29445
+ style: { overflow: "hidden" },
29659
29446
  initial: { opacity: 0, height: transitionPageHeight },
29660
29447
  animate: { opacity: 1, height: "auto" },
29661
29448
  exit: { opacity: 0, height: transitionPageHeight },
29662
- style: { overflow: "hidden" },
29663
29449
  transition: Y_ANIMATION_SETUP,
29664
- children: dialogContent
29450
+ children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
29451
+ "div",
29452
+ {
29453
+ ref: (inst) => onboarder.registerElement(`${EMBARKAI_DIALOG_ONBOARDING_ID}-${page}`, inst),
29454
+ style: {
29455
+ "--ui-kit-scrollbar-mah": `${maxScrollHeight}px`,
29456
+ "--ui-kit-list-scrollbar-pd-r": "var(--ui-kit-pd)"
29457
+ },
29458
+ className: "list-scrollbar-y w-full p-[var(--ui-kit-pd)]",
29459
+ children: dialogContent
29460
+ }
29461
+ )
29665
29462
  },
29666
29463
  page || "empty"
29667
29464
  ) }),
@@ -29672,7 +29469,7 @@ function Dialog2() {
29672
29469
  }
29673
29470
  );
29674
29471
  }
29675
- var import_react97, import_react98, import_jsx_runtime130, EMBARKAI_DIALOG_ONBOARDING_ID;
29472
+ var import_react97, import_react98, import_jsx_runtime130;
29676
29473
  var init_Dialog = __esm({
29677
29474
  "src/internal/components/Dialog/Dialog.tsx"() {
29678
29475
  init_ProviderContext();
@@ -29694,7 +29491,6 @@ var init_Dialog = __esm({
29694
29491
  init_dialog();
29695
29492
  init_visually_hidden();
29696
29493
  import_jsx_runtime130 = require("react/jsx-runtime");
29697
- EMBARKAI_DIALOG_ONBOARDING_ID = "embark-main-dialog-content";
29698
29494
  }
29699
29495
  });
29700
29496