@burdenoff/fe-libs 2026.527.2 → 2026.527.3

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.
Files changed (78) hide show
  1. package/dist/button/Button.js +18 -16
  2. package/dist/chrome/AccountSwitcher.js +10 -7
  3. package/dist/chrome/AutoBreadcrumbs.js +2 -0
  4. package/dist/chrome/Breadcrumbs.js +2 -0
  5. package/dist/chrome/CommandPalette.js +5 -3
  6. package/dist/chrome/ContextSwitcher.js +12 -11
  7. package/dist/chrome/DynamicFooter.js +7 -7
  8. package/dist/chrome/Footer.js +5 -5
  9. package/dist/chrome/GeographySwitcher.js +3 -3
  10. package/dist/chrome/GlobalSearch.js +18 -9
  11. package/dist/chrome/HeaderBar.js +6 -1
  12. package/dist/chrome/LanguagePickerSheet.js +1 -1
  13. package/dist/chrome/LanguageSwitcher.js +2 -2
  14. package/dist/chrome/NotificationCenter.js +19 -10
  15. package/dist/chrome/PanelTabs.js +7 -4
  16. package/dist/chrome/PluginContextMenuTarget.js +1 -1
  17. package/dist/chrome/ProductPickerSheet.js +4 -4
  18. package/dist/chrome/ProductSideNav.js +1 -1
  19. package/dist/chrome/ProductSwitcher.js +3 -3
  20. package/dist/chrome/ProfileSwitcher.js +13 -8
  21. package/dist/chrome/ShortcutHelpDialog.js +2 -1
  22. package/dist/chrome/SideNavigation.js +7 -3
  23. package/dist/chrome/Sidebar.js +1 -0
  24. package/dist/form/Checkbox.js +17 -15
  25. package/dist/form/FormDescription.js +9 -10
  26. package/dist/form/FormField.js +11 -12
  27. package/dist/form/FormLabel.js +13 -13
  28. package/dist/form/FormMessage.js +10 -11
  29. package/dist/form/Input.js +11 -10
  30. package/dist/form/Radio.js +25 -21
  31. package/dist/form/Select.js +81 -66
  32. package/dist/form/Textarea.js +10 -9
  33. package/dist/shared/components/AccessDenied.js +8 -4
  34. package/dist/shared/components/AppErrorBoundary.js +2 -0
  35. package/dist/shared/components/ContextConversationWidget.js +15 -15
  36. package/dist/shared/components/ErrorFallback.js +3 -0
  37. package/dist/shared/components/PWAInstallBanner.js +8 -4
  38. package/dist/shared/components/RequireAuth.js +4 -4
  39. package/dist/shared/components/SSORedirectGuard.js +1 -1
  40. package/dist/shared/feature-flags/FeatureFlagProvider.js +21 -21
  41. package/dist/shared/geography/GeographyProvider.js +20 -20
  42. package/dist/shared/graphql/GatewayContext.js +1 -1
  43. package/dist/shared/motion/MotionList.js +1 -1
  44. package/dist/shared/pages/AiPage.js +3 -3
  45. package/dist/shared/pages/SearchPage.js +38 -33
  46. package/dist/shared/plugins/PluginRuntimeProvider.js +1 -1
  47. package/dist/shared/providers/shell/ActiveContextProvider.js +12 -12
  48. package/dist/shared/providers/shell/AppShellContext.js +1 -1
  49. package/dist/shared/providers/shell/AuthProvider.js +17 -17
  50. package/dist/shared/providers/shell/AuthTokenProvider.js +6 -6
  51. package/dist/shared/providers/shell/ContextManagerProvider.js +1 -1
  52. package/dist/shared/providers/shell/FeatureFlagsProvider.js +5 -5
  53. package/dist/shared/providers/shell/GlobalUiProvider.js +17 -17
  54. package/dist/shared/providers/shell/I18nProvider.js +15 -15
  55. package/dist/shared/providers/shell/PageConversationContextProvider.js +14 -14
  56. package/dist/shared/providers/shell/PermissionProvider.js +16 -16
  57. package/dist/shared/providers/shell/ShellUiProvider.js +13 -13
  58. package/dist/shared/providers/shell/ThemeProvider.js +9 -9
  59. package/dist/shared/tours/TourPlayer.js +1 -0
  60. package/dist/shared/tours/TourPlayerProvider.js +1 -1
  61. package/dist/shared/tours/TourTooltip.js +3 -0
  62. package/dist/shared/tours/TourTrigger.js +12 -9
  63. package/dist/shared/tours/ToursContext.js +11 -11
  64. package/dist/shared-events.js +3 -3
  65. package/dist/shared-hooks.js +1 -1
  66. package/dist/storage/SaveToFilesButton.js +3 -3
  67. package/dist/storage/SaveToFilesDialog.js +1 -1
  68. package/dist/tag/TagBadge.js +1 -1
  69. package/dist/tag/TagsWidget.js +6 -6
  70. package/dist/ui/card.js +44 -39
  71. package/dist/ui/dropdown-menu.js +82 -66
  72. package/dist/ui/input.js +10 -10
  73. package/dist/ui/label.js +13 -11
  74. package/dist/ui/select.js +80 -66
  75. package/dist/ui/table.js +61 -54
  76. package/dist/ui/textarea.js +9 -9
  77. package/dist/ui/tooltip.js +13 -11
  78. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { createContext as e, useContext as t } from "react";
