@declarion/react 0.180.0 → 0.185.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.
@@ -50,19 +50,36 @@ async function l(t) {
50
50
  async function u(t) {
51
51
  await e("agents.cancel_conversation", { conversation_id: t });
52
52
  }
53
- async function d() {
54
- let e = await t("agent_conversation", {
53
+ function d(e) {
54
+ return (e.data ?? []).map((t) => {
55
+ let n = t.agent_id ? e.$refs?.agent?.[t.agent_id] : void 0;
56
+ return {
57
+ ...t,
58
+ agent: n?.code,
59
+ agent_name: n?.name
60
+ };
61
+ });
62
+ }
63
+ async function f(e = 1) {
64
+ return d(await t("agent_conversation", {
55
65
  sort: "updated_at:desc",
56
- page: 1,
66
+ page: e,
57
67
  per_page: 50
58
- });
59
- return (e.data ?? []).map((t) => ({
60
- ...t,
61
- agent: t.agent_id ? e.$refs?.agent?.[t.agent_id]?.code : void 0
62
68
  }));
63
69
  }
64
- async function f(e) {
65
- return h("agent_turn", {
70
+ async function p(e) {
71
+ return d(await t("agent_conversation", {
72
+ filters: [{
73
+ field: "id",
74
+ op: "eq",
75
+ value: e
76
+ }],
77
+ page: 1,
78
+ per_page: 1
79
+ }))[0];
80
+ }
81
+ async function m(e) {
82
+ return _("agent_turn", {
66
83
  filters: [{
67
84
  field: "conversation_id",
68
85
  op: "eq",
@@ -71,8 +88,8 @@ async function f(e) {
71
88
  sort: "runnable_message_seq:asc"
72
89
  });
73
90
  }
74
- async function p(e) {
75
- return h("agent_tool_invocation", {
91
+ async function h(e) {
92
+ return _("agent_tool_invocation", {
76
93
  filters: [{
77
94
  field: "conversation_id",
78
95
  op: "eq",
@@ -81,7 +98,7 @@ async function p(e) {
81
98
  sort: "created_at:asc"
82
99
  });
83
100
  }
84
- async function m(e) {
101
+ async function g(e) {
85
102
  let n = [];
86
103
  for (let r = 1;; r += 1) {
87
104
  let i = await t("agent_message", {
@@ -102,7 +119,7 @@ async function m(e) {
102
119
  if (a.length === 0) throw Error("agent_message pagination did not advance");
103
120
  }
104
121
  }
105
- async function h(e, n) {
122
+ async function _(e, n) {
106
123
  let r = [];
107
124
  for (let i = 1;; i += 1) {
108
125
  let a = await t(e, {
@@ -114,4 +131,4 @@ async function h(e, n) {
114
131
  if (o.length === 0) throw Error(`${e} pagination did not advance`);
115
132
  }
116
133
  }
117
- export { a as answerQuestion, s as approveInvocation, u as cancelConversation, l as cancelInvocation, r as createConversation, n as listAvailableAgents, d as listConversations, p as loadConversationInvocations, f as loadConversationTurns, m as loadHistory, c as rejectInvocation, o as sendElicitResponse, i as sendMessage };
134
+ export { a as answerQuestion, s as approveInvocation, u as cancelConversation, l as cancelInvocation, r as createConversation, n as listAvailableAgents, f as listConversations, p as loadConversation, h as loadConversationInvocations, m as loadConversationTurns, g as loadHistory, c as rejectInvocation, o as sendElicitResponse, i as sendMessage };
@@ -1,6 +1,6 @@
1
1
  // src/api/audience.ts
2
2
  function e(e) {
3
- if (!e.isLoading) return !e.isAuthenticated || !e.user ? null : {
3
+ if (!e.isLoading || e.signedOutPresumed) return !e.isAuthenticated || !e.user ? null : {
4
4
  user_id: e.user.id,
5
5
  tenant_id: e.activeTenant?.id ?? ""
6
6
  };
@@ -31,7 +31,7 @@ function x(e) {
31
31
  async function S() {
32
32
  let e = navigator.locks;
33
33
  if (!e) {
34
- await F();
34
+ await P();
35
35
  return;
36
36
  }
37
37
  let t = Date.now();
@@ -43,7 +43,7 @@ async function S() {
43
43
  } else try {
44
44
  b({
45
45
  ok: !0,
46
- access_expires_at: await F()
46
+ access_expires_at: await P()
47
47
  });
48
48
  } catch (e) {
49
49
  throw e instanceof C && b({
@@ -65,27 +65,27 @@ function T() {
65
65
  }), w;
66
66
  }
67
67
  function E(e) {
68
- return O || (I = null, l() || p(e), typeof window > "u") ? Promise.resolve() : T().then((t) => t.scheduleRenewal(e), () => void 0);
68
+ return O || (F = null, l() || p(e), typeof window > "u") ? Promise.resolve() : T().then((t) => t.scheduleRenewal(e), () => void 0);
69
69
  }
70
70
  function D() {
71
71
  f(), w?.then((e) => e.cancelRenewal());
72
72
  }
73
73
  var O = !1;
74
- function k() {
74
+ function ee() {
75
75
  O = !0, D();
76
76
  }
77
- function A() {
77
+ function k() {
78
78
  return O;
79
79
  }
80
- function j(e) {
81
- return O = !1, E(e);
80
+ function A(e) {
81
+ return O = !1, I += 1, E(e);
82
82
  }
83
83
  typeof window < "u" && window.addEventListener("storage", (e) => {
84
84
  if (e.key !== _ || l()) return;
85
85
  let t = y(() => e.newValue);
86
86
  t?.ok && t.access_expires_at && E(t.access_expires_at);
87
87
  });
88
- async function M(e, n, r) {
88
+ async function j(e, n, r) {
89
89
  let i = new AbortController(), a = setTimeout(() => i.abort(), r);
90
90
  try {
91
91
  return await fetch(e, {
@@ -98,47 +98,49 @@ async function M(e, n, r) {
98
98
  clearTimeout(a);
99
99
  }
100
100
  }
101
- async function N(e) {
101
+ async function M(e) {
102
102
  try {
103
103
  return (await e.json())?.result?.expires_at;
104
104
  } catch {
105
105
  return;
106
106
  }
107
107
  }
108
- function P() {
109
- return M("/api/actions/auth.refresh", {
108
+ function N() {
109
+ return j("/api/actions/auth.refresh", {
110
110
  method: "POST",
111
111
  credentials: "include",
112
112
  headers: { "Content-Type": "application/json" },
113
113
  body: h({})
114
114
  }, u);
115
115
  }
116
- async function F() {
117
- let t = await P();
116
+ async function P() {
117
+ let t = await N();
118
118
  if (t.status === 429) {
119
119
  let e = parseInt(t.headers.get("Retry-After") || "1", 10);
120
- await r(t), await new Promise((t) => setTimeout(t, e * 1e3)), t = await P();
120
+ await r(t), await new Promise((t) => setTimeout(t, e * 1e3)), t = await N();
121
121
  }
122
122
  if (t.status >= 500) {
123
123
  let n = await r(t);
124
124
  throw new e(t.status, n.body, n.raw);
125
125
  }
126
126
  if (!t.ok) throw await r(t), new C(t.status);
127
- let n = await N(t);
127
+ let n = await M(t);
128
128
  return E(n), n;
129
129
  }
130
- var I = null, L = /* @__PURE__ */ new Set(["auth.token_refresh_needed", "auth.unauthorized"]);
130
+ var F = null, I = 0, L = /* @__PURE__ */ new Set(["auth.token_refresh_needed", "auth.unauthorized"]);
131
131
  function R(n) {
132
132
  return n instanceof t || n instanceof e;
133
133
  }
134
134
  async function z() {
135
135
  if (O) throw new C(401);
136
- if (I !== null) throw new C(I);
137
- return g || (g = S().catch((e) => {
138
- throw e instanceof C && (I = e.status), e;
136
+ if (F !== null) throw new C(F);
137
+ if (g) return g;
138
+ let e = I;
139
+ return g = S().catch((t) => {
140
+ throw t instanceof C && e === I && (F = t.status), t;
139
141
  }).finally(() => {
140
142
  g = null;
141
- }), g);
143
+ }), g;
142
144
  }
143
145
  var B = () => {
144
146
  if (typeof window > "u") return;
@@ -169,7 +171,7 @@ function J(e, t) {
169
171
  reader: e
170
172
  } : null);
171
173
  }
172
- function ee(e) {
174
+ function te(e) {
173
175
  G = e ? {
174
176
  language: e,
175
177
  reader: K ?? null
@@ -183,58 +185,58 @@ function X(e) {
183
185
  return !t || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(t)}`;
184
186
  }
185
187
  async function Z(t, i, u, f) {
186
- let p = X(t), m = l(), h = m ? "omit" : i.credentials ?? "include", g = m || h !== "omit", _ = W(i.headers, !!i.body, u, m ? c() : null), v = d(t, i), y = await M(p, {
188
+ let p = X(t), m = l(), h = m ? "omit" : i.credentials ?? "include", g = m || h !== "omit", _ = W(i.headers, !!i.body, u, m ? c() : null), v = d(t, i), y = I, b = await j(p, {
187
189
  ...i,
188
190
  headers: _,
189
191
  credentials: h
190
192
  }, v);
191
- if (a(y.headers), !y.ok) {
192
- let { raw: t, body: a } = await r(y), c = n(a.type), l = a.title ?? "";
193
- if (g && y.status === 401 && L.has(c)) try {
193
+ if (a(b.headers), !b.ok) {
194
+ let { raw: t, body: a } = await r(b), c = n(a.type), l = a.title ?? "";
195
+ if (g && b.status === 401 && L.has(c)) try {
194
196
  let t = null;
195
197
  m ? (s(), t = await o()) : await z();
196
- let a = W(i.headers, !!i.body, u, t), c = await M(p, {
198
+ let a = W(i.headers, !!i.body, u, t), c = await j(p, {
197
199
  ...i,
198
200
  headers: a,
199
201
  credentials: h
200
202
  }, v);
201
203
  if (!c.ok) {
202
204
  let t = await r(c);
203
- throw !m && c.status === 401 && L.has(n(t.body.type)) && (I = 401), c.status === 401 && !u.isSessionProbe && B(), new e(c.status, t.body, t.raw);
205
+ throw !m && y === I && c.status === 401 && L.has(n(t.body.type)) && (F = 401), c.status === 401 && !u.isSessionProbe && B(), new e(c.status, t.body, t.raw);
204
206
  }
205
207
  return f(c);
206
208
  } catch (n) {
207
209
  throw R(n) ? n : (u.isSessionProbe || B(), new e(401, a, t));
208
210
  }
209
- throw g && y.status === 401 && !u.isSessionProbe && B(), U({
210
- status: y.status,
211
+ throw g && b.status === 401 && !u.isSessionProbe && B(), U({
212
+ status: b.status,
211
213
  code: c,
212
214
  message: l
213
- }), new e(y.status, a, t);
215
+ }), new e(b.status, a, t);
214
216
  }
215
- return f(y);
217
+ return f(b);
216
218
  }
217
219
  function Q(e) {
218
220
  return e.status === 204 ? Promise.resolve(void 0) : e.json();
219
221
  }
220
- async function te(e, t = {}, { isSessionProbe: n = !1 } = {}) {
222
+ async function ne(e, t = {}, { isSessionProbe: n = !1 } = {}) {
221
223
  return Z(e, t, {
222
224
  setAccept: !1,
223
225
  isSessionProbe: n
224
226
  }, Q);
225
227
  }
226
- async function ne(e) {
228
+ async function re(e) {
227
229
  return {
228
230
  blob: await e.blob(),
229
231
  filename: $(e.headers),
230
232
  headers: e.headers
231
233
  };
232
234
  }
233
- async function re(e, t = {}) {
235
+ async function ie(e, t = {}) {
234
236
  return Z(e, t, {
235
237
  setAccept: !0,
236
238
  isSessionProbe: !1
237
- }, ne);
239
+ }, re);
238
240
  }
239
241
  function $(e) {
240
242
  let t = e.get("Content-Disposition");
@@ -246,7 +248,7 @@ function $(e) {
246
248
  let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
247
249
  return r ? (r[2] ?? r[3] ?? "").trim() : "";
248
250
  }
249
- async function ie(e, t = {}, { isSessionProbe: n = !1, keepalive: r = !1, credentials: i } = {}) {
251
+ async function ae(e, t = {}, { isSessionProbe: n = !1, keepalive: r = !1, credentials: i } = {}) {
250
252
  return (await Z(`/api/actions/${encodeURIComponent(e)}`, {
251
253
  method: "POST",
252
254
  body: h(t),
@@ -257,4 +259,4 @@ async function ie(e, t = {}, { isSessionProbe: n = !1, keepalive: r = !1, creden
257
259
  isSessionProbe: n
258
260
  }, Q)).result;
259
261
  }
260
- export { C as RefreshDeadError, te as apiFetch, re as apiFetchBlob, j as beginSessionInPage, ie as callHandler, D as cancelProactiveRefresh, Y as currentPublishedLanguage, k as endSessionInPage, z as ensureRefresh, H as getPersistentAuthFailureHandler, A as isSignedOutInPage, R as isTransientFailure, $ as parseContentDispositionFilename, ee as publishLanguage, J as publishLanguageFor, E as scheduleProactiveRefresh, q as setLanguageReader, V as setPersistentAuthFailureHandler, X as withPublishedLanguage };
262
+ export { C as RefreshDeadError, ne as apiFetch, ie as apiFetchBlob, A as beginSessionInPage, ae as callHandler, D as cancelProactiveRefresh, Y as currentPublishedLanguage, ee as endSessionInPage, z as ensureRefresh, H as getPersistentAuthFailureHandler, k as isSignedOutInPage, R as isTransientFailure, $ as parseContentDispositionFilename, te as publishLanguage, J as publishLanguageFor, E as scheduleProactiveRefresh, q as setLanguageReader, V as setPersistentAuthFailureHandler, X as withPublishedLanguage };
package/dist-lib/app.js CHANGED
@@ -3,16 +3,16 @@ import { Layout as t } from "./components/layout/Layout.js";
3
3
  import { SignIn as n } from "./components/pages/auth/SignIn.js";
4
4
  import { SignUp as r } from "./components/pages/auth/SignUp.js";
5
5
  import { Forgot as i } from "./components/pages/auth/Forgot.js";
6
- import { Reset as ee } from "./components/pages/auth/Reset.js";
7
- import { TwoFA as a } from "./components/pages/auth/TwoFA.js";
8
- import { OAuthConsent as te } from "./components/pages/auth/OAuthConsent.js";
9
- import { SSOCallbackPage as ne } from "./components/pages/SSOCallbackPage.js";
10
- import { SSO_RETURN_PATH as re } from "./api/access-expiry.js";
11
- import { NotFoundPage as o } from "./components/pages/NotFoundPage.js";
12
- import { NoScreensPage as s } from "./components/pages/NoScreensPage.js";
13
- import { Profile as c } from "./components/pages/profile/Profile.js";
14
- import { TenantParamsPage as l } from "./components/pages/tenant-params/TenantParamsPage.js";
15
- import { Preferences as u } from "./components/pages/profile/Preferences.js";
6
+ import { Reset as a } from "./components/pages/auth/Reset.js";
7
+ import { TwoFA as o } from "./components/pages/auth/TwoFA.js";
8
+ import { OAuthConsent as ee } from "./components/pages/auth/OAuthConsent.js";
9
+ import { SSOCallbackPage as te } from "./components/pages/SSOCallbackPage.js";
10
+ import { SSO_RETURN_PATH as ne } from "./api/access-expiry.js";
11
+ import { NotFoundPage as s } from "./components/pages/NotFoundPage.js";
12
+ import { NoScreensPage as c } from "./components/pages/NoScreensPage.js";
13
+ import { Profile as l } from "./components/pages/profile/Profile.js";
14
+ import { TenantParamsPage as u } from "./components/pages/tenant-params/TenantParamsPage.js";
15
+ import { Preferences as re } from "./components/pages/profile/Preferences.js";
16
16
  import { AdminCatalogPage as ie } from "./components/pages/AdminCatalogPage.js";
17
17
  import { SmartListPage as d } from "./components/pages/SmartListPage.js";
18
18
  import { SmartDetailPage as f } from "./components/pages/SmartDetailPage.js";
@@ -23,37 +23,37 @@ import { usePreferencesStore as g } from "./stores/preferences.js";
23
23
  import { useSchema as _ } from "./hooks/useSchema.js";
24
24
  import { usePublicParams as v } from "./hooks/useParams.js";
25
25
  import { useBranding as y } from "./hooks/useBranding.js";
26
- import { identityProvidersQueryOptions as ae, setupQueryOptions as oe } from "./hooks/useSignInData.js";
27
- import { useBrandingBreakpoints as b, useBrandingViewport as x } from "./hooks/useBrandingChrome.js";
28
- import { useVersionWatcher as S } from "./hooks/useVersionWatcher.js";
29
- import { ConnectionNotice as C } from "./components/shared/ConnectionNotice.js";
30
- import { shouldRetryQuery as w } from "./lib/query-retry.js";
31
- import { backoffDelayMs as T } from "./api/request-bounds.js";
32
- import { ResponsiveModeProvider as E } from "./hooks/useResponsiveMode.js";
33
- import { isValidLogoUrl as D } from "./lib/branding.js";
34
- import { useFirstScreenSettledOnInput as O } from "./lib/capabilityPrefetch.js";
35
- import { schemaDefaultRoute as k } from "./lib/schema-routing.js";
36
- import { getRegisteredScreen as A, registerScreen as j } from "./stores/screen-registry.js";
37
- import { CurrentScreenProvider as M } from "./hooks/useCurrentScreen.js";
38
- import { setIconRegistry as se } from "./stores/icon-registry.js";
39
- import { applyRetainedReadGcTime as N } from "./hooks/usePageStateRuntime.js";
40
- import { DEFAULT_PAGE_STATE_TTL_MS as P } from "./stores/page-state.js";
41
- import { EmbedProvider as F, useEmbed as I } from "./embed/EmbedContext.js";
42
- import { EmbedAuthBootstrap as L } from "./embed/EmbedAuthBootstrap.js";
43
- import { BlankScreen as R } from "./components/shared/BlankScreen.js";
44
- import { CONSUMER_BRAND_CSS_ID as z, applyBrandTokens as B, brandTokenCss as V } from "./lib/brand-tokens.js";
45
- import { useEffect as H, useMemo as U } from "react";
46
- import { QueryClient as W, QueryClientProvider as G, useQueryClient as K } from "@tanstack/react-query";
26
+ import { identityProvidersQueryOptions as b, setupQueryOptions as ae } from "./hooks/useSignInData.js";
27
+ import { useBrandingBreakpoints as x, useBrandingViewport as S } from "./hooks/useBrandingChrome.js";
28
+ import { useVersionWatcher as C } from "./hooks/useVersionWatcher.js";
29
+ import { ConnectionNotice as w } from "./components/shared/ConnectionNotice.js";
30
+ import { shouldRetryQuery as T } from "./lib/query-retry.js";
31
+ import { backoffDelayMs as E } from "./api/request-bounds.js";
32
+ import { ResponsiveModeProvider as D } from "./hooks/useResponsiveMode.js";
33
+ import { isValidLogoUrl as O } from "./lib/branding.js";
34
+ import { useFirstScreenSettledOnInput as k } from "./lib/capabilityPrefetch.js";
35
+ import { schemaDefaultRoute as A } from "./lib/schema-routing.js";
36
+ import { getRegisteredScreen as j, registerScreen as M } from "./stores/screen-registry.js";
37
+ import { CurrentScreenProvider as N } from "./hooks/useCurrentScreen.js";
38
+ import { setIconRegistry as oe } from "./stores/icon-registry.js";
39
+ import { applyRetainedReadGcTime as P } from "./hooks/usePageStateRuntime.js";
40
+ import { DEFAULT_PAGE_STATE_TTL_MS as F } from "./stores/page-state.js";
41
+ import { EmbedProvider as I, useEmbed as L } from "./embed/EmbedContext.js";
42
+ import { EmbedAuthBootstrap as R } from "./embed/EmbedAuthBootstrap.js";
43
+ import { BlankScreen as z } from "./components/shared/BlankScreen.js";
44
+ import { CONSUMER_BRAND_CSS_ID as B, applyBrandTokens as V, brandTokenCss as H } from "./lib/brand-tokens.js";
45
+ import { useEffect as U, useMemo as W } from "react";
46
+ import { QueryClient as G, QueryClientProvider as K, useQueryClient as se } from "@tanstack/react-query";
47
47
  import { Fragment as ce, jsx as q, jsxs as J } from "react/jsx-runtime";
48
48
  import { BrowserRouter as le, Navigate as Y, Route as X, Routes as ue, useLocation as de } from "react-router";
49
49
  import { Toaster as fe } from "sonner";
50
- j("Profile", c), j("TenantParameters", l);
51
- var Z = "declarion-managed-favicon", Q = new W({ defaultOptions: { queries: {
50
+ M("Profile", l), M("TenantParameters", u);
51
+ var Z = "declarion-managed-favicon", Q = new G({ defaultOptions: { queries: {
52
52
  staleTime: 3e5,
53
- retry: w,
54
- retryDelay: T
53
+ retry: T,
54
+ retryDelay: E
55
55
  } } });
56
- N(Q, P);
56
+ P(Q, F);
57
57
  function $(e) {
58
58
  if (typeof window > "u") return null;
59
59
  try {
@@ -64,12 +64,12 @@ function $(e) {
64
64
  }
65
65
  }
66
66
  function pe({ component: e, screenCode: t }) {
67
- return O(), /* @__PURE__ */ q(e, { screenCode: t });
67
+ return k(), /* @__PURE__ */ q(e, { screenCode: t });
68
68
  }
69
69
  function me() {
70
70
  let { data: e } = _();
71
71
  return {
72
- routes: U(() => {
72
+ routes: W(() => {
73
73
  if (!e) return [];
74
74
  let t = [];
75
75
  for (let [n, r] of Object.entries(e.screens ?? {})) if (r.type === "list") {
@@ -77,30 +77,30 @@ function me() {
77
77
  if ((i ? e.entities?.[i] : void 0)?.singleton) continue;
78
78
  t.push(/* @__PURE__ */ q(X, {
79
79
  path: r.route,
80
- element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(M, {
80
+ element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
81
81
  code: n,
82
82
  children: /* @__PURE__ */ q(d, { screenCode: n })
83
83
  }) })
84
84
  }, n));
85
85
  } else if (r.type === "detail") t.push(/* @__PURE__ */ q(X, {
86
86
  path: r.route,
87
- element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(M, {
87
+ element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
88
88
  code: n,
89
89
  children: /* @__PURE__ */ q(f, { screenCode: n })
90
90
  }) })
91
91
  }, n));
92
92
  else if (r.type === "record_list") t.push(/* @__PURE__ */ q(X, {
93
93
  path: r.route,
94
- element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(M, {
94
+ element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
95
95
  code: n,
96
96
  children: /* @__PURE__ */ q(p, { screenCode: n })
97
97
  }) })
98
98
  }, n));
99
99
  else if (r.type === "custom") {
100
- let e = r.component ? A(r.component) : void 0;
100
+ let e = r.component ? j(r.component) : void 0;
101
101
  e && t.push(/* @__PURE__ */ q(X, {
102
102
  path: r.route,
103
- element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(M, {
103
+ element: /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(N, {
104
104
  code: n,
105
105
  children: /* @__PURE__ */ q(pe, {
106
106
  component: e,
@@ -111,43 +111,43 @@ function me() {
111
111
  }
112
112
  return t;
113
113
  }, [e]),
114
- defaultRoute: U(() => k(e), [e])
114
+ defaultRoute: W(() => A(e), [e])
115
115
  };
116
116
  }
117
117
  function he() {
118
- let c = h((e) => e.initialize), l = h((e) => e.isLoading), d = h((e) => e.isAuthenticated), { data: f, isError: p } = _(), m = e(), { data: g, isLoading: b } = v(), { branding: x, isLoading: S } = y(), { routes: C, defaultRoute: w } = me(), T = I(), E = de(), O = K();
119
- H(() => {
118
+ let l = h((e) => e.initialize), u = h((e) => e.signedOutPresumed), d = h((e) => e.isAuthenticated), { data: f, isError: p } = _(), m = e(), { data: g, isLoading: x } = v(), { branding: S, isLoading: C } = y(), { routes: w, defaultRoute: T } = me(), E = L(), D = de(), k = se(), A = h((e) => e.isLoading) && !u;
119
+ U(() => {
120
120
  document.documentElement.lang = m;
121
121
  }, [m]);
122
- let k = typeof window < "u" && window.self !== window.top && !T.enabled;
123
- H(() => {
124
- E.pathname !== "/login" || T.enabled || k || l || d || (O.prefetchQuery(oe), O.prefetchQuery(ae));
122
+ let j = typeof window < "u" && window.self !== window.top && !E.enabled;
123
+ U(() => {
124
+ D.pathname !== "/login" || E.enabled || j || A || d || (k.prefetchQuery(ae), k.prefetchQuery(b));
125
125
  }, [
126
- E.pathname,
127
- T.enabled,
128
- k,
129
- l,
126
+ D.pathname,
127
+ E.enabled,
128
+ j,
129
+ A,
130
130
  d,
131
- O
132
- ]), H(() => {
133
- T.enabled || k || c();
131
+ k
132
+ ]), U(() => {
133
+ E.enabled || j || l();
134
134
  }, [
135
- T.enabled,
136
- k,
137
- c
135
+ E.enabled,
136
+ j,
137
+ l
138
138
  ]);
139
- let A = f?.icons;
140
- H(() => {
141
- se(A ?? {});
142
- }, [A]);
143
- let j = x?.identity, M = x?.theme;
144
- H(() => {
139
+ let M = f?.icons;
140
+ U(() => {
141
+ oe(M ?? {});
142
+ }, [M]);
143
+ let N = S?.identity, P = S?.theme;
144
+ U(() => {
145
145
  if (typeof document > "u") return;
146
- let e = j?.app_name?.trim();
146
+ let e = N?.app_name?.trim();
147
147
  e && (document.title = e);
148
- }, [j?.app_name]), H(() => {
148
+ }, [N?.app_name]), U(() => {
149
149
  if (typeof document > "u") return;
150
- let e = j?.app_logo, t = D(e) ? $(e.trim()) : null, n = document.getElementById(Z);
150
+ let e = N?.app_logo, t = O(e) ? $(e.trim()) : null, n = document.getElementById(Z);
151
151
  if (!t) n && n.remove();
152
152
  else if (n) n.href !== t && (n.href = t);
153
153
  else {
@@ -155,36 +155,36 @@ function he() {
155
155
  let e = document.createElement("link");
156
156
  e.id = Z, e.rel = "icon", e.href = t, document.head.appendChild(e);
157
157
  }
158
- }, [j?.app_logo]);
159
- let N = M?.css_url ?? null, P = U(() => V(M), [M]);
160
- H(() => {
161
- B(P);
162
- }, [P]), H(() => {
158
+ }, [N?.app_logo]);
159
+ let F = P?.css_url ?? null, I = W(() => H(P), [P]);
160
+ U(() => {
161
+ V(I);
162
+ }, [I]), U(() => {
163
163
  if (typeof document > "u") return;
164
- let e = document.getElementById(z);
165
- if (!N) {
164
+ let e = document.getElementById(B);
165
+ if (!F) {
166
166
  e && e.remove();
167
167
  return;
168
168
  }
169
- let t = $(N);
169
+ let t = $(F);
170
170
  if (!t) {
171
- e && e.remove(), console.error(`[declarion] branding.theme.css_url rejected: ${N}. Only same-origin, relative URLs are allowed (e.g. /modules/crm/public/brand.css).`);
171
+ e && e.remove(), console.error(`[declarion] branding.theme.css_url rejected: ${F}. Only same-origin, relative URLs are allowed (e.g. /modules/crm/public/brand.css).`);
172
172
  return;
173
173
  }
174
174
  if (e && e.href === t) return;
175
175
  e && e.remove();
176
176
  let n = document.createElement("link");
177
- n.id = z, n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
178
- }, [N]);
179
- let F = T.enabled && !d;
180
- return k || F || l || b && !g || S || !f && (d || !p) ? /* @__PURE__ */ q(R, {}) : /* @__PURE__ */ J(ue, { children: [
177
+ n.id = B, n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
178
+ }, [F]);
179
+ let R = E.enabled && !d;
180
+ return j || R || A || x && !g || C || !f && (d || !p) ? /* @__PURE__ */ q(z, {}) : /* @__PURE__ */ J(ue, { children: [
181
181
  /* @__PURE__ */ q(X, {
182
182
  path: "/login",
183
183
  element: /* @__PURE__ */ q(n, {})
184
184
  }),
185
185
  /* @__PURE__ */ q(X, {
186
- path: re,
187
- element: /* @__PURE__ */ q(ne, {})
186
+ path: ne,
187
+ element: /* @__PURE__ */ q(te, {})
188
188
  }),
189
189
  /* @__PURE__ */ q(X, {
190
190
  path: "/signup",
@@ -196,40 +196,40 @@ function he() {
196
196
  }),
197
197
  /* @__PURE__ */ q(X, {
198
198
  path: "/reset",
199
- element: /* @__PURE__ */ q(ee, {})
199
+ element: /* @__PURE__ */ q(a, {})
200
200
  }),
201
201
  /* @__PURE__ */ q(X, {
202
202
  path: "/2fa",
203
- element: /* @__PURE__ */ q(a, {})
203
+ element: /* @__PURE__ */ q(o, {})
204
204
  }),
205
205
  /* @__PURE__ */ q(X, {
206
206
  path: "/oauth/consent",
207
- element: /* @__PURE__ */ q(te, {})
207
+ element: /* @__PURE__ */ q(ee, {})
208
208
  }),
209
209
  /* @__PURE__ */ J(X, {
210
210
  element: /* @__PURE__ */ q(t, {}),
211
211
  children: [
212
- f && !w && /* @__PURE__ */ q(X, {
212
+ f && !T && /* @__PURE__ */ q(X, {
213
213
  index: !0,
214
- element: /* @__PURE__ */ q(s, {})
214
+ element: /* @__PURE__ */ q(c, {})
215
215
  }),
216
- w && /* @__PURE__ */ J(ce, { children: [/* @__PURE__ */ q(X, {
216
+ T && /* @__PURE__ */ J(ce, { children: [/* @__PURE__ */ q(X, {
217
217
  index: !0,
218
218
  element: /* @__PURE__ */ q(Y, {
219
- to: w,
219
+ to: T,
220
220
  replace: !0
221
221
  })
222
222
  }), /* @__PURE__ */ q(X, {
223
223
  path: "/admin",
224
224
  element: /* @__PURE__ */ q(Y, {
225
- to: w,
225
+ to: T,
226
226
  replace: !0
227
227
  })
228
228
  })] }),
229
- C,
229
+ w,
230
230
  /* @__PURE__ */ q(X, {
231
231
  path: "/preferences",
232
- element: /* @__PURE__ */ q(u, {})
232
+ element: /* @__PURE__ */ q(re, {})
233
233
  }),
234
234
  /* @__PURE__ */ q(X, {
235
235
  path: "/admin/catalog",
@@ -237,18 +237,18 @@ function he() {
237
237
  }),
238
238
  /* @__PURE__ */ q(X, {
239
239
  path: "*",
240
- element: /* @__PURE__ */ q(o, {})
240
+ element: /* @__PURE__ */ q(s, {})
241
241
  })
242
242
  ]
243
243
  })
244
244
  ] });
245
245
  }
246
246
  function ge() {
247
- S();
247
+ C();
248
248
  let e = g((e) => e.toastPosition);
249
249
  return /* @__PURE__ */ J(le, { children: [
250
- /* @__PURE__ */ q(L, {}),
251
- /* @__PURE__ */ q(C, {}),
250
+ /* @__PURE__ */ q(R, {}),
251
+ /* @__PURE__ */ q(w, {}),
252
252
  /* @__PURE__ */ q(he, {}),
253
253
  /* @__PURE__ */ q(fe, {
254
254
  position: e,
@@ -266,17 +266,17 @@ function ge() {
266
266
  ] });
267
267
  }
268
268
  function _e({ children: e }) {
269
- let t = x(), n = b();
270
- return /* @__PURE__ */ q(E, {
269
+ let t = S(), n = x();
270
+ return /* @__PURE__ */ q(D, {
271
271
  viewport: t,
272
272
  breakpoints: n,
273
273
  children: e
274
274
  });
275
275
  }
276
276
  function ve() {
277
- return /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(G, {
277
+ return /* @__PURE__ */ q(m, { children: /* @__PURE__ */ q(K, {
278
278
  client: Q,
279
- children: /* @__PURE__ */ q(F, { children: /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ q(ge, {}) }) })
279
+ children: /* @__PURE__ */ q(I, { children: /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ q(ge, {}) }) })
280
280
  }) });
281
281
  }
282
282
  export { ve as App };