@burdenoff/microfe-auth 2026.825.1 → 2026.828.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.
@@ -3,23 +3,24 @@ import { useAuthStore as t } from "../store/authStore.js";
3
3
  import { useAuthOperations as n } from "../hooks/useAuthOperations.js";
4
4
  import { useMyWorkspaces as r } from "../hooks/useMyWorkspaces.js";
5
5
  import { useOAuthOperations as i } from "../hooks/useOAuthOperations.js";
6
- import { AuthLayout as a } from "../components/AuthLayout.js";
7
- import { AlertIcon as o, EmailIcon as s, EyeIcon as c, EyeOffIcon as l, GoogleIcon as ee, LockIcon as te, MicrosoftIcon as ne, SpinnerIcon as re } from "../components/AuthIcons.js";
8
- import { useCaptchaV3 as ie } from "../hooks/useCaptchaV3.js";
9
- import { MFA_REDIRECT as ae } from "../constants/sessionKeys.js";
10
- import { useCallback as u, useEffect as d, useRef as oe, useState as f } from "react";
11
- import { SSORedirectSpinner as se, getSSORedirectUrl as ce } from "@burdenoff/fe-libs/shared/components";
12
- import { useLocation as le, useNavigate as ue, useSearchParams as de } from "react-router";
13
- import { useActiveContext as fe, useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell";
14
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
15
- import { beginSsoNavigation as me, buildSsoDepositUrl as he, isSsoNavigationPending as ge, markSsoDepositPending as _e, mintSsoSessionTokens as ve } from "@burdenoff/fe-libs/shared/utils";
16
- import { resolveAuthBridgeConfig as ye } from "@burdenoff/fe-libs/shared/config";
17
- import { resolveGatewayUrls as be } from "@burdenoff/fe-libs/shared/config/gatewayUrls";
18
- import { Button as xe } from "@burdenoff/fe-libs/button";
19
- import { PagePurpose as Se } from "@burdenoff/fe-libs/ui";
20
- import { getProfileTokens as g, getProfileUser as _, getProfileWorkspaceToken as Ce, getProfiles as v, resolveActiveProfileId as we } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
6
+ import { sanitizePostLoginPath as a } from "../utils/redirect.js";
7
+ import { AuthLayout as o } from "../components/AuthLayout.js";
8
+ import { AlertIcon as s, EmailIcon as c, EyeIcon as l, EyeOffIcon as ee, GoogleIcon as te, LockIcon as ne, MicrosoftIcon as u, SpinnerIcon as d } from "../components/AuthIcons.js";
9
+ import { useCaptchaV3 as re } from "../hooks/useCaptchaV3.js";
10
+ import { MFA_REDIRECT as ie } from "../constants/sessionKeys.js";
11
+ import { useCallback as f, useEffect as p, useRef as ae, useState as m } from "react";
12
+ import { SSORedirectSpinner as oe, getSSORedirectUrl as se } from "@burdenoff/fe-libs/shared/components";
13
+ import { useLocation as ce, useNavigate as le, useSearchParams as ue } from "react-router";
14
+ import { useActiveContext as de, useI18n as fe } from "@burdenoff/fe-libs/shared/providers/shell";
15
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
16
+ import { beginSsoNavigation as pe, buildSsoDepositUrl as me, isSsoNavigationPending as he, markSsoDepositPending as ge, mintSsoSessionTokens as _e } from "@burdenoff/fe-libs/shared/utils";
17
+ import { resolveAuthBridgeConfig as ve } from "@burdenoff/fe-libs/shared/config";
18
+ import { resolveGatewayUrls as ye } from "@burdenoff/fe-libs/shared/config/gatewayUrls";
19
+ import { Button as be } from "@burdenoff/fe-libs/button";
20
+ import { PagePurpose as xe } from "@burdenoff/fe-libs/ui";
21
+ import { getProfileTokens as Se, getProfileUser as Ce, getProfileWorkspaceToken as we, getProfiles as Te, resolveActiveProfileId as Ee } from "@burdenoff/fe-libs/shared/providers/shell/ProfileStorageManager";
21
22
  //#region src/auth/pages/LoginPage.tsx
22
- function Te() {
23
+ function De() {
23
24
  if (typeof window > "u") return !1;
24
25
  let e = window;
25
26
  if (typeof e.Capacitor?.isNativePlatform == "function") try {
@@ -27,7 +28,7 @@ function Te() {
27
28
  } catch {}
28
29
  return !!(typeof navigator < "u" && /Electron/i.test(navigator.userAgent || ""));
29
30
  }
30
- function Ee(e) {
31
+ function Oe(e) {
31
32
  if (typeof window > "u") return e;
32
33
  try {
33
34
  let t = new URL(e, window.location.origin);
@@ -36,7 +37,7 @@ function Ee(e) {
36
37
  return e;
37
38
  }
38
39
  }
39
- function De(e) {
40
+ function ke(e) {
40
41
  try {
41
42
  let t = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "="), r = JSON.parse(atob(n));
42
43
  return typeof r.exp == "number" && r.exp > Date.now() / 1e3;
@@ -44,16 +45,16 @@ function De(e) {
44
45
  return !1;
45
46
  }
46
47
  }
47
- function Oe(e) {
48
+ function Ae(e) {
48
49
  if (!e) return null;
49
50
  try {
50
51
  let t = new URL(decodeURIComponent(e), window.location.origin);
51
- return t.origin === window.location.origin ? y(t, { includeOrigin: !1 }) : null;
52
+ return t.origin === window.location.origin ? v(t, { includeOrigin: !1 }) : null;
52
53
  } catch {
53
54
  return null;
54
55
  }
55
56
  }
56
- function y(e, t) {
57
+ function v(e, t) {
57
58
  for (let t of [
58
59
  "sso_failed",
59
60
  "sso-failed",
@@ -63,92 +64,97 @@ function y(e, t) {
63
64
  let n = e.searchParams.toString();
64
65
  return `${e.pathname}${n ? `?${n}` : ""}${e.hash}`;
65
66
  }
66
- function b(e) {
67
+ function y(e) {
67
68
  try {
68
69
  let t = new URL(decodeURIComponent(e), window.location.origin);
69
- return y(t, { includeOrigin: t.origin !== window.location.origin });
70
+ return v(t, { includeOrigin: t.origin !== window.location.origin });
70
71
  } catch {
71
72
  return e;
72
73
  }
73
74
  }
74
- function x() {
75
- let y = ue(), x = le(), [S] = de(), { t: ke } = pe(), C = u((e, t) => {
76
- let n = ke(e);
75
+ function b() {
76
+ let v = le(), b = ce(), [x] = ue(), { t: S } = fe(), C = f((e, t) => {
77
+ let n = S(e);
77
78
  return n === e ? t : n;
78
- }, [ke]), { signIn: Ae, isLoading: je, error: w, errorCode: Me, resendVerification: Ne } = n(), { completeAuthFlow: Pe } = r(), { setWorkspace: Fe, setOrganization: Ie } = fe(), { defaultPostLoginPath: Le } = e(), { initiateGoogleOAuth: Re, initiateMicrosoftOAuth: ze, isProviderConfigured: T } = i(), E = t((e) => e.mfaRequired), { executeRecaptcha: Be } = ie(), [D, O] = f(!1), [Ve, He] = f(!1), k = u(async (e) => {
79
- if (typeof window > "u" || Te()) return e;
79
+ }, [S]), { signIn: je, isLoading: w, error: T, errorCode: E, resendVerification: Me } = n(), { completeAuthFlow: Ne } = r(), { setWorkspace: D, setOrganization: Pe } = de(), { defaultPostLoginPath: Fe } = e(), { initiateGoogleOAuth: Ie, initiateMicrosoftOAuth: Le, isProviderConfigured: O } = i(), Re = t((e) => e.mfaRequired), { executeRecaptcha: ze } = re(), [k, Be] = m(!1), [Ve, He] = m(!1), Ue = f(async (e) => {
80
+ if (typeof window > "u" || De()) return e;
80
81
  try {
81
- let t = ye(), n = new URL(t.url), r = window.location.origin;
82
+ let t = ve(), n = new URL(t.url), r = window.location.origin;
82
83
  if (n.origin === r) return e;
83
- let i = new URL(e, r).href, a = we();
84
+ let i = new URL(e, r).href, a = Ee();
84
85
  if (!a) return e;
85
- let o = g(a), s = _(a);
86
+ let o = Se(a), s = Ce(a);
86
87
  if (!o || !s) return e;
87
- let c = Ce(a), l = {
88
+ let c = we(a), l = {
88
89
  ...o,
89
90
  workspaceToken: c
90
91
  };
91
92
  if (o.refreshToken) {
92
- let { globalBaseUrl: e } = be(), { tokens: t } = await ve(`${e}/global/graphql`, o.refreshToken);
93
+ let { globalBaseUrl: e } = ye(), { tokens: t } = await _e(`${e}/global/graphql`, o.refreshToken);
93
94
  t && (l = {
94
95
  ...t,
95
96
  workspaceToken: c
96
97
  });
97
98
  }
98
- return _e(a), he(n.origin, i, {
99
+ return ge(a), me(n.origin, i, {
99
100
  profileId: a,
100
101
  tokens: JSON.stringify(l),
101
102
  user: JSON.stringify(s),
102
- profiles: JSON.stringify(v())
103
+ profiles: JSON.stringify(Te())
103
104
  });
104
105
  } catch {
105
106
  return e;
106
107
  }
107
- }, []), A = oe(!1), j = u((e) => {
108
+ }, []), A = ae(!1), j = f((e) => {
109
+ let t = a(e);
108
110
  if (typeof window > "u") {
109
- y(e);
111
+ v(t);
110
112
  return;
111
113
  }
112
114
  try {
113
- sessionStorage.setItem("bf-post-login-return-to", e);
115
+ sessionStorage.setItem("bf-post-login-return-to", t);
114
116
  } catch {}
115
- if (Te()) {
116
- y(Ee(e));
117
+ if (De()) {
118
+ v(Oe(t));
117
119
  return;
118
120
  }
119
121
  A.current = !0, (async () => {
120
- let t = await k(e);
121
- t.includes("/auth/sso-deposit") ? (me(), window.location.assign(t), window.setTimeout(() => {
122
- me(), window.location.replace(t);
123
- }, 2500)) : window.location.assign(t);
122
+ let e = await Promise.race([Ue(t), new Promise((e) => {
123
+ window.setTimeout(() => e(t), 3e3);
124
+ })]);
125
+ e.includes("/auth/sso-deposit") ? (pe(), window.location.assign(e), window.setTimeout(() => {
126
+ pe(), window.location.replace(e);
127
+ }, 2500)) : window.location.assign(e), window.setTimeout(() => {
128
+ typeof window < "u" && window.location.pathname === "/auth/login" && v("/dashboard");
129
+ }, 3500);
124
130
  })();
125
- }, [y, k]), [M, Ue] = f(!1), [N, P] = f(!1), [We, F] = f(!1), [Ge, I] = f(!1), [L, R] = f(!1), [z, B] = f(!1), [Ke, qe] = f(!1), [Je, V] = f(!1), [Ye, H] = f(null), [Xe, U] = f(null), [W, G] = f({
131
+ }, [v, Ue]), [M, We] = m(!1), [N, P] = m(!1), [Ge, F] = m(!1), [Ke, I] = m(!1), [L, R] = m(!1), [z, B] = m(!1), [qe, Je] = m(!1), [Ye, V] = m(!1), [Xe, H] = m(null), [Ze, U] = m(null), [W, G] = m({
126
132
  email: "",
127
133
  password: "",
128
134
  rememberMe: !1
129
- }), [K, q] = f(null), [Ze, J] = f(!1), Y = S.get("mode") === "add-account", X = S.get("returnTo"), Z = oe(X), Q = S.get("reason");
130
- d(() => {
135
+ }), [K, q] = m(null), [Qe, J] = m(!1), Y = x.get("mode") === "add-account", X = x.get("returnTo"), Z = ae(X), Q = x.get("reason");
136
+ p(() => {
131
137
  Q === "session-expired" ? U(C("auth.login.sessionExpired", "Your session has expired. Please sign in again.")) : Q === "logout" && U(C("auth.login.signedOut", "You have been signed out."));
132
- }, [Q, C]), d(() => {
138
+ }, [Q, C]), p(() => {
133
139
  !Z.current && X && (Z.current = X);
134
- }, [X]), d(() => {
135
- if (Y || D || A.current || ge()) return;
136
- let e = we();
140
+ }, [X]), p(() => {
141
+ if (Y || k || A.current || he()) return;
142
+ let e = Ee();
137
143
  if (e) {
138
- let n = g(e), r = _(e);
139
- if (n?.accessToken && r && De(n.accessToken)) {
140
- t.getState().loadFromProfile(e), j(Oe(X) ?? "/");
144
+ let n = Se(e), r = Ce(e);
145
+ if (n?.accessToken && r && ke(n.accessToken)) {
146
+ t.getState().loadFromProfile(e), j(Ae(X) ?? "/");
141
147
  return;
142
148
  }
143
149
  }
144
- let n = ce();
150
+ let n = se();
145
151
  n && (He(!0), window.location.replace(n));
146
152
  }, [
147
153
  Y,
148
- D,
154
+ k,
149
155
  j,
150
156
  X
151
- ]), d(() => {
157
+ ]), p(() => {
152
158
  try {
153
159
  localStorage.removeItem("remembered_password");
154
160
  let e = localStorage.getItem("remembered_email");
@@ -160,14 +166,14 @@ function x() {
160
166
  } catch (e) {
161
167
  console.warn("[LoginPage] Failed to load remembered email:", e);
162
168
  }
163
- }, []), d(() => {
164
- let e = x.state;
169
+ }, []), p(() => {
170
+ let e = b.state;
165
171
  e?.message && U(e.message), e?.email && G((t) => ({
166
172
  ...t,
167
173
  email: e.email
168
174
  })), e && window.history.replaceState({}, document.title);
169
- }, [x.state]);
170
- let Qe = (e, t) => {
175
+ }, [b.state]);
176
+ let $e = (e, t) => {
171
177
  if (t) switch (t) {
172
178
  case "ACCOUNT_DELETED": return "DELETED";
173
179
  case "ACCOUNT_SUSPENDED": return "SUSPENDED";
@@ -180,20 +186,20 @@ function x() {
180
186
  let n = e.toLowerCase();
181
187
  return n.includes("deleted") || n.includes("permanently deleted") ? "DELETED" : n.includes("suspended") ? "SUSPENDED" : n.includes("oauth provider") || n.includes("oauth-only") || n.includes("oauth only") ? "OAUTH_ONLY" : n.includes("inactive") || n.includes("deactivated") || n.includes("not active") ? "INACTIVE" : n.includes("verify your email") || n.includes("email not verified") || n.includes("email_not_verified") ? "EMAIL_NOT_VERIFIED" : null;
182
188
  };
183
- d(() => {
184
- let e = S.get("email");
189
+ p(() => {
190
+ let e = x.get("email");
185
191
  if (e && G((t) => ({
186
192
  ...t,
187
193
  email: e
188
- })), S.get("expired") === "true") {
194
+ })), x.get("expired") === "true") {
189
195
  U(C("auth.login.sessionExpired", "Your session has expired. Please sign in again."));
190
196
  let e = window.location.pathname;
191
197
  window.history.replaceState({}, document.title, e);
192
198
  }
193
- }, [S, C]), d(() => {
194
- E && y("/auth/mfa-verify");
195
- }, [E, y]);
196
- let $e = async (e) => {
199
+ }, [x, C]), p(() => {
200
+ Re && v("/auth/mfa-verify");
201
+ }, [Re, v]);
202
+ let et = async (e) => {
197
203
  e.preventDefault(), P(!1), F(!1), I(!1), R(!1), B(!1), J(!1), V(!1), q(null);
198
204
  let n = (W.email ?? "").trim();
199
205
  if (!n) {
@@ -208,22 +214,22 @@ function x() {
208
214
  q(C("auth.login.enterPassword", "Please enter your password"));
209
215
  return;
210
216
  }
211
- if (Y && v().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
217
+ if (Y && Te().some((e) => e.email.toLowerCase() === n.toLowerCase())) {
212
218
  J(!0), q(null);
213
219
  return;
214
220
  }
215
221
  J(!1);
216
222
  try {
217
- let e = await Be("login"), t = await Ae({
223
+ let e = await ze("login"), t = await je({
218
224
  email: n,
219
225
  password: W.password,
220
226
  rememberMe: W.rememberMe,
221
227
  ...e ? { recaptchaToken: e } : {}
222
228
  });
223
229
  if (t.requiresMFA) {
224
- let e = b(Z.current || X || (Le ?? "/dashboard"));
230
+ let e = y(Z.current || X || (Fe ?? "/dashboard"));
225
231
  try {
226
- sessionStorage.setItem(ae, e);
232
+ sessionStorage.setItem(ie, e);
227
233
  } catch {}
228
234
  return;
229
235
  }
@@ -243,10 +249,10 @@ function x() {
243
249
  } catch (e) {
244
250
  console.warn("[LoginPage] Failed to save/clear remembered email:", e);
245
251
  }
246
- O(!0);
247
- let e = b(Z.current || X || (Le ?? "/dashboard"));
252
+ Be(!0);
253
+ let e = y(Z.current || X || (Fe ?? "/dashboard"));
248
254
  try {
249
- let n = await Promise.race([Pe(t.token), new Promise((e) => {
255
+ let n = await Promise.race([Ne(t.token), new Promise((e) => {
250
256
  window.setTimeout(() => {
251
257
  e({
252
258
  success: !1,
@@ -254,122 +260,122 @@ function x() {
254
260
  });
255
261
  }, 5e3);
256
262
  })]);
257
- n.success ? (n.workspace && (Fe(n.workspace.id), n.workspace.organizationId && Ie(n.workspace.organizationId)), j(e)) : n.error?.includes("No workspaces found") ? y("/onboarding/create-workspace") : (n.workspace && (Fe(n.workspace.id), n.workspace.organizationId && Ie(n.workspace.organizationId)), console.warn("Auth flow warning:", n.error), j(e));
263
+ n.success ? (n.workspace && (D(n.workspace.id), n.workspace.organizationId && Pe(n.workspace.organizationId)), j(e)) : n.error?.includes("No workspaces found") ? v("/onboarding/create-workspace") : (n.workspace && (D(n.workspace.id), n.workspace.organizationId && Pe(n.workspace.organizationId)), console.warn("Auth flow warning:", n.error), j(e));
258
264
  } catch (t) {
259
265
  console.error("Auth flow error (login succeeded):", t), j(e);
260
266
  } finally {
261
- A.current || O(!1);
267
+ A.current || Be(!1);
262
268
  }
263
269
  }
264
270
  } catch (e) {
265
271
  let n = e instanceof Error ? e.message : String(e);
266
272
  n.includes("reCAPTCHA") && q(n);
267
- let r = t.getState().errorCode, i = Qe(n, r);
273
+ let r = t.getState().errorCode, i = $e(n, r);
268
274
  i === "DELETED" ? F(!0) : i === "SUSPENDED" ? I(!0) : i === "OAUTH_ONLY" ? R(!0) : i === "INACTIVE" ? P(!0) : i === "EMAIL_NOT_VERIFIED" && B(!0);
269
275
  }
270
276
  };
271
- d(() => {
272
- if (w) {
273
- let e = Qe(w, Me);
277
+ p(() => {
278
+ if (T) {
279
+ let e = $e(T, E);
274
280
  e === "DELETED" ? F(!0) : e === "SUSPENDED" ? I(!0) : e === "OAUTH_ONLY" ? R(!0) : e === "INACTIVE" ? P(!0) : e === "EMAIL_NOT_VERIFIED" && B(!0);
275
281
  }
276
- }, [w, Me]);
277
- let et = () => {
282
+ }, [T, E]);
283
+ let tt = () => {
278
284
  H(null);
279
285
  try {
280
- Re();
286
+ Ie();
281
287
  } catch (e) {
282
288
  H(e instanceof Error ? e.message : C("auth.login.googleSignInFailed", "Failed to initiate Google sign in"));
283
289
  }
284
- }, tt = () => {
290
+ }, nt = () => {
285
291
  H(null);
286
292
  try {
287
- ze();
293
+ Le();
288
294
  } catch (e) {
289
295
  H(e instanceof Error ? e.message : C("auth.login.microsoftSignInFailed", "Failed to initiate Microsoft sign in"));
290
296
  }
291
- }, nt = async () => {
292
- qe(!0), V(!1);
297
+ }, rt = async () => {
298
+ Je(!0), V(!1);
293
299
  try {
294
- (await Ne((W.email ?? "").trim())).success ? V(!0) : q(C("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
300
+ (await Me((W.email ?? "").trim())).success ? V(!0) : q(C("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
295
301
  } catch (e) {
296
302
  console.error("Failed to resend verification email:", e), q(e instanceof Error ? e.message : C("auth.login.resendFailed", "Failed to resend verification email. Please try again."));
297
303
  } finally {
298
- qe(!1);
304
+ Je(!1);
299
305
  }
300
- }, rt = T("google"), $ = T("microsoft"), it = [{
306
+ }, it = O("google"), $ = O("microsoft"), at = [{
301
307
  name: "Google",
302
- icon: ee,
303
- onClick: et,
304
- disabled: !rt,
305
- tooltip: rt ? void 0 : C("auth.login.googleNotConfigured", "Google sign in is not configured")
308
+ icon: te,
309
+ onClick: tt,
310
+ disabled: !it,
311
+ tooltip: it ? void 0 : C("auth.login.googleNotConfigured", "Google sign in is not configured")
306
312
  }, {
307
313
  name: "Microsoft",
308
- icon: ne,
309
- onClick: tt,
314
+ icon: u,
315
+ onClick: nt,
310
316
  disabled: !$,
311
317
  tooltip: $ ? void 0 : C("auth.login.microsoftNotConfigured", "Microsoft sign in is not configured")
312
318
  }];
313
- return Ve ? /* @__PURE__ */ m(se, {}) : /* @__PURE__ */ h(a, {
319
+ return Ve ? /* @__PURE__ */ g(oe, {}) : /* @__PURE__ */ _(o, {
314
320
  title: C("auth.login.welcomeBack", "Welcome back"),
315
321
  subtitle: C("auth.login.enterCredentials", "Enter your credentials to continue"),
316
322
  children: [
317
- /* @__PURE__ */ m(Se, {
323
+ /* @__PURE__ */ g(xe, {
318
324
  className: "mb-5",
319
325
  children: C("auth.login.purpose", "Sign in to reach your workspaces, agents, and settings. Use your email and password, a social provider, or a passwordless magic link.")
320
326
  }),
321
- /* @__PURE__ */ h("form", {
322
- onSubmit: $e,
327
+ /* @__PURE__ */ _("form", {
328
+ onSubmit: et,
323
329
  className: "space-y-5",
324
330
  children: [
325
- Xe && /* @__PURE__ */ h("div", {
331
+ Ze && /* @__PURE__ */ _("div", {
326
332
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-info-bg-subtle border-status-info-border",
327
- children: [/* @__PURE__ */ m("svg", {
333
+ children: [/* @__PURE__ */ g("svg", {
328
334
  className: "size-5 flex-shrink-0 mt-0.5 text-text-link",
329
335
  fill: "none",
330
336
  viewBox: "0 0 24 24",
331
337
  stroke: "currentColor",
332
- children: /* @__PURE__ */ m("path", {
338
+ children: /* @__PURE__ */ g("path", {
333
339
  strokeLinecap: "round",
334
340
  strokeLinejoin: "round",
335
341
  strokeWidth: 2,
336
342
  d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
337
343
  })
338
- }), /* @__PURE__ */ m("p", {
344
+ }), /* @__PURE__ */ g("p", {
339
345
  className: "text-sm text-status-info-text",
340
- children: Xe
346
+ children: Ze
341
347
  })]
342
348
  }),
343
- K && /* @__PURE__ */ h("div", {
349
+ K && /* @__PURE__ */ _("div", {
344
350
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
345
- children: [/* @__PURE__ */ m(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ m("p", {
351
+ children: [/* @__PURE__ */ g(s, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ g("p", {
346
352
  className: "text-sm text-status-warning-text",
347
353
  children: K
348
354
  })]
349
355
  }),
350
- Ze && /* @__PURE__ */ h("div", {
356
+ Qe && /* @__PURE__ */ _("div", {
351
357
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-warning-bg-subtle border-status-warning-border",
352
- children: [/* @__PURE__ */ m(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ h("div", {
358
+ children: [/* @__PURE__ */ g(s, { className: "size-5 flex-shrink-0 mt-0.5 text-status-warning-text" }), /* @__PURE__ */ _("div", {
353
359
  className: "flex-1",
354
360
  children: [
355
- /* @__PURE__ */ m("p", {
361
+ /* @__PURE__ */ g("p", {
356
362
  className: "text-sm font-medium text-status-warning-text",
357
363
  children: C("auth.login.duplicateAccount", "This account is already signed in.")
358
364
  }),
359
- /* @__PURE__ */ m("p", {
365
+ /* @__PURE__ */ g("p", {
360
366
  className: "mt-1 text-sm text-status-warning-text/80",
361
367
  children: C("auth.login.duplicateAccountHint", "Please use a different account, or go back and switch to this account from the profile menu.")
362
368
  }),
363
- (Z.current || X) && /* @__PURE__ */ h("button", {
369
+ (Z.current || X) && /* @__PURE__ */ _("button", {
364
370
  type: "button",
365
- onClick: () => y(decodeURIComponent(Z.current || X || "/dashboard")),
371
+ onClick: () => v(decodeURIComponent(Z.current || X || "/dashboard")),
366
372
  className: "mt-3 inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm",
367
- children: [/* @__PURE__ */ m("svg", {
373
+ children: [/* @__PURE__ */ g("svg", {
368
374
  className: "size-4",
369
375
  fill: "none",
370
376
  viewBox: "0 0 24 24",
371
377
  stroke: "currentColor",
372
- children: /* @__PURE__ */ m("path", {
378
+ children: /* @__PURE__ */ g("path", {
373
379
  strokeLinecap: "round",
374
380
  strokeLinejoin: "round",
375
381
  strokeWidth: 2,
@@ -380,48 +386,48 @@ function x() {
380
386
  ]
381
387
  })]
382
388
  }),
383
- w && !K && !Ze && /* @__PURE__ */ h("div", {
389
+ T && !K && !Qe && /* @__PURE__ */ _("div", {
384
390
  className: `flex items-start gap-3 p-4 rounded-xl border ${N || L || z ? "bg-status-warning-bg-subtle border-status-warning-border" : "bg-status-error-bg-subtle border-status-error-border"}`,
385
- children: [/* @__PURE__ */ m(o, { className: `size-5 flex-shrink-0 mt-0.5 ${N || L || z ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ h("div", {
391
+ children: [/* @__PURE__ */ g(s, { className: `size-5 flex-shrink-0 mt-0.5 ${N || L || z ? "text-status-warning-text" : "text-status-error-text"}` }), /* @__PURE__ */ _("div", {
386
392
  className: "flex-1",
387
393
  children: [
388
- /* @__PURE__ */ m("p", {
394
+ /* @__PURE__ */ g("p", {
389
395
  className: `text-sm ${N || L || z ? "text-status-warning-text" : "text-status-error-text"}`,
390
- children: We ? C("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Ge ? C("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : N ? C("auth.login.accountDeactivated", "Your account has been deactivated.") : L ? C("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : z ? C("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : w
396
+ children: Ge ? C("auth.login.accountDeleted", "This account has been permanently deleted and cannot be recovered.") : Ke ? C("auth.login.accountSuspended", "Your account has been suspended. Please contact support for assistance.") : N ? C("auth.login.accountDeactivated", "Your account has been deactivated.") : L ? C("auth.login.oauthOnly", "This account uses OAuth sign-in. Please use Google or Microsoft to sign in.") : z ? C("auth.login.emailNotVerified", "Please verify your email before signing in. Check your inbox for the verification link.") : T
391
397
  }),
392
- N && /* @__PURE__ */ m("button", {
398
+ N && /* @__PURE__ */ g("button", {
393
399
  type: "button",
394
- onClick: () => y("/auth/reactivate", { state: { email: W.email } }),
400
+ onClick: () => v("/auth/reactivate", { state: { email: W.email } }),
395
401
  className: "mt-2 text-sm font-semibold text-status-warning-text hover:text-status-warning-text underline underline-offset-2",
396
402
  children: C("auth.login.clickReactivate", "Click here to reactivate your account")
397
403
  }),
398
- z && /* @__PURE__ */ m("div", {
404
+ z && /* @__PURE__ */ g("div", {
399
405
  className: "mt-3",
400
- children: Je ? /* @__PURE__ */ h("div", {
406
+ children: Ye ? /* @__PURE__ */ _("div", {
401
407
  className: "flex items-center gap-2 text-sm text-status-success-text",
402
- children: [/* @__PURE__ */ m("svg", {
408
+ children: [/* @__PURE__ */ g("svg", {
403
409
  className: "size-4",
404
410
  fill: "none",
405
411
  viewBox: "0 0 24 24",
406
412
  stroke: "currentColor",
407
- children: /* @__PURE__ */ m("path", {
413
+ children: /* @__PURE__ */ g("path", {
408
414
  strokeLinecap: "round",
409
415
  strokeLinejoin: "round",
410
416
  strokeWidth: 2,
411
417
  d: "M5 13l4 4L19 7"
412
418
  })
413
419
  }), C("auth.login.verificationSent", "Verification email sent! Please check your inbox.")]
414
- }) : /* @__PURE__ */ m("button", {
420
+ }) : /* @__PURE__ */ g("button", {
415
421
  type: "button",
416
- onClick: nt,
417
- disabled: Ke,
422
+ onClick: rt,
423
+ disabled: qe,
418
424
  className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl border border-status-warning-border bg-bg-surface text-status-warning-text text-sm font-medium hover:bg-status-warning-bg-subtle hover:border-status-warning-border transition-all shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",
419
- children: Ke ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(re, { className: "size-4 animate-spin" }), C("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("svg", {
425
+ children: qe ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, { className: "size-4 animate-spin" }), C("auth.login.sending", "Sending...")] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("svg", {
420
426
  className: "size-4",
421
427
  fill: "none",
422
428
  viewBox: "0 0 24 24",
423
429
  stroke: "currentColor",
424
- children: /* @__PURE__ */ m("path", {
430
+ children: /* @__PURE__ */ g("path", {
425
431
  strokeLinecap: "round",
426
432
  strokeLinejoin: "round",
427
433
  strokeWidth: 2,
@@ -430,35 +436,35 @@ function x() {
430
436
  }), C("auth.login.resendVerification", "Resend verification email")] })
431
437
  })
432
438
  }),
433
- L && /* @__PURE__ */ h("div", {
439
+ L && /* @__PURE__ */ _("div", {
434
440
  className: "mt-3 flex flex-col gap-2",
435
- children: [T("google") && /* @__PURE__ */ h("button", {
441
+ children: [O("google") && /* @__PURE__ */ _("button", {
436
442
  type: "button",
437
- onClick: et,
443
+ onClick: tt,
438
444
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
439
- children: [/* @__PURE__ */ m(ee, { className: "size-5" }), C("auth.login.signInWithGoogle", "Sign in with Google")]
440
- }), T("microsoft") && /* @__PURE__ */ h("button", {
445
+ children: [/* @__PURE__ */ g(te, { className: "size-5" }), C("auth.login.signInWithGoogle", "Sign in with Google")]
446
+ }), O("microsoft") && /* @__PURE__ */ _("button", {
441
447
  type: "button",
442
- onClick: tt,
448
+ onClick: nt,
443
449
  className: "inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border border-border-default bg-bg-surface text-text-primary text-sm font-medium hover:bg-bg-canvas hover:border-border-default transition-all shadow-sm",
444
- children: [/* @__PURE__ */ m(ne, { className: "size-5" }), C("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
450
+ children: [/* @__PURE__ */ g(u, { className: "size-5" }), C("auth.login.signInWithMicrosoft", "Sign in with Microsoft")]
445
451
  })]
446
452
  })
447
453
  ]
448
454
  })]
449
455
  }),
450
- /* @__PURE__ */ h("div", {
456
+ /* @__PURE__ */ _("div", {
451
457
  className: "space-y-2",
452
- children: [/* @__PURE__ */ m("label", {
458
+ children: [/* @__PURE__ */ g("label", {
453
459
  htmlFor: "email",
454
460
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
455
461
  children: C("auth.login.emailLabel", "Email")
456
- }), /* @__PURE__ */ h("div", {
462
+ }), /* @__PURE__ */ _("div", {
457
463
  className: "relative",
458
- children: [/* @__PURE__ */ m("div", {
464
+ children: [/* @__PURE__ */ g("div", {
459
465
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
460
- children: /* @__PURE__ */ m(s, { className: "size-5 text-[var(--color-text-tertiary)]" })
461
- }), /* @__PURE__ */ m("input", {
466
+ children: /* @__PURE__ */ g(c, { className: "size-5 text-[var(--color-text-tertiary)]" })
467
+ }), /* @__PURE__ */ g("input", {
462
468
  id: "email",
463
469
  type: "email",
464
470
  autoComplete: "email",
@@ -475,20 +481,20 @@ function x() {
475
481
  })]
476
482
  })]
477
483
  }),
478
- /* @__PURE__ */ h("div", {
484
+ /* @__PURE__ */ _("div", {
479
485
  className: "space-y-2",
480
- children: [/* @__PURE__ */ m("label", {
486
+ children: [/* @__PURE__ */ g("label", {
481
487
  htmlFor: "password",
482
488
  className: "block text-sm font-medium text-[var(--color-text-primary)]",
483
489
  children: C("auth.login.passwordLabel", "Password")
484
- }), /* @__PURE__ */ h("div", {
490
+ }), /* @__PURE__ */ _("div", {
485
491
  className: "relative",
486
492
  children: [
487
- /* @__PURE__ */ m("div", {
493
+ /* @__PURE__ */ g("div", {
488
494
  className: "absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none",
489
- children: /* @__PURE__ */ m(te, { className: "size-5 text-[var(--color-text-tertiary)]" })
495
+ children: /* @__PURE__ */ g(ne, { className: "size-5 text-[var(--color-text-tertiary)]" })
490
496
  }),
491
- /* @__PURE__ */ m("input", {
497
+ /* @__PURE__ */ g("input", {
492
498
  id: "password",
493
499
  type: M ? "text" : "password",
494
500
  autoComplete: "current-password",
@@ -503,23 +509,23 @@ function x() {
503
509
  className: "block w-full pl-[3.5rem] pr-12 py-3 rounded-xl border border-[var(--color-border-default)] bg-[var(--color-bg-surface)] text-[var(--color-text-primary)] placeholder:text-[var(--color-text-tertiary)] focus:outline-none focus:ring-2 focus:ring-action-primary-bg/20 focus:border-action-primary-bg transition-all",
504
510
  placeholder: C("auth.login.passwordPlaceholder", "Enter your password")
505
511
  }),
506
- /* @__PURE__ */ m("button", {
512
+ /* @__PURE__ */ g("button", {
507
513
  type: "button",
508
- onClick: () => Ue(!M),
514
+ onClick: () => We(!M),
509
515
  "aria-label": M ? "Hide password" : "Show password",
510
516
  className: "absolute inset-y-0 right-0 pr-3.5 flex items-center text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] transition-colors",
511
- children: m(M ? l : c, { className: "size-5" })
517
+ children: g(M ? ee : l, { className: "size-5" })
512
518
  })
513
519
  ]
514
520
  })]
515
521
  }),
516
- /* @__PURE__ */ h("div", {
522
+ /* @__PURE__ */ _("div", {
517
523
  className: "flex items-center justify-between",
518
- children: [/* @__PURE__ */ h("label", {
524
+ children: [/* @__PURE__ */ _("label", {
519
525
  className: "flex items-center gap-2 cursor-pointer group",
520
- children: [/* @__PURE__ */ h("div", {
526
+ children: [/* @__PURE__ */ _("div", {
521
527
  className: "relative",
522
- children: [/* @__PURE__ */ m("input", {
528
+ children: [/* @__PURE__ */ g("input", {
523
529
  type: "checkbox",
524
530
  "aria-label": C("auth.login.rememberMe", "Remember me"),
525
531
  checked: W.rememberMe,
@@ -535,101 +541,101 @@ function x() {
535
541
  }
536
542
  },
537
543
  className: "sr-only peer"
538
- }), /* @__PURE__ */ m("div", {
544
+ }), /* @__PURE__ */ g("div", {
539
545
  className: "size-5 rounded-md border-2 border-[var(--color-border-default)] bg-[var(--color-bg-surface)] peer-checked:bg-status-info-bg-subtle0 peer-checked:border-action-primary-bg transition-all peer-focus:ring-2 peer-focus:ring-action-primary-bg/20",
540
- children: /* @__PURE__ */ m("svg", {
546
+ children: /* @__PURE__ */ g("svg", {
541
547
  className: "size-full text-white opacity-0 peer-checked:opacity-100 transition-opacity p-0.5",
542
548
  fill: "none",
543
549
  viewBox: "0 0 24 24",
544
550
  stroke: "currentColor",
545
551
  strokeWidth: 3,
546
- children: /* @__PURE__ */ m("path", {
552
+ children: /* @__PURE__ */ g("path", {
547
553
  strokeLinecap: "round",
548
554
  strokeLinejoin: "round",
549
555
  d: "M5 13l4 4L19 7"
550
556
  })
551
557
  })
552
558
  })]
553
- }), /* @__PURE__ */ m("span", {
559
+ }), /* @__PURE__ */ g("span", {
554
560
  className: "text-sm text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)] transition-colors",
555
561
  children: C("auth.login.rememberMe", "Remember me")
556
562
  })]
557
- }), /* @__PURE__ */ m("button", {
563
+ }), /* @__PURE__ */ g("button", {
558
564
  type: "button",
559
- onClick: () => y("/auth/reset-password"),
565
+ onClick: () => v("/auth/reset-password"),
560
566
  className: "text-sm font-medium text-text-link hover:text-text-linkHover transition-colors",
561
567
  children: C("auth.login.forgotPassword", "Forgot password?")
562
568
  })]
563
569
  }),
564
- /* @__PURE__ */ m(xe, {
570
+ /* @__PURE__ */ g(be, {
565
571
  type: "submit",
566
- disabled: je || D,
572
+ disabled: w || k,
567
573
  variant: "default",
568
574
  size: "lg",
569
575
  className: "w-full font-semibold",
570
- children: je || D ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(re, { className: "size-5 animate-spin" }), /* @__PURE__ */ m("span", { children: D ? C("auth.login.settingUpWorkspace", "Setting up workspace...") : C("auth.login.signingIn", "Signing in...") })] }) : C("auth.login.signIn", "Sign in")
576
+ children: w || k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, { className: "size-5 animate-spin" }), /* @__PURE__ */ g("span", { children: k ? C("auth.login.settingUpWorkspace", "Setting up workspace...") : C("auth.login.signingIn", "Signing in...") })] }) : C("auth.login.signIn", "Sign in")
571
577
  })
572
578
  ]
573
579
  }),
574
- /* @__PURE__ */ h("div", {
580
+ /* @__PURE__ */ _("div", {
575
581
  className: "relative my-8",
576
- children: [/* @__PURE__ */ m("div", {
582
+ children: [/* @__PURE__ */ g("div", {
577
583
  className: "absolute inset-0 flex items-center",
578
- children: /* @__PURE__ */ m("div", { className: "w-full border-t border-[var(--color-border-default)]" })
579
- }), /* @__PURE__ */ m("div", {
584
+ children: /* @__PURE__ */ g("div", { className: "w-full border-t border-[var(--color-border-default)]" })
585
+ }), /* @__PURE__ */ g("div", {
580
586
  className: "relative flex justify-center",
581
- children: /* @__PURE__ */ m("span", {
587
+ children: /* @__PURE__ */ g("span", {
582
588
  className: "px-4 bg-[var(--color-bg-canvas)] text-sm text-[var(--color-text-tertiary)]",
583
589
  children: C("auth.login.orContinueWith", "or continue with")
584
590
  })
585
591
  })]
586
592
  }),
587
- Ye && /* @__PURE__ */ h("div", {
593
+ Xe && /* @__PURE__ */ _("div", {
588
594
  className: "flex items-start gap-3 p-4 rounded-xl border bg-status-error-bg-subtle border-status-error-border",
589
- children: [/* @__PURE__ */ m(o, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ m("p", {
595
+ children: [/* @__PURE__ */ g(s, { className: "size-5 flex-shrink-0 mt-0.5 text-status-error-text" }), /* @__PURE__ */ g("p", {
590
596
  className: "text-sm text-status-error-text",
591
- children: Ye
597
+ children: Xe
592
598
  })]
593
599
  }),
594
- /* @__PURE__ */ m("div", {
600
+ /* @__PURE__ */ g("div", {
595
601
  className: "grid grid-cols-3 gap-3",
596
- children: it.map((e) => /* @__PURE__ */ h("button", {
602
+ children: at.map((e) => /* @__PURE__ */ _("button", {
597
603
  type: "button",
598
604
  onClick: e.onClick,
599
605
  disabled: e.disabled,
600
606
  title: e.tooltip,
601
607
  "aria-label": e.name,
602
608
  className: `flex items-center justify-center gap-2 px-4 py-3 rounded-xl border transition-all duration-200 group ${e.disabled ? "border-[var(--color-border-subtle)] bg-[var(--color-bg-disabled)] cursor-not-allowed opacity-50" : "border-[var(--color-border-default)] bg-[var(--color-bg-surface)] hover:bg-[var(--color-bg-sunken)] hover:border-[var(--color-border-strong)]"}`,
603
- children: [/* @__PURE__ */ m(e.icon, { className: `size-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ m("span", {
609
+ children: [/* @__PURE__ */ g(e.icon, { className: `size-5 ${e.disabled ? "opacity-50" : ""}` }), /* @__PURE__ */ g("span", {
604
610
  className: `sr-only sm:not-sr-only text-sm font-medium transition-colors ${e.disabled ? "text-[var(--color-text-disabled)]" : "text-[var(--color-text-secondary)] group-hover:text-[var(--color-text-primary)]"}`,
605
611
  children: e.name
606
612
  })]
607
613
  }, e.name))
608
614
  }),
609
- /* @__PURE__ */ m("div", {
615
+ /* @__PURE__ */ g("div", {
610
616
  className: "mt-4 text-center",
611
- children: /* @__PURE__ */ h("button", {
617
+ children: /* @__PURE__ */ _("button", {
612
618
  type: "button",
613
- onClick: () => y("/auth/magic-link"),
619
+ onClick: () => v("/auth/magic-link"),
614
620
  className: "text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] transition-colors",
615
621
  children: [
616
622
  C("auth.login.preferPasswordless", "Prefer passwordless login?"),
617
623
  " ",
618
- /* @__PURE__ */ m("span", {
624
+ /* @__PURE__ */ g("span", {
619
625
  className: "font-semibold text-text-link hover:text-text-linkHover",
620
626
  children: C("auth.login.signInMagicLink", "Sign in with Magic Link")
621
627
  })
622
628
  ]
623
629
  })
624
630
  }),
625
- /* @__PURE__ */ h("p", {
631
+ /* @__PURE__ */ _("p", {
626
632
  className: "mt-6 text-center text-sm text-[var(--color-text-secondary)]",
627
633
  children: [
628
634
  C("auth.login.dontHaveAccount", "Don't have an account?"),
629
635
  " ",
630
- /* @__PURE__ */ m("button", {
636
+ /* @__PURE__ */ g("button", {
631
637
  type: "button",
632
- onClick: () => y("/auth/register"),
638
+ onClick: () => v("/auth/register"),
633
639
  className: "font-semibold text-text-link hover:text-text-linkHover transition-colors",
634
640
  children: C("auth.login.signUp", "Sign up")
635
641
  })
@@ -639,6 +645,6 @@ function x() {
639
645
  });
640
646
  }
641
647
  //#endregion
642
- export { x as LoginPage };
648
+ export { b as LoginPage };
643
649
 
644
650
  //# sourceMappingURL=LoginPage.js.map