@nivaro/react 0.3.119 → 0.3.120
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/CopyValueButton.js +61 -0
- package/dist/shared/components/GridPresenceLine.js +46 -36
- package/dist/shared/components/ItemEditForm.js +1265 -1246
- package/dist/shared/components/ProfileView.js +181 -175
- package/dist/shared/components/RecordReadView.js +590 -557
- package/dist/shared/components/UserAvatar.js +11 -11
- package/dist/shared/components/item-edit/HeaderBand.js +50 -50
- package/dist/shared/components/item-edit/UserChip.js +52 -47
- package/dist/shared/components/profile/PersonAccess.js +84 -94
- package/dist/shared/components/profile/primitives.js +2 -1
- package/dist/shared/components/support/SupportEmailSwitch.js +63 -0
- package/dist/shared/components/support/SupportView.js +51 -45
- package/dist/shared/lib/header-strip.js +125 -120
- package/package.json +1 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as C, useQueryClient as
|
|
3
|
-
import { Plus as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as R, patch as
|
|
7
|
-
import { takeSupportDraft as
|
|
8
|
-
import { useLiveRefresh as
|
|
9
|
-
import { RelationCombobox as
|
|
10
|
-
import { LiveCount as
|
|
11
|
-
import { SimpleSelect as
|
|
12
|
-
import { AssignRulesView as
|
|
13
|
-
import { RequestList as
|
|
14
|
-
import { SupportAnalytics as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as C, useQueryClient as j, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { Plus as I } from "lucide-react";
|
|
4
|
+
import { useState as c, useRef as F, useEffect as w, useCallback as Q } from "react";
|
|
5
|
+
import { useNivaroClient as W, useItemEditAuth as z } from "../../context.js";
|
|
6
|
+
import { get as R, patch as B, post as G, del as P } from "../../lib/commands.js";
|
|
7
|
+
import { takeSupportDraft as H } from "../../lib/error-actions.js";
|
|
8
|
+
import { useLiveRefresh as J } from "../../lib/live-counts.js";
|
|
9
|
+
import { RelationCombobox as U } from "../item-edit/RelationCombobox.js";
|
|
10
|
+
import { LiveCount as X } from "../LiveCount.js";
|
|
11
|
+
import { SimpleSelect as Y } from "../ui/SimpleSelect.js";
|
|
12
|
+
import { AssignRulesView as Z } from "./AssignRules.js";
|
|
13
|
+
import { RequestList as ee } from "./RequestList.js";
|
|
14
|
+
import { SupportAnalytics as te } from "./SupportAnalytics.js";
|
|
15
|
+
import { SupportEmailSwitch as re } from "./SupportEmailSwitch.js";
|
|
16
|
+
import { SupportRequestDialog as ae } from "./SupportRequestDialog.js";
|
|
17
|
+
import { TicketDetailSheet as ne } from "./TicketDetailSheet.js";
|
|
18
|
+
function Ne({
|
|
18
19
|
initialTicketId: o,
|
|
19
20
|
onTicketChange: m,
|
|
20
|
-
className:
|
|
21
|
+
className: u
|
|
21
22
|
}) {
|
|
22
|
-
const y =
|
|
23
|
+
const y = W(), h = z(), x = !!(h != null && h.isAdmin), [n, i] = c("mine"), f = F(!1), g = (e) => {
|
|
23
24
|
f.current = !0, i(e);
|
|
24
|
-
}, [r, a] =
|
|
25
|
-
() => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ?
|
|
26
|
-
), [T, D] =
|
|
25
|
+
}, [r, a] = c(o ?? null), [d, M] = c(
|
|
26
|
+
() => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? H() : null
|
|
27
|
+
), [T, D] = c(!!d);
|
|
27
28
|
w(() => {
|
|
28
29
|
o != null && a(o);
|
|
29
30
|
}, [o]);
|
|
@@ -31,29 +32,29 @@ function ve({
|
|
|
31
32
|
queryKey: ["support-summary"],
|
|
32
33
|
queryFn: () => y.request(R("/support/summary")).then((e) => e.data)
|
|
33
34
|
}), L = !!(s != null && s.desk);
|
|
34
|
-
|
|
35
|
+
J({
|
|
35
36
|
topic: "support",
|
|
36
37
|
keys: [["support-tickets"], ["support-summary"], ["support-ticket"], ["support-workload"]]
|
|
37
38
|
});
|
|
38
|
-
const [_, V] =
|
|
39
|
+
const [_, V] = c(!1);
|
|
39
40
|
w(() => {
|
|
40
41
|
!_ && s && (s.desk && !f.current && i("desk"), V(!0));
|
|
41
42
|
}, [s, _]);
|
|
42
43
|
const N = (e) => {
|
|
43
44
|
a(e), m == null || m(e);
|
|
44
|
-
},
|
|
45
|
+
}, E = [
|
|
45
46
|
{ key: "mine", label: "My requests", count: s == null ? void 0 : s.mine_open },
|
|
46
47
|
...L ? [{ key: "desk", label: "Desk", count: s == null ? void 0 : s.unassigned }] : [],
|
|
47
48
|
...L ? [{ key: "analytics", label: "Analytics" }] : [],
|
|
48
49
|
...x ? [{ key: "types", label: "Request types" }] : [],
|
|
49
50
|
...x ? [{ key: "rules", label: "Assignment rules" }] : []
|
|
50
|
-
], S =
|
|
51
|
+
], S = F(null), [v, $] = c({ left: !1, right: !1 }), b = Q(() => {
|
|
51
52
|
const e = S.current;
|
|
52
53
|
if (!e) return;
|
|
53
54
|
const p = e.scrollLeft > 2, k = e.scrollLeft + e.clientWidth < e.scrollWidth - 2;
|
|
54
55
|
$((q) => q.left === p && q.right === k ? q : { left: p, right: k });
|
|
55
56
|
}, []);
|
|
56
|
-
w(() => (b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b)), [b,
|
|
57
|
+
w(() => (b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b)), [b, E.length]), w(() => {
|
|
57
58
|
const e = S.current, p = e == null ? void 0 : e.querySelector(`[data-support-tab="${n}"]`);
|
|
58
59
|
if (!e || !p || e.scrollWidth <= e.clientWidth) return;
|
|
59
60
|
const k = p.offsetLeft - (e.clientWidth - p.offsetWidth) / 2;
|
|
@@ -63,7 +64,7 @@ function ve({
|
|
|
63
64
|
const e = `linear-gradient(to right, ${v.left ? "transparent" : "black"}, black 20px, black calc(100% - 28px), ${v.right ? "transparent" : "black"})`;
|
|
64
65
|
return { maskImage: e, WebkitMaskImage: e };
|
|
65
66
|
})() : void 0;
|
|
66
|
-
return /* @__PURE__ */ l("div", { className:
|
|
67
|
+
return /* @__PURE__ */ l("div", { className: u, "data-support-view": !0, children: [
|
|
67
68
|
/* @__PURE__ */ l("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
68
69
|
/* @__PURE__ */ t(
|
|
69
70
|
"div",
|
|
@@ -73,7 +74,7 @@ function ve({
|
|
|
73
74
|
className: "relative -mx-1 flex min-w-0 max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none]",
|
|
74
75
|
style: K,
|
|
75
76
|
role: "tablist",
|
|
76
|
-
children:
|
|
77
|
+
children: E.map((e) => /* @__PURE__ */ l(
|
|
77
78
|
"button",
|
|
78
79
|
{
|
|
79
80
|
type: "button",
|
|
@@ -84,7 +85,7 @@ function ve({
|
|
|
84
85
|
className: n === e.key ? "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy dark:text-nvr-cyan" : "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-3 text-[12.5px] text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/5",
|
|
85
86
|
children: [
|
|
86
87
|
e.label,
|
|
87
|
-
e.count ? /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-200 px-1.5 text-[10.5px] font-semibold tabular-nums text-slate-700 dark:bg-white/10 dark:text-slate-200", children: /* @__PURE__ */ t(
|
|
88
|
+
e.count ? /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-200 px-1.5 text-[10.5px] font-semibold tabular-nums text-slate-700 dark:bg-white/10 dark:text-slate-200", children: /* @__PURE__ */ t(X, { value: e.count }) }) : null
|
|
88
89
|
]
|
|
89
90
|
},
|
|
90
91
|
e.key
|
|
@@ -99,15 +100,20 @@ function ve({
|
|
|
99
100
|
onClick: () => D(!0),
|
|
100
101
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
101
102
|
children: [
|
|
102
|
-
/* @__PURE__ */ t(
|
|
103
|
+
/* @__PURE__ */ t(I, { className: "h-3.5 w-3.5" }),
|
|
103
104
|
" Get help"
|
|
104
105
|
]
|
|
105
106
|
}
|
|
106
107
|
)
|
|
107
108
|
] }),
|
|
108
|
-
n === "types" ? /* @__PURE__ */ t(
|
|
109
|
+
n === "types" ? /* @__PURE__ */ t(se, {}) : n === "rules" ? /* @__PURE__ */ t(Z, {}) : n === "analytics" ? /* @__PURE__ */ t(te, {}) : /* @__PURE__ */ l(O, { children: [
|
|
110
|
+
n === "mine" && // The requester's own email opt-in (off by default): replies and changes on
|
|
111
|
+
// their requests reach them in the app unless they turn this on.
|
|
112
|
+
/* @__PURE__ */ t("div", { className: "mt-4 rounded-md border border-slate-200 bg-slate-50/60 px-3 py-2 dark:border-border dark:bg-background/40", children: /* @__PURE__ */ t(re, { compact: !0 }) }),
|
|
113
|
+
/* @__PURE__ */ t(ee, { tab: n, openId: r, onOpen: (e) => N(e) }, n)
|
|
114
|
+
] }),
|
|
109
115
|
/* @__PURE__ */ t(
|
|
110
|
-
|
|
116
|
+
ae,
|
|
111
117
|
{
|
|
112
118
|
open: T,
|
|
113
119
|
onOpenChange: (e) => {
|
|
@@ -121,26 +127,26 @@ function ve({
|
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
129
|
),
|
|
124
|
-
/* @__PURE__ */ t(
|
|
130
|
+
/* @__PURE__ */ t(ne, { ticketId: r, onOpenChange: (e) => !e && N(null) })
|
|
125
131
|
] });
|
|
126
132
|
}
|
|
127
|
-
function
|
|
128
|
-
const o =
|
|
133
|
+
function se() {
|
|
134
|
+
const o = W(), m = j(), [u, y] = c(""), { data: h = [] } = C({
|
|
129
135
|
queryKey: ["support-categories", "all"],
|
|
130
136
|
queryFn: () => o.request(R("/support/categories", { all: "1" })).then((r) => r.data ?? [])
|
|
131
137
|
}), { data: x = [] } = C({
|
|
132
138
|
queryKey: ["support-teams"],
|
|
133
139
|
queryFn: () => o.request(R("/user-groups")).then((r) => r.data ?? []).catch(() => [])
|
|
134
140
|
}), n = () => void m.invalidateQueries({ queryKey: ["support-categories"] }), i = A({
|
|
135
|
-
mutationFn: ({ id: r, body: a }) => o.request(
|
|
141
|
+
mutationFn: ({ id: r, body: a }) => o.request(B(`/support/categories/${r}`, a)),
|
|
136
142
|
onSuccess: n
|
|
137
143
|
}), f = A({
|
|
138
|
-
mutationFn: () => o.request(
|
|
144
|
+
mutationFn: () => o.request(G("/support/categories", { name: u.trim() })),
|
|
139
145
|
onSuccess: () => {
|
|
140
146
|
y(""), n();
|
|
141
147
|
}
|
|
142
148
|
}), g = A({
|
|
143
|
-
mutationFn: (r) => o.request(
|
|
149
|
+
mutationFn: (r) => o.request(P(`/support/categories/${r}`)),
|
|
144
150
|
onSuccess: n
|
|
145
151
|
});
|
|
146
152
|
return /* @__PURE__ */ l("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
|
|
@@ -175,7 +181,7 @@ function ae() {
|
|
|
175
181
|
}
|
|
176
182
|
) }),
|
|
177
183
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
178
|
-
|
|
184
|
+
Y,
|
|
179
185
|
{
|
|
180
186
|
value: r.team_id != null ? String(r.team_id) : "",
|
|
181
187
|
onChange: (a) => i.mutate({ id: r.id, body: { team_id: a ? Number(a) : null } }),
|
|
@@ -187,7 +193,7 @@ function ae() {
|
|
|
187
193
|
}
|
|
188
194
|
) }),
|
|
189
195
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
190
|
-
|
|
196
|
+
U,
|
|
191
197
|
{
|
|
192
198
|
collection: "nivaro_users",
|
|
193
199
|
value: r.default_assignee,
|
|
@@ -220,13 +226,13 @@ function ae() {
|
|
|
220
226
|
{
|
|
221
227
|
className: "flex items-center gap-2",
|
|
222
228
|
onSubmit: (r) => {
|
|
223
|
-
r.preventDefault(),
|
|
229
|
+
r.preventDefault(), u.trim() && f.mutate();
|
|
224
230
|
},
|
|
225
231
|
children: [
|
|
226
232
|
/* @__PURE__ */ t(
|
|
227
233
|
"input",
|
|
228
234
|
{
|
|
229
|
-
value:
|
|
235
|
+
value: u,
|
|
230
236
|
onChange: (r) => y(r.target.value),
|
|
231
237
|
placeholder: "New type, e.g. Vendor change",
|
|
232
238
|
"aria-label": "New type name",
|
|
@@ -237,7 +243,7 @@ function ae() {
|
|
|
237
243
|
"button",
|
|
238
244
|
{
|
|
239
245
|
type: "submit",
|
|
240
|
-
disabled: !
|
|
246
|
+
disabled: !u.trim() || f.isPending,
|
|
241
247
|
className: "h-8 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy disabled:opacity-50 dark:text-nvr-cyan",
|
|
242
248
|
children: "Add type"
|
|
243
249
|
}
|
|
@@ -248,5 +254,5 @@ function ae() {
|
|
|
248
254
|
] });
|
|
249
255
|
}
|
|
250
256
|
export {
|
|
251
|
-
|
|
257
|
+
Ne as SupportView
|
|
252
258
|
};
|
|
@@ -1,151 +1,156 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
const K = "shrink-0 border-y border-slate-200/90 bg-white dark:border-border dark:bg-card", M = "flex items-stretch overflow-hidden pr-4 pl-[29px]", N = "flex min-w-0 flex-1 flex-wrap content-start items-stretch overflow-hidden", L = "[[data-header-dense]_&]:min-h-[34px] [[data-header-dense]_&]:flex-row [[data-header-dense]_&]:items-center [[data-header-dense]_&]:gap-x-2 [[data-header-dense]_&]:pr-3 [[data-header-dense]_&]:pl-4 [[data-header-dense]_&]:pt-[7px] [[data-header-dense]_&]:pb-[7px] [[data-header-dense]_&]:max-w-none", H = "[[data-header-list]_&]:h-8 [[data-header-list]_&]:min-h-0 [[data-header-list]_&]:w-full [[data-header-list]_&]:max-w-none [[data-header-list]_&]:flex-row [[data-header-list]_&]:items-center [[data-header-list]_&]:justify-between [[data-header-list]_&]:gap-x-6 [[data-header-list]_&]:rounded-sm [[data-header-list]_&]:px-2 [[data-header-list]_&]:py-0 [[data-header-list]_&]:shadow-none", O = "[&[data-header-folded]]:pointer-events-none [&[data-header-folded]]:invisible [&[data-header-folded]]:absolute", U = `group relative flex min-h-[52px] min-w-[96px] max-w-[264px] flex-none flex-col justify-start gap-1 px-4 pt-[9px] pb-2 shadow-[-1px_1px_0_0_#e2e8f0] data-[empty=true]:min-w-0 data-[empty=true]:px-3 data-[empty=true]:opacity-60 dark:shadow-[-1px_1px_0_0_hsl(var(--border))] ${L} ${H} ${O}`, $ = "truncate text-[13px] font-semibold leading-tight tabular-nums tracking-[-0.01em] text-slate-900 dark:text-slate-100", T = "truncate text-[10px] font-semibold uppercase leading-none tracking-[0.07em] text-slate-400 dark:text-slate-500 [[data-header-dense]_&]:shrink-0 [[data-header-list]_&]:shrink-0", V = "truncate text-[13px] font-semibold leading-tight tabular-nums text-slate-900 dark:text-slate-100", j = "flex shrink-0 items-stretch self-stretch max-lg:[&[data-header-dock]]:hidden shadow-[-1px_0_0_0_#e2e8f0] dark:shadow-[-1px_0_0_0_hsl(var(--border))]", F = "ml-auto hidden items-center self-center py-1 pr-0 pl-4 max-lg:[&[data-header-tail]]:flex", P = "flex min-h-[40px] items-center gap-3 py-2 pr-4 pl-5", X = "absolute top-2 right-6 flex empty:hidden [[data-header-dense]_&]:static [[data-header-dense]_&]:order-1 [[data-header-dense]_&]:shrink-0 [[data-header-list]_&]:static [[data-header-list]_&]:order-1 [[data-header-list]_&]:shrink-0 [[data-header-list]_&]:mr-auto [[data-header-list]_&]:-ml-4", Y = "[[data-header-dense]_&]:order-2 [[data-header-list]_&]:order-2", z = "text-[11px] font-medium leading-none tabular-nums text-slate-400 dark:text-slate-500 [[data-header-dense]_&]:hidden", G = "flex h-5 items-end gap-x-1.5 [[data-header-dense]_&]:h-auto [[data-header-dense]_&]:items-center [[data-header-list]_&]:h-auto [[data-header-list]_&]:items-baseline [[data-header-list]_&]:justify-end [[data-header-list]_&]:text-right";
|
|
2
|
+
function b(a) {
|
|
3
|
+
const d = Array.from(a.children).filter(
|
|
4
4
|
(t) => !t.hasAttribute("data-header-more") && !t.hasAttribute("data-header-tail")
|
|
5
|
-
),
|
|
6
|
-
return
|
|
5
|
+
), r = d.filter((t) => t.hasAttribute("data-header-cell"));
|
|
6
|
+
return r.length > 0 ? r : d;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return
|
|
11
|
-
let l =
|
|
12
|
-
return
|
|
8
|
+
function R(a) {
|
|
9
|
+
const d = /* @__PURE__ */ new Set();
|
|
10
|
+
return a.map((r, t) => {
|
|
11
|
+
let l = r.hasAttribute("data-header-cell") ? r.getAttribute("data-header-cell") ?? t : t;
|
|
12
|
+
return d.has(l) && (l = `${l}#${t}`), d.add(l), l;
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
for (const
|
|
18
|
-
if (
|
|
19
|
-
let
|
|
20
|
-
if (!
|
|
21
|
-
for (;
|
|
22
|
-
const c =
|
|
23
|
-
!
|
|
15
|
+
function J(a, d) {
|
|
16
|
+
const r = b(a), t = R(r), l = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
17
|
+
for (const s of d) {
|
|
18
|
+
if (s.target === a) continue;
|
|
19
|
+
let o = s.target instanceof Element ? s.target : s.target.parentElement;
|
|
20
|
+
if (!o || o.closest("[data-header-more]")) continue;
|
|
21
|
+
for (; o && o.parentElement !== a; ) o = o.parentElement;
|
|
22
|
+
const c = o ? r.indexOf(o) : -1;
|
|
23
|
+
!o || c < 0 || (o.hasAttribute("data-header-folded") ? n : l).add(t[c]);
|
|
24
24
|
}
|
|
25
|
-
return { shown: [...l], folded: [...
|
|
25
|
+
return { shown: [...l], folded: [...n] };
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const t =
|
|
27
|
+
function Q(a, d, r) {
|
|
28
|
+
const t = b(a);
|
|
29
29
|
if (t.length === 0) return !1;
|
|
30
|
-
const l =
|
|
31
|
-
let
|
|
32
|
-
t.forEach((c,
|
|
33
|
-
let
|
|
34
|
-
|
|
30
|
+
const l = R(t), n = a.querySelector(":scope > [data-header-tail]");
|
|
31
|
+
let s = 0;
|
|
32
|
+
t.forEach((c, f) => {
|
|
33
|
+
let h;
|
|
34
|
+
d ? h = r.get(l[f]) ?? v(c) : (h = c.getBoundingClientRect().width, r.set(l[f], h)), s += h;
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const o = a.clientWidth - ((n == null ? void 0 : n.getBoundingClientRect().width) ?? 0);
|
|
37
|
+
return d ? s > o - 24 : s > o;
|
|
38
38
|
}
|
|
39
|
-
function v(
|
|
39
|
+
function v(a) {
|
|
40
40
|
var t;
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
let
|
|
44
|
-
for (const l of
|
|
45
|
-
const
|
|
46
|
-
|
|
41
|
+
const d = a.querySelectorAll("[data-header-label]");
|
|
42
|
+
if (d.length === 0) return a.getBoundingClientRect().width;
|
|
43
|
+
let r = 0;
|
|
44
|
+
for (const l of d) {
|
|
45
|
+
const n = (t = l.parentElement) == null ? void 0 : t.querySelector(":scope > [data-header-value]"), s = l.closest('[data-empty="true"]') != null, o = Math.max(l.scrollWidth, ((n == null ? void 0 : n.scrollWidth) ?? 0) * 1.16 + 40);
|
|
46
|
+
r += Math.max(o + (s ? 24 : 32), s ? 0 : 96);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return r;
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
var
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
50
|
+
const S = 2;
|
|
51
|
+
function q(a) {
|
|
52
|
+
var n, s;
|
|
53
|
+
const d = a.querySelectorAll("[data-header-label]");
|
|
54
|
+
if (d.length === 0) return a.getBoundingClientRect().width;
|
|
55
|
+
const r = a.querySelectorAll("[data-header-value]");
|
|
56
56
|
let t = 0, l = 0;
|
|
57
|
-
for (const
|
|
58
|
-
const
|
|
59
|
-
t +=
|
|
57
|
+
for (const o of d) {
|
|
58
|
+
const c = ((n = o.parentElement) == null ? void 0 : n.querySelector(":scope > [data-header-value]")) ?? r[l], f = (s = o.parentElement) == null ? void 0 : s.querySelector(":scope > [data-header-freshness] > *");
|
|
59
|
+
t += o.scrollWidth + ((c == null ? void 0 : c.scrollWidth) ?? 0) + 8 + 28 + (f ? 20 : 0), l++;
|
|
60
60
|
}
|
|
61
61
|
return t;
|
|
62
62
|
}
|
|
63
|
+
function Z(a) {
|
|
64
|
+
const d = (r) => r.empty ? 2 : r.money ? 0 : 1;
|
|
65
|
+
return [...a].sort((r, t) => d(r) - d(t) || r.index - t.index);
|
|
66
|
+
}
|
|
63
67
|
const W = "__more__";
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
let
|
|
67
|
-
return (
|
|
68
|
-
}, c =
|
|
69
|
-
return
|
|
68
|
+
function B(a, d, r, t, l) {
|
|
69
|
+
const n = [], s = (h, _) => n[h] === d || _ <= n[h] + 0.5, o = (h) => {
|
|
70
|
+
let _ = l ? n.findIndex((g, E) => s(E, h)) : n.length - 1;
|
|
71
|
+
return (_ < 0 || !s(_, h)) && (n.push(d), _ = n.length - 1), n[_] -= h, _;
|
|
72
|
+
}, c = a.map((h) => h == null ? -1 : o(h)), f = a.some((h) => h == null) ? o(r) : -1;
|
|
73
|
+
return n.length === 0 && n.push(d), t > 0 && !s(n.length - 1, t) && n.push(d - t), { count: n.length, rowOf: c, chipRow: f };
|
|
70
74
|
}
|
|
71
|
-
function
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
+
function I(a) {
|
|
76
|
+
if (a.matches('[data-empty="true"]') || a.querySelector('[data-empty="true"]')) return !0;
|
|
77
|
+
const d = a.querySelectorAll("[data-header-value]");
|
|
78
|
+
return d.length > 0 && Array.from(d).every((r) => {
|
|
75
79
|
var t;
|
|
76
|
-
return ((t =
|
|
80
|
+
return ((t = r.textContent) == null ? void 0 : t.trim()) === "—";
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
|
-
function
|
|
80
|
-
const t = Array.from(
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
|
|
83
|
+
function ee(a, d, r) {
|
|
84
|
+
const t = Array.from(a.children), l = t.find((e) => e.hasAttribute("data-header-more")), n = t.find((e) => e.hasAttribute("data-header-tail")), s = b(a);
|
|
85
|
+
if (s.length === 0) return { folded: [], rows: null };
|
|
86
|
+
const o = R(s), c = s.map((e, i) => {
|
|
87
|
+
const u = o[i];
|
|
88
|
+
if (d && !e.hasAttribute("data-header-folded")) {
|
|
89
|
+
const m = e.getBoundingClientRect().width;
|
|
90
|
+
m > 0 && r.set(u, m);
|
|
87
91
|
}
|
|
88
|
-
return
|
|
89
|
-
}),
|
|
90
|
-
c.map((
|
|
92
|
+
return r.get(u) ?? q(e);
|
|
93
|
+
}), f = a.clientWidth, h = l ? l.getBoundingClientRect().width : 96, _ = (n == null ? void 0 : n.getBoundingClientRect().width) ?? 0, g = (e, i) => B(
|
|
94
|
+
c.map((u, m) => e.has(m) ? null : u),
|
|
95
|
+
f,
|
|
96
|
+
h,
|
|
91
97
|
_,
|
|
92
|
-
i
|
|
93
|
-
|
|
94
|
-
h
|
|
95
|
-
), p = /* @__PURE__ */ new Set();
|
|
96
|
-
if (E(p, !1).count <= k) return { folded: [], rows: null };
|
|
97
|
-
const x = d.map(B), R = d.map(
|
|
98
|
+
i
|
|
99
|
+
), E = s.map(I), A = s.map(
|
|
98
100
|
(e) => e.hasAttribute("data-header-money") || e.querySelector("[data-header-money]") != null
|
|
99
|
-
),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
), k = s.map((e) => e.hasAttribute("data-header-pin")), D = (e) => [...e].sort((i, u) => i - u).map((i) => {
|
|
102
|
+
var u, m;
|
|
103
|
+
return {
|
|
104
|
+
index: i,
|
|
105
|
+
key: o[i],
|
|
106
|
+
empty: E[i],
|
|
107
|
+
money: A[i],
|
|
108
|
+
label: ((m = (u = s[i].querySelector("[data-header-label]")) == null ? void 0 : u.textContent) == null ? void 0 : m.trim()) ?? ""
|
|
109
|
+
};
|
|
110
|
+
}), p = new Set(c.flatMap((e, i) => !k[i] && e > f + 0.5 ? [i] : []));
|
|
111
|
+
if (g(p, !1).count <= S) return { folded: D(p), rows: null };
|
|
112
|
+
const y = (e) => s.map((i, u) => u).filter((i) => !k[i] && e(i)).reverse(), C = [
|
|
113
|
+
...y((e) => E[e]),
|
|
114
|
+
...y((e) => !E[e] && !A[e]),
|
|
115
|
+
...y((e) => !E[e] && A[e])
|
|
103
116
|
];
|
|
104
|
-
let
|
|
117
|
+
let x = g(p, !0);
|
|
105
118
|
for (const e of C) {
|
|
106
|
-
if (
|
|
107
|
-
p.add(e),
|
|
119
|
+
if (x.count <= S) break;
|
|
120
|
+
p.has(e) || (p.add(e), x = g(p, !0));
|
|
108
121
|
}
|
|
109
|
-
const
|
|
110
|
-
return
|
|
111
|
-
e >= 0 && (
|
|
112
|
-
}),
|
|
113
|
-
folded: [...p].sort((e, h) => e - h).map((e) => {
|
|
114
|
-
var h, f;
|
|
115
|
-
return {
|
|
116
|
-
index: e,
|
|
117
|
-
key: s[e],
|
|
118
|
-
empty: x[e],
|
|
119
|
-
label: ((f = (h = d[e].querySelector("[data-header-label]")) == null ? void 0 : h.textContent) == null ? void 0 : f.trim()) ?? ""
|
|
120
|
-
};
|
|
121
|
-
}),
|
|
122
|
-
rows: y
|
|
123
|
-
};
|
|
122
|
+
const w = {};
|
|
123
|
+
return x.rowOf.forEach((e, i) => {
|
|
124
|
+
e >= 0 && (w[String(o[i])] = e);
|
|
125
|
+
}), x.chipRow >= 0 && (w[W] = x.chipRow), { folded: D(p), rows: w };
|
|
124
126
|
}
|
|
125
127
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
128
|
+
K as HEADER_BAND,
|
|
129
|
+
L as HEADER_CELL_DENSE,
|
|
130
|
+
O as HEADER_CELL_FOLDED,
|
|
131
|
+
H as HEADER_CELL_LIST,
|
|
132
|
+
j as HEADER_DOCK,
|
|
133
|
+
P as HEADER_DOCK_CELL,
|
|
134
|
+
F as HEADER_DOCK_INLINE,
|
|
135
|
+
T as HEADER_LABEL,
|
|
136
|
+
X as HEADER_MARK,
|
|
137
|
+
S as HEADER_MAX_ROWS,
|
|
135
138
|
W as HEADER_MORE_ROW_KEY,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
M as HEADER_ROW,
|
|
140
|
+
z as HEADER_SUB,
|
|
141
|
+
U as HEADER_TILE,
|
|
142
|
+
N as HEADER_TILES,
|
|
143
|
+
V as HEADER_VALUE,
|
|
144
|
+
Y as HEADER_VALUE_AFTER_MARK,
|
|
145
|
+
$ as HEADER_VALUE_HERO,
|
|
146
|
+
G as HEADER_VALUE_LINE,
|
|
147
|
+
Z as foldedListOrder,
|
|
148
|
+
I as headerCellIsEmpty,
|
|
149
|
+
R as headerCellKeys,
|
|
150
|
+
b as headerCells,
|
|
151
|
+
J as headerChangedCells,
|
|
152
|
+
q as headerEstimateDenseWidth,
|
|
153
|
+
ee as headerFoldPlan,
|
|
154
|
+
Q as headerNeedsDense,
|
|
155
|
+
B as headerPackRows
|
|
151
156
|
};
|