@lumiapassport/ui-kit 1.14.4 → 1.14.5

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
@@ -4394,7 +4394,7 @@ var import_zustand = require("zustand");
4394
4394
  var import_lucide_react2 = require("lucide-react");
4395
4395
  init_assets();
4396
4396
  var LOCAL_COLOR_MODE_KEY = "lumia-passport-theme";
4397
- var DEFAULT_AUTH_MENU_HEIGHT = 253;
4397
+ var DEFAULT_AUTH_MENU_HEIGHT = 337;
4398
4398
  var DEFAULT_MAIN_MENU_HEIGHT = 90;
4399
4399
  var DEFAULT_SETTINGS_MENU_HEIGHT = 346;
4400
4400
  var MAX_CONTENT_HEIGHT = 640;
@@ -4411,23 +4411,23 @@ var PROVIDERS_META2 = {
4411
4411
  };
4412
4412
 
4413
4413
  // src/internal/hooks/useLayoutDataStore.ts
4414
- var PageKey = /* @__PURE__ */ ((PageKey2) => {
4415
- PageKey2["AUTH"] = "auth";
4416
- PageKey2["TERMS_OF_SERVICE"] = "terms-of-service";
4417
- PageKey2["MAIN_MENU"] = "main-menu";
4418
- PageKey2["SETTINGS"] = "settings";
4419
- PageKey2["SEND"] = "send";
4420
- PageKey2["RECEIVE"] = "receive";
4421
- PageKey2["BUY"] = "buy";
4422
- PageKey2["KYC"] = "kyc";
4423
- PageKey2["TRANSACTIONS"] = "transactions";
4424
- PageKey2["ASSETS"] = "assets";
4425
- PageKey2["MANAGE_WALLET"] = "manage-wallet";
4426
- PageKey2["UNLINK_PROVIDER"] = "unlink-provider";
4427
- PageKey2["SECURITY"] = "security";
4428
- PageKey2["KEYSARE_BACKUP"] = "keysare-backup";
4429
- PageKey2["KEYSHARE_RESTORE"] = "keyshare-restore";
4430
- return PageKey2;
4414
+ var PageKey = /* @__PURE__ */ ((PageKey4) => {
4415
+ PageKey4["AUTH"] = "auth";
4416
+ PageKey4["TERMS_OF_SERVICE"] = "terms-of-service";
4417
+ PageKey4["MAIN_MENU"] = "main-menu";
4418
+ PageKey4["SETTINGS"] = "settings";
4419
+ PageKey4["SEND"] = "send";
4420
+ PageKey4["RECEIVE"] = "receive";
4421
+ PageKey4["BUY"] = "buy";
4422
+ PageKey4["KYC"] = "kyc";
4423
+ PageKey4["TRANSACTIONS"] = "transactions";
4424
+ PageKey4["ASSETS"] = "assets";
4425
+ PageKey4["MANAGE_WALLET"] = "manage-wallet";
4426
+ PageKey4["UNLINK_PROVIDER"] = "unlink-provider";
4427
+ PageKey4["SECURITY"] = "security";
4428
+ PageKey4["KEYSARE_BACKUP"] = "keysare-backup";
4429
+ PageKey4["KEYSHARE_RESTORE"] = "keyshare-restore";
4430
+ return PageKey4;
4431
4431
  })(PageKey || {});
4432
4432
  var useLayoutDataStore = (0, import_zustand.create)((set) => ({
4433
4433
  page: null,
@@ -4439,6 +4439,7 @@ var useLayoutDataStore = (0, import_zustand.create)((set) => ({
4439
4439
  balance: { decimals: 18, formatted: "0.0", symbol: "LUMIA", value: BigInt(0) },
4440
4440
  mainPageHeight: DEFAULT_MAIN_MENU_HEIGHT,
4441
4441
  settingsNotifications: [],
4442
+ isWalletLinking: false,
4442
4443
  setPage: (page) => set({ page }),
4443
4444
  setPageParams: (pageOptions) => set({ pageParams: pageOptions }),
4444
4445
  setCryptoRate: (lumiaRate) => set({ cryptoRate: lumiaRate }),
@@ -4456,7 +4457,8 @@ var useLayoutDataStore = (0, import_zustand.create)((set) => ({
4456
4457
  }
4457
4458
  const filtered = prev.settingsNotifications.filter((n) => n.id !== notification.id);
4458
4459
  return { settingsNotifications: filtered };
4459
- })
4460
+ }),
4461
+ setIsWalletLinking: (isWalletLinking) => set({ isWalletLinking })
4460
4462
  }));
4461
4463
 
4462
4464
  // src/internal/components/BalanceFeedProvider/BalanceFeedProvider.tsx
@@ -4552,7 +4554,7 @@ var import_react50 = require("react");
4552
4554
  // package.json
4553
4555
  var package_default = {
4554
4556
  name: "@lumiapassport/ui-kit",
4555
- version: "1.14.3",
4557
+ version: "1.14.5",
4556
4558
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
4557
4559
  type: "module",
4558
4560
  main: "./dist/index.cjs",
@@ -4785,6 +4787,15 @@ Button.displayName = "Button";
4785
4787
 
4786
4788
  // src/internal/components/Footer/Footer.tsx
4787
4789
  var import_jsx_runtime4 = require("react/jsx-runtime");
4790
+ function Version({ className }) {
4791
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4792
+ "span",
4793
+ {
4794
+ className: cn("font-mono text-[10px] text-[var(--l-pass-fg-muted)]", className),
4795
+ children: `v${package_default.version}`
4796
+ }
4797
+ );
4798
+ }
4788
4799
  function Footer() {
4789
4800
  const qc = (0, import_react_query2.useQueryClient)();
4790
4801
  const { callbacks } = useLumiaPassportConfig();
@@ -4823,7 +4834,7 @@ function Footer() {
4823
4834
  "div",
4824
4835
  {
4825
4836
  style: { borderTop: "1px solid var(--l-pass-bd)" },
4826
- className: cn("w-full flex flex-col gap-1 items-center p-[var(--l-pass-pd)] pb-5"),
4837
+ className: "w-full flex flex-col items-center p-[var(--l-pass-pd)] pb-5",
4827
4838
  children: [
4828
4839
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
4829
4840
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
@@ -4865,9 +4876,9 @@ function Footer() {
4865
4876
  isDisconnecting ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react3.LogOut, { className: "w-4 h-4" })
4866
4877
  ]
4867
4878
  }
4868
- ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-mono text-[10px] text-[var(--l-pass-fg-muted)]", children: `v${package_default.version}` })
4879
+ ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Version, {})
4869
4880
  ] }),
4870
- !!address && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-mono text-[10px] text-[var(--l-pass-fg-muted)]", children: `v${package_default.version}` })
4881
+ !!address && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Version, { className: "block w-fit mt-1" })
4871
4882
  ]
4872
4883
  }
4873
4884
  );
@@ -5520,8 +5531,34 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName;
5520
5531
  var import_jsx_runtime13 = require("react/jsx-runtime");
5521
5532
  var VisuallyHidden = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0", children });
5522
5533
 
5523
- // src/internal/hooks/useAutoConnect.ts
5534
+ // src/internal/hooks/useListenIframeAuthEvents.ts
5524
5535
  var import_react6 = require("react");
