@burdenoff/microfe-auth 2026.527.3 → 2026.528.1

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