@yieldfabric/wallet 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5353,7 +5353,7 @@ var init_SignupFlow = __esm({
5353
5353
  };
5354
5354
  AvererSidebar = ({ onError }) => {
5355
5355
  const navigate = useWalletNavigate();
5356
- return /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "w-full md:w-[360px] md:h-screen bg-background flex md:flex-col items-start justify-between md:justify-between gap-4 px-6 py-5 md:p-10 border-b md:border-b-0 md:border-r border-border-light/20", children: [
5356
+ return /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "w-full md:w-[360px] md:h-screen bg-background flex md:flex-col items-start justify-between md:justify-between gap-4 px-6 pt-[calc(1.25rem+env(safe-area-inset-top))] pb-5 md:p-10 border-b md:border-b-0 md:border-r border-border-light", children: [
5357
5357
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6 md:gap-10", children: [
5358
5358
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(YieldFabricLockup, { size: 32 }) }),
5359
5359
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden md:block space-y-3 max-w-[260px]", children: [
@@ -5962,7 +5962,7 @@ function clearDynamicSession() {
5962
5962
  init_WalletConfigContext();
5963
5963
  var WalletAuthContext = React54.createContext(void 0);
5964
5964
  function WalletAuthProvider({ children }) {
5965
- const { onSessionBootstrapped } = useWalletConfig();
5965
+ const { onSessionBootstrapped, onBeforeLogout } = useWalletConfig();
5966
5966
  const [user, setUser] = React54.useState(null);
5967
5967
  const [isLoading, setIsLoading] = React54.useState(true);
5968
5968
  const [error, setError] = React54.useState(null);
@@ -6055,6 +6055,7 @@ function WalletAuthProvider({ children }) {
6055
6055
  setIsLoading(true);
6056
6056
  setError(null);
6057
6057
  tokenRenewalService.stopRenewal();
6058
+ await Promise.resolve().then(() => onBeforeLogout?.()).catch(() => void 0);
6058
6059
  await exports.authService.logout();
6059
6060
  clearDynamicSession();
6060
6061
  setUser(null);
@@ -6070,6 +6071,7 @@ function WalletAuthProvider({ children }) {
6070
6071
  setIsLoading(true);
6071
6072
  setError(null);
6072
6073
  tokenRenewalService.stopRenewal();
6074
+ await Promise.resolve().then(() => onBeforeLogout?.()).catch(() => void 0);
6073
6075
  await exports.authService.logoutAll();
6074
6076
  clearDynamicSession();
6075
6077
  setUser(null);
@@ -8794,6 +8796,16 @@ var WalletCenterContext = React54.createContext(null);
8794
8796
  function WalletCenterProvider({ children }) {
8795
8797
  const [isOpen, setIsOpen] = React54.useState(false);
8796
8798
  const [requestedView, setRequestedView] = React54.useState("menu");
8799
+ const [host, setHostElement] = React54.useState(null);
8800
+ const [hostOptions, setHostOptions] = React54.useState({});
8801
+ const [hostTitle, setHostTitle] = React54.useState(null);
8802
+ const setHost = React54.useCallback((next) => {
8803
+ setHostElement((current) => {
8804
+ if (current === next) return current;
8805
+ if (!next) setHostTitle(null);
8806
+ return next;
8807
+ });
8808
+ }, []);
8797
8809
  const openWalletCenter = React54.useCallback((view = "menu") => {
8798
8810
  setRequestedView(view);
8799
8811
  setIsOpen(true);
@@ -8803,8 +8815,8 @@ function WalletCenterProvider({ children }) {
8803
8815
  setRequestedView("menu");
8804
8816
  }, []);
8805
8817
  const value = React54.useMemo(
8806
- () => ({ isOpen, requestedView, openWalletCenter, closeWalletCenter }),
8807
- [isOpen, requestedView, openWalletCenter, closeWalletCenter]
8818
+ () => ({ isOpen, requestedView, openWalletCenter, closeWalletCenter, host, setHost, hostOptions, setHostOptions, hostTitle, setHostTitle }),
8819
+ [isOpen, requestedView, openWalletCenter, closeWalletCenter, host, setHost, hostOptions, hostTitle]
8808
8820
  );
8809
8821
  return /* @__PURE__ */ jsxRuntime.jsx(WalletCenterContext.Provider, { value, children });
8810
8822
  }
@@ -8832,53 +8844,105 @@ function RedirectTo({ href, replace = true }) {
8832
8844
  return null;
8833
8845
  }
8834
8846
 
8835
- // src/core/entityEvents.ts
8836
- init_tokenManager();
8837
- init_config();
8838
- function subscribeEntityEvents(entityId, onEvent, onError) {
8839
- let eventSource = null;
8840
- let reconnectTimeout = null;
8841
- let attempts = 0;
8847
+ // src/core/jsonEventStream.ts
8848
+ function subscribeJsonEvents(options) {
8842
8849
  let closed = false;
8843
- function connect() {
8850
+ let retry = 0;
8851
+ let timer;
8852
+ let controller;
8853
+ const connect = async () => {
8844
8854
  if (closed) return;
8845
- const token = exports.tokenManager.getCurrentToken();
8846
- if (!token) {
8847
- onError?.(new Error("No auth token for entity event stream"));
8848
- reconnectTimeout = setTimeout(connect, 5e3);
8849
- return;
8850
- }
8851
- const baseUrl = getPaymentsServiceUrl();
8852
- const url = `${baseUrl}/api/events/stream?entity_id=${encodeURIComponent(entityId)}&access_token=${encodeURIComponent(token)}`;
8853
- eventSource = new EventSource(url);
8854
- eventSource.onmessage = (e) => {
8855
- try {
8856
- onEvent(JSON.parse(e.data));
8857
- } catch {
8858
- }
8859
- };
8860
- eventSource.onopen = () => {
8861
- attempts = 0;
8855
+ const attempt = new AbortController();
8856
+ controller = attempt;
8857
+ let reader;
8858
+ let stall;
8859
+ const renewDeadline = () => {
8860
+ if (stall) clearTimeout(stall);
8861
+ stall = setTimeout(() => attempt.abort(), 75e3);
8862
8862
  };
8863
- eventSource.onerror = () => {
8864
- eventSource?.close();
8865
- eventSource = null;
8866
- if (closed) return;
8867
- attempts++;
8868
- const delay2 = Math.min(1e3 * Math.pow(2, attempts - 1), 3e4);
8869
- reconnectTimeout = setTimeout(connect, delay2);
8870
- onError?.(new Error(`Entity SSE error, reconnecting in ${delay2}ms`));
8871
- };
8872
- }
8873
- connect();
8863
+ try {
8864
+ renewDeadline();
8865
+ const token = options.token();
8866
+ if (!token) throw new Error("Sign in to receive live updates.");
8867
+ const response = await fetch(options.url(), {
8868
+ headers: { Authorization: `Bearer ${token}`, Accept: "text/event-stream" },
8869
+ signal: attempt.signal,
8870
+ credentials: "omit",
8871
+ cache: "no-store",
8872
+ redirect: "error"
8873
+ });
8874
+ if (!response.ok || !response.headers.get("content-type")?.includes("text/event-stream") || !response.body) {
8875
+ throw new Error(`Live updates unavailable (HTTP ${response.status}).`);
8876
+ }
8877
+ reader = response.body.getReader();
8878
+ const decoder = new TextDecoder();
8879
+ let buffer = "", data = [], size = 0;
8880
+ while (!closed) {
8881
+ const part = await reader.read();
8882
+ if (part.done) break;
8883
+ renewDeadline();
8884
+ buffer += decoder.decode(part.value, { stream: true });
8885
+ for (; ; ) {
8886
+ const end = buffer.search(/[\r\n]/);
8887
+ if (end < 0 || buffer[end] === "\r" && end === buffer.length - 1) break;
8888
+ const line = buffer.slice(0, end);
8889
+ const delimiter = buffer[end] === "\r" && buffer[end + 1] === "\n" ? 2 : 1;
8890
+ buffer = buffer.slice(end + delimiter);
8891
+ size += line.length;
8892
+ if (size > 262144) throw new Error("Live update exceeded its size limit.");
8893
+ if (!line) {
8894
+ if (data.length) {
8895
+ let value;
8896
+ try {
8897
+ value = JSON.parse(data.join("\n"));
8898
+ } catch {
8899
+ }
8900
+ if (value !== void 0 && !closed) {
8901
+ retry = 0;
8902
+ options.onEvent(value);
8903
+ }
8904
+ }
8905
+ data = [];
8906
+ size = 0;
8907
+ } else if (line.startsWith("data:")) {
8908
+ data.push(line.slice(5).replace(/^ /, ""));
8909
+ }
8910
+ }
8911
+ if (buffer.length + size > 262144) throw new Error("Live update exceeded its size limit.");
8912
+ }
8913
+ if (!closed) throw new Error("Live updates disconnected.");
8914
+ } catch (error) {
8915
+ if (!closed) options.onError?.(error instanceof Error ? error : new Error("Live updates unavailable."));
8916
+ } finally {
8917
+ if (stall) clearTimeout(stall);
8918
+ attempt.abort();
8919
+ if (reader) {
8920
+ void reader.cancel().catch(() => void 0);
8921
+ reader.releaseLock();
8922
+ }
8923
+ if (!closed) timer = setTimeout(() => void connect(), Math.min(1e3 * 2 ** Math.min(retry++, 5), 3e4));
8924
+ }
8925
+ };
8926
+ void connect();
8874
8927
  return () => {
8875
8928
  closed = true;
8876
- eventSource?.close();
8877
- eventSource = null;
8878
- if (reconnectTimeout) clearTimeout(reconnectTimeout);
8929
+ if (timer) clearTimeout(timer);
8930
+ controller?.abort();
8879
8931
  };
8880
8932
  }
8881
8933
 
8934
+ // src/core/entityEvents.ts
8935
+ init_tokenManager();
8936
+ init_config();
8937
+ function subscribeEntityEvents(entityId, onEvent, onError) {
8938
+ return subscribeJsonEvents({
8939
+ url: () => `${getPaymentsServiceUrl()}/api/events/stream?entity_id=${encodeURIComponent(entityId)}`,
8940
+ token: () => exports.tokenManager.getCurrentToken(),
8941
+ onEvent,
8942
+ onError
8943
+ });
8944
+ }
8945
+
8882
8946
  // src/core/globalNotificationService.ts
8883
8947
  var _GlobalNotificationService = class _GlobalNotificationService {
8884
8948
  constructor(callbacks) {
@@ -9255,11 +9319,11 @@ function humanizeMessageType(messageType) {
9255
9319
  return spaced.charAt(0).toUpperCase() + spaced.slice(1);
9256
9320
  }
9257
9321
  var TONE_COLORS = {
9258
- success: { dotClass: "bg-emerald-300", textClass: "text-emerald-300", bgClass: "bg-emerald-950/[0.16]" },
9259
- danger: { dotClass: "bg-red-300", textClass: "text-red-200", bgClass: "bg-red-950/[0.16]" },
9260
- warn: { dotClass: "bg-amber-300", textClass: "text-amber-200", bgClass: "bg-amber-950/[0.14]" },
9261
- info: { dotClass: "bg-blue-300", textClass: "text-blue-200", bgClass: "bg-blue-950/[0.14]" },
9262
- neutral: { dotClass: "bg-white/[0.34]", textClass: "text-white/[0.56]", bgClass: "bg-white/[0.045]" }
9322
+ success: { dotClass: "bg-emerald-300", textClass: "text-status-success-text dark:text-emerald-300", bgClass: "bg-status-success-bg dark:bg-emerald-950/[0.16]" },
9323
+ danger: { dotClass: "bg-red-300", textClass: "text-status-error-text dark:text-red-200", bgClass: "bg-status-error-bg dark:bg-red-950/[0.16]" },
9324
+ warn: { dotClass: "bg-amber-300", textClass: "text-status-warning-text dark:text-amber-200", bgClass: "bg-status-warning-bg dark:bg-amber-950/[0.14]" },
9325
+ info: { dotClass: "bg-blue-300", textClass: "text-azure dark:text-blue-200", bgClass: "bg-azure-tint dark:bg-blue-950/[0.14]" },
9326
+ neutral: { dotClass: "bg-text-muted dark:bg-white/[0.34]", textClass: "text-text-muted dark:text-white/[0.56]", bgClass: "bg-chip dark:bg-white/[0.045]" }
9263
9327
  };
9264
9328
  var STATUS_TO_TONE = {
9265
9329
  completed: "success",
@@ -9390,7 +9454,7 @@ function CenterPrimaryButton({
9390
9454
  size = "sm",
9391
9455
  className = ""
9392
9456
  }) {
9393
- const sizeClasses2 = size === "md" ? "text-[12px] px-3 py-1.5" : "text-[11px] px-2.5 py-1";
9457
+ const sizeClasses2 = size === "md" ? "text-[12px] px-3 py-1.5 max-lg:min-h-[44px] max-lg:px-4 max-lg:text-[13px]" : "text-[11px] px-2.5 py-1 max-lg:min-h-[44px] max-lg:px-4 max-lg:text-[13px]";
9394
9458
  return /* @__PURE__ */ jsxRuntime.jsx(
9395
9459
  "button",
9396
9460
  {
@@ -9399,7 +9463,7 @@ function CenterPrimaryButton({
9399
9463
  onClick,
9400
9464
  className: [
9401
9465
  "font-medium rounded-md transition-colors",
9402
- "bg-cta text-on-cta hover:bg-cta-hover",
9466
+ "bg-cta text-on-cta hover:bg-cta-hover active:opacity-90",
9403
9467
  "disabled:opacity-50 disabled:cursor-not-allowed",
9404
9468
  sizeClasses2,
9405
9469
  className
@@ -10323,7 +10387,7 @@ function LoginPage({
10323
10387
  align = "center",
10324
10388
  logo
10325
10389
  }) {
10326
- const alignClass = align === "top" ? "items-start pt-12 pb-12" : "items-center";
10390
+ const alignClass = align === "top" ? "items-start pt-[calc(3rem+env(safe-area-inset-top))] pb-12" : "items-center pt-[env(safe-area-inset-top)]";
10327
10391
  return /* @__PURE__ */ jsxRuntime.jsx(
10328
10392
  "div",
10329
10393
  {
@@ -10462,7 +10526,7 @@ function OnboardingChoosePath({ chrome } = {}) {
10462
10526
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto max-w-[520px] text-center space-y-1.5", children: [
10463
10527
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[18px] text-text-primary font-medium", children: messages.choosePath.header }),
10464
10528
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-text-secondary", children: messages.choosePath.subheader }),
10465
- configError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-orange-400 mt-2", children: "Provider config unavailable \u2014 falling back to email only." })
10529
+ configError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-status-warning-text dark:text-orange-400 mt-2", children: "Provider config unavailable \u2014 falling back to email only." })
10466
10530
  ] }),
10467
10531
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto w-full max-w-[480px] space-y-2.5", children: [
10468
10532
  avererEnabled && /* @__PURE__ */ jsxRuntime.jsx(
@@ -11460,7 +11524,7 @@ function StripeProgressPanel({
11460
11524
  detail ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-[10px] leading-relaxed text-text-secondary/75", children: detail }) : null
11461
11525
  ] })
11462
11526
  ] }),
11463
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default/40", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-full w-2/3 rounded-full ${delayed ? "bg-status-warning-text" : "bg-cta"} motion-safe:animate-pulse` }) })
11527
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-full w-2/3 rounded-full ${delayed ? "bg-status-warning-text" : "bg-cta"} motion-safe:animate-pulse` }) })
11464
11528
  ] });
11465
11529
  }
11466
11530
  function StripeResultPanel({
@@ -11866,7 +11930,7 @@ function ProgressPanel({
11866
11930
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[16px] font-medium text-text-primary leading-snug", children: title }),
11867
11931
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[12px] leading-relaxed text-text-secondary", children: body })
11868
11932
  ] }),
11869
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default/40", children: /* @__PURE__ */ jsxRuntime.jsx(
11933
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default", children: /* @__PURE__ */ jsxRuntime.jsx(
11870
11934
  "div",
11871
11935
  {
11872
11936
  className: `h-full w-2/3 rounded-full motion-safe:animate-pulse ${delayed ? "bg-status-warning-text" : "bg-cta"}`
@@ -12211,7 +12275,7 @@ function OnboardingChooseMethod({ chrome } = {}) {
12211
12275
  return /* @__PURE__ */ jsxRuntime.jsx(StepShell, { chrome, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
12212
12276
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
12213
12277
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[16px] text-text-primary", children: messages.chooseMethod.header }),
12214
- configError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-orange-400 mt-2", children: "Provider config unavailable \u2014 falling back to email only." })
12278
+ configError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-status-warning-text dark:text-orange-400 mt-2", children: "Provider config unavailable \u2014 falling back to email only." })
12215
12279
  ] }),
12216
12280
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
12217
12281
  enabled.map(({ id, impl }) => {
@@ -13004,7 +13068,7 @@ function SkeletonAvatar({
13004
13068
  {
13005
13069
  role: "img",
13006
13070
  "aria-label": choice ? `${name} - ${choice.label} avatar` : `${name}'s avatar`,
13007
- className: `rounded-full overflow-hidden flex items-center justify-center select-none bg-[#252525] ${className}`,
13071
+ className: `rounded-full overflow-hidden flex items-center justify-center select-none bg-surface-alt dark:bg-[#252525] ${className}`,
13008
13072
  style: {
13009
13073
  width: size,
13010
13074
  height: size
@@ -13057,7 +13121,7 @@ function AvatarPicker({
13057
13121
  onClick: () => onChange(c.id),
13058
13122
  className: [
13059
13123
  "rounded-full flex items-center justify-center select-none overflow-hidden",
13060
- "transition-all border-2 bg-[#252525]",
13124
+ "transition-all border-2 bg-surface-alt dark:bg-[#252525]",
13061
13125
  selected ? "border-primary scale-105" : "border-transparent hover:border-border-light"
13062
13126
  ].join(" "),
13063
13127
  style: { width: tileSize, height: tileSize },
@@ -14935,7 +14999,7 @@ function RecoveryPanel({
14935
14999
  return /* @__PURE__ */ jsxRuntime.jsx(
14936
15000
  "div",
14937
15001
  {
14938
- className: "rounded-lg border border-status-warning-text/25 bg-status-warning-bg/80 px-3.5 py-3 text-status-warning-text",
15002
+ className: "rounded-lg border border-status-warning-text/25 bg-status-warning-bg px-3.5 py-3 text-status-warning-text",
14939
15003
  role: "alert",
14940
15004
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
14941
15005
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: `mt-0.5 h-8 w-8 shrink-0 rounded-full flex items-center justify-center ${iconClass}`, children: /* @__PURE__ */ jsxRuntime.jsx(outline.ExclamationTriangleIcon, { className: "h-4 w-4", strokeWidth: 1.8 }) }),
@@ -15376,7 +15440,7 @@ function AddWalletsStep({ chrome } = {}) {
15376
15440
  showDynamic && /* @__PURE__ */ jsxRuntime.jsx(
15377
15441
  "div",
15378
15442
  {
15379
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",
15443
+ className: "fixed inset-0 z-[10000] flex items-center justify-center bg-black/70 p-4",
15380
15444
  role: "dialog",
15381
15445
  "aria-modal": "true",
15382
15446
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-md rounded-lg border border-border-default bg-surface p-4", children: [
@@ -15456,6 +15520,8 @@ var Drawer = ({
15456
15520
  React54.useEffect(() => {
15457
15521
  if (!isOpen || typeof document === "undefined") return;
15458
15522
  const previouslyFocused = document.activeElement;
15523
+ const bodyOverflow = document.body.style.overflow;
15524
+ document.body.style.overflow = "hidden";
15459
15525
  const initialFocus = panelRef.current?.querySelector("[data-drawer-initial-focus]") ?? closeButtonRef.current;
15460
15526
  initialFocus?.focus();
15461
15527
  const handleKeyDown = (event) => {
@@ -15486,11 +15552,16 @@ var Drawer = ({
15486
15552
  document.addEventListener("keydown", handleKeyDown);
15487
15553
  return () => {
15488
15554
  document.removeEventListener("keydown", handleKeyDown);
15555
+ document.body.style.overflow = bodyOverflow;
15489
15556
  previouslyFocused?.focus?.();
15490
15557
  };
15491
15558
  }, [isOpen, onClose]);
15492
- const widthClass = maxWidth === "sm" ? "w-full max-w-sm" : maxWidth === "md" ? "w-full max-w-md" : maxWidth === "lg" ? "w-full max-w-2xl" : maxWidth === "half" ? "w-1/2" : maxWidth === "full-mobile" ? "w-full xl:w-1/2" : maxWidth === "full" ? "w-full" : "w-full max-w-md";
15493
- const widthStyle = maxWidth === "lg" ? { width: "672px", maxWidth: "672px" } : maxWidth === "half" ? { width: "50vw", maxWidth: "50vw" } : maxWidth === "full-mobile" ? {} : {};
15559
+ const widthClass = maxWidth === "sm" ? "w-full max-w-sm" : maxWidth === "md" ? "w-full max-w-md" : maxWidth === "lg" ? "w-full max-w-2xl" : maxWidth === "half" ? "w-full lg:w-1/2" : maxWidth === "full-mobile" ? "w-full xl:w-1/2" : maxWidth === "full" ? "w-full" : "w-full max-w-md";
15560
+ const widthStyle = maxWidth === "lg" ? { width: "672px", maxWidth: "672px" } : (
15561
+ // 'half' is a desk shape; a hard 50vw made it 187px on a phone. The
15562
+ // class carries the split now, so there is no inline width to fight.
15563
+ maxWidth === "half" ? {} : maxWidth === "full-mobile" ? {} : {}
15564
+ );
15494
15565
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 overflow-hidden z-[10000]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 overflow-hidden", children: [
15495
15566
  /* @__PURE__ */ jsxRuntime.jsx(
15496
15567
  "div",
@@ -15506,7 +15577,7 @@ var Drawer = ({
15506
15577
  role: "dialog",
15507
15578
  "aria-modal": "true",
15508
15579
  "aria-labelledby": titleId,
15509
- className: `pointer-events-auto ${panelBg} shadow-2xl h-full flex flex-col ${widthClass} ${panelClassName}`,
15580
+ className: `pointer-events-auto ${panelBg} shadow-2xl h-full flex flex-col pt-[env(safe-area-inset-top)] ${widthClass} ${panelClassName}`,
15510
15581
  style: { ...widthStyle, ...panelStyle },
15511
15582
  onClick: (e) => e.stopPropagation(),
15512
15583
  children: [
@@ -15527,12 +15598,12 @@ var Drawer = ({
15527
15598
  /* @__PURE__ */ jsxRuntime.jsx(
15528
15599
  "div",
15529
15600
  {
15530
- className: `flex-1 px-3 pt-2 ${panelBg} ${fillHeight ? "flex flex-col overflow-hidden pb-0" : "overflow-y-auto pb-6"} ${contentClassName}`,
15601
+ className: `flex-1 px-3 pt-2 ${panelBg} ${fillHeight ? "flex flex-col overflow-hidden pb-0" : "overflow-y-auto pb-[max(1.5rem,env(safe-area-inset-bottom))]"} ${contentClassName}`,
15531
15602
  style: contentStyle,
15532
15603
  children
15533
15604
  }
15534
15605
  ),
15535
- footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `px-6 py-4 border-t border-border-default ${panelBg} flex-shrink-0 ${footerClassName}`, children: footer })
15606
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-shrink-0 border-t border-border-default px-6 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] ${panelBg} ${footerClassName}`, children: footer })
15536
15607
  ]
15537
15608
  }
15538
15609
  ) })
@@ -16139,7 +16210,7 @@ var AccountOpeningPanel = ({ onContinue, continueLabel = "Continue" }) => {
16139
16210
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-[16px] font-medium text-text-primary leading-snug", children: copy.title }),
16140
16211
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[12px] leading-relaxed text-text-secondary", children: showExit && !terminalFailure ? "This is taking longer than usual. We'll let you know as soon as it's ready \u2014 you can carry on in the meantime." : copy.body })
16141
16212
  ] }),
16142
- terminalFailure ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default/40", children: /* @__PURE__ */ jsxRuntime.jsx(
16213
+ terminalFailure ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-1.5 w-full overflow-hidden rounded-full bg-border-default", children: /* @__PURE__ */ jsxRuntime.jsx(
16143
16214
  "div",
16144
16215
  {
16145
16216
  className: `h-full w-2/3 rounded-full motion-safe:animate-pulse ${impatient ? "bg-status-warning-text" : "bg-cta"}`
@@ -17917,7 +17988,7 @@ var OnboardingPolicySection = ({
17917
17988
  ]);
17918
17989
  if (hidden || loading || deployLoading || platformActive === null) return null;
17919
17990
  if (platformActive === "error") {
17920
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-white/[0.07] bg-white/[0.02] p-4", children: [
17991
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border-default dark:border-white/[0.07] bg-raised dark:bg-white/[0.02] p-4", children: [
17921
17992
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold text-text-secondary", children: "Platform onboarding" }) }),
17922
17993
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border-light bg-surface-alt px-3 py-2.5 text-[13px] leading-5 text-text-muted", children: [
17923
17994
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Couldn't confirm whether this group is used as a platform." }),
@@ -17934,12 +18005,12 @@ var OnboardingPolicySection = ({
17934
18005
  ] });
17935
18006
  }
17936
18007
  if (!platformActive) {
17937
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-white/[0.07] bg-white/[0.02] p-4", children: [
18008
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border-default dark:border-white/[0.07] bg-raised dark:bg-white/[0.02] p-4", children: [
17938
18009
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold text-text-secondary", children: "Platform onboarding" }) }),
17939
18010
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border-light bg-surface-alt px-3 py-2.5 text-[13px] leading-5 text-text-muted", children: "This group isn't used as a platform, so there are no signups to configure. Enable platform sponsorship first \u2014 then choose the sign-in methods and identity checks its users go through." })
17940
18011
  ] });
17941
18012
  }
17942
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-white/[0.07] bg-white/[0.02] p-4", children: [
18013
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border-default dark:border-white/[0.07] bg-raised dark:bg-white/[0.02] p-4", children: [
17943
18014
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3", children: [
17944
18015
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold text-text-secondary", children: "Platform onboarding" }),
17945
18016
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-text-muted", children: "The path people take from first visit to transacting on this platform." })
@@ -18724,7 +18795,7 @@ function DecodedCalldata({
18724
18795
  }
18725
18796
  const kindColor = {
18726
18797
  zero: "text-text-muted",
18727
- address: "text-blue-300/[0.90]",
18798
+ address: "text-azure dark:text-blue-300/[0.90]",
18728
18799
  uint: "text-text-primary",
18729
18800
  bytes32: "text-text-secondary"
18730
18801
  };
@@ -19715,14 +19786,14 @@ function SignaturePreviewDrawer({ message, onClose, onSignatureConfirmed, userId
19715
19786
  type: "button",
19716
19787
  onClick: handleCancelMessage,
19717
19788
  disabled: cancelling,
19718
- className: "px-3 py-2 text-[13px] text-red-200 hover:text-text-primary disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
19789
+ className: "px-3 py-2 text-[13px] text-status-error-text dark:text-red-200 hover:text-text-primary disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
19719
19790
  children: cancelling ? "Cancelling\u2026" : "Cancel message"
19720
19791
  }
19721
19792
  ) : void 0,
19722
19793
  children: [
19723
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[13px] font-medium text-red-100 mb-1", children: "Couldn't load transaction" }),
19794
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[13px] font-medium text-status-error-text dark:text-red-100 mb-1", children: "Couldn't load transaction" }),
19724
19795
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-text-secondary max-w-sm", children: error }),
19725
- cancelError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-red-200 mt-3", children: cancelError })
19796
+ cancelError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-status-error-text dark:text-red-200 mt-3", children: cancelError })
19726
19797
  ]
19727
19798
  }
19728
19799
  );
@@ -19737,7 +19808,7 @@ function SignaturePreviewDrawer({ message, onClose, onSignatureConfirmed, userId
19737
19808
  })();
19738
19809
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col h-full text-text-primary", children: [
19739
19810
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 px-4 py-4", children: [
19740
- reviewWarning && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rounded-lg border border-amber-300/[0.22] bg-amber-400/[0.08] px-3 py-2 text-[12px] leading-5 text-amber-100", children: reviewWarning }),
19811
+ reviewWarning && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rounded-lg border border-status-warning-line dark:border-amber-300/[0.22] bg-status-warning-bg dark:bg-amber-400/[0.08] px-3 py-2 text-[12px] leading-5 text-status-warning-text dark:text-amber-100", children: reviewWarning }),
19741
19812
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-text-secondary leading-5", children: mode === "inspect" ? "Review action details and execution outcome." : "Review the action, choose a signing key, and confirm." }),
19742
19813
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full rounded-[22px] border border-border-light bg-raised p-1 text-[12px] shadow-[inset_0_1px_0_rgba(255,255,255,0.035)]", children: ["simple", "advanced"].map((mode2) => /* @__PURE__ */ jsxRuntime.jsx(
19743
19814
  "button",
@@ -19926,7 +19997,7 @@ function SignaturePreviewDrawer({ message, onClose, onSignatureConfirmed, userId
19926
19997
  ] })
19927
19998
  }
19928
19999
  ),
19929
- selector && !methodName && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rounded-lg border border-red-300/[0.18] bg-red-400/[0.08] px-2.5 py-2 text-[10px] leading-4 text-red-200", children: "High risk: this selector is unknown. Review the raw target, value, and every calldata word before signing." }),
20000
+ selector && !methodName && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rounded-lg border border-status-error-line dark:border-red-300/[0.18] bg-status-error-bg dark:bg-red-400/[0.08] px-2.5 py-2 text-[10px] leading-4 text-status-error-text dark:text-red-200", children: "High risk: this selector is unknown. Review the raw target, value, and every calldata word before signing." }),
19930
20001
  !dataEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[12px]", children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
19931
20002
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
19932
20003
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-muted", children: "Calldata" }),
@@ -19985,7 +20056,7 @@ function SignaturePreviewDrawer({ message, onClose, onSignatureConfirmed, userId
19985
20056
  ] })
19986
20057
  ] }) }),
19987
20058
  mode === "sign" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 border-t border-border-light bg-surface-alt", children: [
19988
- keysLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-border-strong border-t-transparent" }) }) : keysError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-red-200 px-4 py-3", children: keysError }) : availableKeys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-text-muted text-center py-5", children: ownedSignerState.error ?? (ownedSignerBinding ? "The personal key bound to this owned-group session is unavailable. Return to the parent group and mint a new session with an active key." : `No active keys for this ${entityType}.`) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pt-3 pb-1 space-y-2", children: [
20059
+ keysLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-5", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-border-strong border-t-transparent" }) }) : keysError ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-status-error-text dark:text-red-200 px-4 py-3", children: keysError }) : availableKeys.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-text-muted text-center py-5", children: ownedSignerState.error ?? (ownedSignerBinding ? "The personal key bound to this owned-group session is unavailable. Return to the parent group and mint a new session with an active key." : `No active keys for this ${entityType}.`) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 pt-3 pb-1 space-y-2", children: [
19989
20060
  /* @__PURE__ */ jsxRuntime.jsx(SectionLabel, { children: "Sign with" }),
19990
20061
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "max-h-40 overflow-y-auto divide-y divide-border-light", children: availableKeys.map((key) => {
19991
20062
  const isSelected = selectedKey?.id === key.id;
@@ -20030,7 +20101,7 @@ function SignaturePreviewDrawer({ message, onClose, onSignatureConfirmed, userId
20030
20101
  walletLabel(walletKindFromKey(selectedKey)),
20031
20102
  " will open to sign."
20032
20103
  ] }),
20033
- ownedSignerBinding && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[11px] text-cyan-200", children: [
20104
+ ownedSignerBinding && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[11px] text-azure dark:text-cyan-200", children: [
20034
20105
  "This owned-group request is cryptographically bound to this personal key (",
20035
20106
  ownedSignerBinding.signerCustody,
20036
20107
  "). Choose a different key by returning to the parent group and minting a new child session."
@@ -20106,8 +20177,8 @@ function InspectFooter({
20106
20177
  }
20107
20178
  };
20108
20179
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 border-t border-border-light bg-raised px-3 py-3 space-y-2.5", children: [
20109
- awaitingSignature && onSwitchToSign && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-[18px] border border-amber-300/[0.20] bg-amber-950/[0.12] px-3 py-2 flex items-center justify-between gap-3", children: [
20110
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-amber-100/[0.82]", children: "This message is now awaiting your signature." }),
20180
+ awaitingSignature && onSwitchToSign && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-[18px] border border-status-warning-line dark:border-amber-300/[0.20] bg-status-warning-bg dark:bg-amber-950/[0.12] px-3 py-2 flex items-center justify-between gap-3", children: [
20181
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-status-warning-text dark:text-amber-100/[0.82]", children: "This message is now awaiting your signature." }),
20111
20182
  /* @__PURE__ */ jsxRuntime.jsx(
20112
20183
  "button",
20113
20184
  {
@@ -20136,7 +20207,7 @@ function InspectFooter({
20136
20207
  href: txExplorerUrl,
20137
20208
  target: "_blank",
20138
20209
  rel: "noopener noreferrer",
20139
- className: "text-blue-300/[0.90] hover:text-blue-200 hover:underline underline-offset-2 transition-colors",
20210
+ className: "text-azure dark:text-blue-300/[0.90] hover:text-azure-deep dark:hover:text-blue-200 hover:underline underline-offset-2 transition-colors",
20140
20211
  children: [
20141
20212
  formatTxHashShort(txHash),
20142
20213
  /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "ml-0.5 text-[9px] align-middle opacity-70", children: "\u2197" })
@@ -20162,7 +20233,7 @@ Opens in block explorer` : txHash
20162
20233
  ] }),
20163
20234
  message.response?.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
20164
20235
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-medium uppercase tracking-[0.13em] text-text-muted mb-0.5", children: "Error" }),
20165
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-red-200 break-words", children: message.response.error })
20236
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-status-error-text dark:text-red-200 break-words", children: message.response.error })
20166
20237
  ] }),
20167
20238
  reexecutions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
20168
20239
  /* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "text-[11px] uppercase tracking-[0.12em] text-text-muted cursor-pointer hover:text-text-primary transition-colors", children: [
@@ -20176,7 +20247,7 @@ Opens in block explorer` : txHash
20176
20247
  className: "text-[11px] rounded-[10px] border border-border-light px-2 py-1 bg-surface-alt",
20177
20248
  children: [
20178
20249
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
20179
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: r.success ? "text-emerald-300/[0.90]" : "text-red-200", children: r.success ? "Succeeded" : "Failed" }),
20250
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: r.success ? "text-status-success-text dark:text-emerald-300/[0.90]" : "text-status-error-text dark:text-red-200", children: r.success ? "Succeeded" : "Failed" }),
20180
20251
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-muted", children: formatRelativeTime(r.attempted_at) })
20181
20252
  ] }),
20182
20253
  r.error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-text-secondary break-words", children: r.error })
@@ -20186,7 +20257,7 @@ Opens in block explorer` : txHash
20186
20257
  )) })
20187
20258
  ] })
20188
20259
  ] }),
20189
- actionError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[16px] border border-red-300/[0.24] bg-red-950/[0.18] px-3 py-2 text-[11px] text-red-100", children: actionError }),
20260
+ actionError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[16px] border border-status-error-line dark:border-red-300/[0.24] bg-status-error-bg dark:bg-red-950/[0.18] px-3 py-2 text-[11px] text-status-error-text dark:text-red-100", children: actionError }),
20190
20261
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
20191
20262
  /* @__PURE__ */ jsxRuntime.jsx(
20192
20263
  "button",
@@ -20522,14 +20593,14 @@ function SignatureWorkflow({
20522
20593
  {
20523
20594
  id: `signature-${pending.id}`,
20524
20595
  type: "action",
20525
- title: "Signature Required",
20526
- message: "A queued action is waiting for your signature.",
20596
+ title: "Signature needed",
20597
+ message: "Something is waiting for your signature.",
20527
20598
  duration: 0,
20528
20599
  showProgress: false,
20529
20600
  onClose: dismissPending,
20530
20601
  onClick: () => openSigner(pending),
20531
20602
  action: {
20532
- label: "Review & Sign",
20603
+ label: "Review and sign",
20533
20604
  onClick: () => openSigner(pending)
20534
20605
  }
20535
20606
  }
@@ -20539,7 +20610,7 @@ function SignatureWorkflow({
20539
20610
  {
20540
20611
  isOpen: true,
20541
20612
  onClose: closeSigner,
20542
- title: currentMessage.data?.message_type ? `${currentMessage.data.message_type} \u2014 Sign` : "Sign Transaction",
20613
+ title: currentMessage.data?.message_type ? `${humanizeMessageType(currentMessage.data.message_type)} \u2014 Sign` : "Sign this request",
20543
20614
  maxWidth: "lg",
20544
20615
  fillHeight: true,
20545
20616
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
@@ -20569,8 +20640,10 @@ function SignatureWorkflow({
20569
20640
  ] });
20570
20641
  }
20571
20642
  var PLACEMENT_CLASSES = {
20572
- "top-left": "top-4 left-4",
20573
- "top-right": "top-4 right-4",
20643
+ // The top corners clear the status bar of a home-screen install (zero
20644
+ // in a browser tab).
20645
+ "top-left": "top-[calc(1rem+env(safe-area-inset-top))] left-4",
20646
+ "top-right": "top-[calc(1rem+env(safe-area-inset-top))] right-4",
20574
20647
  "bottom-left": "bottom-4 left-4",
20575
20648
  "bottom-right": "bottom-4 right-4"
20576
20649
  };
@@ -22168,10 +22241,10 @@ function SecurityPage() {
22168
22241
  const [generateDescription, setGenerateDescription] = React54.useState("");
22169
22242
  const [freshApiKey, setFreshApiKey] = React54.useState(null);
22170
22243
  const [freshApiKeyCopied, setFreshApiKeyCopied] = React54.useState(false);
22171
- const refresh = React54.useCallback(async () => {
22244
+ const refresh = React54.useCallback(async (opts) => {
22172
22245
  setError(null);
22173
22246
  try {
22174
- invalidateWalletCount();
22247
+ if (opts?.invalidate !== false) invalidateWalletCount();
22175
22248
  const [k, l] = await Promise.all([
22176
22249
  listMyLoginKeys(),
22177
22250
  keysService.getLockdownStatus().catch(() => null)
@@ -22185,7 +22258,7 @@ function SecurityPage() {
22185
22258
  }
22186
22259
  }, []);
22187
22260
  React54.useEffect(() => {
22188
- refresh();
22261
+ void refresh({ invalidate: false });
22189
22262
  }, [refresh]);
22190
22263
  const refreshApiKeys = React54.useCallback(async () => {
22191
22264
  try {
@@ -23023,7 +23096,7 @@ function SecurityPage() {
23023
23096
  (account) => !(account.chain_id === activeChainId && account.wallet_address.toLowerCase() === target)
23024
23097
  );
23025
23098
  if (otherAccounts.length === 0) return null;
23026
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-status-warning-bg/30 border border-status-warning-text/30 px-3 py-2 space-y-1", children: [
23099
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg bg-status-warning-bg border border-status-warning-text/30 px-3 py-2 space-y-1", children: [
23027
23100
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[11px] text-status-warning-text font-medium", children: [
23028
23101
  "This key also owns ",
23029
23102
  otherAccounts.length,
@@ -23338,7 +23411,7 @@ function RowGhostButton({
23338
23411
  type: "button",
23339
23412
  disabled,
23340
23413
  onClick,
23341
- className: "text-[11px] font-medium px-2.5 py-1 rounded-md text-text-secondary hover:text-text-primary hover:bg-chip disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
23414
+ className: "rounded-md px-2.5 py-1 text-[11px] font-medium text-text-secondary transition-colors hover:bg-chip hover:text-text-primary active:bg-chip-active disabled:cursor-not-allowed disabled:opacity-50 max-lg:min-h-[44px] max-lg:px-4 max-lg:text-[13px]",
23342
23415
  children
23343
23416
  }
23344
23417
  );
@@ -23354,7 +23427,7 @@ function RowNeutralButton({
23354
23427
  type: "button",
23355
23428
  disabled,
23356
23429
  onClick,
23357
- className: "text-[11px] font-medium px-2.5 py-1 rounded-md bg-chip text-text-primary hover:bg-chip-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
23430
+ className: "rounded-md bg-chip px-2.5 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-chip-hover active:bg-chip-active disabled:cursor-not-allowed disabled:opacity-50 max-lg:min-h-[44px] max-lg:px-4 max-lg:text-[13px]",
23358
23431
  children
23359
23432
  }
23360
23433
  );
@@ -23923,18 +23996,18 @@ var GroupsView = ({
23923
23996
  ] }),
23924
23997
  error && /* @__PURE__ */ jsxRuntime.jsx(ErrorBanner, { children: error }),
23925
23998
  delegationSession?.kind === "owned" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-[22px] border border-cyan-300/[0.18] bg-cyan-400/[0.07] px-3.5 py-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.035)]", children: [
23926
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-semibold uppercase tracking-[0.12em] text-cyan-300/80", children: "Account ownership path" }),
23999
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-semibold uppercase tracking-[0.12em] text-azure dark:text-cyan-300/80", children: "Account ownership path" }),
23927
24000
  /* @__PURE__ */ jsxRuntime.jsxs(
23928
24001
  "div",
23929
24002
  {
23930
24003
  className: "mt-2 flex min-w-0 items-center gap-2",
23931
24004
  "aria-label": `${sourceGroup?.name ?? "Owning group"} is operating ${activeOwnedGroup?.name ?? "owned group"}`,
23932
24005
  children: [
23933
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-white/[0.08] bg-white/[0.035] px-2.5 py-1.5 text-[11px] font-semibold text-text-secondary", children: "You" }),
23934
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-cyan-300/70", children: "\u2192" }),
23935
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-white/[0.08] bg-white/[0.035] px-2.5 py-1.5 text-[11px] font-semibold text-text-secondary", children: sourceGroup?.name ?? compactGroupId(delegationSession.parentGroupId) }),
23936
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-cyan-300/70", children: "\u2192" }),
23937
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-cyan-300/[0.18] bg-cyan-300/[0.08] px-2.5 py-1.5 text-[11px] font-semibold text-cyan-200", children: activeOwnedGroup?.name ?? compactGroupId(delegationSession.currentGroupId) })
24006
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-border-default dark:border-white/[0.08] bg-chip dark:bg-white/[0.035] px-2.5 py-1.5 text-[11px] font-semibold text-text-secondary", children: "You" }),
24007
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-azure dark:text-cyan-300/70", children: "\u2192" }),
24008
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-border-default dark:border-white/[0.08] bg-chip dark:bg-white/[0.035] px-2.5 py-1.5 text-[11px] font-semibold text-text-secondary", children: sourceGroup?.name ?? compactGroupId(delegationSession.parentGroupId) }),
24009
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-azure dark:text-cyan-300/70", children: "\u2192" }),
24010
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate rounded-lg border border-azure-line dark:border-cyan-300/[0.18] bg-azure-tint dark:bg-cyan-300/[0.08] px-2.5 py-1.5 text-[11px] font-semibold text-azure dark:text-cyan-200", children: activeOwnedGroup?.name ?? compactGroupId(delegationSession.currentGroupId) })
23938
24011
  ]
23939
24012
  }
23940
24013
  ),
@@ -23946,7 +24019,7 @@ var GroupsView = ({
23946
24019
  type: "button",
23947
24020
  onClick: () => void handleReturnToParent(),
23948
24021
  disabled: busyId === `parent:${delegationSession.parentGroupId}`,
23949
- className: "rounded-full border border-cyan-300/[0.16] bg-cyan-300/[0.08] px-3 py-1.5 text-[11px] font-semibold text-cyan-200 transition-colors hover:bg-cyan-300/[0.13] disabled:opacity-45",
24022
+ className: "rounded-full border border-azure-line dark:border-cyan-300/[0.16] bg-azure-tint dark:bg-cyan-300/[0.08] px-3 py-1.5 text-[11px] font-semibold text-azure dark:text-cyan-200 transition-colors hover:bg-azure-muted dark:hover:bg-cyan-300/[0.13] disabled:opacity-45",
23950
24023
  children: busyId === `parent:${delegationSession.parentGroupId}` ? "Returning..." : `Return to ${sourceGroup?.name ?? "owning group"}`
23951
24024
  }
23952
24025
  ),
@@ -23962,7 +24035,7 @@ var GroupsView = ({
23962
24035
  )
23963
24036
  ] })
23964
24037
  ] }) : actingAsAnyGroup ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 rounded-[22px] border border-amber-300/[0.18] bg-amber-400/[0.08] px-3.5 py-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.035)]", children: [
23965
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "min-w-0 flex-1 text-[12px] font-semibold leading-5 text-amber-300", children: [
24038
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "min-w-0 flex-1 text-[12px] font-semibold leading-5 text-status-warning-text dark:text-amber-300", children: [
23966
24039
  "Acting as ",
23967
24040
  sourceGroup?.name ?? "a group",
23968
24041
  ". Operations use its direct delegation token."
@@ -24297,7 +24370,7 @@ function OwnedGroupRow({
24297
24370
  return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "px-3.5 py-3", children: [
24298
24371
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
24299
24372
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-[11px] font-semibold text-text-secondary", children: sourceName }),
24300
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-cyan-300/70", children: "\u2192" }),
24373
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "shrink-0 text-[12px] text-azure dark:text-cyan-300/70", children: "\u2192" }),
24301
24374
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-[12px] font-semibold text-text-primary", children: projection.group.name })
24302
24375
  ] }),
24303
24376
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex items-center justify-between gap-3", children: [
@@ -24308,7 +24381,7 @@ function OwnedGroupRow({
24308
24381
  type: "button",
24309
24382
  onClick: onSwitch,
24310
24383
  disabled: busy,
24311
- className: "shrink-0 rounded-full border border-cyan-300/[0.16] bg-cyan-300/[0.08] px-3 py-1.5 text-[11px] font-semibold text-cyan-200 transition-colors hover:bg-cyan-300/[0.13] disabled:cursor-not-allowed disabled:opacity-45",
24384
+ className: "shrink-0 rounded-full border border-azure-line dark:border-cyan-300/[0.16] bg-azure-tint dark:bg-cyan-300/[0.08] px-3 py-1.5 text-[11px] font-semibold text-azure dark:text-cyan-200 transition-colors hover:bg-azure-muted dark:hover:bg-cyan-300/[0.13] disabled:cursor-not-allowed disabled:opacity-45",
24312
24385
  children: busy ? "Checking ownership..." : `Operate as ${projection.group.name}`
24313
24386
  }
24314
24387
  )
@@ -24795,7 +24868,7 @@ function PlusIcon() {
24795
24868
  }
24796
24869
  function RoleBadge({ role }) {
24797
24870
  const label = normalizeRole(role);
24798
- const tone = label === "owner" ? "bg-orange-500/[0.16] text-orange-300" : label === "admin" ? "bg-blue-500/[0.16] text-blue-300" : "bg-chip text-text-secondary";
24871
+ const tone = label === "owner" ? "bg-orange-500/[0.16] text-primary dark:text-orange-300" : label === "admin" ? "bg-blue-500/[0.16] text-azure dark:text-blue-300" : "bg-chip text-text-secondary";
24799
24872
  return /* @__PURE__ */ jsxRuntime.jsx(
24800
24873
  "span",
24801
24874
  {
@@ -24937,7 +25010,7 @@ function ActiveEnvironmentBadge({
24937
25010
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center justify-between gap-3 px-1", children: [
24938
25011
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-text-muted", children: "Mode" }),
24939
25012
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 truncate text-right text-[9px] text-text-muted", children: [
24940
- environment.mode === "unknown" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1.5 font-semibold text-amber-400", children: "Unconfigured" }),
25013
+ environment.mode === "unknown" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1.5 font-semibold text-status-warning-text dark:text-amber-400", children: "Unconfigured" }),
24941
25014
  environment.network,
24942
25015
  environment.chainId && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5 font-mono text-text-secondary", children: environment.chainId })
24943
25016
  ] })
@@ -24951,7 +25024,7 @@ function ActiveEnvironmentBadge({
24951
25024
  /* @__PURE__ */ jsxRuntime.jsxs(
24952
25025
  "span",
24953
25026
  {
24954
- className: `inline-flex items-center gap-1.5 text-[11px] font-semibold ${environment.mode === "test" ? "text-amber-400" : environment.mode === "live" ? "text-emerald-400" : "text-text-secondary"}`,
25027
+ className: `inline-flex items-center gap-1.5 text-[11px] font-semibold ${environment.mode === "test" ? "text-status-warning-text dark:text-amber-400" : environment.mode === "live" ? "text-status-success-text dark:text-emerald-400" : "text-text-secondary"}`,
24955
25028
  children: [
24956
25029
  /* @__PURE__ */ jsxRuntime.jsx(
24957
25030
  "span",
@@ -24995,7 +25068,7 @@ function ActiveEnvironmentBadge({
24995
25068
  void switchTo(option);
24996
25069
  }
24997
25070
  },
24998
- className: `flex min-h-[34px] min-w-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-[11px] font-medium transition-colors focus:outline-none focus-visible:ring-2 disabled:cursor-default ${option.active ? test ? "border-amber-500/40 bg-raised text-amber-400 focus-visible:ring-amber-500/40" : "border-emerald-500/40 bg-raised text-emerald-400 focus-visible:ring-emerald-500/40" : unavailable ? "border-transparent text-text-muted opacity-50" : "border-transparent text-text-secondary hover:bg-raised-hover hover:text-text-primary focus-visible:ring-border-strong"}`,
25071
+ className: `flex min-h-[34px] min-w-0 items-center justify-center gap-1.5 rounded-lg border px-2 text-[11px] font-medium transition-colors focus:outline-none focus-visible:ring-2 disabled:cursor-default ${option.active ? test ? "border-amber-500/40 bg-raised text-status-warning-text dark:text-amber-400 focus-visible:ring-amber-500/40" : "border-emerald-500/40 bg-raised text-status-success-text dark:text-emerald-400 focus-visible:ring-emerald-500/40" : unavailable ? "border-transparent text-text-muted opacity-50" : "border-transparent text-text-secondary hover:bg-raised-hover hover:text-text-primary focus-visible:ring-border-strong"}`,
24999
25072
  children: busy ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25000
25073
  option.active && /* @__PURE__ */ jsxRuntime.jsx(
25001
25074
  "span",
@@ -25066,7 +25139,7 @@ function ActiveEnvironmentBadge({
25066
25139
  "div",
25067
25140
  {
25068
25141
  role: "alert",
25069
- className: "mt-2 rounded-xl border border-red-500/25 bg-red-500/[0.07] px-3 py-2 text-[10px] leading-4 text-red-400",
25142
+ className: "mt-2 rounded-xl border border-status-error-line dark:border-red-500/25 bg-status-error-bg dark:bg-red-500/[0.07] px-3 py-2 text-[10px] leading-4 text-status-error-text dark:text-red-400",
25070
25143
  children: error
25071
25144
  }
25072
25145
  )
@@ -25165,7 +25238,10 @@ var WalletCenterSurface = ({
25165
25238
  modules,
25166
25239
  actors,
25167
25240
  identity,
25168
- initialView = "menu"
25241
+ initialView = "menu",
25242
+ embedded = false,
25243
+ backLabel = "Back",
25244
+ onTitle
25169
25245
  }) => {
25170
25246
  const { pendingList, refreshPending } = useSignatureQueue();
25171
25247
  const {
@@ -25193,6 +25269,10 @@ var WalletCenterSurface = ({
25193
25269
  const cancelGuardRef = React54.useRef(/* @__PURE__ */ new Map());
25194
25270
  const wasOpenRef = React54.useRef(false);
25195
25271
  const walletRootRef = React54.useRef(null);
25272
+ const leaveSection = React54.useCallback(() => {
25273
+ if (embedded && initialView !== "menu") onClose();
25274
+ else setSection("menu");
25275
+ }, [embedded, initialView, onClose]);
25196
25276
  React54.useEffect(() => {
25197
25277
  const justOpened = isOpen && !wasOpenRef.current;
25198
25278
  wasOpenRef.current = isOpen;
@@ -25210,9 +25290,9 @@ var WalletCenterSurface = ({
25210
25290
  React54.useEffect(() => {
25211
25291
  if (!isOpen) return;
25212
25292
  if (activeBuiltinFor(section, modules) === "transactions" && pendingList.length === 0) {
25213
- setSection("menu");
25293
+ leaveSection();
25214
25294
  }
25215
- }, [isOpen, modules, pendingList.length, section]);
25295
+ }, [isOpen, leaveSection, modules, pendingList.length, section]);
25216
25296
  const delegatedGroupId = React54.useMemo(() => {
25217
25297
  if (!delegationToken || typeof window === "undefined") return null;
25218
25298
  return window.localStorage.getItem("delegation_group_id");
@@ -25465,11 +25545,11 @@ var WalletCenterSurface = ({
25465
25545
  setActionError(null);
25466
25546
  try {
25467
25547
  await actor.onSelect();
25468
- setSection("menu");
25548
+ leaveSection();
25469
25549
  } catch (error) {
25470
25550
  setActionError(error?.message ?? "Failed to switch signing context.");
25471
25551
  }
25472
- }, []);
25552
+ }, [leaveSection]);
25473
25553
  const drawerTitle = React54.useMemo(() => {
25474
25554
  if (selected) {
25475
25555
  const label = humanizeMessageType(selected.data?.message_type);
@@ -25477,11 +25557,117 @@ var WalletCenterSurface = ({
25477
25557
  }
25478
25558
  return "Wallet";
25479
25559
  }, [selected, selectedSource]);
25560
+ const hostedTitle = !embedded ? null : selected ? drawerTitle : section === "actors" ? "Signing context" : activeModule?.label ?? null;
25561
+ React54.useEffect(() => {
25562
+ if (!embedded) return void 0;
25563
+ onTitle?.(hostedTitle);
25564
+ return () => onTitle?.(null);
25565
+ }, [embedded, hostedTitle, onTitle]);
25480
25566
  const isCompactView = !selected;
25481
25567
  const drawerPanelClass = isCompactView ? stripLayoutUtilities(walletCenterUi?.drawer?.panel, ["height"]) : walletCenterUi?.drawer?.panel;
25482
25568
  const drawerContentClass = isCompactView ? stripLayoutUtilities(walletCenterUi?.drawer?.content, ["overflow"]) : walletCenterUi?.drawer?.content;
25483
- const walletRootClass = isCompactView ? stripLayoutUtilities(walletCenterUi?.root, ["height", "overflow"]) : walletCenterUi?.root;
25484
- const walletMainClass = isCompactView ? stripLayoutUtilities(walletCenterUi?.main, ["height", "overflow"]) : walletCenterUi?.main;
25569
+ const walletRootClass = embedded ? void 0 : isCompactView ? stripLayoutUtilities(walletCenterUi?.root, ["height", "overflow"]) : walletCenterUi?.root;
25570
+ const walletMainClass = embedded ? void 0 : isCompactView ? stripLayoutUtilities(walletCenterUi?.main, ["height", "overflow"]) : walletCenterUi?.main;
25571
+ const body = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: walletRootRef, className: cx4(isCompactView ? "w-full" : "flex h-full overflow-hidden", walletRootClass), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx4(isCompactView ? "min-h-0 w-full" : "flex-1 min-h-0 overflow-hidden", walletMainClass), children: selected ? /* @__PURE__ */ jsxRuntime.jsx(
25572
+ DetailPane,
25573
+ {
25574
+ message: selected,
25575
+ source: selectedSource,
25576
+ userId,
25577
+ onBack: handleBackToList,
25578
+ hideBack: embedded,
25579
+ onSigned: async (m) => {
25580
+ onSigned?.(m);
25581
+ setSelected(null);
25582
+ await refreshPending();
25583
+ },
25584
+ onRetry: handleRetry,
25585
+ onSwitchToSign: () => setSelectedSource("pending"),
25586
+ selectorRegistry,
25587
+ addressLabels,
25588
+ renderSimpleSummary
25589
+ }
25590
+ ) : section === "menu" ? /* @__PURE__ */ jsxRuntime.jsx(
25591
+ WalletMenu,
25592
+ {
25593
+ identity: resolvedIdentity,
25594
+ items: menuItems,
25595
+ actors: resolvedActors,
25596
+ actionError,
25597
+ onSelectModule: handleSelectModule,
25598
+ onOpenActors: () => setSection("actors"),
25599
+ onClose: embedded ? void 0 : onClose,
25600
+ onSignOut: handleSignOut
25601
+ }
25602
+ ) : section === "actors" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-col", children: [
25603
+ embedded ? null : /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Signing context", onBack: leaveSection }),
25604
+ /* @__PURE__ */ jsxRuntime.jsx(
25605
+ ActorsPane,
25606
+ {
25607
+ actors: resolvedActors,
25608
+ error: actionError,
25609
+ onSelect: handleSelectActor
25610
+ }
25611
+ )
25612
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-col", children: [
25613
+ embedded ? null : /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: activeModule?.label ?? "Wallet", onBack: leaveSection }),
25614
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0", children: activeModule ? /* @__PURE__ */ jsxRuntime.jsx(
25615
+ SectionPane,
25616
+ {
25617
+ module: activeModule,
25618
+ panelContext,
25619
+ pendingList,
25620
+ busyId,
25621
+ actionError,
25622
+ onSelectPending: (m) => handleSelect(m, "pending"),
25623
+ onSign: handleSign,
25624
+ onCancel: handleCancel,
25625
+ historyItems: filteredHistoryItems,
25626
+ historyFilter,
25627
+ historyLoading,
25628
+ historyError,
25629
+ historyHasMore: historyHasMore && historyItems.length < HISTORY_MAX_ITEMS,
25630
+ historyAtCap: historyItems.length >= HISTORY_MAX_ITEMS,
25631
+ historyLoadedOnce,
25632
+ showHistoryFilters: !embedded,
25633
+ onFilterChange: handleFilterChange,
25634
+ onLoadMore: handleLoadMore,
25635
+ onSelectHistory: (m) => handleSelect(m, "history"),
25636
+ onRetry: handleRetryFromRow,
25637
+ classNames: walletCenterUi
25638
+ }
25639
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
25640
+ EmptyState,
25641
+ {
25642
+ title: "This wallet view is unavailable",
25643
+ subtitle: "Return to the wallet menu and choose another destination.",
25644
+ classNames: walletCenterUi
25645
+ }
25646
+ ) })
25647
+ ] }) }) });
25648
+ if (embedded) {
25649
+ const back = selected ? { label: activeModule?.label ?? "Wallet", onPick: handleBackToList } : section === "menu" ? null : { label: backLabel, onPick: leaveSection };
25650
+ const sectionControls = !selected && activeBuiltin === "history" ? /* @__PURE__ */ jsxRuntime.jsx(FilterChips, { filter: historyFilter, onChange: handleFilterChange }) : null;
25651
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [
25652
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx4("min-h-0 flex-1", isCompactView ? "overflow-y-auto" : "overflow-hidden"), children: body }),
25653
+ back || sectionControls ? /* @__PURE__ */ jsxRuntime.jsxs("nav", { "aria-label": "Wallet controls", className: "flex h-12 shrink-0 items-center gap-2 border-t border-border-light px-4", children: [
25654
+ back ? /* @__PURE__ */ jsxRuntime.jsxs(
25655
+ "button",
25656
+ {
25657
+ type: "button",
25658
+ onClick: back.onPick,
25659
+ className: "flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-chip-hover pl-2 pr-3 text-[12.5px] font-medium text-text-primary transition-colors hover:bg-raised-hover",
25660
+ children: [
25661
+ /* @__PURE__ */ jsxRuntime.jsx(IconChevronLeft, {}),
25662
+ back.label
25663
+ ]
25664
+ }
25665
+ ) : null,
25666
+ back && sectionControls ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-5 w-px shrink-0 bg-border-strong", "aria-hidden": "true" }) : null,
25667
+ sectionControls ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-x-auto", children: sectionControls }) : null
25668
+ ] }) : null
25669
+ ] });
25670
+ }
25485
25671
  return /* @__PURE__ */ jsxRuntime.jsx(
25486
25672
  Drawer,
25487
25673
  {
@@ -25499,89 +25685,7 @@ var WalletCenterSurface = ({
25499
25685
  closeButtonClassName: walletCenterUi?.drawer?.closeButton,
25500
25686
  contentClassName: drawerContentClass,
25501
25687
  contentStyle: isCompactView ? { flex: "0 1 auto", maxHeight: "calc(100vh - 24px)", overflowY: "auto", paddingBottom: 12 } : void 0,
25502
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: walletRootRef, className: cx4(isCompactView ? "w-full" : "flex h-full overflow-hidden", walletRootClass), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx4(isCompactView ? "min-h-0 w-full" : "flex-1 min-h-0 overflow-hidden", walletMainClass), children: selected ? /* @__PURE__ */ jsxRuntime.jsx(
25503
- DetailPane,
25504
- {
25505
- message: selected,
25506
- source: selectedSource,
25507
- userId,
25508
- onBack: handleBackToList,
25509
- onSigned: async (m) => {
25510
- onSigned?.(m);
25511
- setSelected(null);
25512
- await refreshPending();
25513
- },
25514
- onRetry: handleRetry,
25515
- onSwitchToSign: () => setSelectedSource("pending"),
25516
- selectorRegistry,
25517
- addressLabels,
25518
- renderSimpleSummary
25519
- }
25520
- ) : section === "menu" ? /* @__PURE__ */ jsxRuntime.jsx(
25521
- WalletMenu,
25522
- {
25523
- identity: resolvedIdentity,
25524
- items: menuItems,
25525
- actors: resolvedActors,
25526
- actionError,
25527
- onSelectModule: handleSelectModule,
25528
- onOpenActors: () => setSection("actors"),
25529
- onClose,
25530
- onSignOut: handleSignOut
25531
- }
25532
- ) : section === "actors" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-col", children: [
25533
- /* @__PURE__ */ jsxRuntime.jsx(SectionHeader, { title: "Signing context", onBack: () => setSection("menu") }),
25534
- /* @__PURE__ */ jsxRuntime.jsx(
25535
- ActorsPane,
25536
- {
25537
- actors: resolvedActors,
25538
- error: actionError,
25539
- onSelect: handleSelectActor
25540
- }
25541
- )
25542
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-col", children: [
25543
- /* @__PURE__ */ jsxRuntime.jsx(
25544
- SectionHeader,
25545
- {
25546
- title: activeModule?.label ?? "Wallet",
25547
- onBack: () => {
25548
- setSection("menu");
25549
- }
25550
- }
25551
- ),
25552
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0", children: activeModule ? /* @__PURE__ */ jsxRuntime.jsx(
25553
- SectionPane,
25554
- {
25555
- module: activeModule,
25556
- panelContext,
25557
- pendingList,
25558
- busyId,
25559
- actionError,
25560
- onSelectPending: (m) => handleSelect(m, "pending"),
25561
- onSign: handleSign,
25562
- onCancel: handleCancel,
25563
- historyItems: filteredHistoryItems,
25564
- historyFilter,
25565
- historyLoading,
25566
- historyError,
25567
- historyHasMore: historyHasMore && historyItems.length < HISTORY_MAX_ITEMS,
25568
- historyAtCap: historyItems.length >= HISTORY_MAX_ITEMS,
25569
- historyLoadedOnce,
25570
- onFilterChange: handleFilterChange,
25571
- onLoadMore: handleLoadMore,
25572
- onSelectHistory: (m) => handleSelect(m, "history"),
25573
- onRetry: handleRetryFromRow,
25574
- classNames: walletCenterUi
25575
- }
25576
- ) : /* @__PURE__ */ jsxRuntime.jsx(
25577
- EmptyState,
25578
- {
25579
- title: "This wallet view is unavailable",
25580
- subtitle: "Return to the wallet menu and choose another destination.",
25581
- classNames: walletCenterUi
25582
- }
25583
- ) })
25584
- ] }) }) })
25688
+ children: body
25585
25689
  }
25586
25690
  );
25587
25691
  };
@@ -25703,7 +25807,7 @@ function WalletMenu({
25703
25807
  action.id
25704
25808
  );
25705
25809
  }),
25706
- /* @__PURE__ */ jsxRuntime.jsx(
25810
+ onClose ? /* @__PURE__ */ jsxRuntime.jsx(
25707
25811
  "button",
25708
25812
  {
25709
25813
  type: "button",
@@ -25713,7 +25817,7 @@ function WalletMenu({
25713
25817
  "aria-label": "Close wallet center",
25714
25818
  children: /* @__PURE__ */ jsxRuntime.jsx(IconX, {})
25715
25819
  }
25716
- )
25820
+ ) : null
25717
25821
  ] })
25718
25822
  ] }),
25719
25823
  /* @__PURE__ */ jsxRuntime.jsx(ActiveEnvironmentBadge, {})
@@ -25730,7 +25834,7 @@ function WalletMenu({
25730
25834
  onClick: onOpenActors,
25731
25835
  className: "flex min-h-[52px] w-full items-center gap-3 px-4 py-2 text-left text-[14px] font-semibold text-text-primary transition-colors hover:bg-raised-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-orange-400/70",
25732
25836
  children: [
25733
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-7 w-7 items-center justify-center rounded-lg bg-orange-500/10 text-orange-400", children: activeActor?.kind === "self" ? /* @__PURE__ */ jsxRuntime.jsx(IconUser, {}) : /* @__PURE__ */ jsxRuntime.jsx(IconBuilding, {}) }),
25837
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-7 w-7 items-center justify-center rounded-lg bg-primary/10 text-primary dark:text-orange-400", children: activeActor?.kind === "self" ? /* @__PURE__ */ jsxRuntime.jsx(IconUser, {}) : /* @__PURE__ */ jsxRuntime.jsx(IconBuilding, {}) }),
25734
25838
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
25735
25839
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate", children: activeActor?.label ?? userName }),
25736
25840
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-[10px] font-medium capitalize text-text-muted", children: activeActor?.kind ?? "self" })
@@ -25745,7 +25849,7 @@ function WalletMenu({
25745
25849
  {
25746
25850
  type: "button",
25747
25851
  onClick: onSignOut,
25748
- className: "mt-3 flex min-h-[48px] w-full items-center justify-center gap-2 rounded-[24px] bg-red-500/10 px-4 py-3 text-[14px] font-semibold text-red-400 transition-colors hover:bg-red-500/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-400/70",
25852
+ className: "mt-3 flex min-h-[48px] w-full items-center justify-center gap-2 rounded-[24px] bg-status-error-bg dark:bg-red-500/10 px-4 py-3 text-[14px] font-semibold text-status-error-text dark:text-red-400 transition-colors hover:bg-red-500/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-400/70",
25749
25853
  children: [
25750
25854
  /* @__PURE__ */ jsxRuntime.jsx(IconSignOut, {}),
25751
25855
  "Sign out"
@@ -25777,7 +25881,7 @@ function WalletMenuRow({
25777
25881
  {
25778
25882
  className: cx4(
25779
25883
  "mr-3 inline-flex h-8 w-8 items-center justify-center rounded-lg",
25780
- urgent ? "bg-violet-500/20 text-orange-400" : active ? "bg-surface-alt text-text-secondary" : "bg-surface-alt text-text-muted"
25884
+ urgent ? "bg-violet-500/20 text-primary dark:text-orange-400" : active ? "bg-surface-alt text-text-secondary" : "bg-surface-alt text-text-muted"
25781
25885
  ),
25782
25886
  children: item.icon
25783
25887
  }
@@ -25844,6 +25948,7 @@ function SectionPane(props) {
25844
25948
  {
25845
25949
  items: props.historyItems,
25846
25950
  filter: props.historyFilter,
25951
+ showFilters: props.showHistoryFilters ?? true,
25847
25952
  onFilterChange: props.onFilterChange,
25848
25953
  loading: props.historyLoading,
25849
25954
  error: props.historyError,
@@ -26016,7 +26121,7 @@ function DirectoryPane({
26016
26121
  {
26017
26122
  type: "button",
26018
26123
  onClick: () => setQuery(""),
26019
- className: "mt-2 min-h-[44px] rounded-xl px-3 text-[12px] font-semibold text-orange-400 hover:bg-orange-400/10",
26124
+ className: "mt-2 min-h-[44px] rounded-xl px-3 text-[12px] font-semibold text-primary dark:text-orange-400 hover:bg-primary/10 dark:hover:bg-orange-400/10",
26020
26125
  children: "Clear search"
26021
26126
  }
26022
26127
  )
@@ -26075,6 +26180,7 @@ function PendingSection({
26075
26180
  )) });
26076
26181
  }
26077
26182
  function HistorySection({
26183
+ showFilters = true,
26078
26184
  items,
26079
26185
  filter,
26080
26186
  onFilterChange,
@@ -26090,7 +26196,7 @@ function HistorySection({
26090
26196
  classNames
26091
26197
  }) {
26092
26198
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx4("p-3 space-y-3", classNames?.listSection), children: [
26093
- /* @__PURE__ */ jsxRuntime.jsx(FilterChips, { filter, onChange: onFilterChange }),
26199
+ showFilters ? /* @__PURE__ */ jsxRuntime.jsx(FilterChips, { filter, onChange: onFilterChange }) : null,
26094
26200
  error && /* @__PURE__ */ jsxRuntime.jsx(ErrorBanner, { children: error }),
26095
26201
  !loadedOnce && loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-10 flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { size: "md" }) }),
26096
26202
  loadedOnce && items.length === 0 && !loading && /* @__PURE__ */ jsxRuntime.jsx(
@@ -26173,6 +26279,7 @@ function DetailPane({
26173
26279
  source,
26174
26280
  userId,
26175
26281
  onBack,
26282
+ hideBack = false,
26176
26283
  onSigned,
26177
26284
  onRetry,
26178
26285
  onSwitchToSign,
@@ -26182,7 +26289,7 @@ function DetailPane({
26182
26289
  }) {
26183
26290
  const drawerKey = `signature-${source}-${message.id}`;
26184
26291
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col h-full", children: [
26185
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2.5 border-b border-border-light", children: /* @__PURE__ */ jsxRuntime.jsxs(
26292
+ hideBack ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2.5 border-b border-border-light", children: /* @__PURE__ */ jsxRuntime.jsxs(
26186
26293
  "button",
26187
26294
  {
26188
26295
  type: "button",
@@ -26267,9 +26374,9 @@ function WalletCenter({
26267
26374
  onCanceled
26268
26375
  }) {
26269
26376
  const { user } = useAuth();
26270
- const { isOpen, requestedView, closeWalletCenter } = useWalletCenter();
26377
+ const { isOpen, requestedView, closeWalletCenter, host, hostOptions, setHostTitle } = useWalletCenter();
26271
26378
  if (!isOpen || !user?.id) return null;
26272
- return /* @__PURE__ */ jsxRuntime.jsx(
26379
+ const surface = /* @__PURE__ */ jsxRuntime.jsx(
26273
26380
  WalletCenterSurface,
26274
26381
  {
26275
26382
  isOpen: true,
@@ -26284,9 +26391,13 @@ function WalletCenter({
26284
26391
  renderSimpleSummary,
26285
26392
  onSigned,
26286
26393
  onRetried,
26287
- onCanceled
26394
+ onCanceled,
26395
+ embedded: Boolean(host),
26396
+ backLabel: hostOptions.backLabel,
26397
+ onTitle: setHostTitle
26288
26398
  }
26289
26399
  );
26400
+ return host ? reactDom.createPortal(surface, host) : surface;
26290
26401
  }
26291
26402
  function WalletCenterTrigger({
26292
26403
  variant = "icon",
@@ -27940,7 +28051,7 @@ var BillingCenter = ({ dense = false }) => {
27940
28051
  if (notConfigured) {
27941
28052
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: outerClass, children: [
27942
28053
  !dense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
27943
- /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-lg font-semibold text-text-primary", children: [
28054
+ /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-lg font-semibold text-text-primary max-sm:sr-only", children: [
27944
28055
  "Usage & billing",
27945
28056
  !isLiveMode() && paymentsUrlMap() && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 align-middle inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider bg-amber-500/15 text-amber-600 ring-1 ring-amber-500/40", children: "Test mode" })
27946
28057
  ] }),
@@ -28026,7 +28137,7 @@ var BillingCenter = ({ dense = false }) => {
28026
28137
  const recoveryAction = summary ? billingRecoveryAction(summary) : null;
28027
28138
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: outerClass, children: [
28028
28139
  !dense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
28029
- /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-lg font-semibold text-text-primary", children: [
28140
+ /* @__PURE__ */ jsxRuntime.jsxs("h1", { className: "text-lg font-semibold text-text-primary max-sm:sr-only", children: [
28030
28141
  "Usage & billing",
28031
28142
  !isLiveMode() && paymentsUrlMap() && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 align-middle inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider bg-amber-500/15 text-amber-600 ring-1 ring-amber-500/40", children: "Test mode" })
28032
28143
  ] }),
@@ -29748,7 +29859,7 @@ function BusinessVerificationSection({
29748
29859
  };
29749
29860
  const copy = STATUS_COPY[status] ?? STATUS_COPY.unverified;
29750
29861
  const impl = flowInstance ? resolveKycInstance(config, flowInstance) : null;
29751
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-lg border border-white/[0.07] bg-white/[0.02] p-4 space-y-3", children: [
29862
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-lg border border-border-default dark:border-white/[0.07] bg-raised dark:bg-white/[0.02] p-4 space-y-3", children: [
29752
29863
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
29753
29864
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-sm font-semibold text-text-secondary", children: "Business verification" }),
29754
29865
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -30745,7 +30856,7 @@ var PendingPaymentCard = ({
30745
30856
  {
30746
30857
  className: [
30747
30858
  "flex items-center gap-3 px-3 py-2 border-b transition-colors",
30748
- isHighlighted ? "border-status-warning-text/40 bg-status-warning-bg/30" : "border-border-light hover:bg-chip",
30859
+ isHighlighted ? "border-status-warning-text/40 bg-status-warning-bg" : "border-border-light hover:bg-chip",
30749
30860
  className
30750
30861
  ].join(" "),
30751
30862
  children: [
@@ -30813,7 +30924,7 @@ var PendingPaymentCard = ({
30813
30924
  {
30814
30925
  className: [
30815
30926
  "rounded-lg border p-4 transition-shadow",
30816
- isHighlighted ? "border-status-warning-text/40 bg-status-warning-bg/40" : "border-border-default bg-surface",
30927
+ isHighlighted ? "border-status-warning-text/40 bg-status-warning-bg" : "border-border-default bg-surface",
30817
30928
  "hover:shadow-sm",
30818
30929
  className
30819
30930
  ].join(" "),
@@ -31704,6 +31815,7 @@ exports.snapshotNeedsPrepaidPlan = snapshotNeedsPrepaidPlan;
31704
31815
  exports.startMyEmailVerification = startMyEmailVerification;
31705
31816
  exports.statusToColor = statusToColor;
31706
31817
  exports.subscribeEntityEvents = subscribeEntityEvents;
31818
+ exports.subscribeJsonEvents = subscribeJsonEvents;
31707
31819
  exports.switchChain = switchChain;
31708
31820
  exports.syntheticPasskeyAddress = syntheticPasskeyAddress;
31709
31821
  exports.testChainIds = testChainIds;