5536
+ function useListenIframeAuthEvents() {
5537
+ const setPage = useLayoutDataStore((state) => state.setPage);
5538
+ const setIsIframeReady = useLumiaPassportSession((state) => state.setIsIframeReady);
5539
+ const handleIframeMessage = (0, import_react6.useCallback)(
5540
+ (event) => {
5541
+ if (event.data?.type === "LUMIA_PASSPORT_IFRAME_READY") {
5542
+ console.log("[ IFRAME MESSAGE CACTHED ] Iframe is ready");
5543
+ setIsIframeReady(true);
5544
+ } else if (event.data?.type === "LUMIA_PASSPORT_SHOW_IFRAME") {
5545
+ console.log("[ IFRAME MESSAGE CACTHED ] Consent screen shown - hiding auth modal");
5546
+ } else if (event.data?.type === "LUMIA_PASSPORT_HIDE_IFRAME") {
5547
+ console.log("[ IFRAME MESSAGE CACTHED ] Consent screen hidden");
5548
+ } else if (event.data?.type === "KEYSHARE_RECOVERY_NEEDED") {
5549
+ console.log("[ IFRAME MESSAGE CACTHED] recovery neede");
5550
+ }
5551
+ },
5552
+ [setPage, setIsIframeReady]
5553
+ );
5554
+ (0, import_react6.useEffect)(() => {
5555
+ window.addEventListener("message", handleIframeMessage);
5556
+ return () => window.removeEventListener("message", handleIframeMessage);
5557
+ }, [handleIframeMessage]);
5558
+ }
5559
+
5560
+ // src/internal/hooks/useAutoConnect.ts
5561
+ var import_react7 = require("react");
5525
5562
  function useAutoConnect() {
5526
5563
  const {
5527
5564
  config: { current: config },
@@ -5541,7 +5578,7 @@ function useAutoConnect() {
5541
5578
  setIsIframeReady,
5542
5579
  setIsLoading
5543
5580
  } = useLumiaPassportSession();
5544
- const createSessionWithKeyshare = (0, import_react6.useCallback)(
5581
+ const createSessionWithKeyshare = (0, import_react7.useCallback)(
5545
5582
  async (userId, hasServerKeyshare, isNewUser) => {
5546
5583
  try {
5547
5584
  try {
@@ -5575,8 +5612,8 @@ function useAutoConnect() {
5575
5612
  },
5576
5613
  [usePaymaster, setStatus, callbacks]
5577
5614
  );
5578
- const autoConnectAttemptedRef = (0, import_react6.useRef)(false);
5579
- (0, import_react6.useEffect)(() => {
5615
+ const autoConnectAttemptedRef = (0, import_react7.useRef)(false);
5616
+ (0, import_react7.useEffect)(() => {
5580
5617
  if (autoConnectAttemptedRef.current) return;
5581
5618
  setIsLoading(true);
5582
5619
  const tryAutoConnect = async (attempt) => {
@@ -5698,14 +5735,13 @@ function useAutoConnect() {
5698
5735
 
5699
5736
  // src/internal/hooks/useBackupStatusChanges.ts
5700
5737
  var import_react_query5 = require("@tanstack/react-query");
5701
- var import_react7 = require("react");
5738
+ var import_react8 = require("react");
5702
5739
  init_vaultClient();
5703
5740
  function useBackupStatusChanges() {
5704
5741
  const setHasServerVault = useLumiaPassportSession((st) => st.setHasServerVault);
5705
5742
  const { mutate: handleBackupStatusChanged } = (0, import_react_query5.useMutation)({
5706
5743
  mutationFn: async (event) => {
5707
5744
  const customEvent = event;
5708
- console.log("[BACKUP STATUS] changed:", customEvent.detail);
5709
5745
  return await getShareRecoveryStats();
5710
5746
  },
5711
5747
  onSuccess: (stats) => {
@@ -5722,7 +5758,7 @@ function useBackupStatusChanges() {
5722
5758
  console.warn("[BACKUP STATUS] Failed to fetch initial vault status:", error);
5723
5759
  }
5724
5760
  });
5725
- (0, import_react7.useEffect)(() => {
5761
+ (0, import_react8.useEffect)(() => {
5726
5762
  window.addEventListener("lumia-passport-backup-status-changed", handleBackupStatusChanged);
5727
5763
  return () => {
5728
5764
  window.removeEventListener("lumia-passport-backup-status-changed", handleBackupStatusChanged);
@@ -5731,7 +5767,7 @@ function useBackupStatusChanges() {
5731
5767
  }
5732
5768
 
5733
5769
  // src/internal/hooks/useBackupWarning.ts
5734
- var import_react8 = require("react");
5770
+ var import_react9 = require("react");
5735
5771
  var WARNING_TIMEOUT_MS = 24e3;
5736
5772
  function useBackupWarning() {
5737
5773
  const config = useLumiaPassportConfig().config;
@@ -5739,8 +5775,8 @@ function useBackupWarning() {
5739
5775
  const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
5740
5776
  const page = useLayoutDataStore((st) => st.page);
5741
5777
  const setPage = useLayoutDataStore((st) => st.setPage);
5742
- const timeoutRef = (0, import_react8.useRef)(null);
5743
- (0, import_react8.useEffect)(() => {
5778
+ const timeoutRef = (0, import_react9.useRef)(null);
5779
+ (0, import_react9.useEffect)(() => {
5744
5780
  if (timeoutRef.current) {
5745
5781
  clearTimeout(timeoutRef.current);
5746
5782
  timeoutRef.current = null;
@@ -5762,7 +5798,7 @@ function useBackupWarning() {
5762
5798
 
5763
5799
  // src/internal/hooks/useCheckVaultStatus.ts
5764
5800
  var import_react_query6 = require("@tanstack/react-query");
5765
- var import_react9 = require("react");
5801
+ var import_react10 = require("react");
5766
5802
  init_vaultClient();
5767
5803
  function useCheckVaultStatus() {
5768
5804
  const address = useLumiaPassportSession((st) => st.address);
@@ -5781,7 +5817,7 @@ function useCheckVaultStatus() {
5781
5817
  setHasServerVault(false);
5782
5818
  }
5783
5819
  });
5784
- (0, import_react9.useEffect)(() => {
5820
+ (0, import_react10.useEffect)(() => {
5785
5821
  if (!address) return setHasServerVault(false);
5786
5822
  checkVaultStatus();
5787
5823
  }, [address, checkVaultStatus]);
@@ -5789,12 +5825,12 @@ function useCheckVaultStatus() {
5789
5825
 
5790
5826
  // src/internal/hooks/useDetectMaxScrollHeight.ts
5791
5827
  var import_lodash_es2 = require("lodash-es");
5792
- var import_react10 = require("react");
5828
+ var import_react11 = require("react");
5793
5829
  var DEBOUNCE_DELAY = 50;
5794
5830
  function useDetectMaxScrollHeight() {
5795
5831
  const setIsMobileView = useLayoutStore((state) => state.setIsMobileView);
5796
5832
  const setMaxScrollHeight = useLayoutStore((state) => state.setMaxScrollHeight);
5797
- const onResize = (0, import_react10.useCallback)(
5833
+ const onResize = (0, import_react11.useCallback)(
5798
5834
  (0, import_lodash_es2.debounce)(({ width, height }) => {
5799
5835
  const limContentHeight = height * 0.92 - 116 - 72;
5800
5836
  setIsMobileView(width < height && (width < 475 || limContentHeight <= MAX_CONTENT_HEIGHT));
@@ -5802,7 +5838,7 @@ function useDetectMaxScrollHeight() {
5802
5838
  }, DEBOUNCE_DELAY),
5803
5839
  [setMaxScrollHeight, setIsMobileView]
5804
5840
  );
5805
- (0, import_react10.useEffect)(() => {
5841
+ (0, import_react11.useEffect)(() => {
5806
5842
  const obs = new ResizeObserver(([entry]) => onResize(entry.contentRect));
5807
5843
  const doc = window.document.getElementsByTagName("html")[0];
5808
5844
  if (doc) obs.observe(doc);
@@ -5815,9 +5851,34 @@ var import_react47 = require("react");
5815
5851
 
5816
5852
  // src/internal/components/AuthMenu/AuthMenu.tsx
5817
5853
  var import_framer_motion = require("framer-motion");
5818
- var import_lucide_react17 = require("lucide-react");
5854
+ var import_lucide_react16 = require("lucide-react");
5819
5855
  var import_react21 = require("react");
5820
5856
 
5857
+ // src/internal/components/ui/highlight.tsx
5858
+ var import_jsx_runtime14 = require("react/jsx-runtime");
5859
+ var CARD_STYLES = {
5860
+ info: "text-[var(--l-pass-info)] bg-[var(--l-pass-bg-info)]",
5861
+ success: "text-[var(--l-pass-success)] bg-[var(--l-pass-bg-success)]",
5862
+ warning: "text-[var(--l-pass-warning)] bg-[var(--l-pass-bg-warning)]",
5863
+ error: "text-[var(--l-pass-error)] bg-[var(--l-pass-bg-error)]"
5864
+ };
5865
+ function Highlight(props) {
5866
+ const { type = "info", children, className } = props;
5867
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5868
+ "div",
5869
+ {
5870
+ className: cn(
5871
+ "w-full text-xs rounded-[var(--l-pass-el-bdrs)] p-[var(--l-pass-pd)]",
5872
+ "whitespace-pre-line",
5873
+ type === "error" ? "break-all" : "break-normal",
5874
+ CARD_STYLES[type],
5875
+ className
5876
+ ),
5877
+ children
5878
+ }
5879
+ );
5880
+ }
5881
+
5821
5882
  // src/internal/components/AuthMenu/AuthFailedStep.tsx
5822
5883
  var import_lucide_react9 = require("lucide-react");
5823
5884
 
@@ -5830,68 +5891,58 @@ var useAuthStore = (0, import_zustand3.create)((set) => ({
5830
5891
  expiresIn: null,
5831
5892
  codeSendError: null,
5832
5893
  passkeyStatus: "idle",
5833
- passkeyError: null,
5834
- failedMessage: null,
5835
5894
  failedType: "general",
5836
- verificationError: null,
5837
5895
  setStep: (step) => set({ step }),
5838
- setAlert: (alert2) => set({ alert: alert2 }),
5839
5896
  setEmail: (email) => set({ email }),
5840
5897
  setExpiresIn: (expiresIn) => set({ expiresIn }),
5841
- setCodeSendError: (error) => set({ codeSendError: error }),
5842
5898
  setPasskeyStatus: (status) => set({ passkeyStatus: status }),
5843
- setPasskeyError: (error) => set({ passkeyError: error }),
5844
- setFailedMessage: (message) => set({ failedMessage: message }),
5845
- setFailedType: (type) => set({ failedType: type }),
5846
- setVerificationError: (error) => set({ verificationError: error })
5899
+ setAlert: (alert2) => set({ alert: alert2 }),
5900
+ setFailedType: (type) => set({ failedType: type })
5847
5901
  }));
5848
5902
 
5849
5903
  // src/internal/components/AuthMenu/AuthFailedStep.tsx
5850
- var import_jsx_runtime14 = require("react/jsx-runtime");
5904
+ var import_jsx_runtime15 = require("react/jsx-runtime");
5851
5905
  function AuthFailedStep() {
5852
5906
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
5853
- const { failedMessage, failedType, setStep, setFailedMessage, setFailedType } = useAuthStore();
5907
+ const { failedType, setStep, setFailedType, setAlert } = useAuthStore();
5854
5908
  const isCritical = failedType === "critical" || failedType === "config";
5855
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-full flex flex-col text-center gap-4 p-4", children: [
5856
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5909
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w-full flex flex-col text-center gap-4 p-4", children: [
5910
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5857
5911
  "div",
5858
5912
  {
5859
5913
  className: cn(
5860
5914
  "w-full flex flex-col p-2 gap-2 rounded-[var(--l-pass-el-bdrs)]",
5861
5915
  isCritical ? "text-[var(--l-pass-error)] bg-[var(--l-pass-bg-error)]" : "text-[var(--l-pass-warning)] bg-[var(--l-pass-bg-warning)]"
5862
5916
  ),
5863
- children: [
5864
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-full flex items-center justify-center gap-2", children: [
5865
- isCritical ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.AlertTriangle, { className: "w-5 h-5 text-[var(--l-pass-error)]" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react9.Cross, { className: "w-5 h-5 text-[var(--l-pass-warning)]" }),
5866
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-center block text-xl font-bold", children: failedType === "config" ? "Configuration Error" : failedType === "critical" ? "Critical Error" : "Failed" })
5867
- ] }),
5868
- failedMessage && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-center block text-sm whitespace-pre-line leading-relaxed", children: failedMessage })
5869
- ]
5917
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w-full flex items-center justify-center gap-2", children: [
5918
+ isCritical ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.AlertTriangle, { className: "w-5 h-5 text-[var(--l-pass-error)]" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react9.Cross, { className: "w-5 h-5 text-[var(--l-pass-warning)]" }),
5919
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-center block text-xl font-bold", children: failedType === "config" ? "Configuration Error" : failedType === "critical" ? "Critical Error" : "Failed" })
5920
+ ] })
5870
5921
  }
5871
5922
  ),
5872
- failedType === "config" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "p-2 rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-info)]", children: [
5873
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "text-sm font-medium text-[var(--l-pass-info)] mb-2", children: "To fix this issue:" }),
5874
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("ul", { className: "text-xs text-[var(--l-pass-info)] text-left space-y-1 list-disc list-inside", children: [
5875
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "Contact your project administrator" }),
5876
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "Verify projectId is correctly configured" }),
5877
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "Check project metadata on the server" })
5923
+ failedType === "config" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "p-2 rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-info)]", children: [
5924
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-sm font-medium text-[var(--l-pass-info)] mb-2", children: "To fix this issue:" }),
5925
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { className: "text-xs text-[var(--l-pass-info)] text-left space-y-1 list-disc list-inside", children: [
5926
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Contact your project administrator" }),
5927
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Verify projectId is correctly configured" }),
5928
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Check project metadata on the server" })
5878
5929
  ] })
5879
5930
  ] }),
5880
- failedType === "critical" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "p-2 rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-error)] border", children: [
5881
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "text-sm font-semibold text-[var(--l-pass-error)] mb-2", children: "What to do next:" }),
5882
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("ul", { className: "text-xs text-[var(--l-pass-error)] text-left space-y-1 list-disc list-inside", children: [
5883
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "Contact support immediately" }),
5884
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "Provide your projectId and error details" }),
5885
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "You may need to create a new account" })
5931
+ failedType === "critical" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "p-2 rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-error)] border", children: [
5932
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-sm font-semibold text-[var(--l-pass-error)] mb-2", children: "What to do next:" }),
5933
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { className: "text-xs text-[var(--l-pass-error)] text-left space-y-1 list-disc list-inside", children: [
5934
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Contact support immediately" }),
5935
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Provide your projectId and error details" }),
5936
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "You may need to create a new account" })
5886
5937
  ] })
5887
5938
  ] }),
5888
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5939
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5889
5940
  Button,
5890
5941
  {
5891
5942
  size: "large",
5892
5943
  onClick: () => {
5893
5944
  setStep("signin");
5894
- setFailedMessage("");
5945
+ setAlert(null);
5895
5946
  setFailedType("general");
5896
5947
  setIsLoading(false);
5897
5948
  },
@@ -5904,19 +5955,19 @@ function AuthFailedStep() {
5904
5955
 
5905
5956
  // src/internal/components/AuthMenu/DisaplayNameStep/DisplayNameInput.tsx
5906
5957
  var import_lucide_react10 = require("lucide-react");
5907
- var import_react12 = require("react");
5958
+ var import_react13 = require("react");
5908
5959
  init_auth();
5909
5960
  init_profile();
5910
5961
 
5911
5962
  // src/internal/components/ui/input.tsx
5912
- var import_react11 = __toESM(require("react"), 1);
5913
- var import_jsx_runtime15 = require("react/jsx-runtime");
5914
- var Input = import_react11.default.forwardRef((props, ref) => {
5963
+ var import_react12 = __toESM(require("react"), 1);
5964
+ var import_jsx_runtime16 = require("react/jsx-runtime");
5965
+ var Input = import_react12.default.forwardRef((props, ref) => {
5915
5966
  const { className, disabled, error, Icon, element, ...inputProps } = props;
5916
- const internalRef = (0, import_react11.useRef)(null);
5917
- (0, import_react11.useImperativeHandle)(ref, () => internalRef.current);
5918
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("w-full flex flex-col gap-1", className), children: [
5919
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5967
+ const internalRef = (0, import_react12.useRef)(null);
5968
+ (0, import_react12.useImperativeHandle)(ref, () => internalRef.current);
5969
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cn("w-full flex flex-col gap-1", className), children: [
5970
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5920
5971
  "div",
5921
5972
  {
5922
5973
  className: cn(
@@ -5932,8 +5983,8 @@ var Input = import_react11.default.forwardRef((props, ref) => {
5932
5983
  internalRef.current?.focus();
5933
5984
  },
5934
5985
  children: [
5935
- Icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-none items-center justify-center w-6 h-6 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { width: 16, height: 16, className: "text-[var(--l-pass-fg)]" }) }),
5936
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5986
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex flex-none items-center justify-center w-6 h-6 p-1", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { width: 16, height: 16, className: "text-[var(--l-pass-fg)]" }) }),
5987
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5937
5988
  "input",
5938
5989
  {
5939
5990
  ref: internalRef,
@@ -5952,17 +6003,17 @@ var Input = import_react11.default.forwardRef((props, ref) => {
5952
6003
  ]
5953
6004
  }
5954
6005
  ),
5955
- !!error?.length && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "block text-[var(--l-pass-error)]", children: error })
6006
+ !!error?.length && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block text-[var(--l-pass-error)]", children: error })
5956
6007
  ] });
5957
6008
  });
5958
6009
  Input.displayName = "Input";
5959
6010
 
5960
6011
  // src/internal/components/AuthMenu/DisaplayNameStep/DisplayNameInput.tsx
5961
- var import_jsx_runtime16 = require("react/jsx-runtime");
6012
+ var import_jsx_runtime17 = require("react/jsx-runtime");
5962
6013
  var DisplayNameInput = ({ onComplete, onSkip }) => {
5963
- const [displayName, setDisplayName] = (0, import_react12.useState)("");
5964
- const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
5965
- const [error, setError] = (0, import_react12.useState)("");
6014
+ const [displayName, setDisplayName] = (0, import_react13.useState)("");
6015
+ const [isLoading, setIsLoading] = (0, import_react13.useState)(false);
6016
+ const [error, setError] = (0, import_react13.useState)("");
5966
6017
  const handleSubmit = async (e) => {
5967
6018
  e.preventDefault();
5968
6019
  if (!displayName.trim()) {
@@ -5986,14 +6037,14 @@ var DisplayNameInput = ({ onComplete, onSkip }) => {
5986
6037
  setIsLoading(false);
5987
6038
  }
5988
6039
  };
5989
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
5990
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
5991
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LumiaLogo, { size: 24, className: "w-6 h-6" }),
5992
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-bold text-xl leading-6", children: "What's your name?" })
6040
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
6041
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
6042
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LumiaLogo, { size: 24, className: "w-6 h-6" }),
6043
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-bold text-xl leading-6", children: "What's your name?" })
5993
6044
  ] }),
5994
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block w-full text-xs text-center", children: "This helps personalize your experience" }),
5995
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("form", { onSubmit: handleSubmit, className: "w-full flex flex-col gap-[var(--l-pass-pd)]", children: [
5996
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6045
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "block w-full text-xs text-center", children: "This helps personalize your experience" }),
6046
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("form", { onSubmit: handleSubmit, className: "w-full flex flex-col gap-[var(--l-pass-pd)]", children: [
6047
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5997
6048
  Input,
5998
6049
  {
5999
6050
  Icon: import_lucide_react10.User,
@@ -6010,8 +6061,8 @@ var DisplayNameInput = ({ onComplete, onSkip }) => {
6010
6061
  }
6011
6062
  }
6012
6063
  ),
6013
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w-full flex gap-[var(--l-pass-gap)]", children: [
6014
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6064
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w-full flex gap-[var(--l-pass-gap)]", children: [
6065
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6015
6066
  Button,
6016
6067
  {
6017
6068
  type: "submit",
@@ -6021,7 +6072,7 @@ var DisplayNameInput = ({ onComplete, onSkip }) => {
6021
6072
  children: isLoading ? "Saving..." : "Continue"
6022
6073
  }
6023
6074
  ),
6024
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6075
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6025
6076
  Button,
6026
6077
  {
6027
6078
  className: "flex-1 text-[var(--l-pass-fg-muted)]",
@@ -6039,17 +6090,16 @@ var DisplayNameInput = ({ onComplete, onSkip }) => {
6039
6090
  };
6040
6091
 
6041
6092
  // src/internal/components/AuthMenu/DisaplayNameStep/DisplayNameStep.tsx
6042
- var import_jsx_runtime17 = require("react/jsx-runtime");
6093
+ var import_jsx_runtime18 = require("react/jsx-runtime");
6043
6094
  function DisplayNameStep(props) {
6044
6095
  const { onAuthSuccess } = props;
6045
6096
  const setPage = useLayoutDataStore((st) => st.setPage);
6046
- const { setVerificationError, setStep, setEmail, setPasskeyError, setPasskeyStatus } = useAuthStore();
6097
+ const { setStep, setEmail, setPasskeyStatus, setAlert } = useAuthStore();
6047
6098
  const onSkip = async () => {
6048
6099
  setPage(null);
6049
6100
  setStep("signin");
6050
6101
  setEmail("");
6051
- setVerificationError("");
6052
- setPasskeyError("");
6102
+ setAlert(null);
6053
6103
  setPasskeyStatus("idle");
6054
6104
  await new Promise((resolve) => setTimeout(resolve, 250));
6055
6105
  if (onAuthSuccess) await onAuthSuccess();
@@ -6058,24 +6108,23 @@ function DisplayNameStep(props) {
6058
6108
  setPage(null);
6059
6109
  setStep("signin");
6060
6110
  setEmail("");
6061
- setVerificationError("");
6062
- setPasskeyError("");
6111
+ setAlert(null);
6063
6112
  setPasskeyStatus("idle");
6064
6113
  await new Promise((resolve) => setTimeout(resolve, 250));
6065
6114
  if (onAuthSuccess) await onAuthSuccess();
6066
6115
  };
6067
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DisplayNameInput, { onComplete, onSkip });
6116
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DisplayNameInput, { onComplete, onSkip });
6068
6117
  }
6069
6118
 
6070
6119
  // src/internal/components/AuthMenu/PassKeyStep.tsx
6071
6120
  var import_lucide_react11 = require("lucide-react");
6072
- var import_react14 = require("react");
6121
+ var import_react15 = require("react");
6073
6122
 
6074
6123
  // src/internal/assets/PasskeyAddIcon.tsx
6075
- var import_jsx_runtime18 = require("react/jsx-runtime");
6124
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6076
6125
  function PasskeyAddIcon(props) {
6077
6126
  const { width = "24", height = "24", className = "w-6 h-6", ...rest } = props;
6078
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6127
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6079
6128
  "svg",
6080
6129
  {
6081
6130
  ...rest,
@@ -6088,11 +6137,11 @@ function PasskeyAddIcon(props) {
6088
6137
  strokeLinejoin: "round",
6089
6138
  xmlns: "http://www.w3.org/2000/svg",
6090
6139
  children: [
6091
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" }),
6092
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "m21 2-9.6 9.6" }),
6093
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "7.5", cy: "15.5", r: "5.5" }),
6094
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M18 15v6" }),
6095
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M21 18h-6" })
6140
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" }),
6141
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "m21 2-9.6 9.6" }),
6142
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("circle", { cx: "7.5", cy: "15.5", r: "5.5" }),
6143
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "M18 15v6" }),
6144
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { d: "M21 18h-6" })
6096
6145
  ]
6097
6146
  }
6098
6147
  );
@@ -6102,16 +6151,16 @@ function PasskeyAddIcon(props) {
6102
6151
  init_auth();
6103
6152
 
6104
6153
  // src/internal/components/Expandable/hooks/useExpandable.ts
6105
- var import_react13 = require("react");
6154
+ var import_react14 = require("react");
6106
6155
  var useExpandable = (props) => {
6107
6156
  const { isExpanded = false, children, initHeight = 0, minHeight = 0 } = props;
6108
- const expandableRef = (0, import_react13.useRef)(null);
6109
- const contentRef = (0, import_react13.useRef)(null);
6110
- (0, import_react13.useEffect)(() => {
6157
+ const expandableRef = (0, import_react14.useRef)(null);
6158
+ const contentRef = (0, import_react14.useRef)(null);
6159
+ (0, import_react14.useEffect)(() => {
6111
6160
  if (!expandableRef.current) return;
6112
6161
  expandableRef.current.style.setProperty("--ifo-basic-expandable-h", `${initHeight}px )`);
6113
6162
  }, []);
6114
- const setExpandableHeight = (0, import_react13.useCallback)(
6163
+ const setExpandableHeight = (0, import_react14.useCallback)(
6115
6164
  (isExpnd) => {
6116
6165
  if (!contentRef.current || !expandableRef.current) return;
6117
6166
  expandableRef.current.style.setProperty(
@@ -6122,7 +6171,7 @@ var useExpandable = (props) => {
6122
6171
  // ON_RESIZE_DELEAY),
6123
6172
  [minHeight]
6124
6173
  );
6125
- (0, import_react13.useEffect)(() => {
6174
+ (0, import_react14.useEffect)(() => {
6126
6175
  if (!contentRef.current || !expandableRef.current) return;
6127
6176
  const obs = new ResizeObserver(() => setExpandableHeight(isExpanded));
6128
6177
  obs.observe(expandableRef.current);
@@ -6135,24 +6184,24 @@ var useExpandable = (props) => {
6135
6184
  };
6136
6185
 
6137
6186
  // src/internal/components/Expandable/Expandable.tsx
6138
- var import_jsx_runtime19 = require("react/jsx-runtime");
6187
+ var import_jsx_runtime20 = require("react/jsx-runtime");
6139
6188
  function Expandable(props) {
6140
6189
  const { children, className, contentClassName, minHeight, divProps } = props;
6141
6190
  const { expandableRef, contentRef } = useExpandable(props);
6142
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6191
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
6143
6192
  "div",
6144
6193
  {
6145
6194
  ...divProps,
6146
6195
  ref: expandableRef,
6147
6196
  className: cn("w-full overflow-y-hidden", className),
6148
6197
  style: { height: "var(--ifo-basic-expandable-h)", transition: "height 375ms ease" },
6149
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("w-full", contentClassName), ref: contentRef, style: minHeight ? { minHeight } : void 0, children })
6198
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("w-full", contentClassName), ref: contentRef, style: minHeight ? { minHeight } : void 0, children })
6150
6199
  }
6151
6200
  );
6152
6201
  }
6153
6202
 
6154
6203
  // src/internal/components/AuthMenu/PassKeyStep.tsx
6155
- var import_jsx_runtime20 = require("react/jsx-runtime");
6204
+ var import_jsx_runtime21 = require("react/jsx-runtime");
6156
6205
  function normalizeWebAuthnError(err) {
6157
6206
  const raw = err?.message || String(err || "");
6158
6207
  const lower = raw.toLowerCase();
@@ -6174,20 +6223,9 @@ function PassKeyStep(props) {
6174
6223
  const setPage = useLayoutDataStore((st) => st.setPage);
6175
6224
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
6176
6225
  const autoCloseOnSuccess = !recoveryUserId;
6177
- const {
6178
- passkeyError,
6179
- passkeyStatus,
6180
- setStep,
6181
- setPasskeyError,
6182
- setPasskeyStatus,
6183
- setAlert,
6184
- setEmail,
6185
- setVerificationError,
6186
- setFailedMessage,
6187
- setFailedType
6188
- } = useAuthStore();
6189
- const onPasskeyRegister = (0, import_react14.useCallback)(async () => {
6190
- setPasskeyError("");
6226
+ const { passkeyStatus, setStep, setPasskeyStatus, setAlert, setEmail, setFailedType } = useAuthStore();
6227
+ const onPasskeyRegister = (0, import_react15.useCallback)(async () => {
6228
+ setAlert(null);
6191
6229
  setPasskeyStatus("registering passkey...");
6192
6230
  setIsLoading(true);
6193
6231
  try {
@@ -6214,8 +6252,7 @@ function PassKeyStep(props) {
6214
6252
  if (onAuthSuccess) await onAuthSuccess();
6215
6253
  setStep("signin");
6216
6254
  setEmail("");
6217
- setVerificationError("");
6218
- setPasskeyError("");
6255
+ setAlert(null);
6219
6256
  setPasskeyStatus("idle");
6220
6257
  } else {
6221
6258
  setPasskeyStatus("Passkey registered successfully!");
@@ -6237,7 +6274,10 @@ function PassKeyStep(props) {
6237
6274
  message: "This passkey is already registered for your account. No need to register again!"
6238
6275
  });
6239
6276
  } else if (!normalized.benignCancel) {
6240
- setPasskeyError(errorMessage);
6277
+ setAlert({
6278
+ title: "Passkey Error",
6279
+ message: errorMessage
6280
+ });
6241
6281
  }
6242
6282
  if (!normalized.benignCancel) {
6243
6283
  try {
@@ -6253,8 +6293,8 @@ function PassKeyStep(props) {
6253
6293
  setIsLoading(false);
6254
6294
  }
6255
6295
  }, [onAuthSuccess, setPage, callbacks]);
6256
- const onPasskeyAuth = (0, import_react14.useCallback)(async () => {
6257
- setPasskeyError("");
6296
+ const onPasskeyAuth = (0, import_react15.useCallback)(async () => {
6297
+ setAlert(null);
6258
6298
  setPasskeyStatus("checking available passkeys...");
6259
6299
  setIsLoading(true);
6260
6300
  try {
@@ -6270,9 +6310,10 @@ function PassKeyStep(props) {
6270
6310
  pendingLoginResponseRef.current = result.loginResponse;
6271
6311
  const hasKeyshare = result.loginResponse.hasKeyshare ?? false;
6272
6312
  if (!hasKeyshare && result.loginResponse.isNewUser === void 0) {
6273
- setFailedMessage(
6274
- "The backend could not determine user status. This indicates you probably already have used the passkey and did not create required backups.\n Unfortunately, your wallet cannot be recovered. You need to create account using a different passkey."
6275
- );
6313
+ setAlert({
6314
+ title: "Configuration Error",
6315
+ message: "The backend could not determine user status. This indicates you probably already have used the passkey and did not create required backups.\n Unfortunately, your wallet cannot be recovered. You need to create account using a different passkey."
6316
+ });
6276
6317
  setFailedType("config");
6277
6318
  setStep("failed");
6278
6319
  setPasskeyStatus("idle");
@@ -6280,9 +6321,10 @@ function PassKeyStep(props) {
6280
6321
  return;
6281
6322
  }
6282
6323
  if (!hasKeyshare && result.loginResponse.isNewUser === false) {
6283
- setFailedMessage(
6284
- "Your account data has been lost on the server.\nThis should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered.\nYou will need to create a new account.\n\nPlease contact support immediately with this error."
6285
- );
6324
+ setAlert({
6325
+ title: "Data has been lost",
6326
+ message: "Your account data has been lost on the server.\nThis should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered.\nYou will need to create a new account.\n\nPlease contact support immediately with this error."
6327
+ });
6286
6328
  setFailedType("critical");
6287
6329
  setStep("failed");
6288
6330
  setPasskeyStatus("idle");
@@ -6303,7 +6345,10 @@ function PassKeyStep(props) {
6303
6345
  if (onAuthSuccess) await onAuthSuccess();
6304
6346
  } catch (authError) {
6305
6347
  if (authError?.message?.includes("User denied authorization")) {
6306
- setFailedMessage("Authorization cancelled");
6348
+ setAlert({
6349
+ title: "Authorization Cancelled",
6350
+ message: authError?.message || "You have cancelled the authorization process."
6351
+ });
6307
6352
  setStep("failed");
6308
6353
  setPasskeyStatus("idle");
6309
6354
  return;
@@ -6313,8 +6358,7 @@ function PassKeyStep(props) {
6313
6358
  if (autoCloseOnSuccess) {
6314
6359
  setStep("signin");
6315
6360
  setEmail("");
6316
- setVerificationError("");
6317
- setPasskeyError("");
6361
+ setAlert(null);
6318
6362
  setPasskeyStatus("idle");
6319
6363
  setPage(null);
6320
6364
  }
@@ -6322,7 +6366,10 @@ function PassKeyStep(props) {
6322
6366
  const normalized = normalizeWebAuthnError(e);
6323
6367
  const errorMessage = normalized.message || "Authentication failed";
6324
6368
  if (!normalized.benignCancel) {
6325
- setPasskeyError(errorMessage);
6369
+ setAlert({
6370
+ title: "Passkey Error",
6371
+ message: errorMessage
6372
+ });
6326
6373
  try {
6327
6374
  callbacks?.onLumiaPassportError?.({
6328
6375
  error: e instanceof Error ? e : new Error(errorMessage),
@@ -6337,11 +6384,11 @@ function PassKeyStep(props) {
6337
6384
  setIsLoading(false);
6338
6385
  }
6339
6386
  }, [onAuthSuccess, setPage, callbacks]);
6340
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
6341
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
6342
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react11.Key, { className: "w-6 h-6" }),
6343
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "font-bold text-xl leading-6", children: "Passkey" }),
6344
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6387
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
6388
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
6389
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.Key, { className: "w-6 h-6" }),
6390
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "font-bold text-xl leading-6", children: "Passkey" }),
6391
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
6345
6392
  Button,
6346
6393
  {
6347
6394
  style: { opacity: 0.5, transform: "translate(-4px, -4px)" },
@@ -6351,72 +6398,44 @@ function PassKeyStep(props) {
6351
6398
  className: "absolute left-0 top-0 w-5 h-5",
6352
6399
  onClick: () => setStep("signin"),
6353
6400
  children: [
6354
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react11.ArrowLeft, { className: "h-4 w-4" }),
6355
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: "Back to SignIn" })
6401
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.ArrowLeft, { className: "h-4 w-4" }),
6402
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "sr-only", children: "Back to SignIn" })
6356
6403
  ]
6357
6404
  }
6358
6405
  )
6359
6406
  ] }),
6360
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { variant: "default", size: "large", className: "w-full", onClick: onPasskeyAuth, disabled: isLoading, children: [
6361
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react11.Key, { className: "w-4 h-4" }),
6407
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Button, { variant: "default", size: "large", className: "w-full", onClick: onPasskeyAuth, disabled: isLoading, children: [
6408
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.Key, { className: "w-4 h-4" }),
6362
6409
  "Sign in with existing Passkey"
6363
6410
  ] }),
6364
- config.passkey.showCreateButton && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
6365
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block w-full text-center text-sm text-[var(--l-pass-fg-muted)]", children: "Don't have a passkey?" }),
6366
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Button, { variant: "outline", size: "large", className: "w-full", onClick: onPasskeyRegister, disabled: isLoading, children: [
6367
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PasskeyAddIcon, { className: "w-4 h-4" }),
6411
+ config.passkey.showCreateButton && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
6412
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "block w-full text-center text-sm text-[var(--l-pass-fg-muted)]", children: "Don't have a passkey?" }),
6413
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Button, { variant: "outline", size: "large", className: "w-full", onClick: onPasskeyRegister, disabled: isLoading, children: [
6414
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PasskeyAddIcon, { className: "w-4 h-4" }),
6368
6415
  "Create Passkey"
6369
6416
  ] })
6370
6417
  ] }),
6371
- passkeyError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full p-[var(--l-pass-pd)] rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-error)]", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-full block text-sm text-[var(--l-pass-error)] break-words whitespace-pre-wrap text-center", children: passkeyError }) }),
6372
- !passkeyError && passkeyStatus !== "idle" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full p-[var(--l-pass-pd)] rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-success)]", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-full block text-sm text-[var(--l-pass-success)] break-words whitespace-pre-wrap text-center", children: passkeyStatus }) })
6418
+ passkeyStatus !== "idle" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-full p-[var(--l-pass-pd)] rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-success)]", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w-full block text-sm text-[var(--l-pass-success)] break-words whitespace-pre-wrap text-center", children: passkeyStatus }) })
6373
6419
  ] });
6374
6420
  }
6375
6421
 
6376
6422
  // src/internal/components/AuthMenu/SignInStep/SignInStep.tsx
6377
- var import_lucide_react15 = require("lucide-react");
6378
- var import_react17 = require("react");
6423
+ var import_lucide_react14 = require("lucide-react");
6424
+ var import_react18 = require("react");
6379
6425
 
6380
6426
  // src/internal/components/AuthMenu/SignInStep/Email.tsx
6381
6427
  init_lumiaPassport();
6382
6428
  var import_react_query7 = require("@tanstack/react-query");
6383
6429
  var import_lucide_react12 = require("lucide-react");
6384
- var import_react15 = require("react");
6430
+ var import_react16 = require("react");
6385
6431
  init_projectId();
6386
-
6387
- // src/internal/components/ui/highlight.tsx
6388
- var import_jsx_runtime21 = require("react/jsx-runtime");
6389
- var CARD_STYLES = {
6390
- info: "text-[var(--l-pass-info)] bg-[var(--l-pass-bg-info)]",
6391
- success: "text-[var(--l-pass-success)] bg-[var(--l-pass-bg-success)]",
6392
- warning: "text-[var(--l-pass-warning)] bg-[var(--l-pass-bg-warning)]",
6393
- error: "text-[var(--l-pass-error)] bg-[var(--l-pass-bg-error)]"
6394
- };
6395
- function Highlight(props) {
6396
- const { type = "info", children, className } = props;
6397
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6398
- "div",
6399
- {
6400
- className: cn(
6401
- "w-full text-xs rounded-[var(--l-pass-el-bdrs)] p-[var(--l-pass-pd)]",
6402
- "whitespace-pre-line",
6403
- type === "error" ? "break-all" : "break-normal",
6404
- CARD_STYLES[type],
6405
- className
6406
- ),
6407
- children
6408
- }
6409
- );
6410
- }
6411
-
6412
- // src/internal/components/AuthMenu/SignInStep/Email.tsx
6413
6432
  var import_jsx_runtime22 = require("react/jsx-runtime");
