@declarion/react 0.36.1 → 0.36.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.
- package/dist-lib/{LayoutRenderer-BUIoUmFl.js → LayoutRenderer-0UKE3pp6.js} +1 -1
- package/dist-lib/{SmartDetailPage.impl-yjxK8z0s.js → SmartDetailPage.impl-Ccz4TqfJ.js} +5 -11
- package/dist-lib/{SmartRecordListPage.impl-CwAiIcia.js → SmartRecordListPage.impl-Y0w4oIe3.js} +3 -3
- package/dist-lib/components/shared/PageHeader.d.ts +10 -2
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +18 -8
- package/dist-lib/hooks/useCurrentScreen.d.ts +34 -0
- package/dist-lib/index.d.ts +3 -0
- package/dist-lib/index.js +863 -835
- package/dist-lib/{registry-Bnc6QkvA.js → registry-D_zbJrLC.js} +1174 -1166
- package/dist-lib/stores/screen-registry.d.ts +16 -2
- package/dist-lib/{useProperties-Bqr2yTii.js → useProperties-C_1KM72K.js} +1 -1
- package/package.json +1 -1
package/dist-lib/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { a as e, r as t, s as n, t as r } from "./DynamicIcon-BWO6QtNF.js";
|
|
2
2
|
import { $ as i, $t as a, A as o, An as s, At as c, B as l, Bn as u, Bt as d, C as f, Cn as p, Ct as m, Dn as h, Dt as g, En as _, Et as v, Fn as y, Ft as b, Gt as x, H as S, Hn as C, Ht as w, In as T, It as E, J as D, Jt as O, K as ee, Kt as te, Ln as k, Lt as ne, M as re, Mn as A, Mt as ie, N as ae, Nn as oe, Nt as se, O as ce, On as le, Ot as j, Pn as M, Pt as N, Q as ue, Rn as de, Rt as fe, S as pe, Sn as me, St as he, Tn as ge, Tt as _e, U as ve, Un as P, V as F, Vn as ye, Vt as be, Wn as I, Wt as L, X as xe, Xt as Se, Yt as Ce, Z as we, Zt as Te, _ as Ee, _t as De, a as Oe, an as ke, at as Ae, b as je, bn as R, bt as Me, c as Ne, cn as z, dn as Pe, en as Fe, et as Ie, fn as Le, g as Re, gt as ze, h as Be, hn as Ve, ht as B, in as He, it as Ue, j as We, jn as Ge, jt as Ke, k as qe, kn as Je, l as Ye, ln as Xe, lt as Ze, m as Qe, mn as $e, mt as et, n as tt, nn as nt, nt as V, o as rt, on as it, ot as at, p as ot, pt as st, q as ct, qt as lt, rn as ut, s as dt, sn as ft, st as pt, t as mt, tn as ht, tt as H, un as gt, v as _t, vn as U, vt, wn as yt, wt as bt, x as xt, xn as St, xt as Ct, y as wt, yn as Tt, yt as Et, z as Dt, zn as Ot, zt as kt } from "./ActionRunner-BrXXs8ga.js";
|
|
3
3
|
import { A as At, C as jt, D as Mt, E as Nt, F as Pt, I as Ft, M as It, N as Lt, O as Rt, P as zt, S as Bt, T as Vt, _ as Ht, a as Ut, b as Wt, c as Gt, d as Kt, f as qt, g as Jt, h as Yt, j as Xt, k as Zt, l as Qt, m as $t, n as en, o as tn, p as nn, r as rn, s as an, t as on, u as sn, v as cn, w as ln, x as un, y as dn } from "./RefreshControl-CX_D6PcA.js";
|
|
4
|
-
import { $ as fn, A as pn, B as mn, C as hn, D as gn, E as _n, F as vn, G as yn, H as bn, I as xn, K as Sn, L as Cn, M as W, N as wn, O as Tn, P as En, R as Dn, S as On, St as kn, T as An, U as jn, V as Mn, X as Nn, Z as Pn, _ as Fn, _t as In, a as Ln, at as Rn, b as zn, bt as G, c as Bn, ct as Vn, d as Hn, dt as Un, et as Wn, f as Gn, ft as Kn, g as qn, gt as Jn, h as Yn, ht as Xn, i as Zn, it as Qn, j as $n, l as er, lt as tr, m as nr, mt as rr, n as ir, nt as ar, o as or, ot as sr, p as cr, q as lr, r as ur, rt as dr, s as fr, st as pr, t as mr, tt as hr, u as gr, ut as _r, v as vr, vt as yr, x as br, xt as xr, y as Sr, yt as Cr, z as wr } from "./registry-
|
|
5
|
-
import { C as Tr, S as Er, _ as Dr, a as Or, b as kr, c as Ar, d as jr, f as Mr, g as Nr, h as Pr, i as Fr, l as Ir, m as Lr, n as Rr, o as zr, p as Br, r as Vr, t as Hr, u as Ur, v as Wr, x as Gr, y as Kr } from "./useProperties-
|
|
6
|
-
import { Fragment as qr, Suspense as Jr,
|
|
7
|
-
import { BrowserRouter as
|
|
8
|
-
import { QueryClient as
|
|
9
|
-
import { Toaster as
|
|
4
|
+
import { $ as fn, A as pn, B as mn, C as hn, D as gn, E as _n, F as vn, G as yn, H as bn, I as xn, K as Sn, L as Cn, M as W, N as wn, O as Tn, P as En, R as Dn, S as On, St as kn, T as An, U as jn, V as Mn, X as Nn, Z as Pn, _ as Fn, _t as In, a as Ln, at as Rn, b as zn, bt as G, c as Bn, ct as Vn, d as Hn, dt as Un, et as Wn, f as Gn, ft as Kn, g as qn, gt as Jn, h as Yn, ht as Xn, i as Zn, it as Qn, j as $n, l as er, lt as tr, m as nr, mt as rr, n as ir, nt as ar, o as or, ot as sr, p as cr, q as lr, r as ur, rt as dr, s as fr, st as pr, t as mr, tt as hr, u as gr, ut as _r, v as vr, vt as yr, x as br, xt as xr, y as Sr, yt as Cr, z as wr } from "./registry-D_zbJrLC.js";
|
|
5
|
+
import { C as Tr, S as Er, _ as Dr, a as Or, b as kr, c as Ar, d as jr, f as Mr, g as Nr, h as Pr, i as Fr, l as Ir, m as Lr, n as Rr, o as zr, p as Br, r as Vr, t as Hr, u as Ur, v as Wr, x as Gr, y as Kr } from "./useProperties-C_1KM72K.js";
|
|
6
|
+
import { Fragment as qr, Suspense as Jr, createContext as Yr, createElement as Xr, lazy as Zr, useCallback as K, useContext as Qr, useEffect as q, useMemo as J, useRef as Y, useState as X } from "react";
|
|
7
|
+
import { BrowserRouter as $r, Link as ei, Navigate as ti, Outlet as ni, Route as ri, Routes as ii, useLocation as ai, useLocation as oi, useNavigate as si, useNavigate as ci, useNavigationType as li, useParams as ui, useSearchParams as di, useSearchParams as fi } from "react-router-dom";
|
|
8
|
+
import { QueryClient as pi, QueryClientProvider as mi, useInfiniteQuery as hi, useMutation as gi, useQueries as _i, useQuery as vi, useQueryClient as yi } from "@tanstack/react-query";
|
|
9
|
+
import { Toaster as bi } from "sonner";
|
|
10
10
|
import { Fragment as Z, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
11
|
-
import
|
|
12
|
-
import { flexRender as
|
|
13
|
-
import { useVirtualizer as
|
|
11
|
+
import xi from "react-textarea-autosize";
|
|
12
|
+
import { flexRender as Si, getCoreRowModel as Ci, useReactTable as wi } from "@tanstack/react-table";
|
|
13
|
+
import { useVirtualizer as Ti } from "@tanstack/react-virtual";
|
|
14
14
|
//#region src/components/primitives/BrandGlyph.tsx
|
|
15
|
-
function
|
|
15
|
+
function Ei({ size: e = 24, className: t, title: n }) {
|
|
16
16
|
return /* @__PURE__ */ $("svg", {
|
|
17
17
|
width: e,
|
|
18
18
|
height: e,
|
|
@@ -48,7 +48,7 @@ function wi({ size: e = 24, className: t, title: n }) {
|
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/components/primitives/RowField.tsx
|
|
51
|
-
function
|
|
51
|
+
function Di({ label: e, children: t, wide: n, editing: r, required: i }) {
|
|
52
52
|
let a = k(), o = n || a.isPhone;
|
|
53
53
|
return /* @__PURE__ */ $("div", {
|
|
54
54
|
style: {
|
|
@@ -91,7 +91,7 @@ function Ti({ label: e, children: t, wide: n, editing: r, required: i }) {
|
|
|
91
91
|
}
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/primitives/Check.tsx
|
|
94
|
-
function
|
|
94
|
+
function Oi({ checked: e, onChange: t, indeterminate: n, size: r = 14 }) {
|
|
95
95
|
return /* @__PURE__ */ $("span", {
|
|
96
96
|
onClick: (n) => {
|
|
97
97
|
n.stopPropagation(), t?.(!e);
|
|
@@ -127,16 +127,16 @@ function Ei({ checked: e, onChange: t, indeterminate: n, size: r = 14 }) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/components/layout/Rail.tsx
|
|
130
|
-
var
|
|
131
|
-
function
|
|
130
|
+
var ki = 32;
|
|
131
|
+
function Ai(e) {
|
|
132
132
|
return !e || e.length === 0 ? [] : e.map((e) => ({
|
|
133
133
|
id: e.code,
|
|
134
134
|
icon: e.icon || void 0,
|
|
135
135
|
label: z(e.name) || e.code
|
|
136
136
|
}));
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
let c =
|
|
138
|
+
function ji({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, areas: o, branding: s }) {
|
|
139
|
+
let c = Ai(o), l = s?.app_name ?? "", u = It(s?.app_logo) ? s?.app_logo : void 0;
|
|
140
140
|
return /* @__PURE__ */ $("div", {
|
|
141
141
|
style: {
|
|
142
142
|
gridArea: "rail",
|
|
@@ -151,8 +151,8 @@ function ki({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, are
|
|
|
151
151
|
children: [
|
|
152
152
|
/* @__PURE__ */ Q("div", {
|
|
153
153
|
style: {
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
154
|
+
width: ki,
|
|
155
|
+
height: ki,
|
|
156
156
|
borderRadius: 8,
|
|
157
157
|
background: u ? "transparent" : "linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%)",
|
|
158
158
|
display: "flex",
|
|
@@ -166,8 +166,8 @@ function ki({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, are
|
|
|
166
166
|
children: u ? /* @__PURE__ */ Q("img", {
|
|
167
167
|
src: u,
|
|
168
168
|
alt: l,
|
|
169
|
-
width:
|
|
170
|
-
height:
|
|
169
|
+
width: ki,
|
|
170
|
+
height: ki,
|
|
171
171
|
style: {
|
|
172
172
|
display: "block",
|
|
173
173
|
objectFit: "contain"
|
|
@@ -181,7 +181,7 @@ function ki({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, are
|
|
|
181
181
|
children: l.charAt(0).toUpperCase()
|
|
182
182
|
}) : null
|
|
183
183
|
}),
|
|
184
|
-
c.map((n) => /* @__PURE__ */ Q(
|
|
184
|
+
c.map((n) => /* @__PURE__ */ Q(Mi, {
|
|
185
185
|
item: n,
|
|
186
186
|
active: e === n.id,
|
|
187
187
|
onPick: t
|
|
@@ -190,14 +190,14 @@ function ki({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, are
|
|
|
190
190
|
/* @__PURE__ */ Q("button", {
|
|
191
191
|
onClick: a,
|
|
192
192
|
title: "Command Palette (⌘K)",
|
|
193
|
-
style:
|
|
193
|
+
style: Ni(!1),
|
|
194
194
|
children: n.command && /* @__PURE__ */ Q(n.command, { size: 16 })
|
|
195
195
|
}),
|
|
196
196
|
/* @__PURE__ */ Q("button", {
|
|
197
197
|
onClick: r,
|
|
198
198
|
title: "AI Assistant",
|
|
199
199
|
style: {
|
|
200
|
-
...
|
|
200
|
+
...Ni(!1),
|
|
201
201
|
background: i ? "var(--accent)" : "transparent",
|
|
202
202
|
color: i ? "var(--rail-fg)" : "var(--rail-muted)"
|
|
203
203
|
},
|
|
@@ -206,7 +206,7 @@ function ki({ activeArea: e, onPick: t, onToggleAI: r, aiOpen: i, onCmdK: a, are
|
|
|
206
206
|
]
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Mi({ item: e, active: t, onPick: n }) {
|
|
210
210
|
let [i, a] = X(!1), o = t ? "var(--rail-active)" : i ? "var(--rail-hover)" : "transparent", s = t || i ? "var(--rail-fg)" : "var(--rail-muted)";
|
|
211
211
|
return /* @__PURE__ */ $("button", {
|
|
212
212
|
onClick: () => n(e.id),
|
|
@@ -240,7 +240,7 @@ function Ai({ item: e, active: t, onPick: n }) {
|
|
|
240
240
|
} })]
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Ni(e) {
|
|
244
244
|
return {
|
|
245
245
|
width: 36,
|
|
246
246
|
height: 36,
|
|
@@ -256,7 +256,7 @@ function ji(e) {
|
|
|
256
256
|
}
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region src/components/primitives/BrandLogo.tsx
|
|
259
|
-
function
|
|
259
|
+
function Pi({ appLogo: e, size: t, radius: n, fallback: r }) {
|
|
260
260
|
if (!It(e)) return r ? /* @__PURE__ */ Q(Z, { children: r }) : null;
|
|
261
261
|
let i = n ?? (t >= 30 ? 8 : 6);
|
|
262
262
|
return /* @__PURE__ */ Q("img", {
|
|
@@ -273,7 +273,7 @@ function Mi({ appLogo: e, size: t, radius: n, fallback: r }) {
|
|
|
273
273
|
}
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region src/embed/theme.ts
|
|
276
|
-
function
|
|
276
|
+
function Fi(e) {
|
|
277
277
|
Cr({
|
|
278
278
|
...G.getState(),
|
|
279
279
|
colorScheme: e
|
|
@@ -281,7 +281,7 @@ function Ni(e) {
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region src/embed/handshake.ts
|
|
284
|
-
function
|
|
284
|
+
function Ii(e, t) {
|
|
285
285
|
if (e.origin !== t) return { kind: "rejected" };
|
|
286
286
|
let n = e.data;
|
|
287
287
|
if (typeof n != "object" || !n) return { kind: "rejected" };
|
|
@@ -294,9 +294,9 @@ function Pi(e, t) {
|
|
|
294
294
|
received: r.protocol
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Li(e, t) {
|
|
298
298
|
return (n) => {
|
|
299
|
-
let r =
|
|
299
|
+
let r = Ii(n, e);
|
|
300
300
|
if (r.kind === "rejected") return;
|
|
301
301
|
if (r.kind === "protocol-mismatch") {
|
|
302
302
|
console.warn(`[declarion-embed] protocol version mismatch: this iframe speaks protocol 1, the host sent protocol ${String(r.received)}. Update the host @declarion/embed SDK and the Declarion deployment to matching versions.`);
|
|
@@ -319,9 +319,9 @@ function Fi(e, t) {
|
|
|
319
319
|
}
|
|
320
320
|
//#endregion
|
|
321
321
|
//#region src/embed/EmbedAuthBootstrap.tsx
|
|
322
|
-
var
|
|
323
|
-
function
|
|
324
|
-
let e = we(), t =
|
|
322
|
+
var Ri = 2e4;
|
|
323
|
+
function zi() {
|
|
324
|
+
let e = we(), t = ci(), n = oi(), r = B((e) => e.setUser), [i, a] = X("pending"), o = Y(!1), s = Y(n.pathname);
|
|
325
325
|
return s.current = n.pathname, q(() => {
|
|
326
326
|
if (!e.enabled) return;
|
|
327
327
|
d(e.parentOrigin), Xn.getState().reset();
|
|
@@ -337,7 +337,7 @@ function Li() {
|
|
|
337
337
|
a("error");
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
}, c = e.parentOrigin ?
|
|
340
|
+
}, c = e.parentOrigin ? Li(e.parentOrigin, {
|
|
341
341
|
onAuth: (e) => {
|
|
342
342
|
w(e), o.current || i();
|
|
343
343
|
},
|
|
@@ -352,13 +352,13 @@ function Li() {
|
|
|
352
352
|
r();
|
|
353
353
|
},
|
|
354
354
|
onTheme: (e) => {
|
|
355
|
-
|
|
355
|
+
Fi(e.theme);
|
|
356
356
|
}
|
|
357
357
|
}) : null;
|
|
358
358
|
c && window.addEventListener("message", c), x(e.parentOrigin, L.ready, {});
|
|
359
359
|
let l = window.setTimeout(() => {
|
|
360
360
|
o.current || a("error");
|
|
361
|
-
},
|
|
361
|
+
}, Ri);
|
|
362
362
|
return () => {
|
|
363
363
|
c && window.removeEventListener("message", c), window.clearTimeout(l), se(n);
|
|
364
364
|
};
|
|
@@ -374,12 +374,12 @@ function Li() {
|
|
|
374
374
|
}
|
|
375
375
|
//#endregion
|
|
376
376
|
//#region src/embed/EmbedResizeReporter.tsx
|
|
377
|
-
var
|
|
378
|
-
function
|
|
377
|
+
var Bi = "app-embed";
|
|
378
|
+
function Vi() {
|
|
379
379
|
let e = we(), t = e.enabled && e.parentOrigin !== null;
|
|
380
380
|
return q(() => {
|
|
381
381
|
if (!t || typeof window > "u" || typeof ResizeObserver > "u") return;
|
|
382
|
-
let n = document.getElementById(
|
|
382
|
+
let n = document.getElementById(Bi);
|
|
383
383
|
if (!n) return;
|
|
384
384
|
let r = null, i = -1, a = () => {
|
|
385
385
|
r = null;
|
|
@@ -395,7 +395,7 @@ function zi() {
|
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region src/embed/EmbedDirtyReporter.tsx
|
|
398
|
-
function
|
|
398
|
+
function Hi() {
|
|
399
399
|
let e = we(), t = D((e) => e.isDirty), n = e.enabled && e.parentOrigin !== null;
|
|
400
400
|
return q(() => {
|
|
401
401
|
n && x(e.parentOrigin, L.dirtyChanged, { dirty: t });
|
|
@@ -407,8 +407,8 @@ function Bi() {
|
|
|
407
407
|
}
|
|
408
408
|
//#endregion
|
|
409
409
|
//#region src/embed/EmbedHistoryTracker.tsx
|
|
410
|
-
function
|
|
411
|
-
let e = we(), t =
|
|
410
|
+
function Ui() {
|
|
411
|
+
let e = we(), t = li(), n = oi(), r = e.enabled && e.navigationMode === "self", i = Y(null);
|
|
412
412
|
return q(() => {
|
|
413
413
|
r && i.current !== n.key && (i.current = n.key, Xn.getState().applyNavigation(t));
|
|
414
414
|
}, [
|
|
@@ -417,21 +417,21 @@ function Vi() {
|
|
|
417
417
|
t
|
|
418
418
|
]), null;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Wi(e) {
|
|
421
421
|
return e instanceof HTMLAnchorElement || typeof SVGAElement < "u" && e instanceof SVGAElement;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
for (let t of e.composedPath()) if (
|
|
423
|
+
function Gi(e) {
|
|
424
|
+
for (let t of e.composedPath()) if (Wi(t)) return t;
|
|
425
425
|
return null;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Ki(e) {
|
|
428
428
|
return e instanceof HTMLAnchorElement ? e.getAttribute("href") : e.href?.baseVal ?? e.getAttribute("href") ?? e.getAttribute("xlink:href");
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function qi(e, t = window.location) {
|
|
431
431
|
if (e.defaultPrevented || rr(e)) return null;
|
|
432
|
-
let n =
|
|
432
|
+
let n = Gi(e);
|
|
433
433
|
if (!n || n.hasAttribute("data-declarion-native-link")) return null;
|
|
434
|
-
let r =
|
|
434
|
+
let r = Ki(n);
|
|
435
435
|
if (!r) return null;
|
|
436
436
|
let i = (n.getAttribute("target") ?? "").trim();
|
|
437
437
|
if (i && i !== "_self" || n.hasAttribute("download")) return null;
|
|
@@ -445,7 +445,7 @@ function Gi(e, t = window.location) {
|
|
|
445
445
|
}
|
|
446
446
|
return o.protocol !== "http:" && o.protocol !== "https:" || o.origin !== t.origin || o.pathname === t.pathname && o.search === t.search && o.hash !== "" ? null : o.pathname + o.search + o.hash;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Ji(e, t = window.location) {
|
|
449
449
|
if (e.destination.sameDocument || !e.canIntercept || e.hashChange || e.downloadRequest != null || e.formData != null) return null;
|
|
450
450
|
let n;
|
|
451
451
|
try {
|
|
@@ -455,16 +455,16 @@ function Ki(e, t = window.location) {
|
|
|
455
455
|
}
|
|
456
456
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin !== t.origin ? null : n.pathname + n.search + n.hash;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Yi() {
|
|
459
459
|
let e = Un(), t = we().enabled, n = Y(e);
|
|
460
460
|
n.current = e, q(() => {
|
|
461
461
|
let e = (e) => {
|
|
462
|
-
let t =
|
|
462
|
+
let t = qi(e);
|
|
463
463
|
t != null && (e.preventDefault(), n.current(t));
|
|
464
464
|
};
|
|
465
465
|
document.addEventListener("click", e, { capture: !0 });
|
|
466
466
|
let r = window.navigation, i = (e) => {
|
|
467
|
-
let t =
|
|
467
|
+
let t = Ji(e);
|
|
468
468
|
t != null && e.cancelable && (e.preventDefault(), n.current(t));
|
|
469
469
|
};
|
|
470
470
|
return t && r?.addEventListener("navigate", i), () => {
|
|
@@ -474,8 +474,8 @@ function qi() {
|
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
476
|
//#region src/embed/EmbedLocationReporter.tsx
|
|
477
|
-
function
|
|
478
|
-
let e = we(), t =
|
|
477
|
+
function Xi() {
|
|
478
|
+
let e = we(), t = oi(), { data: n } = et(), r = Y(null), i = e.enabled && e.navigationMode === "self";
|
|
479
479
|
return q(() => {
|
|
480
480
|
if (!i) return;
|
|
481
481
|
let a = `${t.pathname}${t.search}`;
|
|
@@ -493,7 +493,7 @@ function Ji() {
|
|
|
493
493
|
}
|
|
494
494
|
//#endregion
|
|
495
495
|
//#region src/embed/EmbedUnsavedGuard.tsx
|
|
496
|
-
function
|
|
496
|
+
function Zi() {
|
|
497
497
|
let e = ct((e) => e.pendingNavigation), t = ct((e) => e.confirmNavigation), n = ct((e) => e.cancelNavigation);
|
|
498
498
|
return e === null ? null : /* @__PURE__ */ Q(Kn, {
|
|
499
499
|
open: !0,
|
|
@@ -511,8 +511,8 @@ function Yi() {
|
|
|
511
511
|
}
|
|
512
512
|
//#endregion
|
|
513
513
|
//#region src/components/layout/Sidebar.tsx
|
|
514
|
-
function
|
|
515
|
-
let { data: t } = et(), r =
|
|
514
|
+
function Qi({ activeArea: e }) {
|
|
515
|
+
let { data: t } = et(), r = oi(), i = Un(), a = G((e) => e.sidebar), o = G((e) => e.set), s = a === "collapsed", [c, l] = X({}), u = Nt(), d = u?.app_name ?? "", f = u?.app_logo, p = u?.version_label ?? "", m = J(() => $i(t?.navigation ?? [], e), [t?.navigation, e]), h = (e) => e ? r.pathname === e || r.pathname.startsWith(e + "/") : !1, g = (e, n) => {
|
|
516
516
|
if (!e.screen) return;
|
|
517
517
|
let r = t?.screens[e.screen];
|
|
518
518
|
r && i(r.route, {
|
|
@@ -541,7 +541,7 @@ function Xi({ activeArea: e }) {
|
|
|
541
541
|
borderBottom: "1px solid var(--divider)",
|
|
542
542
|
gap: 8
|
|
543
543
|
},
|
|
544
|
-
children: s ? f ? /* @__PURE__ */ Q(
|
|
544
|
+
children: s ? f ? /* @__PURE__ */ Q(Pi, {
|
|
545
545
|
appLogo: f,
|
|
546
546
|
size: 18
|
|
547
547
|
}) : d ? /* @__PURE__ */ Q("span", {
|
|
@@ -552,7 +552,7 @@ function Xi({ activeArea: e }) {
|
|
|
552
552
|
},
|
|
553
553
|
children: d.charAt(0)
|
|
554
554
|
}) : null : /* @__PURE__ */ $(Z, { children: [
|
|
555
|
-
/* @__PURE__ */ Q(
|
|
555
|
+
/* @__PURE__ */ Q(Pi, {
|
|
556
556
|
appLogo: f,
|
|
557
557
|
size: 20
|
|
558
558
|
}),
|
|
@@ -600,7 +600,7 @@ function Xi({ activeArea: e }) {
|
|
|
600
600
|
children: e.title
|
|
601
601
|
}), e.items.map((e, r) => {
|
|
602
602
|
let a = `${n}-${r}-${e.screen || z(e.name)}`, o = e.screen ? t?.screens[e.screen] : void 0, u = h(o?.route), d = !!(e.children && e.children.length > 0), f = !!c[a];
|
|
603
|
-
return /* @__PURE__ */ Q(
|
|
603
|
+
return /* @__PURE__ */ Q(ta, {
|
|
604
604
|
item: e,
|
|
605
605
|
href: o?.route,
|
|
606
606
|
collapsed: s,
|
|
@@ -662,9 +662,9 @@ function Xi({ activeArea: e }) {
|
|
|
662
662
|
]
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function $i(e, t) {
|
|
666
666
|
let n = [];
|
|
667
|
-
for (let r of e) if (
|
|
667
|
+
for (let r of e) if (ea(r, t)) {
|
|
668
668
|
if (r.items && r.items.length > 0) {
|
|
669
669
|
n.push({
|
|
670
670
|
title: z(r.name) || "",
|
|
@@ -682,10 +682,10 @@ function Zi(e, t) {
|
|
|
682
682
|
}
|
|
683
683
|
return n;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function ea(e, t) {
|
|
686
686
|
return (e.area || "default") === t;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function ta({ item: e, href: t, collapsed: i, active: a, hasKids: o, expanded: s, onToggleExpand: c, onPick: l, onPickChild: u, resolveChild: d }) {
|
|
689
689
|
let [f, p] = X(!1), m = !!e.icon, h = z(e.name) || e.screen || "";
|
|
690
690
|
if (i) {
|
|
691
691
|
let n = {
|
|
@@ -811,7 +811,7 @@ function $i({ item: e, href: t, collapsed: i, active: a, hasKids: o, expanded: s
|
|
|
811
811
|
},
|
|
812
812
|
children: (e.children || []).map((e, t) => {
|
|
813
813
|
let n = d(e), r = e.screen || `${t}`;
|
|
814
|
-
return /* @__PURE__ */ Q(
|
|
814
|
+
return /* @__PURE__ */ Q(na, {
|
|
815
815
|
label: z(e.name) || e.screen || "",
|
|
816
816
|
href: n?.route,
|
|
817
817
|
enabled: !!n,
|
|
@@ -820,7 +820,7 @@ function $i({ item: e, href: t, collapsed: i, active: a, hasKids: o, expanded: s
|
|
|
820
820
|
})
|
|
821
821
|
})] });
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function na({ label: e, href: t, enabled: n, onPick: r }) {
|
|
824
824
|
let [i, a] = X(!1), o = {
|
|
825
825
|
width: "100%",
|
|
826
826
|
display: "block",
|
|
@@ -854,13 +854,13 @@ function ea({ label: e, href: t, enabled: n, onPick: r }) {
|
|
|
854
854
|
}
|
|
855
855
|
//#endregion
|
|
856
856
|
//#region src/hooks/useAuth.ts
|
|
857
|
-
function
|
|
858
|
-
let { user: e, isAuthenticated: t, isLoading: n, activeTenant: r, tenants: i, setUser: a, setTenants: o, logout: s } = B(), c =
|
|
857
|
+
function ra() {
|
|
858
|
+
let { user: e, isAuthenticated: t, isLoading: n, activeTenant: r, tenants: i, setUser: a, setTenants: o, logout: s } = B(), c = ci(), l = yi(), u = gi({
|
|
859
859
|
mutationFn: ({ email: e, password: t, remember: n }) => bt(e, t, n ?? !0),
|
|
860
860
|
onSuccess: (e) => {
|
|
861
861
|
a(e.user, e.tenant), l.invalidateQueries({ queryKey: ["schema"] }), m().then(o).catch(() => {});
|
|
862
862
|
}
|
|
863
|
-
}), d =
|
|
863
|
+
}), d = gi({
|
|
864
864
|
mutationFn: ({ email: e, password: t, displayName: n }) => _e(e, t, n),
|
|
865
865
|
onSuccess: (e) => {
|
|
866
866
|
a(e.user, e.tenant), l.invalidateQueries({ queryKey: ["schema"] }), m().then(o).catch(() => {});
|
|
@@ -868,7 +868,7 @@ function ta() {
|
|
|
868
868
|
onError: (e) => {
|
|
869
869
|
F.error(e.message);
|
|
870
870
|
}
|
|
871
|
-
}), f =
|
|
871
|
+
}), f = gi({
|
|
872
872
|
mutationFn: (e) => g(e),
|
|
873
873
|
onSuccess: (e) => {
|
|
874
874
|
let t = e.tenant?.id, n = e.user?.id, r = t && n && Jn(t, n) || "/";
|
|
@@ -897,20 +897,20 @@ function ta() {
|
|
|
897
897
|
}
|
|
898
898
|
//#endregion
|
|
899
899
|
//#region src/hooks/useImpersonation.ts
|
|
900
|
-
function
|
|
901
|
-
let e = B((e) => e.user), t = B((e) => e.initialize), n =
|
|
900
|
+
function ia() {
|
|
901
|
+
let e = B((e) => e.user), t = B((e) => e.initialize), n = yi(), r = e?.impersonation ?? null, i = !!r, a = gi({
|
|
902
902
|
mutationFn: ({ targetUserId: e, reason: t, durationMinutes: n }) => Me(e, t, n),
|
|
903
903
|
onSuccess: async () => {
|
|
904
904
|
await t(), n.invalidateQueries(), F.success("Impersonation session started.");
|
|
905
905
|
},
|
|
906
906
|
onError: (e) => F.error(e.message)
|
|
907
|
-
}), o =
|
|
907
|
+
}), o = gi({
|
|
908
908
|
mutationFn: () => Ct(),
|
|
909
909
|
onSuccess: async () => {
|
|
910
910
|
await t(), n.invalidateQueries(), F.success("Returned to your own session.");
|
|
911
911
|
},
|
|
912
912
|
onError: (e) => F.error(e.message)
|
|
913
|
-
}), s =
|
|
913
|
+
}), s = gi({
|
|
914
914
|
mutationFn: (e) => Et(e),
|
|
915
915
|
onSuccess: () => {
|
|
916
916
|
F.success("Session revoked."), n.invalidateQueries({ queryKey: ["impersonation_session"] });
|
|
@@ -929,11 +929,11 @@ function na() {
|
|
|
929
929
|
}
|
|
930
930
|
//#endregion
|
|
931
931
|
//#region src/components/layout/TenantChip.tsx
|
|
932
|
-
var
|
|
933
|
-
function
|
|
932
|
+
var aa = 6;
|
|
933
|
+
function oa(e) {
|
|
934
934
|
return e.startsWith("_");
|
|
935
935
|
}
|
|
936
|
-
var
|
|
936
|
+
var sa = {
|
|
937
937
|
production: {
|
|
938
938
|
fg: "#C2362C",
|
|
939
939
|
bg: "#FAE8E6",
|
|
@@ -955,16 +955,16 @@ var aa = {
|
|
|
955
955
|
darkFg: "#5AB3EA",
|
|
956
956
|
darkBg: "rgba(90,179,234,0.14)"
|
|
957
957
|
}
|
|
958
|
-
},
|
|
958
|
+
}, ca = {
|
|
959
959
|
fg: "#5B6270",
|
|
960
960
|
bg: "#F3F4F7",
|
|
961
961
|
border: "#E6E8EE"
|
|
962
962
|
};
|
|
963
|
-
function
|
|
964
|
-
return e ?
|
|
963
|
+
function la(e) {
|
|
964
|
+
return e ? sa[e] ?? ca : sa.production;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
let [c, l] = X(!1), [d, f] = X(""), p = Y(null), m = e?.env || "production", h =
|
|
966
|
+
function ua({ tenant: e, tenants: t, onSwitch: r, busy: i, compact: a, locked: o, lockedReason: s }) {
|
|
967
|
+
let [c, l] = X(!1), [d, f] = X(""), p = Y(null), m = e?.env || "production", h = la(m), g = e?.name || "—", _ = e?.role || "—", v = J(() => t.filter((e) => e.is_member !== !1), [t]), y = J(() => t.filter((e) => e.is_member === !1), [t]), b = t.length >= aa, x = (e) => {
|
|
968
968
|
if (!d) return !0;
|
|
969
969
|
let t = d.toLowerCase();
|
|
970
970
|
return e.name.toLowerCase().includes(t) || e.code.toLowerCase().includes(t);
|
|
@@ -1145,7 +1145,7 @@ function ca({ tenant: e, tenants: t, onSwitch: r, busy: i, compact: a, locked: o
|
|
|
1145
1145
|
overflowY: "auto"
|
|
1146
1146
|
},
|
|
1147
1147
|
children: [
|
|
1148
|
-
/* @__PURE__ */ Q(
|
|
1148
|
+
/* @__PURE__ */ Q(da, {
|
|
1149
1149
|
label: y.length > 0 ? "Your tenants" : "Switch tenant",
|
|
1150
1150
|
tenants: S,
|
|
1151
1151
|
activeID: e?.id,
|
|
@@ -1153,7 +1153,7 @@ function ca({ tenant: e, tenants: t, onSwitch: r, busy: i, compact: a, locked: o
|
|
|
1153
1153
|
l(!1), r(e);
|
|
1154
1154
|
}
|
|
1155
1155
|
}),
|
|
1156
|
-
C.length > 0 && /* @__PURE__ */ Q(
|
|
1156
|
+
C.length > 0 && /* @__PURE__ */ Q(da, {
|
|
1157
1157
|
label: "All tenants (admin)",
|
|
1158
1158
|
tenants: C,
|
|
1159
1159
|
activeID: e?.id,
|
|
@@ -1198,7 +1198,7 @@ function ca({ tenant: e, tenants: t, onSwitch: r, busy: i, compact: a, locked: o
|
|
|
1198
1198
|
})]
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function da({ label: e, tenants: t, activeID: n, onPick: r }) {
|
|
1202
1202
|
return t.length === 0 ? null : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("div", {
|
|
1203
1203
|
style: {
|
|
1204
1204
|
padding: "6px 10px 4px",
|
|
@@ -1209,15 +1209,15 @@ function la({ label: e, tenants: t, activeID: n, onPick: r }) {
|
|
|
1209
1209
|
textTransform: "uppercase"
|
|
1210
1210
|
},
|
|
1211
1211
|
children: e
|
|
1212
|
-
}), t.map((e) => /* @__PURE__ */ Q(
|
|
1212
|
+
}), t.map((e) => /* @__PURE__ */ Q(fa, {
|
|
1213
1213
|
tenant: e,
|
|
1214
|
-
tone:
|
|
1214
|
+
tone: la(e.env),
|
|
1215
1215
|
active: e.id === n,
|
|
1216
1216
|
onPick: () => r(e)
|
|
1217
1217
|
}, e.id))] });
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1220
|
-
let [a, o] = X(!1), s = r || a ? "var(--surface-3)" : "transparent", c =
|
|
1219
|
+
function fa({ tenant: e, tone: t, active: r, onPick: i }) {
|
|
1220
|
+
let [a, o] = X(!1), s = r || a ? "var(--surface-3)" : "transparent", c = oa(e.code);
|
|
1221
1221
|
return /* @__PURE__ */ $("button", {
|
|
1222
1222
|
onClick: i,
|
|
1223
1223
|
onMouseEnter: () => o(!0),
|
|
@@ -1291,7 +1291,7 @@ function ua({ tenant: e, tone: t, active: r, onPick: i }) {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
//#endregion
|
|
1293
1293
|
//#region src/components/shared/Breadcrumbs.tsx
|
|
1294
|
-
function
|
|
1294
|
+
function pa({ items: e, onCrumbClick: t }) {
|
|
1295
1295
|
return !e || e.length === 0 ? null : /* @__PURE__ */ Q("nav", {
|
|
1296
1296
|
style: {
|
|
1297
1297
|
display: "flex",
|
|
@@ -1310,7 +1310,7 @@ function da({ items: e, onCrumbClick: t }) {
|
|
|
1310
1310
|
padding: "0 4px"
|
|
1311
1311
|
},
|
|
1312
1312
|
children: /* @__PURE__ */ Q(n.right, { size: 11 })
|
|
1313
|
-
}), /* @__PURE__ */ Q(
|
|
1313
|
+
}), /* @__PURE__ */ Q(ma, {
|
|
1314
1314
|
crumb: r,
|
|
1315
1315
|
last: a,
|
|
1316
1316
|
clickable: o,
|
|
@@ -1319,7 +1319,7 @@ function da({ items: e, onCrumbClick: t }) {
|
|
|
1319
1319
|
})
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function ma({ crumb: e, last: t, clickable: r, onClick: i }) {
|
|
1323
1323
|
let [a, o] = X(!1), s = e.icon && n[e.icon] ? n[e.icon] : n.folder;
|
|
1324
1324
|
return /* @__PURE__ */ $("button", {
|
|
1325
1325
|
onClick: () => {
|
|
@@ -1354,8 +1354,8 @@ function fa({ crumb: e, last: t, clickable: r, onClick: i }) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
//#endregion
|
|
1356
1356
|
//#region src/components/layout/TopBar.tsx
|
|
1357
|
-
function
|
|
1358
|
-
let y = B((e) => e.user), b = k(), { activeTenant: x, tenants: S, switchTenant: w, isSwitchingTenant: T, logout: E } =
|
|
1357
|
+
function ha({ breadcrumbs: e, onCrumbClick: t, onOpenNav: r, navButtonRef: i, showNavButton: a, onOpenTabs: o, tabsButtonRef: s, showTabsButton: c, mobileTabCount: l = 0, onCmdK: d, onToggleAI: f, aiOpen: p, onOpenProfile: m, onOpenPrefs: h, showTenantSwitcher: g = !0, showBreadcrumbs: _ = !0, showThemeToggle: v = !0 } = {}) {
|
|
1358
|
+
let y = B((e) => e.user), b = k(), { activeTenant: x, tenants: S, switchTenant: w, isSwitchingTenant: T, logout: E } = ra(), { isImpersonating: D, stop: O } = ia(), ee = G((e) => e.colorScheme), te = G((e) => e.set), [ne, re] = X(!1), ie = Y(null), ae = x?.env || "production", oe = la(ae), se = y?.email ?? "", ce = y?.display_name || se || "User", le = a && b.category === "phone", j = a && b.category !== "desktop", M = () => {
|
|
1359
1359
|
te("colorScheme", ee === "dark" ? "light" : "dark");
|
|
1360
1360
|
};
|
|
1361
1361
|
return /* @__PURE__ */ $("header", {
|
|
@@ -1395,7 +1395,7 @@ function pa({ breadcrumbs: e, onCrumbClick: t, onOpenNav: r, navButtonRef: i, sh
|
|
|
1395
1395
|
maxWidth: le ? "min(210px, 56vw)" : j ? 230 : void 0,
|
|
1396
1396
|
flex: le ? "1 1 auto" : "0 0 auto"
|
|
1397
1397
|
},
|
|
1398
|
-
children: /* @__PURE__ */ Q(
|
|
1398
|
+
children: /* @__PURE__ */ Q(ua, {
|
|
1399
1399
|
tenant: x,
|
|
1400
1400
|
tenants: S,
|
|
1401
1401
|
onSwitch: (e) => {
|
|
@@ -1431,7 +1431,7 @@ function pa({ breadcrumbs: e, onCrumbClick: t, onOpenNav: r, navButtonRef: i, sh
|
|
|
1431
1431
|
fontSize: 11
|
|
1432
1432
|
},
|
|
1433
1433
|
children: /* @__PURE__ */ Q(n.right, { size: 10 })
|
|
1434
|
-
}), /* @__PURE__ */ Q(
|
|
1434
|
+
}), /* @__PURE__ */ Q(pa, {
|
|
1435
1435
|
items: e ?? [],
|
|
1436
1436
|
onCrumbClick: t
|
|
1437
1437
|
})] }),
|
|
@@ -1633,8 +1633,8 @@ function pa({ breadcrumbs: e, onCrumbClick: t, onOpenNav: r, navButtonRef: i, sh
|
|
|
1633
1633
|
}
|
|
1634
1634
|
//#endregion
|
|
1635
1635
|
//#region src/components/layout/TabStrip.tsx
|
|
1636
|
-
function
|
|
1637
|
-
let i =
|
|
1636
|
+
function ga({ onNew: e, onCloseRequest: t } = {}) {
|
|
1637
|
+
let i = ci(), a = Y(null), o = Y(null), s = Y(null), c = Y(!1), [l, u] = X(!1), d = yr((e) => e.tabs), f = yr((e) => e.activeTabId), p = G((e) => e.tabsMaxOpen), m = yr((e) => e.switchTab), h = yr((e) => e.closeTab), g = d.findIndex((e) => e.id === f);
|
|
1638
1638
|
q(() => {
|
|
1639
1639
|
let e = g === d.length - 1 ? s.current : o.current;
|
|
1640
1640
|
e && (e.scrollIntoView({
|
|
@@ -1886,7 +1886,7 @@ function ma({ onNew: e, onCloseRequest: t } = {}) {
|
|
|
1886
1886
|
},
|
|
1887
1887
|
children: /* @__PURE__ */ Q(n.more, { size: 13 })
|
|
1888
1888
|
}),
|
|
1889
|
-
/* @__PURE__ */ Q(
|
|
1889
|
+
/* @__PURE__ */ Q(_a, {
|
|
1890
1890
|
open: l,
|
|
1891
1891
|
anchor: a.current,
|
|
1892
1892
|
onClose: () => u(!1),
|
|
@@ -1899,7 +1899,7 @@ function ma({ onNew: e, onCloseRequest: t } = {}) {
|
|
|
1899
1899
|
})]
|
|
1900
1900
|
});
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function _a({ open: e, anchor: t, onClose: r, canCloseCurrent: i, canCloseOthers: a, canCloseRight: o, onAction: s }) {
|
|
1903
1903
|
return /* @__PURE__ */ $(u, {
|
|
1904
1904
|
open: e,
|
|
1905
1905
|
onClose: r,
|
|
@@ -1940,7 +1940,7 @@ function ha({ open: e, anchor: t, onClose: r, canCloseCurrent: i, canCloseOthers
|
|
|
1940
1940
|
}
|
|
1941
1941
|
//#endregion
|
|
1942
1942
|
//#region src/components/layout/DirtyTabsCloseDialog.tsx
|
|
1943
|
-
function
|
|
1943
|
+
function va({ pending: e, onCancel: t, onCloseClean: i, onDiscardAll: a }) {
|
|
1944
1944
|
if (q(() => {
|
|
1945
1945
|
if (!e) return;
|
|
1946
1946
|
let n = (e) => {
|
|
@@ -2124,8 +2124,8 @@ function ga({ pending: e, onCancel: t, onCloseClean: i, onDiscardAll: a }) {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
//#endregion
|
|
2126
2126
|
//#region src/components/layout/ImpersonationBanner.tsx
|
|
2127
|
-
function
|
|
2128
|
-
let { info: e, stop: t, isStopping: n } =
|
|
2127
|
+
function ya() {
|
|
2128
|
+
let { info: e, stop: t, isStopping: n } = ia(), [r, i] = X(() => Date.now());
|
|
2129
2129
|
if (q(() => {
|
|
2130
2130
|
if (!e) return;
|
|
2131
2131
|
let t = window.setInterval(() => i(Date.now()), 1e3);
|
|
@@ -2196,8 +2196,8 @@ function _a() {
|
|
|
2196
2196
|
}
|
|
2197
2197
|
//#endregion
|
|
2198
2198
|
//#region src/components/layout/ImpersonationFrame.tsx
|
|
2199
|
-
function
|
|
2200
|
-
let { info: e } =
|
|
2199
|
+
function ba() {
|
|
2200
|
+
let { info: e } = ia(), { value: t } = Rt(e ? "impersonation.allow_destructive" : "", !1);
|
|
2201
2201
|
return q(() => {
|
|
2202
2202
|
if (!e) {
|
|
2203
2203
|
document.body.removeAttribute("data-impersonation-destructive");
|
|
@@ -2223,7 +2223,7 @@ function va() {
|
|
|
2223
2223
|
}
|
|
2224
2224
|
//#endregion
|
|
2225
2225
|
//#region src/components/layout/tab-close.ts
|
|
2226
|
-
function
|
|
2226
|
+
function xa(e, t, n, r) {
|
|
2227
2227
|
if (n === "current" && e.length <= 1) return null;
|
|
2228
2228
|
let i = In(e, t, n, r);
|
|
2229
2229
|
if (i.length === 0) return null;
|
|
@@ -2234,7 +2234,7 @@ function ya(e, t, n, r) {
|
|
|
2234
2234
|
cleanIds: i.filter((e) => !s.has(e))
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
|
-
function
|
|
2237
|
+
function Sa(e) {
|
|
2238
2238
|
return e ? {
|
|
2239
2239
|
pathname: e.pathname,
|
|
2240
2240
|
search: e.search || void 0
|
|
@@ -2245,7 +2245,7 @@ function ba(e) {
|
|
|
2245
2245
|
}
|
|
2246
2246
|
//#endregion
|
|
2247
2247
|
//#region src/components/shell/CommandPalette.tsx
|
|
2248
|
-
function
|
|
2248
|
+
function Ca(e, t = 14) {
|
|
2249
2249
|
if (!e) return null;
|
|
2250
2250
|
let i = n[e];
|
|
2251
2251
|
return i ? /* @__PURE__ */ Q(i, { size: t }) : /* @__PURE__ */ Q(r, {
|
|
@@ -2253,7 +2253,7 @@ function xa(e, t = 14) {
|
|
|
2253
2253
|
size: t
|
|
2254
2254
|
});
|
|
2255
2255
|
}
|
|
2256
|
-
function
|
|
2256
|
+
function wa(e, t, r) {
|
|
2257
2257
|
if (!e || !t) return [];
|
|
2258
2258
|
let i = [], a = (e) => {
|
|
2259
2259
|
if (e.screen) {
|
|
@@ -2262,7 +2262,7 @@ function Sa(e, t, r) {
|
|
|
2262
2262
|
let t = z(e.name) || e.screen;
|
|
2263
2263
|
i.push({
|
|
2264
2264
|
group: "Navigate",
|
|
2265
|
-
icon:
|
|
2265
|
+
icon: Ca(e.icon || a.display?.icon || "folder"),
|
|
2266
2266
|
label: `Go to ${t}`,
|
|
2267
2267
|
act: () => r({
|
|
2268
2268
|
type: "nav",
|
|
@@ -2289,14 +2289,14 @@ function Sa(e, t, r) {
|
|
|
2289
2289
|
for (let t of e) a(t);
|
|
2290
2290
|
return i;
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2292
|
+
function Ta({ open: e, onClose: t, onAction: r, mode: i = "default", navigation: a, screens: o, includeAI: s = !0, aiName: c = "" }) {
|
|
2293
2293
|
let [l, u] = X(""), [d, f] = X(0), p = Y(null), m = k().category === "phone";
|
|
2294
2294
|
q(() => {
|
|
2295
2295
|
e && (setTimeout(() => p.current?.focus(), 50), u(i === "new" ? "New " : ""), f(0));
|
|
2296
2296
|
}, [e, i]);
|
|
2297
2297
|
let h = J(() => {
|
|
2298
2298
|
let e = [];
|
|
2299
|
-
return e.push(...
|
|
2299
|
+
return e.push(...wa(a, o, r)), s && e.push({
|
|
2300
2300
|
group: "AI",
|
|
2301
2301
|
icon: /* @__PURE__ */ Q(n.sparkle, { size: 14 }),
|
|
2302
2302
|
label: "Draft YAML for new entity…",
|
|
@@ -2597,14 +2597,14 @@ function Ca({ open: e, onClose: t, onAction: r, mode: i = "default", navigation:
|
|
|
2597
2597
|
}
|
|
2598
2598
|
//#endregion
|
|
2599
2599
|
//#region src/api/agents.ts
|
|
2600
|
-
async function
|
|
2600
|
+
async function Ea(e) {
|
|
2601
2601
|
return (await H("agent_conversation", {
|
|
2602
2602
|
status: "active",
|
|
2603
2603
|
...e.agent_code ? { agent_code: e.agent_code } : {},
|
|
2604
2604
|
...e.context ? { context: e.context } : {}
|
|
2605
2605
|
})).data;
|
|
2606
2606
|
}
|
|
2607
|
-
async function
|
|
2607
|
+
async function Da(e, t, n) {
|
|
2608
2608
|
return (await H("agent_message", {
|
|
2609
2609
|
role: "user",
|
|
2610
2610
|
content: [{
|
|
@@ -2615,7 +2615,7 @@ async function Ta(e, t, n) {
|
|
|
2615
2615
|
seq: 0
|
|
2616
2616
|
})).data;
|
|
2617
2617
|
}
|
|
2618
|
-
async function
|
|
2618
|
+
async function Oa(e, t, n, r) {
|
|
2619
2619
|
return (await H("agent_message", {
|
|
2620
2620
|
role: "user",
|
|
2621
2621
|
content: [{
|
|
@@ -2627,30 +2627,30 @@ async function Ea(e, t, n, r) {
|
|
|
2627
2627
|
seq: 0
|
|
2628
2628
|
})).data;
|
|
2629
2629
|
}
|
|
2630
|
-
async function
|
|
2630
|
+
async function ka(e, t) {
|
|
2631
2631
|
let n = { status: "approved" };
|
|
2632
2632
|
t && (n.params = t), await st("agent_tool_invocation", e, n);
|
|
2633
2633
|
}
|
|
2634
|
-
async function
|
|
2634
|
+
async function Aa(e, t) {
|
|
2635
2635
|
await st("agent_tool_invocation", e, {
|
|
2636
2636
|
status: "rejected",
|
|
2637
2637
|
...t ? { approval: { reason: t } } : {}
|
|
2638
2638
|
});
|
|
2639
2639
|
}
|
|
2640
|
-
async function
|
|
2640
|
+
async function ja(e) {
|
|
2641
2641
|
await st("agent_conversation", e, { status: "canceling" });
|
|
2642
2642
|
}
|
|
2643
|
-
async function
|
|
2643
|
+
async function Ma() {
|
|
2644
2644
|
return (await pt("agent_conversation", {
|
|
2645
2645
|
sort: "updated_at:desc",
|
|
2646
2646
|
page: 1,
|
|
2647
2647
|
per_page: 50
|
|
2648
2648
|
})).data ?? [];
|
|
2649
2649
|
}
|
|
2650
|
-
async function
|
|
2650
|
+
async function Na(e) {
|
|
2651
2651
|
await Ue("agents.rerun_message_turn", { args: { conversation_id: e } });
|
|
2652
2652
|
}
|
|
2653
|
-
async function
|
|
2653
|
+
async function Pa(e) {
|
|
2654
2654
|
return (await pt("agent_tool_invocation", {
|
|
2655
2655
|
filters: [{
|
|
2656
2656
|
field: "conversation_id",
|
|
@@ -2665,7 +2665,7 @@ async function Ma(e) {
|
|
|
2665
2665
|
per_page: 200
|
|
2666
2666
|
})).data ?? [];
|
|
2667
2667
|
}
|
|
2668
|
-
async function
|
|
2668
|
+
async function Fa(e) {
|
|
2669
2669
|
return (await pt("agent_message", {
|
|
2670
2670
|
filters: [{
|
|
2671
2671
|
field: "conversation_id",
|
|
@@ -2678,16 +2678,16 @@ async function Na(e) {
|
|
|
2678
2678
|
}
|
|
2679
2679
|
//#endregion
|
|
2680
2680
|
//#region src/api/events.ts
|
|
2681
|
-
var
|
|
2682
|
-
function
|
|
2683
|
-
|
|
2681
|
+
var Ia = new EventTarget(), La = "agent-frame", Ra = "agent-message-changed";
|
|
2682
|
+
function za(e) {
|
|
2683
|
+
Ia.dispatchEvent(new CustomEvent(La, { detail: e }));
|
|
2684
2684
|
}
|
|
2685
|
-
var
|
|
2685
|
+
var Ba = class extends Error {
|
|
2686
2686
|
constructor() {
|
|
2687
2687
|
super("SSE auth expired"), this.name = "SSEAuthError";
|
|
2688
2688
|
}
|
|
2689
2689
|
};
|
|
2690
|
-
async function*
|
|
2690
|
+
async function* Va(e = {}) {
|
|
2691
2691
|
let t = new Headers();
|
|
2692
2692
|
e.lastEventID && t.set("Last-Event-ID", e.lastEventID), e.bearerToken && t.set("Authorization", `Bearer ${e.bearerToken}`);
|
|
2693
2693
|
let n = await fetch("/api/events", {
|
|
@@ -2695,7 +2695,7 @@ async function* za(e = {}) {
|
|
|
2695
2695
|
signal: e.signal,
|
|
2696
2696
|
headers: t
|
|
2697
2697
|
});
|
|
2698
|
-
if (n.status === 401) throw new
|
|
2698
|
+
if (n.status === 401) throw new Ba();
|
|
2699
2699
|
if (!n.ok || !n.body) throw Error(`SSE connection failed: ${n.status}`);
|
|
2700
2700
|
let r = n.body.getReader(), i = new TextDecoder(), a = "", o = "", s = "", c = "";
|
|
2701
2701
|
try {
|
|
@@ -2743,13 +2743,13 @@ async function* za(e = {}) {
|
|
|
2743
2743
|
} catch {
|
|
2744
2744
|
t = void 0;
|
|
2745
2745
|
}
|
|
2746
|
-
|
|
2746
|
+
za({
|
|
2747
2747
|
convId: e.ids[0],
|
|
2748
2748
|
kind: e.action,
|
|
2749
2749
|
turnId: e.ids[2],
|
|
2750
2750
|
payload: t
|
|
2751
2751
|
});
|
|
2752
|
-
} else e.entity === "agent_message" &&
|
|
2752
|
+
} else e.entity === "agent_message" && Ia.dispatchEvent(new CustomEvent(Ra, { detail: {
|
|
2753
2753
|
rowId: e.ids[0],
|
|
2754
2754
|
action: e.action
|
|
2755
2755
|
} })), yield {
|
|
@@ -2771,35 +2771,35 @@ async function* za(e = {}) {
|
|
|
2771
2771
|
}
|
|
2772
2772
|
//#endregion
|
|
2773
2773
|
//#region src/hooks/useAgentConversation.ts
|
|
2774
|
-
var
|
|
2774
|
+
var Ha = {
|
|
2775
2775
|
pendingTools: [],
|
|
2776
2776
|
elicits: [],
|
|
2777
2777
|
hints: [],
|
|
2778
2778
|
streaming: !1
|
|
2779
|
-
},
|
|
2780
|
-
function
|
|
2781
|
-
if (e) return `${
|
|
2779
|
+
}, Ua = "declarion.agents.conversation_id";
|
|
2780
|
+
function Wa(e) {
|
|
2781
|
+
if (e) return `${Ua}:${e}`;
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function Ga(e) {
|
|
2784
2784
|
if (typeof window > "u") return;
|
|
2785
|
-
let t =
|
|
2785
|
+
let t = Wa(e);
|
|
2786
2786
|
if (t) try {
|
|
2787
2787
|
return window.localStorage.getItem(t) || void 0;
|
|
2788
2788
|
} catch {
|
|
2789
2789
|
return;
|
|
2790
2790
|
}
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function Ka(e, t) {
|
|
2793
2793
|
if (typeof window > "u") return;
|
|
2794
|
-
let n =
|
|
2794
|
+
let n = Wa(e);
|
|
2795
2795
|
if (n) try {
|
|
2796
2796
|
t ? window.localStorage.setItem(n, t) : window.localStorage.removeItem(n);
|
|
2797
2797
|
} catch {}
|
|
2798
2798
|
}
|
|
2799
|
-
function
|
|
2799
|
+
function qa(e) {
|
|
2800
2800
|
return !(e instanceof O) || e.code !== "FOREIGN_KEY_VIOLATION" ? !1 : e.message.includes("agent_messages_tenant_conv_fk");
|
|
2801
2801
|
}
|
|
2802
|
-
function
|
|
2802
|
+
function Ja(e, t) {
|
|
2803
2803
|
return {
|
|
2804
2804
|
id: e,
|
|
2805
2805
|
conversation_id: t,
|
|
@@ -2810,14 +2810,14 @@ function Ka(e, t) {
|
|
|
2810
2810
|
streaming: !0
|
|
2811
2811
|
};
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2813
|
+
function Ya(e, t) {
|
|
2814
2814
|
let n = !1, r = e.map((e) => e.role !== "assistant" || !e.streaming || e.id === t ? e : (n = !0, {
|
|
2815
2815
|
...e,
|
|
2816
2816
|
streaming: !1
|
|
2817
2817
|
}));
|
|
2818
2818
|
return n ? r : e;
|
|
2819
2819
|
}
|
|
2820
|
-
function
|
|
2820
|
+
function Xa(e, t) {
|
|
2821
2821
|
let n = !1, r = [];
|
|
2822
2822
|
for (let i of e) {
|
|
2823
2823
|
if (i.id !== t || i.role !== "assistant") {
|
|
@@ -2837,19 +2837,19 @@ function Ja(e, t) {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
return n ? r : e;
|
|
2839
2839
|
}
|
|
2840
|
-
function
|
|
2840
|
+
function Za(e) {
|
|
2841
2841
|
let t = e;
|
|
2842
|
-
for (let n of e) n.role !== "assistant" || !n.streaming || (t =
|
|
2842
|
+
for (let n of e) n.role !== "assistant" || !n.streaming || (t = Xa(t, n.id));
|
|
2843
2843
|
return t;
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2845
|
+
function Qa(e, t, n, r) {
|
|
2846
2846
|
let i = !1, a = e.map((e) => e.id === n ? (i = !0, r(e)) : e);
|
|
2847
|
-
return i ? a : [...e, r(
|
|
2847
|
+
return i ? a : [...e, r(Ja(n, t))];
|
|
2848
2848
|
}
|
|
2849
|
-
function
|
|
2849
|
+
function $a(e, t, n, r) {
|
|
2850
2850
|
if (!r) return e;
|
|
2851
2851
|
let i = e.find((e) => e.id === n);
|
|
2852
|
-
return i && !i.streaming ? e :
|
|
2852
|
+
return i && !i.streaming ? e : Qa(Ya(e, n), t, n, (e) => {
|
|
2853
2853
|
let t = [...e.content], n = t[t.length - 1];
|
|
2854
2854
|
return n?.type === "text" ? t[t.length - 1] = {
|
|
2855
2855
|
...n,
|
|
@@ -2864,9 +2864,9 @@ function Za(e, t, n, r) {
|
|
|
2864
2864
|
};
|
|
2865
2865
|
});
|
|
2866
2866
|
}
|
|
2867
|
-
function
|
|
2867
|
+
function eo(e, t, n, r, i, a) {
|
|
2868
2868
|
let o = e.find((e) => e.id === n);
|
|
2869
|
-
return o && !o.streaming ? e :
|
|
2869
|
+
return o && !o.streaming ? e : Qa(Ya(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
|
|
2870
2870
|
...e,
|
|
2871
2871
|
streaming: !0
|
|
2872
2872
|
} : {
|
|
@@ -2880,7 +2880,7 @@ function Qa(e, t, n, r, i, a) {
|
|
|
2880
2880
|
}]
|
|
2881
2881
|
});
|
|
2882
2882
|
}
|
|
2883
|
-
function
|
|
2883
|
+
function to(e, t) {
|
|
2884
2884
|
let n = e.map((e) => e.streaming ? {
|
|
2885
2885
|
...e,
|
|
2886
2886
|
streaming: !1
|
|
@@ -2901,7 +2901,7 @@ function $a(e, t) {
|
|
|
2901
2901
|
}
|
|
2902
2902
|
return n;
|
|
2903
2903
|
}
|
|
2904
|
-
function
|
|
2904
|
+
function no(e, t, n, r, i, a, o) {
|
|
2905
2905
|
let s = [{
|
|
2906
2906
|
type: "tool_result",
|
|
2907
2907
|
id: r || n,
|
|
@@ -2927,7 +2927,7 @@ function eo(e, t, n, r, i, a, o) {
|
|
|
2927
2927
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2928
2928
|
}];
|
|
2929
2929
|
}
|
|
2930
|
-
function
|
|
2930
|
+
function ro(e) {
|
|
2931
2931
|
let t, n = -1;
|
|
2932
2932
|
for (let r = e.length - 1; r >= 0; r--) if (e[r].role === "assistant") {
|
|
2933
2933
|
t = e[r], n = r;
|
|
@@ -2944,17 +2944,17 @@ function to(e) {
|
|
|
2944
2944
|
for (let t = n + 1; t < e.length; t++) for (let n of e[t].content) n.type === "elicit_response" && n.id && i.add(n.id);
|
|
2945
2945
|
return r.filter((e) => !i.has(e.id));
|
|
2946
2946
|
}
|
|
2947
|
-
function
|
|
2947
|
+
function io(e) {
|
|
2948
2948
|
let t = e.payload?.message_id;
|
|
2949
2949
|
return typeof t == "string" && t ? t : void 0;
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2952
|
-
let t = B.getState().activeTenant?.id, [n, r] = X(e ??
|
|
2953
|
-
|
|
2954
|
-
}, [t]), [a, o] = X([]), [s, c] = X(
|
|
2951
|
+
function ao(e) {
|
|
2952
|
+
let t = B.getState().activeTenant?.id, [n, r] = X(e ?? Ga(t)), i = K((e) => {
|
|
2953
|
+
Ka(t, e), r(e);
|
|
2954
|
+
}, [t]), [a, o] = X([]), [s, c] = X(Ha), [l, u] = X([]), d = Y(/* @__PURE__ */ new Set()), f = Y(0);
|
|
2955
2955
|
q(() => {
|
|
2956
2956
|
if (!n) {
|
|
2957
|
-
o([]), c(
|
|
2957
|
+
o([]), c(Ha);
|
|
2958
2958
|
return;
|
|
2959
2959
|
}
|
|
2960
2960
|
if (d.current.has(n)) {
|
|
@@ -2962,21 +2962,21 @@ function ro(e) {
|
|
|
2962
2962
|
return;
|
|
2963
2963
|
}
|
|
2964
2964
|
let e = !1;
|
|
2965
|
-
return
|
|
2965
|
+
return Fa(n).then((t) => {
|
|
2966
2966
|
if (e) return;
|
|
2967
2967
|
let n = t.map((e) => e.streaming ? {
|
|
2968
2968
|
...e,
|
|
2969
2969
|
streaming: !1
|
|
2970
2970
|
} : e);
|
|
2971
2971
|
o(n);
|
|
2972
|
-
let r =
|
|
2972
|
+
let r = ro(n);
|
|
2973
2973
|
r.length > 0 && c((e) => ({
|
|
2974
2974
|
...e,
|
|
2975
2975
|
elicits: r
|
|
2976
2976
|
}));
|
|
2977
2977
|
}, (t) => {
|
|
2978
2978
|
e || t?.status === 404 && (i(void 0), o([]));
|
|
2979
|
-
}),
|
|
2979
|
+
}), Pa(n).then((t) => {
|
|
2980
2980
|
e || t.length !== 0 && c((e) => ({
|
|
2981
2981
|
...e,
|
|
2982
2982
|
pendingTools: t.map((e) => ({
|
|
@@ -3003,30 +3003,30 @@ function ro(e) {
|
|
|
3003
3003
|
payload: a
|
|
3004
3004
|
});
|
|
3005
3005
|
};
|
|
3006
|
-
|
|
3006
|
+
Ia.addEventListener(La, e);
|
|
3007
3007
|
let t = (e, t) => {
|
|
3008
3008
|
switch (t.kind) {
|
|
3009
3009
|
case "turn.started":
|
|
3010
3010
|
c((e) => ({
|
|
3011
|
-
...
|
|
3011
|
+
...Ha,
|
|
3012
3012
|
streaming: !0,
|
|
3013
3013
|
pendingTools: e.pendingTools,
|
|
3014
3014
|
elicits: e.elicits
|
|
3015
|
-
})), o((e) =>
|
|
3015
|
+
})), o((e) => Ya(e));
|
|
3016
3016
|
break;
|
|
3017
3017
|
case "assistant.message.created": {
|
|
3018
3018
|
let n = typeof t.payload?.message_id == "string" ? t.payload.message_id : "";
|
|
3019
3019
|
if (!n) break;
|
|
3020
|
-
o((t) =>
|
|
3020
|
+
o((t) => Qa(Ya(t, n), e, n, (e) => ({
|
|
3021
3021
|
...e,
|
|
3022
3022
|
streaming: !0
|
|
3023
3023
|
})));
|
|
3024
3024
|
break;
|
|
3025
3025
|
}
|
|
3026
3026
|
case "text.delta": {
|
|
3027
|
-
let n = U(t.payload?.text), r =
|
|
3027
|
+
let n = U(t.payload?.text), r = io(t);
|
|
3028
3028
|
if (!r || !n) break;
|
|
3029
|
-
o((t) =>
|
|
3029
|
+
o((t) => $a(t, e, r, n));
|
|
3030
3030
|
break;
|
|
3031
3031
|
}
|
|
3032
3032
|
case "elicit.pending": {
|
|
@@ -3057,9 +3057,9 @@ function ro(e) {
|
|
|
3057
3057
|
break;
|
|
3058
3058
|
}
|
|
3059
3059
|
case "tool.proposed": {
|
|
3060
|
-
let n =
|
|
3060
|
+
let n = io(t), r = typeof t.payload?.tool == "string" ? t.payload.tool : "", i = t.payload?.params ?? {}, a = typeof t.payload?.tool_use_id == "string" ? t.payload.tool_use_id : "";
|
|
3061
3061
|
if (!n || !r) break;
|
|
3062
|
-
o((t) =>
|
|
3062
|
+
o((t) => eo(t, e, n, a, r, i));
|
|
3063
3063
|
break;
|
|
3064
3064
|
}
|
|
3065
3065
|
case "tool.result":
|
|
@@ -3068,7 +3068,7 @@ function ro(e) {
|
|
|
3068
3068
|
let n = typeof t.payload?.tool_use_id == "string" ? t.payload.tool_use_id : "", r = typeof t.payload?.tool == "string" ? t.payload.tool : "result", i = t.payload?.output ?? (typeof t.payload?.error == "string" ? { error: t.payload.error } : {}), a = t.kind === "tool.failed" || t.payload?.is_error === !0;
|
|
3069
3069
|
if (n) {
|
|
3070
3070
|
let s = `local-tool-${t.turnId || "turn"}-${n}`;
|
|
3071
|
-
o((t) =>
|
|
3071
|
+
o((t) => no(t, e, s, n, r, i, a));
|
|
3072
3072
|
}
|
|
3073
3073
|
c((e) => ({
|
|
3074
3074
|
...e,
|
|
@@ -3088,16 +3088,16 @@ function ro(e) {
|
|
|
3088
3088
|
break;
|
|
3089
3089
|
case "turn.finished": {
|
|
3090
3090
|
c((e) => ({
|
|
3091
|
-
...
|
|
3091
|
+
...Ha,
|
|
3092
3092
|
pendingTools: e.pendingTools,
|
|
3093
3093
|
elicits: e.elicits
|
|
3094
3094
|
}));
|
|
3095
|
-
let e =
|
|
3096
|
-
e && o((t) =>
|
|
3095
|
+
let e = io(t);
|
|
3096
|
+
e && o((t) => Xa(t, e));
|
|
3097
3097
|
break;
|
|
3098
3098
|
}
|
|
3099
3099
|
case "error":
|
|
3100
|
-
o((e) =>
|
|
3100
|
+
o((e) => Za(e)), c((e) => ({
|
|
3101
3101
|
...e,
|
|
3102
3102
|
streaming: !1,
|
|
3103
3103
|
error: U(t.payload?.message ?? "stream error")
|
|
@@ -3108,23 +3108,23 @@ function ro(e) {
|
|
|
3108
3108
|
let e = p.current;
|
|
3109
3109
|
if (!e) return;
|
|
3110
3110
|
let t = ++f.current;
|
|
3111
|
-
|
|
3112
|
-
e === p.current && t === f.current && o((e) =>
|
|
3111
|
+
Fa(e).then((n) => {
|
|
3112
|
+
e === p.current && t === f.current && o((e) => to(n, e));
|
|
3113
3113
|
}, () => {});
|
|
3114
3114
|
};
|
|
3115
|
-
return
|
|
3116
|
-
|
|
3115
|
+
return Ia.addEventListener(Ra, n), () => {
|
|
3116
|
+
Ia.removeEventListener(La, e), Ia.removeEventListener(Ra, n);
|
|
3117
3117
|
};
|
|
3118
3118
|
}, []);
|
|
3119
3119
|
let m = K(async (e, t) => {
|
|
3120
3120
|
let r = n;
|
|
3121
|
-
r || (r = (await
|
|
3121
|
+
r || (r = (await Ea({ context: t })).id, d.current.add(r), p.current = r, i(r));
|
|
3122
3122
|
let s = a.length + 1, c;
|
|
3123
3123
|
try {
|
|
3124
|
-
c = await
|
|
3124
|
+
c = await Da(e, r, s);
|
|
3125
3125
|
} catch (n) {
|
|
3126
|
-
if (!
|
|
3127
|
-
r = (await
|
|
3126
|
+
if (!qa(n)) throw n;
|
|
3127
|
+
r = (await Ea({ context: t })).id, d.current.add(r), p.current = r, i(r), c = await Da(e, r, 1);
|
|
3128
3128
|
}
|
|
3129
3129
|
o((t) => t.some((e) => e.id === c.id) ? t : [...t, {
|
|
3130
3130
|
...c,
|
|
@@ -3141,19 +3141,19 @@ function ro(e) {
|
|
|
3141
3141
|
c((t) => ({
|
|
3142
3142
|
...t,
|
|
3143
3143
|
pendingTools: t.pendingTools.filter((t) => t.id !== e)
|
|
3144
|
-
})), await
|
|
3144
|
+
})), await ka(e, t);
|
|
3145
3145
|
}, []), g = K(async (e, t) => {
|
|
3146
3146
|
c((t) => ({
|
|
3147
3147
|
...t,
|
|
3148
3148
|
pendingTools: t.pendingTools.filter((t) => t.id !== e)
|
|
3149
|
-
})), await
|
|
3149
|
+
})), await Aa(e, t);
|
|
3150
3150
|
}, []), _ = K(async (e, t) => {
|
|
3151
3151
|
if (!n) return;
|
|
3152
3152
|
c((t) => ({
|
|
3153
3153
|
...t,
|
|
3154
3154
|
elicits: t.elicits.filter((t) => t.id !== e)
|
|
3155
3155
|
}));
|
|
3156
|
-
let r = a.length + 1, i = await
|
|
3156
|
+
let r = a.length + 1, i = await Oa(n, r, e, t);
|
|
3157
3157
|
o((n) => n.some((e) => e.id === i.id) ? n : [...n, {
|
|
3158
3158
|
...i,
|
|
3159
3159
|
content: [{
|
|
@@ -3169,13 +3169,13 @@ function ro(e) {
|
|
|
3169
3169
|
elicits: t.elicits.filter((t) => t.id !== e)
|
|
3170
3170
|
}));
|
|
3171
3171
|
let t = a.length + 1;
|
|
3172
|
-
await
|
|
3172
|
+
await Oa(n, t, e, { __canceled: !0 });
|
|
3173
3173
|
}, [n, a.length]), y = K(async () => {
|
|
3174
|
-
n && await
|
|
3174
|
+
n && await ja(n);
|
|
3175
3175
|
}, [n]), b = K(async () => {
|
|
3176
|
-
u(await
|
|
3176
|
+
u(await Ma());
|
|
3177
3177
|
}, []), x = K(() => {
|
|
3178
|
-
i(void 0), o([]), c(
|
|
3178
|
+
i(void 0), o([]), c(Ha);
|
|
3179
3179
|
}, [i]);
|
|
3180
3180
|
return {
|
|
3181
3181
|
conversationId: n,
|
|
@@ -3192,7 +3192,7 @@ function ro(e) {
|
|
|
3192
3192
|
n && (c((e) => ({
|
|
3193
3193
|
...e,
|
|
3194
3194
|
error: void 0
|
|
3195
|
-
})), await
|
|
3195
|
+
})), await Na(n));
|
|
3196
3196
|
}, [n]),
|
|
3197
3197
|
refreshConversations: b,
|
|
3198
3198
|
startNew: x,
|
|
@@ -3201,9 +3201,9 @@ function ro(e) {
|
|
|
3201
3201
|
}
|
|
3202
3202
|
//#endregion
|
|
3203
3203
|
//#region src/components/agents/AgentElicitForm.tsx
|
|
3204
|
-
function
|
|
3205
|
-
let [i, a] = X(() =>
|
|
3206
|
-
let e = (t.required ?? []).filter((e) =>
|
|
3204
|
+
function oo({ message: e, schema: t, onSubmit: n, onCancel: r }) {
|
|
3205
|
+
let [i, a] = X(() => fo(t)), [o, s] = X(null), c = () => {
|
|
3206
|
+
let e = (t.required ?? []).filter((e) => uo(i[e]));
|
|
3207
3207
|
if (e.length > 0) {
|
|
3208
3208
|
s(`Required: ${e.join(", ")}`);
|
|
3209
3209
|
return;
|
|
@@ -3219,7 +3219,7 @@ function io({ message: e, schema: t, onSubmit: n, onCancel: r }) {
|
|
|
3219
3219
|
}),
|
|
3220
3220
|
/* @__PURE__ */ Q("div", {
|
|
3221
3221
|
className: "space-y-2",
|
|
3222
|
-
children: l.map(([e, n]) => /* @__PURE__ */ Q(
|
|
3222
|
+
children: l.map(([e, n]) => /* @__PURE__ */ Q(so, {
|
|
3223
3223
|
name: e,
|
|
3224
3224
|
prop: n,
|
|
3225
3225
|
required: (t.required ?? []).includes(e),
|
|
@@ -3248,9 +3248,9 @@ function io({ message: e, schema: t, onSubmit: n, onCancel: r }) {
|
|
|
3248
3248
|
]
|
|
3249
3249
|
});
|
|
3250
3250
|
}
|
|
3251
|
-
function
|
|
3252
|
-
let a = (t.title ??
|
|
3253
|
-
return t.enum ? /* @__PURE__ */ Q(
|
|
3251
|
+
function so({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
3252
|
+
let a = (t.title ?? lo(e)) + (n ? " *" : ""), o = t.description;
|
|
3253
|
+
return t.enum ? /* @__PURE__ */ Q(co, {
|
|
3254
3254
|
label: a,
|
|
3255
3255
|
help: o,
|
|
3256
3256
|
children: /* @__PURE__ */ $("select", {
|
|
@@ -3265,7 +3265,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3265
3265
|
children: String(e)
|
|
3266
3266
|
}, String(e)))]
|
|
3267
3267
|
})
|
|
3268
|
-
}) : t.type === "boolean" ? /* @__PURE__ */ Q(
|
|
3268
|
+
}) : t.type === "boolean" ? /* @__PURE__ */ Q(co, {
|
|
3269
3269
|
label: a,
|
|
3270
3270
|
help: o,
|
|
3271
3271
|
children: /* @__PURE__ */ Q("input", {
|
|
@@ -3273,7 +3273,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3273
3273
|
checked: !!r,
|
|
3274
3274
|
onChange: (e) => i(e.target.checked)
|
|
3275
3275
|
})
|
|
3276
|
-
}) : t.type === "array" && t.items?.enum ? /* @__PURE__ */ Q(
|
|
3276
|
+
}) : t.type === "array" && t.items?.enum ? /* @__PURE__ */ Q(co, {
|
|
3277
3277
|
label: a,
|
|
3278
3278
|
help: o,
|
|
3279
3279
|
children: /* @__PURE__ */ Q("select", {
|
|
@@ -3288,7 +3288,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3288
3288
|
children: String(e)
|
|
3289
3289
|
}, String(e)))
|
|
3290
3290
|
})
|
|
3291
|
-
}) : t.type === "integer" || t.type === "number" ? /* @__PURE__ */ Q(
|
|
3291
|
+
}) : t.type === "integer" || t.type === "number" ? /* @__PURE__ */ Q(co, {
|
|
3292
3292
|
label: a,
|
|
3293
3293
|
help: o,
|
|
3294
3294
|
children: /* @__PURE__ */ Q("input", {
|
|
@@ -3302,7 +3302,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3302
3302
|
},
|
|
3303
3303
|
className: "w-full rounded-md border border-border bg-card p-2 text-sm"
|
|
3304
3304
|
})
|
|
3305
|
-
}) : t.format === "multiline" ? /* @__PURE__ */ Q(
|
|
3305
|
+
}) : t.format === "multiline" ? /* @__PURE__ */ Q(co, {
|
|
3306
3306
|
label: a,
|
|
3307
3307
|
help: o,
|
|
3308
3308
|
children: /* @__PURE__ */ Q("textarea", {
|
|
@@ -3311,7 +3311,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3311
3311
|
onChange: (e) => i(e.target.value),
|
|
3312
3312
|
className: "w-full rounded-md border border-border bg-card p-2 text-sm"
|
|
3313
3313
|
})
|
|
3314
|
-
}) : /* @__PURE__ */ Q(
|
|
3314
|
+
}) : /* @__PURE__ */ Q(co, {
|
|
3315
3315
|
label: a,
|
|
3316
3316
|
help: o,
|
|
3317
3317
|
children: /* @__PURE__ */ Q("input", {
|
|
@@ -3322,7 +3322,7 @@ function ao({ name: e, prop: t, required: n, value: r, onChange: i }) {
|
|
|
3322
3322
|
})
|
|
3323
3323
|
});
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function co({ label: e, help: t, children: n }) {
|
|
3326
3326
|
return /* @__PURE__ */ $("label", {
|
|
3327
3327
|
className: "block",
|
|
3328
3328
|
children: [
|
|
@@ -3338,25 +3338,25 @@ function oo({ label: e, help: t, children: n }) {
|
|
|
3338
3338
|
]
|
|
3339
3339
|
});
|
|
3340
3340
|
}
|
|
3341
|
-
function
|
|
3341
|
+
function lo(e) {
|
|
3342
3342
|
return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
3343
3343
|
}
|
|
3344
|
-
function
|
|
3344
|
+
function uo(e) {
|
|
3345
3345
|
return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
3346
3346
|
}
|
|
3347
|
-
function
|
|
3347
|
+
function fo(e) {
|
|
3348
3348
|
let t = {};
|
|
3349
3349
|
for (let [n, r] of Object.entries(e.properties ?? {})) r.default !== void 0 && (t[n] = r.default);
|
|
3350
3350
|
return t;
|
|
3351
3351
|
}
|
|
3352
3352
|
//#endregion
|
|
3353
3353
|
//#region src/components/agents/AgentChatPanel.tsx
|
|
3354
|
-
var
|
|
3355
|
-
function
|
|
3356
|
-
let a =
|
|
3354
|
+
var po = 80;
|
|
3355
|
+
function mo({ open: e, onClose: t, context: r, title: i = "" }) {
|
|
3356
|
+
let a = ao(), [o, s] = X(""), [c, l] = X(null), u = Y(null), d = Y(!0), [f, p] = X(!1), m = () => {
|
|
3357
3357
|
let e = u.current;
|
|
3358
3358
|
if (!e) return;
|
|
3359
|
-
let t = e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3359
|
+
let t = e.scrollHeight - e.scrollTop - e.clientHeight <= po;
|
|
3360
3360
|
d.current = t, t && f && p(!1);
|
|
3361
3361
|
}, h = (e = "smooth") => {
|
|
3362
3362
|
let t = u.current;
|
|
@@ -3456,7 +3456,7 @@ function fo({ open: e, onClose: t, context: r, title: i = "" }) {
|
|
|
3456
3456
|
a.messages.length > 0 && /* @__PURE__ */ Q(P, {
|
|
3457
3457
|
size: 24,
|
|
3458
3458
|
icon: /* @__PURE__ */ Q(n.copy, { size: 12 }),
|
|
3459
|
-
onClick: () => void
|
|
3459
|
+
onClick: () => void To(a.messages),
|
|
3460
3460
|
title: "Copy entire conversation"
|
|
3461
3461
|
}),
|
|
3462
3462
|
a.conversationId && /* @__PURE__ */ Q(P, {
|
|
@@ -3491,14 +3491,14 @@ function fo({ open: e, onClose: t, context: r, title: i = "" }) {
|
|
|
3491
3491
|
position: "relative"
|
|
3492
3492
|
},
|
|
3493
3493
|
children: [
|
|
3494
|
-
v && /* @__PURE__ */ Q(
|
|
3495
|
-
a.messages.map((e) => /* @__PURE__ */ Q(
|
|
3496
|
-
a.turn.pendingTools.map((e) => /* @__PURE__ */ Q(
|
|
3494
|
+
v && /* @__PURE__ */ Q(go, { children: "Hi — I can answer questions about your data, suggest actions, draft YAML definitions, and run allowed tools within your permissions. What would you like to do?" }),
|
|
3495
|
+
a.messages.map((e) => /* @__PURE__ */ Q(_o, { message: e }, e.id)),
|
|
3496
|
+
a.turn.pendingTools.map((e) => /* @__PURE__ */ Q(Do, {
|
|
3497
3497
|
tool: e,
|
|
3498
3498
|
onApprove: (t) => void a.approve(e.id, t),
|
|
3499
3499
|
onReject: (t) => void a.reject(e.id, t)
|
|
3500
3500
|
}, e.id)),
|
|
3501
|
-
a.turn.elicits.map((e) => /* @__PURE__ */ Q(
|
|
3501
|
+
a.turn.elicits.map((e) => /* @__PURE__ */ Q(oo, {
|
|
3502
3502
|
message: e.message,
|
|
3503
3503
|
schema: e.schema,
|
|
3504
3504
|
onSubmit: (t) => void a.submitElicit(e.id, t),
|
|
@@ -3600,7 +3600,7 @@ function fo({ open: e, onClose: t, context: r, title: i = "" }) {
|
|
|
3600
3600
|
borderRadius: 8
|
|
3601
3601
|
},
|
|
3602
3602
|
children: [
|
|
3603
|
-
/* @__PURE__ */ Q(
|
|
3603
|
+
/* @__PURE__ */ Q(xi, {
|
|
3604
3604
|
value: o,
|
|
3605
3605
|
onChange: (e) => s(e.target.value),
|
|
3606
3606
|
onKeyDown: _,
|
|
@@ -3676,7 +3676,7 @@ function fo({ open: e, onClose: t, context: r, title: i = "" }) {
|
|
|
3676
3676
|
]
|
|
3677
3677
|
});
|
|
3678
3678
|
}
|
|
3679
|
-
function
|
|
3679
|
+
function ho() {
|
|
3680
3680
|
return /* @__PURE__ */ Q("span", {
|
|
3681
3681
|
"aria-hidden": !0,
|
|
3682
3682
|
style: {
|
|
@@ -3690,7 +3690,7 @@ function po() {
|
|
|
3690
3690
|
}
|
|
3691
3691
|
});
|
|
3692
3692
|
}
|
|
3693
|
-
function
|
|
3693
|
+
function go({ children: e, dataMessageId: t, dataStreaming: r }) {
|
|
3694
3694
|
return /* @__PURE__ */ $("div", {
|
|
3695
3695
|
"data-message-id": t,
|
|
3696
3696
|
"data-streaming": r ? "true" : void 0,
|
|
@@ -3725,9 +3725,9 @@ function mo({ children: e, dataMessageId: t, dataStreaming: r }) {
|
|
|
3725
3725
|
})]
|
|
3726
3726
|
});
|
|
3727
3727
|
}
|
|
3728
|
-
function
|
|
3728
|
+
function _o({ message: e }) {
|
|
3729
3729
|
if (e.role === "user") {
|
|
3730
|
-
let t =
|
|
3730
|
+
let t = So(e.content), n = e.content.some((e) => e.type !== "text");
|
|
3731
3731
|
return t && !n ? /* @__PURE__ */ Q("div", {
|
|
3732
3732
|
style: {
|
|
3733
3733
|
alignSelf: "flex-end",
|
|
@@ -3742,18 +3742,18 @@ function ho({ message: e }) {
|
|
|
3742
3742
|
"data-message-id": e.id,
|
|
3743
3743
|
"data-streaming": e.streaming ? "true" : void 0,
|
|
3744
3744
|
children: t
|
|
3745
|
-
}) : /* @__PURE__ */ Q(
|
|
3745
|
+
}) : /* @__PURE__ */ Q(vo, { message: e });
|
|
3746
3746
|
}
|
|
3747
|
-
return e.role === "tool" ? /* @__PURE__ */ Q(
|
|
3747
|
+
return e.role === "tool" ? /* @__PURE__ */ Q(vo, { message: e }) : e.role === "system" ? e.content.some((e) => e.type === "decision") ? /* @__PURE__ */ Q(vo, { message: e }) : /* @__PURE__ */ Q(go, {
|
|
3748
3748
|
dataMessageId: e.id,
|
|
3749
|
-
children: e.content.map((e, t) => /* @__PURE__ */ Q(
|
|
3750
|
-
}) : e.content.length === 0 ? null : /* @__PURE__ */ $(
|
|
3749
|
+
children: e.content.map((e, t) => /* @__PURE__ */ Q(bo, { block: e }, t))
|
|
3750
|
+
}) : e.content.length === 0 ? null : /* @__PURE__ */ $(go, {
|
|
3751
3751
|
dataMessageId: e.id,
|
|
3752
3752
|
dataStreaming: e.streaming,
|
|
3753
|
-
children: [e.content.map((e, t) => /* @__PURE__ */ Q(
|
|
3753
|
+
children: [e.content.map((e, t) => /* @__PURE__ */ Q(bo, { block: e }, t)), e.streaming && /* @__PURE__ */ Q(ho, {})]
|
|
3754
3754
|
});
|
|
3755
3755
|
}
|
|
3756
|
-
function
|
|
3756
|
+
function vo({ message: e }) {
|
|
3757
3757
|
return /* @__PURE__ */ Q("div", {
|
|
3758
3758
|
"data-message-id": e.id,
|
|
3759
3759
|
"data-streaming": e.streaming ? "true" : void 0,
|
|
@@ -3764,10 +3764,10 @@ function go({ message: e }) {
|
|
|
3764
3764
|
flexDirection: "column",
|
|
3765
3765
|
alignItems: "flex-end"
|
|
3766
3766
|
},
|
|
3767
|
-
children: e.content.map((e, t) => /* @__PURE__ */ Q(
|
|
3767
|
+
children: e.content.map((e, t) => /* @__PURE__ */ Q(bo, { block: e }, t))
|
|
3768
3768
|
});
|
|
3769
3769
|
}
|
|
3770
|
-
var
|
|
3770
|
+
var yo = {
|
|
3771
3771
|
code({ node: e, inline: t, className: n, children: r, ...i }) {
|
|
3772
3772
|
return t ? /* @__PURE__ */ Q("code", {
|
|
3773
3773
|
...i,
|
|
@@ -3837,7 +3837,7 @@ var _o = {
|
|
|
3837
3837
|
});
|
|
3838
3838
|
}
|
|
3839
3839
|
};
|
|
3840
|
-
function
|
|
3840
|
+
function bo({ block: e }) {
|
|
3841
3841
|
switch (e.type) {
|
|
3842
3842
|
case "text": return /* @__PURE__ */ Q("div", {
|
|
3843
3843
|
className: "agent-md",
|
|
@@ -3846,30 +3846,30 @@ function vo({ block: e }) {
|
|
|
3846
3846
|
plugins: "gfm",
|
|
3847
3847
|
prose: !1,
|
|
3848
3848
|
skipHtml: !1,
|
|
3849
|
-
components:
|
|
3849
|
+
components: yo
|
|
3850
3850
|
})
|
|
3851
3851
|
});
|
|
3852
3852
|
case "tool_use": {
|
|
3853
|
-
let t =
|
|
3854
|
-
return /* @__PURE__ */ Q(
|
|
3853
|
+
let t = Co(e.name, e.input);
|
|
3854
|
+
return /* @__PURE__ */ Q(xo, {
|
|
3855
3855
|
kind: "call",
|
|
3856
3856
|
label: t.label,
|
|
3857
3857
|
sub: t.sub,
|
|
3858
3858
|
body: e.input
|
|
3859
3859
|
});
|
|
3860
3860
|
}
|
|
3861
|
-
case "tool_result": return /* @__PURE__ */ Q(
|
|
3861
|
+
case "tool_result": return /* @__PURE__ */ Q(xo, {
|
|
3862
3862
|
kind: "result",
|
|
3863
3863
|
label: e.name || (e.is_error ? "error" : "result"),
|
|
3864
3864
|
body: e.output,
|
|
3865
3865
|
isError: !!e.is_error
|
|
3866
3866
|
});
|
|
3867
|
-
case "elicit_response": return /* @__PURE__ */ Q(
|
|
3867
|
+
case "elicit_response": return /* @__PURE__ */ Q(xo, {
|
|
3868
3868
|
kind: "result",
|
|
3869
3869
|
label: "answer",
|
|
3870
3870
|
body: e.data
|
|
3871
3871
|
});
|
|
3872
|
-
case "decision": return /* @__PURE__ */ Q(
|
|
3872
|
+
case "decision": return /* @__PURE__ */ Q(wo, { block: e });
|
|
3873
3873
|
case "ui_hint": return /* @__PURE__ */ $("div", {
|
|
3874
3874
|
style: {
|
|
3875
3875
|
fontSize: 10.5,
|
|
@@ -3909,7 +3909,7 @@ function vo({ block: e }) {
|
|
|
3909
3909
|
default: return null;
|
|
3910
3910
|
}
|
|
3911
3911
|
}
|
|
3912
|
-
function
|
|
3912
|
+
function xo({ kind: e, label: t, sub: n, body: r, isError: i }) {
|
|
3913
3913
|
return /* @__PURE__ */ $("details", {
|
|
3914
3914
|
style: {
|
|
3915
3915
|
marginTop: 6,
|
|
@@ -3994,10 +3994,10 @@ function yo({ kind: e, label: t, sub: n, body: r, isError: i }) {
|
|
|
3994
3994
|
})]
|
|
3995
3995
|
});
|
|
3996
3996
|
}
|
|
3997
|
-
function
|
|
3997
|
+
function So(e) {
|
|
3998
3998
|
return e.map((e) => e.type === "text" ? e.text : "").join("");
|
|
3999
3999
|
}
|
|
4000
|
-
function
|
|
4000
|
+
function Co(e, t) {
|
|
4001
4001
|
if (e === "action.invoke") {
|
|
4002
4002
|
let e = typeof t?.code == "string" ? t.code : "";
|
|
4003
4003
|
if (e) return {
|
|
@@ -4007,7 +4007,7 @@ function xo(e, t) {
|
|
|
4007
4007
|
}
|
|
4008
4008
|
return { label: e };
|
|
4009
4009
|
}
|
|
4010
|
-
function
|
|
4010
|
+
function wo({ block: e }) {
|
|
4011
4011
|
let t = e.decision === "approved", n = t ? "var(--success)" : "var(--destructive)";
|
|
4012
4012
|
return /* @__PURE__ */ $("div", {
|
|
4013
4013
|
style: {
|
|
@@ -4055,10 +4055,10 @@ function So({ block: e }) {
|
|
|
4055
4055
|
]
|
|
4056
4056
|
});
|
|
4057
4057
|
}
|
|
4058
|
-
async function
|
|
4058
|
+
async function To(e) {
|
|
4059
4059
|
let t = [];
|
|
4060
4060
|
for (let n of e) {
|
|
4061
|
-
let e = `[${n.role}]`, r = n.content.map(
|
|
4061
|
+
let e = `[${n.role}]`, r = n.content.map(Eo).filter((e) => e.length > 0).join("\n");
|
|
4062
4062
|
r && t.push(`${e}\n${r}`);
|
|
4063
4063
|
}
|
|
4064
4064
|
let n = t.join("\n\n");
|
|
@@ -4068,11 +4068,11 @@ async function Co(e) {
|
|
|
4068
4068
|
console.error("agent: copyTranscript failed", e);
|
|
4069
4069
|
}
|
|
4070
4070
|
}
|
|
4071
|
-
function
|
|
4071
|
+
function Eo(e) {
|
|
4072
4072
|
switch (e.type) {
|
|
4073
4073
|
case "text": return e.text;
|
|
4074
4074
|
case "tool_use": {
|
|
4075
|
-
let t =
|
|
4075
|
+
let t = Co(e.name, e.input);
|
|
4076
4076
|
return `${t.sub ? `→ ${t.label} (${t.sub})` : `→ ${t.label}`}\n${JSON.stringify(e.input, null, 2)}`;
|
|
4077
4077
|
}
|
|
4078
4078
|
case "tool_result": return `${`${e.is_error ? "✗" : "✓"} ${e.name || (e.is_error ? "error" : "result")}`}\n${JSON.stringify(e.output, null, 2)}`;
|
|
@@ -4085,7 +4085,7 @@ function wo(e) {
|
|
|
4085
4085
|
default: return "";
|
|
4086
4086
|
}
|
|
4087
4087
|
}
|
|
4088
|
-
function
|
|
4088
|
+
function Do({ tool: e, onApprove: t, onReject: r }) {
|
|
4089
4089
|
let i = JSON.stringify(e.params ?? {}, null, 2), [a, o] = X(i), [s, c] = X(!1), [l, u] = X(!1), [d, f] = X(""), [p, m] = X(null), [h, g] = X(!1), _ = () => {
|
|
4090
4090
|
if (h) return;
|
|
4091
4091
|
let e;
|
|
@@ -4264,19 +4264,19 @@ function To({ tool: e, onApprove: t, onReject: r }) {
|
|
|
4264
4264
|
}
|
|
4265
4265
|
//#endregion
|
|
4266
4266
|
//#region src/hooks/useSSE.ts
|
|
4267
|
-
var
|
|
4268
|
-
function
|
|
4267
|
+
var Oo = 3e4, ko = 1e3, Ao = 3e3, jo = 50;
|
|
4268
|
+
function Mo() {
|
|
4269
4269
|
return typeof document > "u" ? !0 : document.visibilityState !== "hidden";
|
|
4270
4270
|
}
|
|
4271
|
-
function
|
|
4272
|
-
let [e, t] = X(
|
|
4271
|
+
function No() {
|
|
4272
|
+
let [e, t] = X(Mo);
|
|
4273
4273
|
return q(() => {
|
|
4274
4274
|
if (typeof document > "u") return;
|
|
4275
|
-
let e = () => t(
|
|
4275
|
+
let e = () => t(Mo());
|
|
4276
4276
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
4277
4277
|
}, []), e;
|
|
4278
4278
|
}
|
|
4279
|
-
function
|
|
4279
|
+
function Po(e, t) {
|
|
4280
4280
|
if (t.length === 0) return;
|
|
4281
4281
|
let n = /* @__PURE__ */ new Map();
|
|
4282
4282
|
for (let e of t) {
|
|
@@ -4290,24 +4290,24 @@ function Mo(e, t) {
|
|
|
4290
4290
|
}), e.invalidateQueries({ queryKey: [Dr, t] }), e.invalidateQueries({ predicate: (e) => {
|
|
4291
4291
|
let n = e.queryKey;
|
|
4292
4292
|
return n[0] === "entity-children" && n[3] === t;
|
|
4293
|
-
} }), r.mutated && e.invalidateQueries({ queryKey: ["entity-item", t] }), t ===
|
|
4293
|
+
} }), r.mutated && e.invalidateQueries({ queryKey: ["entity-item", t] }), t === Fo && e.invalidateQueries({ predicate: (e) => e.queryKey[0] === Yt });
|
|
4294
4294
|
}
|
|
4295
|
-
var
|
|
4296
|
-
function
|
|
4295
|
+
var Fo = "generated_document";
|
|
4296
|
+
function Io(e, t, n) {
|
|
4297
4297
|
let r = e.getQueryData(["schema", t]), i = lr.getState().degradedEntities;
|
|
4298
4298
|
return n.filter((e) => Sn(r?.entities?.[e.entity]?.realtime, i, e.entity));
|
|
4299
4299
|
}
|
|
4300
|
-
function
|
|
4300
|
+
function Lo(e) {
|
|
4301
4301
|
return e[0] === "entity-data" || e[0] === "entity-count" || e[0] === "entity-item" || e[0] === "entity-children";
|
|
4302
4302
|
}
|
|
4303
|
-
function
|
|
4303
|
+
function Ro(e) {
|
|
4304
4304
|
e.invalidateQueries({
|
|
4305
|
-
predicate: (e) =>
|
|
4305
|
+
predicate: (e) => Lo(e.queryKey),
|
|
4306
4306
|
refetchType: "active"
|
|
4307
4307
|
});
|
|
4308
4308
|
}
|
|
4309
|
-
function
|
|
4310
|
-
let e = B((e) => e.isAuthenticated), t = B((e) => e.activeTenant?.id ?? ""), n =
|
|
4309
|
+
function zo() {
|
|
4310
|
+
let e = B((e) => e.isAuthenticated), t = B((e) => e.activeTenant?.id ?? ""), n = yi(), r = Y(null), i = Y(""), a = Y(""), o = No(), s = Y(!o);
|
|
4311
4311
|
q(() => {
|
|
4312
4312
|
if (!e) {
|
|
4313
4313
|
i.current = "", a.current = "", s.current = !o;
|
|
@@ -4317,20 +4317,20 @@ function Lo() {
|
|
|
4317
4317
|
s.current = !0, r.current?.abort(), r.current = null;
|
|
4318
4318
|
return;
|
|
4319
4319
|
}
|
|
4320
|
-
s.current && (s.current = !1,
|
|
4320
|
+
s.current && (s.current = !1, Ro(n)), a.current !== t && (i.current = "", a.current = t);
|
|
4321
4321
|
let c = !0, l = 0, u = [], d = null, f = null, p = () => {
|
|
4322
4322
|
if (f !== null) return;
|
|
4323
|
-
let e = Math.random() *
|
|
4323
|
+
let e = Math.random() * Ao;
|
|
4324
4324
|
f = setTimeout(() => {
|
|
4325
|
-
f = null, c &&
|
|
4325
|
+
f = null, c && Ro(n);
|
|
4326
4326
|
}, e);
|
|
4327
4327
|
}, m = () => {
|
|
4328
4328
|
if (d = null, u.length === 0) return;
|
|
4329
4329
|
let t = u.splice(0, u.length);
|
|
4330
|
-
|
|
4330
|
+
Po(n, Io(n, e, t));
|
|
4331
4331
|
for (let e of t) e.eventID && (i.current = e.eventID);
|
|
4332
4332
|
}, h = () => {
|
|
4333
|
-
d === null && (d = setTimeout(m,
|
|
4333
|
+
d === null && (d = setTimeout(m, jo));
|
|
4334
4334
|
};
|
|
4335
4335
|
async function g() {
|
|
4336
4336
|
for (; c;) {
|
|
@@ -4338,7 +4338,7 @@ function Lo() {
|
|
|
4338
4338
|
r.current = e, l = 0;
|
|
4339
4339
|
let t = be(), a = t ? kt() : null;
|
|
4340
4340
|
try {
|
|
4341
|
-
for await (let r of
|
|
4341
|
+
for await (let r of Va({
|
|
4342
4342
|
signal: e.signal,
|
|
4343
4343
|
lastEventID: i.current,
|
|
4344
4344
|
bearerToken: a ?? void 0,
|
|
@@ -4360,7 +4360,7 @@ function Lo() {
|
|
|
4360
4360
|
continue;
|
|
4361
4361
|
}
|
|
4362
4362
|
if (r.type === "realtime_degraded") {
|
|
4363
|
-
r.eventID && (i.current = r.eventID), lr.getState().markDegraded(r.entity),
|
|
4363
|
+
r.eventID && (i.current = r.eventID), lr.getState().markDegraded(r.entity), Po(n, [{
|
|
4364
4364
|
entity: r.entity,
|
|
4365
4365
|
action: "updated"
|
|
4366
4366
|
}]);
|
|
@@ -4374,7 +4374,7 @@ function Lo() {
|
|
|
4374
4374
|
}
|
|
4375
4375
|
} catch (e) {
|
|
4376
4376
|
if (!c || e instanceof DOMException && e.name === "AbortError") break;
|
|
4377
|
-
if (e instanceof
|
|
4377
|
+
if (e instanceof Ba) {
|
|
4378
4378
|
if (t) try {
|
|
4379
4379
|
fe(), await ne(), l = 0;
|
|
4380
4380
|
continue;
|
|
@@ -4394,7 +4394,7 @@ function Lo() {
|
|
|
4394
4394
|
}
|
|
4395
4395
|
}
|
|
4396
4396
|
if (c) {
|
|
4397
|
-
let e = Math.min(
|
|
4397
|
+
let e = Math.min(ko * 2 ** l, Oo), t = e * .5 * Math.random();
|
|
4398
4398
|
await new Promise((n) => setTimeout(n, e + t)), l++;
|
|
4399
4399
|
}
|
|
4400
4400
|
}
|
|
@@ -4411,22 +4411,22 @@ function Lo() {
|
|
|
4411
4411
|
}
|
|
4412
4412
|
//#endregion
|
|
4413
4413
|
//#region src/components/layout/Layout.tsx
|
|
4414
|
-
var
|
|
4415
|
-
function
|
|
4416
|
-
|
|
4417
|
-
let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = B(), i = we(), a =
|
|
4414
|
+
var Bo = "default";
|
|
4415
|
+
function Vo() {
|
|
4416
|
+
Yi(), Ht();
|
|
4417
|
+
let { isAuthenticated: e, isLoading: t, user: n, activeTenant: r } = B(), i = we(), a = ci(), o = Un(), s = K((e) => o(e, { topLevel: !0 }), [o]), c = oi(), { data: l } = et(), u = k(), d = G((e) => e.sidebar), f = G((e) => e.tabsPosition), p = G((e) => e.aiSurface), m = G((e) => e.colorScheme), h = G((e) => e.set), g = G((e) => e.hydrateFromBranding), { branding: _ } = Vt(), v = nn(), y = yr((e) => e.tabs), b = yr((e) => e.activeTabId), x = yr((e) => e.closeTabs), S = yr((e) => e.switchTab), C = yr((e) => e.setScope), w = yr((e) => e.hydrate), [T, E] = X(Bo), [D, O] = X(!1), [ee, ne] = X("default"), [re, A] = X(!1), [ie, ae] = X(!1), [oe, se] = X(!1), ce = Y(null), le = Y(null), [j, M] = X(null), N = p !== "off" && v.isVisible("show_command_palette"), ue = p === "panel" || p === "both", de = p === "command" || p === "both", fe = Nt(), pe = fe?.ai_name?.trim() ?? "", me = u.category === "phone" || u.category === "tablet", he = v.isVisible("show_topbar"), ge = !me && v.isVisible("show_rail"), _e = !me && v.isVisible("show_sidebar"), ve = !me && v.isVisible("show_tabs"), P = me && v.isVisible("show_sidebar"), F = me && v.isVisible("show_tabs"), ye = v.isVisible("show_tenant_switcher"), be = v.isVisible("show_breadcrumbs"), I = v.isVisible("show_theme_toggle"), L = K((e = "default") => {
|
|
4418
4418
|
N && (ne(e), O(!0));
|
|
4419
4419
|
}, [N]), xe = K((e) => {
|
|
4420
4420
|
if (e.length === 0) return;
|
|
4421
4421
|
let t = yr.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = x(e);
|
|
4422
4422
|
if (!n) return;
|
|
4423
|
-
let i =
|
|
4423
|
+
let i = Sa(r);
|
|
4424
4424
|
a({
|
|
4425
4425
|
pathname: i.pathname,
|
|
4426
4426
|
search: i.search
|
|
4427
4427
|
}, { replace: i.replace });
|
|
4428
4428
|
}, [x, a]), Se = K((e, t) => {
|
|
4429
|
-
let n = yr.getState(), r =
|
|
4429
|
+
let n = yr.getState(), r = xa(n.tabs, n.activeTabId, e, t);
|
|
4430
4430
|
if (r) {
|
|
4431
4431
|
if (r.dirtyTabs.length > 0) {
|
|
4432
4432
|
M(r);
|
|
@@ -4441,7 +4441,7 @@ function zo() {
|
|
|
4441
4441
|
}, [j, xe]), Ee = K(() => {
|
|
4442
4442
|
j && (M(null), xe(j.ids));
|
|
4443
4443
|
}, [j, xe]);
|
|
4444
|
-
|
|
4444
|
+
zo(), q(() => {
|
|
4445
4445
|
i.enabled || !t && !e && a(te(`${c.pathname}${c.search}${c.hash}`), { replace: !0 });
|
|
4446
4446
|
}, [
|
|
4447
4447
|
i.enabled,
|
|
@@ -4463,14 +4463,14 @@ function zo() {
|
|
|
4463
4463
|
g(_?.preferences);
|
|
4464
4464
|
}, [_, g]), q(() => {
|
|
4465
4465
|
if (!l) return;
|
|
4466
|
-
let e =
|
|
4466
|
+
let e = Xo(l.navigation, l.screens, c.pathname);
|
|
4467
4467
|
if (e) {
|
|
4468
4468
|
E(e);
|
|
4469
4469
|
return;
|
|
4470
4470
|
}
|
|
4471
4471
|
let t = T;
|
|
4472
|
-
if ((l.navigation ?? []).some((e) => (e.area ||
|
|
4473
|
-
let n = (l.navigation ?? [])[0]?.area ||
|
|
4472
|
+
if ((l.navigation ?? []).some((e) => (e.area || Bo) === t)) return;
|
|
4473
|
+
let n = (l.navigation ?? [])[0]?.area || Bo;
|
|
4474
4474
|
n !== t && E(n);
|
|
4475
4475
|
}, [
|
|
4476
4476
|
l,
|
|
@@ -4491,7 +4491,7 @@ function zo() {
|
|
|
4491
4491
|
d,
|
|
4492
4492
|
ue
|
|
4493
4493
|
]);
|
|
4494
|
-
let De = J(() => l ?
|
|
4494
|
+
let De = J(() => l ? Zo(l.navigation, l.screens, c.pathname, y, b, s) : [], [
|
|
4495
4495
|
l,
|
|
4496
4496
|
c.pathname,
|
|
4497
4497
|
y,
|
|
@@ -4512,7 +4512,7 @@ function zo() {
|
|
|
4512
4512
|
if (!e) return null;
|
|
4513
4513
|
let Oe = (e) => {
|
|
4514
4514
|
E(e);
|
|
4515
|
-
let t =
|
|
4515
|
+
let t = Yo(e, l);
|
|
4516
4516
|
t && s(t);
|
|
4517
4517
|
}, ke = (e) => {
|
|
4518
4518
|
switch (e.type) {
|
|
@@ -4538,22 +4538,22 @@ function zo() {
|
|
|
4538
4538
|
}
|
|
4539
4539
|
};
|
|
4540
4540
|
return i.enabled ? /* @__PURE__ */ $(mt, { children: [
|
|
4541
|
-
/* @__PURE__ */ Q(
|
|
4541
|
+
/* @__PURE__ */ Q(Xi, {}),
|
|
4542
|
+
/* @__PURE__ */ Q(Ui, {}),
|
|
4543
|
+
/* @__PURE__ */ Q(Zi, {}),
|
|
4544
|
+
/* @__PURE__ */ Q(Hi, {}),
|
|
4542
4545
|
/* @__PURE__ */ Q(Vi, {}),
|
|
4543
|
-
/* @__PURE__ */ Q(Yi, {}),
|
|
4544
|
-
/* @__PURE__ */ Q(Bi, {}),
|
|
4545
|
-
/* @__PURE__ */ Q(zi, {}),
|
|
4546
4546
|
/* @__PURE__ */ Q("div", {
|
|
4547
4547
|
id: "app-embed",
|
|
4548
4548
|
className: "flex min-h-0 flex-col overflow-auto",
|
|
4549
4549
|
style: { height: "var(--app-height)" },
|
|
4550
|
-
children: /* @__PURE__ */ Q(
|
|
4550
|
+
children: /* @__PURE__ */ Q(ni, {})
|
|
4551
4551
|
})
|
|
4552
4552
|
] }) : /* @__PURE__ */ Q(mt, { children: /* @__PURE__ */ $("div", {
|
|
4553
4553
|
id: "app",
|
|
4554
4554
|
"data-sidebar": d,
|
|
4555
4555
|
"data-mobile-shell": me ? "true" : void 0,
|
|
4556
|
-
style:
|
|
4556
|
+
style: Ho({
|
|
4557
4557
|
mobileShell: me,
|
|
4558
4558
|
showTopbar: he,
|
|
4559
4559
|
showRail: ge,
|
|
@@ -4561,9 +4561,9 @@ function zo() {
|
|
|
4561
4561
|
sidebarMode: d
|
|
4562
4562
|
}),
|
|
4563
4563
|
children: [
|
|
4564
|
-
/* @__PURE__ */ Q(
|
|
4565
|
-
/* @__PURE__ */ Q(
|
|
4566
|
-
he && /* @__PURE__ */ Q(
|
|
4564
|
+
/* @__PURE__ */ Q(ya, {}),
|
|
4565
|
+
/* @__PURE__ */ Q(ba, {}),
|
|
4566
|
+
he && /* @__PURE__ */ Q(ha, {
|
|
4567
4567
|
breadcrumbs: De,
|
|
4568
4568
|
onCrumbClick: (e) => e.onClick && e.onClick(),
|
|
4569
4569
|
showNavButton: P,
|
|
@@ -4582,7 +4582,7 @@ function zo() {
|
|
|
4582
4582
|
showBreadcrumbs: be,
|
|
4583
4583
|
showThemeToggle: I
|
|
4584
4584
|
}),
|
|
4585
|
-
ge && /* @__PURE__ */ Q(
|
|
4585
|
+
ge && /* @__PURE__ */ Q(ji, {
|
|
4586
4586
|
activeArea: T,
|
|
4587
4587
|
onPick: Oe,
|
|
4588
4588
|
onToggleAI: () => ue && A((e) => !e),
|
|
@@ -4591,7 +4591,7 @@ function zo() {
|
|
|
4591
4591
|
areas: l?.areas,
|
|
4592
4592
|
branding: fe
|
|
4593
4593
|
}),
|
|
4594
|
-
_e && /* @__PURE__ */ Q(
|
|
4594
|
+
_e && /* @__PURE__ */ Q(Qi, { activeArea: T }),
|
|
4595
4595
|
/* @__PURE__ */ $("main", {
|
|
4596
4596
|
style: {
|
|
4597
4597
|
gridArea: "main",
|
|
@@ -4601,7 +4601,7 @@ function zo() {
|
|
|
4601
4601
|
minWidth: 0
|
|
4602
4602
|
},
|
|
4603
4603
|
children: [
|
|
4604
|
-
ve && f === "top" && /* @__PURE__ */ Q(
|
|
4604
|
+
ve && f === "top" && /* @__PURE__ */ Q(ga, {
|
|
4605
4605
|
onNew: () => L("new"),
|
|
4606
4606
|
onCloseRequest: Se
|
|
4607
4607
|
}),
|
|
@@ -4613,15 +4613,15 @@ function zo() {
|
|
|
4613
4613
|
display: "flex",
|
|
4614
4614
|
flexDirection: "column"
|
|
4615
4615
|
},
|
|
4616
|
-
children: /* @__PURE__ */ Q(
|
|
4616
|
+
children: /* @__PURE__ */ Q(ni, {})
|
|
4617
4617
|
}),
|
|
4618
|
-
ve && f === "bottom" && /* @__PURE__ */ Q(
|
|
4618
|
+
ve && f === "bottom" && /* @__PURE__ */ Q(ga, {
|
|
4619
4619
|
onNew: () => L("new"),
|
|
4620
4620
|
onCloseRequest: Se
|
|
4621
4621
|
})
|
|
4622
4622
|
]
|
|
4623
4623
|
}),
|
|
4624
|
-
N && /* @__PURE__ */ Q(
|
|
4624
|
+
N && /* @__PURE__ */ Q(Ta, {
|
|
4625
4625
|
open: D,
|
|
4626
4626
|
mode: ee,
|
|
4627
4627
|
onClose: () => O(!1),
|
|
@@ -4631,12 +4631,12 @@ function zo() {
|
|
|
4631
4631
|
includeAI: de,
|
|
4632
4632
|
aiName: pe
|
|
4633
4633
|
}),
|
|
4634
|
-
ue && re && /* @__PURE__ */ Q(
|
|
4634
|
+
ue && re && /* @__PURE__ */ Q(mo, {
|
|
4635
4635
|
open: re,
|
|
4636
4636
|
onClose: () => A(!1),
|
|
4637
4637
|
title: pe
|
|
4638
4638
|
}),
|
|
4639
|
-
P && /* @__PURE__ */ Q(
|
|
4639
|
+
P && /* @__PURE__ */ Q(qo, {
|
|
4640
4640
|
open: ie,
|
|
4641
4641
|
activeArea: T,
|
|
4642
4642
|
schema: l,
|
|
@@ -4644,7 +4644,7 @@ function zo() {
|
|
|
4644
4644
|
onClose: () => ae(!1),
|
|
4645
4645
|
onNavigate: s
|
|
4646
4646
|
}),
|
|
4647
|
-
F && /* @__PURE__ */ Q(
|
|
4647
|
+
F && /* @__PURE__ */ Q(Jo, {
|
|
4648
4648
|
open: oe,
|
|
4649
4649
|
tabs: y,
|
|
4650
4650
|
activeTabId: b,
|
|
@@ -4658,7 +4658,7 @@ function zo() {
|
|
|
4658
4658
|
},
|
|
4659
4659
|
onCloseTab: (e) => Se("current", e)
|
|
4660
4660
|
}),
|
|
4661
|
-
/* @__PURE__ */ Q(
|
|
4661
|
+
/* @__PURE__ */ Q(va, {
|
|
4662
4662
|
pending: j,
|
|
4663
4663
|
onCancel: Ce,
|
|
4664
4664
|
onCloseClean: Te,
|
|
@@ -4667,7 +4667,7 @@ function zo() {
|
|
|
4667
4667
|
]
|
|
4668
4668
|
}) });
|
|
4669
4669
|
}
|
|
4670
|
-
function
|
|
4670
|
+
function Ho({ mobileShell: e, showTopbar: t, showRail: n, showSidebar: r, sidebarMode: i }) {
|
|
4671
4671
|
let a = t ? "var(--topbar-h) minmax(0, 1fr)" : "minmax(0, 1fr)";
|
|
4672
4672
|
if (e) return {
|
|
4673
4673
|
height: "var(--app-height)",
|
|
@@ -4689,7 +4689,7 @@ function Bo({ mobileShell: e, showTopbar: t, showRail: n, showSidebar: r, sideba
|
|
|
4689
4689
|
overflow: "hidden"
|
|
4690
4690
|
};
|
|
4691
4691
|
}
|
|
4692
|
-
var
|
|
4692
|
+
var Uo = [
|
|
4693
4693
|
"a[href]",
|
|
4694
4694
|
"button:not([disabled])",
|
|
4695
4695
|
"input:not([disabled])",
|
|
@@ -4697,14 +4697,14 @@ var Vo = [
|
|
|
4697
4697
|
"textarea:not([disabled])",
|
|
4698
4698
|
"[tabindex]:not([tabindex='-1'])"
|
|
4699
4699
|
].join(",");
|
|
4700
|
-
function
|
|
4701
|
-
return e ? Array.from(e.querySelectorAll(
|
|
4700
|
+
function Wo(e) {
|
|
4701
|
+
return e ? Array.from(e.querySelectorAll(Uo)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
|
|
4702
4702
|
}
|
|
4703
|
-
function
|
|
4704
|
-
|
|
4703
|
+
function Go(e) {
|
|
4704
|
+
Wo(e)[0]?.focus();
|
|
4705
4705
|
}
|
|
4706
|
-
function
|
|
4707
|
-
let n =
|
|
4706
|
+
function Ko(e, t) {
|
|
4707
|
+
let n = Wo(e);
|
|
4708
4708
|
if (n.length === 0) {
|
|
4709
4709
|
t.preventDefault();
|
|
4710
4710
|
return;
|
|
@@ -4716,20 +4716,20 @@ function Wo(e, t) {
|
|
|
4716
4716
|
}
|
|
4717
4717
|
!t.shiftKey && a === i && (t.preventDefault(), r.focus());
|
|
4718
4718
|
}
|
|
4719
|
-
function
|
|
4719
|
+
function qo({ open: e, activeArea: t, schema: r, returnFocusRef: i, onClose: a, onNavigate: o }) {
|
|
4720
4720
|
let [s, c] = X(t), l = Y(null);
|
|
4721
4721
|
if (q(() => {
|
|
4722
4722
|
e && c(t);
|
|
4723
4723
|
}, [e, t]), q(() => {
|
|
4724
4724
|
if (!e) return;
|
|
4725
4725
|
let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = i.current;
|
|
4726
|
-
requestAnimationFrame(() =>
|
|
4726
|
+
requestAnimationFrame(() => Go(l.current));
|
|
4727
4727
|
let r = (e) => {
|
|
4728
4728
|
if (e.key === "Escape") {
|
|
4729
4729
|
e.preventDefault(), a();
|
|
4730
4730
|
return;
|
|
4731
4731
|
}
|
|
4732
|
-
e.key === "Tab" &&
|
|
4732
|
+
e.key === "Tab" && Ko(l.current, e);
|
|
4733
4733
|
};
|
|
4734
4734
|
return window.addEventListener("keydown", r), () => {
|
|
4735
4735
|
window.removeEventListener("keydown", r), (n ?? t)?.focus();
|
|
@@ -4739,11 +4739,11 @@ function Go({ open: e, activeArea: t, schema: r, returnFocusRef: i, onClose: a,
|
|
|
4739
4739
|
a,
|
|
4740
4740
|
i
|
|
4741
4741
|
]), !e || !r) return null;
|
|
4742
|
-
let u = Array.from(new Set((r.navigation ?? []).map((e) => e.area ||
|
|
4743
|
-
u.length === 0 && u.push(
|
|
4742
|
+
let u = Array.from(new Set((r.navigation ?? []).map((e) => e.area || Bo)));
|
|
4743
|
+
u.length === 0 && u.push(Bo);
|
|
4744
4744
|
let d = (e) => {
|
|
4745
4745
|
let t = r.areas?.find((t) => t.code === e);
|
|
4746
|
-
return z(t?.name) || (e ===
|
|
4746
|
+
return z(t?.name) || (e === Bo ? "Navigation" : e);
|
|
4747
4747
|
}, f = (e, t) => {
|
|
4748
4748
|
let n = e.screen ? r.screens[e.screen] : void 0, i = [...e.items ?? [], ...e.children ?? []], s = z(e.name) || (n ? z(n.display?.name) : "");
|
|
4749
4749
|
return /* @__PURE__ */ $("div", {
|
|
@@ -4854,7 +4854,7 @@ function Go({ open: e, activeArea: t, schema: r, returnFocusRef: i, onClose: a,
|
|
|
4854
4854
|
gap: 6
|
|
4855
4855
|
},
|
|
4856
4856
|
children: u.map((e) => {
|
|
4857
|
-
let i = s === e, a =
|
|
4857
|
+
let i = s === e, a = $i(r.navigation ?? [], e);
|
|
4858
4858
|
return /* @__PURE__ */ $("section", { children: [/* @__PURE__ */ $("button", {
|
|
4859
4859
|
type: "button",
|
|
4860
4860
|
onClick: () => c(i ? "" : e),
|
|
@@ -4899,18 +4899,18 @@ function Go({ open: e, activeArea: t, schema: r, returnFocusRef: i, onClose: a,
|
|
|
4899
4899
|
})]
|
|
4900
4900
|
})] });
|
|
4901
4901
|
}
|
|
4902
|
-
function
|
|
4902
|
+
function Jo({ open: e, tabs: t, activeTabId: r, returnFocusRef: i, onClose: a, onSwitch: o, onCloseTab: s }) {
|
|
4903
4903
|
let c = Y(null);
|
|
4904
4904
|
return q(() => {
|
|
4905
4905
|
if (!e) return;
|
|
4906
4906
|
let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = i.current;
|
|
4907
|
-
requestAnimationFrame(() =>
|
|
4907
|
+
requestAnimationFrame(() => Go(c.current));
|
|
4908
4908
|
let r = (e) => {
|
|
4909
4909
|
if (e.key === "Escape") {
|
|
4910
4910
|
e.preventDefault(), a();
|
|
4911
4911
|
return;
|
|
4912
4912
|
}
|
|
4913
|
-
e.key === "Tab" &&
|
|
4913
|
+
e.key === "Tab" && Ko(c.current, e);
|
|
4914
4914
|
};
|
|
4915
4915
|
return window.addEventListener("keydown", r), () => {
|
|
4916
4916
|
window.removeEventListener("keydown", r), (n ?? t)?.focus();
|
|
@@ -5017,7 +5017,7 @@ function Ko({ open: e, tabs: t, activeTabId: r, returnFocusRef: i, onClose: a, o
|
|
|
5017
5017
|
}, e.id))]
|
|
5018
5018
|
})] }) : null;
|
|
5019
5019
|
}
|
|
5020
|
-
function
|
|
5020
|
+
function Yo(e, t) {
|
|
5021
5021
|
if (!t) return;
|
|
5022
5022
|
let n = t.areas?.find((t) => t.code === e);
|
|
5023
5023
|
if (n?.home_screen) {
|
|
@@ -5039,12 +5039,12 @@ function qo(e, t) {
|
|
|
5039
5039
|
}
|
|
5040
5040
|
};
|
|
5041
5041
|
for (let n of t.navigation ?? []) {
|
|
5042
|
-
if ((n.area ||
|
|
5042
|
+
if ((n.area || Bo) !== e) continue;
|
|
5043
5043
|
let t = r(n);
|
|
5044
5044
|
if (t) return t;
|
|
5045
5045
|
}
|
|
5046
5046
|
}
|
|
5047
|
-
function
|
|
5047
|
+
function Xo(e, t, n) {
|
|
5048
5048
|
let r = (e) => {
|
|
5049
5049
|
if (!e.screen) return !1;
|
|
5050
5050
|
let r = t[e.screen];
|
|
@@ -5061,11 +5061,11 @@ function Jo(e, t, n) {
|
|
|
5061
5061
|
}
|
|
5062
5062
|
};
|
|
5063
5063
|
for (let t of e ?? []) {
|
|
5064
|
-
let e = i(t, t.area ||
|
|
5064
|
+
let e = i(t, t.area || Bo);
|
|
5065
5065
|
if (e) return e;
|
|
5066
5066
|
}
|
|
5067
5067
|
}
|
|
5068
|
-
function
|
|
5068
|
+
function Zo(e, t, n, r, i, a) {
|
|
5069
5069
|
let o = (e, r) => {
|
|
5070
5070
|
if (e.screen) {
|
|
5071
5071
|
let i = t[e.screen];
|
|
@@ -5108,7 +5108,7 @@ function Yo(e, t, n, r, i, a) {
|
|
|
5108
5108
|
}
|
|
5109
5109
|
//#endregion
|
|
5110
5110
|
//#region src/components/pages/auth/AuthShell.tsx
|
|
5111
|
-
function
|
|
5111
|
+
function Qo(e) {
|
|
5112
5112
|
if (e) {
|
|
5113
5113
|
if (e.en) return e.en;
|
|
5114
5114
|
for (let t of Object.keys(e)) {
|
|
@@ -5117,21 +5117,21 @@ function Xo(e) {
|
|
|
5117
5117
|
}
|
|
5118
5118
|
}
|
|
5119
5119
|
}
|
|
5120
|
-
function
|
|
5120
|
+
function $o(e) {
|
|
5121
5121
|
try {
|
|
5122
5122
|
return new URL(e).host;
|
|
5123
5123
|
} catch {
|
|
5124
5124
|
return e;
|
|
5125
5125
|
}
|
|
5126
5126
|
}
|
|
5127
|
-
function
|
|
5127
|
+
function es({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a, badges: o, brandName: s }) {
|
|
5128
5128
|
let c = G((e) => e.colorScheme), l = k(), u = G((e) => e.set), d = G((e) => e.hydrateFromBranding), f = () => u("colorScheme", c === "dark" ? "light" : "dark"), { branding: p } = Vt();
|
|
5129
5129
|
q(() => {
|
|
5130
5130
|
d(p?.preferences);
|
|
5131
5131
|
}, [p, d]);
|
|
5132
|
-
let m = p?.identity, h = s ?? m?.wordmark ?? m?.app_name ?? "", g = r ??
|
|
5132
|
+
let m = p?.identity, h = s ?? m?.wordmark ?? m?.app_name ?? "", g = r ?? Qo(m?.auth_tagline) ?? "", _ = i ?? Qo(m?.auth_subtagline) ?? "", v = a ?? m?.version_label ?? "", y = J(() => {
|
|
5133
5133
|
if (o && o.length) return o;
|
|
5134
|
-
let e = (m?.auth_badges ?? []).map((e) =>
|
|
5134
|
+
let e = (m?.auth_badges ?? []).map((e) => Qo(e)).filter((e) => !!e);
|
|
5135
5135
|
return e.length ? e.slice(0, 8).map((e) => [e, "shield"]) : [];
|
|
5136
5136
|
}, [o, m?.auth_badges]), b = m?.workspace_domain ?? "", x = !!(t && b), S = m?.status_url ?? "", C = !!S, w = m?.legal_links, T = J(() => [
|
|
5137
5137
|
["Security", w?.security_url ?? ""],
|
|
@@ -5162,7 +5162,7 @@ function Qo({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a,
|
|
|
5162
5162
|
gap: 10
|
|
5163
5163
|
},
|
|
5164
5164
|
children: [
|
|
5165
|
-
/* @__PURE__ */ Q(
|
|
5165
|
+
/* @__PURE__ */ Q(Pi, {
|
|
5166
5166
|
appLogo: m?.app_logo,
|
|
5167
5167
|
size: 26
|
|
5168
5168
|
}),
|
|
@@ -5264,7 +5264,7 @@ function Qo({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a,
|
|
|
5264
5264
|
position: "relative"
|
|
5265
5265
|
},
|
|
5266
5266
|
children: [
|
|
5267
|
-
/* @__PURE__ */ Q(
|
|
5267
|
+
/* @__PURE__ */ Q(Pi, {
|
|
5268
5268
|
appLogo: m?.app_logo,
|
|
5269
5269
|
size: 34
|
|
5270
5270
|
}),
|
|
@@ -5298,7 +5298,7 @@ function Qo({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a,
|
|
|
5298
5298
|
alignItems: "center",
|
|
5299
5299
|
gap: 16
|
|
5300
5300
|
},
|
|
5301
|
-
children: [m?.app_logo && /* @__PURE__ */ Q(
|
|
5301
|
+
children: [m?.app_logo && /* @__PURE__ */ Q(Pi, {
|
|
5302
5302
|
appLogo: m.app_logo,
|
|
5303
5303
|
size: 96,
|
|
5304
5304
|
radius: 0
|
|
@@ -5379,7 +5379,7 @@ function Qo({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a,
|
|
|
5379
5379
|
color: "var(--auth-panel-fg-muted)",
|
|
5380
5380
|
textDecoration: "none"
|
|
5381
5381
|
},
|
|
5382
|
-
children:
|
|
5382
|
+
children: $o(S)
|
|
5383
5383
|
})
|
|
5384
5384
|
]
|
|
5385
5385
|
})
|
|
@@ -5432,7 +5432,7 @@ function Qo({ children: e, tenantSlug: t, tagline: r, subTagline: i, version: a,
|
|
|
5432
5432
|
}
|
|
5433
5433
|
//#endregion
|
|
5434
5434
|
//#region src/components/pages/auth/icons.tsx
|
|
5435
|
-
function
|
|
5435
|
+
function ts({ size: e = 14 }) {
|
|
5436
5436
|
return /* @__PURE__ */ $("svg", {
|
|
5437
5437
|
width: e,
|
|
5438
5438
|
height: e,
|
|
@@ -5458,7 +5458,7 @@ function $o({ size: e = 14 }) {
|
|
|
5458
5458
|
]
|
|
5459
5459
|
});
|
|
5460
5460
|
}
|
|
5461
|
-
function
|
|
5461
|
+
function ns({ size: e = 14 }) {
|
|
5462
5462
|
return /* @__PURE__ */ $("svg", {
|
|
5463
5463
|
width: e,
|
|
5464
5464
|
height: e,
|
|
@@ -5486,90 +5486,90 @@ function es({ size: e = 14 }) {
|
|
|
5486
5486
|
}
|
|
5487
5487
|
//#endregion
|
|
5488
5488
|
//#region src/lib/schema-routing.ts
|
|
5489
|
-
var
|
|
5490
|
-
function
|
|
5489
|
+
var rs = /* @__PURE__ */ new Set(["/preferences", "/admin/catalog"]);
|
|
5490
|
+
function is(e) {
|
|
5491
5491
|
if (!e?.navigation) return null;
|
|
5492
5492
|
let t = e.areas ?? [];
|
|
5493
5493
|
if (t.length > 0) for (let n of t) for (let t of e.navigation) {
|
|
5494
5494
|
if ((t.area || "default") !== n.code) continue;
|
|
5495
|
-
let r =
|
|
5495
|
+
let r = cs(e, t);
|
|
5496
5496
|
if (r) return r;
|
|
5497
5497
|
}
|
|
5498
5498
|
for (let t of e.navigation) {
|
|
5499
|
-
let n =
|
|
5499
|
+
let n = cs(e, t);
|
|
5500
5500
|
if (n) return n;
|
|
5501
5501
|
}
|
|
5502
5502
|
return null;
|
|
5503
5503
|
}
|
|
5504
|
-
function
|
|
5505
|
-
let n =
|
|
5504
|
+
function as(e, t) {
|
|
5505
|
+
let n = is(t) || "/";
|
|
5506
5506
|
if (!t || e === "/" || e === "/admin") return n;
|
|
5507
|
-
let r =
|
|
5508
|
-
if (
|
|
5509
|
-
for (let n of Object.values(t.screens ?? {})) if (!(!n.route || !
|
|
5507
|
+
let r = os(e);
|
|
5508
|
+
if (rs.has(r)) return e;
|
|
5509
|
+
for (let n of Object.values(t.screens ?? {})) if (!(!n.route || !ls(t, n)) && us(n.route).test(r)) return e;
|
|
5510
5510
|
return n;
|
|
5511
5511
|
}
|
|
5512
|
-
function
|
|
5512
|
+
function os(e) {
|
|
5513
5513
|
let t = e.indexOf("#"), n = t >= 0 ? e.slice(0, t) : e, r = n.indexOf("?");
|
|
5514
5514
|
return (r >= 0 ? n.slice(0, r) : n).replace(/\/+$/, "") || "/";
|
|
5515
5515
|
}
|
|
5516
|
-
function
|
|
5516
|
+
function ss(e, t) {
|
|
5517
5517
|
let n = e.screens[t];
|
|
5518
|
-
return !!n &&
|
|
5518
|
+
return !!n && ls(e, n);
|
|
5519
5519
|
}
|
|
5520
|
-
function
|
|
5521
|
-
if (t.screen &&
|
|
5520
|
+
function cs(e, t) {
|
|
5521
|
+
if (t.screen && ss(e, t.screen)) return e.screens[t.screen].route;
|
|
5522
5522
|
for (let n of [...t.items ?? [], ...t.children ?? []]) {
|
|
5523
|
-
let t =
|
|
5523
|
+
let t = cs(e, n);
|
|
5524
5524
|
if (t) return t;
|
|
5525
5525
|
}
|
|
5526
5526
|
return null;
|
|
5527
5527
|
}
|
|
5528
|
-
function
|
|
5528
|
+
function ls(e, t) {
|
|
5529
5529
|
if (t.type !== "list") return !0;
|
|
5530
5530
|
let n = t.entity;
|
|
5531
5531
|
return !(n ? e.entities?.[n] : void 0)?.singleton;
|
|
5532
5532
|
}
|
|
5533
|
-
function
|
|
5533
|
+
function us(e) {
|
|
5534
5534
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
5535
5535
|
return RegExp("^" + t.join("/") + "$");
|
|
5536
5536
|
}
|
|
5537
5537
|
//#endregion
|
|
5538
5538
|
//#region src/lib/messages.ts
|
|
5539
|
-
var
|
|
5540
|
-
function
|
|
5539
|
+
var ds = "en";
|
|
5540
|
+
function fs(e, t, n, r = "") {
|
|
5541
5541
|
return z(e?.[t], n) || r;
|
|
5542
5542
|
}
|
|
5543
|
-
function
|
|
5543
|
+
function ps(e) {
|
|
5544
5544
|
let t = e?.find((e) => e.code === "ui_language")?.value;
|
|
5545
|
-
return typeof t == "string" && t.trim() ? t.trim() :
|
|
5545
|
+
return typeof t == "string" && t.trim() ? t.trim() : ms() || ds;
|
|
5546
5546
|
}
|
|
5547
|
-
function
|
|
5547
|
+
function ms() {
|
|
5548
5548
|
if (typeof navigator > "u") return;
|
|
5549
5549
|
let e = navigator.language;
|
|
5550
5550
|
if (e) return e.split("-")[0] || void 0;
|
|
5551
5551
|
}
|
|
5552
5552
|
//#endregion
|
|
5553
5553
|
//#region src/components/pages/auth/SignIn.tsx
|
|
5554
|
-
var
|
|
5554
|
+
var hs = "Invalid email or password.", gs = "You do not have access to that page. We opened your default page instead.", _s = {
|
|
5555
5555
|
google: {
|
|
5556
5556
|
label: "Continue with Google",
|
|
5557
|
-
icon: /* @__PURE__ */ Q(
|
|
5557
|
+
icon: /* @__PURE__ */ Q(ts, { size: 14 })
|
|
5558
5558
|
},
|
|
5559
5559
|
microsoft: {
|
|
5560
5560
|
label: "Continue with Microsoft",
|
|
5561
|
-
icon: /* @__PURE__ */ Q(
|
|
5561
|
+
icon: /* @__PURE__ */ Q(ns, { size: 14 })
|
|
5562
5562
|
},
|
|
5563
5563
|
azure: {
|
|
5564
5564
|
label: "Continue with Microsoft",
|
|
5565
|
-
icon: /* @__PURE__ */ Q(
|
|
5565
|
+
icon: /* @__PURE__ */ Q(ns, { size: 14 })
|
|
5566
5566
|
}
|
|
5567
5567
|
};
|
|
5568
|
-
function
|
|
5569
|
-
let e =
|
|
5568
|
+
function vs() {
|
|
5569
|
+
let e = ci(), [t] = fi(), { login: r, isLoginPending: i, isAuthenticated: a } = ra(), { data: o } = Zt(), { data: s } = et(), [c, l] = X(""), [u, d] = X(""), [f, m] = X(!0), h = lt(t.get("next") || t.get("redirect")), g = t.get("sso_error"), _ = ps(o?.parameters), { data: y } = vi({
|
|
5570
5570
|
queryKey: ["check-setup"],
|
|
5571
5571
|
queryFn: De
|
|
5572
|
-
}), { data: b } =
|
|
5572
|
+
}), { data: b } = vi({
|
|
5573
5573
|
queryKey: ["sso-providers"],
|
|
5574
5574
|
queryFn: () => he(),
|
|
5575
5575
|
staleTime: 6e4
|
|
@@ -5578,8 +5578,8 @@ function gs() {
|
|
|
5578
5578
|
y?.needs_setup && e("/signup", { replace: !0 });
|
|
5579
5579
|
}, [y, e]), q(() => {
|
|
5580
5580
|
if (!a || !s) return;
|
|
5581
|
-
let t =
|
|
5582
|
-
|
|
5581
|
+
let t = as(h, s);
|
|
5582
|
+
bs(h, t) && F.warning(fs(s.messages, "auth.inaccessible_redirect", _, gs)), e(t, { replace: !0 });
|
|
5583
5583
|
}, [
|
|
5584
5584
|
a,
|
|
5585
5585
|
_,
|
|
@@ -5595,10 +5595,10 @@ function gs() {
|
|
|
5595
5595
|
password: u,
|
|
5596
5596
|
remember: f
|
|
5597
5597
|
}, { onError: (e) => {
|
|
5598
|
-
F.error(
|
|
5598
|
+
F.error(ys(e, o?.messages, _));
|
|
5599
5599
|
} });
|
|
5600
5600
|
}
|
|
5601
|
-
return /* @__PURE__ */ Q(
|
|
5601
|
+
return /* @__PURE__ */ Q(es, { children: /* @__PURE__ */ $("form", {
|
|
5602
5602
|
onSubmit: x,
|
|
5603
5603
|
children: [
|
|
5604
5604
|
/* @__PURE__ */ Q("div", {
|
|
@@ -5636,7 +5636,7 @@ function gs() {
|
|
|
5636
5636
|
marginBottom: 12
|
|
5637
5637
|
},
|
|
5638
5638
|
children: b.map((e) => {
|
|
5639
|
-
let t =
|
|
5639
|
+
let t = _s[e.slug.toLowerCase()] ?? {
|
|
5640
5640
|
label: `Continue with ${e.name}`,
|
|
5641
5641
|
icon: /* @__PURE__ */ Q(n.shield, { size: 13 })
|
|
5642
5642
|
};
|
|
@@ -5705,7 +5705,7 @@ function gs() {
|
|
|
5705
5705
|
children: [
|
|
5706
5706
|
/* @__PURE__ */ Q(St, { children: "Password" }),
|
|
5707
5707
|
/* @__PURE__ */ Q("div", { style: { flex: 1 } }),
|
|
5708
|
-
/* @__PURE__ */ Q(
|
|
5708
|
+
/* @__PURE__ */ Q(ei, {
|
|
5709
5709
|
to: "/forgot",
|
|
5710
5710
|
style: {
|
|
5711
5711
|
fontSize: 11,
|
|
@@ -5754,7 +5754,7 @@ function gs() {
|
|
|
5754
5754
|
textAlign: "center",
|
|
5755
5755
|
marginTop: 4
|
|
5756
5756
|
},
|
|
5757
|
-
children: ["New here? ", /* @__PURE__ */ Q(
|
|
5757
|
+
children: ["New here? ", /* @__PURE__ */ Q(ei, {
|
|
5758
5758
|
to: "/signup",
|
|
5759
5759
|
style: {
|
|
5760
5760
|
color: "var(--accent)",
|
|
@@ -5769,18 +5769,18 @@ function gs() {
|
|
|
5769
5769
|
]
|
|
5770
5770
|
}) });
|
|
5771
5771
|
}
|
|
5772
|
-
function
|
|
5773
|
-
return e instanceof O && e.code === "INVALID_CREDENTIALS" ?
|
|
5772
|
+
function ys(e, t, n) {
|
|
5773
|
+
return e instanceof O && e.code === "INVALID_CREDENTIALS" ? fs(t, "auth.invalid_credentials", n, hs) : e.message;
|
|
5774
5774
|
}
|
|
5775
|
-
function
|
|
5775
|
+
function bs(e, t) {
|
|
5776
5776
|
if (e === t) return !1;
|
|
5777
5777
|
let n = e.split(/[?#]/, 1)[0].replace(/\/+$/, "") || "/";
|
|
5778
5778
|
return n !== "/" && n !== "/admin";
|
|
5779
5779
|
}
|
|
5780
5780
|
//#endregion
|
|
5781
5781
|
//#region src/components/pages/auth/SignUp.tsx
|
|
5782
|
-
function
|
|
5783
|
-
let e =
|
|
5782
|
+
function xs() {
|
|
5783
|
+
let e = ci(), { signup: t, isSignupPending: r, isAuthenticated: i } = ra(), a = k(), [o, s] = X(""), [c, l] = X(""), [u, d] = X(""), [f, m] = X(""), [h, g] = X(""), [_, v] = X(""), [y, b] = X(!1), { data: x } = Zt(), S = Xt(x), C = S?.workspace_domain ?? "", w = S?.legal_links?.terms_url ?? "", T = S?.legal_links?.privacy_url ?? "", E = a.category === "phone" || a.height <= 520, { data: D } = vi({
|
|
5784
5784
|
queryKey: ["check-setup"],
|
|
5785
5785
|
queryFn: De
|
|
5786
5786
|
});
|
|
@@ -5798,7 +5798,7 @@ function ys() {
|
|
|
5798
5798
|
displayName: n
|
|
5799
5799
|
});
|
|
5800
5800
|
}
|
|
5801
|
-
return /* @__PURE__ */ Q(
|
|
5801
|
+
return /* @__PURE__ */ Q(es, { children: /* @__PURE__ */ $("form", {
|
|
5802
5802
|
onSubmit: O,
|
|
5803
5803
|
children: [
|
|
5804
5804
|
/* @__PURE__ */ Q("div", {
|
|
@@ -5915,7 +5915,7 @@ function ys() {
|
|
|
5915
5915
|
style: { marginTop: 2 },
|
|
5916
5916
|
checked: y,
|
|
5917
5917
|
onChange: (e) => b(e.target.checked)
|
|
5918
|
-
}), /* @__PURE__ */ Q(
|
|
5918
|
+
}), /* @__PURE__ */ Q(Ss, {
|
|
5919
5919
|
termsUrl: w,
|
|
5920
5920
|
privacyUrl: T
|
|
5921
5921
|
})]
|
|
@@ -5937,7 +5937,7 @@ function ys() {
|
|
|
5937
5937
|
color: "var(--text-3)",
|
|
5938
5938
|
textAlign: "center"
|
|
5939
5939
|
},
|
|
5940
|
-
children: ["Already have an account? ", /* @__PURE__ */ Q(
|
|
5940
|
+
children: ["Already have an account? ", /* @__PURE__ */ Q(ei, {
|
|
5941
5941
|
to: "/login",
|
|
5942
5942
|
style: {
|
|
5943
5943
|
color: "var(--accent)",
|
|
@@ -5952,7 +5952,7 @@ function ys() {
|
|
|
5952
5952
|
]
|
|
5953
5953
|
}) });
|
|
5954
5954
|
}
|
|
5955
|
-
function
|
|
5955
|
+
function Ss({ termsUrl: e, privacyUrl: t }) {
|
|
5956
5956
|
return /* @__PURE__ */ $("span", { children: [
|
|
5957
5957
|
"I agree to the ",
|
|
5958
5958
|
e ? /* @__PURE__ */ Q("a", {
|
|
@@ -5975,7 +5975,7 @@ function bs({ termsUrl: e, privacyUrl: t }) {
|
|
|
5975
5975
|
}
|
|
5976
5976
|
//#endregion
|
|
5977
5977
|
//#region src/components/pages/auth/Forgot.tsx
|
|
5978
|
-
function
|
|
5978
|
+
function Cs() {
|
|
5979
5979
|
let [e, t] = X(""), [r, i] = X(!1), [a, o] = X(!1);
|
|
5980
5980
|
async function s(t) {
|
|
5981
5981
|
if (t.preventDefault(), !a) {
|
|
@@ -5987,7 +5987,7 @@ function xs() {
|
|
|
5987
5987
|
}
|
|
5988
5988
|
}
|
|
5989
5989
|
}
|
|
5990
|
-
return /* @__PURE__ */ Q(
|
|
5990
|
+
return /* @__PURE__ */ Q(es, { children: /* @__PURE__ */ $("form", {
|
|
5991
5991
|
onSubmit: s,
|
|
5992
5992
|
"data-testid": "forgot-form",
|
|
5993
5993
|
children: [
|
|
@@ -6058,7 +6058,7 @@ function xs() {
|
|
|
6058
6058
|
disabled: a,
|
|
6059
6059
|
children: a ? "Sending…" : "Send reset link"
|
|
6060
6060
|
}),
|
|
6061
|
-
/* @__PURE__ */ Q(
|
|
6061
|
+
/* @__PURE__ */ Q(ei, {
|
|
6062
6062
|
to: "/login",
|
|
6063
6063
|
className: "text-accent text-center no-underline",
|
|
6064
6064
|
style: { fontSize: 12 },
|
|
@@ -6071,26 +6071,26 @@ function xs() {
|
|
|
6071
6071
|
}
|
|
6072
6072
|
//#endregion
|
|
6073
6073
|
//#region src/components/pages/auth/Reset.tsx
|
|
6074
|
-
var
|
|
6075
|
-
function
|
|
6074
|
+
var ws = 8, Ts = "declarion.auth.flash", Es = "declarion-reset-no-referrer";
|
|
6075
|
+
function Ds() {
|
|
6076
6076
|
if (typeof window > "u") return "";
|
|
6077
6077
|
let e = window.location.hash.startsWith("#") ? window.location.hash.slice(1) : window.location.hash;
|
|
6078
6078
|
return e ? new URLSearchParams(e).get("t") ?? "" : "";
|
|
6079
6079
|
}
|
|
6080
|
-
function
|
|
6080
|
+
function Os() {
|
|
6081
6081
|
if (typeof document > "u") return;
|
|
6082
|
-
let e = document.getElementById(
|
|
6083
|
-
e || (e = document.createElement("meta"), e.id =
|
|
6082
|
+
let e = document.getElementById(Es);
|
|
6083
|
+
e || (e = document.createElement("meta"), e.id = Es, e.name = "referrer", e.content = "no-referrer", document.head.appendChild(e));
|
|
6084
6084
|
}
|
|
6085
|
-
function
|
|
6085
|
+
function ks() {
|
|
6086
6086
|
if (typeof document > "u") return;
|
|
6087
|
-
let e = document.getElementById(
|
|
6087
|
+
let e = document.getElementById(Es);
|
|
6088
6088
|
e && e.remove();
|
|
6089
6089
|
}
|
|
6090
|
-
function
|
|
6091
|
-
let e =
|
|
6090
|
+
function As() {
|
|
6091
|
+
let e = ci(), [t] = X(() => Ds()), [r, i] = X(""), [a, o] = X(""), [s, l] = X(""), [u, d] = X(!1), [f, m] = X(null);
|
|
6092
6092
|
q(() => {
|
|
6093
|
-
if (t) return typeof window < "u" && typeof window.history?.replaceState == "function" && window.history.replaceState(null, "", "/reset"),
|
|
6093
|
+
if (t) return typeof window < "u" && typeof window.history?.replaceState == "function" && window.history.replaceState(null, "", "/reset"), Os(), ks;
|
|
6094
6094
|
}, [t]);
|
|
6095
6095
|
let h = J(() => !t, [t]);
|
|
6096
6096
|
async function g(n) {
|
|
@@ -6099,8 +6099,8 @@ function Os() {
|
|
|
6099
6099
|
m("Passwords do not match.");
|
|
6100
6100
|
return;
|
|
6101
6101
|
}
|
|
6102
|
-
if (a.length <
|
|
6103
|
-
m(`Password must be at least ${
|
|
6102
|
+
if (a.length < ws) {
|
|
6103
|
+
m(`Password must be at least ${ws} characters.`);
|
|
6104
6104
|
return;
|
|
6105
6105
|
}
|
|
6106
6106
|
d(!0), m(null);
|
|
@@ -6111,20 +6111,20 @@ function Os() {
|
|
|
6111
6111
|
password: a
|
|
6112
6112
|
});
|
|
6113
6113
|
try {
|
|
6114
|
-
window.sessionStorage.setItem(
|
|
6114
|
+
window.sessionStorage.setItem(Ts, JSON.stringify({
|
|
6115
6115
|
kind: "success",
|
|
6116
6116
|
text: "Password updated. Sign in with your new password."
|
|
6117
6117
|
}));
|
|
6118
6118
|
} catch {}
|
|
6119
6119
|
e("/login", { replace: !0 });
|
|
6120
6120
|
} catch (e) {
|
|
6121
|
-
e instanceof O && e.code === "PASSWORD_REUSED" ? m("Your new password must differ from your current password.") : e instanceof O && e.code === "PASSWORD_TOO_SHORT" ? m(`Password must be at least ${
|
|
6121
|
+
e instanceof O && e.code === "PASSWORD_REUSED" ? m("Your new password must differ from your current password.") : e instanceof O && e.code === "PASSWORD_TOO_SHORT" ? m(`Password must be at least ${ws} characters.`) : m("Invalid or expired link. Please request a new one.");
|
|
6122
6122
|
} finally {
|
|
6123
6123
|
d(!1);
|
|
6124
6124
|
}
|
|
6125
6125
|
}
|
|
6126
6126
|
}
|
|
6127
|
-
return /* @__PURE__ */ Q(
|
|
6127
|
+
return /* @__PURE__ */ Q(es, { children: /* @__PURE__ */ $("div", {
|
|
6128
6128
|
"data-testid": "reset-page",
|
|
6129
6129
|
children: [
|
|
6130
6130
|
/* @__PURE__ */ Q("div", {
|
|
@@ -6154,7 +6154,7 @@ function Os() {
|
|
|
6154
6154
|
fontSize: 13
|
|
6155
6155
|
},
|
|
6156
6156
|
children: "Invalid or expired link. Please request a new one."
|
|
6157
|
-
}), /* @__PURE__ */ Q(
|
|
6157
|
+
}), /* @__PURE__ */ Q(ei, {
|
|
6158
6158
|
to: "/forgot",
|
|
6159
6159
|
className: "text-accent no-underline",
|
|
6160
6160
|
style: { fontSize: 12 },
|
|
@@ -6220,7 +6220,7 @@ function Os() {
|
|
|
6220
6220
|
disabled: u,
|
|
6221
6221
|
children: u ? "Updating…" : "Update password"
|
|
6222
6222
|
}),
|
|
6223
|
-
/* @__PURE__ */ Q(
|
|
6223
|
+
/* @__PURE__ */ Q(ei, {
|
|
6224
6224
|
to: "/login",
|
|
6225
6225
|
className: "text-accent text-center no-underline",
|
|
6226
6226
|
style: { fontSize: 12 },
|
|
@@ -6234,8 +6234,8 @@ function Os() {
|
|
|
6234
6234
|
}
|
|
6235
6235
|
//#endregion
|
|
6236
6236
|
//#region src/components/pages/auth/TwoFA.tsx
|
|
6237
|
-
function
|
|
6238
|
-
let e =
|
|
6237
|
+
function js() {
|
|
6238
|
+
let e = ci(), t = Y([]), n = k(), r = n.category === "phone" || n.height <= 520;
|
|
6239
6239
|
function i(e) {
|
|
6240
6240
|
t.current[e]?.focus(), t.current[e]?.select();
|
|
6241
6241
|
}
|
|
@@ -6246,7 +6246,7 @@ function ks() {
|
|
|
6246
6246
|
function o(e, t) {
|
|
6247
6247
|
t.key === "Backspace" && !t.target.value && e > 0 && i(e - 1);
|
|
6248
6248
|
}
|
|
6249
|
-
return /* @__PURE__ */ Q(
|
|
6249
|
+
return /* @__PURE__ */ Q(es, { children: /* @__PURE__ */ $("div", { children: [
|
|
6250
6250
|
/* @__PURE__ */ Q("div", {
|
|
6251
6251
|
style: {
|
|
6252
6252
|
fontSize: 10.5,
|
|
@@ -6339,7 +6339,7 @@ function ks() {
|
|
|
6339
6339
|
textDecoration: "none"
|
|
6340
6340
|
},
|
|
6341
6341
|
children: "Use backup code"
|
|
6342
|
-
}), /* @__PURE__ */ Q(
|
|
6342
|
+
}), /* @__PURE__ */ Q(ei, {
|
|
6343
6343
|
to: "/login",
|
|
6344
6344
|
style: {
|
|
6345
6345
|
color: "var(--text-3)",
|
|
@@ -6352,8 +6352,8 @@ function ks() {
|
|
|
6352
6352
|
}
|
|
6353
6353
|
//#endregion
|
|
6354
6354
|
//#region src/components/pages/SSOCallbackPage.tsx
|
|
6355
|
-
function
|
|
6356
|
-
let e =
|
|
6355
|
+
function Ms() {
|
|
6356
|
+
let e = ci(), [t] = fi(), { setUser: n, setTenants: r } = B(), i = yi();
|
|
6357
6357
|
return q(() => {
|
|
6358
6358
|
let a = lt(t.get("redirect"));
|
|
6359
6359
|
vt().then((t) => {
|
|
@@ -6377,8 +6377,8 @@ function As() {
|
|
|
6377
6377
|
}
|
|
6378
6378
|
//#endregion
|
|
6379
6379
|
//#region src/components/pages/NotFoundPage.tsx
|
|
6380
|
-
function
|
|
6381
|
-
let e = we(), t = S(), n =
|
|
6380
|
+
function Ns() {
|
|
6381
|
+
let e = we(), t = S(), n = oi(), r = ve();
|
|
6382
6382
|
return q(() => {
|
|
6383
6383
|
e.enabled && r(n.pathname, "not_found");
|
|
6384
6384
|
}, [
|
|
@@ -6439,7 +6439,7 @@ function js() {
|
|
|
6439
6439
|
}
|
|
6440
6440
|
//#endregion
|
|
6441
6441
|
//#region src/components/shared/ChangePasswordDialog.tsx
|
|
6442
|
-
function
|
|
6442
|
+
function Ps({ open: e, onClose: t, onSubmit: r }) {
|
|
6443
6443
|
let i = k().isPhone, [a, o] = X(""), [s, c] = X(""), [l, u] = X(""), [d, f] = X(!1), [m, h] = X(null);
|
|
6444
6444
|
if (!e) return null;
|
|
6445
6445
|
let g = () => {
|
|
@@ -6620,18 +6620,18 @@ function Ms({ open: e, onClose: t, onSubmit: r }) {
|
|
|
6620
6620
|
}
|
|
6621
6621
|
//#endregion
|
|
6622
6622
|
//#region src/components/pages/profile/Profile.tsx
|
|
6623
|
-
var
|
|
6623
|
+
var Fs = [
|
|
6624
6624
|
"image/png",
|
|
6625
6625
|
"image/jpeg",
|
|
6626
6626
|
"image/webp"
|
|
6627
|
-
],
|
|
6628
|
-
function
|
|
6627
|
+
], Is = 5 * 1024 * 1024;
|
|
6628
|
+
function Ls() {
|
|
6629
6629
|
let e = Un(), t = B((e) => e.user), r = B((e) => e.activeTenant), i = B((e) => e.refreshMe), a = k().isPhone, [o, s] = X(!1), [c, l] = X(!1), [u, d] = X(!1), [p, m] = X({
|
|
6630
6630
|
email: !0,
|
|
6631
6631
|
inapp: !0,
|
|
6632
6632
|
slack: !1,
|
|
6633
6633
|
desktop: !1
|
|
6634
|
-
}), h = Y(null), g = t?.display_name || t?.email || "User", _ = t?.email ?? "", v = t?.roles && t.roles[0] || "Member", y = r?.env ? `${r.name} · ${r.env}` : r?.name ?? "—", b = t?.created_at ? new Date(t.created_at).toLocaleDateString() : "—", { data: x, refetch: S } =
|
|
6634
|
+
}), h = Y(null), g = t?.display_name || t?.email || "User", _ = t?.email ?? "", v = t?.roles && t.roles[0] || "Member", y = r?.env ? `${r.name} · ${r.env}` : r?.name ?? "—", b = t?.created_at ? new Date(t.created_at).toLocaleDateString() : "—", { data: x, refetch: S } = vi({
|
|
6635
6635
|
queryKey: ["profile-files", t?.id],
|
|
6636
6636
|
queryFn: () => at("profile", { id: t.id }),
|
|
6637
6637
|
enabled: !!t?.id,
|
|
@@ -6715,13 +6715,13 @@ function Fs() {
|
|
|
6715
6715
|
/* @__PURE__ */ Q("input", {
|
|
6716
6716
|
ref: h,
|
|
6717
6717
|
type: "file",
|
|
6718
|
-
accept:
|
|
6718
|
+
accept: Fs.join(","),
|
|
6719
6719
|
style: { display: "none" },
|
|
6720
6720
|
onChange: async (e) => {
|
|
6721
6721
|
let n = e.target.files?.[0];
|
|
6722
6722
|
if (!n || !t) return;
|
|
6723
6723
|
e.target.value = "";
|
|
6724
|
-
let r = f(n,
|
|
6724
|
+
let r = f(n, Fs, Is);
|
|
6725
6725
|
if (r) {
|
|
6726
6726
|
F.error(r.message);
|
|
6727
6727
|
return;
|
|
@@ -6841,33 +6841,33 @@ function Fs() {
|
|
|
6841
6841
|
rowGap: 6
|
|
6842
6842
|
},
|
|
6843
6843
|
children: [
|
|
6844
|
-
/* @__PURE__ */ Q(
|
|
6844
|
+
/* @__PURE__ */ Q(Di, {
|
|
6845
6845
|
label: "Display name",
|
|
6846
6846
|
children: g
|
|
6847
6847
|
}),
|
|
6848
|
-
/* @__PURE__ */ Q(
|
|
6848
|
+
/* @__PURE__ */ Q(Di, {
|
|
6849
6849
|
label: "Email",
|
|
6850
6850
|
children: /* @__PURE__ */ Q("span", {
|
|
6851
6851
|
className: "mono",
|
|
6852
6852
|
children: _
|
|
6853
6853
|
})
|
|
6854
6854
|
}),
|
|
6855
|
-
/* @__PURE__ */ Q(
|
|
6855
|
+
/* @__PURE__ */ Q(Di, {
|
|
6856
6856
|
label: "Phone",
|
|
6857
6857
|
children: /* @__PURE__ */ Q("span", {
|
|
6858
6858
|
style: { color: "var(--text-4)" },
|
|
6859
6859
|
children: "—"
|
|
6860
6860
|
})
|
|
6861
6861
|
}),
|
|
6862
|
-
/* @__PURE__ */ Q(
|
|
6862
|
+
/* @__PURE__ */ Q(Di, {
|
|
6863
6863
|
label: "Timezone",
|
|
6864
|
-
children:
|
|
6864
|
+
children: Bs()
|
|
6865
6865
|
}),
|
|
6866
|
-
/* @__PURE__ */ Q(
|
|
6866
|
+
/* @__PURE__ */ Q(Di, {
|
|
6867
6867
|
label: "Language",
|
|
6868
6868
|
children: "English (US)"
|
|
6869
6869
|
}),
|
|
6870
|
-
/* @__PURE__ */ Q(
|
|
6870
|
+
/* @__PURE__ */ Q(Di, {
|
|
6871
6871
|
label: "Joined",
|
|
6872
6872
|
children: /* @__PURE__ */ Q("span", {
|
|
6873
6873
|
className: "mono",
|
|
@@ -6887,7 +6887,7 @@ function Fs() {
|
|
|
6887
6887
|
gap: 10
|
|
6888
6888
|
},
|
|
6889
6889
|
children: [
|
|
6890
|
-
/* @__PURE__ */ Q(
|
|
6890
|
+
/* @__PURE__ */ Q(zs, {
|
|
6891
6891
|
icon: /* @__PURE__ */ Q(n.key, { size: 13 }),
|
|
6892
6892
|
label: "Password",
|
|
6893
6893
|
hint: "Update at any time",
|
|
@@ -6897,7 +6897,7 @@ function Fs() {
|
|
|
6897
6897
|
children: "Change"
|
|
6898
6898
|
})
|
|
6899
6899
|
}),
|
|
6900
|
-
/* @__PURE__ */ Q(
|
|
6900
|
+
/* @__PURE__ */ Q(zs, {
|
|
6901
6901
|
icon: /* @__PURE__ */ Q(n.shield, { size: 13 }),
|
|
6902
6902
|
label: "Two-factor authentication",
|
|
6903
6903
|
hint: "Authenticator app recommended",
|
|
@@ -6907,7 +6907,7 @@ function Fs() {
|
|
|
6907
6907
|
children: "Not set up"
|
|
6908
6908
|
})
|
|
6909
6909
|
}),
|
|
6910
|
-
/* @__PURE__ */ Q(
|
|
6910
|
+
/* @__PURE__ */ Q(zs, {
|
|
6911
6911
|
icon: /* @__PURE__ */ Q(n.device, { size: 13 }),
|
|
6912
6912
|
label: "Trusted devices",
|
|
6913
6913
|
hint: "Sign-in sessions by device",
|
|
@@ -6917,7 +6917,7 @@ function Fs() {
|
|
|
6917
6917
|
children: "Manage"
|
|
6918
6918
|
})
|
|
6919
6919
|
}),
|
|
6920
|
-
/* @__PURE__ */ Q(
|
|
6920
|
+
/* @__PURE__ */ Q(zs, {
|
|
6921
6921
|
icon: /* @__PURE__ */ Q(n.activity, { size: 13 }),
|
|
6922
6922
|
label: "Sign-in history",
|
|
6923
6923
|
hint: "Audit trail of recent logins",
|
|
@@ -6940,7 +6940,7 @@ function Fs() {
|
|
|
6940
6940
|
gap: 6
|
|
6941
6941
|
},
|
|
6942
6942
|
children: [
|
|
6943
|
-
/* @__PURE__ */ Q(
|
|
6943
|
+
/* @__PURE__ */ Q(Di, {
|
|
6944
6944
|
label: "Role",
|
|
6945
6945
|
children: /* @__PURE__ */ Q(C, {
|
|
6946
6946
|
tone: "violet",
|
|
@@ -6949,7 +6949,7 @@ function Fs() {
|
|
|
6949
6949
|
children: v
|
|
6950
6950
|
})
|
|
6951
6951
|
}),
|
|
6952
|
-
/* @__PURE__ */ Q(
|
|
6952
|
+
/* @__PURE__ */ Q(Di, {
|
|
6953
6953
|
label: "Groups",
|
|
6954
6954
|
children: t?.roles && t.roles.length > 0 ? /* @__PURE__ */ Q("div", {
|
|
6955
6955
|
style: {
|
|
@@ -6963,7 +6963,7 @@ function Fs() {
|
|
|
6963
6963
|
children: "—"
|
|
6964
6964
|
})
|
|
6965
6965
|
}),
|
|
6966
|
-
/* @__PURE__ */ Q(
|
|
6966
|
+
/* @__PURE__ */ Q(Di, {
|
|
6967
6967
|
label: "Permissions",
|
|
6968
6968
|
children: /* @__PURE__ */ $("span", {
|
|
6969
6969
|
className: "mono",
|
|
@@ -6974,7 +6974,7 @@ function Fs() {
|
|
|
6974
6974
|
children: [t?.permissions?.length ?? 0, " explicit"]
|
|
6975
6975
|
})
|
|
6976
6976
|
}),
|
|
6977
|
-
/* @__PURE__ */ Q(
|
|
6977
|
+
/* @__PURE__ */ Q(Di, {
|
|
6978
6978
|
label: "API keys",
|
|
6979
6979
|
children: /* @__PURE__ */ Q("span", {
|
|
6980
6980
|
className: "mono",
|
|
@@ -7047,7 +7047,7 @@ function Fs() {
|
|
|
7047
7047
|
})
|
|
7048
7048
|
]
|
|
7049
7049
|
}),
|
|
7050
|
-
/* @__PURE__ */ Q(
|
|
7050
|
+
/* @__PURE__ */ Q(Vs, { userId: t?.id }),
|
|
7051
7051
|
t && /* @__PURE__ */ $("div", {
|
|
7052
7052
|
style: {
|
|
7053
7053
|
fontSize: 11,
|
|
@@ -7071,7 +7071,7 @@ function Fs() {
|
|
|
7071
7071
|
})
|
|
7072
7072
|
]
|
|
7073
7073
|
}),
|
|
7074
|
-
/* @__PURE__ */ Q(
|
|
7074
|
+
/* @__PURE__ */ Q(Rs, {
|
|
7075
7075
|
open: c,
|
|
7076
7076
|
initialName: t?.display_name ?? "",
|
|
7077
7077
|
userId: t?.id ?? "",
|
|
@@ -7080,7 +7080,7 @@ function Fs() {
|
|
|
7080
7080
|
await i(), l(!1);
|
|
7081
7081
|
}
|
|
7082
7082
|
}),
|
|
7083
|
-
/* @__PURE__ */ Q(
|
|
7083
|
+
/* @__PURE__ */ Q(Ps, {
|
|
7084
7084
|
open: o,
|
|
7085
7085
|
onClose: () => s(!1),
|
|
7086
7086
|
onSubmit: async ({ current: e, next: t }) => {
|
|
@@ -7090,7 +7090,7 @@ function Fs() {
|
|
|
7090
7090
|
]
|
|
7091
7091
|
});
|
|
7092
7092
|
}
|
|
7093
|
-
function
|
|
7093
|
+
function Rs({ open: e, initialName: t, userId: r, onClose: i, onSaved: a }) {
|
|
7094
7094
|
let o = k().isPhone, [s, c] = X(t), [l, u] = X(!1), [d, f] = X(null);
|
|
7095
7095
|
if (!e) return null;
|
|
7096
7096
|
let p = () => {
|
|
@@ -7236,7 +7236,7 @@ function Is({ open: e, initialName: t, userId: r, onClose: i, onSaved: a }) {
|
|
|
7236
7236
|
]
|
|
7237
7237
|
})] });
|
|
7238
7238
|
}
|
|
7239
|
-
function
|
|
7239
|
+
function zs({ icon: e, label: t, hint: n, action: r }) {
|
|
7240
7240
|
return /* @__PURE__ */ $("div", {
|
|
7241
7241
|
style: {
|
|
7242
7242
|
display: "flex",
|
|
@@ -7282,14 +7282,14 @@ function Ls({ icon: e, label: t, hint: n, action: r }) {
|
|
|
7282
7282
|
]
|
|
7283
7283
|
});
|
|
7284
7284
|
}
|
|
7285
|
-
function
|
|
7285
|
+
function Bs() {
|
|
7286
7286
|
try {
|
|
7287
7287
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "—";
|
|
7288
7288
|
} catch {
|
|
7289
7289
|
return "—";
|
|
7290
7290
|
}
|
|
7291
7291
|
}
|
|
7292
|
-
function
|
|
7292
|
+
function Vs({ userId: e }) {
|
|
7293
7293
|
let { data: t } = et();
|
|
7294
7294
|
if (!e || !t) return null;
|
|
7295
7295
|
let n = t.entities.profile;
|
|
@@ -7308,7 +7308,7 @@ function zs({ userId: e }) {
|
|
|
7308
7308
|
}
|
|
7309
7309
|
//#endregion
|
|
7310
7310
|
//#region src/components/pages/profile/Preferences.tsx
|
|
7311
|
-
var
|
|
7311
|
+
var Hs = [
|
|
7312
7312
|
{
|
|
7313
7313
|
id: "violet",
|
|
7314
7314
|
c: "#5B5BD6"
|
|
@@ -7329,11 +7329,11 @@ var Bs = [
|
|
|
7329
7329
|
id: "rose",
|
|
7330
7330
|
c: "#BE123C"
|
|
7331
7331
|
}
|
|
7332
|
-
],
|
|
7332
|
+
], Us = [
|
|
7333
7333
|
"compact",
|
|
7334
7334
|
"comfortable",
|
|
7335
7335
|
"cozy"
|
|
7336
|
-
],
|
|
7336
|
+
], Ws = [
|
|
7337
7337
|
["Command palette", "⌘ K"],
|
|
7338
7338
|
["Toggle AI assistant", "⌘ /"],
|
|
7339
7339
|
["Collapse sidebar", "⌘ B"],
|
|
@@ -7341,7 +7341,7 @@ var Bs = [
|
|
|
7341
7341
|
["Quick search", "/"],
|
|
7342
7342
|
["Escape / close", "Esc"]
|
|
7343
7343
|
];
|
|
7344
|
-
function
|
|
7344
|
+
function Gs() {
|
|
7345
7345
|
let e = G((e) => e.colorScheme), t = G((e) => e.accent), r = G((e) => e.density), i = G((e) => e.radius), a = G((e) => e.zebra), o = G((e) => e.set), s = G((e) => e.resetToDefaults), { branding: c } = Vt(), l = k().isPhone;
|
|
7346
7346
|
return /* @__PURE__ */ Q("div", {
|
|
7347
7347
|
style: {
|
|
@@ -7404,7 +7404,7 @@ function Us() {
|
|
|
7404
7404
|
gap: 12
|
|
7405
7405
|
},
|
|
7406
7406
|
children: [
|
|
7407
|
-
/* @__PURE__ */ Q(
|
|
7407
|
+
/* @__PURE__ */ Q(Ks, {
|
|
7408
7408
|
label: "Theme",
|
|
7409
7409
|
hint: "Pick light or dark (system sync coming soon)",
|
|
7410
7410
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -7412,14 +7412,14 @@ function Us() {
|
|
|
7412
7412
|
display: "flex",
|
|
7413
7413
|
gap: 6
|
|
7414
7414
|
},
|
|
7415
|
-
children: [["light", "Light"], ["dark", "Dark"]].map(([t, n]) => /* @__PURE__ */ Q(
|
|
7415
|
+
children: [["light", "Light"], ["dark", "Dark"]].map(([t, n]) => /* @__PURE__ */ Q(qs, {
|
|
7416
7416
|
active: e === t,
|
|
7417
7417
|
onClick: () => o("colorScheme", t),
|
|
7418
7418
|
children: n
|
|
7419
7419
|
}, t))
|
|
7420
7420
|
})
|
|
7421
7421
|
}),
|
|
7422
|
-
/* @__PURE__ */ Q(
|
|
7422
|
+
/* @__PURE__ */ Q(Ks, {
|
|
7423
7423
|
label: "Accent color",
|
|
7424
7424
|
hint: "Your personal accent across the app",
|
|
7425
7425
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -7427,7 +7427,7 @@ function Us() {
|
|
|
7427
7427
|
display: "flex",
|
|
7428
7428
|
gap: 8
|
|
7429
7429
|
},
|
|
7430
|
-
children:
|
|
7430
|
+
children: Hs.map((e) => /* @__PURE__ */ Q("button", {
|
|
7431
7431
|
onClick: () => o("accent", e.id),
|
|
7432
7432
|
"aria-label": `Accent ${e.id}`,
|
|
7433
7433
|
style: {
|
|
@@ -7441,7 +7441,7 @@ function Us() {
|
|
|
7441
7441
|
}, e.id))
|
|
7442
7442
|
})
|
|
7443
7443
|
}),
|
|
7444
|
-
/* @__PURE__ */ Q(
|
|
7444
|
+
/* @__PURE__ */ Q(Ks, {
|
|
7445
7445
|
label: "Density",
|
|
7446
7446
|
hint: "Compact saves space; cozy is easier on the eyes",
|
|
7447
7447
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -7449,7 +7449,7 @@ function Us() {
|
|
|
7449
7449
|
display: "flex",
|
|
7450
7450
|
gap: 6
|
|
7451
7451
|
},
|
|
7452
|
-
children:
|
|
7452
|
+
children: Us.map((e) => /* @__PURE__ */ Q(qs, {
|
|
7453
7453
|
active: r === e,
|
|
7454
7454
|
onClick: () => o("density", e),
|
|
7455
7455
|
capitalize: !0,
|
|
@@ -7457,7 +7457,7 @@ function Us() {
|
|
|
7457
7457
|
}, e))
|
|
7458
7458
|
})
|
|
7459
7459
|
}),
|
|
7460
|
-
/* @__PURE__ */ $(
|
|
7460
|
+
/* @__PURE__ */ $(Ks, {
|
|
7461
7461
|
label: "Border radius",
|
|
7462
7462
|
children: [/* @__PURE__ */ Q("input", {
|
|
7463
7463
|
type: "range",
|
|
@@ -7476,7 +7476,7 @@ function Us() {
|
|
|
7476
7476
|
children: [i, "px"]
|
|
7477
7477
|
})]
|
|
7478
7478
|
}),
|
|
7479
|
-
/* @__PURE__ */ Q(
|
|
7479
|
+
/* @__PURE__ */ Q(Ks, {
|
|
7480
7480
|
label: "Zebra rows",
|
|
7481
7481
|
hint: "Alternating row backgrounds on tables",
|
|
7482
7482
|
children: /* @__PURE__ */ Q(oe, {
|
|
@@ -7497,7 +7497,7 @@ function Us() {
|
|
|
7497
7497
|
gridTemplateColumns: l ? "minmax(0, 1fr)" : "repeat(2, minmax(0, 1fr))",
|
|
7498
7498
|
gap: 8
|
|
7499
7499
|
},
|
|
7500
|
-
children:
|
|
7500
|
+
children: Ws.map(([e, t]) => /* @__PURE__ */ $("div", {
|
|
7501
7501
|
style: {
|
|
7502
7502
|
display: "flex",
|
|
7503
7503
|
alignItems: "center",
|
|
@@ -7518,7 +7518,7 @@ function Us() {
|
|
|
7518
7518
|
})
|
|
7519
7519
|
});
|
|
7520
7520
|
}
|
|
7521
|
-
function
|
|
7521
|
+
function Ks({ label: e, hint: t, children: n }) {
|
|
7522
7522
|
let r = k().isPhone;
|
|
7523
7523
|
return /* @__PURE__ */ $("div", {
|
|
7524
7524
|
style: {
|
|
@@ -7561,7 +7561,7 @@ function Ws({ label: e, hint: t, children: n }) {
|
|
|
7561
7561
|
})]
|
|
7562
7562
|
});
|
|
7563
7563
|
}
|
|
7564
|
-
function
|
|
7564
|
+
function qs({ active: e, onClick: t, children: n, capitalize: r }) {
|
|
7565
7565
|
return /* @__PURE__ */ Q("button", {
|
|
7566
7566
|
onClick: t,
|
|
7567
7567
|
style: {
|
|
@@ -7579,7 +7579,7 @@ function Gs({ active: e, onClick: t, children: n, capitalize: r }) {
|
|
|
7579
7579
|
}
|
|
7580
7580
|
//#endregion
|
|
7581
7581
|
//#region src/components/pages/AdminCatalogPage.tsx
|
|
7582
|
-
function
|
|
7582
|
+
function Js() {
|
|
7583
7583
|
let { data: e } = et(), [t, n] = X("handlers"), r = k().isPhone;
|
|
7584
7584
|
return e ? /* @__PURE__ */ $("div", {
|
|
7585
7585
|
style: {
|
|
@@ -7631,11 +7631,11 @@ function Ks() {
|
|
|
7631
7631
|
overflowY: "auto",
|
|
7632
7632
|
padding: r ? "0 14px 20px" : "0 20px 20px"
|
|
7633
7633
|
},
|
|
7634
|
-
children: [t === "handlers" && /* @__PURE__ */ Q(
|
|
7634
|
+
children: [t === "handlers" && /* @__PURE__ */ Q(Ys, { schema: e }), t === "actions" && /* @__PURE__ */ Q(Qs, { schema: e })]
|
|
7635
7635
|
})]
|
|
7636
7636
|
}) : null;
|
|
7637
7637
|
}
|
|
7638
|
-
function
|
|
7638
|
+
function Ys({ schema: e }) {
|
|
7639
7639
|
let t = J(() => {
|
|
7640
7640
|
let t = [];
|
|
7641
7641
|
if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t.push({
|
|
@@ -7668,7 +7668,7 @@ function qs({ schema: e }) {
|
|
|
7668
7668
|
flexDirection: "column",
|
|
7669
7669
|
gap: 8
|
|
7670
7670
|
},
|
|
7671
|
-
children: t.map(({ code: e, handler: t, entity: n }) => /* @__PURE__ */ Q(
|
|
7671
|
+
children: t.map(({ code: e, handler: t, entity: n }) => /* @__PURE__ */ Q(Xs, {
|
|
7672
7672
|
code: e,
|
|
7673
7673
|
handler: t,
|
|
7674
7674
|
entity: n
|
|
@@ -7676,7 +7676,7 @@ function qs({ schema: e }) {
|
|
|
7676
7676
|
})]
|
|
7677
7677
|
});
|
|
7678
7678
|
}
|
|
7679
|
-
function
|
|
7679
|
+
function Xs({ code: e, handler: t, entity: n }) {
|
|
7680
7680
|
let [i, a] = X(!1), o = k().isPhone, s = t.display?.name ? z(t.display.name) : e;
|
|
7681
7681
|
return /* @__PURE__ */ $("div", {
|
|
7682
7682
|
style: {
|
|
@@ -7783,7 +7783,7 @@ function Js({ code: e, handler: t, entity: n }) {
|
|
|
7783
7783
|
},
|
|
7784
7784
|
children: (t.params?.names() ?? []).map((e) => {
|
|
7785
7785
|
let n = t.params.get(e);
|
|
7786
|
-
return n ? /* @__PURE__ */ Q(
|
|
7786
|
+
return n ? /* @__PURE__ */ Q(Zs, {
|
|
7787
7787
|
code: e,
|
|
7788
7788
|
param: n
|
|
7789
7789
|
}, e) : null;
|
|
@@ -7792,7 +7792,7 @@ function Js({ code: e, handler: t, entity: n }) {
|
|
|
7792
7792
|
})]
|
|
7793
7793
|
});
|
|
7794
7794
|
}
|
|
7795
|
-
function
|
|
7795
|
+
function Zs({ code: e, param: t }) {
|
|
7796
7796
|
let n = t.display?.name ? z(t.display.name) : void 0, r = k().isPhone;
|
|
7797
7797
|
return /* @__PURE__ */ $("div", {
|
|
7798
7798
|
style: {
|
|
@@ -7849,7 +7849,7 @@ function Ys({ code: e, param: t }) {
|
|
|
7849
7849
|
]
|
|
7850
7850
|
});
|
|
7851
7851
|
}
|
|
7852
|
-
function
|
|
7852
|
+
function Qs({ schema: e }) {
|
|
7853
7853
|
let t = J(() => {
|
|
7854
7854
|
let t = [];
|
|
7855
7855
|
if (e.actions) for (let [n, r] of Object.entries(e.actions)) t.push({
|
|
@@ -7897,14 +7897,14 @@ function Xs({ schema: e }) {
|
|
|
7897
7897
|
flexDirection: "column",
|
|
7898
7898
|
gap: 6
|
|
7899
7899
|
},
|
|
7900
|
-
children: t.map(({ code: e, action: t }) => /* @__PURE__ */ Q(
|
|
7900
|
+
children: t.map(({ code: e, action: t }) => /* @__PURE__ */ Q($s, {
|
|
7901
7901
|
code: e,
|
|
7902
7902
|
action: t
|
|
7903
7903
|
}, e))
|
|
7904
7904
|
})] }, e))]
|
|
7905
7905
|
});
|
|
7906
7906
|
}
|
|
7907
|
-
function
|
|
7907
|
+
function $s({ code: e, action: t }) {
|
|
7908
7908
|
let n = z(t.display?.name), i = k().isPhone;
|
|
7909
7909
|
return /* @__PURE__ */ $("div", {
|
|
7910
7910
|
style: {
|
|
@@ -7997,14 +7997,14 @@ function Zs({ code: e, action: t }) {
|
|
|
7997
7997
|
}
|
|
7998
7998
|
//#endregion
|
|
7999
7999
|
//#region src/components/pages/ExportMenu.tsx
|
|
8000
|
-
function
|
|
8000
|
+
function ec(e) {
|
|
8001
8001
|
return !(e && e.enabled === !1);
|
|
8002
8002
|
}
|
|
8003
|
-
function
|
|
8003
|
+
function tc(e) {
|
|
8004
8004
|
return e == null ? "all matching rows" : `${e.toLocaleString()} ${e === 1 ? "row" : "rows"}`;
|
|
8005
8005
|
}
|
|
8006
|
-
function
|
|
8007
|
-
let { entityCode: t, entity: r, screen: i, viewState: a, visibleColumns: o, selectedRowPKs: s, totalRows: c, pageSize: l, locale: d, align: f = "end", variant: p = "toolbar", onBeforeOpen: m } = e, [h, g] = X(!1), [_, v] = X(!1), [y, b] = X(null), x = Y(null), S =
|
|
8006
|
+
function nc(e) {
|
|
8007
|
+
let { entityCode: t, entity: r, screen: i, viewState: a, visibleColumns: o, selectedRowPKs: s, totalRows: c, pageSize: l, locale: d, align: f = "end", variant: p = "toolbar", onBeforeOpen: m } = e, [h, g] = X(!1), [_, v] = X(!1), [y, b] = X(null), x = Y(null), S = ec(r.export), C = ec(i?.export);
|
|
8008
8008
|
if (!S || !C) return null;
|
|
8009
8009
|
async function w(e) {
|
|
8010
8010
|
b(null), v(!0);
|
|
@@ -8015,7 +8015,7 @@ function ec(e) {
|
|
|
8015
8015
|
selectedRowPKs: e === "selected_rows" ? s : void 0,
|
|
8016
8016
|
locale: d
|
|
8017
8017
|
}), { blob: r, filename: i } = await Ae(t, n);
|
|
8018
|
-
|
|
8018
|
+
ic(r, i || `${t}-${rc()}.csv`), g(!1);
|
|
8019
8019
|
} catch (e) {
|
|
8020
8020
|
let t = e instanceof O ? {
|
|
8021
8021
|
code: e.code,
|
|
@@ -8061,7 +8061,7 @@ function ec(e) {
|
|
|
8061
8061
|
/* @__PURE__ */ $(A, {
|
|
8062
8062
|
icon: /* @__PURE__ */ Q(n.download, { size: 12 }),
|
|
8063
8063
|
onClick: _ ? void 0 : () => void w("current_view"),
|
|
8064
|
-
children: ["Current view (CSV) · ",
|
|
8064
|
+
children: ["Current view (CSV) · ", tc(c)]
|
|
8065
8065
|
}),
|
|
8066
8066
|
T && /* @__PURE__ */ $(A, {
|
|
8067
8067
|
icon: /* @__PURE__ */ Q(n.check, { size: 12 }),
|
|
@@ -8100,18 +8100,18 @@ function ec(e) {
|
|
|
8100
8100
|
]
|
|
8101
8101
|
})] });
|
|
8102
8102
|
}
|
|
8103
|
-
function
|
|
8103
|
+
function rc() {
|
|
8104
8104
|
let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
|
|
8105
8105
|
return `${e.getUTCFullYear()}${t(e.getUTCMonth() + 1)}${t(e.getUTCDate())}-${t(e.getUTCHours())}${t(e.getUTCMinutes())}`;
|
|
8106
8106
|
}
|
|
8107
|
-
function
|
|
8107
|
+
function ic(e, t) {
|
|
8108
8108
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
8109
8109
|
r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
8110
8110
|
}
|
|
8111
8111
|
//#endregion
|
|
8112
8112
|
//#region src/hooks/usePageState.ts
|
|
8113
|
-
function
|
|
8114
|
-
let r =
|
|
8113
|
+
function ac(e, t, n) {
|
|
8114
|
+
let r = oi(), i = n?.scope === "path" ? un(r) : Bt(r), a = Y(i);
|
|
8115
8115
|
a.current = i;
|
|
8116
8116
|
let o = Y(t), s = ln((t) => t.ttlMs <= 0 ? void 0 : t.entries[i]?.bag[e]), c = s === void 0 ? o.current : s;
|
|
8117
8117
|
return q(() => {
|
|
@@ -8123,7 +8123,7 @@ function rc(e, t, n) {
|
|
|
8123
8123
|
}
|
|
8124
8124
|
//#endregion
|
|
8125
8125
|
//#region src/components/shared/EmptyState.tsx
|
|
8126
|
-
function
|
|
8126
|
+
function oc({ icon: e, title: t, description: n, action: i }) {
|
|
8127
8127
|
return /* @__PURE__ */ $("div", {
|
|
8128
8128
|
style: {
|
|
8129
8129
|
display: "flex",
|
|
@@ -8175,8 +8175,8 @@ function ic({ icon: e, title: t, description: n, action: i }) {
|
|
|
8175
8175
|
}
|
|
8176
8176
|
//#endregion
|
|
8177
8177
|
//#region src/hooks/useFilters.ts
|
|
8178
|
-
function
|
|
8179
|
-
let [e, t] =
|
|
8178
|
+
function sc() {
|
|
8179
|
+
let [e, t] = fi(), n = J(() => jr(e), [e]);
|
|
8180
8180
|
return {
|
|
8181
8181
|
filters: n,
|
|
8182
8182
|
activeCount: J(() => zr(n), [n]),
|
|
@@ -8192,17 +8192,17 @@ function ac() {
|
|
|
8192
8192
|
}
|
|
8193
8193
|
//#endregion
|
|
8194
8194
|
//#region src/components/list/PeekFieldCell.tsx
|
|
8195
|
-
var
|
|
8195
|
+
var cc = /* @__PURE__ */ new Set([
|
|
8196
8196
|
"enum",
|
|
8197
8197
|
"bool",
|
|
8198
8198
|
"ref"
|
|
8199
8199
|
]);
|
|
8200
|
-
function
|
|
8200
|
+
function lc(e) {
|
|
8201
8201
|
let t = e.display?.widget;
|
|
8202
|
-
return t &&
|
|
8202
|
+
return t && cc.has(t) ? !0 : cc.has(e.type);
|
|
8203
8203
|
}
|
|
8204
|
-
function
|
|
8205
|
-
let l = ot(), [u, d] = X(!1), [f, p] = X(i), m =
|
|
8204
|
+
function uc({ field: e, fieldName: t, label: r, value: i, record: a, refs: o, readOnly: s, onCommit: c }) {
|
|
8205
|
+
let l = ot(), [u, d] = X(!1), [f, p] = X(i), m = lc(e);
|
|
8206
8206
|
q(() => {
|
|
8207
8207
|
u || p(i);
|
|
8208
8208
|
}, [i, u]);
|
|
@@ -8332,7 +8332,7 @@ function cc({ field: e, fieldName: t, label: r, value: i, record: a, refs: o, re
|
|
|
8332
8332
|
}
|
|
8333
8333
|
//#endregion
|
|
8334
8334
|
//#region src/components/list/QuickPeek.tsx
|
|
8335
|
-
function
|
|
8335
|
+
function dc(e, t = 12) {
|
|
8336
8336
|
let i = e.display?.icon;
|
|
8337
8337
|
if (!i) return null;
|
|
8338
8338
|
let a = n[i];
|
|
@@ -8341,7 +8341,7 @@ function lc(e, t = 12) {
|
|
|
8341
8341
|
size: t
|
|
8342
8342
|
});
|
|
8343
8343
|
}
|
|
8344
|
-
function
|
|
8344
|
+
function fc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatarName: o, fields: s, refs: c, screen: l, actions: d, executeAction: f, onClose: p, onOpen: m, onSave: h }) {
|
|
8345
8345
|
let g = ot(), [_, v] = X({ ...r }), [y, b] = X(!1), [x, S] = X(!1), C = Y(null), { run: w } = tt();
|
|
8346
8346
|
q(() => {
|
|
8347
8347
|
v({ ...r }), b(!1);
|
|
@@ -8473,7 +8473,7 @@ function uc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
|
|
|
8473
8473
|
/* @__PURE__ */ Q(ye, { children: "Esc" }),
|
|
8474
8474
|
" to close."
|
|
8475
8475
|
]
|
|
8476
|
-
}), s.map((n) => /* @__PURE__ */ Q(
|
|
8476
|
+
}), s.map((n) => /* @__PURE__ */ Q(pc, {
|
|
8477
8477
|
label: n.label,
|
|
8478
8478
|
children: n.kind === "file" ? Wn({
|
|
8479
8479
|
entity: e,
|
|
@@ -8485,7 +8485,7 @@ function uc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
|
|
|
8485
8485
|
refs: c,
|
|
8486
8486
|
disabled: n.readOnly,
|
|
8487
8487
|
locale: g
|
|
8488
|
-
}) : /* @__PURE__ */ Q(
|
|
8488
|
+
}) : /* @__PURE__ */ Q(uc, {
|
|
8489
8489
|
field: n.field,
|
|
8490
8490
|
fieldName: n.key,
|
|
8491
8491
|
label: n.label,
|
|
@@ -8541,7 +8541,7 @@ function uc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
|
|
|
8541
8541
|
width: 220,
|
|
8542
8542
|
align: "end",
|
|
8543
8543
|
children: D.map(({ code: e, action: t }) => /* @__PURE__ */ Q(A, {
|
|
8544
|
-
icon:
|
|
8544
|
+
icon: dc(t),
|
|
8545
8545
|
danger: t.destructive,
|
|
8546
8546
|
onClick: () => {
|
|
8547
8547
|
S(!1), O({
|
|
@@ -8555,7 +8555,7 @@ function uc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
|
|
|
8555
8555
|
}),
|
|
8556
8556
|
E && /* @__PURE__ */ Q(I, {
|
|
8557
8557
|
kind: "default",
|
|
8558
|
-
icon:
|
|
8558
|
+
icon: dc(E.action, 13),
|
|
8559
8559
|
onClick: () => O(E),
|
|
8560
8560
|
children: z(E.action.display?.name) || E.code
|
|
8561
8561
|
}),
|
|
@@ -8570,7 +8570,7 @@ function uc({ entity: e, entityCode: t, record: r, title: i, recordId: a, avatar
|
|
|
8570
8570
|
]
|
|
8571
8571
|
})] });
|
|
8572
8572
|
}
|
|
8573
|
-
function
|
|
8573
|
+
function pc({ label: e, children: t }) {
|
|
8574
8574
|
return /* @__PURE__ */ $("div", {
|
|
8575
8575
|
style: {
|
|
8576
8576
|
display: "grid",
|
|
@@ -8591,7 +8591,7 @@ function dc({ label: e, children: t }) {
|
|
|
8591
8591
|
}
|
|
8592
8592
|
//#endregion
|
|
8593
8593
|
//#region src/lib/format-count.ts
|
|
8594
|
-
var
|
|
8594
|
+
var mc = [
|
|
8595
8595
|
{
|
|
8596
8596
|
value: 1e9,
|
|
8597
8597
|
suffix: "B"
|
|
@@ -8605,26 +8605,26 @@ var fc = [
|
|
|
8605
8605
|
suffix: "K"
|
|
8606
8606
|
}
|
|
8607
8607
|
];
|
|
8608
|
-
function
|
|
8608
|
+
function hc(e) {
|
|
8609
8609
|
if (!Number.isFinite(e) || e < 0) return "~0";
|
|
8610
8610
|
let t = Math.round(e);
|
|
8611
8611
|
if (t < 1e3) return `~${t}`;
|
|
8612
|
-
for (let { value: e, suffix: n } of
|
|
8612
|
+
for (let { value: e, suffix: n } of mc) {
|
|
8613
8613
|
if (t < e) continue;
|
|
8614
8614
|
let r = t / e;
|
|
8615
8615
|
return `~${(r < 10 ? r.toFixed(1) : Math.round(r).toString()).replace(/\.0$/, "")}${n}`;
|
|
8616
8616
|
}
|
|
8617
8617
|
return `~${t.toLocaleString()}`;
|
|
8618
8618
|
}
|
|
8619
|
-
function
|
|
8619
|
+
function gc(e) {
|
|
8620
8620
|
return !Number.isFinite(e) || e < 0 ? "0" : Math.round(e).toLocaleString();
|
|
8621
8621
|
}
|
|
8622
|
-
function
|
|
8623
|
-
return t === "estimated" ?
|
|
8622
|
+
function _c(e, t) {
|
|
8623
|
+
return t === "estimated" ? hc(e) : gc(e);
|
|
8624
8624
|
}
|
|
8625
8625
|
//#endregion
|
|
8626
8626
|
//#region src/components/filters/FilterChips.tsx
|
|
8627
|
-
function
|
|
8627
|
+
function vc({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel: a = (e) => e, resolveValue: o }) {
|
|
8628
8628
|
return e.length === 0 ? null : Ur(e) ? /* @__PURE__ */ $("div", {
|
|
8629
8629
|
style: {
|
|
8630
8630
|
display: "flex",
|
|
@@ -8663,14 +8663,14 @@ function gc({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
|
|
|
8663
8663
|
children: a(e.field)
|
|
8664
8664
|
}),
|
|
8665
8665
|
" ",
|
|
8666
|
-
/* @__PURE__ */ Q(
|
|
8666
|
+
/* @__PURE__ */ Q(bc, {
|
|
8667
8667
|
node: e,
|
|
8668
8668
|
resolveValue: o
|
|
8669
8669
|
})
|
|
8670
8670
|
] }, t))
|
|
8671
8671
|
})]
|
|
8672
8672
|
}, t))
|
|
8673
|
-
}, n) : e.field && e.op ? /* @__PURE__ */ Q(
|
|
8673
|
+
}, n) : e.field && e.op ? /* @__PURE__ */ Q(yc, {
|
|
8674
8674
|
node: e,
|
|
8675
8675
|
fieldLabel: a,
|
|
8676
8676
|
resolveValue: o,
|
|
@@ -8691,7 +8691,7 @@ function gc({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
|
|
|
8691
8691
|
flexWrap: "wrap",
|
|
8692
8692
|
paddingBottom: 12
|
|
8693
8693
|
},
|
|
8694
|
-
children: [Ar(e).map((e, n) => /* @__PURE__ */ Q(
|
|
8694
|
+
children: [Ar(e).map((e, n) => /* @__PURE__ */ Q(yc, {
|
|
8695
8695
|
node: e,
|
|
8696
8696
|
fieldLabel: a,
|
|
8697
8697
|
resolveValue: o,
|
|
@@ -8706,7 +8706,7 @@ function gc({ filters: e, onRemove: t, onClearAll: r, onChipClick: i, fieldLabel
|
|
|
8706
8706
|
})]
|
|
8707
8707
|
});
|
|
8708
8708
|
}
|
|
8709
|
-
function
|
|
8709
|
+
function yc({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }) {
|
|
8710
8710
|
return /* @__PURE__ */ Q(de, {
|
|
8711
8711
|
tone: "slate",
|
|
8712
8712
|
icon: /* @__PURE__ */ Q(n.filter, { size: 11 }),
|
|
@@ -8720,7 +8720,7 @@ function _c({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }
|
|
|
8720
8720
|
" ",
|
|
8721
8721
|
/* @__PURE__ */ Q("span", {
|
|
8722
8722
|
style: { fontWeight: 600 },
|
|
8723
|
-
children: /* @__PURE__ */ Q(
|
|
8723
|
+
children: /* @__PURE__ */ Q(bc, {
|
|
8724
8724
|
node: e,
|
|
8725
8725
|
resolveValue: r
|
|
8726
8726
|
})
|
|
@@ -8728,18 +8728,18 @@ function _c({ node: e, fieldLabel: t, resolveValue: r, onRemove: i, onClick: a }
|
|
|
8728
8728
|
] })
|
|
8729
8729
|
});
|
|
8730
8730
|
}
|
|
8731
|
-
function
|
|
8731
|
+
function bc({ node: e, resolveValue: t }) {
|
|
8732
8732
|
let n = e.op, r = Or[n] || n;
|
|
8733
8733
|
return Fr.has(n) ? /* @__PURE__ */ Q(Z, { children: r }) : t ? /* @__PURE__ */ $(Z, { children: [
|
|
8734
8734
|
r,
|
|
8735
8735
|
" ",
|
|
8736
8736
|
(Array.isArray(e.value) ? e.value : [e.value]).map((n, r) => {
|
|
8737
8737
|
let i = t(e.field, n);
|
|
8738
|
-
return /* @__PURE__ */ $(qr, { children: [r > 0 ? ", " : "", /* @__PURE__ */ Q("span", { children: i.status === "loading" ? /* @__PURE__ */ Q(
|
|
8738
|
+
return /* @__PURE__ */ $(qr, { children: [r > 0 ? ", " : "", /* @__PURE__ */ Q("span", { children: i.status === "loading" ? /* @__PURE__ */ Q(xc, {}) : i.label ?? i.raw })] }, r);
|
|
8739
8739
|
})
|
|
8740
8740
|
] }) : /* @__PURE__ */ Q(Z, { children: Ir(e) });
|
|
8741
8741
|
}
|
|
8742
|
-
function
|
|
8742
|
+
function xc() {
|
|
8743
8743
|
return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("style", { children: "@keyframes declarion-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}" }), /* @__PURE__ */ Q("span", {
|
|
8744
8744
|
"aria-label": "loading",
|
|
8745
8745
|
style: {
|
|
@@ -8756,7 +8756,7 @@ function yc() {
|
|
|
8756
8756
|
}
|
|
8757
8757
|
//#endregion
|
|
8758
8758
|
//#region src/components/filters/FilterDrawer.tsx
|
|
8759
|
-
function
|
|
8759
|
+
function Sc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, defaultFilters: o, refs: s }) {
|
|
8760
8760
|
let c = k().category === "phone", [l, u] = X(r), [d, f] = X(!1);
|
|
8761
8761
|
if (q(() => {
|
|
8762
8762
|
if (e) {
|
|
@@ -8870,7 +8870,7 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8870
8870
|
if (!e.or) {
|
|
8871
8871
|
if (!e.field || !e.op) return null;
|
|
8872
8872
|
let n = a.find((t) => t.code === e.field);
|
|
8873
|
-
return n ? /* @__PURE__ */ Q(
|
|
8873
|
+
return n ? /* @__PURE__ */ Q(Oc, {
|
|
8874
8874
|
node: e,
|
|
8875
8875
|
meta: n,
|
|
8876
8876
|
refs: s,
|
|
@@ -8879,7 +8879,7 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8879
8879
|
onRemove: () => _(t)
|
|
8880
8880
|
}, `${e.field}-${t}`) : null;
|
|
8881
8881
|
}
|
|
8882
|
-
return /* @__PURE__ */ Q(
|
|
8882
|
+
return /* @__PURE__ */ Q(kc, {
|
|
8883
8883
|
groups: e.or,
|
|
8884
8884
|
availableFields: a,
|
|
8885
8885
|
refs: s,
|
|
@@ -8892,7 +8892,7 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8892
8892
|
}) : l.map((e, t) => {
|
|
8893
8893
|
if (!e.field || !e.op) return null;
|
|
8894
8894
|
let n = a.find((t) => t.code === e.field);
|
|
8895
|
-
return n ? /* @__PURE__ */ Q(
|
|
8895
|
+
return n ? /* @__PURE__ */ Q(Oc, {
|
|
8896
8896
|
node: e,
|
|
8897
8897
|
meta: n,
|
|
8898
8898
|
refs: s,
|
|
@@ -8907,7 +8907,7 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8907
8907
|
gap: 6,
|
|
8908
8908
|
paddingTop: 6
|
|
8909
8909
|
},
|
|
8910
|
-
children: d ? /* @__PURE__ */ Q(
|
|
8910
|
+
children: d ? /* @__PURE__ */ Q(Ac, {
|
|
8911
8911
|
fields: a,
|
|
8912
8912
|
activeFields: m,
|
|
8913
8913
|
compact: c,
|
|
@@ -8956,7 +8956,7 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8956
8956
|
/* @__PURE__ */ Q(I, {
|
|
8957
8957
|
kind: "primary",
|
|
8958
8958
|
onClick: () => {
|
|
8959
|
-
i(
|
|
8959
|
+
i(wc(l)), t();
|
|
8960
8960
|
},
|
|
8961
8961
|
children: "Apply"
|
|
8962
8962
|
})
|
|
@@ -8965,14 +8965,14 @@ function bc({ open: e, onClose: t, filters: r, onApply: i, availableFields: a, d
|
|
|
8965
8965
|
]
|
|
8966
8966
|
})] });
|
|
8967
8967
|
}
|
|
8968
|
-
function
|
|
8968
|
+
function Cc(e) {
|
|
8969
8969
|
return e == null || e === "" ? !1 : Array.isArray(e) ? e.length > 0 : !0;
|
|
8970
8970
|
}
|
|
8971
|
-
function
|
|
8971
|
+
function wc(e) {
|
|
8972
8972
|
let t = [];
|
|
8973
8973
|
for (let n of e) {
|
|
8974
8974
|
if (n.or) {
|
|
8975
|
-
let e = n.or.map(
|
|
8975
|
+
let e = n.or.map(wc).filter((e) => e.length > 0);
|
|
8976
8976
|
e.length > 0 && t.push({
|
|
8977
8977
|
...n,
|
|
8978
8978
|
or: e
|
|
@@ -8980,18 +8980,18 @@ function Sc(e) {
|
|
|
8980
8980
|
continue;
|
|
8981
8981
|
}
|
|
8982
8982
|
if (n.and) {
|
|
8983
|
-
let e =
|
|
8983
|
+
let e = wc(n.and);
|
|
8984
8984
|
e.length > 0 && t.push({
|
|
8985
8985
|
...n,
|
|
8986
8986
|
and: e
|
|
8987
8987
|
});
|
|
8988
8988
|
continue;
|
|
8989
8989
|
}
|
|
8990
|
-
!n.field || !n.op || !Fr.has(n.op) && !
|
|
8990
|
+
!n.field || !n.op || !Fr.has(n.op) && !Cc(n.value) || t.push(n);
|
|
8991
8991
|
}
|
|
8992
8992
|
return t;
|
|
8993
8993
|
}
|
|
8994
|
-
function
|
|
8994
|
+
function Tc(e) {
|
|
8995
8995
|
return !e || e.length === 0 ? [] : [
|
|
8996
8996
|
{
|
|
8997
8997
|
value: "",
|
|
@@ -9009,8 +9009,8 @@ function Cc(e) {
|
|
|
9009
9009
|
}
|
|
9010
9010
|
];
|
|
9011
9011
|
}
|
|
9012
|
-
var
|
|
9013
|
-
function
|
|
9012
|
+
var Ec = "__custom__";
|
|
9013
|
+
function Dc({ meta: e, value: t, onUpdate: n }) {
|
|
9014
9014
|
let r = e.specialValues ?? [], i = U(t), [a, o] = X(!r.some((e) => e.code === i) && i !== "");
|
|
9015
9015
|
return a ? /* @__PURE__ */ Q(Je, {
|
|
9016
9016
|
"aria-label": `${e.label} filter value`,
|
|
@@ -9026,18 +9026,18 @@ function Tc({ meta: e, value: t, onUpdate: n }) {
|
|
|
9026
9026
|
value: "",
|
|
9027
9027
|
label: "Select…"
|
|
9028
9028
|
},
|
|
9029
|
-
...
|
|
9029
|
+
...Tc(r),
|
|
9030
9030
|
{
|
|
9031
|
-
value:
|
|
9031
|
+
value: Ec,
|
|
9032
9032
|
label: "Custom value…"
|
|
9033
9033
|
}
|
|
9034
9034
|
],
|
|
9035
9035
|
onChange: (e) => {
|
|
9036
|
-
e ===
|
|
9036
|
+
e === Ec ? (o(!0), n({ value: "" })) : n({ value: e });
|
|
9037
9037
|
}
|
|
9038
9038
|
});
|
|
9039
9039
|
}
|
|
9040
|
-
function
|
|
9040
|
+
function Oc({ node: e, meta: t, refs: r, compact: i, onUpdate: a, onRemove: o }) {
|
|
9041
9041
|
let s = Fr.has(e.op), c = t.operators.map((e) => ({
|
|
9042
9042
|
value: e,
|
|
9043
9043
|
label: Or[e] || e
|
|
@@ -9081,13 +9081,13 @@ function Ec({ node: e, meta: t, refs: r, compact: i, onUpdate: a, onRemove: o })
|
|
|
9081
9081
|
}) : t.options ? /* @__PURE__ */ Q(_, {
|
|
9082
9082
|
"aria-label": `${t.label} filter value`,
|
|
9083
9083
|
value: U(e.value),
|
|
9084
|
-
options: [...
|
|
9084
|
+
options: [...Tc(t.specialValues), ...t.options.map((e) => ({
|
|
9085
9085
|
value: e.value,
|
|
9086
9086
|
label: e.label
|
|
9087
9087
|
}))],
|
|
9088
9088
|
onChange: (e) => a({ value: e }),
|
|
9089
9089
|
placeholder: "Select…"
|
|
9090
|
-
}) : t.specialValues && t.specialValues.length > 0 ? /* @__PURE__ */ Q(
|
|
9090
|
+
}) : t.specialValues && t.specialValues.length > 0 ? /* @__PURE__ */ Q(Dc, {
|
|
9091
9091
|
meta: t,
|
|
9092
9092
|
value: e.value,
|
|
9093
9093
|
onUpdate: a
|
|
@@ -9106,7 +9106,7 @@ function Ec({ node: e, meta: t, refs: r, compact: i, onUpdate: a, onRemove: o })
|
|
|
9106
9106
|
]
|
|
9107
9107
|
});
|
|
9108
9108
|
}
|
|
9109
|
-
function
|
|
9109
|
+
function kc({ groups: e, availableFields: t, refs: r, compact: i, onChange: a }) {
|
|
9110
9110
|
return /* @__PURE__ */ $("div", {
|
|
9111
9111
|
style: {
|
|
9112
9112
|
display: "flex",
|
|
@@ -9161,7 +9161,7 @@ function Dc({ groups: e, availableFields: t, refs: r, compact: i, onChange: a })
|
|
|
9161
9161
|
}),
|
|
9162
9162
|
o.map((n, o) => {
|
|
9163
9163
|
let c = t.find((e) => e.code === n.field);
|
|
9164
|
-
return c ? /* @__PURE__ */ Q(
|
|
9164
|
+
return c ? /* @__PURE__ */ Q(Oc, {
|
|
9165
9165
|
node: n,
|
|
9166
9166
|
meta: c,
|
|
9167
9167
|
refs: r,
|
|
@@ -9200,7 +9200,7 @@ function Dc({ groups: e, availableFields: t, refs: r, compact: i, onChange: a })
|
|
|
9200
9200
|
})]
|
|
9201
9201
|
});
|
|
9202
9202
|
}
|
|
9203
|
-
function
|
|
9203
|
+
function Ac({ fields: e, activeFields: t, compact: r, onSelect: i, onCancel: a }) {
|
|
9204
9204
|
let [o, s] = X(""), c = e.filter((e) => !t.has(e.code) && (o === "" || e.label.toLowerCase().includes(o.toLowerCase()) || e.code.toLowerCase().includes(o.toLowerCase())));
|
|
9205
9205
|
return /* @__PURE__ */ $("div", {
|
|
9206
9206
|
style: {
|
|
@@ -9286,7 +9286,7 @@ function Oc({ fields: e, activeFields: t, compact: r, onSelect: i, onCancel: a }
|
|
|
9286
9286
|
}
|
|
9287
9287
|
//#endregion
|
|
9288
9288
|
//#region src/components/pages/list/filter-meta.ts
|
|
9289
|
-
function
|
|
9289
|
+
function jc(e, t, n) {
|
|
9290
9290
|
if (!e || !t) return [];
|
|
9291
9291
|
let r = e.filters ?? t.fields.names(), i = [];
|
|
9292
9292
|
for (let a of r) {
|
|
@@ -9330,7 +9330,7 @@ function kc(e, t, n) {
|
|
|
9330
9330
|
}
|
|
9331
9331
|
let r = t.fields.get(a);
|
|
9332
9332
|
if (!r) continue;
|
|
9333
|
-
let o = ke(r, a, n), s =
|
|
9333
|
+
let o = ke(r, a, n), s = Mc(r.type), c = r.values?.map((e) => ({
|
|
9334
9334
|
value: e.code,
|
|
9335
9335
|
label: z(e.name) || e.code,
|
|
9336
9336
|
color: e.color
|
|
@@ -9347,7 +9347,7 @@ function kc(e, t, n) {
|
|
|
9347
9347
|
}
|
|
9348
9348
|
return i;
|
|
9349
9349
|
}
|
|
9350
|
-
function
|
|
9350
|
+
function Mc(e) {
|
|
9351
9351
|
switch (e) {
|
|
9352
9352
|
case "string":
|
|
9353
9353
|
case "text":
|
|
@@ -9435,11 +9435,11 @@ function Ac(e) {
|
|
|
9435
9435
|
}
|
|
9436
9436
|
//#endregion
|
|
9437
9437
|
//#region src/components/pages/list/use-filter-value-labels.ts
|
|
9438
|
-
var
|
|
9439
|
-
function
|
|
9440
|
-
let i = new Map(e.map((e) => [e.code, e])), a =
|
|
9438
|
+
var Nc = 200;
|
|
9439
|
+
function Pc(e, t, n, r) {
|
|
9440
|
+
let i = new Map(e.map((e) => [e.code, e])), a = Fc(i, t, n, r), o = _i({ queries: a.map((e) => {
|
|
9441
9441
|
let t = {
|
|
9442
|
-
per_page:
|
|
9442
|
+
per_page: Nc,
|
|
9443
9443
|
filters: [{
|
|
9444
9444
|
field: e.lookupField,
|
|
9445
9445
|
op: "in",
|
|
@@ -9514,7 +9514,7 @@ function Mc(e, t, n, r) {
|
|
|
9514
9514
|
refs: s
|
|
9515
9515
|
};
|
|
9516
9516
|
}
|
|
9517
|
-
function
|
|
9517
|
+
function Fc(e, t, n, r) {
|
|
9518
9518
|
let i = /* @__PURE__ */ new Map();
|
|
9519
9519
|
for (let a of Ar(t)) {
|
|
9520
9520
|
if (!a.field) continue;
|
|
@@ -9539,7 +9539,7 @@ function Nc(e, t, n, r) {
|
|
|
9539
9539
|
}
|
|
9540
9540
|
//#endregion
|
|
9541
9541
|
//#region src/components/pages/list/SaveViewDialog.tsx
|
|
9542
|
-
function
|
|
9542
|
+
function Ic({ open: e, pending: t, onClose: n, onSave: r }) {
|
|
9543
9543
|
let [i, a] = X("");
|
|
9544
9544
|
if (q(() => {
|
|
9545
9545
|
e && a("");
|
|
@@ -9636,7 +9636,7 @@ function Pc({ open: e, pending: t, onClose: n, onSave: r }) {
|
|
|
9636
9636
|
}
|
|
9637
9637
|
//#endregion
|
|
9638
9638
|
//#region src/components/pages/list/ListHeader.tsx
|
|
9639
|
-
function
|
|
9639
|
+
function Lc({ title: e, description: t, toolbarActions: r, screenActionLayout: i, entityActionLayout: a, selectedIds: o, data: s, rowKey: c, onActionSuccess: l, widgetContext: u }) {
|
|
9640
9640
|
let { run: d } = tt(), f = qt("list"), p = f.isVisible("show_title"), m = f.isVisible("show_actions"), h = Fn(), g = J(() => {
|
|
9641
9641
|
let e = {};
|
|
9642
9642
|
for (let { code: t, action: n } of r) e[t] = n;
|
|
@@ -9722,8 +9722,8 @@ function Fc({ title: e, description: t, toolbarActions: r, screenActionLayout: i
|
|
|
9722
9722
|
}
|
|
9723
9723
|
//#endregion
|
|
9724
9724
|
//#region src/components/pages/list/ListBulkBar.tsx
|
|
9725
|
-
function
|
|
9726
|
-
let { run: d } = tt(), f =
|
|
9725
|
+
function Rc({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: s, onClear: c, onActionSuccess: l, widgetContext: u }) {
|
|
9726
|
+
let { run: d } = tt(), f = yi(), p = J(() => {
|
|
9727
9727
|
let e = {};
|
|
9728
9728
|
for (let { code: n, action: r } of t) e[n] = r;
|
|
9729
9729
|
return e;
|
|
@@ -9802,7 +9802,8 @@ function Ic({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityA
|
|
|
9802
9802
|
});
|
|
9803
9803
|
},
|
|
9804
9804
|
widgetContext: u,
|
|
9805
|
-
ariaLabel: "Bulk action bar"
|
|
9805
|
+
ariaLabel: "Bulk action bar",
|
|
9806
|
+
constrain: !1
|
|
9806
9807
|
}),
|
|
9807
9808
|
/* @__PURE__ */ Q("button", {
|
|
9808
9809
|
onClick: c,
|
|
@@ -9823,7 +9824,7 @@ function Ic({ selectedIds: e, floatbarActions: t, screenActionLayout: r, entityA
|
|
|
9823
9824
|
}
|
|
9824
9825
|
//#endregion
|
|
9825
9826
|
//#region src/components/pages/list/DataCell.tsx
|
|
9826
|
-
function
|
|
9827
|
+
function zc({ cell: e }) {
|
|
9827
9828
|
let t = e.column.id === "_select", n = e.column.id === "_actions", r = e.column.columnDef.cell, i = typeof r == "function" ? r(e.getContext()) : r;
|
|
9828
9829
|
return /* @__PURE__ */ Q("td", {
|
|
9829
9830
|
title: typeof i == "string" ? i : void 0,
|
|
@@ -9847,7 +9848,7 @@ function Lc({ cell: e }) {
|
|
|
9847
9848
|
}
|
|
9848
9849
|
//#endregion
|
|
9849
9850
|
//#region src/components/pages/list/RowActionsCell.tsx
|
|
9850
|
-
function
|
|
9851
|
+
function Bc({ row: e, rowId: t, screen: r, fullScreen: i, entity: a, entityCode: o, hasDefaultEditAction: s, hasDefaultDeleteAction: c, rowActions: l, tabNavigate: u, onPeek: d, locale: f }) {
|
|
9851
9852
|
let { run: p } = tt(), m = J(() => ({
|
|
9852
9853
|
entity: a,
|
|
9853
9854
|
entityCode: o ?? "",
|
|
@@ -9923,29 +9924,29 @@ function Rc({ row: e, rowId: t, screen: r, fullScreen: i, entity: a, entityCode:
|
|
|
9923
9924
|
}
|
|
9924
9925
|
//#endregion
|
|
9925
9926
|
//#region src/components/pages/list/columns.ts
|
|
9926
|
-
function
|
|
9927
|
+
function Vc(e, t, r, i) {
|
|
9927
9928
|
let a = Hn(t, r);
|
|
9928
|
-
if (!a || a.read !== "denied") return i ?
|
|
9929
|
+
if (!a || a.read !== "denied") return i ? Xr("span", { title: i }, e) : e;
|
|
9929
9930
|
let o = a.required_permission ? `Locked column: requires "${a.required_permission}"` : `Locked column: ${a.classification} classification`;
|
|
9930
|
-
return
|
|
9931
|
+
return Xr("span", {
|
|
9931
9932
|
title: o,
|
|
9932
9933
|
"aria-label": o,
|
|
9933
9934
|
className: "inline-flex items-center gap-1"
|
|
9934
|
-
},
|
|
9935
|
+
}, Xr(n.lock, { size: 12 }), e);
|
|
9935
9936
|
}
|
|
9936
|
-
function
|
|
9937
|
+
function Hc(e) {
|
|
9937
9938
|
let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: s, hasExplicitRowActions: c, canUpdate: l, canDelete: u, peekEnabled: d, userLocale: f, tabNavigate: p, refsRef: m, rowSelectionKey: h, setPeekRow: g } = e;
|
|
9938
9939
|
if (t.length === 0 || !n) return [];
|
|
9939
9940
|
let _ = [];
|
|
9940
9941
|
s && _.push({
|
|
9941
9942
|
id: "_select",
|
|
9942
|
-
header: ({ table: e }) =>
|
|
9943
|
+
header: ({ table: e }) => Xr(Oi, {
|
|
9943
9944
|
checked: e.getIsAllRowsSelected(),
|
|
9944
9945
|
indeterminate: e.getIsSomeRowsSelected(),
|
|
9945
9946
|
onChange: () => e.toggleAllRowsSelected()
|
|
9946
9947
|
}),
|
|
9947
9948
|
size: 34,
|
|
9948
|
-
cell: ({ row: e }) =>
|
|
9949
|
+
cell: ({ row: e }) => Xr("span", { "data-testid": "row-select-checkbox" }, Xr(Oi, {
|
|
9949
9950
|
checked: e.getIsSelected(),
|
|
9950
9951
|
onChange: () => e.toggleSelected()
|
|
9951
9952
|
}))
|
|
@@ -9961,9 +9962,9 @@ function Bc(e) {
|
|
|
9961
9962
|
size: 140,
|
|
9962
9963
|
cell: ({ row: e }) => {
|
|
9963
9964
|
let n = e.original.$statuses?.find((e) => e.group_code === t);
|
|
9964
|
-
if (!n) return
|
|
9965
|
+
if (!n) return Xr("span", { className: "text-sm text-muted-foreground" }, "-");
|
|
9965
9966
|
let r = i.get(n.status_code);
|
|
9966
|
-
return
|
|
9967
|
+
return Xr(C, {
|
|
9967
9968
|
tone: r?.color ?? "slate",
|
|
9968
9969
|
size: "xs"
|
|
9969
9970
|
}, z(r?.name) || n.status_code);
|
|
@@ -9976,12 +9977,12 @@ function Bc(e) {
|
|
|
9976
9977
|
if (!r) continue;
|
|
9977
9978
|
_.push({
|
|
9978
9979
|
id: e,
|
|
9979
|
-
header: () =>
|
|
9980
|
+
header: () => Vc(z(r.name) || t, n, t, z(r.description) || void 0),
|
|
9980
9981
|
size: 150,
|
|
9981
9982
|
enableSorting: !1,
|
|
9982
9983
|
cell: ({ row: e }) => {
|
|
9983
9984
|
let n = e.original.$properties?.find((e) => e.property_code === t);
|
|
9984
|
-
return !n || n.value == null ?
|
|
9985
|
+
return !n || n.value == null ? Xr("span", { className: "text-sm text-muted-foreground" }, "-") : Xr("span", { className: "text-sm" }, U(n.value));
|
|
9985
9986
|
}
|
|
9986
9987
|
});
|
|
9987
9988
|
continue;
|
|
@@ -9990,7 +9991,7 @@ function Bc(e) {
|
|
|
9990
9991
|
_.push({
|
|
9991
9992
|
id: e,
|
|
9992
9993
|
accessorFn: (t) => t.$files?.[e] ?? null,
|
|
9993
|
-
header: () =>
|
|
9994
|
+
header: () => Vc(hr(n, e, i?.entities), n, e),
|
|
9994
9995
|
size: 150,
|
|
9995
9996
|
cell: ({ row: t }) => Wn({
|
|
9996
9997
|
entity: n,
|
|
@@ -10020,7 +10021,7 @@ function Bc(e) {
|
|
|
10020
10021
|
_.push({
|
|
10021
10022
|
id: e,
|
|
10022
10023
|
accessorKey: e,
|
|
10023
|
-
header: () =>
|
|
10024
|
+
header: () => Vc(r, n, e, z(t.display?.description) || void 0),
|
|
10024
10025
|
enableSorting: t.type !== "json",
|
|
10025
10026
|
size: o ?? 150,
|
|
10026
10027
|
cell: ({ getValue: e, row: t }) => s(e(), t.original)
|
|
@@ -10031,7 +10032,7 @@ function Bc(e) {
|
|
|
10031
10032
|
id: "_actions",
|
|
10032
10033
|
header: "",
|
|
10033
10034
|
size: 40,
|
|
10034
|
-
cell: ({ row: e }) =>
|
|
10035
|
+
cell: ({ row: e }) => Xr(Bc, {
|
|
10035
10036
|
row: e.original,
|
|
10036
10037
|
rowId: h(n, e.original),
|
|
10037
10038
|
screen: r,
|
|
@@ -10049,7 +10050,7 @@ function Bc(e) {
|
|
|
10049
10050
|
}
|
|
10050
10051
|
//#endregion
|
|
10051
10052
|
//#region src/components/columns/ColumnPicker.tsx
|
|
10052
|
-
function
|
|
10053
|
+
function Uc({ availableColumns: e, visibleColumns: t, onToggle: r, onReset: i, onShowAll: a, columnLabel: o = (e) => e }) {
|
|
10053
10054
|
let s = Y(null), [c, l] = X(!1);
|
|
10054
10055
|
return /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(I, {
|
|
10055
10056
|
ref: s,
|
|
@@ -10099,7 +10100,7 @@ function Vc({ availableColumns: e, visibleColumns: t, onToggle: r, onReset: i, o
|
|
|
10099
10100
|
}
|
|
10100
10101
|
//#endregion
|
|
10101
10102
|
//#region src/components/views/ViewSwitcher.tsx
|
|
10102
|
-
var
|
|
10103
|
+
var Wc = {
|
|
10103
10104
|
display: "flex",
|
|
10104
10105
|
alignItems: "center",
|
|
10105
10106
|
gap: 6,
|
|
@@ -10113,7 +10114,7 @@ var Hc = {
|
|
|
10113
10114
|
color: "var(--text-2)",
|
|
10114
10115
|
fontFamily: "inherit"
|
|
10115
10116
|
};
|
|
10116
|
-
function
|
|
10117
|
+
function Gc({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onSaveAs: o }) {
|
|
10117
10118
|
let s = Y(null), [c, l] = X(!1), d = e.find((e) => e.id === t), f = e.filter((e) => e.source === "system"), p = e.filter((e) => e.source === "personal"), m = e.filter((e) => e.source === "shared"), h = d ? z(d.name) : "Default view", g = (e) => /* @__PURE__ */ Q("div", {
|
|
10118
10119
|
style: {
|
|
10119
10120
|
padding: "6px 8px 4px",
|
|
@@ -10136,7 +10137,7 @@ function Uc({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onS
|
|
|
10136
10137
|
ref: s,
|
|
10137
10138
|
type: "button",
|
|
10138
10139
|
onClick: () => l((e) => !e),
|
|
10139
|
-
style:
|
|
10140
|
+
style: Wc,
|
|
10140
10141
|
children: [
|
|
10141
10142
|
/* @__PURE__ */ Q(n.star, { size: 12 }),
|
|
10142
10143
|
/* @__PURE__ */ Q("span", { children: h }),
|
|
@@ -10215,14 +10216,14 @@ function Uc({ views: e, activeViewId: t, isDirty: r, onSelect: i, onSave: a, onS
|
|
|
10215
10216
|
}
|
|
10216
10217
|
//#endregion
|
|
10217
10218
|
//#region src/hooks/useScreen.ts
|
|
10218
|
-
function
|
|
10219
|
+
function Kc(e) {
|
|
10219
10220
|
let { data: t } = et();
|
|
10220
10221
|
if (!(!t || !e)) return t.screens[e];
|
|
10221
10222
|
}
|
|
10222
10223
|
//#endregion
|
|
10223
10224
|
//#region src/hooks/useViews.ts
|
|
10224
|
-
function
|
|
10225
|
-
let n =
|
|
10225
|
+
function qc(e, t) {
|
|
10226
|
+
let n = Kc(e), { data: r } = ae("view", {
|
|
10226
10227
|
filters: [{
|
|
10227
10228
|
field: "screen_code",
|
|
10228
10229
|
op: "eq",
|
|
@@ -10272,7 +10273,7 @@ function Gc(e, t) {
|
|
|
10272
10273
|
}
|
|
10273
10274
|
//#endregion
|
|
10274
10275
|
//#region src/components/pages/SmartListPage.tsx
|
|
10275
|
-
function
|
|
10276
|
+
function Jc({ field: e, activeDir: t, activeNulls: r, inMultiSort: i, canAppend: a, onApply: o, onAppend: s, onClearColumn: c, onClearAll: l }) {
|
|
10276
10277
|
let d = Y(null), [f, p] = X(!1), m = [
|
|
10277
10278
|
{
|
|
10278
10279
|
label: "Sort ascending, empty last",
|
|
@@ -10371,7 +10372,7 @@ function Kc({ field: e, activeDir: t, activeNulls: r, inMultiSort: i, canAppend:
|
|
|
10371
10372
|
]
|
|
10372
10373
|
})] });
|
|
10373
10374
|
}
|
|
10374
|
-
var
|
|
10375
|
+
var Yc = 1e4, Xc = [
|
|
10375
10376
|
25,
|
|
10376
10377
|
50,
|
|
10377
10378
|
100,
|
|
@@ -10379,7 +10380,7 @@ var qc = 1e4, Jc = [
|
|
|
10379
10380
|
500,
|
|
10380
10381
|
1e3
|
|
10381
10382
|
];
|
|
10382
|
-
function
|
|
10383
|
+
function Zc(e, t) {
|
|
10383
10384
|
let [n, r] = X(!1);
|
|
10384
10385
|
return q(() => {
|
|
10385
10386
|
if (!e) {
|
|
@@ -10387,14 +10388,14 @@ function Yc(e, t) {
|
|
|
10387
10388
|
return;
|
|
10388
10389
|
}
|
|
10389
10390
|
r(!1);
|
|
10390
|
-
let t = window.setTimeout(() => r(!0),
|
|
10391
|
+
let t = window.setTimeout(() => r(!0), Yc);
|
|
10391
10392
|
return () => window.clearTimeout(t);
|
|
10392
10393
|
}, [e, t]), n;
|
|
10393
10394
|
}
|
|
10394
|
-
function
|
|
10395
|
+
function Qc(e) {
|
|
10395
10396
|
return e instanceof O ? `${e.code}: ${e.message}` : e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.";
|
|
10396
10397
|
}
|
|
10397
|
-
var
|
|
10398
|
+
var $c = /* @__PURE__ */ new Set([
|
|
10398
10399
|
"secret",
|
|
10399
10400
|
"password",
|
|
10400
10401
|
"json",
|
|
@@ -10402,13 +10403,13 @@ var Zc = /* @__PURE__ */ new Set([
|
|
|
10402
10403
|
"int_array",
|
|
10403
10404
|
"uuid_array"
|
|
10404
10405
|
]);
|
|
10405
|
-
function
|
|
10406
|
+
function el(e, t) {
|
|
10406
10407
|
if (e === "_actions" || e === "_select" || e.startsWith("$property.") || e.startsWith("$refs.")) return !1;
|
|
10407
10408
|
if (e.startsWith("$status.")) return !0;
|
|
10408
10409
|
let n = t?.fields.get(e);
|
|
10409
|
-
return n ?
|
|
10410
|
+
return n ? !$c.has(n.type) : !1;
|
|
10410
10411
|
}
|
|
10411
|
-
function
|
|
10412
|
+
function tl(e) {
|
|
10412
10413
|
let t = new URLSearchParams(), n = e.get("search");
|
|
10413
10414
|
n && t.set("search", n);
|
|
10414
10415
|
for (let n of ue) {
|
|
@@ -10417,27 +10418,27 @@ function $c(e) {
|
|
|
10417
10418
|
}
|
|
10418
10419
|
return t;
|
|
10419
10420
|
}
|
|
10420
|
-
function
|
|
10421
|
+
function nl(e, t) {
|
|
10421
10422
|
return Pe(e, He(e, t));
|
|
10422
10423
|
}
|
|
10423
|
-
function
|
|
10424
|
+
function rl(e, t, n) {
|
|
10424
10425
|
if (!e || n.length === 0) return [];
|
|
10425
10426
|
let r = new Set(n);
|
|
10426
|
-
return t.filter((t) => r.has(
|
|
10427
|
+
return t.filter((t) => r.has(nl(e, t))).map((t) => He(e, t));
|
|
10427
10428
|
}
|
|
10428
|
-
function
|
|
10429
|
+
function il(e, t) {
|
|
10429
10430
|
let n = U(t.id);
|
|
10430
10431
|
n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => !e || e.data.some((e) => U(e.id) === n) ? e : {
|
|
10431
10432
|
...e,
|
|
10432
10433
|
data: [t, ...e.data]
|
|
10433
10434
|
});
|
|
10434
10435
|
}
|
|
10435
|
-
var
|
|
10436
|
-
function
|
|
10437
|
-
return /* @__PURE__ */ Q(Re, { children: /* @__PURE__ */ Q(
|
|
10436
|
+
var al = {};
|
|
10437
|
+
function ol({ screenCode: e }) {
|
|
10438
|
+
return /* @__PURE__ */ Q(Re, { children: /* @__PURE__ */ Q(sl, { screenCode: e }) });
|
|
10438
10439
|
}
|
|
10439
|
-
function
|
|
10440
|
-
let t = Un(), r =
|
|
10440
|
+
function sl({ screenCode: e }) {
|
|
10441
|
+
let t = Un(), r = yi(), [i, s] = fi(), { data: c } = et(), l = ot(), [d, f] = X(null), [p, m] = ac("selection", al, { scope: "path" }), [h, g] = X(!1), [_, v] = X(!1), [y, b] = X(!1), [x, S] = X(!1), w = Y(null), [T, E] = X(null), { filters: D, activeCount: O, setFilters: ee, clearFilters: te } = sc(), ne = B((e) => e.user), ie = B((e) => e.activeTenant), oe = qc(e, ne?.id), se = _t(), ce = `dcl:smartlist:default-view-cleared:${e}`, le = Y(!1);
|
|
10441
10442
|
q(() => {
|
|
10442
10443
|
if (le.current || !oe || oe.length === 0) return;
|
|
10443
10444
|
if (i.get("view")) {
|
|
@@ -10451,7 +10452,7 @@ function al({ screenCode: e }) {
|
|
|
10451
10452
|
let e = oe.find((e) => e.source === "personal" && e.is_default);
|
|
10452
10453
|
if (!e || !e.id) return;
|
|
10453
10454
|
le.current = !0;
|
|
10454
|
-
let t =
|
|
10455
|
+
let t = tl(i);
|
|
10455
10456
|
t.set("view", e.id), e.filters && Array.isArray(e.filters) && e.filters.length > 0 && t.set("filters", JSON.stringify(e.filters)), e.columns && e.columns.length > 0 && t.set("columns", e.columns.join(",")), e.sort && t.set("sort", e.sort), s(t, { replace: !0 });
|
|
10456
10457
|
}, [
|
|
10457
10458
|
oe,
|
|
@@ -10480,7 +10481,7 @@ function al({ screenCode: e }) {
|
|
|
10480
10481
|
let e = /* @__PURE__ */ new Map();
|
|
10481
10482
|
for (let t of R) t.nulls && e.set(t.field, t.nulls);
|
|
10482
10483
|
return e;
|
|
10483
|
-
}, [R]), Ne = J(() => hn(je), [je]), Le = J(() =>
|
|
10484
|
+
}, [R]), Ne = J(() => hn(je), [je]), Le = J(() => jc(j, M, c?.entities), [
|
|
10484
10485
|
j,
|
|
10485
10486
|
M,
|
|
10486
10487
|
c?.entities
|
|
@@ -10547,7 +10548,7 @@ function al({ screenCode: e }) {
|
|
|
10547
10548
|
limit: Oe
|
|
10548
10549
|
}, H = kr(N, ht, V);
|
|
10549
10550
|
cn(We(N, nt), !V), cn(Wr(N, ht), V);
|
|
10550
|
-
let gt = V ? H.isLoading : at, vt = V ? H.isFetching : st, yt = V ? H.isError : ct, bt = V ? H.error : lt, xt = V ? H.total : ft?.meta?.total, St = V ? H.countMode : ft?.meta?.count_mode, Ct = V ? H.isLoading : pt, wt = V ? !1 : mt, Tt =
|
|
10551
|
+
let gt = V ? H.isLoading : at, vt = V ? H.isFetching : st, yt = V ? H.isError : ct, bt = V ? H.error : lt, xt = V ? H.total : ft?.meta?.total, St = V ? H.countMode : ft?.meta?.count_mode, Ct = V ? H.isLoading : pt, wt = V ? !1 : mt, Tt = Zc(gt, `${N ?? ""}|${i.toString()}`), Et = K(() => {
|
|
10551
10552
|
N && r.cancelQueries({ queryKey: ["entity-data", N] }), V ? H.refetch() : dt();
|
|
10552
10553
|
}, [
|
|
10553
10554
|
N,
|
|
@@ -10558,7 +10559,7 @@ function al({ screenCode: e }) {
|
|
|
10558
10559
|
]), Ot = lr((e) => e.degradedEntities), kt = Sn(M?.realtime, Ot, N ?? ""), At = jn(N ?? ""), jt = yn(N ?? ""), Mt = bn("view"), Nt = J(() => R.map((e) => ({
|
|
10559
10560
|
id: e.field,
|
|
10560
10561
|
desc: e.dir === "desc"
|
|
10561
|
-
})), [R]), Pt = J(() => M?.fields.names().find((e) => M.fields.get(e)?.primary) ?? "id", [M]), Ft = K((e) => M ?
|
|
10562
|
+
})), [R]), Pt = J(() => M?.fields.names().find((e) => M.fields.get(e)?.primary) ?? "id", [M]), Ft = K((e) => M ? nl(M, e) : U(e[Pt]), [M, Pt]), It = V ? H.refs : rt?.$refs, Lt = Y(It);
|
|
10562
10563
|
Lt.current = It;
|
|
10563
10564
|
let Rt = J(() => {
|
|
10564
10565
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -10585,7 +10586,7 @@ function al({ screenCode: e }) {
|
|
|
10585
10586
|
c?.screens,
|
|
10586
10587
|
Lt,
|
|
10587
10588
|
l
|
|
10588
|
-
]), { labelFor: zt, refs: Bt } =
|
|
10589
|
+
]), { labelFor: zt, refs: Bt } = Pc(Le, D, It, c?.entities), [Vt, Ht] = X(null), Ut = j?.on_row_click === "peek" && j.quick_peek?.enabled !== !1 && ze.category !== "phone", Wt = J(() => Hc({
|
|
10589
10590
|
visibleCols: Xe,
|
|
10590
10591
|
entity: M,
|
|
10591
10592
|
screen: j,
|
|
@@ -10600,7 +10601,7 @@ function al({ screenCode: e }) {
|
|
|
10600
10601
|
userLocale: l,
|
|
10601
10602
|
tabNavigate: t,
|
|
10602
10603
|
refsRef: Lt,
|
|
10603
|
-
rowSelectionKey:
|
|
10604
|
+
rowSelectionKey: nl,
|
|
10604
10605
|
setPeekRow: Ht
|
|
10605
10606
|
}), [
|
|
10606
10607
|
j,
|
|
@@ -10627,10 +10628,10 @@ function al({ screenCode: e }) {
|
|
|
10627
10628
|
V,
|
|
10628
10629
|
xt,
|
|
10629
10630
|
Oe
|
|
10630
|
-
]), Xt = V ? H.hasMore : Jt?.has_more ?? (Yt !== void 0 && De < Yt), Zt =
|
|
10631
|
+
]), Xt = V ? H.hasMore : Jt?.has_more ?? (Yt !== void 0 && De < Yt), Zt = wi({
|
|
10631
10632
|
data: Kt,
|
|
10632
10633
|
columns: Wt,
|
|
10633
|
-
getCoreRowModel:
|
|
10634
|
+
getCoreRowModel: Ci(),
|
|
10634
10635
|
manualSorting: !0,
|
|
10635
10636
|
manualPagination: !0,
|
|
10636
10637
|
state: {
|
|
@@ -10656,7 +10657,7 @@ function al({ screenCode: e }) {
|
|
|
10656
10657
|
onRowSelectionChange: m,
|
|
10657
10658
|
getRowId: Ft,
|
|
10658
10659
|
rowCount: xt ?? Kt.length
|
|
10659
|
-
}), $t = J(() => Object.keys(p).filter((e) => p[e]), [p]), tn = J(() =>
|
|
10660
|
+
}), $t = J(() => Object.keys(p).filter((e) => p[e]), [p]), tn = J(() => rl(M, Kt, $t), [
|
|
10660
10661
|
M,
|
|
10661
10662
|
Kt,
|
|
10662
10663
|
$t
|
|
@@ -10706,7 +10707,7 @@ function al({ screenCode: e }) {
|
|
|
10706
10707
|
};
|
|
10707
10708
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
10708
10709
|
}, []);
|
|
10709
|
-
let mn = Y(null), { rows: gn } = Zt.getRowModel(), _n = G((e) => e.density), vn = G((e) => e.zebra), Cn = an(), W =
|
|
10710
|
+
let mn = Y(null), { rows: gn } = Zt.getRowModel(), _n = G((e) => e.density), vn = G((e) => e.zebra), Cn = an(), W = Ti({
|
|
10710
10711
|
count: gn.length,
|
|
10711
10712
|
getScrollElement: () => mn.current,
|
|
10712
10713
|
estimateSize: () => Ye === "cards" ? 142 : 48,
|
|
@@ -10856,7 +10857,7 @@ function al({ screenCode: e }) {
|
|
|
10856
10857
|
return n ? z(n.name) || t : e;
|
|
10857
10858
|
}
|
|
10858
10859
|
return hr(M, e, c?.entities);
|
|
10859
|
-
}, tr = (j.columns ?? []).filter((e) =>
|
|
10860
|
+
}, tr = (j.columns ?? []).filter((e) => el(e, M)), nr = tn.map((e) => Pe(M, e)), rr = [];
|
|
10860
10861
|
if ($t.length > 0) {
|
|
10861
10862
|
let e = /* @__PURE__ */ new Map();
|
|
10862
10863
|
for (let t of Kt) e.set(Ft(t), t);
|
|
@@ -10901,7 +10902,7 @@ function al({ screenCode: e }) {
|
|
|
10901
10902
|
row: e.original
|
|
10902
10903
|
});
|
|
10903
10904
|
},
|
|
10904
|
-
children: e.getVisibleCells().map((e) => /* @__PURE__ */ Q(
|
|
10905
|
+
children: e.getVisibleCells().map((e) => /* @__PURE__ */ Q(zc, { cell: e }, e.id))
|
|
10905
10906
|
}, e.id);
|
|
10906
10907
|
}, sr = (e) => {
|
|
10907
10908
|
if (e.startsWith("$status.")) {
|
|
@@ -11024,7 +11025,7 @@ function al({ screenCode: e }) {
|
|
|
11024
11025
|
ve && /* @__PURE__ */ Q("span", {
|
|
11025
11026
|
"data-testid": "row-select-checkbox",
|
|
11026
11027
|
style: { paddingTop: 2 },
|
|
11027
|
-
children: /* @__PURE__ */ Q(
|
|
11028
|
+
children: /* @__PURE__ */ Q(Oi, {
|
|
11028
11029
|
checked: a,
|
|
11029
11030
|
onChange: () => e.toggleSelected()
|
|
11030
11031
|
})
|
|
@@ -11128,7 +11129,7 @@ function al({ screenCode: e }) {
|
|
|
11128
11129
|
})
|
|
11129
11130
|
]
|
|
11130
11131
|
}),
|
|
11131
|
-
/* @__PURE__ */ Q(
|
|
11132
|
+
/* @__PURE__ */ Q(Bc, {
|
|
11132
11133
|
row: r,
|
|
11133
11134
|
rowId: Ft(r),
|
|
11134
11135
|
screen: j,
|
|
@@ -11155,7 +11156,7 @@ function al({ screenCode: e }) {
|
|
|
11155
11156
|
},
|
|
11156
11157
|
children: [
|
|
11157
11158
|
/* @__PURE__ */ $(Z, { children: [
|
|
11158
|
-
/* @__PURE__ */ Q(
|
|
11159
|
+
/* @__PURE__ */ Q(Lc, {
|
|
11159
11160
|
title: qn,
|
|
11160
11161
|
description: Yn,
|
|
11161
11162
|
toolbarActions: me,
|
|
@@ -11176,13 +11177,13 @@ function al({ screenCode: e }) {
|
|
|
11176
11177
|
flexWrap: "wrap"
|
|
11177
11178
|
},
|
|
11178
11179
|
children: [
|
|
11179
|
-
/* @__PURE__ */ Q(
|
|
11180
|
+
/* @__PURE__ */ Q(Gc, {
|
|
11180
11181
|
views: oe,
|
|
11181
11182
|
activeViewId: i.get("view"),
|
|
11182
11183
|
isDirty: !1,
|
|
11183
11184
|
onSelect: (e) => {
|
|
11184
11185
|
if (!e.id) {
|
|
11185
|
-
typeof window < "u" && window.sessionStorage?.setItem(ce, "1"), s(
|
|
11186
|
+
typeof window < "u" && window.sessionStorage?.setItem(ce, "1"), s(tl(i));
|
|
11186
11187
|
return;
|
|
11187
11188
|
}
|
|
11188
11189
|
let t = new URLSearchParams(i);
|
|
@@ -11279,7 +11280,7 @@ function al({ screenCode: e }) {
|
|
|
11279
11280
|
})] })
|
|
11280
11281
|
]
|
|
11281
11282
|
})] }),
|
|
11282
|
-
!Zn && /* @__PURE__ */ Q(
|
|
11283
|
+
!Zn && /* @__PURE__ */ Q(Uc, {
|
|
11283
11284
|
availableColumns: j.columns ?? [],
|
|
11284
11285
|
visibleColumns: Xe,
|
|
11285
11286
|
onToggle: (e) => {
|
|
@@ -11356,7 +11357,7 @@ function al({ screenCode: e }) {
|
|
|
11356
11357
|
capability: M.documents,
|
|
11357
11358
|
canManageTemplates: Qt(c)
|
|
11358
11359
|
}),
|
|
11359
|
-
N && M && /* @__PURE__ */ Q(
|
|
11360
|
+
N && M && /* @__PURE__ */ Q(nc, {
|
|
11360
11361
|
entityCode: N,
|
|
11361
11362
|
entity: M,
|
|
11362
11363
|
screen: j,
|
|
@@ -11379,7 +11380,7 @@ function al({ screenCode: e }) {
|
|
|
11379
11380
|
}),
|
|
11380
11381
|
D.length > 0 && /* @__PURE__ */ Q("div", {
|
|
11381
11382
|
style: { padding: "0 20px 10px" },
|
|
11382
|
-
children: /* @__PURE__ */ Q(
|
|
11383
|
+
children: /* @__PURE__ */ Q(vc, {
|
|
11383
11384
|
filters: D,
|
|
11384
11385
|
resolveValue: zt,
|
|
11385
11386
|
onRemove: (e) => ee(Mr(D, e)),
|
|
@@ -11402,7 +11403,7 @@ function al({ screenCode: e }) {
|
|
|
11402
11403
|
] }),
|
|
11403
11404
|
gt && Tt ? /* @__PURE__ */ Q("div", {
|
|
11404
11405
|
style: { padding: "0 20px" },
|
|
11405
|
-
children: /* @__PURE__ */ Q(
|
|
11406
|
+
children: /* @__PURE__ */ Q(oc, {
|
|
11406
11407
|
icon: "alert-circle",
|
|
11407
11408
|
title: "Still loading data",
|
|
11408
11409
|
description: "This table is taking longer than expected. Retry the request or check network and server health.",
|
|
@@ -11415,10 +11416,10 @@ function al({ screenCode: e }) {
|
|
|
11415
11416
|
})
|
|
11416
11417
|
}) : gt ? /* @__PURE__ */ Q(An, { cols: j.columns?.length ?? 4 }) : yt ? /* @__PURE__ */ Q("div", {
|
|
11417
11418
|
style: { padding: "0 20px" },
|
|
11418
|
-
children: /* @__PURE__ */ Q(
|
|
11419
|
+
children: /* @__PURE__ */ Q(oc, {
|
|
11419
11420
|
icon: "alert-circle",
|
|
11420
11421
|
title: "Failed to load data",
|
|
11421
|
-
description:
|
|
11422
|
+
description: Qc(bt),
|
|
11422
11423
|
action: /* @__PURE__ */ Q(I, {
|
|
11423
11424
|
kind: "primary",
|
|
11424
11425
|
size: "sm",
|
|
@@ -11435,7 +11436,7 @@ function al({ screenCode: e }) {
|
|
|
11435
11436
|
target: "_blank",
|
|
11436
11437
|
rel: "noopener noreferrer",
|
|
11437
11438
|
children: "Learn more"
|
|
11438
|
-
})] })] }) : ue ? `Create your first ${z(Gn.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(
|
|
11439
|
+
})] })] }) : ue ? `Create your first ${z(Gn.name).toLowerCase()} to get started` : void 0, /* @__PURE__ */ Q(oc, {
|
|
11439
11440
|
icon: Jn,
|
|
11440
11441
|
title: a,
|
|
11441
11442
|
description: o
|
|
@@ -11503,7 +11504,7 @@ function al({ screenCode: e }) {
|
|
|
11503
11504
|
background: "var(--surface-2)"
|
|
11504
11505
|
},
|
|
11505
11506
|
children: e.headers.map((e) => {
|
|
11506
|
-
let t =
|
|
11507
|
+
let t = el(e.id, M), r = e.column.getIsSorted(), i = e.id === "_select", a = e.id === "_actions", o = r ? R.findIndex((t) => t.field === e.id) + 1 : 0, s = R.length > 1 && o > 0, c = o > 0, l = R.length < 5, u = t ? e.column.getToggleSortingHandler() : void 0;
|
|
11507
11508
|
return /* @__PURE__ */ Q("th", {
|
|
11508
11509
|
onClick: t ? (t) => {
|
|
11509
11510
|
if (t.shiftKey) {
|
|
@@ -11540,7 +11541,7 @@ function al({ screenCode: e }) {
|
|
|
11540
11541
|
letterSpacing: "0.04em"
|
|
11541
11542
|
},
|
|
11542
11543
|
children: [
|
|
11543
|
-
|
|
11544
|
+
Si(e.column.columnDef.header, e.getContext()),
|
|
11544
11545
|
/* @__PURE__ */ $("span", {
|
|
11545
11546
|
style: {
|
|
11546
11547
|
display: "inline-flex",
|
|
@@ -11573,7 +11574,7 @@ function al({ screenCode: e }) {
|
|
|
11573
11574
|
},
|
|
11574
11575
|
children: o
|
|
11575
11576
|
}) : null,
|
|
11576
|
-
/* @__PURE__ */ Q(
|
|
11577
|
+
/* @__PURE__ */ Q(Jc, {
|
|
11577
11578
|
field: e.id,
|
|
11578
11579
|
activeDir: r,
|
|
11579
11580
|
activeNulls: Me.get(e.id),
|
|
@@ -11585,7 +11586,7 @@ function al({ screenCode: e }) {
|
|
|
11585
11586
|
onClearAll: pn
|
|
11586
11587
|
})
|
|
11587
11588
|
]
|
|
11588
|
-
}) :
|
|
11589
|
+
}) : Si(e.column.columnDef.header, e.getContext())
|
|
11589
11590
|
}, e.id);
|
|
11590
11591
|
})
|
|
11591
11592
|
}, e.id)) }), /* @__PURE__ */ $("tbody", { children: [
|
|
@@ -11631,7 +11632,7 @@ function al({ screenCode: e }) {
|
|
|
11631
11632
|
] }) : /* @__PURE__ */ $(Z, { children: [
|
|
11632
11633
|
Kt.length,
|
|
11633
11634
|
" of ",
|
|
11634
|
-
|
|
11635
|
+
_c(xt, St ?? "exact"),
|
|
11635
11636
|
" ",
|
|
11636
11637
|
xt === 1 ? "record" : "records"
|
|
11637
11638
|
] })
|
|
@@ -11663,7 +11664,7 @@ function al({ screenCode: e }) {
|
|
|
11663
11664
|
color: "var(--text-2)",
|
|
11664
11665
|
cursor: "pointer"
|
|
11665
11666
|
},
|
|
11666
|
-
children:
|
|
11667
|
+
children: Xc.map((e) => /* @__PURE__ */ Q("option", {
|
|
11667
11668
|
value: e,
|
|
11668
11669
|
children: e
|
|
11669
11670
|
}, e))
|
|
@@ -11720,7 +11721,7 @@ function al({ screenCode: e }) {
|
|
|
11720
11721
|
})]
|
|
11721
11722
|
})
|
|
11722
11723
|
}),
|
|
11723
|
-
/* @__PURE__ */ Q(
|
|
11724
|
+
/* @__PURE__ */ Q(Sc, {
|
|
11724
11725
|
open: h,
|
|
11725
11726
|
onClose: () => g(!1),
|
|
11726
11727
|
filters: D,
|
|
@@ -11729,7 +11730,7 @@ function al({ screenCode: e }) {
|
|
|
11729
11730
|
defaultFilters: j?.default_filters,
|
|
11730
11731
|
refs: Bt
|
|
11731
11732
|
}),
|
|
11732
|
-
/* @__PURE__ */ Q(
|
|
11733
|
+
/* @__PURE__ */ Q(Ic, {
|
|
11733
11734
|
open: _,
|
|
11734
11735
|
pending: Mt.isPending,
|
|
11735
11736
|
onClose: () => v(!1),
|
|
@@ -11747,7 +11748,7 @@ function al({ screenCode: e }) {
|
|
|
11747
11748
|
is_default: !1
|
|
11748
11749
|
}), a = U(n.data.id);
|
|
11749
11750
|
if (a) {
|
|
11750
|
-
|
|
11751
|
+
il(r, n.data), await r.invalidateQueries({ queryKey: ["entity-data", "view"] });
|
|
11751
11752
|
let e = new URLSearchParams(i);
|
|
11752
11753
|
e.set("view", a), s(e);
|
|
11753
11754
|
}
|
|
@@ -11763,7 +11764,7 @@ function al({ screenCode: e }) {
|
|
|
11763
11764
|
onConfirm: Hn,
|
|
11764
11765
|
destructive: !0
|
|
11765
11766
|
}),
|
|
11766
|
-
$t.length > 0 && /* @__PURE__ */ Q(
|
|
11767
|
+
$t.length > 0 && /* @__PURE__ */ Q(Rc, {
|
|
11767
11768
|
selectedIds: $t,
|
|
11768
11769
|
floatbarActions: he,
|
|
11769
11770
|
screenActionLayout: j.action_layout,
|
|
@@ -11829,7 +11830,7 @@ function al({ screenCode: e }) {
|
|
|
11829
11830
|
}
|
|
11830
11831
|
})]
|
|
11831
11832
|
}),
|
|
11832
|
-
Ut && Vt && M && /* @__PURE__ */ Q(
|
|
11833
|
+
Ut && Vt && M && /* @__PURE__ */ Q(fc, {
|
|
11833
11834
|
entity: M,
|
|
11834
11835
|
entityCode: N,
|
|
11835
11836
|
record: Vt,
|
|
@@ -11886,26 +11887,26 @@ function al({ screenCode: e }) {
|
|
|
11886
11887
|
}
|
|
11887
11888
|
//#endregion
|
|
11888
11889
|
//#region src/components/pages/SmartDetailPage.tsx
|
|
11889
|
-
var
|
|
11890
|
-
function
|
|
11890
|
+
var cl = Zr(() => import("./SmartDetailPage.impl-Ccz4TqfJ.js").then((e) => ({ default: e.SmartDetailPage })));
|
|
11891
|
+
function ll(e) {
|
|
11891
11892
|
return /* @__PURE__ */ Q(Jr, {
|
|
11892
11893
|
fallback: null,
|
|
11893
|
-
children: /* @__PURE__ */ Q(
|
|
11894
|
+
children: /* @__PURE__ */ Q(cl, { ...e })
|
|
11894
11895
|
});
|
|
11895
11896
|
}
|
|
11896
11897
|
//#endregion
|
|
11897
11898
|
//#region src/components/pages/SmartRecordListPage.tsx
|
|
11898
|
-
var
|
|
11899
|
-
function
|
|
11899
|
+
var ul = Zr(() => import("./SmartRecordListPage.impl-Y0w4oIe3.js").then((e) => ({ default: e.SmartRecordListPage })));
|
|
11900
|
+
function dl(e) {
|
|
11900
11901
|
return /* @__PURE__ */ Q(Jr, {
|
|
11901
11902
|
fallback: null,
|
|
11902
|
-
children: /* @__PURE__ */ Q(
|
|
11903
|
+
children: /* @__PURE__ */ Q(ul, { ...e })
|
|
11903
11904
|
});
|
|
11904
11905
|
}
|
|
11905
11906
|
//#endregion
|
|
11906
11907
|
//#region src/hooks/useVersionWatcher.ts
|
|
11907
|
-
function
|
|
11908
|
-
let e =
|
|
11908
|
+
function fl() {
|
|
11909
|
+
let e = yi();
|
|
11909
11910
|
q(() => {
|
|
11910
11911
|
let t = !1, n = null, r = 6e4, i = r, a = 0, o = 0;
|
|
11911
11912
|
function s(e) {
|
|
@@ -11961,34 +11962,50 @@ function ul() {
|
|
|
11961
11962
|
}
|
|
11962
11963
|
//#endregion
|
|
11963
11964
|
//#region src/lib/capabilityPrefetch.ts
|
|
11964
|
-
var
|
|
11965
|
+
var pl = [
|
|
11965
11966
|
() => import("./MarkdownRenderer-CvURrJCu.js"),
|
|
11966
11967
|
() => import("./JsonEditor-DoNmyrYd.js"),
|
|
11967
11968
|
() => import("./Grid-DT9wV-D7.js"),
|
|
11968
11969
|
() => import("./DraggableChildrenTable-ChUh120M.js")
|
|
11969
11970
|
];
|
|
11970
|
-
function fl() {
|
|
11971
|
-
for (let e of dl) e().catch(() => {});
|
|
11972
|
-
}
|
|
11973
|
-
var pl = !1;
|
|
11974
11971
|
function ml() {
|
|
11975
|
-
|
|
11976
|
-
|
|
11972
|
+
for (let e of pl) e().catch(() => {});
|
|
11973
|
+
}
|
|
11974
|
+
var hl = !1;
|
|
11975
|
+
function gl() {
|
|
11976
|
+
if (hl) return;
|
|
11977
|
+
hl = !0;
|
|
11977
11978
|
let e = globalThis.requestIdleCallback;
|
|
11978
|
-
typeof e == "function" ? e(
|
|
11979
|
+
typeof e == "function" ? e(ml) : setTimeout(ml, 0);
|
|
11979
11980
|
}
|
|
11980
11981
|
//#endregion
|
|
11981
11982
|
//#region src/stores/screen-registry.ts
|
|
11982
|
-
var
|
|
11983
|
-
function
|
|
11984
|
-
|
|
11983
|
+
var _l = /* @__PURE__ */ new Map();
|
|
11984
|
+
function vl(e, t) {
|
|
11985
|
+
_l.set(e, t);
|
|
11986
|
+
}
|
|
11987
|
+
function yl(e) {
|
|
11988
|
+
return _l.get(e);
|
|
11989
|
+
}
|
|
11990
|
+
//#endregion
|
|
11991
|
+
//#region src/hooks/useCurrentScreen.tsx
|
|
11992
|
+
var bl = Yr(void 0);
|
|
11993
|
+
function xl({ code: e, children: t }) {
|
|
11994
|
+
let { data: n } = et(), r = J(() => ({
|
|
11995
|
+
code: e,
|
|
11996
|
+
screen: n?.screens[e]
|
|
11997
|
+
}), [e, n]);
|
|
11998
|
+
return /* @__PURE__ */ Q(bl.Provider, {
|
|
11999
|
+
value: r,
|
|
12000
|
+
children: t
|
|
12001
|
+
});
|
|
11985
12002
|
}
|
|
11986
|
-
function
|
|
11987
|
-
return
|
|
12003
|
+
function Sl() {
|
|
12004
|
+
return Qr(bl);
|
|
11988
12005
|
}
|
|
11989
12006
|
//#endregion
|
|
11990
12007
|
//#region src/lib/brand-tokens.ts
|
|
11991
|
-
var
|
|
12008
|
+
var Cl = ["light", "dark"], wl = ["page_title_size", "page_title_line_height"], Tl = [
|
|
11992
12009
|
"background",
|
|
11993
12010
|
"surface",
|
|
11994
12011
|
"surface_2",
|
|
@@ -12004,19 +12021,19 @@ var vl = ["light", "dark"], yl = ["page_title_size", "page_title_line_height"],
|
|
|
12004
12021
|
"sidebar",
|
|
12005
12022
|
"rail"
|
|
12006
12023
|
];
|
|
12007
|
-
function
|
|
12024
|
+
function El(e) {
|
|
12008
12025
|
return `--${e.replace(/_/g, "-")}`;
|
|
12009
12026
|
}
|
|
12010
|
-
function
|
|
12027
|
+
function Dl(e) {
|
|
12011
12028
|
if (typeof e != "string") return null;
|
|
12012
12029
|
let t = e.trim();
|
|
12013
12030
|
return !t || /[;{}]/.test(t) ? null : t;
|
|
12014
12031
|
}
|
|
12015
|
-
function
|
|
12016
|
-
let t =
|
|
12032
|
+
function Ol(e) {
|
|
12033
|
+
let t = Dl(e);
|
|
12017
12034
|
return !t || typeof CSS < "u" && CSS.supports && !CSS.supports("color", t) ? null : t;
|
|
12018
12035
|
}
|
|
12019
|
-
var
|
|
12036
|
+
var kl = {
|
|
12020
12037
|
light: {
|
|
12021
12038
|
soft: 10,
|
|
12022
12039
|
ring: 28,
|
|
@@ -12028,62 +12045,62 @@ var wl = {
|
|
|
12028
12045
|
row: 22
|
|
12029
12046
|
}
|
|
12030
12047
|
};
|
|
12031
|
-
function
|
|
12032
|
-
if (!
|
|
12033
|
-
let n =
|
|
12048
|
+
function Al(e, t) {
|
|
12049
|
+
if (!Ol(t.accent)) return [];
|
|
12050
|
+
let n = kl[e];
|
|
12034
12051
|
return [
|
|
12035
12052
|
`--accent-soft: color-mix(in srgb, var(--accent) ${n.soft}%, var(--surface))`,
|
|
12036
12053
|
`--accent-ring: color-mix(in srgb, var(--accent) ${n.ring}%, transparent)`,
|
|
12037
12054
|
`--row-selected-bg: color-mix(in srgb, var(--accent) ${n.row}%, var(--surface))`
|
|
12038
12055
|
];
|
|
12039
12056
|
}
|
|
12040
|
-
function
|
|
12057
|
+
function jl(e, t) {
|
|
12041
12058
|
let n = [];
|
|
12042
|
-
for (let e of
|
|
12043
|
-
let r =
|
|
12044
|
-
r && n.push(`${
|
|
12059
|
+
for (let e of Tl) {
|
|
12060
|
+
let r = Ol(t[e]);
|
|
12061
|
+
r && n.push(`${El(e)}: ${r}`);
|
|
12045
12062
|
}
|
|
12046
|
-
return n.push(...
|
|
12063
|
+
return n.push(...Al(e, t)), n;
|
|
12047
12064
|
}
|
|
12048
|
-
function
|
|
12065
|
+
function Ml(e) {
|
|
12049
12066
|
if (!e) return "";
|
|
12050
|
-
let t = [], n = [], r =
|
|
12067
|
+
let t = [], n = [], r = Dl(e.font_sans), i = Dl(e.font_mono);
|
|
12051
12068
|
r && n.push(`--font-sans: ${r}`), i && n.push(`--font-mono: ${i}`);
|
|
12052
|
-
for (let t of
|
|
12053
|
-
let r =
|
|
12054
|
-
r && n.push(`${
|
|
12069
|
+
for (let t of wl) {
|
|
12070
|
+
let r = Dl(e.typography?.[t]);
|
|
12071
|
+
r && n.push(`${El(t)}: ${r}`);
|
|
12055
12072
|
}
|
|
12056
12073
|
n.length && t.push(`:root { ${n.join("; ")}; }`);
|
|
12057
|
-
for (let n of
|
|
12074
|
+
for (let n of Cl) {
|
|
12058
12075
|
let r = e.colors?.[n];
|
|
12059
12076
|
if (!r) continue;
|
|
12060
|
-
let i =
|
|
12077
|
+
let i = jl(n, r);
|
|
12061
12078
|
i.length && t.push(`html[data-color-scheme="${n}"] { ${i.join("; ")}; }`);
|
|
12062
12079
|
}
|
|
12063
12080
|
return t.join("\n");
|
|
12064
12081
|
}
|
|
12065
|
-
var
|
|
12066
|
-
function
|
|
12082
|
+
var Nl = "declarion-brand-tokens", Pl = "consumer-brand-css";
|
|
12083
|
+
function Fl(e) {
|
|
12067
12084
|
if (typeof document > "u") return;
|
|
12068
|
-
let t = document.head, n = document.getElementById(
|
|
12085
|
+
let t = document.head, n = document.getElementById(Nl);
|
|
12069
12086
|
if (!e) {
|
|
12070
12087
|
n?.remove();
|
|
12071
12088
|
return;
|
|
12072
12089
|
}
|
|
12073
12090
|
let r = n ?? document.createElement("style");
|
|
12074
|
-
n || (r.id =
|
|
12075
|
-
let i = document.getElementById(
|
|
12091
|
+
n || (r.id = Nl, t.appendChild(r)), r.textContent !== e && (r.textContent = e);
|
|
12092
|
+
let i = document.getElementById(Pl);
|
|
12076
12093
|
i && i.compareDocumentPosition(r) & Node.DOCUMENT_POSITION_FOLLOWING && t.appendChild(i);
|
|
12077
12094
|
}
|
|
12078
12095
|
//#endregion
|
|
12079
12096
|
//#region src/app.tsx
|
|
12080
|
-
|
|
12081
|
-
var
|
|
12097
|
+
vl("Profile", Ls);
|
|
12098
|
+
var Il = "declarion-managed-favicon", Ll = new pi({ defaultOptions: { queries: {
|
|
12082
12099
|
staleTime: 300 * 1e3,
|
|
12083
12100
|
retry: 1
|
|
12084
12101
|
} } });
|
|
12085
|
-
Jt(
|
|
12086
|
-
function
|
|
12102
|
+
Jt(Ll, jt);
|
|
12103
|
+
function Rl(e) {
|
|
12087
12104
|
if (typeof window > "u") return null;
|
|
12088
12105
|
try {
|
|
12089
12106
|
let t = new URL(e, window.location.origin);
|
|
@@ -12092,7 +12109,7 @@ function Nl(e) {
|
|
|
12092
12109
|
return null;
|
|
12093
12110
|
}
|
|
12094
12111
|
}
|
|
12095
|
-
function
|
|
12112
|
+
function zl() {
|
|
12096
12113
|
let { data: e } = et();
|
|
12097
12114
|
return {
|
|
12098
12115
|
routes: J(() => {
|
|
@@ -12102,41 +12119,53 @@ function Pl() {
|
|
|
12102
12119
|
if (r.type === "list") {
|
|
12103
12120
|
let i = r.entity;
|
|
12104
12121
|
if ((i ? e.entities?.[i] : void 0)?.singleton) continue;
|
|
12105
|
-
t.push(/* @__PURE__ */ Q(
|
|
12122
|
+
t.push(/* @__PURE__ */ Q(ri, {
|
|
12106
12123
|
path: r.route,
|
|
12107
|
-
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(
|
|
12124
|
+
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(xl, {
|
|
12125
|
+
code: n,
|
|
12126
|
+
children: /* @__PURE__ */ Q(ol, { screenCode: n })
|
|
12127
|
+
}) })
|
|
12108
12128
|
}, n));
|
|
12109
12129
|
continue;
|
|
12110
12130
|
}
|
|
12111
12131
|
if (r.type === "detail") {
|
|
12112
|
-
t.push(/* @__PURE__ */ Q(
|
|
12132
|
+
t.push(/* @__PURE__ */ Q(ri, {
|
|
12113
12133
|
path: r.route,
|
|
12114
|
-
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(
|
|
12134
|
+
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(xl, {
|
|
12135
|
+
code: n,
|
|
12136
|
+
children: /* @__PURE__ */ Q(ll, { screenCode: n })
|
|
12137
|
+
}) })
|
|
12115
12138
|
}, n));
|
|
12116
12139
|
continue;
|
|
12117
12140
|
}
|
|
12118
12141
|
if (r.type === "record_list") {
|
|
12119
|
-
t.push(/* @__PURE__ */ Q(
|
|
12142
|
+
t.push(/* @__PURE__ */ Q(ri, {
|
|
12120
12143
|
path: r.route,
|
|
12121
|
-
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(
|
|
12144
|
+
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(xl, {
|
|
12145
|
+
code: n,
|
|
12146
|
+
children: /* @__PURE__ */ Q(dl, { screenCode: n })
|
|
12147
|
+
}) })
|
|
12122
12148
|
}, n));
|
|
12123
12149
|
continue;
|
|
12124
12150
|
}
|
|
12125
12151
|
if (r.type === "custom") {
|
|
12126
|
-
let e = r.component ?
|
|
12127
|
-
e && t.push(/* @__PURE__ */ Q(
|
|
12152
|
+
let e = r.component ? yl(r.component) : void 0;
|
|
12153
|
+
e && t.push(/* @__PURE__ */ Q(ri, {
|
|
12128
12154
|
path: r.route,
|
|
12129
|
-
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(
|
|
12155
|
+
element: /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(xl, {
|
|
12156
|
+
code: n,
|
|
12157
|
+
children: /* @__PURE__ */ Q(e, { screenCode: n })
|
|
12158
|
+
}) })
|
|
12130
12159
|
}, n));
|
|
12131
12160
|
}
|
|
12132
12161
|
}
|
|
12133
12162
|
return t;
|
|
12134
12163
|
}, [e]),
|
|
12135
|
-
defaultRoute: J(() =>
|
|
12164
|
+
defaultRoute: J(() => is(e), [e])
|
|
12136
12165
|
};
|
|
12137
12166
|
}
|
|
12138
|
-
function
|
|
12139
|
-
let t = B((e) => e.initialize), n = B((e) => e.isLoading), r = B((e) => e.isAuthenticated), { data: i, isLoading: a } = et(), { data: o, isLoading: s } = Zt(), { branding: c, isLoading: l } = Vt(), { routes: u, defaultRoute: d } =
|
|
12167
|
+
function Bl() {
|
|
12168
|
+
let t = B((e) => e.initialize), n = B((e) => e.isLoading), r = B((e) => e.isAuthenticated), { data: i, isLoading: a } = et(), { data: o, isLoading: s } = Zt(), { branding: c, isLoading: l } = Vt(), { routes: u, defaultRoute: d } = zl(), f = we(), p = typeof window < "u" && window.self !== window.top && !f.enabled;
|
|
12140
12169
|
q(() => {
|
|
12141
12170
|
f.enabled || p || t();
|
|
12142
12171
|
}, [
|
|
@@ -12148,7 +12177,7 @@ function Fl() {
|
|
|
12148
12177
|
q(() => {
|
|
12149
12178
|
e(m ?? {});
|
|
12150
12179
|
}, [m]), q(() => {
|
|
12151
|
-
|
|
12180
|
+
gl();
|
|
12152
12181
|
}, []);
|
|
12153
12182
|
let h = c?.identity, g = c?.theme;
|
|
12154
12183
|
q(() => {
|
|
@@ -12157,7 +12186,7 @@ function Fl() {
|
|
|
12157
12186
|
e && (document.title = e);
|
|
12158
12187
|
}, [h?.app_name]), q(() => {
|
|
12159
12188
|
if (typeof document > "u") return;
|
|
12160
|
-
let e = h?.app_logo, t = It(e) ?
|
|
12189
|
+
let e = h?.app_logo, t = It(e) ? Rl(e.trim()) : null, n = document.getElementById(Il);
|
|
12161
12190
|
if (!t) {
|
|
12162
12191
|
n && n.remove();
|
|
12163
12192
|
return;
|
|
@@ -12165,22 +12194,22 @@ function Fl() {
|
|
|
12165
12194
|
if (!n) {
|
|
12166
12195
|
document.querySelectorAll("link[rel=\"icon\"], link[rel=\"shortcut icon\"]").forEach((e) => e.remove());
|
|
12167
12196
|
let e = document.createElement("link");
|
|
12168
|
-
e.id =
|
|
12197
|
+
e.id = Il, e.rel = "icon", e.href = t, document.head.appendChild(e);
|
|
12169
12198
|
return;
|
|
12170
12199
|
}
|
|
12171
12200
|
n.href !== t && (n.href = t);
|
|
12172
12201
|
}, [h?.app_logo]);
|
|
12173
|
-
let _ = g?.css_url ?? null, v = J(() =>
|
|
12202
|
+
let _ = g?.css_url ?? null, v = J(() => Ml(g), [g]);
|
|
12174
12203
|
q(() => {
|
|
12175
|
-
|
|
12204
|
+
Fl(v);
|
|
12176
12205
|
}, [v]), q(() => {
|
|
12177
12206
|
if (typeof document > "u") return;
|
|
12178
|
-
let e = document.getElementById(
|
|
12207
|
+
let e = document.getElementById(Pl);
|
|
12179
12208
|
if (!_) {
|
|
12180
12209
|
e && e.remove();
|
|
12181
12210
|
return;
|
|
12182
12211
|
}
|
|
12183
|
-
let t =
|
|
12212
|
+
let t = Rl(_);
|
|
12184
12213
|
if (!t) {
|
|
12185
12214
|
e && e.remove(), console.error(`[declarion] branding.theme.css_url rejected: ${_}. Only same-origin, relative URLs are allowed (e.g. /modules/crm/public/brand.css).`);
|
|
12186
12215
|
return;
|
|
@@ -12188,7 +12217,7 @@ function Fl() {
|
|
|
12188
12217
|
if (e && e.href === t) return;
|
|
12189
12218
|
e && e.remove();
|
|
12190
12219
|
let n = document.createElement("link");
|
|
12191
|
-
n.id =
|
|
12220
|
+
n.id = Pl, n.rel = "stylesheet", n.href = t, document.head.appendChild(n);
|
|
12192
12221
|
}, [_]);
|
|
12193
12222
|
let y = f.enabled && !r;
|
|
12194
12223
|
return p || y || n || s && !o || l || a && !i ? /* @__PURE__ */ Q("div", {
|
|
@@ -12197,71 +12226,71 @@ function Fl() {
|
|
|
12197
12226
|
minHeight: "var(--app-height)",
|
|
12198
12227
|
background: "var(--background)"
|
|
12199
12228
|
}
|
|
12200
|
-
}) : /* @__PURE__ */ $(
|
|
12201
|
-
/* @__PURE__ */ Q(
|
|
12229
|
+
}) : /* @__PURE__ */ $(ii, { children: [
|
|
12230
|
+
/* @__PURE__ */ Q(ri, {
|
|
12202
12231
|
path: "/login",
|
|
12203
|
-
element: /* @__PURE__ */ Q(
|
|
12232
|
+
element: /* @__PURE__ */ Q(vs, {})
|
|
12204
12233
|
}),
|
|
12205
|
-
/* @__PURE__ */ Q(
|
|
12234
|
+
/* @__PURE__ */ Q(ri, {
|
|
12206
12235
|
path: "/login/sso-callback",
|
|
12207
|
-
element: /* @__PURE__ */ Q(
|
|
12236
|
+
element: /* @__PURE__ */ Q(Ms, {})
|
|
12208
12237
|
}),
|
|
12209
|
-
/* @__PURE__ */ Q(
|
|
12238
|
+
/* @__PURE__ */ Q(ri, {
|
|
12210
12239
|
path: "/signup",
|
|
12211
|
-
element: /* @__PURE__ */ Q(
|
|
12240
|
+
element: /* @__PURE__ */ Q(xs, {})
|
|
12212
12241
|
}),
|
|
12213
|
-
/* @__PURE__ */ Q(
|
|
12242
|
+
/* @__PURE__ */ Q(ri, {
|
|
12214
12243
|
path: "/forgot",
|
|
12215
|
-
element: /* @__PURE__ */ Q(
|
|
12244
|
+
element: /* @__PURE__ */ Q(Cs, {})
|
|
12216
12245
|
}),
|
|
12217
|
-
/* @__PURE__ */ Q(
|
|
12246
|
+
/* @__PURE__ */ Q(ri, {
|
|
12218
12247
|
path: "/reset",
|
|
12219
|
-
element: /* @__PURE__ */ Q(
|
|
12248
|
+
element: /* @__PURE__ */ Q(As, {})
|
|
12220
12249
|
}),
|
|
12221
|
-
/* @__PURE__ */ Q(
|
|
12250
|
+
/* @__PURE__ */ Q(ri, {
|
|
12222
12251
|
path: "/2fa",
|
|
12223
|
-
element: /* @__PURE__ */ Q(
|
|
12252
|
+
element: /* @__PURE__ */ Q(js, {})
|
|
12224
12253
|
}),
|
|
12225
|
-
/* @__PURE__ */ $(
|
|
12226
|
-
element: /* @__PURE__ */ Q(
|
|
12254
|
+
/* @__PURE__ */ $(ri, {
|
|
12255
|
+
element: /* @__PURE__ */ Q(Vo, {}),
|
|
12227
12256
|
children: [
|
|
12228
|
-
d && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(
|
|
12257
|
+
d && /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(ri, {
|
|
12229
12258
|
index: !0,
|
|
12230
|
-
element: /* @__PURE__ */ Q(
|
|
12259
|
+
element: /* @__PURE__ */ Q(ti, {
|
|
12231
12260
|
to: d,
|
|
12232
12261
|
replace: !0
|
|
12233
12262
|
})
|
|
12234
|
-
}), /* @__PURE__ */ Q(
|
|
12263
|
+
}), /* @__PURE__ */ Q(ri, {
|
|
12235
12264
|
path: "/admin",
|
|
12236
|
-
element: /* @__PURE__ */ Q(
|
|
12265
|
+
element: /* @__PURE__ */ Q(ti, {
|
|
12237
12266
|
to: d,
|
|
12238
12267
|
replace: !0
|
|
12239
12268
|
})
|
|
12240
12269
|
})] }),
|
|
12241
12270
|
u,
|
|
12242
|
-
/* @__PURE__ */ Q(
|
|
12271
|
+
/* @__PURE__ */ Q(ri, {
|
|
12243
12272
|
path: "/preferences",
|
|
12244
|
-
element: /* @__PURE__ */ Q(
|
|
12273
|
+
element: /* @__PURE__ */ Q(Gs, {})
|
|
12245
12274
|
}),
|
|
12246
|
-
/* @__PURE__ */ Q(
|
|
12275
|
+
/* @__PURE__ */ Q(ri, {
|
|
12247
12276
|
path: "/admin/catalog",
|
|
12248
|
-
element: /* @__PURE__ */ Q(
|
|
12277
|
+
element: /* @__PURE__ */ Q(Js, {})
|
|
12249
12278
|
}),
|
|
12250
|
-
/* @__PURE__ */ Q(
|
|
12279
|
+
/* @__PURE__ */ Q(ri, {
|
|
12251
12280
|
path: "*",
|
|
12252
|
-
element: /* @__PURE__ */ Q(
|
|
12281
|
+
element: /* @__PURE__ */ Q(Ns, {})
|
|
12253
12282
|
})
|
|
12254
12283
|
]
|
|
12255
12284
|
})
|
|
12256
12285
|
] });
|
|
12257
12286
|
}
|
|
12258
|
-
function
|
|
12259
|
-
|
|
12287
|
+
function Vl() {
|
|
12288
|
+
fl();
|
|
12260
12289
|
let e = G((e) => e.toastPosition);
|
|
12261
|
-
return /* @__PURE__ */ $(
|
|
12262
|
-
/* @__PURE__ */ Q(
|
|
12263
|
-
/* @__PURE__ */ Q(
|
|
12264
|
-
/* @__PURE__ */ Q(
|
|
12290
|
+
return /* @__PURE__ */ $($r, { children: [
|
|
12291
|
+
/* @__PURE__ */ Q(zi, {}),
|
|
12292
|
+
/* @__PURE__ */ Q(Bl, {}),
|
|
12293
|
+
/* @__PURE__ */ Q(bi, {
|
|
12265
12294
|
position: e,
|
|
12266
12295
|
toastOptions: { unstyled: !0 },
|
|
12267
12296
|
expand: !0,
|
|
@@ -12271,26 +12300,26 @@ function Il() {
|
|
|
12271
12300
|
})
|
|
12272
12301
|
] });
|
|
12273
12302
|
}
|
|
12274
|
-
function
|
|
12303
|
+
function Hl({ children: e }) {
|
|
12275
12304
|
return /* @__PURE__ */ Q(y, {
|
|
12276
12305
|
viewport: $t(),
|
|
12277
12306
|
children: e
|
|
12278
12307
|
});
|
|
12279
12308
|
}
|
|
12280
|
-
function
|
|
12281
|
-
return /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(
|
|
12282
|
-
client:
|
|
12283
|
-
children: /* @__PURE__ */ Q(xe, { children: /* @__PURE__ */ Q(
|
|
12309
|
+
function Ul() {
|
|
12310
|
+
return /* @__PURE__ */ Q(or, { children: /* @__PURE__ */ Q(mi, {
|
|
12311
|
+
client: Ll,
|
|
12312
|
+
children: /* @__PURE__ */ Q(xe, { children: /* @__PURE__ */ Q(Hl, { children: /* @__PURE__ */ Q(Vl, {}) }) })
|
|
12284
12313
|
}) });
|
|
12285
12314
|
}
|
|
12286
12315
|
//#endregion
|
|
12287
12316
|
//#region src/api/batch.ts
|
|
12288
|
-
var
|
|
12317
|
+
var Wl = class {
|
|
12289
12318
|
ops = [];
|
|
12290
12319
|
call(e, t) {
|
|
12291
12320
|
return this.ops.push({
|
|
12292
12321
|
action: e,
|
|
12293
|
-
params:
|
|
12322
|
+
params: Gl(t)
|
|
12294
12323
|
}), this;
|
|
12295
12324
|
}
|
|
12296
12325
|
upsert(e, t, n = "upsert", r = []) {
|
|
@@ -12312,14 +12341,14 @@ var zl = class {
|
|
|
12312
12341
|
return this.ops;
|
|
12313
12342
|
}
|
|
12314
12343
|
};
|
|
12315
|
-
function
|
|
12344
|
+
function Gl(e) {
|
|
12316
12345
|
return e == null ? null : typeof e == "object" && !Array.isArray(e) ? e : { value: e };
|
|
12317
12346
|
}
|
|
12318
12347
|
//#endregion
|
|
12319
12348
|
//#region src/hooks/useAllEntityData.ts
|
|
12320
|
-
var
|
|
12321
|
-
function
|
|
12322
|
-
return
|
|
12349
|
+
var Kl = 1e3, ql = 20;
|
|
12350
|
+
function Jl(e, t = {}) {
|
|
12351
|
+
return vi({
|
|
12323
12352
|
queryKey: [
|
|
12324
12353
|
"entity-data-all",
|
|
12325
12354
|
e,
|
|
@@ -12329,7 +12358,7 @@ function Ul(e, t = {}) {
|
|
|
12329
12358
|
queryFn: async ({ signal: n }) => {
|
|
12330
12359
|
let r = {
|
|
12331
12360
|
...t,
|
|
12332
|
-
per_page:
|
|
12361
|
+
per_page: Kl,
|
|
12333
12362
|
count: "with"
|
|
12334
12363
|
}, i;
|
|
12335
12364
|
try {
|
|
@@ -12342,7 +12371,7 @@ function Ul(e, t = {}) {
|
|
|
12342
12371
|
}
|
|
12343
12372
|
let a = i.meta.total_pages ?? 1;
|
|
12344
12373
|
if (a <= 1) return i;
|
|
12345
|
-
if (a >
|
|
12374
|
+
if (a > ql) throw Error(`useAllEntityData: entity "${e}" spans ${a} pages (limit ${ql}); it is not a bounded entity. Use useEntityData with server-side pagination instead.`);
|
|
12346
12375
|
let o = await Promise.all(Array.from({ length: a - 1 }, (t, i) => pt(e, {
|
|
12347
12376
|
...r,
|
|
12348
12377
|
page: i + 2
|
|
@@ -12365,7 +12394,7 @@ function Ul(e, t = {}) {
|
|
|
12365
12394
|
}
|
|
12366
12395
|
//#endregion
|
|
12367
12396
|
//#region src/hooks/useLiveObject.ts
|
|
12368
|
-
function
|
|
12397
|
+
function Yl(e, t) {
|
|
12369
12398
|
let n = Ln(e, t), { data: r } = et(), i = lr((e) => e.degradedEntities), a = n.data?.data ? Mn(n.data.data) : void 0, o = e ? Sn(r?.entities?.[e]?.realtime, i, e) : !1;
|
|
12370
12399
|
return {
|
|
12371
12400
|
...n,
|
|
@@ -12376,30 +12405,30 @@ function Wl(e, t) {
|
|
|
12376
12405
|
}
|
|
12377
12406
|
//#endregion
|
|
12378
12407
|
//#region src/hooks/useActionData.ts
|
|
12379
|
-
var
|
|
12380
|
-
function
|
|
12408
|
+
var Xl = "action-data", Zl = "action-data-cursor";
|
|
12409
|
+
function Ql(e, t) {
|
|
12381
12410
|
return [
|
|
12382
|
-
|
|
12411
|
+
Xl,
|
|
12383
12412
|
e,
|
|
12384
12413
|
t
|
|
12385
12414
|
];
|
|
12386
12415
|
}
|
|
12387
|
-
function
|
|
12388
|
-
return
|
|
12389
|
-
queryKey:
|
|
12416
|
+
function $l(e, t, n = !0) {
|
|
12417
|
+
return vi({
|
|
12418
|
+
queryKey: Ql(e, t),
|
|
12390
12419
|
queryFn: async () => (await Ue(e, t)).result,
|
|
12391
12420
|
enabled: !!e && n
|
|
12392
12421
|
});
|
|
12393
12422
|
}
|
|
12394
|
-
function
|
|
12423
|
+
function eu(e, t) {
|
|
12395
12424
|
return [
|
|
12396
|
-
|
|
12425
|
+
Zl,
|
|
12397
12426
|
e,
|
|
12398
12427
|
t
|
|
12399
12428
|
];
|
|
12400
12429
|
}
|
|
12401
|
-
function
|
|
12402
|
-
let r =
|
|
12430
|
+
function tu(e, t, n = !0) {
|
|
12431
|
+
let r = eu(e, t), i = hi({
|
|
12403
12432
|
queryKey: r,
|
|
12404
12433
|
queryFn: async ({ pageParam: n }) => (await Ue(e, n ? {
|
|
12405
12434
|
...t,
|
|
@@ -12427,8 +12456,8 @@ function Xl(e, t, n = !0) {
|
|
|
12427
12456
|
}
|
|
12428
12457
|
//#endregion
|
|
12429
12458
|
//#region src/hooks/useColumns.ts
|
|
12430
|
-
function
|
|
12431
|
-
let [n, r] =
|
|
12459
|
+
function nu(e, t) {
|
|
12460
|
+
let [n, r] = fi(), i = J(() => {
|
|
12432
12461
|
let r = n.get("columns");
|
|
12433
12462
|
return r ? r.split(",").filter(Boolean).filter((t) => e.includes(t)) : t.length > 0 ? t : e;
|
|
12434
12463
|
}, [
|
|
@@ -12437,7 +12466,7 @@ function Zl(e, t) {
|
|
|
12437
12466
|
t
|
|
12438
12467
|
]), a = K((e) => {
|
|
12439
12468
|
let i = new URLSearchParams(n);
|
|
12440
|
-
e.length === 0 ||
|
|
12469
|
+
e.length === 0 || ru(e, t) ? i.delete("columns") : i.set("columns", e.join(",")), r(i);
|
|
12441
12470
|
}, [
|
|
12442
12471
|
n,
|
|
12443
12472
|
r,
|
|
@@ -12463,32 +12492,32 @@ function Zl(e, t) {
|
|
|
12463
12492
|
}, [i, a])
|
|
12464
12493
|
};
|
|
12465
12494
|
}
|
|
12466
|
-
function
|
|
12495
|
+
function ru(e, t) {
|
|
12467
12496
|
return e.length === t.length ? e.every((e, n) => e === t[n]) : !1;
|
|
12468
12497
|
}
|
|
12469
12498
|
//#endregion
|
|
12470
12499
|
//#region src/hooks/useScreenTab.ts
|
|
12471
|
-
function
|
|
12472
|
-
let t =
|
|
12500
|
+
function iu(e) {
|
|
12501
|
+
let t = oi(), [n] = fi(), r = e?.route ?? t.pathname, i = Y(n.toString());
|
|
12473
12502
|
Pr(r, e?.title ?? r, e?.icon, i.current), Nr(r);
|
|
12474
12503
|
}
|
|
12475
12504
|
//#endregion
|
|
12476
12505
|
//#region src/components/shared/PageHeader.tsx
|
|
12477
|
-
function
|
|
12478
|
-
let
|
|
12479
|
-
if (
|
|
12480
|
-
if (!
|
|
12481
|
-
let e = yr.getState().findTabByPathname(
|
|
12506
|
+
function au({ title: e, description: t, backTo: r, actions: i }) {
|
|
12507
|
+
let a = Sl(), o = e ?? z(a?.screen?.display?.name) ?? "", s = t ?? z(a?.screen?.display?.description), c = qt("custom"), l = c.isVisible("show_title"), u = c.isVisible("show_actions"), d = we(), f = S(), { hasOriginBack: p, goBack: m } = Fn({ fallback: K(() => {
|
|
12508
|
+
if (r) {
|
|
12509
|
+
if (!d.enabled) {
|
|
12510
|
+
let e = yr.getState().findTabByPathname(r);
|
|
12482
12511
|
e && yr.getState().switchTab(e.id);
|
|
12483
12512
|
}
|
|
12484
|
-
|
|
12513
|
+
f(r);
|
|
12485
12514
|
}
|
|
12486
12515
|
}, [
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12516
|
+
r,
|
|
12517
|
+
d.enabled,
|
|
12518
|
+
f
|
|
12490
12519
|
]) });
|
|
12491
|
-
return !
|
|
12520
|
+
return !l && (!u || !i) ? null : /* @__PURE__ */ $("div", {
|
|
12492
12521
|
style: {
|
|
12493
12522
|
display: "flex",
|
|
12494
12523
|
alignItems: "center",
|
|
@@ -12496,55 +12525,62 @@ function eu({ title: e, backTo: t, actions: r }) {
|
|
|
12496
12525
|
marginBottom: 16,
|
|
12497
12526
|
gap: 12
|
|
12498
12527
|
},
|
|
12499
|
-
children: [
|
|
12528
|
+
children: [l && /* @__PURE__ */ $("div", {
|
|
12500
12529
|
style: {
|
|
12501
12530
|
display: "flex",
|
|
12502
12531
|
alignItems: "center",
|
|
12503
12532
|
gap: 10,
|
|
12504
12533
|
minWidth: 0
|
|
12505
12534
|
},
|
|
12506
|
-
children: [
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12535
|
+
children: [
|
|
12536
|
+
(p || !!r) && /* @__PURE__ */ Q(P, {
|
|
12537
|
+
icon: /* @__PURE__ */ Q(n.back, { size: 14 }),
|
|
12538
|
+
onClick: m,
|
|
12539
|
+
title: "Back"
|
|
12540
|
+
}),
|
|
12541
|
+
/* @__PURE__ */ Q("h1", {
|
|
12542
|
+
style: {
|
|
12543
|
+
margin: 0,
|
|
12544
|
+
fontSize: "var(--page-title-size, var(--page-title-size-page))",
|
|
12545
|
+
lineHeight: "var(--page-title-line-height, var(--page-title-line-height-page))",
|
|
12546
|
+
fontWeight: 600,
|
|
12547
|
+
letterSpacing: "-0.01em",
|
|
12548
|
+
color: "var(--text)",
|
|
12549
|
+
overflow: "hidden",
|
|
12550
|
+
textOverflow: "ellipsis",
|
|
12551
|
+
whiteSpace: "nowrap"
|
|
12552
|
+
},
|
|
12553
|
+
children: o
|
|
12554
|
+
}),
|
|
12555
|
+
s && /* @__PURE__ */ Q(zt, {
|
|
12556
|
+
label: s,
|
|
12557
|
+
"data-testid": "page-description-info"
|
|
12558
|
+
})
|
|
12559
|
+
]
|
|
12560
|
+
}), u && i && /* @__PURE__ */ Q("div", {
|
|
12525
12561
|
style: {
|
|
12526
12562
|
display: "flex",
|
|
12527
12563
|
alignItems: "center",
|
|
12528
|
-
justifyContent: "flex-end",
|
|
12529
12564
|
gap: 6,
|
|
12530
12565
|
flex: "1 1 auto",
|
|
12531
|
-
minWidth: 0
|
|
12566
|
+
minWidth: 0,
|
|
12567
|
+
justifyContent: "flex-end"
|
|
12532
12568
|
},
|
|
12533
|
-
children:
|
|
12569
|
+
children: i
|
|
12534
12570
|
})]
|
|
12535
12571
|
});
|
|
12536
12572
|
}
|
|
12537
12573
|
//#endregion
|
|
12538
12574
|
//#region src/components/shared/ObjectActionBar.tsx
|
|
12539
|
-
function
|
|
12540
|
-
let { data: o } = et(), { run: s, isRunning: c } = tt(), l = S(), u = Un(), d = ot(), f =
|
|
12575
|
+
function ou({ entity: e, object: t, slot: n, screen: r, select: i, onAfterRun: a }) {
|
|
12576
|
+
let { data: o } = et(), { run: s, isRunning: c } = tt(), l = S(), u = Un(), d = ot(), f = oi(), p = o?.entities?.[e], m = J(() => cu(o, e, r, f.pathname), [
|
|
12541
12577
|
o,
|
|
12542
12578
|
e,
|
|
12543
12579
|
r,
|
|
12544
12580
|
f.pathname
|
|
12545
12581
|
]), h = o?.actions, g = Cn(o, e);
|
|
12546
12582
|
return {
|
|
12547
|
-
nodes: J(() => !p || !t ? [] : W(
|
|
12583
|
+
nodes: J(() => !p || !t ? [] : W(uu(wr(m?.action_layout, p.action_layout, p.actions, h, n), i), p.actions, h, t, []), [
|
|
12548
12584
|
m?.action_layout,
|
|
12549
12585
|
p,
|
|
12550
12586
|
t,
|
|
@@ -12595,8 +12631,8 @@ function tu({ entity: e, object: t, slot: n, screen: r, select: i, onAfterRun: a
|
|
|
12595
12631
|
])
|
|
12596
12632
|
};
|
|
12597
12633
|
}
|
|
12598
|
-
function
|
|
12599
|
-
let { data: s } = et(), { nodes: c, run: l, widgetContext: u } =
|
|
12634
|
+
function su({ entity: e, object: t, slot: n, screen: r, select: i, extraActions: a, onAfterRun: o }) {
|
|
12635
|
+
let { data: s } = et(), { nodes: c, run: l, widgetContext: u } = ou({
|
|
12600
12636
|
entity: e,
|
|
12601
12637
|
object: t,
|
|
12602
12638
|
slot: n,
|
|
@@ -12605,15 +12641,7 @@ function nu({ entity: e, object: t, slot: n, screen: r, select: i, extraActions:
|
|
|
12605
12641
|
onAfterRun: o
|
|
12606
12642
|
}), d = s?.entities?.[e];
|
|
12607
12643
|
return c.length === 0 && !a ? null : /* @__PURE__ */ $("span", {
|
|
12608
|
-
style: {
|
|
12609
|
-
display: "flex",
|
|
12610
|
-
flex: "1 1 auto",
|
|
12611
|
-
minWidth: 0,
|
|
12612
|
-
alignItems: "center",
|
|
12613
|
-
justifyContent: "flex-end",
|
|
12614
|
-
gap: 8,
|
|
12615
|
-
flexWrap: "wrap"
|
|
12616
|
-
},
|
|
12644
|
+
style: { display: "contents" },
|
|
12617
12645
|
children: [c.length > 0 && /* @__PURE__ */ Q(Tn, {
|
|
12618
12646
|
layout: c,
|
|
12619
12647
|
row: t,
|
|
@@ -12626,24 +12654,24 @@ function nu({ entity: e, object: t, slot: n, screen: r, select: i, extraActions:
|
|
|
12626
12654
|
}), a]
|
|
12627
12655
|
});
|
|
12628
12656
|
}
|
|
12629
|
-
function
|
|
12657
|
+
function cu(e, t, n, r) {
|
|
12630
12658
|
if (!e?.screens) return;
|
|
12631
12659
|
if (n) return e.screens[n];
|
|
12632
12660
|
let i = r.replace(/\/+$/, "") || "/";
|
|
12633
|
-
return Object.values(e.screens).find((e) => e.entity !== t || !e.route ? !1 :
|
|
12661
|
+
return Object.values(e.screens).find((e) => e.entity !== t || !e.route ? !1 : lu(e.route).test(i));
|
|
12634
12662
|
}
|
|
12635
|
-
function
|
|
12663
|
+
function lu(e) {
|
|
12636
12664
|
let t = (e.replace(/\/+$/, "") || "/").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
12637
12665
|
return RegExp(`^${t.join("/")}$`);
|
|
12638
12666
|
}
|
|
12639
|
-
function
|
|
12667
|
+
function uu(e, t) {
|
|
12640
12668
|
if (!t) return e;
|
|
12641
12669
|
let n = t.include ? new Set(t.include) : null, r = t.exclude ? new Set(t.exclude) : null;
|
|
12642
|
-
return e.map((e) =>
|
|
12670
|
+
return e.map((e) => du(e, n, r)).filter((e) => e !== null);
|
|
12643
12671
|
}
|
|
12644
|
-
function
|
|
12672
|
+
function du(e, t, n) {
|
|
12645
12673
|
if (e.kind === "action") return t && !t.has(e.code) || n?.has(e.code) ? null : e;
|
|
12646
|
-
let r = e.items.map((e) =>
|
|
12674
|
+
let r = e.items.map((e) => du(e, t, n)).filter((e) => e !== null);
|
|
12647
12675
|
return r.length > 0 ? {
|
|
12648
12676
|
...e,
|
|
12649
12677
|
items: r
|
|
@@ -12651,7 +12679,7 @@ function ou(e, t, n) {
|
|
|
12651
12679
|
}
|
|
12652
12680
|
//#endregion
|
|
12653
12681
|
//#region src/components/list/RowMenu.tsx
|
|
12654
|
-
function
|
|
12682
|
+
function fu({ x: e, y: t, onClose: r, onPeek: i, onOpen: a, onEditInline: o, onDuplicate: s, onCopyLink: c, onDelete: l, actions: u }) {
|
|
12655
12683
|
let d = (e) => () => {
|
|
12656
12684
|
r(), e?.();
|
|
12657
12685
|
}, f = i || a || o || s || c, p = u && u.length > 0;
|
|
@@ -12729,7 +12757,7 @@ function su({ x: e, y: t, onClose: r, onPeek: i, onOpen: a, onEditInline: o, onD
|
|
|
12729
12757
|
}
|
|
12730
12758
|
//#endregion
|
|
12731
12759
|
//#region src/components/list/InlineEditCell.tsx
|
|
12732
|
-
var
|
|
12760
|
+
var pu = {
|
|
12733
12761
|
padding: "4px 6px",
|
|
12734
12762
|
margin: "-4px -6px",
|
|
12735
12763
|
borderRadius: 4,
|
|
@@ -12740,7 +12768,7 @@ var cu = {
|
|
|
12740
12768
|
alignItems: "center",
|
|
12741
12769
|
gap: 4
|
|
12742
12770
|
};
|
|
12743
|
-
function
|
|
12771
|
+
function mu({ value: e, onSave: t, type: r = "text", options: i, trigger: a = "always", label: o, placeholder: s }) {
|
|
12744
12772
|
let [c, l] = X(e), [u, d] = X(e), [f, p] = X(!1), [m, h] = X(e), g = Y(null);
|
|
12745
12773
|
q(() => {
|
|
12746
12774
|
l(e), d(e), h(e);
|
|
@@ -12812,7 +12840,7 @@ function lu({ value: e, onSave: t, type: r = "text", options: i, trigger: a = "a
|
|
|
12812
12840
|
onMouseLeave: (e) => {
|
|
12813
12841
|
e.currentTarget.style.borderColor = "transparent";
|
|
12814
12842
|
},
|
|
12815
|
-
style:
|
|
12843
|
+
style: pu,
|
|
12816
12844
|
children: u ?? /* @__PURE__ */ Q("span", {
|
|
12817
12845
|
style: { color: "var(--text-4)" },
|
|
12818
12846
|
children: "Click to edit"
|
|
@@ -12821,7 +12849,7 @@ function lu({ value: e, onSave: t, type: r = "text", options: i, trigger: a = "a
|
|
|
12821
12849
|
}
|
|
12822
12850
|
//#endregion
|
|
12823
12851
|
//#region src/components/pages/home/HomeStub.tsx
|
|
12824
|
-
var
|
|
12852
|
+
var hu = [
|
|
12825
12853
|
{
|
|
12826
12854
|
id: "a1",
|
|
12827
12855
|
title: "James Gallagher moved to Discovery",
|
|
@@ -12837,7 +12865,7 @@ var uu = [
|
|
|
12837
12865
|
title: "Refill enrichment job completed (32 leads)",
|
|
12838
12866
|
when: "10:00 AM"
|
|
12839
12867
|
}
|
|
12840
|
-
],
|
|
12868
|
+
], gu = [
|
|
12841
12869
|
{
|
|
12842
12870
|
label: "Open leads",
|
|
12843
12871
|
val: "127",
|
|
@@ -12862,7 +12890,7 @@ var uu = [
|
|
|
12862
12890
|
delta: "2 failed",
|
|
12863
12891
|
tone: "amber"
|
|
12864
12892
|
}
|
|
12865
|
-
],
|
|
12893
|
+
], _u = [
|
|
12866
12894
|
[
|
|
12867
12895
|
"leads",
|
|
12868
12896
|
"Leads",
|
|
@@ -12894,7 +12922,7 @@ var uu = [
|
|
|
12894
12922
|
"entity"
|
|
12895
12923
|
]
|
|
12896
12924
|
];
|
|
12897
|
-
function
|
|
12925
|
+
function vu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLabel: r = "Acme · production" }) {
|
|
12898
12926
|
return /* @__PURE__ */ Q("div", {
|
|
12899
12927
|
style: {
|
|
12900
12928
|
padding: "22px 24px",
|
|
@@ -12938,7 +12966,7 @@ function pu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
12938
12966
|
gap: 10,
|
|
12939
12967
|
margin: "16px 0"
|
|
12940
12968
|
},
|
|
12941
|
-
children:
|
|
12969
|
+
children: gu.map((e) => /* @__PURE__ */ $("div", {
|
|
12942
12970
|
style: {
|
|
12943
12971
|
padding: 14,
|
|
12944
12972
|
background: "var(--surface)",
|
|
@@ -12986,7 +13014,7 @@ function pu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
12986
13014
|
gridTemplateColumns: "repeat(3,1fr)",
|
|
12987
13015
|
gap: 8
|
|
12988
13016
|
},
|
|
12989
|
-
children:
|
|
13017
|
+
children: _u.map(([t, r, i]) => {
|
|
12990
13018
|
let a = n[i];
|
|
12991
13019
|
return /* @__PURE__ */ $("button", {
|
|
12992
13020
|
onClick: () => e?.(t),
|
|
@@ -13002,7 +13030,7 @@ function pu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
13002
13030
|
textAlign: "left"
|
|
13003
13031
|
},
|
|
13004
13032
|
children: [
|
|
13005
|
-
a &&
|
|
13033
|
+
a && Xr(a, {
|
|
13006
13034
|
size: 14,
|
|
13007
13035
|
style: { color: "var(--accent)" }
|
|
13008
13036
|
}),
|
|
@@ -13031,7 +13059,7 @@ function pu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
13031
13059
|
flexDirection: "column",
|
|
13032
13060
|
gap: 8
|
|
13033
13061
|
},
|
|
13034
|
-
children:
|
|
13062
|
+
children: hu.slice(0, 3).map((e) => /* @__PURE__ */ $("div", {
|
|
13035
13063
|
style: {
|
|
13036
13064
|
fontSize: 12,
|
|
13037
13065
|
color: "var(--text-2)"
|
|
@@ -13060,19 +13088,19 @@ function pu({ onOpenNav: e, greeting: t = "Good afternoon, Konstantin", tenantLa
|
|
|
13060
13088
|
}
|
|
13061
13089
|
//#endregion
|
|
13062
13090
|
//#region src/components/pages/pipeline/Pipeline.tsx
|
|
13063
|
-
var
|
|
13091
|
+
var yu = {
|
|
13064
13092
|
"1-New": { color: "slate" },
|
|
13065
13093
|
"2-Contacted": { color: "sky" },
|
|
13066
13094
|
"3-Qualified": { color: "violet" },
|
|
13067
13095
|
"4-Proposal": { color: "amber" },
|
|
13068
13096
|
"5-Won": { color: "emerald" },
|
|
13069
13097
|
"6-Lost": { color: "rose" }
|
|
13070
|
-
},
|
|
13098
|
+
}, bu = {
|
|
13071
13099
|
P0: "rose",
|
|
13072
13100
|
P1: "amber",
|
|
13073
13101
|
P2: "sky",
|
|
13074
13102
|
P3: "slate"
|
|
13075
|
-
},
|
|
13103
|
+
}, xu = [
|
|
13076
13104
|
{
|
|
13077
13105
|
id: "l1",
|
|
13078
13106
|
contact: "James Gallagher",
|
|
@@ -13138,11 +13166,11 @@ var mu = {
|
|
|
13138
13166
|
score: 58
|
|
13139
13167
|
}
|
|
13140
13168
|
];
|
|
13141
|
-
function
|
|
13142
|
-
let e = Object.entries(
|
|
13169
|
+
function Su() {
|
|
13170
|
+
let e = Object.entries(yu).map(([e, t]) => ({
|
|
13143
13171
|
key: e,
|
|
13144
13172
|
color: t.color,
|
|
13145
|
-
leads:
|
|
13173
|
+
leads: xu.filter((t) => t.pipeline === e)
|
|
13146
13174
|
}));
|
|
13147
13175
|
return /* @__PURE__ */ $("div", {
|
|
13148
13176
|
style: {
|
|
@@ -13173,7 +13201,7 @@ function _u() {
|
|
|
13173
13201
|
fontSize: 12,
|
|
13174
13202
|
color: "var(--text-3)"
|
|
13175
13203
|
},
|
|
13176
|
-
children: [
|
|
13204
|
+
children: [xu.length, " leads · $2.4M pipeline"]
|
|
13177
13205
|
})]
|
|
13178
13206
|
}), /* @__PURE__ */ Q("div", {
|
|
13179
13207
|
style: {
|
|
@@ -13259,7 +13287,7 @@ function _u() {
|
|
|
13259
13287
|
flexWrap: "wrap"
|
|
13260
13288
|
},
|
|
13261
13289
|
children: [e.priority && e.priority !== "-" && /* @__PURE__ */ Q(C, {
|
|
13262
|
-
tone:
|
|
13290
|
+
tone: bu[e.priority] ?? "slate",
|
|
13263
13291
|
size: "xs",
|
|
13264
13292
|
dot: !0,
|
|
13265
13293
|
children: e.priority
|
|
@@ -13278,7 +13306,7 @@ function _u() {
|
|
|
13278
13306
|
}
|
|
13279
13307
|
//#endregion
|
|
13280
13308
|
//#region src/components/pages/jobs/Jobs.tsx
|
|
13281
|
-
var
|
|
13309
|
+
var Cu = [
|
|
13282
13310
|
{
|
|
13283
13311
|
id: "job_91a4",
|
|
13284
13312
|
name: "reparse_leads_with_llm",
|
|
@@ -13322,12 +13350,12 @@ var vu = [
|
|
|
13322
13350
|
worker: "wk-us-01",
|
|
13323
13351
|
took: "2m 02s"
|
|
13324
13352
|
}
|
|
13325
|
-
],
|
|
13353
|
+
], wu = {
|
|
13326
13354
|
running: "sky",
|
|
13327
13355
|
success: "emerald",
|
|
13328
13356
|
queued: "slate",
|
|
13329
13357
|
failed: "rose"
|
|
13330
|
-
},
|
|
13358
|
+
}, Tu = [
|
|
13331
13359
|
"ID",
|
|
13332
13360
|
"Name",
|
|
13333
13361
|
"Status",
|
|
@@ -13337,7 +13365,7 @@ var vu = [
|
|
|
13337
13365
|
"Worker",
|
|
13338
13366
|
""
|
|
13339
13367
|
];
|
|
13340
|
-
function
|
|
13368
|
+
function Eu() {
|
|
13341
13369
|
return /* @__PURE__ */ $("div", {
|
|
13342
13370
|
style: {
|
|
13343
13371
|
padding: "14px 20px",
|
|
@@ -13386,7 +13414,7 @@ function xu() {
|
|
|
13386
13414
|
background: "var(--surface-2)",
|
|
13387
13415
|
color: "var(--text-3)"
|
|
13388
13416
|
},
|
|
13389
|
-
children:
|
|
13417
|
+
children: Tu.map((e, t) => /* @__PURE__ */ Q("th", {
|
|
13390
13418
|
style: {
|
|
13391
13419
|
padding: "0 10px",
|
|
13392
13420
|
textAlign: "left",
|
|
@@ -13398,7 +13426,7 @@ function xu() {
|
|
|
13398
13426
|
},
|
|
13399
13427
|
children: e
|
|
13400
13428
|
}, e || `_h${t}`))
|
|
13401
|
-
}) }), /* @__PURE__ */ Q("tbody", { children:
|
|
13429
|
+
}) }), /* @__PURE__ */ Q("tbody", { children: Cu.map((e) => /* @__PURE__ */ $("tr", {
|
|
13402
13430
|
style: { height: 32 },
|
|
13403
13431
|
children: [
|
|
13404
13432
|
/* @__PURE__ */ Q("td", {
|
|
@@ -13430,7 +13458,7 @@ function xu() {
|
|
|
13430
13458
|
borderBottom: "1px solid var(--divider)"
|
|
13431
13459
|
},
|
|
13432
13460
|
children: /* @__PURE__ */ Q(C, {
|
|
13433
|
-
tone:
|
|
13461
|
+
tone: wu[e.status],
|
|
13434
13462
|
size: "xs",
|
|
13435
13463
|
dot: !0,
|
|
13436
13464
|
children: e.status
|
|
@@ -13460,7 +13488,7 @@ function xu() {
|
|
|
13460
13488
|
display: "block",
|
|
13461
13489
|
height: "100%",
|
|
13462
13490
|
width: `${e.progress}%`,
|
|
13463
|
-
background: `var(--pill-${
|
|
13491
|
+
background: `var(--pill-${wu[e.status]})`
|
|
13464
13492
|
} })
|
|
13465
13493
|
}), /* @__PURE__ */ $("span", {
|
|
13466
13494
|
className: "mono num",
|
|
@@ -13515,8 +13543,8 @@ function xu() {
|
|
|
13515
13543
|
}
|
|
13516
13544
|
//#endregion
|
|
13517
13545
|
//#region src/components/layout/ImpersonationStartModal.tsx
|
|
13518
|
-
function
|
|
13519
|
-
let { start: a, isStarting: o } =
|
|
13546
|
+
function Du({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarted: i }) {
|
|
13547
|
+
let { start: a, isStarting: o } = ia(), { value: s } = Rt("impersonation.require_reason_min_length", 10), [c, l] = X(""), [u, d] = X("");
|
|
13520
13548
|
if (!e) return null;
|
|
13521
13549
|
let f = c.trim(), p = f.length >= s;
|
|
13522
13550
|
return /* @__PURE__ */ Q("div", {
|
|
@@ -13675,7 +13703,7 @@ function Su({ open: e, targetUserId: t, targetUserLabel: n, onClose: r, onStarte
|
|
|
13675
13703
|
}
|
|
13676
13704
|
//#endregion
|
|
13677
13705
|
//#region src/components/agents/AgentVisualHints.tsx
|
|
13678
|
-
function
|
|
13706
|
+
function Ou({ turn: e, navigate: t }) {
|
|
13679
13707
|
return q(() => {
|
|
13680
13708
|
for (let n of e.hints) switch (n.kind) {
|
|
13681
13709
|
case "navigate":
|
|
@@ -13714,7 +13742,7 @@ function Cu({ turn: e, navigate: t }) {
|
|
|
13714
13742
|
}
|
|
13715
13743
|
//#endregion
|
|
13716
13744
|
//#region src/components/agents/AgentConversationDrawer.tsx
|
|
13717
|
-
function
|
|
13745
|
+
function ku({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, onNew: o, onRefresh: s }) {
|
|
13718
13746
|
return q(() => {
|
|
13719
13747
|
e && s();
|
|
13720
13748
|
}, [e, s]), e ? /* @__PURE__ */ $("aside", {
|
|
@@ -13741,7 +13769,7 @@ function wu({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, o
|
|
|
13741
13769
|
className: `block w-full px-4 py-3 text-left border-b border-divider hover:bg-surface ${e.id === i ? "bg-surface" : ""}`,
|
|
13742
13770
|
children: [/* @__PURE__ */ Q("div", {
|
|
13743
13771
|
className: "text-sm font-medium truncate",
|
|
13744
|
-
children: e.title || e.context ?
|
|
13772
|
+
children: e.title || e.context ? Au(e.context) : "Untitled"
|
|
13745
13773
|
}), /* @__PURE__ */ $("div", {
|
|
13746
13774
|
className: "text-xs text-muted-foreground",
|
|
13747
13775
|
children: [
|
|
@@ -13764,10 +13792,10 @@ function wu({ open: e, onClose: t, conversations: r, activeId: i, onSelect: a, o
|
|
|
13764
13792
|
]
|
|
13765
13793
|
}) : null;
|
|
13766
13794
|
}
|
|
13767
|
-
function
|
|
13795
|
+
function Au(e) {
|
|
13768
13796
|
if (!e) return "";
|
|
13769
13797
|
let t = e.entity ? U(e.entity) : "", n = e.pk ? `:${U(e.pk).slice(0, 6)}` : "";
|
|
13770
13798
|
return t ? `${t}${n}` : "";
|
|
13771
13799
|
}
|
|
13772
13800
|
//#endregion
|
|
13773
|
-
export {
|
|
13801
|
+
export { Zl as ACTION_DATA_CURSOR_KEY, Xl as ACTION_DATA_KEY, i as ActionBatchError, mt as ActionRunnerProvider, mo as AgentChatPanel, ku as AgentConversationDrawer, oo as AgentElicitForm, Ou as AgentVisualHints, Ul as App, Ul as Declarion, es as AuthShell, Ft as Avatar, Wl as Batch, oe as BoolToggle, Ei as BrandGlyph, pa as Breadcrumbs, I as Btn, Ce as CURSOR_LOCALE_CHANGED, Se as CURSOR_SEMANTICS_MISMATCH, Ps as ChangePasswordDialog, Oi as Check, de as Chip, Qn as CircleImage, xr as ClassifiedFieldLocked, Uc as ColumnPicker, Ta as CommandPalette, Kn as ConfirmDialog, M as DEFAULT_RESPONSIVE_BREAKPOINTS, R as DateInput, u as Dropdown, r as DynamicIcon, oc as EmptyState, Gr as EntityClient, St as FieldLabel, Re as FileDraftScope, vc as FilterChips, Sc as FilterDrawer, Cs as Forgot, vu as HomeStub, Ot as HoverCard, n as Icon, P as IconBtn, ya as ImpersonationBanner, ba as ImpersonationFrame, Du as ImpersonationStartModal, zt as InfoTooltip, mu as InlineEditCell, Eu as JobsStub, me as JsonField, ye as Kbd, Oe as MULTIPLE_VALUES, A as MenuItem, Fr as NO_VALUE_OPS, Or as OP_LABELS, su as ObjectActionBar, Tt as OrderedMap, dn as PAGE_STATE_TTL_PARAM, au as PageHeader, p as PasswordInput, C as Pill, Su as PipelineStub, Gs as Preferences, Ls as Profile, rt as PropertyGridEditor, pc as QEField, yt as QuickEditCell, fc as QuickPeek, ji as Rail, Lt as RecordIdBadge, Er as RefCache, ge as RefField, on as RefreshControl, As as Reset, y as ResponsiveModeProvider, Di as RowField, fu as RowMenu, Ut as SCROLL_STATE_KEY, kn as SectionCard, _ as Select, Qi as Sidebar, vs as SignIn, xs as SignUp, ll as SmartDetailPage, ol as SmartListPage, dl as SmartRecordListPage, Ge as Spinner, Rn as SquareImage, ga as TabStrip, h as TagsInput, ua as TenantChip, le as TextArea, Je as TextInput, Pt as Tooltip, ha as TopBar, js as TwoFA, wt as UploadError, s as ViewField, Gc as ViewSwitcher, dr as WideBanner, Ql as actionDataQueryKey, ka as approveInvocation, Ie as buildActionBody, a as buildDetailHrefFromId, Fe as buildEntityDetailHref, Ne as buildMassEditTargets, ht as buildRowDetailHref, $i as buildSections, ja as cancelConversation, Bt as canonicalUrl, gr as classificationTier, U as coerceDisplayString, zr as countActiveFilters, Ea as createConversation, eu as cursorActionDataQueryKey, Wr as cursorEntityDataQueryKey, Kr as cursorEntityStableKey, V as deleteObject, dt as detectCommonValue, je as discardFile, Tr as entityClient, We as entityDataQueryKey, la as envTone, Ue as executeAction, He as extractPkValues, Hn as fieldAccessInfo, Gn as fieldClassification, ke as fieldDisplayName, cr as fieldRequiredPermission, xt as formatBytes, _c as formatCount, hc as formatEstimatedCount, gc as formatExactCount, Vn as getFileWidget, t as getIcon, sr as getImageCropper, mr as getLayoutWidget, ft as getPrimaryKeyFields, tr as hasFileWidget, ir as hasLayoutWidget, Ur as hasOrGroups, Te as isCursorStaleError, nr as isFieldReadable, Yn as isFieldSoDProtected, qn as isFieldWritable, Ma as listConversations, Pa as listPendingInvocations, Fa as loadHistory, z as loc, Zn as objectQueryKey, jr as parseFiltersFromURL, Ye as parseTargetFilter, Xe as pkValuePartsToId, gt as pkValuesFromId, Pe as pkValuesToDetailId, Le as pkValuesToId, _r as registerFileWidget, ur as registerLayoutWidget, vl as registerScreen, Aa as rejectInvocation, Na as rerunMessageTurn, $e as resolveDetailRoute, T as resolveViewportCategory, Ze as restoreObject, Oa as sendElicitResponse, Da as sendMessage, Br as setFiltersInURL, e as setIconRegistry, pr as setImageCropper, pe as uploadFile, $l as useActionData, tt as useActionRunner, ao as useAgentConversation, Jl as useAllEntityData, ra as useAuth, nu as useColumns, bn as useCreateObject, Sl as useCurrentScreen, tu as useCursorActionData, kr as useCursorEntityData, o as useDebounce, jn as useDeleteObject, Hr as useDeleteProperty, Ee as useDraftRegistration, Mt as useEffectiveParam, qe as useEntity, re as useEntityCount, ae as useEntityData, _t as useFileDraftScope, sc as useFilters, ia as useImpersonation, Yl as useLiveObject, ai as useLocation, si as useNavigate, Ln as useObject, ou as useObjectActions, ac as usePageState, Wt as usePageStateTtl, Rt as useParam, ui as useParams, tn as usePlainScrollRestoration, Zt as usePublicParams, cn as useRegisterRetainedQuery, At as useResolvedParam, k as useResponsiveMode, an as useSavedScrollOffset, et as useSchema, Kc as useScreen, Fn as useScreenBack, iu as useScreenTab, di as useSearchParams, Rr as useSetProperty, Vr as useSetStatus, Un as useTabNavigate, Nr as useTabSearchMirror, yr as useTabStore, yn as useUpdateObject, qc as useViews, Gt as useVirtualScrollRestoration, f as validateClientSide };
|