@skylabs-digital/react-identity-access 1.3.0 → 1.4.0

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as n, Fragment as B, jsxs as u } from "react/jsx-runtime";
2
- import { createContext as ee, useState as m, useMemo as O, useCallback as X, useEffect as K, useContext as te } from "react";
3
- import { useLocation as me, Navigate as ae } from "react-router";
1
+ import { jsx as s, Fragment as H, jsxs as c } from "react/jsx-runtime";
2
+ import { createContext as ee, useState as b, useMemo as z, useCallback as Z, useEffect as Y, useContext as te } from "react";
3
+ import { useLocation as ae, Navigate as ne } from "react-router";
4
4
  class G {
5
5
  // SessionManager instance
6
6
  constructor(e, t = 1e4) {
@@ -12,16 +12,16 @@ class G {
12
12
  getBaseUrl() {
13
13
  return this.baseUrl;
14
14
  }
15
- async request(e, t, r, s) {
16
- return this.executeRequest(e, t, r, s, !1);
15
+ async request(e, t, r, n) {
16
+ return this.executeRequest(e, t, r, n, !1);
17
17
  }
18
- async executeRequest(e, t, r, s, a = !1) {
19
- const v = `${this.baseUrl}${t.startsWith("/") ? t : `/${t}`}`, T = (s == null ? void 0 : s.timeout) || this.timeout;
18
+ async executeRequest(e, t, r, n, o = !1) {
19
+ const m = `${this.baseUrl}${t.startsWith("/") ? t : `/${t}`}`, T = (n == null ? void 0 : n.timeout) || this.timeout;
20
20
  let M = {
21
21
  "Content-Type": "application/json",
22
- ...s == null ? void 0 : s.headers
22
+ ...n == null ? void 0 : n.headers
23
23
  };
24
- if (!(s != null && s.skipAuth) && this.sessionManager)
24
+ if (!(n != null && n.skipAuth) && this.sessionManager)
25
25
  try {
26
26
  const h = await this.sessionManager.getAuthHeaders();
27
27
  M = { ...M, ...h };
@@ -30,17 +30,17 @@ class G {
30
30
  }
31
31
  const P = new AbortController(), g = setTimeout(() => P.abort(), T);
32
32
  try {
33
- const h = await fetch(v, {
33
+ const h = await fetch(m, {
34
34
  method: e,
35
35
  headers: M,
36
36
  body: r ? JSON.stringify(r) : void 0,
37
37
  signal: P.signal
38
38
  });
39
- if (clearTimeout(g), h.status === 401 && !(s != null && s.skipRetry) && !a && this.sessionManager)
39
+ if (clearTimeout(g), h.status === 401 && !(n != null && n.skipRetry) && !o && this.sessionManager)
40
40
  try {
41
41
  const p = this.sessionManager.getTokens();
42
42
  if (p != null && p.refreshToken)
43
- return await this.sessionManager.getAuthHeaders(), this.executeRequest(e, t, r, s, !0);
43
+ return await this.sessionManager.getAuthHeaders(), this.executeRequest(e, t, r, n, !0);
44
44
  } catch {
45
45
  throw new Error(`HTTP ${h.status}: ${h.statusText}`);
46
46
  }
@@ -78,12 +78,12 @@ class be {
78
78
  async getApps(e) {
79
79
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
80
80
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder);
81
- const s = `/apps/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
81
+ const n = `/apps/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
82
82
  headers: t
83
83
  });
84
84
  return {
85
- apps: a.data,
86
- meta: a.meta
85
+ apps: o.data,
86
+ meta: o.meta
87
87
  };
88
88
  }
89
89
  async getAppById(e) {
@@ -110,11 +110,11 @@ class be {
110
110
  )).data;
111
111
  }
112
112
  async updateSettingsSchema(e, t, r) {
113
- const s = await this.sessionManager.getAuthHeaders();
113
+ const n = await this.sessionManager.getAuthHeaders();
114
114
  return (await this.httpService.put(
115
115
  `/apps/${e}/settings-schema`,
116
116
  { schema: t, defaultSettings: r },
117
- { headers: s }
117
+ { headers: n }
118
118
  )).data;
119
119
  }
120
120
  async exportConfig(e) {
@@ -124,7 +124,7 @@ class be {
124
124
  })).data;
125
125
  }
126
126
  }
127
- const ge = ee(null), Se = () => /* @__PURE__ */ n(
127
+ const pe = ee(null), Se = () => /* @__PURE__ */ s(
128
128
  "div",
129
129
  {
130
130
  style: {
@@ -134,9 +134,9 @@ const ge = ee(null), Se = () => /* @__PURE__ */ n(
134
134
  height: "100vh",
135
135
  fontFamily: "system-ui, sans-serif"
136
136
  },
137
- children: /* @__PURE__ */ n("div", { children: "Loading application..." })
137
+ children: /* @__PURE__ */ s("div", { children: "Loading application..." })
138
138
  }
139
- ), ve = ({ error: i, retry: e }) => /* @__PURE__ */ u(
139
+ ), ve = ({ error: i, retry: e }) => /* @__PURE__ */ c(
140
140
  "div",
141
141
  {
142
142
  style: {
@@ -150,9 +150,9 @@ const ge = ee(null), Se = () => /* @__PURE__ */ n(
150
150
  padding: "20px"
151
151
  },
152
152
  children: [
153
- /* @__PURE__ */ n("h2", { style: { color: "#dc3545", marginBottom: "16px" }, children: "Application Error" }),
154
- /* @__PURE__ */ n("p", { style: { color: "#6c757d", marginBottom: "24px" }, children: i.message || "Unable to load application" }),
155
- /* @__PURE__ */ n(
153
+ /* @__PURE__ */ s("h2", { style: { color: "#dc3545", marginBottom: "16px" }, children: "Application Error" }),
154
+ /* @__PURE__ */ s("p", { style: { color: "#6c757d", marginBottom: "24px" }, children: i.message || "Unable to load application" }),
155
+ /* @__PURE__ */ s(
156
156
  "button",
157
157
  {
158
158
  onClick: e,
@@ -170,8 +170,8 @@ const ge = ee(null), Se = () => /* @__PURE__ */ n(
170
170
  ]
171
171
  }
172
172
  );
173
- function Je({ config: i, children: e }) {
174
- const [t, r] = m(null), [s, a] = m(!0), [v, T] = m(null), M = O(() => {
173
+ function Ze({ config: i, children: e }) {
174
+ const [t, r] = b(null), [n, o] = b(!0), [m, T] = b(null), M = z(() => {
175
175
  const g = () => {
176
176
  P();
177
177
  };
@@ -180,39 +180,39 @@ function Je({ config: i, children: e }) {
180
180
  baseUrl: i.baseUrl,
181
181
  // App info
182
182
  appInfo: t,
183
- isAppLoading: s,
184
- appError: v,
183
+ isAppLoading: n,
184
+ appError: m,
185
185
  retryApp: g
186
186
  };
187
- }, [i, t, s, v]), P = X(async () => {
187
+ }, [i, t, n, m]), P = Z(async () => {
188
188
  try {
189
- a(!0), T(null);
189
+ o(!0), T(null);
190
190
  const g = new G(i.baseUrl), x = await new be(g, {}).getPublicAppInfo(i.appId);
191
191
  r(x);
192
192
  } catch (g) {
193
193
  const h = g instanceof Error ? g : new Error("Failed to load app information");
194
194
  T(h), r(null);
195
195
  } finally {
196
- a(!1);
196
+ o(!1);
197
197
  }
198
198
  }, [i.baseUrl, i.appId]);
199
- if (K(() => {
199
+ if (Y(() => {
200
200
  P();
201
- }, [P]), s)
202
- return /* @__PURE__ */ n(B, { children: i.loadingFallback || /* @__PURE__ */ n(Se, {}) });
203
- if (v) {
204
- const g = typeof i.errorFallback == "function" ? i.errorFallback(v, () => P()) : i.errorFallback || /* @__PURE__ */ n(ve, { error: v, retry: () => P() });
205
- return /* @__PURE__ */ n(B, { children: g });
201
+ }, [P]), n)
202
+ return /* @__PURE__ */ s(H, { children: i.loadingFallback || /* @__PURE__ */ s(Se, {}) });
203
+ if (m) {
204
+ const g = typeof i.errorFallback == "function" ? i.errorFallback(m, () => P()) : i.errorFallback || /* @__PURE__ */ s(ve, { error: m, retry: () => P() });
205
+ return /* @__PURE__ */ s(H, { children: g });
206
206
  }
207
- return /* @__PURE__ */ n(ge.Provider, { value: M, children: e });
207
+ return /* @__PURE__ */ s(pe.Provider, { value: M, children: e });
208
208
  }
209
209
  function re() {
210
- const i = te(ge);
210
+ const i = te(pe);
211
211
  if (!i)
212
212
  throw new Error("useApp must be used within an AppProvider");
213
213
  return i;
214
214
  }
215
- const Xe = re;
215
+ const et = re;
216
216
  class xe {
217
217
  constructor(e = {}) {
218
218
  this.refreshPromise = null, this.refreshQueue = [], this.storageKey = e.storageKey || "auth_tokens", this.autoRefresh = e.autoRefresh ?? !0, this.refreshThreshold = e.refreshThreshold || 3e5, this.onRefreshFailed = e.onRefreshFailed, this.baseUrl = e.baseUrl || "", this.tokenStorage = e.tokenStorage || {
@@ -281,10 +281,10 @@ class xe {
281
281
  try {
282
282
  await this.refreshPromise;
283
283
  const t = this.getTokens(), r = t != null && t.accessToken ? { Authorization: `Bearer ${t.accessToken}` } : {};
284
- return this.refreshQueue.forEach(({ resolve: s }) => s(r)), this.refreshQueue = [], r;
284
+ return this.refreshQueue.forEach(({ resolve: n }) => n(r)), this.refreshQueue = [], r;
285
285
  } catch (t) {
286
286
  const r = t instanceof Error ? t : new Error("Token refresh failed");
287
- return this.refreshQueue.forEach(({ reject: s }) => s(r)), this.refreshQueue = [], this.clearSession(), this.onRefreshFailed && this.onRefreshFailed(), {};
287
+ return this.refreshQueue.forEach(({ reject: n }) => n(r)), this.refreshQueue = [], this.clearSession(), this.onRefreshFailed && this.onRefreshFailed(), {};
288
288
  } finally {
289
289
  this.refreshPromise = null;
290
290
  }
@@ -303,11 +303,11 @@ class xe {
303
303
  });
304
304
  if (!r.ok)
305
305
  throw new Error(`Token refresh failed: ${r.status} ${r.statusText}`);
306
- const s = await r.json();
306
+ const n = await r.json();
307
307
  this.setTokens({
308
- accessToken: s.accessToken,
309
- refreshToken: s.refreshToken || e,
310
- expiresIn: s.expiresIn
308
+ accessToken: n.accessToken,
309
+ refreshToken: n.refreshToken || e,
310
+ expiresIn: n.expiresIn
311
311
  });
312
312
  }
313
313
  setUser(e) {
@@ -364,7 +364,7 @@ class Ae {
364
364
  });
365
365
  }
366
366
  }
367
- class le {
367
+ class ce {
368
368
  constructor(e, t) {
369
369
  this.httpService = e, this.sessionManager = t;
370
370
  }
@@ -404,10 +404,10 @@ class le {
404
404
  async getRolesByApp(e, t) {
405
405
  const r = new URLSearchParams();
406
406
  t != null && t.page && r.append("page", t.page.toString()), t != null && t.limit && r.append("limit", t.limit.toString()), t != null && t.sortBy && r.append("sortBy", t.sortBy), t != null && t.sortOrder && r.append("sortOrder", t.sortOrder);
407
- const s = `/roles/app/${e}${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s);
407
+ const n = `/roles/app/${e}${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n);
408
408
  return {
409
- roles: a.data,
410
- meta: a.meta
409
+ roles: o.data,
410
+ meta: o.meta
411
411
  };
412
412
  }
413
413
  async assignRole(e, t) {
@@ -429,14 +429,14 @@ class le {
429
429
  async getUserRoles(e, t) {
430
430
  if (!this.sessionManager)
431
431
  throw new Error("SessionManager is required for private endpoints");
432
- const r = await this.sessionManager.getAuthHeaders(), s = new URLSearchParams();
433
- t != null && t.page && s.append("page", t.page.toString()), t != null && t.limit && s.append("limit", t.limit.toString()), t != null && t.sortBy && s.append("sortBy", t.sortBy), t != null && t.sortOrder && s.append("sortOrder", t.sortOrder);
434
- const a = `/roles/user/${e}${s.toString() ? `?${s.toString()}` : ""}`, v = await this.httpService.get(a, {
432
+ const r = await this.sessionManager.getAuthHeaders(), n = new URLSearchParams();
433
+ t != null && t.page && n.append("page", t.page.toString()), t != null && t.limit && n.append("limit", t.limit.toString()), t != null && t.sortBy && n.append("sortBy", t.sortBy), t != null && t.sortOrder && n.append("sortOrder", t.sortOrder);
434
+ const o = `/roles/user/${e}${n.toString() ? `?${n.toString()}` : ""}`, m = await this.httpService.get(o, {
435
435
  headers: r
436
436
  });
437
437
  return {
438
- roles: v.data,
439
- meta: v.meta
438
+ roles: m.data,
439
+ meta: m.meta
440
440
  };
441
441
  }
442
442
  }
@@ -453,12 +453,12 @@ class Pe {
453
453
  async getUsers(e) {
454
454
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
455
455
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder);
456
- const s = `/users/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
456
+ const n = `/users/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
457
457
  headers: t
458
458
  });
459
459
  return {
460
- users: a.data,
461
- meta: a.meta
460
+ users: o.data,
461
+ meta: o.meta
462
462
  };
463
463
  }
464
464
  async getUserById(e) {
@@ -480,7 +480,7 @@ class Pe {
480
480
  });
481
481
  }
482
482
  }
483
- class ce {
483
+ class de {
484
484
  constructor(e, t, r) {
485
485
  this.httpService = e, this.appId = t, this.sessionManager = r;
486
486
  }
@@ -497,12 +497,12 @@ class ce {
497
497
  throw new Error("SessionManager is required for private endpoints");
498
498
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
499
499
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder);
500
- const s = `/tenants/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
500
+ const n = `/tenants/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
501
501
  headers: t
502
502
  });
503
503
  return {
504
- tenants: a.data,
505
- meta: a.meta
504
+ tenants: o.data,
505
+ meta: o.meta
506
506
  };
507
507
  }
508
508
  async getTenantById(e) {
@@ -558,7 +558,7 @@ class ce {
558
558
  )).data;
559
559
  }
560
560
  }
561
- const pe = ee(null), ke = () => /* @__PURE__ */ n(
561
+ const fe = ee(null), ke = () => /* @__PURE__ */ s(
562
562
  "div",
563
563
  {
564
564
  style: {
@@ -568,9 +568,9 @@ const pe = ee(null), ke = () => /* @__PURE__ */ n(
568
568
  height: "100vh",
569
569
  fontFamily: "system-ui, sans-serif"
570
570
  },
571
- children: /* @__PURE__ */ n("div", { children: "Loading tenant..." })
571
+ children: /* @__PURE__ */ s("div", { children: "Loading tenant..." })
572
572
  }
573
- ), Te = ({ error: i, retry: e }) => /* @__PURE__ */ u(
573
+ ), Te = ({ error: i, retry: e }) => /* @__PURE__ */ c(
574
574
  "div",
575
575
  {
576
576
  style: {
@@ -584,9 +584,9 @@ const pe = ee(null), ke = () => /* @__PURE__ */ n(
584
584
  padding: "20px"
585
585
  },
586
586
  children: [
587
- /* @__PURE__ */ n("h2", { style: { color: "#dc3545", marginBottom: "16px" }, children: "Tenant Error" }),
588
- /* @__PURE__ */ n("p", { style: { color: "#6c757d", marginBottom: "24px" }, children: i.message || "Unable to load tenant" }),
589
- /* @__PURE__ */ n(
587
+ /* @__PURE__ */ s("h2", { style: { color: "#dc3545", marginBottom: "16px" }, children: "Tenant Error" }),
588
+ /* @__PURE__ */ s("p", { style: { color: "#6c757d", marginBottom: "24px" }, children: i.message || "Unable to load tenant" }),
589
+ /* @__PURE__ */ s(
590
590
  "button",
591
591
  {
592
592
  onClick: e,
@@ -604,73 +604,73 @@ const pe = ee(null), ke = () => /* @__PURE__ */ n(
604
604
  ]
605
605
  }
606
606
  );
607
- function Ze({ config: i, children: e }) {
608
- const { baseUrl: t, appInfo: r, appId: s } = re(), [a, v] = m(i.initialTenant || null), [T, M] = m(!i.initialTenant), [P, g] = m(null), [h, x] = m(null), [p, A] = m(!1), [F, f] = m(null), C = X(() => {
609
- const c = i.tenantMode || "selector", w = "tenant";
607
+ function tt({ config: i, children: e }) {
608
+ const { baseUrl: t, appInfo: r, appId: n } = re(), [o, m] = b(i.initialTenant || null), [T, M] = b(!i.initialTenant), [P, g] = b(null), [h, x] = b(null), [p, A] = b(!1), [F, f] = b(null), L = Z(() => {
609
+ const d = i.tenantMode || "selector", w = "tenant";
610
610
  if (typeof window > "u") return null;
611
- if (c === "subdomain") {
612
- const o = window.location.hostname.split(".");
613
- if (o.length >= 3) {
614
- const l = o[0];
611
+ if (d === "subdomain") {
612
+ const a = window.location.hostname.split(".");
613
+ if (a.length >= 3) {
614
+ const l = a[0];
615
615
  return localStorage.setItem(w, l), l;
616
616
  }
617
617
  return localStorage.getItem(w);
618
- } else if (c === "selector") {
619
- const o = new URLSearchParams(window.location.search).get(i.selectorParam || "tenant");
620
- return o ? (localStorage.setItem(w, o), o) : localStorage.getItem(w);
618
+ } else if (d === "selector") {
619
+ const a = new URLSearchParams(window.location.search).get(i.selectorParam || "tenant");
620
+ return a ? (localStorage.setItem(w, a), a) : localStorage.getItem(w);
621
621
  }
622
622
  return null;
623
- }, [i.tenantMode, i.selectorParam]), y = O(() => C(), [C]), b = (r == null ? void 0 : r.settingsSchema) || null, k = X(
624
- async (c) => {
623
+ }, [i.tenantMode, i.selectorParam]), y = z(() => L(), [L]), S = (r == null ? void 0 : r.settingsSchema) || null, k = Z(
624
+ async (d) => {
625
625
  try {
626
626
  M(!0), g(null);
627
- const w = new G(t), o = await new ce(w, s).getPublicTenantInfo(c);
628
- v(o);
627
+ const w = new G(t), a = await new de(w, n).getPublicTenantInfo(d);
628
+ m(a);
629
629
  } catch (w) {
630
- const d = w instanceof Error ? w : new Error("Failed to load tenant information");
631
- g(d), v(null);
630
+ const u = w instanceof Error ? w : new Error("Failed to load tenant information");
631
+ g(u), m(null);
632
632
  } finally {
633
633
  M(!1);
634
634
  }
635
635
  },
636
- [t, s]
637
- ), R = X(async () => {
638
- if (a != null && a.id)
636
+ [t, n]
637
+ ), R = Z(async () => {
638
+ if (o != null && o.id)
639
639
  try {
640
640
  A(!0), f(null);
641
- const c = new G(t), d = await new ce(c, a.appId).getTenantSettings(a.id);
642
- x(d);
643
- } catch (c) {
644
- const w = c instanceof Error ? c : new Error("Failed to load tenant settings");
641
+ const d = new G(t), u = await new de(d, o.appId).getTenantSettings(o.id);
642
+ x(u);
643
+ } catch (d) {
644
+ const w = d instanceof Error ? d : new Error("Failed to load tenant settings");
645
645
  f(w), x(null);
646
646
  } finally {
647
647
  A(!1);
648
648
  }
649
- }, [t, a]), L = X(() => {
649
+ }, [t, o]), D = Z(() => {
650
650
  R();
651
- }, [R]), E = X(
652
- (c) => {
653
- if (!b)
651
+ }, [R]), E = Z(
652
+ (d) => {
653
+ if (!S)
654
654
  return { isValid: !0, errors: [] };
655
655
  const w = [];
656
656
  try {
657
- return b.properties && Object.entries(b.properties).forEach(([d, o]) => {
657
+ return S.properties && Object.entries(S.properties).forEach(([u, a]) => {
658
658
  var W;
659
- const l = c[d];
660
- if ((W = b.required) != null && W.includes(d) && l == null) {
661
- w.push(`Field '${d}' is required`);
659
+ const l = d[u];
660
+ if ((W = S.required) != null && W.includes(u) && l == null) {
661
+ w.push(`Field '${u}' is required`);
662
662
  return;
663
663
  }
664
664
  if (l != null) {
665
- if (o.type) {
666
- const I = o.type, N = typeof l;
667
- I === "string" && N !== "string" ? w.push(`Field '${d}' must be a string`) : (I === "number" || I === "integer") && N !== "number" ? w.push(`Field '${d}' must be a number`) : I === "boolean" && N !== "boolean" ? w.push(`Field '${d}' must be a boolean`) : I === "array" && !Array.isArray(l) && w.push(`Field '${d}' must be an array`);
665
+ if (a.type) {
666
+ const I = a.type, N = typeof l;
667
+ I === "string" && N !== "string" ? w.push(`Field '${u}' must be a string`) : (I === "number" || I === "integer") && N !== "number" ? w.push(`Field '${u}' must be a number`) : I === "boolean" && N !== "boolean" ? w.push(`Field '${u}' must be a boolean`) : I === "array" && !Array.isArray(l) && w.push(`Field '${u}' must be an array`);
668
668
  }
669
- o.minLength !== void 0 && typeof l == "string" && l.length < o.minLength && w.push(
670
- `Field '${d}' must be at least ${o.minLength} characters long`
671
- ), o.maxLength !== void 0 && typeof l == "string" && l.length > o.maxLength && w.push(
672
- `Field '${d}' must be no more than ${o.maxLength} characters long`
673
- ), o.minimum !== void 0 && typeof l == "number" && l < o.minimum && w.push(`Field '${d}' must be at least ${o.minimum}`), o.maximum !== void 0 && typeof l == "number" && l > o.maximum && w.push(`Field '${d}' must be no more than ${o.maximum}`), o.pattern && typeof l == "string" && (new RegExp(o.pattern).test(l) || w.push(`Field '${d}' does not match the required pattern`)), o.enum && !o.enum.includes(l) && w.push(`Field '${d}' must be one of: ${o.enum.join(", ")}`);
669
+ a.minLength !== void 0 && typeof l == "string" && l.length < a.minLength && w.push(
670
+ `Field '${u}' must be at least ${a.minLength} characters long`
671
+ ), a.maxLength !== void 0 && typeof l == "string" && l.length > a.maxLength && w.push(
672
+ `Field '${u}' must be no more than ${a.maxLength} characters long`
673
+ ), a.minimum !== void 0 && typeof l == "number" && l < a.minimum && w.push(`Field '${u}' must be at least ${a.minimum}`), a.maximum !== void 0 && typeof l == "number" && l > a.maximum && w.push(`Field '${u}' must be no more than ${a.maximum}`), a.pattern && typeof l == "string" && (new RegExp(a.pattern).test(l) || w.push(`Field '${u}' does not match the required pattern`)), a.enum && !a.enum.includes(l) && w.push(`Field '${u}' must be one of: ${a.enum.join(", ")}`);
674
674
  }
675
675
  }), {
676
676
  isValid: w.length === 0,
@@ -683,16 +683,16 @@ function Ze({ config: i, children: e }) {
683
683
  };
684
684
  }
685
685
  },
686
- [b]
686
+ [S]
687
687
  );
688
- K(() => {
689
- !i.initialTenant && y ? k(y) : !i.initialTenant && !y && (v(null), g(null), M(!1));
690
- }, [i.initialTenant, y, k]), K(() => {
691
- a != null && a.id ? R() : (x(null), f(null), A(!1));
692
- }, [a == null ? void 0 : a.id, R]);
693
- const D = O(() => ({
688
+ Y(() => {
689
+ !i.initialTenant && y ? k(y) : !i.initialTenant && !y && (m(null), g(null), M(!1));
690
+ }, [i.initialTenant, y, k]), Y(() => {
691
+ o != null && o.id ? R() : (x(null), f(null), A(!1));
692
+ }, [o == null ? void 0 : o.id, R]);
693
+ const B = z(() => ({
694
694
  // Tenant info
695
- tenant: a,
695
+ tenant: o,
696
696
  tenantSlug: y,
697
697
  isTenantLoading: T,
698
698
  tenantError: P,
@@ -701,87 +701,87 @@ function Ze({ config: i, children: e }) {
701
701
  },
702
702
  // Settings
703
703
  settings: h,
704
- settingsSchema: b,
704
+ settingsSchema: S,
705
705
  isSettingsLoading: p,
706
706
  settingsError: F,
707
707
  // Actions
708
- refreshSettings: L,
708
+ refreshSettings: D,
709
709
  // Validation
710
710
  validateSettings: E
711
711
  }), [
712
- a,
712
+ o,
713
713
  y,
714
714
  T,
715
715
  P,
716
716
  h,
717
- b,
717
+ S,
718
718
  p,
719
719
  F,
720
- L,
720
+ D,
721
721
  E
722
722
  ]);
723
723
  if (T)
724
- return /* @__PURE__ */ n(B, { children: i.loadingFallback || /* @__PURE__ */ n(ke, {}) });
724
+ return /* @__PURE__ */ s(H, { children: i.loadingFallback || /* @__PURE__ */ s(ke, {}) });
725
725
  if (P) {
726
- const c = typeof i.errorFallback == "function" ? i.errorFallback(P, () => k(y || "")) : i.errorFallback || /* @__PURE__ */ n(Te, { error: P, retry: () => k(y || "") });
727
- return /* @__PURE__ */ n(B, { children: c });
726
+ const d = typeof i.errorFallback == "function" ? i.errorFallback(P, () => k(y || "")) : i.errorFallback || /* @__PURE__ */ s(Te, { error: P, retry: () => k(y || "") });
727
+ return /* @__PURE__ */ s(H, { children: d });
728
728
  }
729
- return /* @__PURE__ */ n(pe.Provider, { value: D, children: e });
729
+ return /* @__PURE__ */ s(fe.Provider, { value: B, children: e });
730
730
  }
731
- function oe() {
732
- const i = te(pe);
731
+ function le() {
732
+ const i = te(fe);
733
733
  if (!i)
734
734
  throw new Error("useTenant must be used within a TenantProvider");
735
735
  return i;
736
736
  }
737
- const et = oe;
738
- function tt() {
737
+ const rt = le;
738
+ function st() {
739
739
  const {
740
740
  settings: i,
741
741
  settingsSchema: e,
742
742
  isSettingsLoading: t,
743
743
  settingsError: r,
744
- validateSettings: s
745
- } = oe();
744
+ validateSettings: n
745
+ } = le();
746
746
  return {
747
747
  settings: i,
748
748
  settingsSchema: e,
749
749
  isLoading: t,
750
750
  error: r,
751
- validateSettings: s
751
+ validateSettings: n
752
752
  };
753
753
  }
754
- function Z() {
755
- const { tenant: i, tenantSlug: e, isTenantLoading: t, tenantError: r, retryTenant: s } = oe();
754
+ function K() {
755
+ const { tenant: i, tenantSlug: e, isTenantLoading: t, tenantError: r, retryTenant: n } = le();
756
756
  return {
757
757
  tenant: i,
758
758
  tenantSlug: e,
759
759
  isLoading: t,
760
760
  error: r,
761
- retry: s
761
+ retry: n
762
762
  };
763
763
  }
764
- const fe = ee(null);
765
- function rt({ config: i = {}, children: e }) {
766
- const { appId: t, baseUrl: r } = re(), s = Z(), a = (s == null ? void 0 : s.tenantSlug) || null, [v, T] = m(i.initialRoles || []), [M, P] = m(!i.initialRoles), [g, h] = m(null), [x, p] = m(!1), [A, F] = m(null), f = O(() => {
767
- const c = a ? `auth_tokens_${a}` : "auth_tokens", w = {
764
+ const ye = ee(null);
765
+ function nt({ config: i = {}, children: e }) {
766
+ const { appId: t, baseUrl: r } = re(), n = K(), o = (n == null ? void 0 : n.tenantSlug) || null, [m, T] = b(i.initialRoles || []), [M, P] = b(!i.initialRoles), [g, h] = b(null), [x, p] = b(!1), [A, F] = b(null), f = z(() => {
767
+ const d = o ? `auth_tokens_${o}` : "auth_tokens", w = {
768
768
  get: () => {
769
769
  try {
770
- const d = localStorage.getItem(c);
771
- return d ? JSON.parse(d) : null;
770
+ const u = localStorage.getItem(d);
771
+ return u ? JSON.parse(u) : null;
772
772
  } catch {
773
773
  return null;
774
774
  }
775
775
  },
776
- set: (d) => {
776
+ set: (u) => {
777
777
  try {
778
- localStorage.setItem(c, JSON.stringify(d));
778
+ localStorage.setItem(d, JSON.stringify(u));
779
779
  } catch {
780
780
  }
781
781
  },
782
782
  clear: () => {
783
783
  try {
784
- localStorage.removeItem(c);
784
+ localStorage.removeItem(d);
785
785
  } catch {
786
786
  }
787
787
  }
@@ -791,35 +791,35 @@ function rt({ config: i = {}, children: e }) {
791
791
  tokenStorage: w,
792
792
  baseUrl: r
793
793
  });
794
- }, [a, r, i.onRefreshFailed]), C = O(() => {
795
- const c = new G(r);
796
- return c.setSessionManager(f), c;
797
- }, [r, f]), y = O(() => new Ae(new G(r)), [r]), b = O(() => new Pe(C, f), [C, f]), k = O(() => new le(new G(r)), [r]), R = O(() => g || f.getUser(), [g, f]), L = O(() => R != null && R.roleId && v.find((c) => c.id === R.roleId) || null, [R, v]), E = O(() => (L == null ? void 0 : L.permissions) || [], [L]);
798
- K(() => {
794
+ }, [o, r, i.onRefreshFailed]), L = z(() => {
795
+ const d = new G(r);
796
+ return d.setSessionManager(f), d;
797
+ }, [r, f]), y = z(() => new Ae(new G(r)), [r]), S = z(() => new Pe(L, f), [L, f]), k = z(() => new ce(new G(r)), [r]), R = z(() => g || f.getUser(), [g, f]), D = z(() => R != null && R.roleId && m.find((d) => d.id === R.roleId) || null, [R, m]), E = z(() => (D == null ? void 0 : D.permissions) || [], [D]);
798
+ Y(() => {
799
799
  console.log("AuthProvider - userPermissions changed:", E);
800
800
  }, [E]);
801
- const D = O(() => {
802
- const c = async () => {
801
+ const B = z(() => {
802
+ const d = async () => {
803
803
  try {
804
804
  p(!0), F(null);
805
- const S = f.getUser();
806
- if (!(S != null && S.id))
805
+ const v = f.getUser();
806
+ if (!(v != null && v.id))
807
807
  throw new Error("No user ID available in session");
808
- const $ = await b.getUserById(S.id);
808
+ const $ = await S.getUserById(v.id);
809
809
  h($), f.setUser($);
810
- } catch (S) {
811
- const $ = S instanceof Error ? S : new Error("Failed to load user data");
810
+ } catch (v) {
811
+ const $ = v instanceof Error ? v : new Error("Failed to load user data");
812
812
  F($), console.error("Failed to load user data:", $);
813
813
  } finally {
814
814
  p(!1);
815
815
  }
816
816
  }, w = async () => {
817
- await c();
818
- }, d = async (S, $, Q) => {
817
+ await d();
818
+ }, u = async (v, $, J) => {
819
819
  const V = await y.login({
820
- email: S,
820
+ email: v,
821
821
  password: $,
822
- tenantId: Q
822
+ tenantId: J
823
823
  });
824
824
  if (f.setTokens({
825
825
  accessToken: V.accessToken,
@@ -828,125 +828,125 @@ function rt({ config: i = {}, children: e }) {
828
828
  }), V.user) {
829
829
  f.setUser(V.user), h(V.user);
830
830
  try {
831
- await c();
832
- } catch (ie) {
833
- console.warn("Failed to load complete user data after login:", ie);
831
+ await d();
832
+ } catch (oe) {
833
+ console.warn("Failed to load complete user data after login:", oe);
834
834
  }
835
835
  }
836
836
  return V;
837
- }, o = async (S, $, Q, V) => await y.signup({ email: S, name: $, password: Q, tenantId: V }), l = async (S, $, Q, V) => await y.signupTenantAdmin({
838
- email: S,
837
+ }, a = async (v, $, J, V) => await y.signup({ email: v, name: $, password: J, tenantId: V }), l = async (v, $, J, V) => await y.signupTenantAdmin({
838
+ email: v,
839
839
  name: $,
840
- password: Q,
840
+ password: J,
841
841
  tenantName: V,
842
842
  appId: t
843
- }), W = async (S, $) => {
844
- const Q = await f.getAuthHeaders();
845
- await y.changePassword({ currentPassword: S, newPassword: $ }, Q);
846
- }, I = async (S, $) => {
847
- await y.requestPasswordReset({ email: S, tenantId: $ });
848
- }, N = async (S, $) => {
849
- await y.confirmPasswordReset({ token: S, newPassword: $ });
843
+ }), W = async (v, $) => {
844
+ const J = await f.getAuthHeaders();
845
+ await y.changePassword({ currentPassword: v, newPassword: $ }, J);
846
+ }, I = async (v, $) => {
847
+ await y.requestPasswordReset({ email: v, tenantId: $ });
848
+ }, N = async (v, $) => {
849
+ await y.confirmPasswordReset({ token: v, newPassword: $ });
850
850
  }, _ = async () => {
851
- const S = f.getTokens();
852
- if (!(S != null && S.refreshToken))
851
+ const v = f.getTokens();
852
+ if (!(v != null && v.refreshToken))
853
853
  throw new Error("No refresh token available");
854
854
  const $ = await y.refreshToken({
855
- refreshToken: S.refreshToken
855
+ refreshToken: v.refreshToken
856
856
  });
857
857
  f.setTokens({
858
858
  accessToken: $.accessToken,
859
- refreshToken: $.refreshToken || S.refreshToken,
859
+ refreshToken: $.refreshToken || v.refreshToken,
860
860
  expiresIn: $.expiresIn
861
861
  });
862
- }, H = () => {
862
+ }, C = () => {
863
863
  f.clearSession(), h(null), F(null);
864
- }, q = (S) => {
865
- f.setTokens(S);
866
- }, Y = () => f.hasValidSession(), U = () => {
864
+ }, U = (v) => {
865
+ f.setTokens(v);
866
+ }, Q = () => f.hasValidSession(), q = () => {
867
867
  f.clearSession(), h(null), F(null);
868
- }, z = async () => {
868
+ }, O = async () => {
869
869
  if (t)
870
870
  try {
871
871
  P(!0);
872
- const { roles: S } = await k.getRolesByApp(t);
873
- T(S);
874
- } catch (S) {
875
- console.error("Failed to fetch roles:", S);
872
+ const { roles: v } = await k.getRolesByApp(t);
873
+ T(v);
874
+ } catch (v) {
875
+ console.error("Failed to fetch roles:", v);
876
876
  } finally {
877
877
  P(!1);
878
878
  }
879
879
  }, j = async () => {
880
- await z();
881
- }, ne = (S) => {
880
+ await O();
881
+ }, ie = (v) => {
882
882
  if (!E || E.length === 0)
883
883
  return !1;
884
- if (typeof S == "string")
885
- return E.includes(S);
886
- const $ = `${S.resource}.${S.action}`;
884
+ if (typeof v == "string")
885
+ return E.includes(v);
886
+ const $ = `${v.resource}.${v.action}`;
887
887
  return E.includes($);
888
888
  };
889
889
  return {
890
890
  sessionManager: f,
891
- authenticatedHttpService: C,
892
- login: d,
893
- signup: o,
891
+ authenticatedHttpService: L,
892
+ login: u,
893
+ signup: a,
894
894
  signupTenantAdmin: l,
895
895
  changePassword: W,
896
896
  requestPasswordReset: I,
897
897
  confirmPasswordReset: N,
898
898
  refreshToken: _,
899
- logout: H,
900
- setTokens: q,
901
- hasValidSession: Y,
902
- clearSession: U,
899
+ logout: C,
900
+ setTokens: U,
901
+ hasValidSession: Q,
902
+ clearSession: q,
903
903
  currentUser: g,
904
904
  isUserLoading: x,
905
905
  userError: A,
906
906
  refreshUser: w,
907
- userRole: L,
907
+ userRole: D,
908
908
  userPermissions: E,
909
- availableRoles: v,
909
+ availableRoles: m,
910
910
  rolesLoading: M,
911
- hasPermission: ne,
912
- hasAnyPermission: (S) => S.some(($) => ne($)),
913
- hasAllPermissions: (S) => S.every(($) => ne($)),
911
+ hasPermission: ie,
912
+ hasAnyPermission: (v) => v.some(($) => ie($)),
913
+ hasAllPermissions: (v) => v.every(($) => ie($)),
914
914
  getUserPermissionStrings: () => E || [],
915
915
  refreshRoles: j
916
916
  };
917
917
  }, [
918
918
  f,
919
- C,
919
+ L,
920
920
  y,
921
- b,
921
+ S,
922
922
  k,
923
923
  t,
924
- v,
924
+ m,
925
925
  g,
926
926
  x,
927
927
  A,
928
- L,
928
+ D,
929
929
  E
930
930
  ]);
931
- return K(() => {
931
+ return Y(() => {
932
932
  !i.initialRoles && t && (async () => {
933
933
  try {
934
934
  P(!0);
935
- const w = new G(r), d = new le(w), { roles: o } = await d.getRolesByApp(t);
936
- T(o);
935
+ const w = new G(r), u = new ce(w), { roles: a } = await u.getRolesByApp(t);
936
+ T(a);
937
937
  } catch (w) {
938
938
  console.error("Failed to fetch roles:", w);
939
939
  } finally {
940
940
  P(!1);
941
941
  }
942
942
  })();
943
- }, [t, r, i.initialRoles]), K(() => {
944
- const c = f.getUser();
945
- c && f.hasValidSession() && h(c);
946
- }, [f]), /* @__PURE__ */ n(fe.Provider, { value: D, children: e });
943
+ }, [t, r, i.initialRoles]), Y(() => {
944
+ const d = f.getUser();
945
+ d && f.hasValidSession() && h(d);
946
+ }, [f]), /* @__PURE__ */ s(ye.Provider, { value: B, children: e });
947
947
  }
948
948
  function se() {
949
- const i = te(fe);
949
+ const i = te(ye);
950
950
  if (!i)
951
951
  throw new Error("useAuth must be used within an AuthProvider");
952
952
  return i;
@@ -972,12 +972,12 @@ class Me {
972
972
  throw new Error("SessionManager is required for private endpoints");
973
973
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
974
974
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder);
975
- const s = `/feature-flags/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
975
+ const n = `/feature-flags/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
976
976
  headers: t
977
977
  });
978
978
  return {
979
- featureFlags: a.data,
980
- meta: a.meta
979
+ featureFlags: o.data,
980
+ meta: o.meta
981
981
  };
982
982
  }
983
983
  async getFeatureFlagById(e) {
@@ -1014,8 +1014,8 @@ class Me {
1014
1014
  throw new Error("Tenant ID and App ID are required");
1015
1015
  const r = new URLSearchParams();
1016
1016
  r.append("tenantId", e), r.append("appId", t);
1017
- const s = `/tenant-feature-flags${r.toString() ? `?${r.toString()}` : ""}`;
1018
- return (await this.httpService.get(s, {
1017
+ const n = `/tenant-feature-flags${r.toString() ? `?${r.toString()}` : ""}`;
1018
+ return (await this.httpService.get(n, {
1019
1019
  headers: { "X-Tenant-ID": e }
1020
1020
  })).data;
1021
1021
  }
@@ -1023,28 +1023,28 @@ class Me {
1023
1023
  async getTenantFeatureFlag(e, t, r) {
1024
1024
  if (!e || !t || !r)
1025
1025
  throw new Error("Flag Key, Tenant ID and App ID are required");
1026
- const s = new URLSearchParams();
1027
- s.append("tenantId", t), s.append("appId", r);
1028
- const a = `/tenant-feature-flags/${e}${s.toString() ? `?${s.toString()}` : ""}`;
1029
- return (await this.httpService.get(a, {
1026
+ const n = new URLSearchParams();
1027
+ n.append("tenantId", t), n.append("appId", r);
1028
+ const o = `/tenant-feature-flags/${e}${n.toString() ? `?${n.toString()}` : ""}`;
1029
+ return (await this.httpService.get(o, {
1030
1030
  headers: { "X-Tenant-ID": t }
1031
1031
  })).data;
1032
1032
  }
1033
1033
  }
1034
- const ye = ee(null);
1035
- function st({ config: i = {}, children: e }) {
1036
- const { baseUrl: t, appId: r } = re(), { tenant: s } = Z(), [a, v] = m([]), [T, M] = m(!1), [P, g] = m(null), h = O(() => {
1034
+ const we = ee(null);
1035
+ function it({ config: i = {}, children: e }) {
1036
+ const { baseUrl: t, appId: r } = re(), { tenant: n } = K(), [o, m] = b([]), [T, M] = b(!1), [P, g] = b(null), h = z(() => {
1037
1037
  const A = new G(t);
1038
1038
  return new Me(A);
1039
1039
  }, [t]), x = async () => {
1040
- if (!(s != null && s.id)) {
1041
- v([]);
1040
+ if (!(n != null && n.id)) {
1041
+ m([]);
1042
1042
  return;
1043
1043
  }
1044
1044
  M(!0), g(null);
1045
1045
  try {
1046
- const A = await h.getTenantFeatureFlags(s.id, r);
1047
- v(A);
1046
+ const A = await h.getTenantFeatureFlags(n.id, r);
1047
+ m(A);
1048
1048
  } catch (A) {
1049
1049
  const F = A instanceof Error ? A.message : "Failed to fetch feature flags";
1050
1050
  g(F), i.onError && i.onError(A instanceof Error ? A : new Error(F));
@@ -1052,32 +1052,32 @@ function st({ config: i = {}, children: e }) {
1052
1052
  M(!1);
1053
1053
  }
1054
1054
  };
1055
- K(() => {
1055
+ Y(() => {
1056
1056
  x();
1057
1057
  const A = i.refreshInterval || 5 * 60 * 1e3, F = setInterval(x, A);
1058
1058
  return () => clearInterval(F);
1059
- }, [s == null ? void 0 : s.id, i.refreshInterval]);
1060
- const p = O(() => ({
1061
- featureFlags: a,
1059
+ }, [n == null ? void 0 : n.id, i.refreshInterval]);
1060
+ const p = z(() => ({
1061
+ featureFlags: o,
1062
1062
  loading: T,
1063
1063
  error: P,
1064
1064
  isEnabled: (y) => {
1065
- const b = a.find((k) => k.key === y);
1066
- return (b == null ? void 0 : b.value) === !0;
1065
+ const S = o.find((k) => k.key === y);
1066
+ return (S == null ? void 0 : S.value) === !0;
1067
1067
  },
1068
- getFlag: (y) => a.find((b) => b.key === y),
1068
+ getFlag: (y) => o.find((S) => S.key === y),
1069
1069
  getFlagState: (y) => {
1070
- const b = a.find((k) => k.key === y);
1071
- return b ? b.value ? "enabled" : "disabled" : "not_found";
1070
+ const S = o.find((k) => k.key === y);
1071
+ return S ? S.value ? "enabled" : "disabled" : "not_found";
1072
1072
  },
1073
1073
  refresh: async () => {
1074
1074
  await x();
1075
1075
  }
1076
- }), [a, T, P]);
1077
- return /* @__PURE__ */ n(ye.Provider, { value: p, children: e });
1076
+ }), [o, T, P]);
1077
+ return /* @__PURE__ */ s(we.Provider, { value: p, children: e });
1078
1078
  }
1079
1079
  function Ee() {
1080
- const i = te(ye);
1080
+ const i = te(we);
1081
1081
  if (!i)
1082
1082
  throw new Error("useFeatureFlags must be used within a FeatureFlagProvider");
1083
1083
  return i;
@@ -1148,20 +1148,20 @@ class Re {
1148
1148
  )).data;
1149
1149
  }
1150
1150
  }
1151
- const we = ee(void 0);
1152
- function nt({ config: i = {}, children: e }) {
1153
- const { baseUrl: t } = re(), { tenant: r } = Z(), [s, a] = m(null), [v, T] = m(!1), [M, P] = m(null), g = O(() => {
1151
+ const me = ee(void 0);
1152
+ function ot({ config: i = {}, children: e }) {
1153
+ const { baseUrl: t } = re(), { tenant: r } = K(), [n, o] = b(null), [m, T] = b(!1), [M, P] = b(null), g = z(() => {
1154
1154
  const p = new G(t);
1155
1155
  return new Re(p);
1156
1156
  }, [t]), h = async () => {
1157
1157
  if (!(r != null && r.id)) {
1158
- a(null);
1158
+ o(null);
1159
1159
  return;
1160
1160
  }
1161
1161
  T(!0), P(null);
1162
1162
  try {
1163
1163
  const p = await g.getTenantSubscriptionFeatures(r.id);
1164
- a(p);
1164
+ o(p);
1165
1165
  } catch (p) {
1166
1166
  const A = p instanceof Error ? p.message : "Failed to fetch subscription";
1167
1167
  P(A), i.onError && i.onError(p instanceof Error ? p : new Error(A));
@@ -1169,43 +1169,43 @@ function nt({ config: i = {}, children: e }) {
1169
1169
  T(!1);
1170
1170
  }
1171
1171
  };
1172
- K(() => {
1172
+ Y(() => {
1173
1173
  if (h(), !i.refreshInterval) return;
1174
1174
  const p = i.refreshInterval || 10 * 60 * 1e3, A = setInterval(h, p);
1175
1175
  return () => clearInterval(A);
1176
1176
  }, [r == null ? void 0 : r.id, i.refreshInterval]);
1177
- const x = O(() => {
1178
- const p = (s == null ? void 0 : s.features) || [];
1177
+ const x = z(() => {
1178
+ const p = (n == null ? void 0 : n.features) || [];
1179
1179
  return {
1180
- subscription: s,
1180
+ subscription: n,
1181
1181
  features: p,
1182
- loading: v,
1182
+ loading: m,
1183
1183
  error: M,
1184
- isFeatureEnabled: (b) => {
1185
- const k = p.find((R) => R.key === b);
1184
+ isFeatureEnabled: (S) => {
1185
+ const k = p.find((R) => R.key === S);
1186
1186
  return k ? k.type === "BOOLEAN" || k.type === "boolean" ? k.value === !0 : !!k.value : !1;
1187
1187
  },
1188
- getFeature: (b) => p.find((k) => k.key === b),
1189
- getFeatureValue: (b, k) => {
1190
- const R = p.find((L) => L.key === b);
1188
+ getFeature: (S) => p.find((k) => k.key === S),
1189
+ getFeatureValue: (S, k) => {
1190
+ const R = p.find((D) => D.key === S);
1191
1191
  return R ? R.value : k;
1192
1192
  },
1193
- hasAllowedPlan: (b) => !s || !s.isActive ? !1 : b.includes(s.planId),
1193
+ hasAllowedPlan: (S) => !n || !n.isActive ? !1 : S.includes(n.planId),
1194
1194
  refresh: async () => {
1195
1195
  await h();
1196
1196
  }
1197
1197
  };
1198
- }, [s, v, M]);
1199
- return /* @__PURE__ */ n(we.Provider, { value: x, children: e });
1198
+ }, [n, m, M]);
1199
+ return /* @__PURE__ */ s(me.Provider, { value: x, children: e });
1200
1200
  }
1201
1201
  function Fe() {
1202
- const i = te(we);
1202
+ const i = te(me);
1203
1203
  if (i === void 0)
1204
1204
  throw new Error("useSubscription must be used within a SubscriptionProvider");
1205
1205
  return i;
1206
1206
  }
1207
- var J = /* @__PURE__ */ ((i) => (i.SUPERUSER = "SUPERUSER", i.TENANT_ADMIN = "TENANT_ADMIN", i.USER = "USER", i))(J || {});
1208
- const de = () => /* @__PURE__ */ u(
1207
+ var X = /* @__PURE__ */ ((i) => (i.SUPERUSER = "SUPERUSER", i.TENANT_ADMIN = "TENANT_ADMIN", i.USER = "USER", i))(X || {});
1208
+ const ue = () => /* @__PURE__ */ c(
1209
1209
  "div",
1210
1210
  {
1211
1211
  style: {
@@ -1221,10 +1221,10 @@ const de = () => /* @__PURE__ */ u(
1221
1221
  margin: "20px 0"
1222
1222
  },
1223
1223
  children: [
1224
- /* @__PURE__ */ n("div", { style: { fontSize: "2rem", marginBottom: "10px" }, children: "🔒" }),
1225
- /* @__PURE__ */ n("h3", { style: { color: "#495057", marginBottom: "10px" }, children: "Access Required" }),
1226
- /* @__PURE__ */ n("p", { style: { color: "#6c757d", fontSize: "14px", marginBottom: "15px" }, children: "You need to be signed in to view this content." }),
1227
- /* @__PURE__ */ n(
1224
+ /* @__PURE__ */ s("div", { style: { fontSize: "2rem", marginBottom: "10px" }, children: "🔒" }),
1225
+ /* @__PURE__ */ s("h3", { style: { color: "#495057", marginBottom: "10px" }, children: "Access Required" }),
1226
+ /* @__PURE__ */ s("p", { style: { color: "#6c757d", fontSize: "14px", marginBottom: "15px" }, children: "You need to be signed in to view this content." }),
1227
+ /* @__PURE__ */ s(
1228
1228
  "button",
1229
1229
  {
1230
1230
  style: {
@@ -1242,11 +1242,11 @@ const de = () => /* @__PURE__ */ u(
1242
1242
  )
1243
1243
  ]
1244
1244
  }
1245
- ), ue = ({
1245
+ ), he = ({
1246
1246
  userType: i,
1247
1247
  minUserType: e,
1248
1248
  missingPermissions: t
1249
- }) => /* @__PURE__ */ u(
1249
+ }) => /* @__PURE__ */ c(
1250
1250
  "div",
1251
1251
  {
1252
1252
  style: {
@@ -1262,57 +1262,57 @@ const de = () => /* @__PURE__ */ u(
1262
1262
  margin: "20px 0"
1263
1263
  },
1264
1264
  children: [
1265
- /* @__PURE__ */ n("div", { style: { fontSize: "2rem", marginBottom: "10px" }, children: "⚠️" }),
1266
- /* @__PURE__ */ n("h3", { style: { color: "#856404", marginBottom: "10px" }, children: "Insufficient Permissions" }),
1267
- e && i ? /* @__PURE__ */ u(B, { children: [
1268
- /* @__PURE__ */ u("p", { style: { color: "#856404", fontSize: "14px", marginBottom: "10px" }, children: [
1265
+ /* @__PURE__ */ s("div", { style: { fontSize: "2rem", marginBottom: "10px" }, children: "⚠️" }),
1266
+ /* @__PURE__ */ s("h3", { style: { color: "#856404", marginBottom: "10px" }, children: "Insufficient Permissions" }),
1267
+ e && i ? /* @__PURE__ */ c(H, { children: [
1268
+ /* @__PURE__ */ c("p", { style: { color: "#856404", fontSize: "14px", marginBottom: "10px" }, children: [
1269
1269
  "This content requires ",
1270
- /* @__PURE__ */ n("strong", { children: e }),
1270
+ /* @__PURE__ */ s("strong", { children: e }),
1271
1271
  " access level or higher."
1272
1272
  ] }),
1273
- /* @__PURE__ */ u("p", { style: { color: "#6c757d", fontSize: "12px" }, children: [
1273
+ /* @__PURE__ */ c("p", { style: { color: "#6c757d", fontSize: "12px" }, children: [
1274
1274
  "Your current access level: ",
1275
- /* @__PURE__ */ n("strong", { children: i })
1275
+ /* @__PURE__ */ s("strong", { children: i })
1276
1276
  ] })
1277
- ] }) : /* @__PURE__ */ u(B, { children: [
1278
- /* @__PURE__ */ n("p", { style: { color: "#856404", fontSize: "14px", marginBottom: "10px" }, children: "You don't have the required permissions to view this content." }),
1279
- t && t.length > 0 && /* @__PURE__ */ u("p", { style: { color: "#6c757d", fontSize: "12px" }, children: [
1277
+ ] }) : /* @__PURE__ */ c(H, { children: [
1278
+ /* @__PURE__ */ s("p", { style: { color: "#856404", fontSize: "14px", marginBottom: "10px" }, children: "You don't have the required permissions to view this content." }),
1279
+ t && t.length > 0 && /* @__PURE__ */ c("p", { style: { color: "#6c757d", fontSize: "12px" }, children: [
1280
1280
  "Required permissions: ",
1281
- /* @__PURE__ */ n("strong", { children: t.join(", ") })
1281
+ /* @__PURE__ */ s("strong", { children: t.join(", ") })
1282
1282
  ] })
1283
1283
  ] })
1284
1284
  ]
1285
1285
  }
1286
1286
  ), Ie = (i, e) => {
1287
1287
  const t = {
1288
- [J.USER]: 1,
1289
- [J.TENANT_ADMIN]: 2,
1290
- [J.SUPERUSER]: 3
1288
+ [X.USER]: 1,
1289
+ [X.TENANT_ADMIN]: 2,
1290
+ [X.SUPERUSER]: 3
1291
1291
  };
1292
1292
  return t[i] >= t[e];
1293
1293
  };
1294
- function it({
1294
+ function at({
1295
1295
  children: i,
1296
1296
  fallback: e,
1297
1297
  minUserType: t,
1298
1298
  requiredPermissions: r,
1299
- requireAllPermissions: s = !1
1299
+ requireAllPermissions: n = !1
1300
1300
  }) {
1301
- const { hasValidSession: a, sessionManager: v, hasPermission: T, hasAnyPermission: M, hasAllPermissions: P } = se();
1302
- if (!a())
1303
- return /* @__PURE__ */ n(B, { children: e || /* @__PURE__ */ n(de, {}) });
1304
- const g = v.getUser();
1301
+ const { hasValidSession: o, sessionManager: m, hasPermission: T, hasAnyPermission: M, hasAllPermissions: P } = se();
1302
+ if (!o())
1303
+ return /* @__PURE__ */ s(H, { children: e || /* @__PURE__ */ s(ue, {}) });
1304
+ const g = m.getUser();
1305
1305
  if (!g)
1306
- return /* @__PURE__ */ n(B, { children: e || /* @__PURE__ */ n(de, {}) });
1306
+ return /* @__PURE__ */ s(H, { children: e || /* @__PURE__ */ s(ue, {}) });
1307
1307
  if (t && !Ie(g.userType, t))
1308
- return /* @__PURE__ */ n(ue, { userType: g.userType, minUserType: t });
1309
- if (r && r.length > 0 && !(s ? P(r) : M(r))) {
1308
+ return /* @__PURE__ */ s(he, { userType: g.userType, minUserType: t });
1309
+ if (r && r.length > 0 && !(n ? P(r) : M(r))) {
1310
1310
  const x = r.filter((p) => !T(p)).map((p) => typeof p == "string" ? p : p.name);
1311
- return /* @__PURE__ */ n(ue, { missingPermissions: x });
1311
+ return /* @__PURE__ */ s(he, { missingPermissions: x });
1312
1312
  }
1313
- return /* @__PURE__ */ n(B, { children: i });
1313
+ return /* @__PURE__ */ s(H, { children: i });
1314
1314
  }
1315
- const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1315
+ const He = ({ redirectPath: i }) => /* @__PURE__ */ s(
1316
1316
  "div",
1317
1317
  {
1318
1318
  style: {
@@ -1325,7 +1325,7 @@ const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1325
1325
  backgroundColor: "#f9fafb",
1326
1326
  textAlign: "center"
1327
1327
  },
1328
- children: /* @__PURE__ */ u(
1328
+ children: /* @__PURE__ */ c(
1329
1329
  "div",
1330
1330
  {
1331
1331
  style: {
@@ -1336,10 +1336,10 @@ const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1336
1336
  maxWidth: "400px"
1337
1337
  },
1338
1338
  children: [
1339
- /* @__PURE__ */ n("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "🔒" }),
1340
- /* @__PURE__ */ n("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Access Required" }),
1341
- /* @__PURE__ */ n("p", { style: { color: "#6b7280", marginBottom: "1.5rem" }, children: "You need to be signed in to access this page." }),
1342
- /* @__PURE__ */ u("p", { style: { fontSize: "0.875rem", color: "#9ca3af" }, children: [
1339
+ /* @__PURE__ */ s("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "🔒" }),
1340
+ /* @__PURE__ */ s("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Access Required" }),
1341
+ /* @__PURE__ */ s("p", { style: { color: "#6b7280", marginBottom: "1.5rem" }, children: "You need to be signed in to access this page." }),
1342
+ /* @__PURE__ */ c("p", { style: { fontSize: "0.875rem", color: "#9ca3af" }, children: [
1343
1343
  "Redirecting to ",
1344
1344
  i,
1345
1345
  "..."
@@ -1348,11 +1348,11 @@ const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1348
1348
  }
1349
1349
  )
1350
1350
  }
1351
- ), he = ({
1351
+ ), ge = ({
1352
1352
  userType: i,
1353
1353
  minUserType: e,
1354
1354
  missingPermissions: t
1355
- }) => /* @__PURE__ */ n(
1355
+ }) => /* @__PURE__ */ s(
1356
1356
  "div",
1357
1357
  {
1358
1358
  style: {
@@ -1365,7 +1365,7 @@ const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1365
1365
  backgroundColor: "#f9fafb",
1366
1366
  textAlign: "center"
1367
1367
  },
1368
- children: /* @__PURE__ */ u(
1368
+ children: /* @__PURE__ */ c(
1369
1369
  "div",
1370
1370
  {
1371
1371
  style: {
@@ -1376,63 +1376,159 @@ const He = ({ redirectPath: i }) => /* @__PURE__ */ n(
1376
1376
  maxWidth: "400px"
1377
1377
  },
1378
1378
  children: [
1379
- /* @__PURE__ */ n("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "⚠️" }),
1380
- /* @__PURE__ */ n("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Insufficient Permissions" }),
1381
- e && i ? /* @__PURE__ */ u(B, { children: [
1382
- /* @__PURE__ */ u("p", { style: { color: "#6b7280", marginBottom: "1rem" }, children: [
1379
+ /* @__PURE__ */ s("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "⚠️" }),
1380
+ /* @__PURE__ */ s("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Insufficient Permissions" }),
1381
+ e && i ? /* @__PURE__ */ c(H, { children: [
1382
+ /* @__PURE__ */ c("p", { style: { color: "#6b7280", marginBottom: "1rem" }, children: [
1383
1383
  "This page requires ",
1384
- /* @__PURE__ */ n("strong", { children: e }),
1384
+ /* @__PURE__ */ s("strong", { children: e }),
1385
1385
  " access level or higher."
1386
1386
  ] }),
1387
- /* @__PURE__ */ u("p", { style: { color: "#9ca3af", fontSize: "0.875rem" }, children: [
1387
+ /* @__PURE__ */ c("p", { style: { color: "#9ca3af", fontSize: "0.875rem" }, children: [
1388
1388
  "Your current access level: ",
1389
- /* @__PURE__ */ n("strong", { children: i })
1389
+ /* @__PURE__ */ s("strong", { children: i })
1390
1390
  ] })
1391
- ] }) : /* @__PURE__ */ u(B, { children: [
1392
- /* @__PURE__ */ n("p", { style: { color: "#6b7280", marginBottom: "1rem" }, children: "You don't have the required permissions to access this page." }),
1393
- t && t.length > 0 && /* @__PURE__ */ u("p", { style: { color: "#9ca3af", fontSize: "0.875rem" }, children: [
1391
+ ] }) : /* @__PURE__ */ c(H, { children: [
1392
+ /* @__PURE__ */ s("p", { style: { color: "#6b7280", marginBottom: "1rem" }, children: "You don't have the required permissions to access this page." }),
1393
+ t && t.length > 0 && /* @__PURE__ */ c("p", { style: { color: "#9ca3af", fontSize: "0.875rem" }, children: [
1394
1394
  "Required permissions: ",
1395
- /* @__PURE__ */ n("strong", { children: t.join(", ") })
1395
+ /* @__PURE__ */ s("strong", { children: t.join(", ") })
1396
1396
  ] })
1397
1397
  ] })
1398
1398
  ]
1399
1399
  }
1400
1400
  )
1401
1401
  }
1402
- ), $e = (i, e) => {
1402
+ ), Ce = (i, e) => {
1403
1403
  const t = {
1404
- [J.USER]: 1,
1405
- [J.TENANT_ADMIN]: 2,
1406
- [J.SUPERUSER]: 3
1404
+ [X.USER]: 1,
1405
+ [X.TENANT_ADMIN]: 2,
1406
+ [X.SUPERUSER]: 3
1407
1407
  };
1408
1408
  return t[i] >= t[e];
1409
1409
  };
1410
- function ot({
1410
+ function lt({
1411
1411
  children: i,
1412
1412
  redirectTo: e = "/login",
1413
1413
  minUserType: t,
1414
1414
  requiredPermissions: r,
1415
- requireAllPermissions: s = !1,
1416
- fallback: a
1415
+ requireAllPermissions: n = !1,
1416
+ fallback: o
1417
1417
  }) {
1418
- const { hasValidSession: v, sessionManager: T, hasPermission: M, hasAnyPermission: P, hasAllPermissions: g } = se(), h = me();
1419
- if (!v())
1420
- return a ? /* @__PURE__ */ n(B, { children: a }) : /* @__PURE__ */ u(B, { children: [
1421
- /* @__PURE__ */ n(He, { redirectPath: e }),
1422
- /* @__PURE__ */ n(ae, { to: e, state: { from: h.pathname }, replace: !0 })
1418
+ const { hasValidSession: m, sessionManager: T, hasPermission: M, hasAnyPermission: P, hasAllPermissions: g } = se(), h = ae();
1419
+ if (!m())
1420
+ return o ? /* @__PURE__ */ s(H, { children: o }) : /* @__PURE__ */ c(H, { children: [
1421
+ /* @__PURE__ */ s(He, { redirectPath: e }),
1422
+ /* @__PURE__ */ s(ne, { to: e, state: { from: h.pathname }, replace: !0 })
1423
1423
  ] });
1424
1424
  const x = T.getUser();
1425
1425
  if (!x)
1426
- return /* @__PURE__ */ n(ae, { to: e, state: { from: h.pathname }, replace: !0 });
1427
- if (t && !$e(x.userType, t))
1428
- return /* @__PURE__ */ n(he, { userType: x.userType, minUserType: t });
1429
- if (r && r.length > 0 && !(s ? g(r) : P(r))) {
1426
+ return /* @__PURE__ */ s(ne, { to: e, state: { from: h.pathname }, replace: !0 });
1427
+ if (t && !Ce(x.userType, t))
1428
+ return /* @__PURE__ */ s(ge, { userType: x.userType, minUserType: t });
1429
+ if (r && r.length > 0 && !(n ? g(r) : P(r))) {
1430
1430
  const A = r.filter((F) => !M(F)).map((F) => typeof F == "string" ? F : F.name);
1431
- return /* @__PURE__ */ n(he, { missingPermissions: A });
1431
+ return /* @__PURE__ */ s(ge, { missingPermissions: A });
1432
+ }
1433
+ return /* @__PURE__ */ s(H, { children: i });
1434
+ }
1435
+ const $e = ({ redirectPath: i }) => /* @__PURE__ */ s(
1436
+ "div",
1437
+ {
1438
+ style: {
1439
+ display: "flex",
1440
+ flexDirection: "column",
1441
+ justifyContent: "center",
1442
+ alignItems: "center",
1443
+ minHeight: "100vh",
1444
+ padding: "2rem",
1445
+ backgroundColor: "#f9fafb",
1446
+ textAlign: "center"
1447
+ },
1448
+ children: /* @__PURE__ */ c(
1449
+ "div",
1450
+ {
1451
+ style: {
1452
+ backgroundColor: "#ffffff",
1453
+ padding: "2rem",
1454
+ borderRadius: "8px",
1455
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
1456
+ maxWidth: "400px"
1457
+ },
1458
+ children: [
1459
+ /* @__PURE__ */ s("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "🏢" }),
1460
+ /* @__PURE__ */ s("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Tenant Required" }),
1461
+ /* @__PURE__ */ s("p", { style: { color: "#6b7280", marginBottom: "1.5rem" }, children: "This page requires a tenant context to access." }),
1462
+ /* @__PURE__ */ c("p", { style: { fontSize: "0.875rem", color: "#9ca3af" }, children: [
1463
+ "Redirecting to ",
1464
+ i,
1465
+ "..."
1466
+ ] })
1467
+ ]
1468
+ }
1469
+ )
1470
+ }
1471
+ );
1472
+ function ct({
1473
+ children: i,
1474
+ redirectTo: e = "/",
1475
+ fallback: t
1476
+ }) {
1477
+ const { tenant: r, isLoading: n, error: o } = K(), m = ae();
1478
+ return n || o ? null : r ? /* @__PURE__ */ s(H, { children: i }) : t ? /* @__PURE__ */ s(H, { children: t }) : /* @__PURE__ */ c(H, { children: [
1479
+ /* @__PURE__ */ s($e, { redirectPath: e }),
1480
+ /* @__PURE__ */ s(ne, { to: e, state: { from: m.pathname }, replace: !0 })
1481
+ ] });
1482
+ }
1483
+ const Le = ({ redirectPath: i }) => /* @__PURE__ */ s(
1484
+ "div",
1485
+ {
1486
+ style: {
1487
+ display: "flex",
1488
+ flexDirection: "column",
1489
+ justifyContent: "center",
1490
+ alignItems: "center",
1491
+ minHeight: "100vh",
1492
+ padding: "2rem",
1493
+ backgroundColor: "#f9fafb",
1494
+ textAlign: "center"
1495
+ },
1496
+ children: /* @__PURE__ */ c(
1497
+ "div",
1498
+ {
1499
+ style: {
1500
+ backgroundColor: "#ffffff",
1501
+ padding: "2rem",
1502
+ borderRadius: "8px",
1503
+ boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
1504
+ maxWidth: "400px"
1505
+ },
1506
+ children: [
1507
+ /* @__PURE__ */ s("div", { style: { fontSize: "3rem", marginBottom: "1rem" }, children: "🚀" }),
1508
+ /* @__PURE__ */ s("h2", { style: { color: "#374151", marginBottom: "1rem" }, children: "Tenant Detected" }),
1509
+ /* @__PURE__ */ s("p", { style: { color: "#6b7280", marginBottom: "1.5rem" }, children: "You are accessing a tenant-specific context. Redirecting to the appropriate page." }),
1510
+ /* @__PURE__ */ c("p", { style: { fontSize: "0.875rem", color: "#9ca3af" }, children: [
1511
+ "Redirecting to ",
1512
+ i,
1513
+ "..."
1514
+ ] })
1515
+ ]
1516
+ }
1517
+ )
1432
1518
  }
1433
- return /* @__PURE__ */ n(B, { children: i });
1519
+ );
1520
+ function dt({
1521
+ children: i,
1522
+ redirectTo: e = "/dashboard",
1523
+ fallback: t
1524
+ }) {
1525
+ const { tenant: r, isLoading: n, error: o } = K(), m = ae();
1526
+ return n || o ? null : r ? t ? /* @__PURE__ */ s(H, { children: t }) : /* @__PURE__ */ c(H, { children: [
1527
+ /* @__PURE__ */ s(Le, { redirectPath: e }),
1528
+ /* @__PURE__ */ s(ne, { to: e, state: { from: m.pathname }, replace: !0 })
1529
+ ] }) : /* @__PURE__ */ s(H, { children: i });
1434
1530
  }
1435
- const Ce = () => /* @__PURE__ */ u(
1531
+ const De = () => /* @__PURE__ */ c(
1436
1532
  "div",
1437
1533
  {
1438
1534
  style: {
@@ -1444,19 +1540,19 @@ const Ce = () => /* @__PURE__ */ u(
1444
1540
  color: "#dc2626"
1445
1541
  },
1446
1542
  children: [
1447
- /* @__PURE__ */ n("h3", { style: { margin: "0 0 1rem 0" }, children: "🔒 Subscription Required" }),
1448
- /* @__PURE__ */ n("p", { style: { margin: 0 }, children: "This feature requires a higher subscription plan. Please upgrade your plan to access this content." })
1543
+ /* @__PURE__ */ s("h3", { style: { margin: "0 0 1rem 0" }, children: "🔒 Subscription Required" }),
1544
+ /* @__PURE__ */ s("p", { style: { margin: 0 }, children: "This feature requires a higher subscription plan. Please upgrade your plan to access this content." })
1449
1545
  ]
1450
1546
  }
1451
1547
  );
1452
- function at({
1548
+ function ut({
1453
1549
  children: i,
1454
- fallback: e = /* @__PURE__ */ n(Ce, {}),
1550
+ fallback: e = /* @__PURE__ */ s(De, {}),
1455
1551
  allowedPlans: t,
1456
1552
  requiredFeature: r
1457
1553
  }) {
1458
- const { subscription: s, hasAllowedPlan: a, isFeatureEnabled: v, loading: T } = Fe();
1459
- return T ? /* @__PURE__ */ n(
1554
+ const { subscription: n, hasAllowedPlan: o, isFeatureEnabled: m, loading: T } = Fe();
1555
+ return T ? /* @__PURE__ */ s(
1460
1556
  "div",
1461
1557
  {
1462
1558
  style: {
@@ -1466,9 +1562,9 @@ function at({
1466
1562
  },
1467
1563
  children: "Loading subscription..."
1468
1564
  }
1469
- ) : s ? s.isActive ? t && t.length > 0 && !a(t) ? /* @__PURE__ */ n(B, { children: e }) : r && !v(r) ? /* @__PURE__ */ n(B, { children: e }) : /* @__PURE__ */ n(B, { children: i }) : /* @__PURE__ */ n(B, { children: e }) : /* @__PURE__ */ n(B, { children: e });
1565
+ ) : n ? n.isActive ? t && t.length > 0 && !o(t) ? /* @__PURE__ */ s(H, { children: e }) : r && !m(r) ? /* @__PURE__ */ s(H, { children: e }) : /* @__PURE__ */ s(H, { children: i }) : /* @__PURE__ */ s(H, { children: e }) : /* @__PURE__ */ s(H, { children: e });
1470
1566
  }
1471
- const Le = ({ flagName: i }) => /* @__PURE__ */ u(
1567
+ const Be = ({ flagName: i }) => /* @__PURE__ */ c(
1472
1568
  "div",
1473
1569
  {
1474
1570
  style: {
@@ -1485,9 +1581,9 @@ const Le = ({ flagName: i }) => /* @__PURE__ */ u(
1485
1581
  color: "#6c757d"
1486
1582
  },
1487
1583
  children: [
1488
- /* @__PURE__ */ n("div", { style: { fontSize: "24px", marginBottom: "8px" }, children: "🚧" }),
1489
- /* @__PURE__ */ n("div", { style: { fontSize: "14px", fontWeight: "500", marginBottom: "4px" }, children: "Feature Not Available" }),
1490
- /* @__PURE__ */ u("div", { style: { fontSize: "12px", opacity: 0.7 }, children: [
1584
+ /* @__PURE__ */ s("div", { style: { fontSize: "24px", marginBottom: "8px" }, children: "🚧" }),
1585
+ /* @__PURE__ */ s("div", { style: { fontSize: "14px", fontWeight: "500", marginBottom: "4px" }, children: "Feature Not Available" }),
1586
+ /* @__PURE__ */ c("div", { style: { fontSize: "12px", opacity: 0.7 }, children: [
1491
1587
  'Feature flag "',
1492
1588
  i,
1493
1589
  '" is disabled'
@@ -1495,9 +1591,9 @@ const Le = ({ flagName: i }) => /* @__PURE__ */ u(
1495
1591
  ]
1496
1592
  }
1497
1593
  );
1498
- function lt({ name: i, children: e, fallback: t }) {
1499
- const { isEnabled: r, loading: s } = Ee();
1500
- return s ? /* @__PURE__ */ n(
1594
+ function ht({ name: i, children: e, fallback: t }) {
1595
+ const { isEnabled: r, loading: n } = Ee();
1596
+ return n ? /* @__PURE__ */ s(
1501
1597
  "div",
1502
1598
  {
1503
1599
  style: {
@@ -1510,9 +1606,9 @@ function lt({ name: i, children: e, fallback: t }) {
1510
1606
  },
1511
1607
  children: "Loading feature flags..."
1512
1608
  }
1513
- ) : (console.log(i, r(i)), r(i) ? /* @__PURE__ */ n(B, { children: e }) : /* @__PURE__ */ n(B, { children: t || /* @__PURE__ */ n(Le, { flagName: i }) }));
1609
+ ) : (console.log(i, r(i)), r(i) ? /* @__PURE__ */ s(H, { children: e }) : /* @__PURE__ */ s(H, { children: t || /* @__PURE__ */ s(Be, { flagName: i }) }));
1514
1610
  }
1515
- const De = () => /* @__PURE__ */ u(
1611
+ const qe = () => /* @__PURE__ */ c(
1516
1612
  "svg",
1517
1613
  {
1518
1614
  width: "16",
@@ -1525,11 +1621,11 @@ const De = () => /* @__PURE__ */ u(
1525
1621
  strokeLinejoin: "round",
1526
1622
  style: { flexShrink: 0 },
1527
1623
  children: [
1528
- /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
1529
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
1624
+ /* @__PURE__ */ s("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
1625
+ /* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" })
1530
1626
  ]
1531
1627
  }
1532
- ), Be = () => /* @__PURE__ */ u(
1628
+ ), Ue = () => /* @__PURE__ */ c(
1533
1629
  "svg",
1534
1630
  {
1535
1631
  width: "16",
@@ -1542,14 +1638,14 @@ const De = () => /* @__PURE__ */ u(
1542
1638
  strokeLinejoin: "round",
1543
1639
  style: { flexShrink: 0 },
1544
1640
  children: [
1545
- /* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
1546
- /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1641
+ /* @__PURE__ */ s("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
1642
+ /* @__PURE__ */ s("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
1547
1643
  ]
1548
1644
  }
1549
- ), Ue = {
1550
- showPassword: /* @__PURE__ */ n(De, {}),
1551
- hidePassword: /* @__PURE__ */ n(Be, {})
1552
- }, qe = {
1645
+ ), Ne = {
1646
+ showPassword: /* @__PURE__ */ s(qe, {}),
1647
+ hidePassword: /* @__PURE__ */ s(Ue, {})
1648
+ }, ze = {
1553
1649
  title: "Sign In",
1554
1650
  emailLabel: "Email",
1555
1651
  emailPlaceholder: "Enter your email",
@@ -1561,7 +1657,7 @@ const De = () => /* @__PURE__ */ u(
1561
1657
  signupText: "Don't have an account?",
1562
1658
  errorMessage: "Invalid email or password",
1563
1659
  loadingText: "Signing in..."
1564
- }, Ne = {
1660
+ }, Oe = {
1565
1661
  container: {
1566
1662
  maxWidth: "400px",
1567
1663
  width: "100%",
@@ -1668,52 +1764,52 @@ const De = () => /* @__PURE__ */ u(
1668
1764
  fontSize: "0.875rem"
1669
1765
  }
1670
1766
  };
1671
- function ct({
1767
+ function gt({
1672
1768
  copy: i = {},
1673
1769
  styles: e = {},
1674
1770
  icons: t = {},
1675
1771
  onSuccess: r,
1676
- onError: s,
1677
- onForgotPassword: a,
1678
- onSignupClick: v,
1772
+ onError: n,
1773
+ onForgotPassword: o,
1774
+ onSignupClick: m,
1679
1775
  showForgotPassword: T = !0,
1680
1776
  showSignupLink: M = !0,
1681
1777
  className: P
1682
1778
  }) {
1683
- const [g, h] = m(""), [x, p] = m(""), [A, F] = m(!1), [f, C] = m(!1), [y, b] = m(""), [k, R] = m({}), { login: L } = se(), { tenant: E } = Z(), D = { ...qe, ...i }, c = { ...Ne, ...e }, w = { ...Ue, ...t }, d = () => {
1779
+ const [g, h] = b(""), [x, p] = b(""), [A, F] = b(!1), [f, L] = b(!1), [y, S] = b(""), [k, R] = b({}), { login: D } = se(), { tenant: E } = K(), B = { ...ze, ...i }, d = { ...Oe, ...e }, w = { ...Ne, ...t }, u = () => {
1684
1780
  const I = {};
1685
1781
  return g.trim() || (I.email = !0), x.trim() || (I.password = !0), R(I), Object.keys(I).length === 0;
1686
- }, o = async (I) => {
1687
- if (I.preventDefault(), !!d()) {
1782
+ }, a = async (I) => {
1783
+ if (I.preventDefault(), !!u()) {
1688
1784
  if (!(E != null && E.id)) {
1689
- b("Tenant not found");
1785
+ S("Tenant not found");
1690
1786
  return;
1691
1787
  }
1692
- C(!0), b("");
1788
+ L(!0), S("");
1693
1789
  try {
1694
- const N = await L(g, x, E.id);
1790
+ const N = await D(g, x, E.id);
1695
1791
  r == null || r(N);
1696
1792
  } catch (N) {
1697
- const _ = N.message || D.errorMessage;
1698
- b(_), s == null || s(_);
1793
+ const _ = N.message || B.errorMessage;
1794
+ S(_), n == null || n(_);
1699
1795
  } finally {
1700
- C(!1);
1796
+ L(!1);
1701
1797
  }
1702
1798
  }
1703
1799
  }, l = (I) => ({
1704
- ...c.input,
1705
- ...k[I] ? c.inputError : {}
1800
+ ...d.input,
1801
+ ...k[I] ? d.inputError : {}
1706
1802
  }), W = () => ({
1707
- ...c.button,
1708
- ...f ? c.buttonLoading : {},
1709
- ...!g || !x || f ? c.buttonDisabled : {}
1803
+ ...d.button,
1804
+ ...f ? d.buttonLoading : {},
1805
+ ...!g || !x || f ? d.buttonDisabled : {}
1710
1806
  });
1711
- return /* @__PURE__ */ u("div", { className: P, style: c.container, children: [
1712
- /* @__PURE__ */ n("h2", { style: c.title, children: D.title }),
1713
- /* @__PURE__ */ u("form", { onSubmit: o, style: c.form, children: [
1714
- /* @__PURE__ */ u("div", { style: c.fieldGroup, children: [
1715
- /* @__PURE__ */ n("label", { style: c.label, children: D.emailLabel }),
1716
- /* @__PURE__ */ n(
1807
+ return /* @__PURE__ */ c("div", { className: P, style: d.container, children: [
1808
+ /* @__PURE__ */ s("h2", { style: d.title, children: B.title }),
1809
+ /* @__PURE__ */ c("form", { onSubmit: a, style: d.form, children: [
1810
+ /* @__PURE__ */ c("div", { style: d.fieldGroup, children: [
1811
+ /* @__PURE__ */ s("label", { style: d.label, children: B.emailLabel }),
1812
+ /* @__PURE__ */ s(
1717
1813
  "input",
1718
1814
  {
1719
1815
  id: "email",
@@ -1723,16 +1819,16 @@ function ct({
1723
1819
  onChange: (I) => {
1724
1820
  h(I.target.value), k.email && R((N) => ({ ...N, email: !1 }));
1725
1821
  },
1726
- placeholder: D.emailPlaceholder,
1822
+ placeholder: B.emailPlaceholder,
1727
1823
  style: l("email"),
1728
1824
  disabled: f
1729
1825
  }
1730
1826
  )
1731
1827
  ] }),
1732
- /* @__PURE__ */ u("div", { style: c.fieldGroup, children: [
1733
- /* @__PURE__ */ n("label", { style: c.label, children: D.passwordLabel }),
1734
- /* @__PURE__ */ u("div", { style: c.inputContainer, children: [
1735
- /* @__PURE__ */ n(
1828
+ /* @__PURE__ */ c("div", { style: d.fieldGroup, children: [
1829
+ /* @__PURE__ */ s("label", { style: d.label, children: B.passwordLabel }),
1830
+ /* @__PURE__ */ c("div", { style: d.inputContainer, children: [
1831
+ /* @__PURE__ */ s(
1736
1832
  "input",
1737
1833
  {
1738
1834
  id: "password",
@@ -1742,7 +1838,7 @@ function ct({
1742
1838
  onChange: (I) => {
1743
1839
  p(I.target.value), k.password && R((N) => ({ ...N, password: !1 }));
1744
1840
  },
1745
- placeholder: D.passwordPlaceholder,
1841
+ placeholder: B.passwordPlaceholder,
1746
1842
  style: {
1747
1843
  ...l("password"),
1748
1844
  paddingRight: "2.5rem"
@@ -1751,12 +1847,12 @@ function ct({
1751
1847
  disabled: f
1752
1848
  }
1753
1849
  ),
1754
- /* @__PURE__ */ n(
1850
+ /* @__PURE__ */ s(
1755
1851
  "button",
1756
1852
  {
1757
1853
  type: "button",
1758
1854
  onClick: () => F(!A),
1759
- style: c.passwordToggle,
1855
+ style: d.passwordToggle,
1760
1856
  disabled: f,
1761
1857
  "aria-label": A ? "Hide password" : "Show password",
1762
1858
  children: A ? w.hidePassword : w.showPassword
@@ -1764,23 +1860,23 @@ function ct({
1764
1860
  )
1765
1861
  ] })
1766
1862
  ] }),
1767
- /* @__PURE__ */ n("button", { type: "submit", disabled: !g || !x || f, style: W(), children: f ? D.loadingText : D.submitButton }),
1768
- y && /* @__PURE__ */ n("div", { style: c.errorText, children: y })
1863
+ /* @__PURE__ */ s("button", { type: "submit", disabled: !g || !x || f, style: W(), children: f ? B.loadingText : B.submitButton }),
1864
+ y && /* @__PURE__ */ s("div", { style: d.errorText, children: y })
1769
1865
  ] }),
1770
- (T || M) && /* @__PURE__ */ u("div", { style: c.linkContainer, children: [
1771
- T && /* @__PURE__ */ n("a", { onClick: a, style: c.link, children: D.forgotPasswordLink }),
1772
- T && M && /* @__PURE__ */ n("div", { style: c.divider, children: "•" }),
1773
- M && /* @__PURE__ */ u("div", { children: [
1774
- /* @__PURE__ */ u("span", { style: c.divider, children: [
1775
- D.signupText,
1866
+ (T || M) && /* @__PURE__ */ c("div", { style: d.linkContainer, children: [
1867
+ T && /* @__PURE__ */ s("a", { onClick: o, style: d.link, children: B.forgotPasswordLink }),
1868
+ T && M && /* @__PURE__ */ s("div", { style: d.divider, children: "•" }),
1869
+ M && /* @__PURE__ */ c("div", { children: [
1870
+ /* @__PURE__ */ c("span", { style: d.divider, children: [
1871
+ B.signupText,
1776
1872
  " "
1777
1873
  ] }),
1778
- /* @__PURE__ */ n("a", { onClick: v, style: c.link, children: D.signupLink })
1874
+ /* @__PURE__ */ s("a", { onClick: m, style: d.link, children: B.signupLink })
1779
1875
  ] })
1780
1876
  ] })
1781
1877
  ] });
1782
1878
  }
1783
- const Oe = {
1879
+ const je = {
1784
1880
  title: "Create Account",
1785
1881
  nameLabel: "Full Name",
1786
1882
  namePlaceholder: "Enter your full name",
@@ -1800,7 +1896,7 @@ const Oe = {
1800
1896
  passwordMismatchError: "Passwords do not match",
1801
1897
  isAdminLabel: "Create new organization",
1802
1898
  isAdminDescription: "Check this if you want to create a new organization"
1803
- }, ze = {
1899
+ }, Ve = {
1804
1900
  container: {
1805
1901
  maxWidth: "400px",
1806
1902
  width: "100%",
@@ -1899,154 +1995,154 @@ const Oe = {
1899
1995
  fontSize: "0.875rem"
1900
1996
  }
1901
1997
  };
1902
- function dt({
1998
+ function pt({
1903
1999
  copy: i = {},
1904
2000
  styles: e = {},
1905
2001
  signupType: t = "user",
1906
2002
  onSuccess: r,
1907
- onError: s,
1908
- onLoginClick: a,
1909
- showLoginLink: v = !0,
2003
+ onError: n,
2004
+ onLoginClick: o,
2005
+ showLoginLink: m = !0,
1910
2006
  className: T
1911
2007
  }) {
1912
- const [M, P] = m(""), [g, h] = m(""), [x, p] = m(""), [A, F] = m(""), [f, C] = m(""), [y, b] = m(!1), [k, R] = m(""), [L, E] = m({}), { signup: D, signupTenantAdmin: c } = se(), { tenant: w } = Z(), d = { ...Oe, ...i }, o = { ...ze, ...e }, l = () => {
1913
- const H = {};
1914
- return M.trim() || (H.name = !0), g.trim() || (H.email = !0), x.trim() || (H.password = !0), A.trim() || (H.confirmPassword = !0), t === "tenant" && !f.trim() && (H.tenantName = !0), E(H), Object.keys(H).length === 0;
1915
- }, W = async (H) => {
1916
- if (H.preventDefault(), !!l()) {
2008
+ const [M, P] = b(""), [g, h] = b(""), [x, p] = b(""), [A, F] = b(""), [f, L] = b(""), [y, S] = b(!1), [k, R] = b(""), [D, E] = b({}), { signup: B, signupTenantAdmin: d } = se(), { tenant: w } = K(), u = { ...je, ...i }, a = { ...Ve, ...e }, l = () => {
2009
+ const C = {};
2010
+ return M.trim() || (C.name = !0), g.trim() || (C.email = !0), x.trim() || (C.password = !0), A.trim() || (C.confirmPassword = !0), t === "tenant" && !f.trim() && (C.tenantName = !0), E(C), Object.keys(C).length === 0;
2011
+ }, W = async (C) => {
2012
+ if (C.preventDefault(), !!l()) {
1917
2013
  if (x !== A) {
1918
- R(d.passwordMismatchError), E({ confirmPassword: !0 });
2014
+ R(u.passwordMismatchError), E({ confirmPassword: !0 });
1919
2015
  return;
1920
2016
  }
1921
2017
  if (t === "user" && !(w != null && w.id)) {
1922
2018
  R("Tenant not found");
1923
2019
  return;
1924
2020
  }
1925
- b(!0), R("");
2021
+ S(!0), R("");
1926
2022
  try {
1927
- let q;
1928
- t === "tenant" ? q = await c(g, M, x, f) : q = await D(g, M, x, w.id), r == null || r(q);
1929
- } catch (q) {
1930
- const Y = q.message || d.errorMessage;
1931
- R(Y), s == null || s(Y);
2023
+ let U;
2024
+ t === "tenant" ? U = await d(g, M, x, f) : U = await B(g, M, x, w.id), r == null || r(U);
2025
+ } catch (U) {
2026
+ const Q = U.message || u.errorMessage;
2027
+ R(Q), n == null || n(Q);
1932
2028
  } finally {
1933
- b(!1);
2029
+ S(!1);
1934
2030
  }
1935
2031
  }
1936
- }, I = (H) => ({
1937
- ...o.input,
1938
- ...L[H] ? o.inputError : {}
2032
+ }, I = (C) => ({
2033
+ ...a.input,
2034
+ ...D[C] ? a.inputError : {}
1939
2035
  }), N = () => ({
1940
- ...o.button,
1941
- ...y ? o.buttonLoading : {},
1942
- ...!M || !g || !x || !A || y || t === "tenant" && !f ? o.buttonDisabled : {}
2036
+ ...a.button,
2037
+ ...y ? a.buttonLoading : {},
2038
+ ...!M || !g || !x || !A || y || t === "tenant" && !f ? a.buttonDisabled : {}
1943
2039
  }), _ = M && g && x && A && (t === "user" || f);
1944
- return /* @__PURE__ */ u("div", { className: T, style: o.container, children: [
1945
- /* @__PURE__ */ n("h2", { style: o.title, children: d.title }),
1946
- /* @__PURE__ */ u("form", { onSubmit: W, style: o.form, children: [
1947
- /* @__PURE__ */ u("div", { style: o.fieldGroup, children: [
1948
- /* @__PURE__ */ n("label", { style: o.label, children: d.nameLabel }),
1949
- /* @__PURE__ */ n(
2040
+ return /* @__PURE__ */ c("div", { className: T, style: a.container, children: [
2041
+ /* @__PURE__ */ s("h2", { style: a.title, children: u.title }),
2042
+ /* @__PURE__ */ c("form", { onSubmit: W, style: a.form, children: [
2043
+ /* @__PURE__ */ c("div", { style: a.fieldGroup, children: [
2044
+ /* @__PURE__ */ s("label", { style: a.label, children: u.nameLabel }),
2045
+ /* @__PURE__ */ s(
1950
2046
  "input",
1951
2047
  {
1952
2048
  id: "name",
1953
2049
  name: "name",
1954
2050
  type: "text",
1955
2051
  value: M,
1956
- onChange: (H) => {
1957
- P(H.target.value), L.name && E((q) => ({ ...q, name: !1 }));
2052
+ onChange: (C) => {
2053
+ P(C.target.value), D.name && E((U) => ({ ...U, name: !1 }));
1958
2054
  },
1959
- placeholder: d.namePlaceholder,
2055
+ placeholder: u.namePlaceholder,
1960
2056
  style: I("name"),
1961
2057
  disabled: y
1962
2058
  }
1963
2059
  )
1964
2060
  ] }),
1965
- /* @__PURE__ */ u("div", { style: o.fieldGroup, children: [
1966
- /* @__PURE__ */ n("label", { style: o.label, children: d.emailLabel }),
1967
- /* @__PURE__ */ n(
2061
+ /* @__PURE__ */ c("div", { style: a.fieldGroup, children: [
2062
+ /* @__PURE__ */ s("label", { style: a.label, children: u.emailLabel }),
2063
+ /* @__PURE__ */ s(
1968
2064
  "input",
1969
2065
  {
1970
2066
  id: "email",
1971
2067
  name: "email",
1972
2068
  type: "email",
1973
2069
  value: g,
1974
- onChange: (H) => {
1975
- h(H.target.value), L.email && E((q) => ({ ...q, email: !1 }));
2070
+ onChange: (C) => {
2071
+ h(C.target.value), D.email && E((U) => ({ ...U, email: !1 }));
1976
2072
  },
1977
- placeholder: d.emailPlaceholder,
2073
+ placeholder: u.emailPlaceholder,
1978
2074
  style: I("email"),
1979
2075
  disabled: y
1980
2076
  }
1981
2077
  )
1982
2078
  ] }),
1983
- /* @__PURE__ */ u("div", { style: o.fieldGroup, children: [
1984
- /* @__PURE__ */ n("label", { style: o.label, children: d.passwordLabel }),
1985
- /* @__PURE__ */ n(
2079
+ /* @__PURE__ */ c("div", { style: a.fieldGroup, children: [
2080
+ /* @__PURE__ */ s("label", { style: a.label, children: u.passwordLabel }),
2081
+ /* @__PURE__ */ s(
1986
2082
  "input",
1987
2083
  {
1988
2084
  id: "password",
1989
2085
  name: "password",
1990
2086
  type: "password",
1991
2087
  value: x,
1992
- onChange: (H) => {
1993
- p(H.target.value), L.password && E((q) => ({ ...q, password: !1 }));
2088
+ onChange: (C) => {
2089
+ p(C.target.value), D.password && E((U) => ({ ...U, password: !1 }));
1994
2090
  },
1995
- placeholder: d.passwordPlaceholder,
2091
+ placeholder: u.passwordPlaceholder,
1996
2092
  style: I("password"),
1997
2093
  disabled: y
1998
2094
  }
1999
2095
  )
2000
2096
  ] }),
2001
- /* @__PURE__ */ u("div", { style: o.fieldGroup, children: [
2002
- /* @__PURE__ */ n("label", { style: o.label, children: d.confirmPasswordLabel }),
2003
- /* @__PURE__ */ n(
2097
+ /* @__PURE__ */ c("div", { style: a.fieldGroup, children: [
2098
+ /* @__PURE__ */ s("label", { style: a.label, children: u.confirmPasswordLabel }),
2099
+ /* @__PURE__ */ s(
2004
2100
  "input",
2005
2101
  {
2006
2102
  id: "confirmPassword",
2007
2103
  name: "confirmPassword",
2008
2104
  type: "password",
2009
2105
  value: A,
2010
- onChange: (H) => {
2011
- F(H.target.value), L.confirmPassword && E((q) => ({ ...q, confirmPassword: !1 })), k === d.passwordMismatchError && R("");
2106
+ onChange: (C) => {
2107
+ F(C.target.value), D.confirmPassword && E((U) => ({ ...U, confirmPassword: !1 })), k === u.passwordMismatchError && R("");
2012
2108
  },
2013
- placeholder: d.confirmPasswordPlaceholder,
2109
+ placeholder: u.confirmPasswordPlaceholder,
2014
2110
  style: I("confirmPassword"),
2015
2111
  disabled: y
2016
2112
  }
2017
2113
  )
2018
2114
  ] }),
2019
- t === "tenant" && /* @__PURE__ */ u("div", { style: o.fieldGroup, children: [
2020
- /* @__PURE__ */ n("label", { style: o.label, children: d.tenantNameLabel }),
2021
- /* @__PURE__ */ n(
2115
+ t === "tenant" && /* @__PURE__ */ c("div", { style: a.fieldGroup, children: [
2116
+ /* @__PURE__ */ s("label", { style: a.label, children: u.tenantNameLabel }),
2117
+ /* @__PURE__ */ s(
2022
2118
  "input",
2023
2119
  {
2024
2120
  id: "tenantName",
2025
2121
  name: "tenantName",
2026
2122
  type: "text",
2027
2123
  value: f,
2028
- onChange: (H) => {
2029
- C(H.target.value), L.tenantName && E((q) => ({ ...q, tenantName: !1 }));
2124
+ onChange: (C) => {
2125
+ L(C.target.value), D.tenantName && E((U) => ({ ...U, tenantName: !1 }));
2030
2126
  },
2031
- placeholder: d.tenantNamePlaceholder,
2127
+ placeholder: u.tenantNamePlaceholder,
2032
2128
  style: I("tenantName"),
2033
2129
  disabled: y
2034
2130
  }
2035
2131
  )
2036
2132
  ] }),
2037
- /* @__PURE__ */ n("button", { type: "submit", disabled: !_ || y, style: N(), children: y ? d.loadingText : d.submitButton }),
2038
- k && /* @__PURE__ */ n("div", { style: o.errorText, children: k })
2133
+ /* @__PURE__ */ s("button", { type: "submit", disabled: !_ || y, style: N(), children: y ? u.loadingText : u.submitButton }),
2134
+ k && /* @__PURE__ */ s("div", { style: a.errorText, children: k })
2039
2135
  ] }),
2040
- v && /* @__PURE__ */ u("div", { style: o.linkContainer, children: [
2041
- /* @__PURE__ */ u("span", { style: o.divider, children: [
2042
- d.loginText,
2136
+ m && /* @__PURE__ */ c("div", { style: a.linkContainer, children: [
2137
+ /* @__PURE__ */ c("span", { style: a.divider, children: [
2138
+ u.loginText,
2043
2139
  " "
2044
2140
  ] }),
2045
- /* @__PURE__ */ n("a", { onClick: a, style: o.link, children: d.loginLink })
2141
+ /* @__PURE__ */ s("a", { onClick: o, style: a.link, children: u.loginLink })
2046
2142
  ] })
2047
2143
  ] });
2048
2144
  }
2049
- const je = {
2145
+ const We = {
2050
2146
  title: "Reset Password",
2051
2147
  subtitle: "Enter your email address and we'll send you a link to reset your password.",
2052
2148
  emailLabel: "Email",
@@ -2068,7 +2164,7 @@ const je = {
2068
2164
  resetLoadingText: "Resetting...",
2069
2165
  resetSuccessMessage: "Password reset successfully!",
2070
2166
  passwordMismatchError: "Passwords do not match"
2071
- }, Ve = {
2167
+ }, Ge = {
2072
2168
  container: {
2073
2169
  maxWidth: "400px",
2074
2170
  margin: "0 auto",
@@ -2160,186 +2256,186 @@ const je = {
2160
2256
  cursor: "pointer"
2161
2257
  }
2162
2258
  };
2163
- function ut({
2259
+ function ft({
2164
2260
  copy: i = {},
2165
2261
  styles: e = {},
2166
2262
  mode: t = "request",
2167
2263
  token: r = "",
2168
- onSuccess: s,
2169
- onError: a,
2170
- onBackToLogin: v,
2264
+ onSuccess: n,
2265
+ onError: o,
2266
+ onBackToLogin: m,
2171
2267
  onModeChange: T,
2172
2268
  className: M
2173
2269
  }) {
2174
- const [P, g] = m(""), [h, x] = m(r), [p, A] = m(""), [F, f] = m(""), [C, y] = m(!1), [b, k] = m(""), [R, L] = m(""), [E, D] = m({}), { requestPasswordReset: c, confirmPasswordReset: w } = se(), { tenant: d } = Z(), o = { ...je, ...i }, l = { ...Ve, ...e }, W = () => {
2175
- const U = {};
2176
- return P.trim() || (U.email = !0), D(U), Object.keys(U).length === 0;
2270
+ const [P, g] = b(""), [h, x] = b(r), [p, A] = b(""), [F, f] = b(""), [L, y] = b(!1), [S, k] = b(""), [R, D] = b(""), [E, B] = b({}), { requestPasswordReset: d, confirmPasswordReset: w } = se(), { tenant: u } = K(), a = { ...We, ...i }, l = { ...Ge, ...e }, W = () => {
2271
+ const q = {};
2272
+ return P.trim() || (q.email = !0), B(q), Object.keys(q).length === 0;
2177
2273
  }, I = () => {
2178
- const U = {};
2179
- return h.trim() || (U.token = !0), p.trim() || (U.newPassword = !0), F.trim() || (U.confirmPassword = !0), D(U), Object.keys(U).length === 0;
2180
- }, N = async (U) => {
2181
- if (U.preventDefault(), !!W()) {
2182
- if (!(d != null && d.id)) {
2274
+ const q = {};
2275
+ return h.trim() || (q.token = !0), p.trim() || (q.newPassword = !0), F.trim() || (q.confirmPassword = !0), B(q), Object.keys(q).length === 0;
2276
+ }, N = async (q) => {
2277
+ if (q.preventDefault(), !!W()) {
2278
+ if (!(u != null && u.id)) {
2183
2279
  k("Tenant not found");
2184
2280
  return;
2185
2281
  }
2186
- y(!0), k(""), L("");
2282
+ y(!0), k(""), D("");
2187
2283
  try {
2188
- await c(P, d.id), L(o.successMessage), s == null || s();
2189
- } catch (z) {
2190
- const j = z.message || o.errorMessage;
2191
- k(j), a == null || a(j);
2284
+ await d(P, u.id), D(a.successMessage), n == null || n();
2285
+ } catch (O) {
2286
+ const j = O.message || a.errorMessage;
2287
+ k(j), o == null || o(j);
2192
2288
  } finally {
2193
2289
  y(!1);
2194
2290
  }
2195
2291
  }
2196
- }, _ = async (U) => {
2197
- if (U.preventDefault(), !!I()) {
2292
+ }, _ = async (q) => {
2293
+ if (q.preventDefault(), !!I()) {
2198
2294
  if (p !== F) {
2199
- k(o.passwordMismatchError), D({ confirmPassword: !0 });
2295
+ k(a.passwordMismatchError), B({ confirmPassword: !0 });
2200
2296
  return;
2201
2297
  }
2202
- y(!0), k(""), L("");
2298
+ y(!0), k(""), D("");
2203
2299
  try {
2204
- await w(h, p), L(o.resetSuccessMessage), s == null || s();
2205
- } catch (z) {
2206
- const j = z.message || o.errorMessage;
2207
- k(j), a == null || a(j);
2300
+ await w(h, p), D(a.resetSuccessMessage), n == null || n();
2301
+ } catch (O) {
2302
+ const j = O.message || a.errorMessage;
2303
+ k(j), o == null || o(j);
2208
2304
  } finally {
2209
2305
  y(!1);
2210
2306
  }
2211
2307
  }
2212
- }, H = (U) => ({
2308
+ }, C = (q) => ({
2213
2309
  ...l.input,
2214
- ...E[U] ? l.inputError : {}
2215
- }), q = () => ({
2310
+ ...E[q] ? l.inputError : {}
2311
+ }), U = () => ({
2216
2312
  ...l.button,
2217
- ...C ? l.buttonLoading : {}
2313
+ ...L ? l.buttonLoading : {}
2218
2314
  });
2219
2315
  if (t === "reset") {
2220
- const U = h && p && F;
2221
- return /* @__PURE__ */ u("div", { className: M, style: l.container, children: [
2222
- /* @__PURE__ */ n("h2", { style: l.title, children: o.resetTitle }),
2223
- /* @__PURE__ */ n("p", { style: l.subtitle, children: o.resetSubtitle }),
2224
- /* @__PURE__ */ u("form", { onSubmit: _, style: l.form, children: [
2225
- /* @__PURE__ */ u("div", { style: l.fieldGroup, children: [
2226
- /* @__PURE__ */ n("label", { style: l.label, children: o.tokenLabel }),
2227
- /* @__PURE__ */ n(
2316
+ const q = h && p && F;
2317
+ return /* @__PURE__ */ c("div", { className: M, style: l.container, children: [
2318
+ /* @__PURE__ */ s("h2", { style: l.title, children: a.resetTitle }),
2319
+ /* @__PURE__ */ s("p", { style: l.subtitle, children: a.resetSubtitle }),
2320
+ /* @__PURE__ */ c("form", { onSubmit: _, style: l.form, children: [
2321
+ /* @__PURE__ */ c("div", { style: l.fieldGroup, children: [
2322
+ /* @__PURE__ */ s("label", { style: l.label, children: a.tokenLabel }),
2323
+ /* @__PURE__ */ s(
2228
2324
  "input",
2229
2325
  {
2230
2326
  type: "text",
2231
2327
  value: h,
2232
- onChange: (z) => {
2233
- x(z.target.value), E.token && D((j) => ({ ...j, token: !1 }));
2328
+ onChange: (O) => {
2329
+ x(O.target.value), E.token && B((j) => ({ ...j, token: !1 }));
2234
2330
  },
2235
- placeholder: o.tokenPlaceholder,
2236
- style: H("token"),
2237
- disabled: C
2331
+ placeholder: a.tokenPlaceholder,
2332
+ style: C("token"),
2333
+ disabled: L
2238
2334
  }
2239
2335
  )
2240
2336
  ] }),
2241
- /* @__PURE__ */ u("div", { style: l.fieldGroup, children: [
2242
- /* @__PURE__ */ n("label", { style: l.label, children: o.newPasswordLabel }),
2243
- /* @__PURE__ */ n(
2337
+ /* @__PURE__ */ c("div", { style: l.fieldGroup, children: [
2338
+ /* @__PURE__ */ s("label", { style: l.label, children: a.newPasswordLabel }),
2339
+ /* @__PURE__ */ s(
2244
2340
  "input",
2245
2341
  {
2246
2342
  type: "password",
2247
2343
  value: p,
2248
- onChange: (z) => {
2249
- A(z.target.value), E.newPassword && D((j) => ({ ...j, newPassword: !1 }));
2344
+ onChange: (O) => {
2345
+ A(O.target.value), E.newPassword && B((j) => ({ ...j, newPassword: !1 }));
2250
2346
  },
2251
- placeholder: o.newPasswordPlaceholder,
2252
- style: H("newPassword"),
2253
- disabled: C
2347
+ placeholder: a.newPasswordPlaceholder,
2348
+ style: C("newPassword"),
2349
+ disabled: L
2254
2350
  }
2255
2351
  )
2256
2352
  ] }),
2257
- /* @__PURE__ */ u("div", { style: l.fieldGroup, children: [
2258
- /* @__PURE__ */ n("label", { style: l.label, children: o.confirmPasswordLabel }),
2259
- /* @__PURE__ */ n(
2353
+ /* @__PURE__ */ c("div", { style: l.fieldGroup, children: [
2354
+ /* @__PURE__ */ s("label", { style: l.label, children: a.confirmPasswordLabel }),
2355
+ /* @__PURE__ */ s(
2260
2356
  "input",
2261
2357
  {
2262
2358
  type: "password",
2263
2359
  value: F,
2264
- onChange: (z) => {
2265
- f(z.target.value), E.confirmPassword && D((j) => ({ ...j, confirmPassword: !1 })), b === o.passwordMismatchError && k("");
2360
+ onChange: (O) => {
2361
+ f(O.target.value), E.confirmPassword && B((j) => ({ ...j, confirmPassword: !1 })), S === a.passwordMismatchError && k("");
2266
2362
  },
2267
- placeholder: o.confirmPasswordPlaceholder,
2268
- style: H("confirmPassword"),
2269
- disabled: C
2363
+ placeholder: a.confirmPasswordPlaceholder,
2364
+ style: C("confirmPassword"),
2365
+ disabled: L
2270
2366
  }
2271
2367
  )
2272
2368
  ] }),
2273
- /* @__PURE__ */ n(
2369
+ /* @__PURE__ */ s(
2274
2370
  "button",
2275
2371
  {
2276
2372
  type: "submit",
2277
- disabled: !U || C,
2373
+ disabled: !q || L,
2278
2374
  style: {
2279
- ...q(),
2280
- ...!U || C ? l.buttonDisabled : {}
2375
+ ...U(),
2376
+ ...!q || L ? l.buttonDisabled : {}
2281
2377
  },
2282
- children: C ? o.resetLoadingText : o.resetSubmitButton
2378
+ children: L ? a.resetLoadingText : a.resetSubmitButton
2283
2379
  }
2284
2380
  ),
2285
- b && /* @__PURE__ */ n("div", { style: l.errorText, children: b }),
2286
- R && /* @__PURE__ */ n("div", { style: l.successText, children: R })
2381
+ S && /* @__PURE__ */ s("div", { style: l.errorText, children: S }),
2382
+ R && /* @__PURE__ */ s("div", { style: l.successText, children: R })
2287
2383
  ] }),
2288
- /* @__PURE__ */ u("div", { style: l.linkContainer, children: [
2289
- /* @__PURE__ */ n("a", { onClick: v, style: l.link, children: o.backToLoginLink }),
2290
- T && /* @__PURE__ */ u(B, { children: [
2291
- /* @__PURE__ */ n("span", { style: { margin: "0 0.5rem", color: "#6b7280" }, children: "•" }),
2292
- /* @__PURE__ */ n("a", { onClick: () => T("request"), style: l.link, children: "Request New Link" })
2384
+ /* @__PURE__ */ c("div", { style: l.linkContainer, children: [
2385
+ /* @__PURE__ */ s("a", { onClick: m, style: l.link, children: a.backToLoginLink }),
2386
+ T && /* @__PURE__ */ c(H, { children: [
2387
+ /* @__PURE__ */ s("span", { style: { margin: "0 0.5rem", color: "#6b7280" }, children: "•" }),
2388
+ /* @__PURE__ */ s("a", { onClick: () => T("request"), style: l.link, children: "Request New Link" })
2293
2389
  ] })
2294
2390
  ] })
2295
2391
  ] });
2296
2392
  }
2297
- const Y = P;
2298
- return /* @__PURE__ */ u("div", { className: M, style: l.container, children: [
2299
- /* @__PURE__ */ n("h2", { style: l.title, children: o.title }),
2300
- /* @__PURE__ */ n("p", { style: l.subtitle, children: o.subtitle }),
2301
- /* @__PURE__ */ u("form", { onSubmit: N, style: l.form, children: [
2302
- /* @__PURE__ */ u("div", { style: l.fieldGroup, children: [
2303
- /* @__PURE__ */ n("label", { style: l.label, children: o.emailLabel }),
2304
- /* @__PURE__ */ n(
2393
+ const Q = P;
2394
+ return /* @__PURE__ */ c("div", { className: M, style: l.container, children: [
2395
+ /* @__PURE__ */ s("h2", { style: l.title, children: a.title }),
2396
+ /* @__PURE__ */ s("p", { style: l.subtitle, children: a.subtitle }),
2397
+ /* @__PURE__ */ c("form", { onSubmit: N, style: l.form, children: [
2398
+ /* @__PURE__ */ c("div", { style: l.fieldGroup, children: [
2399
+ /* @__PURE__ */ s("label", { style: l.label, children: a.emailLabel }),
2400
+ /* @__PURE__ */ s(
2305
2401
  "input",
2306
2402
  {
2307
2403
  type: "email",
2308
2404
  value: P,
2309
- onChange: (U) => {
2310
- g(U.target.value), E.email && D((z) => ({ ...z, email: !1 }));
2405
+ onChange: (q) => {
2406
+ g(q.target.value), E.email && B((O) => ({ ...O, email: !1 }));
2311
2407
  },
2312
- placeholder: o.emailPlaceholder,
2313
- style: H("email"),
2314
- disabled: C
2408
+ placeholder: a.emailPlaceholder,
2409
+ style: C("email"),
2410
+ disabled: L
2315
2411
  }
2316
2412
  )
2317
2413
  ] }),
2318
- /* @__PURE__ */ n(
2414
+ /* @__PURE__ */ s(
2319
2415
  "button",
2320
2416
  {
2321
2417
  type: "submit",
2322
- disabled: !Y || C,
2418
+ disabled: !Q || L,
2323
2419
  style: {
2324
- ...q(),
2325
- ...!Y || C ? l.buttonDisabled : {}
2420
+ ...U(),
2421
+ ...!Q || L ? l.buttonDisabled : {}
2326
2422
  },
2327
- children: C ? o.loadingText : o.submitButton
2423
+ children: L ? a.loadingText : a.submitButton
2328
2424
  }
2329
2425
  ),
2330
- b && /* @__PURE__ */ n("div", { style: l.errorText, children: b }),
2331
- R && /* @__PURE__ */ n("div", { style: l.successText, children: R })
2426
+ S && /* @__PURE__ */ s("div", { style: l.errorText, children: S }),
2427
+ R && /* @__PURE__ */ s("div", { style: l.successText, children: R })
2332
2428
  ] }),
2333
- /* @__PURE__ */ u("div", { style: l.linkContainer, children: [
2334
- /* @__PURE__ */ n("a", { onClick: v, style: l.link, children: o.backToLoginLink }),
2335
- T && /* @__PURE__ */ u(B, { children: [
2336
- /* @__PURE__ */ n("span", { style: { margin: "0 0.5rem", color: "#6b7280" }, children: "•" }),
2337
- /* @__PURE__ */ n("a", { onClick: () => T("reset"), style: l.link, children: "I have a token" })
2429
+ /* @__PURE__ */ c("div", { style: l.linkContainer, children: [
2430
+ /* @__PURE__ */ s("a", { onClick: m, style: l.link, children: a.backToLoginLink }),
2431
+ T && /* @__PURE__ */ c(H, { children: [
2432
+ /* @__PURE__ */ s("span", { style: { margin: "0 0.5rem", color: "#6b7280" }, children: "•" }),
2433
+ /* @__PURE__ */ s("a", { onClick: () => T("reset"), style: l.link, children: "I have a token" })
2338
2434
  ] })
2339
2435
  ] })
2340
2436
  ] });
2341
2437
  }
2342
- class ht {
2438
+ class yt {
2343
2439
  constructor(e, t) {
2344
2440
  this.httpService = e, this.sessionManager = t;
2345
2441
  }
@@ -2360,12 +2456,12 @@ class ht {
2360
2456
  throw new Error("SessionManager is required for private endpoints");
2361
2457
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
2362
2458
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder);
2363
- const s = `/permissions/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
2459
+ const n = `/permissions/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
2364
2460
  headers: t
2365
2461
  });
2366
2462
  return {
2367
- permissions: a.data,
2368
- meta: a.meta
2463
+ permissions: o.data,
2464
+ meta: o.meta
2369
2465
  };
2370
2466
  }
2371
2467
  async getPermissionById(e) {
@@ -2400,14 +2496,14 @@ class ht {
2400
2496
  async getAppPermissions(e, t) {
2401
2497
  const r = new URLSearchParams();
2402
2498
  t != null && t.page && r.append("page", t.page.toString()), t != null && t.limit && r.append("limit", t.limit.toString()), t != null && t.sortBy && r.append("sortBy", t.sortBy), t != null && t.sortOrder && r.append("sortOrder", t.sortOrder);
2403
- const s = `/permissions/apps/${e}${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s);
2499
+ const n = `/permissions/apps/${e}${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n);
2404
2500
  return {
2405
- permissions: a.data,
2406
- meta: a.meta
2501
+ permissions: o.data,
2502
+ meta: o.meta
2407
2503
  };
2408
2504
  }
2409
2505
  }
2410
- class gt {
2506
+ class wt {
2411
2507
  constructor(e, t) {
2412
2508
  this.httpService = e, this.sessionManager = t;
2413
2509
  }
@@ -2424,12 +2520,12 @@ class gt {
2424
2520
  async getSubscriptionPlans(e) {
2425
2521
  const t = await this.sessionManager.getAuthHeaders(), r = new URLSearchParams();
2426
2522
  e != null && e.page && r.append("page", e.page.toString()), e != null && e.limit && r.append("limit", e.limit.toString()), e != null && e.sortBy && r.append("sortBy", e.sortBy), e != null && e.sortOrder && r.append("sortOrder", e.sortOrder), e != null && e.appId && r.append("appId", e.appId);
2427
- const s = `/subscription-plans/${r.toString() ? `?${r.toString()}` : ""}`, a = await this.httpService.get(s, {
2523
+ const n = `/subscription-plans/${r.toString() ? `?${r.toString()}` : ""}`, o = await this.httpService.get(n, {
2428
2524
  headers: t
2429
2525
  });
2430
2526
  return {
2431
- plans: a.data,
2432
- meta: a.meta
2527
+ plans: o.data,
2528
+ meta: o.meta
2433
2529
  };
2434
2530
  }
2435
2531
  async getSubscriptionPlanById(e) {
@@ -2458,7 +2554,7 @@ class gt {
2458
2554
  });
2459
2555
  }
2460
2556
  }
2461
- class pt {
2557
+ class mt {
2462
2558
  constructor(e) {
2463
2559
  this.httpService = e;
2464
2560
  }
@@ -2467,7 +2563,7 @@ class pt {
2467
2563
  return await this.httpService.get("/health");
2468
2564
  }
2469
2565
  }
2470
- class ft {
2566
+ class bt {
2471
2567
  // Date string to Date object
2472
2568
  static toDate(e) {
2473
2569
  return new Date(e);
@@ -2584,46 +2680,48 @@ class ft {
2584
2680
  // Transform query parameters for API calls
2585
2681
  static transformQueryParams(e) {
2586
2682
  const t = new URLSearchParams();
2587
- return Object.entries(e).forEach(([r, s]) => {
2588
- s != null && s !== "" && t.append(r, String(s));
2683
+ return Object.entries(e).forEach(([r, n]) => {
2684
+ n != null && n !== "" && t.append(r, String(n));
2589
2685
  }), t;
2590
2686
  }
2591
2687
  }
2592
2688
  export {
2593
- ft as ApiMappers,
2689
+ bt as ApiMappers,
2594
2690
  be as AppApiService,
2595
- Je as AppProvider,
2691
+ Ze as AppProvider,
2596
2692
  Ae as AuthApiService,
2597
- rt as AuthProvider,
2598
- lt as FeatureFlag,
2693
+ nt as AuthProvider,
2694
+ ht as FeatureFlag,
2599
2695
  Me as FeatureFlagApiService,
2600
- st as FeatureFlagProvider,
2601
- pt as HealthApiService,
2696
+ it as FeatureFlagProvider,
2697
+ mt as HealthApiService,
2602
2698
  G as HttpService,
2603
- ct as LoginForm,
2604
- ut as PasswordRecoveryForm,
2605
- ht as PermissionApiService,
2606
- it as Protected,
2607
- ot as ProtectedRoute,
2608
- le as RoleApiService,
2699
+ dt as LandingRoute,
2700
+ gt as LoginForm,
2701
+ ft as PasswordRecoveryForm,
2702
+ yt as PermissionApiService,
2703
+ at as Protected,
2704
+ lt as ProtectedRoute,
2705
+ ce as RoleApiService,
2609
2706
  xe as SessionManager,
2610
- dt as SignupForm,
2707
+ pt as SignupForm,
2611
2708
  Re as SubscriptionApiService,
2612
- at as SubscriptionGuard,
2613
- gt as SubscriptionPlanApiService,
2614
- nt as SubscriptionProvider,
2615
- ce as TenantApiService,
2616
- Ze as TenantProvider,
2709
+ ut as SubscriptionGuard,
2710
+ wt as SubscriptionPlanApiService,
2711
+ ot as SubscriptionProvider,
2712
+ de as TenantApiService,
2713
+ tt as TenantProvider,
2714
+ ct as TenantRoute,
2617
2715
  Pe as UserApiService,
2618
- J as UserType,
2619
- Xe as useApi,
2716
+ X as UserType,
2717
+ et as useApi,
2620
2718
  re as useApp,
2621
2719
  se as useAuth,
2622
2720
  Ee as useFeatureFlags,
2623
- tt as useSettings,
2721
+ st as useSettings,
2624
2722
  Fe as useSubscription,
2625
- oe as useTenant,
2626
- Z as useTenantInfo,
2627
- et as useTenantSettings
2723
+ le as useTenant,
2724
+ K as useTenantInfo,
2725
+ rt as useTenantSettings
2628
2726
  };
2629
2727
  //# sourceMappingURL=index.es.js.map