6414
6433
  function Email() {
6415
6434
  const { config, callbacks } = useLumiaPassportConfig();
6416
- const buttonRef = (0, import_react15.useRef)(null);
6435
+ const buttonRef = (0, import_react16.useRef)(null);
6417
6436
  const isLoading = useLumiaPassportSession((st) => st.isLoading);
6418
6437
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
6419
- const { email, codeSendError, alert: alert2, setEmail, setCodeSendError, setExpiresIn, setStep, setAlert } = useAuthStore();
6438
+ const { email, alert: alert2, setEmail, setExpiresIn, setStep, setAlert } = useAuthStore();
6420
6439
  const { mutate: onSendVerificationCode } = (0, import_react_query7.useMutation)({
6421
6440
  mutationFn: async (mail) => {
6422
6441
  const isEmailValid = mail.length !== 0 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(mail);
@@ -6424,7 +6443,7 @@ function Email() {
6424
6443
  throw new Error("Invalid email format, please correct and try again.");
6425
6444
  }
6426
6445
  setIsLoading(true);
6427
- setCodeSendError("");
6446
+ setAlert(null);
6428
6447
  const apiUrl = addProjectIdToUrl(`${getServiceUrls().tssUrl}/api/auth/email/send-code`);
6429
6448
  return await fetch(apiUrl, {
6430
6449
  method: "POST",
@@ -6441,113 +6460,103 @@ function Email() {
6441
6460
  } else {
6442
6461
  if (response.status === 429) {
6443
6462
  const retryAfter = data.retryAfter || 60;
6444
- setCodeSendError(`Code already sent recently. Please wait ${retryAfter} seconds before requesting another.`);
6463
+ setAlert({
6464
+ title: "Code already sent recently (Too Many Requests)",
6465
+ message: `Please wait ${retryAfter} seconds before requesting another.`
6466
+ });
6445
6467
  } else if (response.status === 400) {
6446
- setCodeSendError(data.message || "Invalid email address");
6468
+ setAlert({
6469
+ title: "Failed to send verification code",
6470
+ message: data.message || "Unknown error occurred"
6471
+ });
6447
6472
  } else {
6448
- setCodeSendError(data.message || "Failed to send verification code");
6473
+ setAlert({
6474
+ title: "Failed to send verification code",
6475
+ message: data.message || "Unknown error occurred"
6476
+ });
6449
6477
  }
6450
6478
  }
6451
6479
  setIsLoading(false);
6452
6480
  },
6453
6481
  onError: (error) => {
6454
6482
  callbacks?.onLumiaPassportError?.({ error, message: error?.message || "" });
6455
- setCodeSendError(error?.message || "Network error. Please check your connection.");
6483
+ setAlert({
6484
+ title: "Failed to send verification code",
6485
+ message: error?.message || "Unknown error occurred"
6486
+ });
6456
6487
  setIsLoading(false);
6457
6488
  }
6458
6489
  });
6459
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: [
6460
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6461
- "div",
6462
- {
6463
- className: "w-full flex gap-[10px] items-center",
6464
- onKeyDown: (e) => {
6465
- if (e.key === "Enter" && !isLoading && email) {
6466
- buttonRef.current?.click();
6467
- }
6468
- },
6469
- children: [
6470
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6471
- Input,
6472
- {
6473
- name: "signin-email",
6474
- Icon: import_lucide_react12.Mail,
6475
- type: "email",
6476
- autoComplete: "off",
6477
- placeholder: config.current?.email?.placeholder || "Enter your email",
6478
- value: email,
6479
- disabled: isLoading,
6480
- className: "flex-1 w-full",
6481
- onChange: (e) => {
6482
- if (alert2) setAlert(null);
6483
- setEmail(e.target.value);
6484
- }
6485
- }
6486
- ),
6487
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6488
- Button,
6489
- {
6490
- ref: buttonRef,
6491
- className: "w-12 h-12 flex-none",
6492
- variant: "default",
6493
- size: "large",
6494
- disabled: !email || isLoading,
6495
- onClick: () => onSendVerificationCode(email),
6496
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.ChevronRight, { className: "w-4 h-4" })
6490
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6491
+ "div",
6492
+ {
6493
+ className: "w-full flex gap-[10px] items-center",
6494
+ onKeyDown: (e) => {
6495
+ if (e.key === "Enter" && !isLoading && email) {
6496
+ buttonRef.current?.click();
6497
+ }
6498
+ },
6499
+ children: [
6500
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6501
+ Input,
6502
+ {
6503
+ name: "signin-email",
6504
+ Icon: import_lucide_react12.Mail,
6505
+ type: "email",
6506
+ autoComplete: "off",
6507
+ placeholder: config.current?.email?.placeholder || "Enter your email",
6508
+ value: email,
6509
+ disabled: isLoading,
6510
+ className: "flex-1 w-full",
6511
+ onChange: (e) => {
6512
+ if (alert2) setAlert(null);
6513
+ setEmail(e.target.value);
6497
6514
  }
6498
- )
6499
- ]
6500
- }
6501
- ),
6502
- !!codeSendError && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--l-pass-gap)]", children: [
6503
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Mail, { className: "w-4 h-4" }),
6504
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: codeSendError })
6505
- ] })
6506
- ] });
6507
- }
6508
-
6509
- // src/internal/components/AuthMenu/SignInStep/ErrorAlert.tsx
6510
- var import_lucide_react13 = require("lucide-react");
6511
- var import_jsx_runtime23 = require("react/jsx-runtime");
6512
- function ErrorAlert(props) {
6513
- const { title, message } = props;
6514
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Highlight, { type: "error", className: "w-full flex gap-[var(--l-pass-gap)]", children: [
6515
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.AlertTriangle, { className: "w-5 h-5 text-[var(--l-pass-error)]" }),
6516
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full flex-1", children: [
6517
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block w-full font-bold", children: title }),
6518
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block w-full whitespace-pre-line", children: message })
6519
- ] })
6520
- ] });
6515
+ }
6516
+ ),
6517
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6518
+ Button,
6519
+ {
6520
+ ref: buttonRef,
6521
+ className: "w-12 h-12 flex-none",
6522
+ variant: "default",
6523
+ size: "large",
6524
+ disabled: !email || isLoading,
6525
+ onClick: () => onSendVerificationCode(email),
6526
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.ChevronRight, { className: "w-4 h-4" })
6527
+ }
6528
+ )
6529
+ ]
6530
+ }
6531
+ ) });
6521
6532
  }
6522
6533
 
6523
6534
  // src/internal/components/AuthMenu/SignInStep/Social.tsx
6524
- var import_lucide_react14 = require("lucide-react");
6525
- var import_react16 = require("react");
6535
+ var import_lucide_react13 = require("lucide-react");
6536
+ var import_react17 = require("react");
6526
6537
  init_assets();
6527
6538
  init_lumiaPassport();
6528
6539
  init_auth();
6529
6540
  init_projectId();
6530
6541
 
6531
6542
  // src/internal/components/AuthMenu/SignInStep/utils.ts
6532
- var POSSIBLE_SIGNIN_METHODS = [
6533
- "email",
6534
- "passkey",
6535
- "social"
6536
- // 'wallet'
6537
- ];
6543
+ var POSSIBLE_SIGNIN_METHODS = ["email", "passkey", "social", "wallet"];
6538
6544
  function getSignInEnabledMethods(params) {
6539
6545
  const { order, config, exclude } = params;
6540
6546
  const enabled = new Array(POSSIBLE_SIGNIN_METHODS.length).fill(null);
6547
+ const unordered = new Array(POSSIBLE_SIGNIN_METHODS.length).fill(null);
6541
6548
  POSSIBLE_SIGNIN_METHODS.forEach((sign) => {
6542
6549
  const orderedIdx = order.indexOf(sign);
6543
6550
  if (orderedIdx < 0) {
6544
- const unordered = config[sign]?.enabled ? sign : null;
6545
- enabled.push(unordered);
6551
+ unordered.push(config[sign]?.enabled ? sign : null);
6546
6552
  } else {
6547
6553
  enabled[orderedIdx] = config[sign]?.enabled ? sign : null;
6548
6554
  }
6549
6555
  });
6550
- return enabled.filter(Boolean).filter((s) => !exclude.includes(s));
6556
+ return [
6557
+ ...enabled.filter(Boolean).filter((s) => !exclude.includes(s)),
6558
+ ...unordered.filter(Boolean).filter((s) => !exclude.includes(s))
6559
+ ];
6551
6560
  }
