@nivaro/react 0.3.100 → 0.3.101
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/index.d.ts +46 -3
- package/dist/index.js +623 -620
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/ItemEditForm.js +2708 -2704
- package/dist/shared/components/JobsTray.js +74 -63
- package/dist/shared/components/NotificationBell.js +80 -73
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/panels/BackgroundMove.js +152 -85
- package/dist/shared/components/panels/PipelinePanel.js +602 -594
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +16 -6
- package/dist/shared/lib/obligation-banner.js +16 -16
- package/dist/shared/lib/partner-failure.js +44 -32
- package/package.json +1 -1
|
@@ -1,558 +1,535 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Flame as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as $ } from "@tanstack/react-query";
|
|
3
|
+
import { Flame as G, LogIn as Q, ChevronLeft as V, ChevronRight as X, Footprints as ee } from "lucide-react";
|
|
4
|
+
import { useState as T, useMemo as R } from "react";
|
|
5
|
+
import { useNivaroClient as B, useNavigation as te, useItemNavigation as ae } from "../../context.js";
|
|
6
|
+
import { get as A } from "../../lib/commands.js";
|
|
7
|
+
import { formatRelative as se, formatDateTime as ne, cn as f } from "../../lib/utils.js";
|
|
8
|
+
import { ErrorNotice as re } from "../ErrorNotice.js";
|
|
9
|
+
import { SkeletonBar as D } from "../Skeletons.js";
|
|
10
|
+
import { SimpleSelect as le } from "../ui/SimpleSelect.js";
|
|
11
|
+
import { localDateKey as ie, localDayOffset as oe, shiftDate as de, isSafeAdminPath as ce } from "./dayTimelineLayout.js";
|
|
12
|
+
import { foldJourneySession as me, fmtDuration as U, fallbackJourneyLabel as ue, words as pe, fmtSpan as he, fmtClock as xe } from "./journey-view.js";
|
|
13
|
+
import { SectionCard as E, EmptyLine as F, usePersonUrl as fe } from "./primitives.js";
|
|
14
|
+
function Re({ userId: e, title: r = "Rhythm" }) {
|
|
15
|
+
const n = B(), { data: t } = $({
|
|
16
|
+
queryKey: ["nvr-user-stats", e],
|
|
17
|
+
queryFn: () => n.request(A(`/users/${e}/stats`)).then((u) => u.data).catch(() => null),
|
|
14
18
|
staleTime: 5 * 6e4
|
|
15
19
|
});
|
|
16
|
-
if (!
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
+
if (!t) return null;
|
|
21
|
+
const c = Math.max(1, ...t.weeks.map((u) => u.transitions + u.tasks_done + u.created)), o = t.totals.transitions + t.totals.tasks_done + t.totals.created === 0;
|
|
22
|
+
return /* @__PURE__ */ a(
|
|
23
|
+
E,
|
|
20
24
|
{
|
|
21
|
-
icon: /* @__PURE__ */
|
|
22
|
-
title:
|
|
25
|
+
icon: /* @__PURE__ */ a(G, { className: "h-4 w-4" }),
|
|
26
|
+
title: r,
|
|
23
27
|
hint: "Last eight weeks",
|
|
24
28
|
testId: "stats",
|
|
25
|
-
actions:
|
|
26
|
-
|
|
29
|
+
actions: t.streak_days > 0 && /* @__PURE__ */ l("span", { className: "text-[11.5px] font-medium text-amber-600 dark:text-amber-400", children: [
|
|
30
|
+
t.streak_days,
|
|
27
31
|
"-day streak"
|
|
28
32
|
] }),
|
|
29
|
-
children:
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
["Approvals",
|
|
35
|
-
["Tasks done",
|
|
36
|
-
["Records created",
|
|
37
|
-
].map(([
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
] }, String(
|
|
33
|
+
children: o ? /* @__PURE__ */ a(F, { children: "Nothing recorded in the last eight weeks." }) : /* @__PURE__ */ l(Z, { children: [
|
|
34
|
+
/* @__PURE__ */ a(ye, { weeks: t.weeks, max: c }),
|
|
35
|
+
t.active_days && /* @__PURE__ */ a(be, { days: t.active_days }),
|
|
36
|
+
t.typical_hours_utc && /* @__PURE__ */ a(ve, { hours: t.typical_hours_utc }),
|
|
37
|
+
/* @__PURE__ */ a("dl", { className: "mt-4 grid grid-cols-3 gap-2 text-center", children: [
|
|
38
|
+
["Approvals", t.totals.transitions],
|
|
39
|
+
["Tasks done", t.totals.tasks_done],
|
|
40
|
+
["Records created", t.totals.created]
|
|
41
|
+
].map(([u, s]) => /* @__PURE__ */ l("div", { className: "rounded-md bg-slate-50 py-2 dark:bg-muted/40", children: [
|
|
42
|
+
/* @__PURE__ */ a("dd", { className: "text-[16px] font-semibold tabular-nums text-slate-800 dark:text-slate-100", children: Number(s).toLocaleString() }),
|
|
43
|
+
/* @__PURE__ */ a("dt", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: u })
|
|
44
|
+
] }, String(u))) })
|
|
41
45
|
] })
|
|
42
46
|
}
|
|
43
47
|
);
|
|
44
48
|
}
|
|
45
|
-
const
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
+
const M = 864e5;
|
|
50
|
+
function P(e) {
|
|
51
|
+
const r = new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())), n = (r.getUTCDay() + 6) % 7;
|
|
52
|
+
return r.setUTCDate(r.getUTCDate() - n), r;
|
|
49
53
|
}
|
|
50
|
-
const q = (
|
|
51
|
-
function
|
|
52
|
-
weeks:
|
|
53
|
-
max:
|
|
54
|
+
const q = (e) => e.toLocaleDateString(void 0, { month: "short", day: "numeric", timeZone: "UTC" });
|
|
55
|
+
function ye({
|
|
56
|
+
weeks: e,
|
|
57
|
+
max: r
|
|
54
58
|
}) {
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
const n = P(/* @__PURE__ */ new Date());
|
|
60
|
+
return /* @__PURE__ */ l("div", { "data-person-week-bars": !0, children: [
|
|
61
|
+
/* @__PURE__ */ a("p", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: "Actions per week" }),
|
|
62
|
+
/* @__PURE__ */ a("div", { className: "mt-1.5 flex items-end gap-1.5", "data-person-stats-bars": !0, children: e.map((t, c) => {
|
|
63
|
+
const o = t.transitions + t.tasks_done + t.created, u = o === 0 ? 2 : Math.max(6, Math.round(o / r * 56)), s = new Date(n.getTime() - (e.length - 1 - c) * 7 * M), d = c === e.length - 1;
|
|
64
|
+
return /* @__PURE__ */ l(
|
|
61
65
|
"div",
|
|
62
66
|
{
|
|
63
67
|
className: "flex flex-1 flex-col items-center justify-end",
|
|
64
|
-
title: `Week of ${q(
|
|
68
|
+
title: `Week of ${q(s)} · ${o} actions · ${t.transitions} approvals · ${t.tasks_done} tasks · ${t.created} created`,
|
|
65
69
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ a(
|
|
67
71
|
"span",
|
|
68
72
|
{
|
|
69
|
-
className:
|
|
73
|
+
className: f(
|
|
70
74
|
"mb-0.5 text-[10.5px] tabular-nums",
|
|
71
|
-
|
|
75
|
+
o === 0 ? "text-transparent" : "text-slate-500 dark:text-slate-400"
|
|
72
76
|
),
|
|
73
|
-
"aria-hidden":
|
|
74
|
-
children:
|
|
77
|
+
"aria-hidden": o === 0,
|
|
78
|
+
children: o
|
|
75
79
|
}
|
|
76
80
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ a(
|
|
78
82
|
"div",
|
|
79
83
|
{
|
|
80
|
-
className:
|
|
84
|
+
className: f(
|
|
81
85
|
"w-full rounded-sm",
|
|
82
|
-
d ? "bg-nvr-cyan" :
|
|
86
|
+
d ? "bg-nvr-cyan" : o === 0 ? "bg-slate-200 dark:bg-slate-700" : "bg-slate-300 dark:bg-slate-600"
|
|
83
87
|
),
|
|
84
|
-
style: { height:
|
|
88
|
+
style: { height: u }
|
|
85
89
|
}
|
|
86
90
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ a(
|
|
88
92
|
"span",
|
|
89
93
|
{
|
|
90
|
-
className:
|
|
94
|
+
className: f(
|
|
91
95
|
"mt-1 text-[10px] tabular-nums",
|
|
92
96
|
d ? "font-semibold text-slate-700 dark:text-slate-200" : "text-slate-400"
|
|
93
97
|
),
|
|
94
|
-
children: d ? "This wk" : q(
|
|
98
|
+
children: d ? "This wk" : q(s)
|
|
95
99
|
}
|
|
96
100
|
)
|
|
97
101
|
]
|
|
98
102
|
},
|
|
99
|
-
|
|
103
|
+
s.toISOString()
|
|
100
104
|
);
|
|
101
105
|
}) })
|
|
102
106
|
] });
|
|
103
107
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
+
const ge = ["Mon", "", "Wed", "", "Fri", "", "Sun"];
|
|
109
|
+
function be({ days: e }) {
|
|
110
|
+
const r = new Set(e), n = P(/* @__PURE__ */ new Date()), t = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), c = Array.from({ length: 8 }, (s, d) => {
|
|
111
|
+
const m = new Date(n.getTime() - (7 - d) * 7 * M);
|
|
108
112
|
return {
|
|
109
|
-
monday:
|
|
110
|
-
cells: Array.from({ length: 7 }, (y,
|
|
111
|
-
const
|
|
112
|
-
return { key:
|
|
113
|
+
monday: m,
|
|
114
|
+
cells: Array.from({ length: 7 }, (y, g) => {
|
|
115
|
+
const b = new Date(m.getTime() + g * M), h = b.toISOString().slice(0, 10);
|
|
116
|
+
return { key: h, on: r.has(h), future: h > t, today: h === t, date: b };
|
|
113
117
|
})
|
|
114
118
|
};
|
|
115
|
-
}),
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
119
|
+
}), o = c.flat().flatMap((s) => s.cells).filter((s) => s.on).length, u = c.flatMap((s) => s.cells).filter((s) => !s.future).length;
|
|
120
|
+
return /* @__PURE__ */ l("div", { className: "mt-4", "data-person-presence-strip": o, children: [
|
|
121
|
+
/* @__PURE__ */ l("div", { className: "flex items-baseline justify-between", children: [
|
|
122
|
+
/* @__PURE__ */ a("p", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: "Days with activity" }),
|
|
123
|
+
/* @__PURE__ */ l("p", { className: "text-[11.5px] tabular-nums text-slate-600 dark:text-slate-300", children: [
|
|
124
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: o }),
|
|
121
125
|
" of the last ",
|
|
122
|
-
|
|
126
|
+
u,
|
|
123
127
|
" days"
|
|
124
128
|
] })
|
|
125
129
|
] }),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ l("div", { className: "mt-1.5 flex gap-1.5", children: [
|
|
131
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-[3px] pr-1", "aria-hidden": !0, children: ge.map((s, d) => /* @__PURE__ */ a(
|
|
128
132
|
"span",
|
|
129
133
|
{
|
|
130
134
|
className: "h-3 text-[9.5px] leading-3 text-slate-400",
|
|
131
|
-
children:
|
|
135
|
+
children: s
|
|
132
136
|
},
|
|
133
137
|
d
|
|
134
138
|
)) }),
|
|
135
|
-
|
|
139
|
+
c.map((s) => /* @__PURE__ */ a("div", { className: "flex flex-1 flex-col gap-[3px]", children: s.cells.map((d) => /* @__PURE__ */ a(
|
|
136
140
|
"span",
|
|
137
141
|
{
|
|
138
142
|
title: d.future ? void 0 : `${d.date.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric", timeZone: "UTC" })}${d.on ? " · active" : " · no activity"}`,
|
|
139
|
-
className:
|
|
143
|
+
className: f(
|
|
140
144
|
"h-3 rounded-[2px]",
|
|
141
145
|
d.future ? "bg-transparent" : d.on ? "bg-nvr-cyan" : "bg-slate-200 dark:bg-slate-700",
|
|
142
146
|
d.today && "ring-1 ring-slate-400 dark:ring-slate-300"
|
|
143
147
|
)
|
|
144
148
|
},
|
|
145
149
|
d.key
|
|
146
|
-
)) },
|
|
150
|
+
)) }, s.monday.toISOString()))
|
|
147
151
|
] }),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ l("div", { className: "mt-1.5 flex items-center justify-between text-[10px] text-slate-400", children: [
|
|
153
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-1", children: [
|
|
154
|
+
/* @__PURE__ */ a("span", { className: "inline-block h-2.5 w-2.5 rounded-[2px] bg-nvr-cyan" }),
|
|
151
155
|
" did something",
|
|
152
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ a("span", { className: "ml-2 inline-block h-2.5 w-2.5 rounded-[2px] bg-slate-200 dark:bg-slate-700" }),
|
|
153
157
|
" ",
|
|
154
158
|
"quiet"
|
|
155
159
|
] }),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
q(
|
|
160
|
+
/* @__PURE__ */ l("span", { children: [
|
|
161
|
+
q(c[0].monday),
|
|
158
162
|
" → today"
|
|
159
163
|
] })
|
|
160
164
|
] })
|
|
161
165
|
] });
|
|
162
166
|
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
return new Date(2e3, 0, 1,
|
|
167
|
+
function ve({ hours: e }) {
|
|
168
|
+
const r = -(/* @__PURE__ */ new Date()).getTimezoneOffset() / 60, n = (c) => ((c + r) % 24 + 24) % 24, t = (c) => {
|
|
169
|
+
const o = Math.round(c * 2) / 2, u = Math.floor(o) % 24, s = o % 1 ? 30 : 0;
|
|
170
|
+
return new Date(2e3, 0, 1, u, s).toLocaleTimeString([], { hour: "numeric", minute: s ? "2-digit" : void 0 });
|
|
167
171
|
};
|
|
168
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ l("p", { className: "mt-3 text-[12px] text-slate-600 dark:text-slate-300", "data-person-typical-hours": !0, children: [
|
|
169
173
|
"Usually active",
|
|
170
174
|
" ",
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
|
|
175
|
+
/* @__PURE__ */ l("span", { className: "font-medium text-slate-800 dark:text-slate-100", children: [
|
|
176
|
+
t(n(e.start)),
|
|
173
177
|
" – ",
|
|
174
|
-
|
|
178
|
+
t(n(e.end))
|
|
175
179
|
] }),
|
|
176
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ l("span", { className: "text-slate-400", children: [
|
|
177
181
|
" ",
|
|
178
182
|
"· your time · based on ",
|
|
179
|
-
|
|
183
|
+
e.samples.toLocaleString(),
|
|
180
184
|
" actions"
|
|
181
185
|
] })
|
|
182
186
|
] });
|
|
183
187
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
188
|
+
function Je(e) {
|
|
189
|
+
const r = ue(e);
|
|
190
|
+
return r.section && r.kind === "page" ? `${r.section} › ${r.title}` : r.title;
|
|
186
191
|
}
|
|
187
|
-
function
|
|
188
|
-
return
|
|
192
|
+
function ke(e, r, n) {
|
|
193
|
+
return e.request(
|
|
194
|
+
A(`/journeys/days/${r}`, n ? { app: n } : void 0)
|
|
195
|
+
).then((t) => ({ days: t.data ?? [], apps: t.apps ?? [] })).catch(() => ({ days: [], apps: [] }));
|
|
189
196
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
function
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
197
|
+
function Ne(e) {
|
|
198
|
+
const r = e.filter((n) => n !== "admin");
|
|
199
|
+
return (n) => !n || n === "admin" ? "Admin" : r.length <= 1 ? "Portal" : pe(n);
|
|
200
|
+
}
|
|
201
|
+
function we(e) {
|
|
202
|
+
return e < 600 ? e : Math.floor(e / 60) * 60;
|
|
203
|
+
}
|
|
204
|
+
function W(e, r) {
|
|
205
|
+
if (e === r) return "Today";
|
|
206
|
+
if (e === de(r, -1)) return "Yesterday";
|
|
207
|
+
const [n, t, c] = e.split("-").map(Number);
|
|
208
|
+
return new Date(n, t - 1, c).toLocaleDateString("en-US", {
|
|
209
|
+
weekday: "short",
|
|
210
|
+
month: "short",
|
|
211
|
+
day: "numeric",
|
|
212
|
+
...Number(r.slice(0, 4)) !== n ? { year: "numeric" } : {}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function J(e, r, n = !1) {
|
|
216
|
+
const t = W(e, r);
|
|
217
|
+
return t === "Today" || t === "Yesterday" ? t.toLowerCase() : n ? `on ${t}` : t;
|
|
218
|
+
}
|
|
219
|
+
const L = 8, Se = 300;
|
|
220
|
+
function Be({ userId: e }) {
|
|
221
|
+
var O;
|
|
222
|
+
const r = B(), n = ie(/* @__PURE__ */ new Date()), [t, c] = T(n), [o, u] = T(null), { data: s } = $({
|
|
223
|
+
queryKey: ["nvr-journey-days", e, o],
|
|
224
|
+
queryFn: () => ke(r, e, o)
|
|
225
|
+
}), d = (s == null ? void 0 : s.days) ?? [], m = (s == null ? void 0 : s.apps) ?? [], y = oe(t), { data: g, isLoading: b, isError: h, error: w, refetch: S } = $({
|
|
226
|
+
queryKey: ["nvr-journey", e, t, y, o],
|
|
227
|
+
queryFn: () => r.request(
|
|
228
|
+
A(`/journeys/user/${e}`, {
|
|
229
|
+
date: t,
|
|
230
|
+
tz_offset: y,
|
|
231
|
+
...o ? { app: o } : {}
|
|
222
232
|
})
|
|
233
|
+
).then((i) => i.data ?? { sessions: [] }),
|
|
234
|
+
retry: !1
|
|
235
|
+
}), k = m.length > 1 || m.length === 1 && m[0] !== "admin", p = R(
|
|
236
|
+
() => [.../* @__PURE__ */ new Set([n, ...d.map((i) => i.date)])].sort().reverse(),
|
|
237
|
+
[n, d]
|
|
238
|
+
), N = p.indexOf(t), _ = N > 0 ? p[N - 1] : null, C = N >= 0 && N < p.length - 1 ? p[N + 1] : null, x = R(
|
|
239
|
+
() => ((g == null ? void 0 : g.sessions) ?? []).map((i) => ({ s: i, v: me(i.steps) })).filter((i) => i.v.rows.length > 0).sort((i, v) => i.v.start.localeCompare(v.v.start)),
|
|
240
|
+
[g]
|
|
241
|
+
), Y = Math.max(60, ...x.flatMap((i) => i.v.rows.map((v) => v.seconds ?? 0))), z = x.reduce((i, v) => i + we(v.v.seconds), 0), I = Ne(m), j = ((O = d.find((i) => i.date !== t)) == null ? void 0 : O.date) ?? null, K = "inline-flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 disabled:pointer-events-none disabled:opacity-30 dark:text-slate-400 dark:hover:bg-muted dark:hover:text-slate-100", H = /* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", "data-journey-day-picker": !0, children: [
|
|
242
|
+
/* @__PURE__ */ a(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
"aria-label": "Earlier day",
|
|
247
|
+
disabled: !C,
|
|
248
|
+
onClick: () => C && c(C),
|
|
249
|
+
className: K,
|
|
250
|
+
children: /* @__PURE__ */ a(V, { className: "h-3.5 w-3.5" })
|
|
251
|
+
}
|
|
223
252
|
),
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
253
|
+
/* @__PURE__ */ a(
|
|
254
|
+
le,
|
|
255
|
+
{
|
|
256
|
+
value: t,
|
|
257
|
+
onChange: c,
|
|
258
|
+
ariaLabel: "Day",
|
|
259
|
+
options: p.map((i) => ({ value: i, label: W(i, n) })),
|
|
260
|
+
className: "h-7 w-[124px] gap-1 rounded-md border-slate-200 bg-white px-2 text-[12px] font-medium text-slate-700 dark:border-border dark:bg-card dark:text-slate-200 [&>svg]:h-3.5 [&>svg]:w-3.5",
|
|
261
|
+
triggerProps: { "data-journey-day": t }
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ a(
|
|
265
|
+
"button",
|
|
266
|
+
{
|
|
267
|
+
type: "button",
|
|
268
|
+
"aria-label": "Later day",
|
|
269
|
+
disabled: !_,
|
|
270
|
+
onClick: () => _ && c(_),
|
|
271
|
+
className: K,
|
|
272
|
+
children: /* @__PURE__ */ a(X, { className: "h-3.5 w-3.5" })
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
] });
|
|
276
|
+
return /* @__PURE__ */ l(
|
|
277
|
+
E,
|
|
238
278
|
{
|
|
239
|
-
icon: /* @__PURE__ */
|
|
240
|
-
title: "
|
|
241
|
-
hint:
|
|
242
|
-
testId: "
|
|
243
|
-
actions:
|
|
244
|
-
"button",
|
|
245
|
-
{
|
|
246
|
-
type: "button",
|
|
247
|
-
onClick: () => N((n) => n === "desc" ? "asc" : "desc"),
|
|
248
|
-
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] text-slate-500 hover:bg-slate-50 hover:text-slate-800 dark:text-slate-400 dark:hover:bg-muted",
|
|
249
|
-
children: [
|
|
250
|
-
d === "desc" ? /* @__PURE__ */ e(Y, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(G, { className: "h-3.5 w-3.5" }),
|
|
251
|
-
d === "desc" ? "Newest first" : "Oldest first"
|
|
252
|
-
]
|
|
253
|
-
}
|
|
254
|
-
),
|
|
279
|
+
icon: /* @__PURE__ */ a(ee, { className: "h-4 w-4" }),
|
|
280
|
+
title: "Pages visited",
|
|
281
|
+
hint: "Session by session, kept 30 days",
|
|
282
|
+
testId: "journey",
|
|
283
|
+
actions: H,
|
|
255
284
|
children: [
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return /* @__PURE__ */ s(
|
|
260
|
-
"button",
|
|
261
|
-
{
|
|
262
|
-
type: "button",
|
|
263
|
-
"aria-pressed": i === n.action,
|
|
264
|
-
onClick: () => u(i === n.action ? "" : n.action),
|
|
265
|
-
className: v(
|
|
266
|
-
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium transition-opacity",
|
|
267
|
-
r.cls,
|
|
268
|
-
i && i !== n.action && "opacity-40"
|
|
269
|
-
),
|
|
270
|
-
children: [
|
|
271
|
-
n.action,
|
|
272
|
-
/* @__PURE__ */ e("span", { className: "font-mono opacity-70", children: n.count })
|
|
273
|
-
]
|
|
274
|
-
},
|
|
275
|
-
n.action
|
|
276
|
-
);
|
|
277
|
-
}),
|
|
278
|
-
x.collections.length > 1 && /* @__PURE__ */ e(
|
|
279
|
-
V,
|
|
285
|
+
(k || x.length > 0) && /* @__PURE__ */ l("div", { className: "mb-4 flex flex-wrap items-center justify-between gap-x-3 gap-y-2", children: [
|
|
286
|
+
k ? /* @__PURE__ */ l(
|
|
287
|
+
"fieldset",
|
|
280
288
|
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
className: "inline-flex rounded-md border border-slate-200 p-0.5 dark:border-border",
|
|
290
|
+
"data-journey-apps": !0,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ a("legend", { className: "sr-only", children: "App" }),
|
|
293
|
+
[null, ...m].map((i) => /* @__PURE__ */ a(
|
|
294
|
+
"button",
|
|
295
|
+
{
|
|
296
|
+
type: "button",
|
|
297
|
+
"aria-pressed": o === i,
|
|
298
|
+
"data-journey-app-filter": i ?? "all",
|
|
299
|
+
onClick: () => u(i),
|
|
300
|
+
className: f(
|
|
301
|
+
"h-6 rounded px-2.5 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40",
|
|
302
|
+
o === i ? "bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"
|
|
303
|
+
),
|
|
304
|
+
children: i ? I(i) : "All apps"
|
|
305
|
+
},
|
|
306
|
+
i ?? "__all"
|
|
307
|
+
))
|
|
308
|
+
]
|
|
292
309
|
}
|
|
293
|
-
),
|
|
294
|
-
|
|
295
|
-
"
|
|
310
|
+
) : /* @__PURE__ */ a("span", {}),
|
|
311
|
+
x.length > 0 && /* @__PURE__ */ l(
|
|
312
|
+
"p",
|
|
296
313
|
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
u(""), m("");
|
|
300
|
-
},
|
|
301
|
-
className: "inline-flex items-center gap-1 text-[11px] text-slate-400 hover:text-slate-600",
|
|
314
|
+
className: "text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
315
|
+
"data-journey-summary": !0,
|
|
302
316
|
children: [
|
|
303
|
-
|
|
304
|
-
"
|
|
317
|
+
x.length,
|
|
318
|
+
" session",
|
|
319
|
+
x.length === 1 ? "" : "s",
|
|
320
|
+
" ·",
|
|
321
|
+
" ",
|
|
322
|
+
U(z) || "under a minute"
|
|
305
323
|
]
|
|
306
324
|
}
|
|
307
325
|
)
|
|
308
326
|
] }),
|
|
309
|
-
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
] })
|
|
315
|
-
|
|
316
|
-
_.map((n) => /* @__PURE__ */ s("div", { children: [
|
|
317
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-3 py-2", children: [
|
|
318
|
-
/* @__PURE__ */ e("div", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
|
|
319
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium text-slate-400", children: n.date }),
|
|
320
|
-
/* @__PURE__ */ e("div", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
|
|
321
|
-
] }),
|
|
322
|
-
/* @__PURE__ */ e("ol", { className: "relative ml-1 border-l border-slate-100 dark:border-border", children: n.entries.map((r) => {
|
|
323
|
-
const f = U[r.action] ?? K, k = ne(r) ? p({ collection: r.collection, itemId: r.item }) : null;
|
|
324
|
-
return /* @__PURE__ */ s("li", { className: "relative py-2 pl-4", "data-activity-row": r.id, children: [
|
|
325
|
-
/* @__PURE__ */ e(
|
|
326
|
-
"span",
|
|
327
|
-
{
|
|
328
|
-
className: v(
|
|
329
|
-
"absolute -left-[4.5px] top-[15px] h-2 w-2 rounded-full",
|
|
330
|
-
f.dot
|
|
331
|
-
)
|
|
332
|
-
}
|
|
333
|
-
),
|
|
334
|
-
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
335
|
-
/* @__PURE__ */ e(
|
|
336
|
-
"span",
|
|
337
|
-
{
|
|
338
|
-
className: v(
|
|
339
|
-
"rounded-full px-1.5 py-0.5 text-[10px] font-medium",
|
|
340
|
-
f.cls
|
|
341
|
-
),
|
|
342
|
-
children: le(r)
|
|
343
|
-
}
|
|
344
|
-
),
|
|
345
|
-
r.collection && (k ? /* @__PURE__ */ s(
|
|
346
|
-
"a",
|
|
347
|
-
{
|
|
348
|
-
href: k,
|
|
349
|
-
onClick: (L) => {
|
|
350
|
-
L.metaKey || L.ctrlKey || (L.preventDefault(), a.navigate(k));
|
|
351
|
-
},
|
|
352
|
-
className: "min-w-0 truncate text-[12.5px] text-slate-700 hover:underline dark:text-slate-200",
|
|
353
|
-
title: `${r.collection} #${r.item}`,
|
|
354
|
-
children: [
|
|
355
|
-
r.link ? null : /* @__PURE__ */ s("span", { className: "text-slate-400", children: [
|
|
356
|
-
r.collection_label ?? r.collection,
|
|
357
|
-
" "
|
|
358
|
-
] }),
|
|
359
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children: r.record_label ?? `#${r.item}` })
|
|
360
|
-
]
|
|
361
|
-
}
|
|
362
|
-
) : /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-[12.5px] text-slate-600 dark:text-slate-300", children: [
|
|
363
|
-
r.link && r.record_label ? null : /* @__PURE__ */ s("span", { className: "text-slate-400", children: [
|
|
364
|
-
r.collection_label ?? r.collection,
|
|
365
|
-
" "
|
|
366
|
-
] }),
|
|
367
|
-
r.record_label ? /* @__PURE__ */ e("span", { className: "font-medium", children: r.record_label }) : r.item ? /* @__PURE__ */ s("span", { className: "font-medium", children: [
|
|
368
|
-
"#",
|
|
369
|
-
r.item
|
|
370
|
-
] }) : null
|
|
371
|
-
] })),
|
|
372
|
-
/* @__PURE__ */ e(
|
|
373
|
-
"span",
|
|
374
|
-
{
|
|
375
|
-
className: "ml-auto text-[11px] text-slate-400",
|
|
376
|
-
title: O(r.timestamp),
|
|
377
|
-
children: j(r.timestamp)
|
|
378
|
-
}
|
|
379
|
-
)
|
|
380
|
-
] }),
|
|
381
|
-
r.comment && /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: r.comment }),
|
|
382
|
-
r.ip && /* @__PURE__ */ s("span", { className: "mt-0.5 inline-flex items-center gap-1 font-mono text-[10px] text-slate-300 dark:text-slate-600", children: [
|
|
383
|
-
/* @__PURE__ */ e(R, { className: "h-2.5 w-2.5" }),
|
|
384
|
-
" ",
|
|
385
|
-
r.ip
|
|
386
|
-
] })
|
|
387
|
-
] }, r.id);
|
|
388
|
-
}) })
|
|
389
|
-
] }, n.date)),
|
|
390
|
-
g.hasNextPage && /* @__PURE__ */ e("div", { className: "pt-3 text-center", children: /* @__PURE__ */ e(
|
|
327
|
+
b ? /* @__PURE__ */ a(De, {}) : h ? /* @__PURE__ */ a(re, { error: w, what: "the pages visited", onRetry: () => void S() }) : x.length === 0 ? /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", "data-journey-empty": !0, children: [
|
|
328
|
+
/* @__PURE__ */ l(F, { children: [
|
|
329
|
+
"No pages recorded ",
|
|
330
|
+
t === n ? "today" : J(t, n, !0),
|
|
331
|
+
"."
|
|
332
|
+
] }),
|
|
333
|
+
j && /* @__PURE__ */ l(
|
|
391
334
|
"button",
|
|
392
335
|
{
|
|
393
336
|
type: "button",
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
337
|
+
onClick: () => c(j),
|
|
338
|
+
className: "text-[12px] font-medium text-nvr-navy underline decoration-nvr-navy/30 underline-offset-2 hover:decoration-nvr-navy focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-nvr-cyan dark:decoration-nvr-cyan/40 dark:hover:decoration-nvr-cyan",
|
|
339
|
+
children: [
|
|
340
|
+
"Show ",
|
|
341
|
+
J(j, n)
|
|
342
|
+
]
|
|
398
343
|
}
|
|
399
|
-
)
|
|
400
|
-
] })
|
|
344
|
+
)
|
|
345
|
+
] }) : /* @__PURE__ */ a("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: x.map(({ s: i, v }) => /* @__PURE__ */ a(
|
|
346
|
+
_e,
|
|
347
|
+
{
|
|
348
|
+
app: i.app ?? "admin",
|
|
349
|
+
appName: I(i.app ?? "admin"),
|
|
350
|
+
view: v,
|
|
351
|
+
showApp: k,
|
|
352
|
+
maxDwell: Y
|
|
353
|
+
},
|
|
354
|
+
i.session_id
|
|
355
|
+
)) })
|
|
401
356
|
]
|
|
402
357
|
}
|
|
403
358
|
);
|
|
404
359
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return l < 60 ? `${l}m ${t % 60}s` : `${Math.floor(l / 60)}h ${l % 60}m`;
|
|
360
|
+
function De() {
|
|
361
|
+
return /* @__PURE__ */ l("div", { className: "space-y-3", role: "status", "aria-busy": "true", "aria-label": "Loading pages visited", children: [
|
|
362
|
+
/* @__PURE__ */ a(D, { width: 160, className: "h-3.5" }),
|
|
363
|
+
[72, 54, 64, 46].map((e) => /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
364
|
+
/* @__PURE__ */ a(D, { width: 48 }),
|
|
365
|
+
/* @__PURE__ */ a(D, { width: `${e}%` }),
|
|
366
|
+
/* @__PURE__ */ a(D, { width: 40, className: "ml-auto" })
|
|
367
|
+
] }, e))
|
|
368
|
+
] });
|
|
415
369
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
370
|
+
function _e({
|
|
371
|
+
app: e,
|
|
372
|
+
appName: r,
|
|
373
|
+
view: n,
|
|
374
|
+
showApp: t,
|
|
375
|
+
maxDwell: c
|
|
376
|
+
}) {
|
|
377
|
+
const [o, u] = T(!1), s = n.rows.length > L + 2 && !o, d = s ? n.rows.slice(0, L) : n.rows;
|
|
378
|
+
return /* @__PURE__ */ l("section", { className: "py-4 first:pt-0 last:pb-0", "data-journey-session": !0, children: [
|
|
379
|
+
/* @__PURE__ */ l("header", { className: "mb-2 flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
380
|
+
/* @__PURE__ */ a("h4", { className: "text-[13px] font-semibold tabular-nums text-slate-800 dark:text-slate-100", children: he(n.start, n.end) }),
|
|
381
|
+
/* @__PURE__ */ l("p", { className: "text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400", children: [
|
|
382
|
+
U(n.seconds) || "under a minute",
|
|
383
|
+
" · ",
|
|
384
|
+
n.views,
|
|
385
|
+
" page view",
|
|
386
|
+
n.views === 1 ? "" : "s"
|
|
387
|
+
] }),
|
|
388
|
+
t && /* @__PURE__ */ a(
|
|
389
|
+
"span",
|
|
390
|
+
{
|
|
391
|
+
className: "ml-auto rounded bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
392
|
+
"data-journey-app": e,
|
|
393
|
+
children: r
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
] }),
|
|
397
|
+
/* @__PURE__ */ a("ol", { className: "-mx-2", children: d.map((m) => /* @__PURE__ */ a(
|
|
398
|
+
Ce,
|
|
399
|
+
{
|
|
400
|
+
row: m,
|
|
401
|
+
maxDwell: c,
|
|
402
|
+
appName: r
|
|
403
|
+
},
|
|
404
|
+
`${m.start}-${m.label.key}`
|
|
405
|
+
)) }),
|
|
406
|
+
(s || n.skipped > 0) && /* @__PURE__ */ l("div", { className: "mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px]", children: [
|
|
407
|
+
s && /* @__PURE__ */ l(
|
|
408
|
+
"button",
|
|
409
|
+
{
|
|
410
|
+
type: "button",
|
|
411
|
+
onClick: () => u(!0),
|
|
412
|
+
className: "font-medium text-nvr-navy hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-nvr-cyan",
|
|
413
|
+
children: [
|
|
414
|
+
"Show ",
|
|
415
|
+
n.rows.length - L,
|
|
416
|
+
" more"
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
n.skipped > 0 && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-slate-400", "data-journey-skipped": !0, children: n.skipped === 1 ? "1 page open for less than a second isn’t shown" : `${n.skipped} pages open for less than a second aren’t shown` })
|
|
421
|
+
] })
|
|
422
|
+
] });
|
|
420
423
|
}
|
|
421
|
-
function
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
424
|
+
function Ce({
|
|
425
|
+
row: e,
|
|
426
|
+
maxDwell: r,
|
|
427
|
+
appName: n
|
|
428
|
+
}) {
|
|
429
|
+
var k;
|
|
430
|
+
const t = te(), { urlFor: c, open: o } = ae(), u = fe(), s = e.label, d = (p) => t.consoleUrl ? t.consoleUrl(p) : p;
|
|
431
|
+
let m = null, y = null;
|
|
432
|
+
if (s.record) {
|
|
433
|
+
const p = { collection: s.record.collection, itemId: s.record.id };
|
|
434
|
+
m = c(p), y = () => o(p);
|
|
435
|
+
} else s.queue_id ? m = d(`/queues/${encodeURIComponent(s.queue_id)}`) : s.person_id ? m = u(s.person_id) : e.app === "admin" && s.kind !== "record" && ce(e.path) && (m = d(e.path));
|
|
436
|
+
const b = [s.kind === "record" || s.kind === "new-record" || ((k = s.section) == null ? void 0 : k.toLowerCase()) === n.toLowerCase() ? null : s.section, ...e.details, e.visits > 1 ? `${e.visits} visits` : null].filter(
|
|
437
|
+
Boolean
|
|
438
|
+
), h = (e.seconds ?? 0) >= Se, w = (e.seconds ?? 0) >= 60 ? Math.max(15, Math.round(Math.sqrt((e.seconds ?? 0) / r) * 100)) : 0, S = /* @__PURE__ */ a("span", { className: "line-clamp-2 break-words", children: s.title });
|
|
439
|
+
return /* @__PURE__ */ l(
|
|
440
|
+
"li",
|
|
433
441
|
{
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
hint: "Their path through the admin and the portal, per session — kept 30 days",
|
|
437
|
-
testId: "journey",
|
|
442
|
+
className: "grid grid-cols-[52px_minmax(0,1fr)_auto] items-start gap-x-2 rounded-md px-2 py-1.5 hover:bg-slate-50 dark:hover:bg-muted/40",
|
|
443
|
+
"data-journey-row": s.kind,
|
|
438
444
|
children: [
|
|
439
|
-
|
|
440
|
-
"
|
|
445
|
+
/* @__PURE__ */ a(
|
|
446
|
+
"time",
|
|
441
447
|
{
|
|
442
|
-
|
|
443
|
-
"
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
/* @__PURE__ */ e("ol", { className: "relative ml-2 border-l border-slate-200 dark:border-border", children: o.steps.map((h, n) => {
|
|
493
|
-
const f = (h.app ?? "admin") === "admin" && h.path.startsWith("/") && !h.path.startsWith("//") && !h.path.includes(":") ? _(h.path) : null;
|
|
494
|
-
return /* @__PURE__ */ s("li", { className: "relative py-1 pl-4", children: [
|
|
495
|
-
/* @__PURE__ */ e("span", { className: "absolute -left-[3.5px] top-[13px] h-1.5 w-1.5 rounded-full bg-nvr-cyan" }),
|
|
496
|
-
/* @__PURE__ */ s("div", { className: "flex items-baseline gap-2", children: [
|
|
497
|
-
f ? /* @__PURE__ */ e(
|
|
498
|
-
"a",
|
|
499
|
-
{
|
|
500
|
-
href: f,
|
|
501
|
-
onClick: (k) => {
|
|
502
|
-
k.metaKey || k.ctrlKey || (k.preventDefault(), p.navigate(f));
|
|
503
|
-
},
|
|
504
|
-
className: "truncate text-[12.5px] text-slate-700 hover:text-nvr-navy hover:underline dark:text-slate-300 dark:hover:text-nvr-cyan",
|
|
505
|
-
children: I(h.path)
|
|
506
|
-
}
|
|
507
|
-
) : /* @__PURE__ */ e("span", { className: "truncate text-[12.5px] text-slate-700 dark:text-slate-300", children: I(h.path) }),
|
|
508
|
-
/* @__PURE__ */ s("span", { className: "shrink-0 text-[10.5px] tabular-nums text-slate-400", children: [
|
|
509
|
-
new Date(h.entered_at).toLocaleTimeString(void 0, {
|
|
510
|
-
hour: "2-digit",
|
|
511
|
-
minute: "2-digit"
|
|
512
|
-
}),
|
|
513
|
-
h.duration_seconds != null && ` · ${ie(h.duration_seconds)}`
|
|
514
|
-
] })
|
|
515
|
-
] })
|
|
516
|
-
] }, `${h.entered_at}-${n}`);
|
|
517
|
-
}) })
|
|
518
|
-
] }, o.session_id)) })
|
|
448
|
+
dateTime: e.start,
|
|
449
|
+
className: "pt-px text-[11.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
450
|
+
children: xe(e.start)
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ l("div", { className: "min-w-0", children: [
|
|
454
|
+
m ? /* @__PURE__ */ a(
|
|
455
|
+
"a",
|
|
456
|
+
{
|
|
457
|
+
href: m,
|
|
458
|
+
onClick: (p) => {
|
|
459
|
+
p.metaKey || p.ctrlKey || p.shiftKey || p.button !== 0 || (p.preventDefault(), y ? y() : m && t.navigate(m));
|
|
460
|
+
},
|
|
461
|
+
className: "block text-[12.5px] font-medium leading-snug text-slate-800 underline-offset-2 hover:text-nvr-navy hover:underline focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-100 dark:hover:text-nvr-cyan",
|
|
462
|
+
children: S
|
|
463
|
+
}
|
|
464
|
+
) : /* @__PURE__ */ a(
|
|
465
|
+
"span",
|
|
466
|
+
{
|
|
467
|
+
className: f(
|
|
468
|
+
"block text-[12.5px] leading-snug",
|
|
469
|
+
s.record || s.kind === "page" || s.kind === "list" || s.queue_id || s.person_id ? "font-medium text-slate-800 dark:text-slate-100" : "text-slate-600 dark:text-slate-300"
|
|
470
|
+
),
|
|
471
|
+
children: S
|
|
472
|
+
}
|
|
473
|
+
),
|
|
474
|
+
b.length > 0 && /* @__PURE__ */ a("p", { className: "mt-0.5 truncate text-[11px] text-slate-500 dark:text-slate-400", children: b.join(" · ") })
|
|
475
|
+
] }),
|
|
476
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2 pt-px", children: [
|
|
477
|
+
/* @__PURE__ */ a("span", { "aria-hidden": !0, className: "hidden h-1 w-8 justify-end sm:flex", children: w > 0 && /* @__PURE__ */ a(
|
|
478
|
+
"span",
|
|
479
|
+
{
|
|
480
|
+
className: f(
|
|
481
|
+
"h-1 rounded-full",
|
|
482
|
+
h ? "bg-slate-500 dark:bg-slate-400" : "bg-slate-300 dark:bg-slate-600"
|
|
483
|
+
),
|
|
484
|
+
style: { width: `${w}%` }
|
|
485
|
+
}
|
|
486
|
+
) }),
|
|
487
|
+
/* @__PURE__ */ a(
|
|
488
|
+
"span",
|
|
489
|
+
{
|
|
490
|
+
className: f(
|
|
491
|
+
"min-w-[44px] text-right text-[11.5px] tabular-nums",
|
|
492
|
+
h ? "font-semibold text-slate-800 dark:text-slate-100" : "text-slate-500 dark:text-slate-400"
|
|
493
|
+
),
|
|
494
|
+
children: e.seconds != null ? U(e.seconds) : e.open ? "still open" : ""
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
] })
|
|
519
498
|
]
|
|
520
499
|
}
|
|
521
500
|
);
|
|
522
501
|
}
|
|
523
|
-
function
|
|
524
|
-
var
|
|
525
|
-
const
|
|
526
|
-
return /* @__PURE__ */
|
|
527
|
-
|
|
502
|
+
function Pe({ profile: e }) {
|
|
503
|
+
var n;
|
|
504
|
+
const r = ((n = e.admin) == null ? void 0 : n.logins) ?? [];
|
|
505
|
+
return /* @__PURE__ */ a(
|
|
506
|
+
E,
|
|
528
507
|
{
|
|
529
|
-
icon: /* @__PURE__ */
|
|
508
|
+
icon: /* @__PURE__ */ a(Q, { className: "h-4 w-4" }),
|
|
530
509
|
title: "Sign-ins",
|
|
531
|
-
hint:
|
|
510
|
+
hint: e.admin ? `${e.admin.sessions} live session${e.admin.sessions === 1 ? "" : "s"} · ${e.admin.activity_30d.toLocaleString()} actions in 30 days` : void 0,
|
|
532
511
|
testId: "sign-ins",
|
|
533
|
-
children:
|
|
512
|
+
children: r.length === 0 ? /* @__PURE__ */ a(F, { children: "No sign-in recorded yet." }) : /* @__PURE__ */ a("ul", { className: "space-y-1.5", children: r.map((t) => /* @__PURE__ */ l(
|
|
534
513
|
"li",
|
|
535
514
|
{
|
|
536
515
|
className: "flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[12px] text-slate-600 dark:text-slate-300",
|
|
537
516
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
|
|
541
|
-
|
|
517
|
+
/* @__PURE__ */ a("span", { title: ne(t.at), children: se(t.at) }),
|
|
518
|
+
/* @__PURE__ */ a("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300", children: t.method }),
|
|
519
|
+
t.ip && /* @__PURE__ */ a("span", { className: "font-mono text-[11px] text-slate-400", children: t.ip }),
|
|
520
|
+
t.new_ip && /* @__PURE__ */ a("span", { className: "rounded-full bg-amber-50 px-1.5 py-px text-[10.5px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400", children: "new address" })
|
|
542
521
|
]
|
|
543
522
|
},
|
|
544
|
-
|
|
523
|
+
t.at
|
|
545
524
|
)) })
|
|
546
525
|
}
|
|
547
526
|
);
|
|
548
527
|
}
|
|
549
528
|
export {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
ie as fmtDuration,
|
|
557
|
-
I as pageLabel
|
|
529
|
+
Be as JourneyCard,
|
|
530
|
+
Pe as SignInsCard,
|
|
531
|
+
Re as StatsCard,
|
|
532
|
+
ke as fetchJourneyDays,
|
|
533
|
+
U as fmtDuration,
|
|
534
|
+
Je as pageLabel
|
|
558
535
|
};
|