1
+ import { createContext as e, use as t } from "react";
2
2
  import { jsx as n } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/AppShellContext.tsx
4
4
  var r = e({
@@ -4,7 +4,7 @@ import { PROFILE_STORAGE_CHANGE_EVENT as n, addProfile as r, getActiveProfileId
4
4
  import { clearShellSsoCookies as g, isSharedSsoCookieDomain as re, isTrustedSsoOrigin as _, readShellSsoCookie as v, setShellSsoCookies as ie } from "../../utils/authCookie.js";
5
5
  import { getAuthBridge as y, initAuthBridge as ae, isAuthBridgeInitialized as oe } from "./AuthBridgeClient.js";
6
6
  import { checkRemoteSLO as se, checkSLO as ce, clearLocalAuthState as b, hasRecentSSORedirectAttempt as x, markSSORedirectAttempt as S, shouldSkipSSORedirect as C } from "../../components/SSORedirectGuard.js";
7
- import { createContext as w, useCallback as T, useContext as E, useEffect as D, useMemo as le, useRef as ue, useState as O } from "react";
7
+ import { createContext as w, use as T, useCallback as E, useEffect as D, useMemo as le, useRef as ue, useState as O } from "react";
8
8
  import { jsx as de } from "react/jsx-runtime";
9
9
  //#region src/shared/providers/shell/AuthProvider.tsx
10
10
  var k = w(null);
@@ -79,7 +79,7 @@ function F(e) {
79
79
  return null;
80
80
  }
81
81
  }
82
- function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefreshToken: b, bridgeUrl: w, bridgeAllowedOrigins: E, bridgeDebug: j, onBridgeReady: M }) {
82
+ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefreshToken: b, bridgeUrl: w, bridgeAllowedOrigins: T, bridgeDebug: j, onBridgeReady: M }) {
83
83
  let P = ue(!1), [I, L] = O(() => u()), [R, z] = O(() => I ? o(I) : null), [B, V] = O(() => I ? a(I) : null), [H, U] = O(() => I ? s(I) : null), [W, G] = O(() => {
84
84
  if (I && o(I)) return !1;
85
85
  if (w) try {
@@ -94,7 +94,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
94
94
  avatar: e.avatar,
95
95
  isActive: e.id === I,
96
96
  lastLogin: e.lastLogin
97
- }))), Y = T(() => {
97
+ }))), Y = E(() => {
98
98
  let e = i();
99
99
  J(c().map((t) => ({
100
100
  id: t.id,
@@ -160,7 +160,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
160
160
  }, 5e3);
161
161
  return ae({
162
162
  bridgeUrl: w,
163
- allowedOrigins: E,
163
+ allowedOrigins: T,
164
164
  onStateChanged: t,
165
165
  debug: j ?? !1
166
166
  }), () => {
@@ -168,12 +168,12 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
168
168
  };
169
169
  }, [
170
170
  w,
171
- E,
171
+ T,
172
172
  j,
173
173
  M,
174
174
  Y
175
175
  ]);
176
- let ge = T((e, t, n) => {
176
+ let ge = E((e, t, n) => {
177
177
  let r = A(t) ?? Date.now() + 3600 * 1e3, i = {
178
178
  accessToken: t,
179
179
  refreshToken: n,
@@ -194,7 +194,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
194
194
  activeProfileId: a,
195
195
  profiles: c()
196
196
  });
197
- }, [Y]), X = T(() => {
197
+ }, [Y]), X = E(() => {
198
198
  I && l(I);
199
199
  let e = u();
200
200
  e ? (L(e), z(o(e)), V(a(e)), U(s(e))) : (L(null), z(null), V(null), U(null)), K(!1), q(null), Y();
@@ -204,7 +204,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
204
204
  P.current || y()?.notifyLogout();
205
205
  let t = N();
206
206
  t && !P.current && window.location.replace(t);
207
- }, [I, Y]), _e = T((e) => {
207
+ }, [I, Y]), _e = E((e) => {
208
208
  if (!R || !I) return;
209
209
  let t = {
210
210
  ...R,
@@ -221,7 +221,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
221
221
  R,
222
222
  I,
223
223
  Y
224
- ]), Z = T(async () => {
224
+ ]), Z = E(async () => {
225
225
  if (!(!B?.refreshToken || !b || !I)) {
226
226
  G(!0);
227
227
  try {
@@ -247,29 +247,29 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
247
247
  I,
248
248
  X,
249
249
  h
250
- ]), Q = T((e) => R?.permissions ? R.permissions.includes(e) || R.permissions.includes("*") : !1, [R]), ve = T((e) => {
250
+ ]), Q = E((e) => R?.permissions ? R.permissions.includes(e) || R.permissions.includes("*") : !1, [R]), ve = E((e) => {
251
251
  U(e), I && m(I, e);
252
- }, [I]), ye = T((e, t) => {
252
+ }, [I]), ye = E((e, t) => {
253
253
  K(e), q(t ?? null);
254
- }, []), be = T((e) => {
254
+ }, []), be = E((e) => {
255
255
  if (!ne(e)) {
256
256
  console.error(`Profile ${e} not found`);
257
257
  return;
258
258
  }
259
259
  L(e), z(o(e)), V(a(e)), U(s(e)), K(!1), q(null), Y(), P.current || y()?.notifyAccountSwitch(e);
260
- }, [Y]), xe = T((e, t, n) => {
260
+ }, [Y]), xe = E((e, t, n) => {
261
261
  ee(e, {
262
262
  accessToken: t,
263
263
  refreshToken: n,
264
264
  expiresAt: A(t) ?? Date.now() + 3600 * 1e3
265
265
  }), I && d(I), Y();
266
- }, [I, Y]), Se = T((e) => {
266
+ }, [I, Y]), Se = E((e) => {
267
267
  if (e === I) {
268
268
  console.error("Cannot remove active account — logout first");
269
269
  return;
270
270
  }
271
271
  l(e), Y();
272
- }, [I, Y]), Ce = T(() => {
272
+ }, [I, Y]), Ce = E(() => {
273
273
  te(), L(null), z(null), V(null), U(null), K(!1), q(null), J([]);
274
274
  try {
275
275
  g();
@@ -309,7 +309,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
309
309
  h,
310
310
  _
311
311
  ]);
312
- let we = T(() => {
312
+ let we = E(() => {
313
313
  let e = u();
314
314
  if (!e) {
315
315
  (R || B) && (z(null), V(null), U(null), L(null), J([]));
@@ -399,7 +399,7 @@ function I({ children: t, onTokenExpired: h, onSessionExpiringSoon: _, onRefresh
399
399
  });
400
400
  }
401
401
  function L() {
402
- let e = E(k);
402
+ let e = T(k);
403
403
  if (!e) throw Error("useAuth must be used within an AuthProvider");
404
404
  return e;
405
405
  }
@@ -1,7 +1,7 @@
1
1
  import { getProfileWorkspaceToken as e, resolveActiveProfileId as t } from "./ProfileStorageManager.js";
2
2
  import { readActiveContextValueWithUrlPrecedence as n } from "./ActiveContextStorage.js";
3
3
  import { isWorkspaceTokenValidForContext as r } from "../../graphql/workspaceToken.js";
4
- import { createContext as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
4
+ import { createContext as i, use as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
5
5
  import { jsx as d } from "react/jsx-runtime";
6
6
  //#region src/shared/providers/shell/AuthTokenProvider.tsx
7
7
  var f = "bf-p", p = "bf-active-profile", m = i(null);
@@ -62,13 +62,13 @@ function b() {
62
62
  };
63
63
  }
64
64
  function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r }) {
65
- let [i, o] = u(b), h = l(i.accessToken), g = l(i.workspaceToken);
65
+ let [i, a] = u(b), h = l(i.accessToken), g = l(i.workspaceToken);
66
66
  s(() => {
67
67
  h.current = i.accessToken, g.current = i.workspaceToken;
68
68
  }, [i.accessToken, i.workspaceToken]);
69
- let _ = a(() => {
69
+ let _ = o(() => {
70
70
  let e = b();
71
- o(e), t && console.log("[AuthTokenProvider] Reloaded from profile storage:", {
71
+ a(e), t && console.log("[AuthTokenProvider] Reloaded from profile storage:", {
72
72
  hasAccessToken: !!e.accessToken,
73
73
  hasWorkspaceToken: !!e.workspaceToken,
74
74
  userId: e.userId
@@ -93,7 +93,7 @@ function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r
93
93
  ]), s(() => {
94
94
  r?.(i.workspaceId);
95
95
  }, [i.workspaceId, r]);
96
- let v = a(() => h.current, []), y = a(() => g.current, []), x = a(() => g.current || h.current, []), S = c(() => ({
96
+ let v = o(() => h.current, []), y = o(() => g.current, []), x = o(() => g.current || h.current, []), S = c(() => ({
97
97
  accessToken: i.accessToken,
98
98
  workspaceToken: i.workspaceToken,
99
99
  workspaceId: i.workspaceId,
@@ -117,7 +117,7 @@ function x({ children: e, debug: t = !1, onTokenChange: n, onWorkspaceChange: r
117
117
  });
118
118
  }
119
119
  function S() {
120
- let e = o(m);
120
+ let e = a(m);
121
121
  if (!e) throw Error("useAuthToken must be used within AuthTokenProvider");
122
122
  return e;
123
123
  }
@@ -1,6 +1,6 @@
1
1
  import { useAuth as e } from "./AuthProvider.js";
2
2
  import { useActiveContext as t } from "./ActiveContextProvider.js";
3
- import { createContext as n, useContext as r, useMemo as i } from "react";
3
+ import { createContext as n, use as r, useMemo as i } from "react";
4
4
  import { jsx as a } from "react/jsx-runtime";
5
5
  //#region src/shared/providers/shell/ContextManagerProvider.tsx
6
6
  var o = n(null);
@@ -1,9 +1,9 @@
1
- import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/FeatureFlagsProvider.tsx
4
4
  var s = e(null);
5
- function c({ children: e, initialFlags: n = {}, fetchFlags: c, refreshInterval: l }) {
6
- let [u, d] = a(n), [f, p] = a(!1), m = t(async () => {
5
+ function c({ children: e, initialFlags: t = {}, fetchFlags: c, refreshInterval: l }) {
6
+ let [u, d] = a(t), [f, p] = a(!1), m = n(async () => {
7
7
  if (c) {
8
8
  p(!0);
9
9
  try {
@@ -14,7 +14,7 @@ function c({ children: e, initialFlags: n = {}, fetchFlags: c, refreshInterval:
14
14
  p(!1);
15
15
  }
16
16
  }
17
- }, [c]), h = t((e) => !!u[e], [u]), g = t((e, t) => {
17
+ }, [c]), h = n((e) => !!u[e], [u]), g = n((e, t) => {
18
18
  let n = u[e];
19
19
  return n === void 0 && t !== void 0 ? t : n;
20
20
  }, [u]);
@@ -50,7 +50,7 @@ function c({ children: e, initialFlags: n = {}, fetchFlags: c, refreshInterval:
50
50
  });
51
51
  }
52
52
  function l() {
53
- let e = n(s);
53
+ let e = t(s);
54
54
  if (!e) throw Error("useFeatureFlags must be used within a FeatureFlagsProvider");
55
55
  return e;
56
56
  }
@@ -1,21 +1,21 @@
1
- import { createContext as e, useCallback as t, useContext as n, useMemo as r, useState as i } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useMemo as r, useState as i } from "react";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/GlobalUiProvider.tsx
4
4
  var o = e(null);
5
- function s({ children: e, maxToasts: n = 5, defaultToastDuration: s = 5e3 }) {
6
- let [c, l] = i([]), [u, d] = i([]), [f, p] = i(!1), [m, h] = i(!1), g = t((e, t = "info", r = s) => {
5
+ function s({ children: e, maxToasts: t = 5, defaultToastDuration: s = 5e3 }) {
6
+ let [c, l] = i([]), [u, d] = i([]), [f, p] = i(!1), [m, h] = i(!1), g = n((e, n = "info", r = s) => {
7
7
  let i = `toast-${Date.now()}-${Math.random()}`, a = {
8
8
  id: i,
9
- type: t,
9
+ type: n,
10
10
  message: e,
11
11
  duration: r
12
12
  };
13
- l((e) => [...e, a].slice(-n)), r > 0 && setTimeout(() => {
13
+ l((e) => [...e, a].slice(-t)), r > 0 && setTimeout(() => {
14
14
  l((e) => e.filter((e) => e.id !== i));
15
15
  }, r);
16
- }, [n, s]), _ = t((e) => {
16
+ }, [t, s]), _ = n((e) => {
17
17
  l((t) => t.filter((t) => t.id !== e));
18
- }, []), v = t((e) => {
18
+ }, []), v = n((e) => {
19
19
  let t = {
20
20
  ...e,
21
21
  id: `notification-${Date.now()}-${Math.random()}`,
@@ -23,29 +23,29 @@ function s({ children: e, maxToasts: n = 5, defaultToastDuration: s = 5e3 }) {
23
23
  read: !1
24
24
  };
25
25
  d((e) => [t, ...e]);
26
- }, []), y = t((e) => {
26
+ }, []), y = n((e) => {
27
27
  d((t) => t.map((t) => t.id === e ? {
28
28
  ...t,
29
29
  read: !0
30
30
  } : t));
31
- }, []), b = t(() => {
31
+ }, []), b = n(() => {
32
32
  d((e) => e.map((e) => ({
33
33
  ...e,
34
34
  read: !0
35
35
  })));
36
- }, []), x = t(() => {
36
+ }, []), x = n(() => {
37
37
  d([]);
38
- }, []), S = t(() => {
38
+ }, []), S = n(() => {
39
39
  p(!0);
40
- }, []), C = t(() => {
40
+ }, []), C = n(() => {
41
41
  p(!1);
42
- }, []), w = t(() => {
42
+ }, []), w = n(() => {
43
43
  p((e) => !e);
44
- }, []), T = t(() => {
44
+ }, []), T = n(() => {
45
45
  h(!0);
46
- }, []), E = t(() => {
46
+ }, []), E = n(() => {
47
47
  h(!1);
48
- }, []), D = t(() => {
48
+ }, []), D = n(() => {
49
49
  h((e) => !e);
50
50
  }, []), O = r(() => u.filter((e) => !e.read).length, [u]), k = r(() => ({
51
51
  toasts: c,
@@ -91,7 +91,7 @@ function s({ children: e, maxToasts: n = 5, defaultToastDuration: s = 5e3 }) {
91
91
  });
92
92
  }
93
93
  function c() {
94
- let e = n(o);
94
+ let e = t(o);
95
95
  if (!e) throw Error("useGlobalUi must be used within a GlobalUiProvider");
96
96
  return e;
97
97
  }
@@ -1,4 +1,4 @@
1
- import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
2
  import { Fragment as s, jsx as c } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/I18nProvider.tsx
4
4
  var l = e(null), u = {
@@ -51,15 +51,15 @@ function h(e, t) {
51
51
  }
52
52
  return n;
53
53
  }
54
- function g({ children: e, defaultLocale: n = "en", translations: m = u, storageKey: g = "burdenoff-locale", profileId: _, fetchTranslations: v, showChildrenWhileLoading: y = !0, loadingComponent: b }) {
55
- let [x, S] = o(() => f(_, g, n)), [C, w] = o({}), [T, E] = o(!!v), [D, O] = o(null), k = a(/* @__PURE__ */ new Set()), A = a(d.version), j = i(() => {
54
+ function g({ children: e, defaultLocale: t = "en", translations: m = u, storageKey: g = "burdenoff-locale", profileId: _, fetchTranslations: v, showChildrenWhileLoading: y = !0, loadingComponent: b }) {
55
+ let [x, S] = o(() => f(_, g, t)), [C, w] = o({}), [T, E] = o(!!v), [D, O] = o(null), k = a(/* @__PURE__ */ new Set()), A = a(d.version), j = i(() => {
56
56
  let e = { ...m };
57
57
  for (let [t, n] of Object.entries(C)) if (n && Object.keys(n).length > 0) {
58
58
  let r = t;
59
59
  e[r] = h(m[r], n);
60
60
  }
61
61
  return e;
62
- }, [m, C]), M = t(async (e) => {
62
+ }, [m, C]), M = n(async (e) => {
63
63
  if (v) {
64
64
  if (A.current !== d.version && (k.current.clear(), A.current = d.version), d.attempted.has(e)) {
65
65
  let t = d.translations[e];
@@ -92,28 +92,28 @@ function g({ children: e, defaultLocale: n = "en", translations: m = u, storageK
92
92
  x,
93
93
  M
94
94
  ]), r(() => {
95
- let e = f(_, g, n);
95
+ let e = f(_, g, t);
96
96
  S(e), document.documentElement.setAttribute("lang", e);
97
97
  }, [
98
98
  _,
99
99
  g,
100
- n
100
+ t
101
101
  ]);
102
- let N = t((e) => {
102
+ let N = n((e) => {
103
103
  S(e), localStorage.setItem(g, e), _ && localStorage.setItem(`bf-p-${_}-locale`, e), document.documentElement.setAttribute("lang", e);
104
- }, [g, _]), P = t((e, t, r) => {
104
+ }, [g, _]), P = n((e, n, r) => {
105
105
  let i, a;
106
- if (typeof t == "string") i = t, a = r;
107
- else if (t && typeof t == "object") {
108
- let { defaultValue: e, ...n } = t;
109
- typeof e == "string" ? i = e : typeof e == "number" && (i = String(e)), a = n;
106
+ if (typeof n == "string") i = n, a = r;
107
+ else if (n && typeof n == "object") {
108
+ let { defaultValue: e, ...t } = n;
109
+ typeof e == "string" ? i = e : typeof e == "number" && (i = String(e)), a = t;
110
110
  }
111
- let o = p(j[x], e) ?? (x === n ? void 0 : p(j[n], e)) ?? (n === "en" ? void 0 : p(j.en, e)) ?? i ?? e;
111
+ let o = p(j[x], e) ?? (x === t ? void 0 : p(j[t], e)) ?? (t === "en" ? void 0 : p(j.en, e)) ?? i ?? e;
112
112
  return a ? Object.entries(a).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), o) : o;
113
113
  }, [
114
114
  x,
115
115
  j,
116
- n
116
+ t
117
117
  ]), F = i(() => ({
118
118
  locale: x,
119
119
  translations: j[x] || {},
@@ -135,7 +135,7 @@ function g({ children: e, defaultLocale: n = "en", translations: m = u, storageK
135
135
  });
136
136
  }
137
137
  function _() {
138
- let e = n(l);
138
+ let e = t(l);
139
139
  if (!e) throw Error("useI18n must be used within an I18nProvider");
140
140
  return e;
141
141
  }
@@ -1,4 +1,4 @@
1
- import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  import { useLocation as s } from "react-router-dom";
4
4
  //#region src/shared/providers/shell/PageConversationContextProvider.tsx
@@ -7,7 +7,7 @@ function l(e) {
7
7
  let t = e.split("/").filter(Boolean).map((e) => e.replace(/[-_]+/g, " "));
8
8
  return t.length === 0 ? "Home" : t.map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" · ");
9
9
  }
10
- function u({ children: e, product: n, resolveContext: u }) {
10
+ function u({ children: e, product: t, resolveContext: u }) {
11
11
  let d = s(), [f, p] = a(null);
12
12
  r(() => {
13
13
  p(null);
@@ -17,11 +17,11 @@ function u({ children: e, product: n, resolveContext: u }) {
17
17
  d.hash
18
18
  ]);
19
19
  let m = i(() => {
20
- let e = typeof document < "u" && document.title.trim().length > 0 ? document.title : l(d.pathname), t = typeof window < "u" ? `${window.location.origin}${d.pathname}${d.search}${d.hash}` : `${d.pathname}${d.search}${d.hash}`, r = u?.(d) ?? null;
20
+ let e = typeof document < "u" && document.title.trim().length > 0 ? document.title : l(d.pathname), n = typeof window < "u" ? `${window.location.origin}${d.pathname}${d.search}${d.hash}` : `${d.pathname}${d.search}${d.hash}`, r = u?.(d) ?? null;
21
21
  return {
22
- product: n,
22
+ product: t,
23
23
  pagePath: `${d.pathname}${d.search}${d.hash}`,
24
- contextHref: t,
24
+ contextHref: n,
25
25
  contextTitle: e,
26
26
  widgetKey: "default",
27
27
  ...r ?? {},
@@ -29,7 +29,7 @@ function u({ children: e, product: n, resolveContext: u }) {
29
29
  };
30
30
  }, [
31
31
  d,
32
- n,
32
+ t,
33
33
  u
34
34
  ]), h = i(() => ({
35
35
  ...m,
@@ -38,9 +38,9 @@ function u({ children: e, product: n, resolveContext: u }) {
38
38
  ...m.metadata ?? {},
39
39
  ...f?.metadata ?? {}
40
40
  }
41
- }), [m, f]), g = t((e) => {
41
+ }), [m, f]), g = n((e) => {
42
42
  p(e);
43
- }, []), _ = t(() => {
43
+ }, []), _ = n(() => {
44
44
  p(null);
45
45
  }, []);
46
46
  return /* @__PURE__ */ o(c.Provider, {
@@ -53,16 +53,16 @@ function u({ children: e, product: n, resolveContext: u }) {
53
53
  });
54
54
  }
55
55
  function d() {
56
- let e = n(c);
56
+ let e = t(c);
57
57
  if (!e) throw Error("usePageConversationContext must be used within PageConversationContextProvider");
58
58
  return e.context;
59
59
  }
60
60
  function f(e) {
61
- let t = n(c);
62
- if (!t) throw Error("useRegisterPageConversationContext must be used within PageConversationContextProvider");
63
- r(() => (t.setOverride(e ?? null), () => {
64
- t.clearOverride();
65
- }), [t, e]);
61
+ let n = t(c);
62
+ if (!n) throw Error("useRegisterPageConversationContext must be used within PageConversationContextProvider");
63
+ r(() => (n.setOverride(e ?? null), () => {
64
+ n.clearOverride();
65
+ }), [n, e]);
66
66
  }
67
67
  //#endregion
68
68
  export { u as PageConversationContextProvider, d as usePageConversationContext, f as useRegisterPageConversationContext };
@@ -1,6 +1,6 @@
1
1
  import { graphqlFetch as e } from "../../graphql/fetch.js";
2
2
  import { useAuth as t } from "./AuthProvider.js";
3
- import { createContext as n, useCallback as r, useContext as i, useEffect as a, useMemo as o } from "react";
3
+ import { createContext as n, use as r, useCallback as i, useEffect as a, useMemo as o } from "react";
4
4
  import { jsx as s } from "react/jsx-runtime";
5
5
  import { useQuery as c, useQueryClient as l } from "@tanstack/react-query";
6
6
  //#region src/shared/providers/shell/PermissionProvider.tsx
@@ -41,22 +41,22 @@ function g(e) {
41
41
  let t = e;
42
42
  return typeof t.actorType == "string" ? t.actorType : typeof t.actor_type == "string" ? t.actor_type : null;
43
43
  }
44
- function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 300 * 1e3, refetchInterval: v = 300 * 1e3, refetchOnFocusStaleTime: y = 120 * 1e3, debug: b = !1 }) {
44
+ function _({ children: n, scopeId: r, gateway: p = "workspace", staleTime: _ = 300 * 1e3, refetchInterval: v = 300 * 1e3, refetchOnFocusStaleTime: y = 120 * 1e3, debug: b = !1 }) {
45
45
  let { isAuthenticated: x, tokens: S, workspaceToken: C, user: w } = t(), T = l(), E = h(x, w?.role, g(w)), D = p === "workspace" ? C ? C.slice(-16) : "missing" : "n/a", O = o(() => [
46
46
  "permissions",
47
47
  p,
48
- i,
48
+ r,
49
49
  D
50
50
  ], [
51
51
  p,
52
- i,
52
+ r,
53
53
  D
54
- ]), k = r(async () => {
55
- if (!i) throw Error("scopeId is required for permission fetching");
56
- b && console.log("[PermissionProvider] Fetching permissions for scope:", i);
54
+ ]), k = i(async () => {
55
+ if (!r) throw Error("scopeId is required for permission fetching");
56
+ b && console.log("[PermissionProvider] Fetching permissions for scope:", r);
57
57
  let t = await e({
58
58
  query: d,
59
- variables: { scopeId: i },
59
+ variables: { scopeId: r },
60
60
  gateway: p
61
61
  });
62
62
  if (t.errors?.length) throw Error(t.errors[0].message);
@@ -64,10 +64,10 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
64
64
  let n = f(t.data.myPermissions);
65
65
  return b && console.log("[PermissionProvider] Received permissions:", n), n;
66
66
  }, [
67
- i,
67
+ r,
68
68
  p,
69
69
  b
70
- ]), A = !E && x && !!i && !!S?.accessToken, j = c({
70
+ ]), A = !E && x && !!r && !!S?.accessToken, j = c({
71
71
  queryKey: O,
72
72
  queryFn: k,
73
73
  enabled: A,
@@ -98,12 +98,12 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
98
98
  A,
99
99
  F
100
100
  ]);
101
- let I = A ? M ?? null : null, L = r((e) => E ? !0 : I?.permissionStrings ? m(I.permissionStrings, e) : !1, [I?.permissionStrings, E]), R = r((e, t) => {
101
+ let I = A ? M ?? null : null, L = i((e) => E ? !0 : I?.permissionStrings ? m(I.permissionStrings, e) : !1, [I?.permissionStrings, E]), R = i((e, t) => {
102
102
  if (E) return !0;
103
103
  if (!I?.permissionStrings) return !1;
104
104
  let { requireAll: n = !1 } = t ?? {};
105
105
  return n ? e.every((e) => m(I.permissionStrings, e)) : e.some((e) => m(I.permissionStrings, e));
106
- }, [I?.permissionStrings, E]), z = r((e) => E ? !0 : I?.roles ? I.roles.includes(e) : !1, [I?.roles, E]), B = r((e) => E ? !0 : I?.roles ? e.some((e) => I.roles.includes(e)) : !1, [I?.roles, E]), V = r((e) => E ? !0 : I?.roles ? e.every((e) => I.roles.includes(e)) : !1, [I?.roles, E]), H = r(async () => {
106
+ }, [I?.permissionStrings, E]), z = i((e) => E ? !0 : I?.roles ? I.roles.includes(e) : !1, [I?.roles, E]), B = i((e) => E ? !0 : I?.roles ? e.some((e) => I.roles.includes(e)) : !1, [I?.roles, E]), V = i((e) => E ? !0 : I?.roles ? e.every((e) => I.roles.includes(e)) : !1, [I?.roles, E]), H = i(async () => {
107
107
  if (!A) {
108
108
  b && console.log("[PermissionProvider] Skipping manual refresh — workspace token not available");
109
109
  return;
@@ -113,7 +113,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
113
113
  F,
114
114
  b,
115
115
  A
116
- ]), U = r(async () => {
116
+ ]), U = i(async () => {
117
117
  b && console.log("[PermissionProvider] Invalidating permissions cache"), await T.invalidateQueries({ queryKey: O });
118
118
  }, [
119
119
  T,
@@ -130,7 +130,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
130
130
  hasAllRoles: V,
131
131
  refreshPermissions: H,
132
132
  invalidatePermissions: U,
133
- scopeId: i,
133
+ scopeId: r,
134
134
  query: j
135
135
  }), [
136
136
  I,
@@ -145,7 +145,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
145
145
  V,
146
146
  H,
147
147
  U,
148
- i
148
+ r
149
149
  ]);
150
150
  return /* @__PURE__ */ s(u.Provider, {
151
151
  value: W,
@@ -153,7 +153,7 @@ function _({ children: n, scopeId: i, gateway: p = "workspace", staleTime: _ = 3
153
153
  });
154
154
  }
155
155
  function v() {
156
- let e = i(u);
156
+ let e = r(u);
157
157
  if (!e) throw Error("usePermissions must be used within a PermissionProvider");
158
158
  return e;
159
159
  }
@@ -1,35 +1,35 @@
1
- import { createContext as e, useCallback as t, useContext as n, useMemo as r, useState as i } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useMemo as r, useState as i } from "react";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/ShellUiProvider.tsx
4
4
  var o = e(null);
5
- function s({ children: e, defaultSidebarCollapsed: n = !1, defaultSidebarOpen: s = !0, defaultHeaderVisible: c = !0, defaultFooterVisible: l = !0, defaultSidebarVisible: u = !0, storageKey: d = "burdenoff-shell-ui" }) {
5
+ function s({ children: e, defaultSidebarCollapsed: t = !1, defaultSidebarOpen: s = !0, defaultHeaderVisible: c = !0, defaultFooterVisible: l = !0, defaultSidebarVisible: u = !0, storageKey: d = "burdenoff-shell-ui" }) {
6
6
  let [f, p] = i(() => {
7
- if (typeof window > "u") return n;
7
+ if (typeof window > "u") return t;
8
8
  let e = localStorage.getItem(`${d}-sidebar-collapsed`);
9
- return e ? e === "true" : n;
9
+ return e ? e === "true" : t;
10
10
  }), [m, h] = i(() => {
11
11
  if (typeof window > "u") return s;
12
12
  let e = localStorage.getItem(`${d}-sidebar-open`);
13
13
  return e ? e === "true" : s;
14
- }), [g, _] = i(c), [v, y] = i(l), [b, x] = i(u), [S, C] = i([]), [w, T] = i(!1), E = t((e) => {
14
+ }), [g, _] = i(c), [v, y] = i(l), [b, x] = i(u), [S, C] = i([]), [w, T] = i(!1), E = n((e) => {
15
15
  p(e), localStorage.setItem(`${d}-sidebar-collapsed`, String(e));
16
- }, [d]), D = t(() => {
16
+ }, [d]), D = n(() => {
17
17
  p((e) => {
18
18
  let t = !e;
19
19
  return localStorage.setItem(`${d}-sidebar-collapsed`, String(t)), t;
20
20
  });
21
- }, [d]), O = t((e) => {
21
+ }, [d]), O = n((e) => {
22
22
  h(e), localStorage.setItem(`${d}-sidebar-open`, String(e));
23
- }, [d]), k = t(() => {
23
+ }, [d]), k = n(() => {
24
24
  h((e) => {
25
25
  let t = !e;
26
26
  return localStorage.setItem(`${d}-sidebar-open`, String(t)), t;
27
27
  });
28
- }, [d]), A = t((e) => {
28
+ }, [d]), A = n((e) => {
29
29
  C(e);
30
- }, []), j = t((e) => {
30
+ }, []), j = n((e) => {
31
31
  C((t) => [...t, e]);
32
- }, []), M = t(() => {
32
+ }, []), M = n(() => {
33
33
  C([]);
34
34
  }, []), N = r(() => ({
35
35
  isSidebarCollapsed: f,
@@ -78,12 +78,12 @@ function s({ children: e, defaultSidebarCollapsed: n = !1, defaultSidebarOpen: s
78
78
  });
79
79
  }
80
80
  function c() {
81
- let e = n(o);
81
+ let e = t(o);
82
82
  if (!e) throw Error("useShellUi must be used within a ShellUiProvider");
83
83
  return e;
84
84
  }
85
85
  function l() {
86
- return n(o);
86
+ return t(o);
87
87
  }
88
88
  //#endregion
89
89
  export { s as ShellUiProvider, l as useSafeShellUi, c as useShellUi };
@@ -1,9 +1,9 @@
1
- import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useState as a } from "react";
1
+ import { createContext as e, use as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  //#region src/shared/providers/shell/ThemeProvider.tsx
4
4
  var s = e(null);
5
- function c({ children: e, defaultMode: n = "system", defaultBrand: c = "default", defaultDensity: l = "comfortable", defaultTypography: u = "default", storageKey: d = "burdenoff-theme" }) {
6
- let [f, p] = a(() => typeof window > "u" ? n : localStorage.getItem(`${d}-mode`) || n), [m, h] = a(() => typeof window > "u" ? c : localStorage.getItem(`${d}-brand`) || c), [g, _] = a(() => typeof window > "u" ? l : localStorage.getItem(`${d}-density`) || l), [v, y] = a(() => typeof window > "u" ? u : localStorage.getItem(`${d}-typography`) || u), [b, x] = a(() => f === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f);
5
+ function c({ children: e, defaultMode: t = "system", defaultBrand: c = "default", defaultDensity: l = "comfortable", defaultTypography: u = "default", storageKey: d = "burdenoff-theme" }) {
6
+ let [f, p] = a(() => typeof window > "u" ? t : localStorage.getItem(`${d}-mode`) || t), [m, h] = a(() => typeof window > "u" ? c : localStorage.getItem(`${d}-brand`) || c), [g, _] = a(() => typeof window > "u" ? l : localStorage.getItem(`${d}-density`) || l), [v, y] = a(() => typeof window > "u" ? u : localStorage.getItem(`${d}-typography`) || u), [b, x] = a(() => f === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f);
7
7
  r(() => {
8
8
  if (f === "system") {
9
9
  let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => {
@@ -20,15 +20,15 @@ function c({ children: e, defaultMode: n = "system", defaultBrand: c = "default"
20
20
  g,
21
21
  v
22
22
  ]);
23
- let S = t((e) => {
23
+ let S = n((e) => {
24
24
  p(e), localStorage.setItem(`${d}-mode`, e);
25
- }, [d]), C = t((e) => {
25
+ }, [d]), C = n((e) => {
26
26
  h(e), localStorage.setItem(`${d}-brand`, e);
27
- }, [d]), w = t((e) => {
27
+ }, [d]), w = n((e) => {
28
28
  _(e), localStorage.setItem(`${d}-density`, e);
29
- }, [d]), T = t((e) => {
29
+ }, [d]), T = n((e) => {
30
30
  y(e), localStorage.setItem(`${d}-typography`, e);
31
- }, [d]), E = t(() => {
31
+ }, [d]), E = n(() => {
32
32
  S(b === "light" ? "dark" : "light");
33
33
  }, [b, S]), D = i(() => ({
34
34
  mode: f,
@@ -60,7 +60,7 @@ function c({ children: e, defaultMode: n = "system", defaultBrand: c = "default"
60
60
  });
61
61
  }
62
62
  function l() {
63
- let e = n(s);
63
+ let e = t(s);
64
64
  if (!e) throw Error("useTheme must be used within a ThemeProvider");
65
65
  return e;
66
66
  }
@@ -46,6 +46,7 @@ function a() {
46
46
  function o({ tour: e, children: t, className: n, style: i }) {
47
47
  let o = a();
48
48
  return /* @__PURE__ */ r("button", {
49
+ type: "button",
49
50
  onClick: () => o(e),
50
51
  className: n,
51
52
  style: i,