6552
6561
  async function normalizeSocialLoginResponse(rawLoginResponse, providerKey, userData) {
6553
6562
  if (!rawLoginResponse) {
@@ -6587,7 +6596,7 @@ async function normalizeSocialLoginResponse(rawLoginResponse, providerKey, userD
6587
6596
  }
6588
6597
 
6589
6598
  // src/internal/components/AuthMenu/SignInStep/Social.tsx
6590
- var import_jsx_runtime24 = require("react/jsx-runtime");
6599
+ var import_jsx_runtime23 = require("react/jsx-runtime");
6591
6600
  var SUPPORTED_PROVIDERS = ["telegram", "x", "twitter"];
6592
6601
  var SOCIAL_ICONS = {
6593
6602
  google: GoogleIcon,
@@ -6695,18 +6704,8 @@ function Social(props) {
6695
6704
  const { config, callbacks } = useLumiaPassportConfig();
6696
6705
  const isLoading = useLumiaPassportSession((st) => st.isLoading);
6697
6706
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
6698
- const {
6699
- alert: alert2,
6700
- setStep,
6701
- setEmail,
6702
- setVerificationError,
6703
- setFailedType,
6704
- setAlert,
6705
- setFailedMessage,
6706
- setPasskeyError,
6707
- setPasskeyStatus
6708
- } = useAuthStore();
6709
- const onSocialAuth = (0, import_react16.useCallback)(
6707
+ const { alert: alert2, setStep, setEmail, setFailedType, setAlert, setPasskeyStatus } = useAuthStore();
6708
+ const onSocialAuth = (0, import_react17.useCallback)(
6710
6709
  async (providerId) => {
6711
6710
  const normalizedProviderId = providerId.toLowerCase();
6712
6711
  const provider = config.current?.social?.providers?.find(
@@ -6760,9 +6759,10 @@ function Social(props) {
6760
6759
  loginResponse2.hasKeyshare = false;
6761
6760
  loginResponse2.isNewUser = false;
6762
6761
  } else {
6763
- setFailedMessage(
6764
- "The backend could not determine user status. This indicates that your projectId is not properly configured or the project metadata is missing.\n\nPlease contact support with your projectId to resolve this issue."
6765
- );
6762
+ setAlert({
6763
+ title: "Configuration Error",
6764
+ message: "The backend could not determine user status. This indicates that your projectId is not properly configured or the project metadata is missing.\n\nPlease contact support with your projectId to resolve this issue."
6765
+ });
6766
6766
  setFailedType("config");
6767
6767
  setStep("failed");
6768
6768
  setIsLoading(false);
@@ -6771,9 +6771,10 @@ function Social(props) {
6771
6771
  }
6772
6772
  }
6773
6773
  if (loginResponse2.hasKeyshare === false && loginResponse2.isNewUser === false && providerKey !== "x") {
6774
- setFailedMessage(
6775
- "Your account data has been lost on the server.\nThis should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered.\nYou will need to create a new account.\n\nPlease contact support immediately with this error."
6776
- );
6774
+ setAlert({
6775
+ title: "Account Data Lost",
6776
+ message: "Your account data has been lost on the server. This should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered. You will need to create a new account.\n\nPlease contact support immediately with this error."
6777
+ });
6777
6778
  setFailedType("critical");
6778
6779
  setStep("failed");
6779
6780
  setIsLoading(false);
@@ -6823,16 +6824,14 @@ function Social(props) {
6823
6824
  onAuthSuccess?.();
6824
6825
  setStep("signin");
6825
6826
  setEmail("");
6826
- setVerificationError("");
6827
- setPasskeyError("");
6827
+ setAlert(null);
6828
6828
  setPasskeyStatus("idle");
6829
6829
  setIsLoading(false);
6830
6830
  } else {
6831
6831
  onAuthSuccess?.();
6832
6832
  setStep("signin");
6833
6833
  setEmail("");
6834
- setVerificationError("");
6835
- setPasskeyError("");
6834
+ setAlert(null);
6836
6835
  setPasskeyStatus("idle");
6837
6836
  setIsLoading(false);
6838
6837
  }
@@ -6922,13 +6921,13 @@ function Social(props) {
6922
6921
  );
6923
6922
  const isPasskey = config.current?.passkey?.enabled;
6924
6923
  const gridCols = (config.current?.social?.gridColumns || 1) + (isPasskey ? 1 : 0);
6925
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6924
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6926
6925
  "div",
6927
6926
  {
6928
6927
  className: "grid gap-[var(--l-pass-gap)]",
6929
6928
  style: { gridTemplateColumns: `repeat(${gridCols}, minmax(0, 1fr))` },
6930
6929
  children: [
6931
- isPasskey && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6930
+ isPasskey && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6932
6931
  Button,
6933
6932
  {
6934
6933
  variant: "outline",
@@ -6940,7 +6939,7 @@ function Social(props) {
6940
6939
  },
6941
6940
  disabled: isLoading,
6942
6941
  title: "Passkey",
6943
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react14.Key, { className: "w-5 h-5" })
6942
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react13.Key, { className: "w-5 h-5" })
6944
6943
  }
6945
6944
  ),
6946
6945
  config.current?.social?.providers.filter((provider) => provider.enabled).map((provider) => {
@@ -6948,7 +6947,7 @@ function Social(props) {
6948
6947
  const isSupported = SUPPORTED_PROVIDERS.includes(providerId);
6949
6948
  const IconComponent = config.current?.ui?.useExternalIcons ? provider.icon : SOCIAL_ICONS[providerId];
6950
6949
  const handleClick = isSupported ? () => onSocialAuth(providerId) : () => setAlert({ title: "Coming Soon", message: `${provider.name} authentication is coming soon!` });
6951
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6950
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6952
6951
  Button,
6953
6952
  {
6954
6953
  variant: "outline",
@@ -6960,7 +6959,7 @@ function Social(props) {
6960
6959
  },
6961
6960
  disabled: isLoading,
6962
6961
  title: provider.comingSoon ? `${provider.name} (Coming Soon)` : provider.name,
6963
- children: IconComponent ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconComponent, { className: "w-5 h-5" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-lg font-bold", children: provider.name.slice(0, 1).toUpperCase() })
6962
+ children: IconComponent ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconComponent, { className: "w-5 h-5" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-lg font-bold", children: provider.name.slice(0, 1).toUpperCase() })
6964
6963
  },
6965
6964
  provider.id
6966
6965
  );
@@ -6970,12 +6969,35 @@ function Social(props) {
6970
6969
  );
6971
6970
  }
6972
6971
 
6972
+ // src/internal/components/AuthMenu/SignInStep/Wallet.tsx
6973
+ var import_jsx_runtime24 = require("react/jsx-runtime");
6974
+ function Wallet() {
6975
+ const setAlert = useAuthStore((st) => st.setAlert);
6976
+ const setIsWalletLinking = useLayoutDataStore((st) => st.setIsWalletLinking);
6977
+ const Icon = PROVIDERS_META2.wallet.icon;
6978
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6979
+ Button,
6980
+ {
6981
+ size: "large",
6982
+ variant: "outline",
6983
+ className: "w-full",
6984
+ onClick: () => {
6985
+ setAlert(null);
6986
+ setIsWalletLinking(true);
6987
+ },
6988
+ children: [
6989
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { className: "w-5 h-5" }),
6990
+ "Wallet"
6991
+ ]
6992
+ }
6993
+ );
6994
+ }
6995
+
6973
6996
  // src/internal/components/AuthMenu/SignInStep/SignInStep.tsx
6974
6997
  var import_jsx_runtime25 = require("react/jsx-runtime");
6975
6998
  function SignInStep(props) {
6976
6999
  const { pendingLoginResponseRef, onAuthSuccess, checkDisplayNameRequired } = props;
6977
7000
  const { config } = useLumiaPassportConfig();
6978
- const alert2 = useAuthStore((st) => st.alert);
6979
7001
  const setPage = useLayoutDataStore((st) => st.setPage);
6980
7002
  const enabledWoPasskey = getSignInEnabledMethods({
6981
7003
  config: config.current,
@@ -6991,24 +7013,22 @@ function SignInStep(props) {
6991
7013
  onAuthSuccess,
6992
7014
  checkDisplayNameRequired
6993
7015
  }
6994
- )
7016
+ ),
7017
+ wallet: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Wallet, {})
6995
7018
  };
6996
7019
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
6997
7020
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
6998
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react15.UserCircle, { className: "w-6 h-6" }),
7021
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.UserCircle, { className: "w-6 h-6" }),
6999
7022
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-bold text-xl leading-6", children: "Sign In" })
7000
7023
  ] }),
7001
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: [
7002
- enabledWoPasskey.map((kind, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react17.Fragment, { children: [
7003
- idx > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center", children: [
7004
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { borderTop: "1px solid var(--l-pass-bd)" }, className: "flex-1" }),
7005
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-none px-2 text-xs leading-4", children: "Or sign in using" }),
7006
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { borderTop: "1px solid var(--l-pass-bd)" }, className: "flex-1" })
7007
- ] }, `auth-method-${kind}-${idx}`),
7008
- signInMethods[kind]
7009
- ] }, `fragment-${idx}`)),
7010
- !!alert2 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ErrorAlert, { title: alert2.title, message: alert2.message })
7011
- ] }),
7024
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: enabledWoPasskey.map((kind, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react18.Fragment, { children: [
7025
+ idx > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center", children: [
7026
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { borderTop: "1px solid var(--l-pass-bd)" }, className: "flex-1" }),
7027
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-none px-2 text-xs leading-4", children: "Or" }),
7028
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { style: { borderTop: "1px solid var(--l-pass-bd)" }, className: "flex-1" })
7029
+ ] }, `auth-method-${kind}-${idx}`),
7030
+ signInMethods[kind]
7031
+ ] }, `fragment-${idx}`)) }),
7012
7032
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full flex items-center gap-2 justify-center", children: [
7013
7033
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-[10px] font-medium", children: "By signing in, you agree to the" }),
7014
7034
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
@@ -7027,17 +7047,18 @@ function SignInStep(props) {
7027
7047
 
7028
7048
  // src/internal/components/AuthMenu/useAuthMenuHanders.ts
7029
7049
  var import_react_query8 = require("@tanstack/react-query");
7030
- var import_react18 = require("react");
7050
+ var import_react19 = require("react");
7031
7051
  init_auth();
7032
7052
  function useAuthMenuHandlers() {
7033
7053
  const { config, callbacks } = useLumiaPassportConfig();
7034
7054
  const qc = (0, import_react_query8.useQueryClient)();
7035
- const pendingLoginResponseRef = (0, import_react18.useRef)(null);
7055
+ const pendingLoginResponseRef = (0, import_react19.useRef)(null);
7036
7056
  const setPage = useLayoutDataStore((st) => st.setPage);
7037
- const [telegramCleanup, setTelegramCleanup] = (0, import_react18.useState)(null);
7057
+ const [telegramCleanup, setTelegramCleanup] = (0, import_react19.useState)(null);
7038
7058
  const { usePaymaster, setError, setStatus, setSession, setAddress, setRecoveryUserId, setHasServerVault } = useLumiaPassportSession();
7039
- const { setStep, setVerificationError, setCodeSendError, setFailedMessage } = useAuthStore();
7040
- const createSessionWithKeyshare = (0, import_react18.useCallback)(
7059
+ const setStep = useAuthStore((st) => st.setStep);
7060
+ const setAlert = useAuthStore((st) => st.setAlert);
7061
+ const createSessionWithKeyshare = (0, import_react19.useCallback)(
7041
7062
  async (userId, hasServerKeyshare, isNewUser) => {
7042
7063
  try {
7043
7064
  try {
@@ -7071,7 +7092,7 @@ function useAuthMenuHandlers() {
7071
7092
  },
7072
7093
  [setStatus, callbacks, usePaymaster]
7073
7094
  );
7074
- const onAuthSuccess = (0, import_react18.useCallback)(async () => {
7095
+ const onAuthSuccess = (0, import_react19.useCallback)(async () => {
7075
7096
  const loginResponse = pendingLoginResponseRef.current;
7076
7097
  if (!loginResponse || !loginResponse.userId) {
7077
7098
  setError("Authentication failed - no login data available");
@@ -7099,7 +7120,7 @@ function useAuthMenuHandlers() {
7099
7120
  jwt?.isNewUser
7100
7121
  );
7101
7122
  setError(null);
7102
- setFailedMessage(null);
7123
+ setAlert(null);
7103
7124
  setSession(sess);
7104
7125
  setAddress(addr);
7105
7126
  setStatus("ready");
@@ -7137,7 +7158,10 @@ function useAuthMenuHandlers() {
7137
7158
  await import_auth3.jwtTokenManager.clearTokens();
7138
7159
  setStatus("error");
7139
7160
  setError(error?.message || String(error));
7140
- setFailedMessage("Authorization cancelled");
7161
+ setAlert({
7162
+ title: "Authorization cancelled",
7163
+ message: error?.message || String(error) || "An unknown error occurred during authentication."
7164
+ });
7141
7165
  setStep("failed");
7142
7166
  }
7143
7167
  }
@@ -7149,12 +7173,13 @@ function useAuthMenuHandlers() {
7149
7173
  setError,
7150
7174
  setStatus,
7151
7175
  setSession,
7176
+ setAlert,
7152
7177
  setAddress,
7153
7178
  setRecoveryUserId,
7154
7179
  setHasServerVault,
7155
7180
  createSessionWithKeyshare
7156
7181
  ]);
7157
- const checkDisplayNameRequired = (0, import_react18.useCallback)(async (loginResponse) => {
7182
+ const checkDisplayNameRequired = (0, import_react19.useCallback)(async (loginResponse) => {
7158
7183
  if (!config.current?.features?.displayNameNeeded) {
7159
7184
  return false;
7160
7185
  }
@@ -7178,15 +7203,14 @@ function useAuthMenuHandlers() {
7178
7203
  return false;
7179
7204
  }
7180
7205
  }, []);
7181
- const goBackToSignIn = (0, import_react18.useCallback)(() => {
7206
+ const goBackToSignIn = (0, import_react19.useCallback)(() => {
7182
7207
  setStep("signin");
7183
- setVerificationError("");
7184
- setCodeSendError("");
7208
+ setAlert(null);
7185
7209
  if (telegramCleanup) {
7186
7210
  telegramCleanup();
7187
7211
  setTelegramCleanup(null);
7188
7212
  }
7189
- }, [setStep, setVerificationError, setCodeSendError, telegramCleanup]);
7213
+ }, [setStep, setAlert, telegramCleanup]);
7190
7214
  return {
7191
7215
  pendingLoginResponseRef,
7192
7216
  onAuthSuccess,
@@ -7195,39 +7219,10 @@ function useAuthMenuHandlers() {
7195
7219
  };
7196
7220
  }
7197
7221
 
7198
- // src/internal/components/AuthMenu/useListenIframeAuthEvents.ts
7199
- var import_react19 = require("react");
7200
- function useListenIframeAuthEvents() {
7201
- const setPage = useLayoutDataStore((state) => state.setPage);
7202
- const setIsIframeReady = useLumiaPassportSession((state) => state.setIsIframeReady);
7203
- const handleIframeMessage = (0, import_react19.useCallback)(
7204
- (event) => {
7205
- console.log("[AuthMenu] Received iframe message:", event.data);
7206
- if (event.data?.type === "LUMIA_PASSPORT_IFRAME_READY") {
7207
- console.log("[AuthMenu] Iframe is ready");
7208
- setIsIframeReady(true);
7209
- } else if (event.data?.type === "LUMIA_PASSPORT_SHOW_IFRAME") {
7210
- console.log("[AuthMenu] Consent screen shown - hiding auth modal");
7211
- setPage(null);
7212
- } else if (event.data?.type === "LUMIA_PASSPORT_HIDE_IFRAME") {
7213
- console.log("[AuthMenu] Consent screen hidden");
7214
- } else if (event.data?.type === "KEYSHARE_RECOVERY_NEEDED") {
7215
- console.log("[AuthMenu] recovery neede");
7216
- setPage("keyshare-restore" /* KEYSHARE_RESTORE */);
7217
- }
7218
- },
7219
- [setPage, setIsIframeReady]
7220
- );
7221
- (0, import_react19.useEffect)(() => {
7222
- window.addEventListener("message", handleIframeMessage);
7223
- return () => window.removeEventListener("message", handleIframeMessage);
7224
- }, [handleIframeMessage]);
7225
- }
7226
-
7227
7222
  // src/internal/components/AuthMenu/VerifyStep/VerifyStep.tsx
7228
7223
  init_lumiaPassport();
7229
7224
  var import_react_query9 = require("@tanstack/react-query");
7230
- var import_lucide_react16 = require("lucide-react");
7225
+ var import_lucide_react15 = require("lucide-react");
7231
7226
 
7232
7227
  // src/internal/assets/OtpIcon.tsx
7233
7228
  var import_jsx_runtime26 = require("react/jsx-runtime");
@@ -7250,8 +7245,8 @@ init_projectId();
7250
7245
  var import_react20 = require("react");
7251
7246
  var import_jsx_runtime27 = require("react/jsx-runtime");
7252
7247
  var VerificationCodeInput = (props) => {
7253
- const { onVerifyCode, onResendCode, isLoading, expiresIn, error } = props;
7254
- const setVerificationError = useAuthStore((st) => st.setVerificationError);
7248
+ const { onVerifyCode, onResendCode, isLoading, expiresIn } = props;
7249
+ const setAlert = useAuthStore((st) => st.setAlert);
7255
7250
  const [timeLeft, setTimeLeft] = (0, import_react20.useState)(expiresIn);
7256
7251
  (0, import_react20.useEffect)(() => setTimeLeft(expiresIn), [expiresIn]);
7257
7252
  (0, import_react20.useEffect)(() => {
@@ -7347,7 +7342,6 @@ var VerificationCodeInput = (props) => {
7347
7342
  },
7348
7343
  i
7349
7344
  )) }),
7350
- error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-full bg-[var(--l-pass-bg-error)] p-[var(--l-pass-pd)] rounded-[var(--l-pass-el-bdrs)]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "w-full block text-sm text-[var(--l-pass-error)] break-words whitespace-pre-wrap text-center", children: error }) }),
7351
7345
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "text-xs", children: [
7352
7346
  "Code expires in ",
7353
7347
  mm,
@@ -7365,8 +7359,8 @@ var VerificationCodeInput = (props) => {
7365
7359
  className: "text-xs h-fit px-0 leading-4 text-[var(--l-pass-fg-muted)] underline underline-offset-4",
7366
7360
  onClick: () => {
7367
7361
  if (!timeLeft) return onResendCode();
7368
- setVerificationError("Please wait until the current code expires to resend.");
7369
- setTimeout(() => setVerificationError(""), 3e3);
7362
+ setAlert({ title: "Please wait", message: "Please wait until the current code expires to resend." });
7363
+ setTimeout(() => setAlert(null), 3e3);
7370
7364
  },
7371
7365
  children: "Resend"
7372
7366
  }
@@ -7387,18 +7381,16 @@ function VerifyStep(props) {
7387
7381
  const {
7388
7382
  email,
7389
7383
  expiresIn,
7390
- verificationError,
7391
- setVerificationError,
7392
- setFailedMessage,
7393
7384
  setFailedType,
7394
7385
  setStep,
7395
7386
  setEmail,
7396
- setExpiresIn
7387
+ setExpiresIn,
7388
+ setAlert
7397
7389
  } = useAuthStore();
7398
7390
  const { mutate: onVerifyCode, isPending: isCodeVerifying } = (0, import_react_query9.useMutation)({
7399
7391
  mutationFn: async (code) => {
7400
7392
  setIsLoading(true);
7401
- setVerificationError("");
7393
+ setAlert(null);
7402
7394
  const { loginWithEmail: loginWithEmail2 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
7403
7395
  const loginResponse = await loginWithEmail2(email, code, { skipTokenSave: true });
7404
7396
  pendingLoginResponseRef.current = loginResponse;
@@ -7406,9 +7398,10 @@ function VerifyStep(props) {
7406
7398
  },
7407
7399
  onSuccess: async (loginResponse) => {
7408
7400
  if (!loginResponse.hasKeyshare && loginResponse.isNewUser === void 0) {
7409
- setFailedMessage(
7410
- "The backend could not determine user status. This indicates that your projectId is not properly configured or the project metadata is missing.\n\nPlease contact support with your projectId to resolve this issue."
7411
- );
7401
+ setAlert({
7402
+ title: "Configuration Error",
7403
+ message: "The backend could not determine user status. This indicates that your projectId is not properly configured or the project metadata is missing.\n\nPlease contact support with your projectId to resolve this issue."
7404
+ });
7412
7405
  setFailedType("config");
7413
7406
  setStep("failed");
7414
7407
  pendingLoginResponseRef.current = null;
@@ -7416,9 +7409,10 @@ function VerifyStep(props) {
7416
7409
  return;
7417
7410
  }
7418
7411
  if (!loginResponse.hasKeyshare && loginResponse.isNewUser === false) {
7419
- setFailedMessage(
7420
- "Your account data has been lost on the server.\nThis should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered.\nYou will need to create a new account.\n\nPlease contact support immediately with this error."
7421
- );
7412
+ setAlert({
7413
+ title: "Account Data Lost",
7414
+ message: "Your account data has been lost on the server. This should never happen and indicates a serious system failure.\n\nUnfortunately, your wallet cannot be recovered. You will need to create a new account.\n\nPlease contact support immediately with this error."
7415
+ });
7422
7416
  setFailedType("critical");
7423
7417
  setStep("failed");
7424
7418
  pendingLoginResponseRef.current = null;
@@ -7444,7 +7438,7 @@ function VerifyStep(props) {
7444
7438
  if (!recoveryUserId && !needsRecovery) {
7445
7439
  setStep("signin");
7446
7440
  setEmail("");
7447
- setVerificationError("");
7441
+ setAlert(null);
7448
7442
  setPage(null);
7449
7443
  }
7450
7444
  setIsLoading(false);
@@ -7460,7 +7454,10 @@ function VerifyStep(props) {
7460
7454
  } else {
7461
7455
  errorMessage = error.message || "Verification failed. Please try again.";
7462
7456
  }
7463
- setVerificationError(errorMessage);
7457
+ setAlert({
7458
+ title: "Verification failed",
7459
+ message: errorMessage
7460
+ });
7464
7461
  callbacks?.onLumiaPassportError?.({
7465
7462
  error: error instanceof Error ? error : new Error(errorMessage),
7466
7463
  message: errorMessage
@@ -7470,7 +7467,7 @@ function VerifyStep(props) {
7470
7467
  });
7471
7468
  const { mutate: onResendCode, isPending: isCodeResending } = (0, import_react_query9.useMutation)({
7472
7469
  mutationFn: async () => {
7473
- setVerificationError("");
7470
+ setAlert(null);
7474
7471
  setIsLoading(true);
7475
7472
  const response = await fetch(addProjectIdToUrl(`${getServiceUrls().tssUrl}/api/auth/email/send-code`), {
7476
7473
  method: "POST",
@@ -7486,17 +7483,24 @@ function VerifyStep(props) {
7486
7483
  setExpiresIn(data.expiresIn || 300);
7487
7484
  }
7488
7485
  if (!response.ok && response.status === 429) {
7489
- setVerificationError(
7490
- `Code already sent recently. Please wait ${data.retryAfter || 60} seconds before requesting another.`
7491
- );
7486
+ setAlert({
7487
+ title: "Code already sent recently (Too Many Requests)",
7488
+ message: `Please wait ${data.retryAfter || 60} seconds before requesting another.`
7489
+ });
7492
7490
  }
7493
7491
  if (!response.ok && response.status !== 429) {
7494
- setVerificationError(data.message || "Failed to resend verification code");
7492
+ setAlert({
7493
+ title: "Failed to resend verification code",
7494
+ message: data.message || "Unknown error occurred"
7495
+ });
7495
7496
  }
7496
7497
  setIsLoading(false);
7497
7498
  },
7498
7499
  onError: (err) => {
7499
- setVerificationError(err.message || "Network error. Please check your connection.");
7500
+ setAlert({
7501
+ title: "Failed to resend verification code",
7502
+ message: err.message || "Unknown error occurred"
7503
+ });
7500
7504
  setIsLoading(false);
7501
7505
  }
7502
7506
  });
@@ -7505,7 +7509,7 @@ function VerifyStep(props) {
7505
7509
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
7506
7510
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(OtpIcon, { className: "w-6 h-6" }),
7507
7511
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-bold text-xl leading-6", children: "Verification code" }),
7508
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Loader, { className: "h-4 w-4 animate-spin" }),
7512
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react15.Loader, { className: "h-4 w-4 animate-spin" }),
7509
7513
  /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
7510
7514
  Button,
7511
7515
  {
@@ -7517,7 +7521,7 @@ function VerifyStep(props) {
7517
7521
  className: "absolute left-0 top-0 w-5 h-5",
7518
7522
  onClick: goBackToSignIn,
7519
7523
  children: [
7520
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.ArrowLeft, { className: "h-4 w-4" }),
7524
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react15.ArrowLeft, { className: "h-4 w-4" }),
7521
7525
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "sr-only", children: "Back to SignIn" })
7522
7526
  ]
7523
7527
  }
@@ -7533,8 +7537,7 @@ function VerifyStep(props) {
7533
7537
  onVerifyCode,
7534
7538
  onResendCode,
7535
7539
  isLoading,
7536
- expiresIn,
7537
- error: verificationError
7540
+ expiresIn
7538
7541
  }
7539
7542
  )
7540
7543
  ] });
@@ -7544,35 +7547,21 @@ function VerifyStep(props) {
7544
7547
  var import_jsx_runtime29 = require("react/jsx-runtime");
7545
7548
  var AuthMenu = () => {
7546
7549
  const isIframeReady = useLumiaPassportSession((st) => st.isIframeReady);
7547
- const page = useLayoutDataStore((st) => st.page);
7548
7550
  const setMainPageHeight = useLayoutDataStore((st) => st.setMainPageHeight);
7549
- (0, import_react21.useEffect)(() => setMainPageHeight(DEFAULT_AUTH_MENU_HEIGHT), [setMainPageHeight]);
7550
- const {
7551
- step,
7552
- setStep,
7553
- setPasskeyError,
7554
- setPasskeyStatus,
7555
- setEmail,
7556
- setVerificationError,
7557
- setFailedMessage,
7558
- setCodeSendError
7559
- } = useAuthStore();
7551
+ const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setAlert } = useAuthStore();
7552
+ (0, import_react21.useEffect)(() => setMainPageHeight(DEFAULT_AUTH_MENU_HEIGHT), []);
7560
7553
  (0, import_react21.useEffect)(() => {
7561
- if (page !== "auth" /* AUTH */) {
7554
+ return () => {
7562
7555
  setStep("signin");
7563
7556
  setEmail("");
7564
- setVerificationError("");
7565
- setCodeSendError("");
7566
- setPasskeyError("");
7567
7557
  setPasskeyStatus("idle");
7568
- setFailedMessage("");
7569
- }
7570
- }, [page]);
7571
- useListenIframeAuthEvents();
7558
+ setAlert(null);
7559
+ };
7560
+ }, []);
7572
7561
  const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn, checkDisplayNameRequired } = useAuthMenuHandlers();
7573
7562
  if (!isIframeReady) {
7574
7563
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "w-full p-8 flex flex-col justify-center items-center gap-[var(--l-pass-gap)]", children: [
7575
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.Loader, { className: "w-5 h-5 animate-spin" }),
7564
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react16.Loader, { className: "w-5 h-5 animate-spin" }),
7576
7565
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-sm text-[var(--l-pass-fg-muted)]", children: "Initializing wallet..." })
7577
7566
  ] });
7578
7567
  }
@@ -7608,25 +7597,32 @@ var AuthMenu = () => {
7608
7597
  }),
7609
7598
  [onAuthSuccess, goBackToSignIn, checkDisplayNameRequired]
7610
7599
  );
7611
- return (
7612
- // simple wrap by div
7613
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_framer_motion.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7614
- import_framer_motion.motion.div,
7615
- {
7616
- initial: { opacity: 0, height: DEFAULT_AUTH_MENU_HEIGHT },
7617
- animate: { opacity: 1, height: "auto" },
7618
- exit: { opacity: 0, height: DEFAULT_AUTH_MENU_HEIGHT },
7619
- style: { overflow: "hidden" },
7620
- transition: Y_ANIMATION_SETUP,
7621
- children: stepContent[step]
7622
- },
7623
- step
7624
- ) }) })
7625
- );
7600
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_framer_motion.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
7601
+ import_framer_motion.motion.div,
7602
+ {
7603
+ initial: { opacity: 0, height: DEFAULT_AUTH_MENU_HEIGHT },
7604
+ animate: { opacity: 1, height: "auto" },
7605
+ exit: { opacity: 0, height: DEFAULT_AUTH_MENU_HEIGHT },
7606
+ style: { overflow: "hidden" },
7607
+ transition: Y_ANIMATION_SETUP,
7608
+ children: [
7609
+ stepContent[step],
7610
+ !!alert2 && // <Expandable isExpanded contentClassName="px-[var(--l-pass-pd)]">
7611
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Highlight, { type: "error", className: "w-full flex gap-[var(--l-pass-gap)]", children: [
7612
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react16.AlertTriangle, { className: "w-5 h-5 text-[var(--l-pass-error)]" }),
7613
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "block w-full flex flex-col gap-1 flex-1", children: [
7614
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "block font-bold leading-5", children: alert2.title }),
7615
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "block whitespace-pre-line", children: alert2.message })
7616
+ ] })
7617
+ ] })
7618
+ ]
7619
+ },
7620
+ step
7621
+ ) }) });
7626
7622
  };
7627
7623
 
7628
7624
  // src/internal/components/BuyMenu/ByuMenu.tsx
7629
- var import_lucide_react20 = require("lucide-react");
7625
+ var import_lucide_react19 = require("lucide-react");
7630
7626
 
7631
7627
  // src/internal/components/BuyMenu/assets/BinanceIcon.tsx
7632
7628
  var import_jsx_runtime30 = require("react/jsx-runtime");
@@ -7723,7 +7719,7 @@ function RampnowIcon() {
7723
7719
 
7724
7720
  // src/internal/components/BuyMenu/binance/Binance.tsx
7725
7721
  var import_react_query10 = require("@tanstack/react-query");
7726
- var import_lucide_react18 = require("lucide-react");
7722
+ var import_lucide_react17 = require("lucide-react");
7727
7723
  var import_react23 = require("react");
7728
7724
 
7729
7725
  // src/internal/components/BuyMenu/components/PaymentSelector.tsx
@@ -7958,7 +7954,7 @@ function Binance(props) {
7958
7954
  Input,
7959
7955
  {
7960
7956
  ref: inputRef,
7961
- Icon: import_lucide_react18.DollarSign,
7957
+ Icon: import_lucide_react17.DollarSign,
7962
7958
  name: "binance-onramp-input",
7963
7959
  disabled: isLoading,
7964
7960
  autoComplete: "off",
@@ -7971,7 +7967,7 @@ function Binance(props) {
7971
7967
  ),
7972
7968
  localError && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Highlight, { type: "error", children: localError }),
7973
7969
  !localError && ((receiveLumiaAmount || 0) > 0 || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("flex justify-between gap-4 mt-2 text-sm leading-4", { "opacity-60": srcInputAmount <= 0 }), children: [
7974
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react18.LoaderIcon, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-[var(--l-pass-fg-muted)]", children: "You receive:" }),
7970
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.LoaderIcon, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-[var(--l-pass-fg-muted)]", children: "You receive:" }),
7975
7971
  (receiveLumiaAmount || 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: `${receiveLumiaAmount || 0} LUMIA` })
7976
7972
  ] }),
7977
7973
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
@@ -7995,7 +7991,7 @@ function Binance(props) {
7995
7991
  variant: "default",
7996
7992
  onClick: () => checkoutFundWalletOrder(),
7997
7993
  children: [
7998
- redirecting && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react18.LoaderIcon, { size: 16, className: "animate-spin" }),
7994
+ redirecting && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react17.LoaderIcon, { size: 16, className: "animate-spin" }),
7999
7995
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: redirecting ? "REDIRECTING..." : "CONTINUE" })
8000
7996
  ]
8001
7997
  }
@@ -8005,7 +8001,7 @@ function Binance(props) {
8005
8001
 
8006
8002
  // src/internal/components/BuyMenu/rampnow/Rampnow.tsx
8007
8003
  var import_react_query11 = require("@tanstack/react-query");
8008
- var import_lucide_react19 = require("lucide-react");
8004
+ var import_lucide_react18 = require("lucide-react");
8009
8005
  var import_react24 = require("react");
8010
8006
 
8011
8007
  // src/internal/components/BuyMenu/rampnow/api.ts
@@ -8144,7 +8140,7 @@ function Rampnow(props) {
8144
8140
  Input,
8145
8141
  {
8146
8142
  ref: inputRef,
8147
- Icon: import_lucide_react19.DollarSign,
8143
+ Icon: import_lucide_react18.DollarSign,
8148
8144
  name: "rampnow-onramp-input",
8149
8145
  disabled: isLoading,
8150
8146
  autoComplete: "off",
@@ -8157,7 +8153,7 @@ function Rampnow(props) {
8157
8153
  ),
8158
8154
  localError && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Highlight, { type: "error", children: localError }),
8159
8155
  !localError && ((receiveLumiaAmount || 0) > 0 || isLoading) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cn("flex justify-between gap-4 text-sm leading-4", { "opacity-60": srcInputAmount <= 0 }), children: [
8160
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react19.LoaderIcon, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-[var(--l-pass-fg-muted)]", children: "You receive:" }),
8156
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.LoaderIcon, { size: 16, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-[var(--l-pass-fg-muted)]", children: "You receive:" }),
8161
8157
  (receiveLumiaAmount || 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: `${receiveLumiaAmount || 0} LUMIA` })
8162
8158
  ] }),
8163
8159
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
@@ -8178,7 +8174,7 @@ function Rampnow(props) {
8178
8174
  variant: "default",
8179
8175
  onClick: () => checkoutFundWalletOrder(),
8180
8176
  children: [
8181
- redirecting && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react19.LoaderIcon, { size: 16, className: "animate-spin" }),
8177
+ redirecting && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react18.LoaderIcon, { size: 16, className: "animate-spin" }),
8182
8178
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: redirecting ? "REDIRECTING..." : "CONTINUE" })
8183
8179
  ]
8184
8180
  }
@@ -8279,7 +8275,7 @@ function BuyMenu() {
8279
8275
  className: "list-scrollbar-y w-full flex flex-col gap-[var(--l-pass-gap)] p-[var(--l-pass-pd)]",
8280
8276
  children: [
8281
8277
  /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
8282
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.ArrowLeft, { className: "h-4 w-4" }) }),
8278
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react19.ArrowLeft, { className: "h-4 w-4" }) }),
8283
8279
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl font-semibold", children: "Buy LUMIA" })
8284
8280
  ] }),
8285
8281
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full flex items-center gap-[var(--l-pass-gap)]", children: AVAILABLE_RAMP_PROVIDERS.map(({ id, icon: Icon }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
@@ -8302,13 +8298,13 @@ function BuyMenu() {
8302
8298
 
8303
8299
  // src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
8304
8300
  var import_react_query17 = require("@tanstack/react-query");
8305
- var import_lucide_react27 = require("lucide-react");
8301
+ var import_lucide_react26 = require("lucide-react");
8306
8302
  var import_react31 = require("react");
8307
8303
  init_vaultClient();
8308
8304
 
8309
8305
  // src/internal/components/KeyshareRestoreMenu/components/MethodSelector.tsx
8310
8306
  var import_react_query15 = require("@tanstack/react-query");
8311
- var import_lucide_react21 = require("lucide-react");
8307
+ var import_lucide_react20 = require("lucide-react");
8312
8308
  var import_react28 = require("react");
8313
8309
  init_vaultClient();
8314
8310
 
@@ -8724,7 +8720,7 @@ function useRestoreAccount() {
8724
8720
  var import_jsx_runtime37 = require("react/jsx-runtime");
8725
8721
  var RESTORE_METHODS = [
8726
8722
  { method: "server", label: "Server", Icon: OtpIcon },
8727
- { method: "file", label: "File", Icon: import_lucide_react21.FileDown }
8723
+ { method: "file", label: "File", Icon: import_lucide_react20.FileDown }
8728
8724
  // { method: 'cloud', label: 'Cloud', Icon: Cloud }
8729
8725
  ];
8730
8726
  function MethodSelector(props) {
@@ -8771,7 +8767,7 @@ function MethodSelector(props) {
8771
8767
  }, [mode, serverRecoveryStatus]);
8772
8768
  if (!!selectedRecoveryMethod) return null;
8773
8769
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react28.Fragment, { children: [
8774
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "block w-full text-xs font-semibold text-center leading-8 text-[var(--l-pass-fg-muted)]", children: isBackupStatusLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "block w-full h-8 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.Loader, { className: "animate-spin w-4 h-4 mx-auto" }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "leading-8", children: mode === "restore" ? "Choose method to restore" : "Create or Update Backup via" }) }),
8770
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "block w-full text-xs font-semibold text-center leading-8 text-[var(--l-pass-fg-muted)]", children: isBackupStatusLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "block w-full h-8 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.Loader, { className: "animate-spin w-4 h-4 mx-auto" }) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "leading-8", children: mode === "restore" ? "Choose method to restore" : "Create or Update Backup via" }) }),
8775
8771
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8776
8772
  "div",
8777
8773
  {
@@ -8821,7 +8817,7 @@ function MethodSelector(props) {
8821
8817
  }
8822
8818
 
8823
8819
  // src/internal/components/KeyshareRestoreMenu/components/NoBackupFound.tsx
8824
- var import_lucide_react22 = require("lucide-react");
8820
+ var import_lucide_react21 = require("lucide-react");
8825
8821
  var import_jsx_runtime38 = require("react/jsx-runtime");
8826
8822
  var ACCOUNT_RECOVERY_TEXT = `This device doesn't have access to your wallet keyshare, and no backup was found in the Vault. To access your wallet: use the original device where you created the account, create a backup from that device first, then try restoring on this device.`;
8827
8823
  var ACCOUNT_FILE_RECOVERY_TEXT = `Try uploading a backup file if you have one saved locally, or create a different new account`;
@@ -8830,7 +8826,7 @@ function NoBackupFound(props) {
8830
8826
  const { restoreFile, setRestoreFile } = useRestoreStore();
8831
8827
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
8832
8828
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Highlight, { type: "error", className: "animate-glow-warning flex gap-[var(--l-pass-gap)]", children: [
8833
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.AlertCircle, { className: "h-4 w-4 flex-0" }),
8829
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.AlertCircle, { className: "h-4 w-4 flex-0" }),
8834
8830
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "w-full flex-1 flex flex-col gap-2", children: [
8835
8831
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "block w-full text-xl leading-5 font-semibold", children: "No Keyshare Found! Account Recovery Needed" }),
8836
8832
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "block w-full text-xs", children: ACCOUNT_RECOVERY_TEXT })
@@ -8842,7 +8838,7 @@ function NoBackupFound(props) {
8842
8838
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { style: { borderTop: "1px solid var(--l-pass-bd)" }, className: "flex-1" })
8843
8839
  ] }),
8844
8840
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--l-pass-gap)]", children: [
8845
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.Upload, { className: "h-4 w-4 flex-0" }),
8841
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Upload, { className: "h-4 w-4 flex-0" }),
8846
8842
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "block w-full text-xs", children: ACCOUNT_FILE_RECOVERY_TEXT })
8847
8843
  ] }),
8848
8844
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("label", { className: "block w-full flex items-center justify-center cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
@@ -8861,14 +8857,14 @@ function NoBackupFound(props) {
8861
8857
  }
8862
8858
  ) }),
8863
8859
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Button, { size: "large", className: "w-full", onClick: () => restoreFromFile(), disabled: isLoading || !restoreFile, children: [
8864
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react22.RefreshCcw, { className: "w-4 h-4" }),
8860
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.RefreshCcw, { className: "w-4 h-4" }),
8865
8861
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: `Restore with ${restoreFile ? restoreFile.name : "File"}` })
8866
8862
  ] })
8867
8863
  ] });
8868
8864
  }
8869
8865
 
8870
8866
  // src/internal/components/KeyshareRestoreMenu/methods/File.tsx
8871
- var import_lucide_react23 = require("lucide-react");
8867
+ var import_lucide_react22 = require("lucide-react");
8872
8868
  var import_jsx_runtime39 = require("react/jsx-runtime");
8873
8869
  function File2(props) {
8874
8870
  const { isLoading, mode = "restore", fileHandler } = props;
@@ -8888,7 +8884,7 @@ function File2(props) {
8888
8884
  setSuccess(null);
8889
8885
  setMethod(null);
8890
8886
  },
8891
- children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.ArrowLeft, { className: "h-4 w-4" })
8887
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.ArrowLeft, { className: "h-4 w-4" })
8892
8888
  }
8893
8889
  ),
8894
8890
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-xl font-semibold", children: "File" })
@@ -8909,7 +8905,7 @@ function File2(props) {
8909
8905
  }
8910
8906
  ) }),
8911
8907
  restoreFile && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Button, { variant: "ghost", onClick: () => setRestoreFile(null), children: [
8912
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.RefreshCcw, { className: "w-4 h-4" }),
8908
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.RefreshCcw, { className: "w-4 h-4" }),
8913
8909
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "Clear selected File" })
8914
8910
  ] }),
8915
8911
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
@@ -8920,7 +8916,7 @@ function File2(props) {
8920
8916
  onClick: () => fileHandler(),
8921
8917
  disabled: !!isLoading || mode === "restore" && !restoreFile,
8922
8918
  children: [
8923
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react23.FileDown, { className: "w-4 h-4" }),
8919
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.FileDown, { className: "w-4 h-4" }),
8924
8920
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: `${actionText} ${restoreFile ? restoreFile.name : "Backup File"}` })
8925
8921
  ]
8926
8922
  }
@@ -8929,12 +8925,12 @@ function File2(props) {
8929
8925
  }
8930
8926
 
8931
8927
  // src/internal/components/KeyshareRestoreMenu/methods/Server.tsx
8932
- var import_lucide_react25 = require("lucide-react");
8928
+ var import_lucide_react24 = require("lucide-react");
8933
8929
  var import_react29 = require("react");
8934
8930
 
8935
8931
  // src/internal/components/ui/checkbox.tsx
8936
8932
  var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
8937
- var import_lucide_react24 = require("lucide-react");
8933
+ var import_lucide_react23 = require("lucide-react");
8938
8934
  var import_jsx_runtime40 = require("react/jsx-runtime");
8939
8935
  function Checkbox({ className, ...props }) {
8940
8936
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
@@ -8952,7 +8948,7 @@ function Checkbox({ className, ...props }) {
8952
8948
  className
8953
8949
  ),
8954
8950
  ...props,
8955
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center transition-none", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react24.CheckIcon, { className: "w-4 h-4 text-[var(--l-pass-fg)]" }) })
8951
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center transition-none", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react23.CheckIcon, { className: "w-4 h-4 text-[var(--l-pass-fg)]" }) })
8956
8952
  }
8957
8953
  );
8958
8954
  }
@@ -8992,7 +8988,7 @@ function Server(props) {
8992
8988
  setSuccess(null);
8993
8989
  setMethod(null);
8994
8990
  },
8995
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react25.ArrowLeft, { className: "h-4 w-4" })
8991
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.ArrowLeft, { className: "h-4 w-4" })
8996
8992
  }
8997
8993
  ),
8998
8994
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xl font-semibold", children: passkeyOrPassword })
@@ -9013,7 +9009,7 @@ function Server(props) {
9013
9009
  Input,
9014
9010
  {
9015
9011
  autoComplete: "off",
9016
- Icon: import_lucide_react25.ServerIcon,
9012
+ Icon: import_lucide_react24.ServerIcon,
9017
9013
  type: showPassword ? "text" : "password",
9018
9014
  placeholder: "Enter server backup password",
9019
9015
  value: restorePassword,
@@ -9021,7 +9017,7 @@ function Server(props) {
9021
9017
  onKeyDown: (e) => {
9022
9018
  if (e.key === "Enter" && !isLoading && restorePassword) actionRef.current?.click();
9023
9019
  },
9024
- element: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { variant: "ghost", size: "icon", type: "button", onClick: () => setShowPassword(!showPassword), children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react25.EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react25.Eye, { className: "h-4 w-4" }) })
9020
+ element: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { variant: "ghost", size: "icon", type: "button", onClick: () => setShowPassword(!showPassword), children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.Eye, { className: "h-4 w-4" }) })
9025
9021
  }
9026
9022
  ),
9027
9023
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
@@ -9033,7 +9029,7 @@ function Server(props) {
9033
9029
  disabled: isLoading || !usePasskey && !restorePassword,
9034
9030
  className: "w-full",
9035
9031
  children: [
9036
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react25.Loader, { className: "animate-spin h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react25.ServerIcon, { className: "h-4 w-4" }),
9032
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.Loader, { className: "animate-spin h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react24.ServerIcon, { className: "h-4 w-4" }),
9037
9033
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: isLoading ? loadingText : `${actionText} with ${passkeyOrPassword}` })
9038
9034
  ]
9039
9035
  }
@@ -9043,7 +9039,7 @@ function Server(props) {
9043
9039
 
9044
9040
  // src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
9045
9041
  var import_react_query16 = require("@tanstack/react-query");
9046
- var import_lucide_react26 = require("lucide-react");
9042
+ var import_lucide_react25 = require("lucide-react");
9047
9043
  var import_react30 = require("react");
9048
9044
  var import_jsx_runtime42 = require("react/jsx-runtime");
9049
9045
  function Cloud2(props) {
@@ -9090,12 +9086,12 @@ function Cloud2(props) {
9090
9086
  setSelectedCloudProvider(null);
9091
9087
  setMethod(null);
9092
9088
  },
9093
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react26.ArrowLeft, { className: "h-4 w-4" })
9089
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react25.ArrowLeft, { className: "h-4 w-4" })
9094
9090
  }
9095
9091
  ),
9096
9092
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-xl font-semibold", children: "Cloud" })
9097
9093
  ] }),
9098
- isCloudProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react26.Loader, { className: "animate-spin w-4 h-4 mx-auto" }),
9094
+ isCloudProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react25.Loader, { className: "animate-spin w-4 h-4 mx-auto" }),
9099
9095
  !isCloudProvidersLoading && cloudProviders.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
9100
9096
  "select",
9101
9097
  {
@@ -9114,7 +9110,7 @@ function Cloud2(props) {
9114
9110
  onClick: () => cloudHandler?.(),
9115
9111
  disabled: isLoading || !selectedCloudProvider || cloudProviders.length === 0,
9116
9112
  children: [
9117
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react26.CloudUpload, { className: "w-4 h-4" }),
9113
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react25.CloudUpload, { className: "w-4 h-4" }),
9118
9114
  isLoading ? loadingText : actionText
9119
9115
  ]
9120
9116
  }
@@ -9198,7 +9194,7 @@ var KeyshareRestoreMenu = () => {
9198
9194
  className: "list-scrollbar-y w-full",
9199
9195
  children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--l-pass-gap)] p-[var(--l-pass-pd)]", children: [
9200
9196
  checkingBackup && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)] text-center justify-center items-center", children: [
9201
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.Loader, { className: "w-5 h-5 animate-spin" }),
9197
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.Loader, { className: "w-5 h-5 animate-spin" }),
9202
9198
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "block w-full text-xs leading-4", children: "Checking for backups..." }),
9203
9199
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "block w-full text-xs leading-4", children: "Please wait while we check for available backups..." })
9204
9200
  ] }),
@@ -9211,7 +9207,7 @@ var KeyshareRestoreMenu = () => {
9211
9207
  ),
9212
9208
  !success && !checkingBackup && hasServerBackup && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
9213
9209
  /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-center gap-[var(--l-pass-gap)] px-[var(--l-pass-pd)] py-[var(--l-pass-gap)]", children: [
9214
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.CloudUpload, { className: "w-6 h-6" }),
9210
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.CloudUpload, { className: "w-6 h-6" }),
9215
9211
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "font-bold text-xl leading-6", children: "Restore Account" })
9216
9212
  ] }),
9217
9213
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(MethodSelector, { mode: "restore" }),
@@ -9237,18 +9233,18 @@ var KeyshareRestoreMenu = () => {
9237
9233
  disabled: isDisconnecting || isRestoringFromFile || isRestoringFromServer,
9238
9234
  className: "w-fit mx-auto",
9239
9235
  children: [
9240
- isDisconnecting ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.LogOut, { className: "w-4 h-4" }),
9236
+ isDisconnecting ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.LogOut, { className: "w-4 h-4" }),
9241
9237
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "Disconnect" })
9242
9238
  ]
9243
9239
  }
9244
9240
  )
9245
9241
  ] }),
9246
9242
  error && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--l-pass-gap)]", children: [
9247
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9243
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9248
9244
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "w-full flex-1 block", children: error })
9249
9245
  ] }),
9250
9246
  success && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Highlight, { type: "success", className: "flex gap-[var(--l-pass-gap)]", children: [
9251
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react27.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9247
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react26.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9252
9248
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "w-full flex-1 block", children: success })
9253
9249
  ] })
9254
9250
  ] })
@@ -9257,7 +9253,7 @@ var KeyshareRestoreMenu = () => {
9257
9253
  };
9258
9254
 
9259
9255
  // src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
9260
- var import_lucide_react28 = require("lucide-react");
9256
+ var import_lucide_react27 = require("lucide-react");
9261
9257
  var import_react32 = require("react");
9262
9258
  var import_jsx_runtime44 = require("react/jsx-runtime");
9263
9259
  var COMPONENTS = {
@@ -9317,13 +9313,13 @@ function KeyshareBackupMenu() {
9317
9313
  setSuccess(null);
9318
9314
  setPage("settings" /* SETTINGS */);
9319
9315
  },
9320
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react28.ArrowLeft, { className: "h-4 w-4" })
9316
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react27.ArrowLeft, { className: "h-4 w-4" })
9321
9317
  }
9322
9318
  ),
9323
9319
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xl font-semibold", children: "Create Backup" })
9324
9320
  ] }),
9325
9321
  !isRecoveryLoading && !currentBackupMethod && !hasRecoveryData && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Highlight, { type: "warning", className: "flex gap-[var(--l-pass-gap)]", children: [
9326
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react28.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9322
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react27.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9327
9323
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block flex-1", children: BACKUP_INFO_MESSAGE })
9328
9324
  ] }),
9329
9325
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MethodSelector, { mode: "backup" }),
@@ -9339,7 +9335,7 @@ function KeyshareBackupMenu() {
9339
9335
  }
9340
9336
  ),
9341
9337
  currentBackupMethod === "server" && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Highlight, { className: "flex items-start gap-[var(--l-pass-gap)]", type: "info", children: [
9342
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react28.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9338
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react27.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9343
9339
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
9344
9340
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "font-medium", children: "Security Notice:" }),
9345
9341
  " All backups are encrypted with AES-256 using your ",
@@ -9351,11 +9347,11 @@ function KeyshareBackupMenu() {
9351
9347
  ] })
9352
9348
  ] }),
9353
9349
  error && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--l-pass-gap)]", children: [
9354
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react28.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9350
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react27.AlertCircle, { className: "h-4 w-4 flex-shrink-0" }),
9355
9351
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block w-full flex-1", children: error })
9356
9352
  ] }),
9357
9353
  success && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Highlight, { type: "success", className: "flex gap-[var(--l-pass-gap)]", children: [
9358
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react28.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9354
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react27.CheckCircle2, { className: "h-4 w-4 flex-shrink-0" }),
9359
9355
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block w-full flex-1", children: success })
9360
9356
  ] })
9361
9357
  ] })
@@ -9364,7 +9360,7 @@ function KeyshareBackupMenu() {
9364
9360
  }
9365
9361
 
9366
9362
  // src/internal/components/MainMenu/MainMenu.tsx
9367
- var import_lucide_react29 = require("lucide-react");
9363
+ var import_lucide_react28 = require("lucide-react");
9368
9364
  var import_react33 = require("react");
9369
9365
 
9370
9366
  // src/internal/components/ManageWalletMenu/hooks/useProvidersList.ts
@@ -9386,10 +9382,10 @@ function useProvidersList() {
9386
9382
  // src/internal/components/MainMenu/MainMenu.tsx
9387
9383
  var import_jsx_runtime45 = require("react/jsx-runtime");
9388
9384
  var MAIN_MENU_BUTTONS = [
9389
- { id: "send" /* SEND */, label: "Send", icon: import_lucide_react29.ChevronRight },
9390
- { id: "receive" /* RECEIVE */, label: "Receive", icon: import_lucide_react29.ChevronLeft },
9391
- { id: "buy" /* BUY */, label: "Buy", icon: import_lucide_react29.DollarSign },
9392
- { id: "assets" /* ASSETS */, label: "Portfolio", icon: import_lucide_react29.Wallet2 }
9385
+ { id: "send" /* SEND */, label: "Send", icon: import_lucide_react28.ChevronRight },
9386
+ { id: "receive" /* RECEIVE */, label: "Receive", icon: import_lucide_react28.ChevronLeft },
9387
+ { id: "buy" /* BUY */, label: "Buy", icon: import_lucide_react28.DollarSign },
9388
+ { id: "assets" /* ASSETS */, label: "Portfolio", icon: import_lucide_react28.Wallet2 }
9393
9389
  ];
9394
9390
  function MainMenu() {
9395
9391
  const address = useLumiaPassportSession((st) => st.address);
@@ -9416,7 +9412,7 @@ function MainMenu() {
9416
9412
 
9417
9413
  // src/internal/components/ManageWalletMenu/ManageWallet.tsx
9418
9414
  var import_lodash_es3 = require("lodash-es");
9419
- var import_lucide_react33 = require("lucide-react");
9415
+ var import_lucide_react32 = require("lucide-react");
9420
9416
  var import_react37 = require("react");
9421
9417
 
9422
9418
  // src/modules/linkedProfiles.ts
@@ -9467,35 +9463,27 @@ init_passkey2();
9467
9463
  // src/internal/components/ManageWalletMenu/EmailForm.tsx
9468
9464
  init_lumiaPassport();
9469
9465
  var import_react_query20 = require("@tanstack/react-query");
9470
- var import_lucide_react30 = require("lucide-react");
9466
+ var import_lucide_react29 = require("lucide-react");
9471
9467
  init_projectId();
9472
9468
 
9473
9469
  // src/internal/components/ManageWalletMenu/hooks/useStore.ts
9474
9470
  var import_zustand5 = require("zustand");
9475
9471
  var useManageWalletStore = (0, import_zustand5.create)((set) => ({
9472
+ alert: null,
9476
9473
  emailStep: "input",
9477
9474
  email: "",
9478
9475
  emailCode: "",
9479
- emailCodeSentError: "",
9480
9476
  emailCodeExpiresIn: 0,
9481
- isWalletLinking: false,
9482
9477
  linkIsLoading: false,
9483
- linkError: "",
9484
- verificationError: "",
9485
9478
  providerType: null,
9486
9479
  confirmUnlink: null,
9480
+ setAlert: (alert2) => set({ alert: alert2 }),
9487
9481
  setEmailStep: (emailStep) => set({ emailStep }),
9488
9482
  setEmail: (email) => set({ email }),
9489
9483
  setEmailCode: (emailCode) => set({ emailCode }),
9490
- setEmailCodeSentError: (emailCodeSentError) => set({ emailCodeSentError }),
9491
9484
  setEmailCodeExpiresIn: (emailCodeExpiresIn) => set({ emailCodeExpiresIn }),
9492
- setIsWalletLinking: (isWalletLinking) => set({ isWalletLinking }),
9493
9485
  setLinkIsLoading: (linkIsLoading) => set({ linkIsLoading }),
9494
- setLinkError: (linkError) => set({ linkError }),
9495
- setVerificationError: (verificationError) => set({ verificationError }),
9496
- setProviderType: (providerType) => {
9497
- set({ providerType });
9498
- },
9486
+ setProviderType: (providerType) => set({ providerType }),
9499
9487
  setConfirmUnlink: (confirmUnlink) => set({ confirmUnlink })
9500
9488
  }));
9501
9489
 
@@ -9508,12 +9496,12 @@ function EmailForm() {
9508
9496
  } = useLumiaPassportConfig();
9509
9497
  const isLoading = useLumiaPassportSession((st) => st.isLoading);
9510
9498
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
9511
- const { email, setEmail, setEmailCodeSentError, setEmailCodeExpiresIn, setEmailStep } = useManageWalletStore();
9499
+ const { email, setEmail, setAlert, setEmailCodeExpiresIn, setEmailStep } = useManageWalletStore();
9512
9500
  const { mutate: onSendVerificationCode } = (0, import_react_query20.useMutation)({
9513
9501
  mutationFn: async () => {
9514
9502
  if (!email) return;
9515
9503
  setIsLoading(true);
9516
- setEmailCodeSentError("");
9504
+ setAlert(null);
9517
9505
  try {
9518
9506
  const response = await fetch(addProjectIdToUrl(`${getServiceUrls().tssUrl}/api/auth/email/send-code`), {
9519
9507
  method: "POST",
@@ -9533,18 +9521,28 @@ function EmailForm() {
9533
9521
  } else {
9534
9522
  if (response.status === 429) {
9535
9523
  const retryAfter = data.retryAfter || 60;
9536
- setEmailCodeSentError(
9537
- `Code already sent recently. Please wait ${retryAfter} seconds before requesting another.`
9538
- );
9524
+ setAlert({
9525
+ title: "Too Many Requests",
9526
+ message: `Code already sent recently. Please wait ${retryAfter} seconds before requesting another.`
9527
+ });
9539
9528
  } else if (response.status === 400) {
9540
- setEmailCodeSentError(data.message || "Invalid email address");
9529
+ setAlert({
9530
+ title: "Invalid Email",
9531
+ message: data.message || "Invalid email address"
9532
+ });
9541
9533
  } else {
9542
- setEmailCodeSentError(data.message || "Failed to send verification code");
9534
+ setAlert({
9535
+ title: "Error",
9536
+ message: data.message || "Failed to send verification code"
9537
+ });
9543
9538
  }
9544
9539
  }
9545
9540
  } catch (error) {
9546
9541
  const errorMessage = "Network error. Please check your connection.";
9547
- setEmailCodeSentError(errorMessage);
9542
+ setAlert({
9543
+ title: "Network Error",
9544
+ message: errorMessage
9545
+ });
9548
9546
  try {
9549
9547
  callbacks?.onLumiaPassportError?.({
9550
9548
  error: error instanceof Error ? error : new Error(errorMessage),
@@ -9562,7 +9560,7 @@ function EmailForm() {
9562
9560
  Input,
9563
9561
  {
9564
9562
  name: "signin-email",
9565
- Icon: import_lucide_react30.Mail,
9563
+ Icon: import_lucide_react29.Mail,
9566
9564
  type: "email",
9567
9565
  autoComplete: "off",
9568
9566
  placeholder: config.email.placeholder,
@@ -9579,7 +9577,7 @@ function EmailForm() {
9579
9577
  size: "large",
9580
9578
  disabled: !email || isLoading,
9581
9579
  onClick: () => onSendVerificationCode(),
9582
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react30.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react30.ChevronRight, { className: "w-4 h-4" })
9580
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react29.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react29.ChevronRight, { className: "w-4 h-4" })
9583
9581
  }
9584
9582
  )
9585
9583
  ] });
@@ -9589,19 +9587,21 @@ function EmailForm() {
9589
9587
  var import_react_query21 = require("@tanstack/react-query");
9590
9588
  init_email();
9591
9589
  function useSendVerificationCode() {
9592
- const { setVerificationError, setLinkIsLoading, setEmailCodeSentError, setEmailCodeExpiresIn } = useManageWalletStore();
9590
+ const setAlert = useManageWalletStore((st) => st.setAlert);
9591
+ const setLinkIsLoading = useManageWalletStore((st) => st.setLinkIsLoading);
9592
+ const setEmailCodeExpiresIn = useManageWalletStore((st) => st.setEmailCodeExpiresIn);
9593
9593
  return (0, import_react_query21.useMutation)({
9594
9594
  mutationFn: async (email) => {
9595
9595
  if (!email) {
9596
9596
  throw new Error("Email is required");
9597
9597
  }
9598
- setVerificationError("");
9598
+ setAlert(null);
9599
9599
  setLinkIsLoading(true);
9600
9600
  await sendEmailLinkCode(email);
9601
9601
  },
9602
9602
  onError: (error) => {
9603
9603
  console.error("Failed to send verification code", error.message);
9604
- setEmailCodeSentError(error?.message || "Failed to send verification code");
9604
+ setAlert({ title: "Error", message: error?.message || "Failed to send verification code" });
9605
9605
  setLinkIsLoading(false);
9606
9606
  },
9607
9607
  onSuccess: () => {
@@ -9620,28 +9620,17 @@ function useVerifyCode() {
9620
9620
  const qc = (0, import_react_query22.useQueryClient)();
9621
9621
  const address = useLumiaPassportSession((st) => st.address);
9622
9622
  const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
9623
- const {
9624
- email,
9625
- emailCode,
9626
- setEmail,
9627
- setEmailStep,
9628
- setEmailCode,
9629
- setProviderType,
9630
- setLinkIsLoading,
9631
- setVerificationError,
9632
- setEmailCodeSentError
9633
- } = useManageWalletStore();
9623
+ const { email, emailCode, setEmail, setEmailStep, setEmailCode, setProviderType, setLinkIsLoading, setAlert } = useManageWalletStore();
9634
9624
  return (0, import_react_query22.useMutation)({
9635
9625
  mutationFn: async (codeToVerify) => {
9636
9626
  const code = codeToVerify ?? emailCode;
9637
9627
  if (!code) {
9638
- setEmailCodeSentError("Please enter the verification code");
9628
+ setAlert({ title: "Error", message: "Please enter the verification code" });
9639
9629
  return;
9640
9630
  }
9641
9631
  setIsLoading(true);
9642
9632
  setLinkIsLoading(true);
9643
- setVerificationError("");
9644
- setEmailCodeSentError("");
9633
+ setAlert(null);
9645
9634
  return await verifyEmailLinkCode(email, code);
9646
9635
  },
9647
9636
  onSuccess: async () => {
@@ -9650,8 +9639,7 @@ function useVerifyCode() {
9650
9639
  setProviderType(null);
9651
9640
  setEmail("");
9652
9641
  setEmailCode("");
9653
- setVerificationError("");
9654
- setEmailCodeSentError("");
9642
+ setAlert(null);
9655
9643
  setEmailStep("input");
9656
9644
  try {
9657
9645
  callbacks?.onLumiaPassportUpdate?.({ providers: qc.getQueryData([PROVIDERS_QUERY_KEY, address]) });
@@ -9661,7 +9649,7 @@ function useVerifyCode() {
9661
9649
  setLinkIsLoading(false);
9662
9650
  },
9663
9651
  onError: (error) => {
9664
- setVerificationError(error?.message || "Failed to verify and link email");
9652
+ setAlert({ title: "Error", message: error?.message || "Failed to verify and link email" });
9665
9653
  setIsLoading(false);
9666
9654
  setLinkIsLoading(false);
9667
9655
  }
@@ -9682,7 +9670,7 @@ function normalizePasskeyLinkError(msg) {
9682
9670
  }
9683
9671
  function AddProvider() {
9684
9672
  const qc = (0, import_react_query23.useQueryClient)();
9685
- const { callbacks } = useLumiaPassportConfig();
9673
+ const callbacks = useLumiaPassportConfig().callbacks;
9686
9674
  const address = useLumiaPassportSession((st) => st.address);
9687
9675
  const {
9688
9676
  linkIsLoading,
@@ -9690,8 +9678,8 @@ function AddProvider() {
9690
9678
  email,
9691
9679
  emailStep,
9692
9680
  emailCodeExpiresIn,
9681
+ setAlert,
9693
9682
  setProviderType,
9694
- setLinkError,
9695
9683
  setLinkIsLoading
9696
9684
  } = useManageWalletStore();
9697
9685
  const setPage = useLayoutDataStore((st) => st.setPage);
@@ -9731,7 +9719,7 @@ function AddProvider() {
9731
9719
  size: "medium",
9732
9720
  disabled: isLoading,
9733
9721
  onClick: async () => {
9734
- setLinkError("");
9722
+ setAlert(null);
9735
9723
  setLinkIsLoading(true);
9736
9724
  try {
9737
9725
  await linkPasskeyWithWebAuthn({
@@ -9753,7 +9741,7 @@ function AddProvider() {
9753
9741
  setProviderType(null);
9754
9742
  } catch (e) {
9755
9743
  const msg = e?.message || "Failed to link passkey";
9756
- setLinkError(normalizePasskeyLinkError(msg));
9744
+ setAlert({ title: "Error", message: normalizePasskeyLinkError(msg) });
9757
9745
  } finally {
9758
9746
  setLinkIsLoading(false);
9759
9747
  }
@@ -9772,7 +9760,7 @@ function AddProvider() {
9772
9760
  size: "medium",
9773
9761
  disabled: isLoading,
9774
9762
  onClick: async () => {
9775
- setLinkError("");
9763
+ setAlert(null);
9776
9764
  setLinkIsLoading(true);
9777
9765
  try {
9778
9766
  await linkPasskeyWithWebAuthn({
@@ -9794,7 +9782,7 @@ function AddProvider() {
9794
9782
  setProviderType(null);
9795
9783
  } catch (e) {
9796
9784
  const msg = e?.message || "Failed to link passkey";
9797
- setLinkError(normalizePasskeyLinkError(msg));
9785
+ setAlert({ title: "Error", message: normalizePasskeyLinkError(msg) });
9798
9786
  } finally {
9799
9787
  setLinkIsLoading(false);
9800
9788
  }
@@ -9812,7 +9800,7 @@ function AddProvider() {
9812
9800
 
9813
9801
  // src/internal/components/ManageWalletMenu/EmailNotConnectedWarning.tsx
9814
9802
  var import_framer_motion2 = require("framer-motion");
9815
- var import_lucide_react31 = require("lucide-react");
9803
+ var import_lucide_react30 = require("lucide-react");
9816
9804
  init_auth();
9817
9805
  var import_jsx_runtime48 = require("react/jsx-runtime");
9818
9806
  function EmailNotConnectedWarning() {
@@ -9831,7 +9819,7 @@ function EmailNotConnectedWarning() {
9831
9819
  transition: Y_ANIMATION_SETUP,
9832
9820
  children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Highlight, { type: "warning", className: "flex flex-col gap-[var(--l-pass-gap)] items-center text-center", children: [
9833
9821
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "flex items-center gap-[var(--l-pass-gap)] text-lg font-bold", children: [
9834
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react31.Mail, { className: "w-5 h-5" }),
9822
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react30.Mail, { className: "w-5 h-5" }),
9835
9823
  "CONNECT EMAIL"
9836
9824
  ] }),
9837
9825
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "font-medium", children: "Connect your email for easier account recovery and additional security." })
@@ -9852,14 +9840,15 @@ function useLinkSocial() {
9852
9840
  callbacks
9853
9841
  } = useLumiaPassportConfig();
9854
9842
  const setPage = useLayoutDataStore((st) => st.setPage);
9855
- const { providerType, linkIsLoading, isWalletLinking, setProviderType, setLinkIsLoading, setLinkError } = useManageWalletStore();
9843
+ const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
9844
+ const { providerType, linkIsLoading, setProviderType, setAlert, setLinkIsLoading } = useManageWalletStore();
9856
9845
  const handleLinkSocialProvider = import_react35.default.useCallback(
9857
9846
  async (providerIdRaw) => {
9858
9847
  const providerKey = providerIdRaw.toLowerCase();
9859
9848
  const normalizedKey = providerKey === "twitter" ? "x" : providerKey;
9860
9849
  try {
9861
9850
  setLinkIsLoading(true);
9862
- setLinkError("");
9851
+ setAlert(null);
9863
9852
  const socialProvider = config.social?.providers?.find(
9864
9853
  (p) => (p.id || "").toLowerCase() === normalizedKey && p.enabled
9865
9854
  );
@@ -9897,7 +9886,7 @@ function useLinkSocial() {
9897
9886
  } catch (e) {
9898
9887
  console.error(`[ManageWallet] Failed to link ${providerIdRaw}:`, e);
9899
9888
  const message = e?.message || `Failed to link ${providerIdRaw}`;
9900
- setLinkError(message);
9889
+ setAlert({ title: "Error", message });
9901
9890
  setProviderType(null);
9902
9891
  } finally {
9903
9892
  setLinkIsLoading(false);
@@ -9936,12 +9925,13 @@ function useLinkTelegram() {
9936
9925
  } = useLumiaPassportConfig();
9937
9926
  const qc = (0, import_react_query25.useQueryClient)();
9938
9927
  const address = useLumiaPassportSession((st) => st.address);
9939
- const { providerType, linkIsLoading, isWalletLinking, setLinkIsLoading, setProviderType, setLinkError } = useManageWalletStore();
9928
+ const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
9929
+ const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
9940
9930
  const setPage = useLayoutDataStore((st) => st.setPage);
9941
9931
  const handleLinkTelegram = (0, import_react36.useCallback)(async () => {
9942
9932
  try {
9943
9933
  setLinkIsLoading(true);
9944
- setLinkError("");
9934
+ setAlert(null);
9945
9935
  const telegramProvider = config.social?.providers?.find(
9946
9936
  (p) => (p.id || "").toLowerCase() === "telegram" && p.enabled
9947
9937
  );
@@ -9974,7 +9964,7 @@ function useLinkTelegram() {
9974
9964
  setProviderType(null);
9975
9965
  } catch (e) {
9976
9966
  console.error("[ManageWallet] Failed to link Telegram:", e);
9977
- setLinkError(e?.message || "Failed to link Telegram");
9967
+ setAlert({ title: "Error", message: e?.message || "Failed to link Telegram" });
9978
9968
  setProviderType(null);
9979
9969
  } finally {
9980
9970
  setLinkIsLoading(false);
@@ -9982,7 +9972,12 @@ function useLinkTelegram() {
9982
9972
  }, [config.social?.providers, callbacks]);
9983
9973
  const [telegramLinkStarted, setTelegramLinkStarted] = (0, import_react36.useState)(false);
9984
9974
  (0, import_react36.useEffect)(() => {
9985
- console.log("[useLinkTelegram] Effect triggered:", { providerType, linkIsLoading, telegramLinkStarted, isWalletLinking });
9975
+ console.log("[useLinkTelegram] Effect triggered:", {
9976
+ providerType,
9977
+ linkIsLoading,
9978
+ telegramLinkStarted,
9979
+ isWalletLinking
9980
+ });
9986
9981
  if (isWalletLinking) {
9987
9982
  console.log("[useLinkTelegram] Skipping - wallet linking in progress");
9988
9983
  return;
@@ -10001,7 +9996,7 @@ function useLinkTelegram() {
10001
9996
  }
10002
9997
 
10003
9998
  // src/internal/components/ManageWalletMenu/ProviderCard.tsx
10004
- var import_lucide_react32 = require("lucide-react");
9999
+ var import_lucide_react31 = require("lucide-react");
10005
10000
  init_types();
10006
10001
  var import_jsx_runtime49 = require("react/jsx-runtime");
10007
10002
  function ProviderCard(props) {
@@ -10030,7 +10025,7 @@ function ProviderCard(props) {
10030
10025
  )
10031
10026
  ] }),
10032
10027
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-fit flex items-center gap-[var(--l-pass-gap)] flex-none", children: [
10033
- props.verified ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react32.CheckCircle, { className: `w-4 h-4 text-[var(--l-pass-bg-success)]` }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react32.Clock, { className: "w-4 h-4 text-[var(--l-pass-bg-warning)]" }),
10028
+ props.verified ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react31.CheckCircle, { className: `w-4 h-4 text-[var(--l-pass-bg-success)]` }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react31.Clock, { className: "w-4 h-4 text-[var(--l-pass-bg-warning)]" }),
10034
10029
  allowUnlink && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
10035
10030
  Button,
10036
10031
  {
@@ -10042,7 +10037,7 @@ function ProviderCard(props) {
10042
10037
  setConfirmUnlink({ provider: props.provider, providerName: info.name, externalId: props.externalId });
10043
10038
  setPage("unlink-provider" /* UNLINK_PROVIDER */);
10044
10039
  },
10045
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react32.Trash2, { className: "w-4 h-4 text-[var(--l-pass-bg-error)]" })
10040
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react31.Trash2, { className: "w-4 h-4 text-[var(--l-pass-bg-error)]" })
10046
10041
  }
10047
10042
  )
10048
10043
  ] })
@@ -10083,22 +10078,18 @@ function ManageWalletMenu() {
10083
10078
  config: { current: config }
10084
10079
  } = useLumiaPassportConfig();
10085
10080
  const setPage = useLayoutDataStore((st) => st.setPage);
10081
+ const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
10082
+ const setIsWalletLinking = useLayoutDataStore((st) => st.setIsWalletLinking);
10086
10083
  const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
10087
10084
  const {
10085
+ alert: alert2,
10088
10086
  providerType,
10089
- isWalletLinking,
10090
- linkError,
10091
- verificationError,
10092
- emailCodeSentError,
10087
+ setAlert,
10093
10088
  setProviderType,
10094
10089
  setEmail,
10095
10090
  setEmailStep,
10096
- setEmailCodeSentError,
10097
10091
  setEmailCodeExpiresIn,
10098
- setEmailCode,
10099
- setLinkError,
10100
- setVerificationError,
10101
- setIsWalletLinking
10092
+ setEmailCode
10102
10093
  } = useManageWalletStore();
10103
10094
  const configuredProviders = getConfiguredProviders(config);
10104
10095
  const { data: providers = [], isLoading: isProvidersLoading, error: providersError } = useProvidersList();
@@ -10124,17 +10115,16 @@ function ManageWalletMenu() {
10124
10115
  disabled: isWalletLinking,
10125
10116
  onClick: () => {
10126
10117
  if (isWalletLinking) return;
10118
+ setAlert(null);
10127
10119
  switch (provider) {
10128
10120
  case "email":
10129
10121
  setEmail("");
10130
10122
  setEmailCode("");
10131
- setEmailCodeSentError("");
10132
10123
  setEmailCodeExpiresIn(0);
10133
10124
  setEmailStep("input");
10134
10125
  setProviderType(provider);
10135
10126
  break;
10136
10127
  case "twitter":
10137
- console.log("[ManageWallet] Twitter button clicked!");
10138
10128
  setProviderType("twitter");
10139
10129
  break;
10140
10130
  case "wallet":
@@ -10162,7 +10152,7 @@ function ManageWalletMenu() {
10162
10152
  useLinkSocial();
10163
10153
  const showCurrentProviders = !isProvidersLoading && !providersError && (providerType !== "email" && providerType !== "passkey" || providerType === null);
10164
10154
  const showExtraProvidersUi = !isProvidersLoading && !providersError && (providerType === "email" || providerType === "passkey");
10165
- const combinedError = emailCodeSentError || linkError || verificationError || null;
10155
+ const combinedAlertMessage = alert2?.message || providersError?.message || null;
10166
10156
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
10167
10157
  "div",
10168
10158
  {
@@ -10180,33 +10170,34 @@ function ManageWalletMenu() {
10180
10170
  size: "icon",
10181
10171
  title: "Back",
10182
10172
  onClick: () => {
10173
+ setAlert(null);
10183
10174
  if (providerType === "email") {
10184
10175
  setEmail("");
10185
10176
  setEmailCode("");
10186
10177
  setEmailStep("input");
10187
- setEmailCodeSentError("");
10188
10178
  setEmailCodeExpiresIn(0);
10189
- setVerificationError("");
10190
10179
  }
10191
- setLinkError("");
10192
10180
  if (!providerType) setPage("settings" /* SETTINGS */);
10193
10181
  setProviderType(null);
10194
10182
  },
10195
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react33.ArrowLeft, { className: "h-4 w-4" })
10183
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react32.ArrowLeft, { className: "h-4 w-4" })
10196
10184
  }
10197
10185
  ),
10198
10186
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "text-xl font-semibold", children: "Profiles" })
10199
10187
  ] }),
10200
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: [
10201
- providersError && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Highlight, { type: "error", className: "flex items-start gap-[var(--l-pass-gap)] break-words whitespace-pre-wrap", children: [
10202
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react33.AlertTriangle, { className: "w-4 h-4 shrink-0" }),
10203
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "block", children: providersError.message })
10204
- ] }),
10205
- isProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center justify-center p-4 text-[var(--l-pass-fg-muted)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react33.Loader, { className: "w-5 h-5 animate-spin" }) }),
10206
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(EmailNotConnectedWarning, {}),
10207
- showCurrentProviders && renderProviders.map((node) => node),
10208
- showExtraProvidersUi && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AddProvider, {}),
10209
- combinedError && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Highlight, { type: "error", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: combinedError }) })
10188
+ isProvidersLoading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex items-center justify-center p-4 text-[var(--l-pass-fg-muted)]", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react32.Loader, { className: "w-5 h-5 animate-spin" }) }),
10189
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(EmailNotConnectedWarning, {}),
10190
+ showCurrentProviders && renderProviders.map((node) => node),
10191
+ showExtraProvidersUi && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AddProvider, {}),
10192
+ combinedAlertMessage && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--l-pass-gap)]", children: [
10193
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react32.AlertTriangle, { className: "w-4 h-4 shrink-0" }),
10194
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { className: "break-words whitespace-pre-wrap", children: [
10195
+ alert2?.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
10196
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: alert2.title }),
10197
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("br", {})
10198
+ ] }),
10199
+ combinedAlertMessage
10200
+ ] })
10210
10201
  ] })
10211
10202
  ]
10212
10203
  }
@@ -10215,7 +10206,7 @@ function ManageWalletMenu() {
10215
10206
 
10216
10207
  // src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
10217
10208
  var import_react_query26 = require("@tanstack/react-query");
10218
- var import_lucide_react34 = require("lucide-react");
10209
+ var import_lucide_react33 = require("lucide-react");
10219
10210
  var import_react38 = require("react");
10220
10211
  init_auth();
10221
10212
  var import_jsx_runtime51 = require("react/jsx-runtime");
@@ -10224,7 +10215,7 @@ function UnlinkProviderMenu() {
10224
10215
  const address = useLumiaPassportSession((st) => st.address);
10225
10216
  const { callbacks } = useLumiaPassportConfig();
10226
10217
  const setPage = useLayoutDataStore((st) => st.setPage);
10227
- const { confirmUnlink, setConfirmUnlink, setLinkError } = useManageWalletStore();
10218
+ const { confirmUnlink, setConfirmUnlink, setAlert } = useManageWalletStore();
10228
10219
  const [confirmInput, setConfirmInput] = (0, import_react38.useState)("");
10229
10220
  const { mutate: handleUnlinkProvider, isPending: isProviderUnlinking } = (0, import_react_query26.useMutation)({
10230
10221
  mutationFn: async () => {
@@ -10246,7 +10237,7 @@ function UnlinkProviderMenu() {
10246
10237
  }
10247
10238
  },
10248
10239
  onError: (error) => {
10249
- setLinkError(error?.message || "Failed to unlink provider");
10240
+ setAlert({ title: "Error", message: error?.message || "Failed to unlink provider" });
10250
10241
  setPage("manage-wallet" /* MANAGE_WALLET */);
10251
10242
  }
10252
10243
  });
@@ -10258,7 +10249,7 @@ function UnlinkProviderMenu() {
10258
10249
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
10259
10250
  Input,
10260
10251
  {
10261
- Icon: import_lucide_react34.Key,
10252
+ Icon: import_lucide_react33.Key,
10262
10253
  value: confirmInput,
10263
10254
  onChange: (e) => setConfirmInput(e.target.value),
10264
10255
  placeholder: "Enter provider ID"
@@ -10289,7 +10280,7 @@ function UnlinkProviderMenu() {
10289
10280
  disabled: !!isProviderUnlinking || !confirmUnlink || confirmInput !== confirmUnlink.externalId,
10290
10281
  className: "w-full flex-1",
10291
10282
  children: [
10292
- isProviderUnlinking && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react34.Loader, { className: "animate-spin h-4 w-4" }),
10283
+ isProviderUnlinking && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react33.Loader, { className: "animate-spin h-4 w-4" }),
10293
10284
  isProviderUnlinking ? "Removing\u2026" : "Remove"
10294
10285
  ]
10295
10286
  }
@@ -10300,7 +10291,7 @@ function UnlinkProviderMenu() {
10300
10291
 
10301
10292
  // src/internal/components/PortfolioMenu/PortfolioMenu.tsx
10302
10293
  var import_react_query28 = require("@tanstack/react-query");
10303
- var import_lucide_react36 = require("lucide-react");
10294
+ var import_lucide_react35 = require("lucide-react");
10304
10295
  var import_react40 = require("react");
10305
10296
 
10306
10297
  // src/modules/assets.ts
@@ -10466,7 +10457,7 @@ function useTokenBalance(tokenAddress, userAddress) {
10466
10457
 
10467
10458
  // src/internal/components/PortfolioMenu/PortfolioItem.tsx
10468
10459
  var import_react_query27 = require("@tanstack/react-query");
10469
- var import_lucide_react35 = require("lucide-react");
10460
+ var import_lucide_react34 = require("lucide-react");
10470
10461
  init_base();
10471
10462
  var import_jsx_runtime52 = require("react/jsx-runtime");
10472
10463
  var price16 = Intl.NumberFormat("en-US", { minimumFractionDigits: 16, maximumFractionDigits: 16 });
@@ -10538,7 +10529,7 @@ function PortfolioItem(props) {
10538
10529
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: formatValue(Number(renderBalance)) }),
10539
10530
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: " " + asset.symbol })
10540
10531
  ] }),
10541
- isRateLoading && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react35.Loader, { className: "h-4 w-4 animate-spin" }),
10532
+ isRateLoading && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react34.Loader, { className: "h-4 w-4 animate-spin" }),
10542
10533
  !isRateLoading && !isProjectAsset && !!assetRate?.price && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: (Number(asset.formattedBalance) * Number(assetRate.price)).toLocaleString("en-US", {
10543
10534
  minimumFractionDigits: 2,
10544
10535
  maximumFractionDigits: 2,
@@ -10577,7 +10568,7 @@ function PortfolioMenu() {
10577
10568
  className: "list-scrollbar-y w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]",
10578
10569
  children: [
10579
10570
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
10580
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react36.ArrowLeft, { className: "h-4 w-4" }) }),
10571
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react35.ArrowLeft, { className: "h-4 w-4" }) }),
10581
10572
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-xl font-semibold", children: "Your Assets" }),
10582
10573
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
10583
10574
  Button,
@@ -10587,17 +10578,17 @@ function PortfolioMenu() {
10587
10578
  size: "icon",
10588
10579
  onClick: refreshAllAssetsBalances,
10589
10580
  disabled: isLoading,
10590
- children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react36.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react36.RefreshCw, { className: "h-4 w-4" })
10581
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react35.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react35.RefreshCw, { className: "h-4 w-4" })
10591
10582
  }
10592
10583
  )
10593
10584
  ] }),
10594
10585
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: [
10595
10586
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex items-center justify-center gap-[var(--l-pass-gap)] p-[var(--l-pass-pd)]", children: [
10596
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react36.Loader, { className: "h-5 w-5 animate-spin" }),
10587
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react35.Loader, { className: "h-5 w-5 animate-spin" }),
10597
10588
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-[var(--l-pass-muted)]", children: "Loading assets..." })
10598
10589
  ] }),
10599
10590
  !isLoading && assets.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex flex-col items-center justify-center py-8 text-[var(--l-pass-muted)]", children: [
10600
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react36.Gem, { className: "w-12 h-12 mb-2" }),
10591
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react35.Gem, { className: "w-12 h-12 mb-2" }),
10601
10592
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: "No assets found" })
10602
10593
  ] }),
10603
10594
  !isLoading && assets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)] py-[var(--l-pass-pd)]", children: [
@@ -10619,7 +10610,7 @@ function PortfolioMenu() {
10619
10610
 
10620
10611
  // src/internal/components/SecurityMenu/SecurityMenu.tsx
10621
10612
  var import_react_query29 = require("@tanstack/react-query");
10622
- var import_lucide_react37 = require("lucide-react");
10613
+ var import_lucide_react36 = require("lucide-react");
10623
10614
  var import_react41 = require("react");
10624
10615
  init_auth();
10625
10616
  init_keyshare();
@@ -10699,7 +10690,7 @@ function SecurityMenu() {
10699
10690
  className: "list-scrollbar-y w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]",
10700
10691
  children: [
10701
10692
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
10702
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.ArrowLeft, { className: "h-4 w-4" }) }),
10693
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.ArrowLeft, { className: "h-4 w-4" }) }),
10703
10694
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xl font-semibold", children: "Security" })
10704
10695
  ] }),
10705
10696
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-between gap-[var(--l-pass-gap)]", children: [
@@ -10712,14 +10703,14 @@ function SecurityMenu() {
10712
10703
  title: "Refresh",
10713
10704
  disabled: isRecoveryRefreshing,
10714
10705
  onClick: () => qc.invalidateQueries({ queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId] }),
10715
- children: isRecoveryRefreshing ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.RefreshCw, { className: "h-4 w-4" })
10706
+ children: isRecoveryRefreshing ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.RefreshCw, { className: "h-4 w-4" })
10716
10707
  }
10717
10708
  )
10718
10709
  ] }),
10719
10710
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "grid grid-cols-3 gap-[var(--l-pass-gap)]", children: [
10720
10711
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2 text-center", children: [
10721
10712
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-center gap-[var(--l-pass-gap)]", children: [
10722
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Cloud, { className: "h-4 w-4" }),
10713
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Cloud, { className: "h-4 w-4" }),
10723
10714
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs font-medium", children: "Server" })
10724
10715
  ] }),
10725
10716
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
@@ -10730,7 +10721,7 @@ function SecurityMenu() {
10730
10721
  serverHasKeyshare ? "bg-[var(--l-pass-bg-success)]" : "bg-[var(--l-pass-bg-warning)]"
10731
10722
  ),
10732
10723
  children: [
10733
- serverHasKeyshare ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.AlertTriangle, { className: "h-4 w-4" }),
10724
+ serverHasKeyshare ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.AlertTriangle, { className: "h-4 w-4" }),
10734
10725
  serverHasKeyshare ? "Ready" : "Missing"
10735
10726
  ]
10736
10727
  }
@@ -10738,7 +10729,7 @@ function SecurityMenu() {
10738
10729
  ] }),
10739
10730
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2 text-center", children: [
10740
10731
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-center gap-[var(--l-pass-gap)]", children: [
10741
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Laptop, { className: "h-4 w-4" }),
10732
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Laptop, { className: "h-4 w-4" }),
10742
10733
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs font-medium", children: "Local" })
10743
10734
  ] }),
10744
10735
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
@@ -10749,7 +10740,7 @@ function SecurityMenu() {
10749
10740
  localInfo?.hasKeyshare ? "bg-[var(--l-pass-bg-success)]" : "bg-[var(--l-pass-bg-warning)]"
10750
10741
  ),
10751
10742
  children: [
10752
- localInfo?.hasKeyshare ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.AlertTriangle, { className: "h-4 w-4" }),
10743
+ localInfo?.hasKeyshare ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.AlertTriangle, { className: "h-4 w-4" }),
10753
10744
  localInfo?.hasKeyshare ? "Ready" : "Missing"
10754
10745
  ]
10755
10746
  }
@@ -10757,7 +10748,7 @@ function SecurityMenu() {
10757
10748
  ] }),
10758
10749
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-2 text-center", children: [
10759
10750
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center justify-center gap-[var(--l-pass-gap)]", children: [
10760
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Shield, { className: "h-4 w-4" }),
10751
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Shield, { className: "h-4 w-4" }),
10761
10752
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-xs font-medium", children: "Vault" })
10762
10753
  ] }),
10763
10754
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
@@ -10768,7 +10759,7 @@ function SecurityMenu() {
10768
10759
  hasServerBackup ? "bg-[var(--l-pass-bg-success)]" : "bg-[var(--l-pass-bg-warning)]"
10769
10760
  ),
10770
10761
  children: [
10771
- hasServerBackup ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.AlertTriangle, { className: "h-4 w-4" }),
10762
+ hasServerBackup ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.CheckCircle2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.AlertTriangle, { className: "h-4 w-4" }),
10772
10763
  hasServerBackup ? "Ready" : "None"
10773
10764
  ]
10774
10765
  }
@@ -10793,28 +10784,28 @@ function SecurityMenu() {
10793
10784
  ] }),
10794
10785
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "space-y-0.5 text-[10px] leading-tight text-[var(--l-pass-fg-muted)]", children: [
10795
10786
  backup.server.enabled && backup.server.lastBackup && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
10796
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Server, { className: "h-2.5 w-2.5" }),
10787
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Server, { className: "h-2.5 w-2.5" }),
10797
10788
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
10798
10789
  "Server: ",
10799
10790
  new Date(backup.server.lastBackup).toLocaleString()
10800
10791
  ] })
10801
10792
  ] }),
10802
10793
  !backup.server.lastBackup && recoveryCreatedAt && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
10803
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Server, { className: "h-2.5 w-2.5" }),
10794
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Server, { className: "h-2.5 w-2.5" }),
10804
10795
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
10805
10796
  "Server: ",
10806
10797
  new Date(recoveryCreatedAt).toLocaleString()
10807
10798
  ] })
10808
10799
  ] }),
10809
10800
  backup.cloud.enabled && backup.cloud.lastBackup && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
10810
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Cloud, { className: "h-2.5 w-2.5" }),
10801
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Cloud, { className: "h-2.5 w-2.5" }),
10811
10802
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
10812
10803
  "Cloud: ",
10813
10804
  new Date(backup.cloud.lastBackup).toLocaleString()
10814
10805
  ] })
10815
10806
  ] }),
10816
10807
  backup.local.enabled && backup.local.lastBackup && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-1", children: [
10817
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.HardDrive, { className: "h-2.5 w-2.5" }),
10808
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.HardDrive, { className: "h-2.5 w-2.5" }),
10818
10809
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
10819
10810
  "Local: ",
10820
10811
  new Date(backup.local.lastBackup).toLocaleString()
@@ -10875,7 +10866,7 @@ function SecurityMenu() {
10875
10866
  origin: app.origin,
10876
10867
  hostname: new URL(app.origin).hostname
10877
10868
  }),
10878
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react37.Trash2, { className: "h-3 w-3" })
10869
+ children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react36.Trash2, { className: "h-3 w-3" })
10879
10870
  }
10880
10871
  )
10881
10872
  ]
@@ -10903,7 +10894,7 @@ function SecurityMenu() {
10903
10894
  }
10904
10895
 
10905
10896
  // src/internal/components/SendRecieveMenu/SendLumiaMenu.tsx
10906
- var import_lucide_react38 = require("lucide-react");
10897
+ var import_lucide_react37 = require("lucide-react");
10907
10898
  var import_react43 = require("react");
10908
10899
  var import_viem6 = require("viem");
10909
10900
  var import_wagmi3 = require("wagmi");
@@ -11049,7 +11040,7 @@ function SendLumiaMenu() {
11049
11040
  };
11050
11041
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
11051
11042
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
11052
- txStep === "input" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react38.ArrowLeft, { className: "h-4 w-4" }) }),
11043
+ txStep === "input" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react37.ArrowLeft, { className: "h-4 w-4" }) }),
11053
11044
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-xl font-semibold", children: "Send LUMIA" })
11054
11045
  ] }),
11055
11046
  txStep === "input" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
@@ -11058,7 +11049,7 @@ function SendLumiaMenu() {
11058
11049
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
11059
11050
  Input,
11060
11051
  {
11061
- Icon: import_lucide_react38.Wallet,
11052
+ Icon: import_lucide_react37.Wallet,
11062
11053
  type: "text",
11063
11054
  value: recipient,
11064
11055
  onChange: (e) => setRecipient(e.target.value),
@@ -11101,7 +11092,7 @@ function SendLumiaMenu() {
11101
11092
  ] })
11102
11093
  ] }),
11103
11094
  (validationError || error) && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex items-center gap-2 p-3 bg-[var(--l-pass-bg-error)] text-[var(--l-pass-error)] rounded-[var(--l-pass-el-bdrs)]", children: [
11104
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react38.AlertCircle, { className: "h-4 w-4" }),
11095
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react37.AlertCircle, { className: "h-4 w-4" }),
11105
11096
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "text-sm", children: validationError || error })
11106
11097
  ] }),
11107
11098
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { onClick: handleSend, disabled: isLoading, className: "w-full", size: "large", children: "Continue" })
@@ -11130,13 +11121,13 @@ function SendLumiaMenu() {
11130
11121
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex gap-2", children: [
11131
11122
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { onClick: () => setTxStep("input"), variant: "outline", className: "flex-1", size: "large", children: "Back" }),
11132
11123
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Button, { onClick: handleConfirm, disabled: isLoading, className: "flex-1", size: "large", children: [
11133
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react38.Loader, { className: "h-4 w-4 animate-spin" }),
11124
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react37.Loader, { className: "h-4 w-4 animate-spin" }),
11134
11125
  "Confirm"
11135
11126
  ] })
11136
11127
  ] })
11137
11128
  ] }),
11138
11129
  txStep === "pending" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "py-8 text-center space-y-4", children: [
11139
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react38.Loader, { className: "h-5 w-5 animate-spin mx-auto" }),
11130
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react37.Loader, { className: "h-5 w-5 animate-spin mx-auto" }),
11140
11131
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
11141
11132
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "block font-medium", children: "Transaction Pending" }),
11142
11133
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "block text-sm mt-1", children: "Please wait while we process your transaction" })
@@ -11144,7 +11135,7 @@ function SendLumiaMenu() {
11144
11135
  ] }),
11145
11136
  txStep === "success" && userOpHash && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
11146
11137
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "text-center py-4", children: [
11147
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react38.CheckCircle2, { className: "h-12 w-12 text-[var(--l-pass-success)] mx-auto mb-3" }),
11138
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react37.CheckCircle2, { className: "h-12 w-12 text-[var(--l-pass-success)] mx-auto mb-3" }),
11148
11139
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "font-medium", children: "Transaction Sent!" }),
11149
11140
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm mt-1", children: "Your transaction is being processed" })
11150
11141
  ] }),
@@ -11154,7 +11145,7 @@ function SendLumiaMenu() {
11154
11145
  }
11155
11146
 
11156
11147
  // src/internal/components/SendRecieveMenu/ReceiveLumiaMenu.tsx
11157
- var import_lucide_react39 = require("lucide-react");
11148
+ var import_lucide_react38 = require("lucide-react");
11158
11149
  var import_qrcode = __toESM(require("qrcode"), 1);
11159
11150
  var import_react44 = require("react");
11160
11151
  init_clients();
@@ -11200,21 +11191,21 @@ function ReceiveLumiaMenu() {
11200
11191
  className: "list-scrollbar-y w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]",
11201
11192
  children: [
11202
11193
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "w-full flex items-center gap-[var(--l-pass-gap)]", children: [
11203
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react39.ArrowLeft, { className: "h-4 w-4" }) }),
11194
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react38.ArrowLeft, { className: "h-4 w-4" }) }),
11204
11195
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-xl font-semibold", children: "Receive LUMIA" })
11205
11196
  ] }),
11206
11197
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Highlight, { className: "text-center", type: "warning", children: [
11207
11198
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("strong", { className: "block w-full", children: `Network: ${lumiaBeam.name}` }),
11208
11199
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "block w-full", children: "Ensure sender is on the same network" })
11209
11200
  ] }),
11210
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center justify-center p-[var(--l-pass-pd)]", style: { minHeight: "216px" }, children: qrCodeUrl ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("img", { src: qrCodeUrl, alt: "Wallet QR Code", className: "w-48 h-48" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react39.Loader, { className: "w-5 h-5 animate-spin text-[var(--l-pass-fg-muted)]" }) }),
11201
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex items-center justify-center p-[var(--l-pass-pd)]", style: { minHeight: "216px" }, children: qrCodeUrl ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("img", { src: qrCodeUrl, alt: "Wallet QR Code", className: "w-48 h-48" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react38.Loader, { className: "w-5 h-5 animate-spin text-[var(--l-pass-fg-muted)]" }) }),
11211
11202
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Highlight, { type: "info", children: [
11212
11203
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "block w-full text-center font-mono text-[10px] break-all mb-2", children: address }),
11213
11204
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { onClick: handleCopy, className: "w-full", size: "medium", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
11214
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react39.CheckCircle2, { className: "h-4 w-4" }),
11205
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react38.CheckCircle2, { className: "h-4 w-4" }),
11215
11206
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: "Copied!" })
11216
11207
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
11217
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react39.Copy, { className: "h-4 w-4" }),
11208
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react38.Copy, { className: "h-4 w-4" }),
11218
11209
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { children: "Copy Address" })
11219
11210
  ] }) })
11220
11211
  ] }),
@@ -11225,11 +11216,11 @@ function ReceiveLumiaMenu() {
11225
11216
  }
11226
11217
 
11227
11218
  // src/internal/components/SettingsMenu/SettingsMenu.tsx
11228
- var import_lucide_react41 = require("lucide-react");
11219
+ var import_lucide_react40 = require("lucide-react");
11229
11220
  var import_react45 = require("react");
11230
11221
 
11231
11222
  // src/internal/components/SettingsMenu/constants.ts
11232
- var import_lucide_react40 = require("lucide-react");
11223
+ var import_lucide_react39 = require("lucide-react");
11233
11224
 
11234
11225
  // src/internal/assets/KycIcon.tsx
11235
11226
  var import_jsx_runtime57 = require("react/jsx-runtime");
@@ -11246,11 +11237,11 @@ function KycIcon(props) {
11246
11237
 
11247
11238
  // src/internal/components/SettingsMenu/constants.ts
11248
11239
  var NAV_BUTTONS = [
11249
- { id: "transactions" /* TRANSACTIONS */, name: "Transactions", Icon: import_lucide_react40.ArrowLeftRight },
11240
+ { id: "transactions" /* TRANSACTIONS */, name: "Transactions", Icon: import_lucide_react39.ArrowLeftRight },
11250
11241
  { id: "kyc" /* KYC */, name: "KYC", Icon: KycIcon },
11251
- { id: "manage-wallet" /* MANAGE_WALLET */, name: "Profiles", Icon: import_lucide_react40.UsersRound },
11252
- { id: "security" /* SECURITY */, name: "Security", Icon: import_lucide_react40.LockKeyhole },
11253
- { id: "keysare-backup" /* KEYSARE_BACKUP */, name: "Backup", Icon: import_lucide_react40.DatabaseBackup }
11242
+ { id: "manage-wallet" /* MANAGE_WALLET */, name: "Profiles", Icon: import_lucide_react39.UsersRound },
11243
+ { id: "security" /* SECURITY */, name: "Security", Icon: import_lucide_react39.LockKeyhole },
11244
+ { id: "keysare-backup" /* KEYSARE_BACKUP */, name: "Backup", Icon: import_lucide_react39.DatabaseBackup }
11254
11245
  ];
11255
11246
 
11256
11247
  // src/internal/components/SettingsMenu/SettingsMenu.tsx
@@ -11266,7 +11257,7 @@ function SettingsMenu() {
11266
11257
  const highlightedKeys = settingsNotifications.map((n) => n.target);
11267
11258
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: [
11268
11259
  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
11269
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react41.ArrowLeft, { className: "h-4 w-4" }) }),
11260
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("main-menu" /* MAIN_MENU */), children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react40.ArrowLeft, { className: "h-4 w-4" }) }),
11270
11261
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-xl font-semibold", children: "Settings" })
11271
11262
  ] }),
11272
11263
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: navItems.map(({ id, name, Icon, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
@@ -11292,7 +11283,7 @@ function SettingsMenu() {
11292
11283
  }
11293
11284
 
11294
11285
  // src/internal/components/TermsOfService.tsx
11295
- var import_lucide_react42 = require("lucide-react");
11286
+ var import_lucide_react41 = require("lucide-react");
11296
11287
  var import_jsx_runtime59 = require("react/jsx-runtime");
11297
11288
  function TermsOfService() {
11298
11289
  const address = useLumiaPassportSession((st) => st.address);
@@ -11306,7 +11297,7 @@ function TermsOfService() {
11306
11297
  size: "icon",
11307
11298
  title: "Back",
11308
11299
  onClick: () => setPage(!!address ? "settings" /* SETTINGS */ : "auth" /* AUTH */),
11309
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react42.ArrowLeft, { className: "h-4 w-4" })
11300
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react41.ArrowLeft, { className: "h-4 w-4" })
11310
11301
  }
11311
11302
  ),
11312
11303
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "text-xl font-semibold", children: "Terms of Service" })
@@ -11320,7 +11311,7 @@ function TermsOfService() {
11320
11311
 
11321
11312
  // src/internal/components/TransactionsMenu/TransactionsMenu.tsx
11322
11313
  var import_react_query30 = require("@tanstack/react-query");
11323
- var import_lucide_react44 = require("lucide-react");
11314
+ var import_lucide_react43 = require("lucide-react");
11324
11315
  var import_react46 = require("react");
11325
11316
 
11326
11317
  // src/internal/components/TransactionsMenu/api.ts
@@ -11612,7 +11603,7 @@ async function getTransactionsListQuery(address) {
11612
11603
  }
11613
11604
 
11614
11605
  // src/internal/components/TransactionsMenu/TransactionsGroup.tsx
11615
- var import_lucide_react43 = require("lucide-react");
11606
+ var import_lucide_react42 = require("lucide-react");
11616
11607
 
11617
11608
  // src/internal/assets/NegativeIcon.tsx
11618
11609
  var import_jsx_runtime60 = require("react/jsx-runtime");
@@ -11708,7 +11699,7 @@ function TransactionsGroup(props) {
11708
11699
  children: [
11709
11700
  /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center justify-between gap-[var(--l-pass-gap)]", children: [
11710
11701
  /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex items-center gap-1 flex-0 w-fit", children: [
11711
- parent.direction === "in" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react43.ChevronLeft, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react43.ChevronRight, { className: "w-4 h-4" }),
11702
+ parent.direction === "in" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react42.ChevronLeft, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react42.ChevronRight, { className: "w-4 h-4" }),
11712
11703
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-[10px]", children: isIncoming ? "RECEIVED" : "SENT" }),
11713
11704
  parent.status === "ok" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(PositiveIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NegativeIcon, {})
11714
11705
  ] }),
@@ -11730,7 +11721,7 @@ function TransactionsGroup(props) {
11730
11721
  onClick: (e) => {
11731
11722
  e.stopPropagation();
11732
11723
  },
11733
- children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react43.Copy, { className: "w-4 h-4" })
11724
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react42.Copy, { className: "w-4 h-4" })
11734
11725
  }
11735
11726
  ),
11736
11727
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
@@ -11829,7 +11820,7 @@ function TransactionsMenu() {
11829
11820
  className: "list-scrollbar-y w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]",
11830
11821
  children: [
11831
11822
  /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2", children: [
11832
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react44.ArrowLeft, { className: "h-4 w-4" }) }),
11823
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { variant: "ghost", size: "icon", title: "Back", onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react43.ArrowLeft, { className: "h-4 w-4" }) }),
11833
11824
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-xl font-semibold", children: "Transaction History" }),
11834
11825
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
11835
11826
  Button,
@@ -11839,14 +11830,14 @@ function TransactionsMenu() {
11839
11830
  onClick: refreshTxHistory,
11840
11831
  disabled: isTxHistoryFetching,
11841
11832
  title: "Refresh transactions",
11842
- children: isTxHistoryFetching ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react44.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react44.RefreshCw, { className: "h-4 w-4" })
11833
+ children: isTxHistoryFetching ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react43.Loader, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react43.RefreshCw, { className: "h-4 w-4" })
11843
11834
  }
11844
11835
  )
11845
11836
  ] }),
11846
11837
  /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: [
11847
- isTxHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react44.Loader, { className: "h-5 w-5 animate-spin" }) }),
11838
+ isTxHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react43.Loader, { className: "h-5 w-5 animate-spin" }) }),
11848
11839
  !isTxHistoryLoading && txHistoryResolvedError && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Highlight, { type: "error", className: "flex gap-[var(--l-pass-gap)]", children: [
11849
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react44.XCircle, { className: "w-4 h-4 flex-none" }),
11840
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react43.XCircle, { className: "w-4 h-4 flex-none" }),
11850
11841
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "block w-full flex-1 text-center text-xs", children: txHistoryResolvedError })
11851
11842
  ] }),
11852
11843
  !isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Highlight, { type: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: "No transactions found. Smart account transactions will appear here" }) }),
@@ -12086,6 +12077,7 @@ function LumiaPassportDialog() {
12086
12077
  useBackupStatusChanges();
12087
12078
  useDetectMaxScrollHeight();
12088
12079
  useSettingsNotifications();
12080
+ useListenIframeAuthEvents();
12089
12081
  useBackupWarning();
12090
12082
  useWalletStatus();
12091
12083
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
@@ -12168,43 +12160,47 @@ var import_wagmi4 = require("wagmi");
12168
12160
  init_wallet();
12169
12161
  function WalletConnectHandler() {
12170
12162
  const qc = (0, import_react_query31.useQueryClient)();
12171
- const { callbacks } = useLumiaPassportConfig();
12172
- const userAddress = useLumiaPassportSession((st) => st.address);
12163
+ const callbacks = useLumiaPassportConfig().callbacks;
12164
+ const passportWalletAddress = useLumiaPassportSession((st) => st.address);
12173
12165
  const { address: walletAddress, isConnected, chain, connector } = (0, import_wagmi4.useAccount)();
12166
+ const { openConnectModal, connectModalOpen } = (0, import_rainbowkit.useConnectModal)();
12174
12167
  const { disconnect } = (0, import_wagmi4.useDisconnect)();
12175
12168
  const { signMessageAsync } = (0, import_wagmi4.useSignMessage)();
12169
+ const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
12176
12170
  const setPage = useLayoutDataStore((st) => st.setPage);
12177
- const { isWalletLinking, setLinkError, setIsWalletLinking, setLinkIsLoading, setProviderType } = useManageWalletStore();
12178
- const onError = (0, import_react52.useCallback)((error) => {
12179
- setLinkError(error);
12180
- setIsWalletLinking(false);
12181
- setPage("manage-wallet" /* MANAGE_WALLET */);
12182
- }, []);
12171
+ const setIsWalletLinking = useLayoutDataStore((st) => st.setIsWalletLinking);
12172
+ const setAuthError = useAuthStore((st) => st.setAlert);
12173
+ const setManageWalletLinkError = useManageWalletStore((st) => st.setLinkError);
12174
+ const setLinkIsLoading = useManageWalletStore((st) => st.setLinkIsLoading);
12175
+ const setProviderType = useManageWalletStore((st) => st.setProviderType);
12183
12176
  const onLinkingComplete = (0, import_react52.useCallback)(
12184
12177
  async (success) => {
12185
- console.log("[WalletConnectHandler] onLinkingComplete called:", { success, userAddress });
12186
12178
  setIsWalletLinking(false);
12179
+ if (!success && !passportWalletAddress) {
12180
+ setProviderType(null);
12181
+ setPage("auth" /* AUTH */);
12182
+ return;
12183
+ }
12184
+ if (!success && passportWalletAddress) {
12185
+ setProviderType(null);
12186
+ setPage("manage-wallet" /* MANAGE_WALLET */);
12187
+ return;
12188
+ }
12187
12189
  setProviderType(null);
12188
12190
  setPage("manage-wallet" /* MANAGE_WALLET */);
12189
- if (success) {
12190
- console.log("[WalletConnectHandler] Invalidating and refetching queries with key:", [
12191
- PROVIDERS_QUERY_KEY,
12192
- userAddress
12193
- ]);
12194
- await qc.invalidateQueries({ queryKey: [PROVIDERS_QUERY_KEY, userAddress], refetchType: "active" });
12195
- await qc.invalidateQueries({ queryKey: [LINKED_PROFILES_QUERY_KEY, userAddress], refetchType: "active" });
12196
- await qc.refetchQueries({ queryKey: [PROVIDERS_QUERY_KEY, userAddress] });
12197
- try {
12198
- callbacks?.onLumiaPassportUpdate?.({ providers: qc.getQueryData([PROVIDERS_QUERY_KEY, userAddress]) });
12199
- } catch {
12200
- }
12191
+ await qc.invalidateQueries({ queryKey: [PROVIDERS_QUERY_KEY, passportWalletAddress], refetchType: "active" });
12192
+ await qc.invalidateQueries({
12193
+ queryKey: [LINKED_PROFILES_QUERY_KEY, passportWalletAddress],
12194
+ refetchType: "active"
12195
+ });
12196
+ try {
12197
+ callbacks?.onLumiaPassportUpdate?.({ providers: qc.getQueryData([PROVIDERS_QUERY_KEY, passportWalletAddress]) });
12198
+ } catch {
12201
12199
  }
12202
12200
  },
12203
- [qc, userAddress, callbacks, setProviderType, setPage, setIsWalletLinking]
12201
+ [qc, passportWalletAddress, callbacks, setProviderType, setPage, setIsWalletLinking]
12204
12202
  );
12205
- const { openConnectModal, connectModalOpen } = (0, import_rainbowkit.useConnectModal)();
12206
12203
  const [hasStartedLinking, setHasStartedLinking] = import_react52.default.useState(false);
12207
- const timeoutRef = import_react52.default.useRef();
12208
12204
  (0, import_react52.useEffect)(() => {
12209
12205
  if (isWalletLinking && !hasStartedLinking) {
12210
12206
  setHasStartedLinking(true);
@@ -12212,94 +12208,101 @@ function WalletConnectHandler() {
12212
12208
  if (isConnected) {
12213
12209
  disconnect();
12214
12210
  setTimeout(() => {
12215
- if (openConnectModal) {
12216
- setPage(null);
12217
- openConnectModal();
12218
- }
12219
- }, 500);
12220
- } else {
12221
- if (openConnectModal) {
12222
12211
  setPage(null);
12223
12212
  openConnectModal();
12224
- }
12213
+ }, 500);
12214
+ } else {
12215
+ setPage(null);
12216
+ openConnectModal();
12225
12217
  }
12226
12218
  }
12227
12219
  if (!isWalletLinking && hasStartedLinking) {
12228
12220
  setHasStartedLinking(false);
12229
- if (timeoutRef.current) clearTimeout(timeoutRef.current);
12230
12221
  if (isConnected) disconnect();
12231
12222
  }
12232
12223
  }, [isWalletLinking, hasStartedLinking, isConnected, openConnectModal, disconnect, setPage, setProviderType]);
12233
12224
  (0, import_react52.useEffect)(() => {
12234
- console.log("[WalletConnectHandler] Modal state check:", {
12235
- hasStartedLinking,
12236
- connectModalOpen,
12237
- isConnected,
12238
- isWalletLinking
12239
- });
12240
12225
  if (hasStartedLinking && !connectModalOpen && !isConnected && isWalletLinking) {
12241
- console.log("[WalletConnectHandler] Modal closed without connecting, resetting state");
12226
+ console.log("[WalletConnectHandler] Modal closed without connecting");
12242
12227
  onLinkingComplete(false);
12243
12228
  setHasStartedLinking(false);
12244
12229
  }
12245
12230
  }, [connectModalOpen, hasStartedLinking, isConnected, isWalletLinking]);
12246
- (0, import_react52.useEffect)(() => {
12247
- if (isConnected && walletAddress && isWalletLinking && hasStartedLinking) {
12248
- handleWalletSign();
12249
- }
12250
- }, [isConnected, walletAddress, isWalletLinking, hasStartedLinking]);
12251
- const handleWalletSign = async () => {
12252
- if (timeoutRef.current) {
12253
- clearTimeout(timeoutRef.current);
12254
- }
12255
- if (!walletAddress || !chain) {
12256
- onError("No wallet connected");
12257
- disconnect();
12258
- onLinkingComplete(false);
12259
- setHasStartedLinking(false);
12260
- return;
12261
- }
12262
- try {
12231
+ const { mutate: handleWalletSign, isPending: isWalletSigning } = (0, import_react_query31.useMutation)({
12232
+ mutationFn: async (payload) => {
12233
+ const { chainId, signingWalletAddress } = payload;
12234
+ if (!signingWalletAddress || !chainId) {
12235
+ disconnect();
12236
+ if (passportWalletAddress) {
12237
+ setManageWalletLinkError("Wallet error! No wallet available");
12238
+ } else {
12239
+ setAuthError({ title: "Wallet error", message: "No wallet available" });
12240
+ }
12241
+ setIsWalletLinking(false);
12242
+ setHasStartedLinking(false);
12243
+ onLinkingComplete(false);
12244
+ setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
12245
+ return;
12246
+ }
12263
12247
  setLinkIsLoading(true);
12264
- const message = createSignatureMessage(walletAddress);
12265
- const signature = await signMessageAsync({ message });
12248
+ const message = createSignatureMessage(signingWalletAddress);
12249
+ const signature = await signMessageAsync({ message, account: signingWalletAddress });
12266
12250
  if (!signature) {
12267
12251
  throw new Error("Failed to get signature");
12268
12252
  }
12269
12253
  const walletName = connector?.name || "Unknown Wallet";
12270
12254
  const walletType = connector?.id || "unknown";
12271
- console.log("[WalletConnectHandler] Wallet metadata:", {
12272
- walletName,
12273
- walletType,
12274
- connectorInfo: connector
12275
- });
12276
- await linkWallet({
12277
- address: walletAddress,
12255
+ return await linkWallet({
12256
+ // chainId: chain.id,
12257
+ chainId,
12258
+ address: signingWalletAddress,
12278
12259
  signature,
12279
12260
  message,
12280
- chainId: chain.id,
12281
12261
  walletName,
12282
12262
  walletType
12283
12263
  });
12264
+ },
12265
+ onSuccess: () => {
12284
12266
  disconnect();
12267
+ setHasStartedLinking(false);
12285
12268
  onLinkingComplete(true);
12269
+ setLinkIsLoading(false);
12270
+ },
12271
+ onError: (err) => {
12272
+ disconnect();
12273
+ setIsWalletLinking(false);
12274
+ onLinkingComplete(false);
12286
12275
  setHasStartedLinking(false);
12287
- } catch (err) {
12276
+ setLinkIsLoading(false);
12288
12277
  const errorMsg = err?.message || "Failed to link wallet";
12289
12278
  if (errorMsg.includes("User rejected") || errorMsg.includes("User denied")) {
12290
- onError("Signature request was cancelled");
12279
+ if (passportWalletAddress) {
12280
+ setManageWalletLinkError("Signature request was cancelled");
12281
+ } else {
12282
+ setAuthError({ title: "Signature error", message: "Signature request was cancelled" });
12283
+ }
12291
12284
  } else if (errorMsg.includes("already linked")) {
12292
- onError("This wallet is already linked to another account");
12285
+ if (passportWalletAddress) {
12286
+ setManageWalletLinkError("This wallet is already linked to another account");
12287
+ } else {
12288
+ setAuthError({ title: "Wallet error", message: "This wallet is already linked to another account" });
12289
+ }
12293
12290
  } else {
12294
- onError(errorMsg);
12291
+ if (passportWalletAddress) {
12292
+ setManageWalletLinkError(errorMsg);
12293
+ } else {
12294
+ setAuthError({ title: "Error", message: errorMsg });
12295
+ }
12295
12296
  }
12296
- disconnect();
12297
- onLinkingComplete(false);
12298
- setHasStartedLinking(false);
12299
- } finally {
12300
- setLinkIsLoading(false);
12297
+ setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
12301
12298
  }
12302
- };
12299
+ });
12300
+ (0, import_react52.useEffect)(() => {
12301
+ if (!!chain?.id && isConnected && walletAddress && isWalletLinking && hasStartedLinking) {
12302
+ console.log("[WalletConnectHandler] handleWalletSign triggered");
12303
+ handleWalletSign({ chainId: chain.id, signingWalletAddress: walletAddress });
12304
+ }
12305
+ }, [chain, isConnected, walletAddress, isWalletLinking, hasStartedLinking]);
12303
12306
  return null;
12304
12307
  }
12305
12308
 
@@ -12479,7 +12482,7 @@ var useLumiaPassportConfig = () => {
12479
12482
  };
12480
12483
 
12481
12484
  // src/components/ConnectWalletButton.tsx
12482
- var import_lucide_react45 = require("lucide-react");
12485
+ var import_lucide_react44 = require("lucide-react");
12483
12486
  var import_react55 = require("react");
12484
12487
  init_auth();
12485
12488
  var import_jsx_runtime68 = (
@@ -12522,7 +12525,7 @@ function ConnectWalletButton(props) {
12522
12525
  disabled: isConnecting,
12523
12526
  onClick: () => setPage("auth" /* AUTH */),
12524
12527
  children: [
12525
- isConnecting && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react45.Loader, { className: "w-4 h-4 animate-spin" }),
12528
+ isConnecting && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }),
12526
12529
  connectButtonLabel
12527
12530
  ]
12528
12531
  }
@@ -12542,7 +12545,7 @@ function ConnectWalletButton(props) {
12542
12545
  "disabled:hover:bg-[var(--l-pass-bg)] disabled:active:bg-[var(--l-pass-bg)]"
12543
12546
  ),
12544
12547
  children: [
12545
- isConnecting && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react45.Loader, { className: "w-4 h-4 animate-spin" }),
12548
+ isConnecting && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react44.Loader, { className: "w-4 h-4 animate-spin" }),
12546
12549
  connectButtonLabel.toUpperCase()
12547
12550
  ]
12548
12551
  }
@@ -12570,7 +12573,7 @@ function ConnectWalletButton(props) {
12570
12573
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center space-x-1", children: [
12571
12574
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "group relative", children: [
12572
12575
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
12573
- import_lucide_react45.Cloud,
12576
+ import_lucide_react44.Cloud,
12574
12577
  {
12575
12578
  className: `w-3 h-3 ${indicators.server ? "text-[var(--l-pass-bg-success)]" : "text-[var(--l-pass-bg-warning)]"}`
12576
12579
  }
@@ -12592,7 +12595,7 @@ function ConnectWalletButton(props) {
12592
12595
  ] }),
12593
12596
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "group relative", children: [
12594
12597
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
12595
- import_lucide_react45.Laptop,
12598
+ import_lucide_react44.Laptop,
12596
12599
  {
12597
12600
  className: `w-3 h-3 ${indicators.local ? "text-[var(--l-pass-bg-success)]" : "text-[var(--l-pass-bg-warning)]"}`
12598
12601
  }
@@ -12614,7 +12617,7 @@ function ConnectWalletButton(props) {
12614
12617
  ] }),
12615
12618
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "group relative", children: [
12616
12619
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
12617
- import_lucide_react45.Shield,
12620
+ import_lucide_react44.Shield,
12618
12621
  {
12619
12622
  className: `w-3 h-3 ${indicators.backup ? "text-[var(--l-pass-bg-success)]" : "text-[var(--l-pass-bg-warning)]"}`
12620
12623
  }
@@ -12728,7 +12731,7 @@ function useLumiaPassportColorMode() {
12728
12731
  }
12729
12732
 
12730
12733
  // src/components/ThemeToggle.tsx
12731
- var import_lucide_react46 = require("lucide-react");
12734
+ var import_lucide_react45 = require("lucide-react");
12732
12735
  var import_jsx_runtime69 = require("react/jsx-runtime");
12733
12736
  function ThemeToggle(props) {
12734
12737
  const { colorMode, setColorMode } = useLumiaPassportColorMode();
@@ -12745,7 +12748,7 @@ function ThemeToggle(props) {
12745
12748
  variant: "ghost",
12746
12749
  onClick: () => setColorMode(colorMode === "light" ? "dark" : "light"),
12747
12750
  title: `Current theme: ${colorMode}. Click to switch.`,
12748
- children: colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react46.Sun, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react46.Moon, { className: "w-4 h-4" })
12751
+ children: colorMode === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react45.Sun, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react45.Moon, { className: "w-4 h-4" })
12749
12752
  }
12750
12753
  )
12751
12754
  }
@@ -13006,7 +13009,7 @@ function LumiaRainbowKitProvider({ children }) {
13006
13009
  }
13007
13010
 
13008
13011
  // src/internal/components/UserOpStatus.tsx
13009
- var import_lucide_react48 = require("lucide-react");
13012
+ var import_lucide_react47 = require("lucide-react");
13010
13013
  var React13 = __toESM(require("react"), 1);
13011
13014
  init_base();
13012
13015
 
@@ -13018,7 +13021,7 @@ function cn2(...inputs) {
13018
13021
  }
13019
13022
 
13020
13023
  // src/internal/components/Address.tsx
13021
- var import_lucide_react47 = require("lucide-react");
13024
+ var import_lucide_react46 = require("lucide-react");
13022
13025
  var React12 = __toESM(require("react"), 1);
13023
13026
  var import_jsx_runtime71 = require("react/jsx-runtime");
13024
13027
  function toExplorerAddressUrl(address, chain) {
@@ -13060,7 +13063,7 @@ var Address = ({
13060
13063
  } catch {
13061
13064
  }
13062
13065
  },
13063
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react47.Copy, { className: "h-4 w-4" })
13066
+ children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react46.Copy, { className: "h-4 w-4" })
13064
13067
  }
13065
13068
  ),
13066
13069
  showExplorer && explorer && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
@@ -13071,7 +13074,7 @@ var Address = ({
13071
13074
  rel: "noreferrer noopener",
13072
13075
  className: "inline-flex items-center justify-center h-10 w-10 rounded-md hover:bg-accent text-foreground",
13073
13076
  title: "Open in explorer",
13074
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react47.ExternalLink, { className: "h-4 w-4" })
13077
+ children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react46.ExternalLink, { className: "h-4 w-4" })
13075
13078
  }
13076
13079
  )
13077
13080
  ] });
@@ -13237,30 +13240,30 @@ var UserOpStatus = ({
13237
13240
  if (receipt) {
13238
13241
  const ok = !!receipt.success;
13239
13242
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Badge, { variant: ok ? "success" : "destructive", className: "gap-1", children: [
13240
- ok ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.CheckCircle2, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-3 w-3" }),
13243
+ ok ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.CheckCircle2, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-3 w-3" }),
13241
13244
  ok ? "Included" : "Failed"
13242
13245
  ] });
13243
13246
  }
13244
13247
  if (rejected) {
13245
13248
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Badge, { variant: "destructive", className: "gap-1", children: [
13246
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-3 w-3" }),
13249
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-3 w-3" }),
13247
13250
  " Rejected by bundler"
13248
13251
  ] });
13249
13252
  }
13250
13253
  if (timedOut) {
13251
13254
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Badge, { variant: "warning", className: "gap-1", children: [
13252
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-3 w-3" }),
13255
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-3 w-3" }),
13253
13256
  " Timeout - may be rejected"
13254
13257
  ] });
13255
13258
  }
13256
13259
  if (mempool) {
13257
13260
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Badge, { variant: "outline", className: "gap-1", children: [
13258
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.Clock, { className: "h-3 w-3" }),
13261
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.Clock, { className: "h-3 w-3" }),
13259
13262
  " Pending in bundler"
13260
13263
  ] });
13261
13264
  }
13262
13265
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Badge, { variant: "secondary", className: "gap-1", children: [
13263
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.Clock, { className: "h-3 w-3" }),
13266
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.Clock, { className: "h-3 w-3" }),
13264
13267
  " Waiting"
13265
13268
  ] });
13266
13269
  };
@@ -13279,7 +13282,7 @@ var UserOpStatus = ({
13279
13282
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xs text-muted-foreground", children: "This is a UserOperation hash (EIP-4337), not a L2 tx hash." })
13280
13283
  ] }),
13281
13284
  /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Button, { variant: "ghost", size: "small", onClick: () => tick(), disabled: refreshing, className: "h-8", children: [
13282
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.RefreshCw, { className: cn2("h-3.5 w-3.5 mr-1", refreshing && "animate-spin") }),
13285
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.RefreshCw, { className: cn2("h-3.5 w-3.5 mr-1", refreshing && "animate-spin") }),
13283
13286
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xs", children: "Refresh" })
13284
13287
  ] })
13285
13288
  ] }),
@@ -13298,7 +13301,7 @@ var UserOpStatus = ({
13298
13301
  } catch {
13299
13302
  }
13300
13303
  },
13301
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.Copy, { className: "h-3.5 w-3.5" })
13304
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.Copy, { className: "h-3.5 w-3.5" })
13302
13305
  }
13303
13306
  )
13304
13307
  ] }),
@@ -13317,7 +13320,7 @@ var UserOpStatus = ({
13317
13320
  } catch {
13318
13321
  }
13319
13322
  },
13320
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.Copy, { className: "h-3.5 w-3.5" })
13323
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.Copy, { className: "h-3.5 w-3.5" })
13321
13324
  }
13322
13325
  ),
13323
13326
  chain?.blockExplorers?.default?.url && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
@@ -13328,7 +13331,7 @@ var UserOpStatus = ({
13328
13331
  rel: "noreferrer noopener",
13329
13332
  className: "inline-flex items-center justify-center h-8 w-8 rounded-md hover:bg-accent text-foreground",
13330
13333
  title: "Open in explorer",
13331
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.ExternalLink, { className: "h-3.5 w-3.5" })
13334
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.ExternalLink, { className: "h-3.5 w-3.5" })
13332
13335
  }
13333
13336
  )
13334
13337
  ] }),
@@ -13357,16 +13360,16 @@ var UserOpStatus = ({
13357
13360
  ] })
13358
13361
  ] }),
13359
13362
  error && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
13360
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-4 w-4" }),
13363
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-4 w-4" }),
13361
13364
  " ",
13362
13365
  error
13363
13366
  ] }),
13364
13367
  rejected && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
13365
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-4 w-4" }),
13368
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-4 w-4" }),
13366
13369
  "UserOperation was dropped from bundler mempool. This usually means it was invalid or replaced."
13367
13370
  ] }),
13368
13371
  timedOut && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
13369
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react48.AlertCircle, { className: "h-4 w-4" }),
13372
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react47.AlertCircle, { className: "h-4 w-4" }),
13370
13373
  "Stopped polling after ",
13371
13374
  Math.round(maxPollTimeMs / 1e3),
13372
13375
  "s. UserOperation may have been rejected by the bundler."
@@ -13377,7 +13380,7 @@ var UserOpStatus = ({
13377
13380
  };
13378
13381
 
13379
13382
  // src/internal/components/Hash.tsx
13380
- var import_lucide_react49 = require("lucide-react");
13383
+ var import_lucide_react48 = require("lucide-react");
13381
13384
  var React14 = __toESM(require("react"), 1);
13382
13385
  var import_jsx_runtime74 = require("react/jsx-runtime");
13383
13386
  function toExplorerUrl(kind, value, chain) {
@@ -13421,7 +13424,7 @@ var Hash = ({
13421
13424
  } catch {
13422
13425
  }
13423
13426
  },
13424
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react49.Copy, { className: "h-4 w-4" })
13427
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react48.Copy, { className: "h-4 w-4" })
13425
13428
  }
13426
13429
  ),
13427
13430
  showExplorer && explorer && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
@@ -13432,7 +13435,7 @@ var Hash = ({
13432
13435
  rel: "noreferrer noopener",
13433
13436
  className: "inline-flex items-center justify-center h-10 w-10 rounded-md hover:bg-accent text-foreground",
13434
13437
  title: "Open in explorer",
13435
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react49.ExternalLink, { className: "h-4 w-4" })
13438
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react48.ExternalLink, { className: "h-4 w-4" })
13436
13439
  }
13437
13440
  )
13438
13441
  ] });