@nivaro/react 0.2.56 → 0.3.1
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/components/slots/TasksSlot.js +31 -29
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +414 -1
- package/dist/index.js +767 -716
- package/dist/shared/components/ClientChaosToolbar.js +410 -0
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/LoadErrorNote.js +49 -0
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/PretendDown.js +258 -0
- package/dist/shared/components/ProfileView.js +208 -184
- package/dist/shared/components/QueryErrorState.js +16 -0
- package/dist/shared/components/ReportView.js +1351 -1338
- package/dist/shared/components/WidgetSlot.js +438 -418
- package/dist/shared/components/ai/AiPlanCard.js +427 -0
- package/dist/shared/components/ai/AiPlanChanges.js +117 -0
- package/dist/shared/components/ai/TaskDo.js +1022 -0
- package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
- package/dist/shared/components/chaos/DrillBanner.js +119 -0
- package/dist/shared/components/chaos/DrillTag.js +62 -0
- package/dist/shared/components/chaos/GameDayStrip.js +61 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
- package/dist/shared/components/chat/ChatPanel.js +1356 -1317
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
- package/dist/shared/components/chat/chat-core.js +273 -264
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
- package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
- package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
- package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
- package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
- package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
- package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
- package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
- package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
- package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
- package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
- package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
- package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
- package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
- package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
- package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
- package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
- package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
- package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
- package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
- package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
- package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
- package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
- package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
- package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
- package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
- package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
- package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
- package/dist/shared/components/client-chaos-gate.js +51 -0
- package/dist/shared/components/integrations/console/SignalCard.js +172 -167
- package/dist/shared/components/item-edit/GroupSection.js +1 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
- package/dist/shared/components/item-edit/UserChip.js +145 -142
- package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
- package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
- package/dist/shared/components/pipeline/TeamsView.js +184 -169
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/client-chaos.js +359 -0
- package/dist/shared/lib/load-error.js +26 -0
- package/dist/shared/lib/notification-sound.js +25 -16
- package/dist/shared/lib/socket-realtime.js +31 -30
- package/dist/shared/lib/worker-socket.js +108 -89
- package/package.json +2 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as y, useQuery as x } from "@tanstack/react-query";
|
|
3
|
+
import { Siren as w } from "lucide-react";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
|
+
import { useNivaroClient as k } from "../../context.js";
|
|
6
|
+
import { post as N } from "../../lib/commands.js";
|
|
7
|
+
import { cn as l } from "../../lib/utils.js";
|
|
8
|
+
const u = ["chaos-declared-at"];
|
|
9
|
+
function F({ className: a }) {
|
|
10
|
+
const m = k(), [b, n] = i(!1), [o, s] = i(!1), p = y(), { data: d = null } = x({
|
|
11
|
+
queryKey: u,
|
|
12
|
+
queryFn: () => null,
|
|
13
|
+
enabled: !1,
|
|
14
|
+
staleTime: Number.POSITIVE_INFINITY
|
|
15
|
+
}), [h, c] = i(!1), f = async () => {
|
|
16
|
+
var r;
|
|
17
|
+
s(!0), c(!1);
|
|
18
|
+
try {
|
|
19
|
+
const v = await m.request(N("/chaos/declare", {}));
|
|
20
|
+
p.setQueryData(u, ((r = v.data) == null ? void 0 : r.at) ?? (/* @__PURE__ */ new Date()).toISOString()), n(!1);
|
|
21
|
+
} catch {
|
|
22
|
+
c(!0);
|
|
23
|
+
} finally {
|
|
24
|
+
s(!1);
|
|
25
|
+
}
|
|
26
|
+
}, g = (r) => new Date(r).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
27
|
+
return b ? /* @__PURE__ */ t("span", { className: l("inline-flex items-center gap-1.5 text-[12px]", a), children: [
|
|
28
|
+
/* @__PURE__ */ e("span", { className: "whitespace-nowrap opacity-80", children: "Declare an incident now?" }),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
type: "button",
|
|
33
|
+
disabled: o,
|
|
34
|
+
onClick: () => void f(),
|
|
35
|
+
className: "h-7 whitespace-nowrap rounded-md border border-red-300 bg-white px-2.5 font-medium text-red-700 transition-colors duration-150 hover:border-red-400 hover:bg-red-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-400 disabled:opacity-40 dark:border-red-800 dark:bg-red-950/60 dark:text-red-200 dark:hover:border-red-700 dark:hover:bg-red-900/50",
|
|
36
|
+
children: o ? "Declaring…" : "Declare now"
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
disabled: o,
|
|
44
|
+
onClick: () => n(!1),
|
|
45
|
+
className: "h-7 whitespace-nowrap rounded-md px-2 opacity-80 transition-colors duration-150 hover:bg-black/[0.05] hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-white/[0.08]",
|
|
46
|
+
children: "Cancel"
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
h && /* @__PURE__ */ e("span", { role: "alert", className: "font-medium text-red-700 dark:text-red-400", children: "Not recorded — try again" })
|
|
50
|
+
] }) : /* @__PURE__ */ t("span", { className: l("inline-flex items-center gap-2 text-[12px]", a), children: [
|
|
51
|
+
/* @__PURE__ */ t(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: () => n(!0),
|
|
56
|
+
"data-tip": "Mark the moment you noticed something wrong",
|
|
57
|
+
className: "inline-flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-slate-200 bg-white px-2.5 font-medium text-slate-700 transition-colors duration-150 hover:border-red-300 hover:text-red-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:border-border dark:bg-card dark:text-foreground dark:hover:border-red-800 dark:hover:text-red-400",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ e(w, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
60
|
+
"Declare incident"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
d && /* @__PURE__ */ t("span", { role: "status", className: "whitespace-nowrap opacity-75", children: [
|
|
65
|
+
"Declared at ",
|
|
66
|
+
g(d)
|
|
67
|
+
] })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
F as DeclareIncidentButton
|
|
72
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as l, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as x, useQuery as v } from "@tanstack/react-query";
|
|
3
|
+
import { useState as w, useEffect as _ } from "react";
|
|
4
|
+
import { useNavigation as y, useOptionalNivaroClient as N } from "../../context.js";
|
|
5
|
+
import { get as k } from "../../lib/commands.js";
|
|
6
|
+
import { useLiveAvailable as D, useLiveEvent as I } from "../../lib/live.js";
|
|
7
|
+
import { DeclareIncidentButton as S } from "./DeclareIncidentButton.js";
|
|
8
|
+
import { GameDayStrip as A, useActiveGamedays as q } from "./GameDayStrip.js";
|
|
9
|
+
const m = ["chaos-armed"];
|
|
10
|
+
function f() {
|
|
11
|
+
const r = N(), o = x(), t = D(), { data: e } = v({
|
|
12
|
+
queryKey: m,
|
|
13
|
+
queryFn: () => r.request(k("/chaos/armed")).then((a) => a.data ?? { allowed: !1, armed: [] }).catch(() => ({ allowed: !1, armed: [] })),
|
|
14
|
+
enabled: !!r,
|
|
15
|
+
staleTime: 15e3,
|
|
16
|
+
refetchInterval: (a) => {
|
|
17
|
+
const d = a.state.data;
|
|
18
|
+
return d && !d.allowed ? !1 : t ? 12e4 : 3e4;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return I(
|
|
22
|
+
"chaos:armed",
|
|
23
|
+
(a) => {
|
|
24
|
+
Array.isArray(a == null ? void 0 : a.armed) ? o.setQueryData(m, { allowed: !0, armed: a.armed }) : o.invalidateQueries({ queryKey: m });
|
|
25
|
+
},
|
|
26
|
+
{ includeOwn: !0, enabled: !!r && (e == null ? void 0 : e.allowed) !== !1 }
|
|
27
|
+
), { allowed: (e == null ? void 0 : e.allowed) ?? !0, armed: (e == null ? void 0 : e.armed) ?? [], ready: !!e };
|
|
28
|
+
}
|
|
29
|
+
function E(r, o = Date.now()) {
|
|
30
|
+
const t = Math.max(0, Math.round((r - o) / 1e3));
|
|
31
|
+
return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
|
|
32
|
+
}
|
|
33
|
+
function B() {
|
|
34
|
+
const { armed: r, allowed: o } = f(), t = q(o);
|
|
35
|
+
return r.some((e) => e.ends_at > Date.now()) || t.some((e) => e.status === "running");
|
|
36
|
+
}
|
|
37
|
+
function K({ stopHref: r = "/chaos", canStop: o = !1 }) {
|
|
38
|
+
const { armed: t, allowed: e } = f(), { navigate: a, consoleUrl: d } = y(), [p, h] = w(() => Date.now()), s = t.filter((n) => n.ends_at > p);
|
|
39
|
+
if (_(() => {
|
|
40
|
+
if (!t.length) return;
|
|
41
|
+
const n = setInterval(() => h(Date.now()), 1e3);
|
|
42
|
+
return () => clearInterval(n);
|
|
43
|
+
}, [t.length]), s.length === 0) return /* @__PURE__ */ l(A, { enabled: e });
|
|
44
|
+
const c = s[0], u = d ? d(r) : r, g = s.reduce((n, b) => Math.min(n, b.ends_at), Number.POSITIVE_INFINITY);
|
|
45
|
+
return /* @__PURE__ */ i(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
role: "status",
|
|
49
|
+
"aria-live": "polite",
|
|
50
|
+
"data-drill-banner": !0,
|
|
51
|
+
"data-nvr-recording-hide": !0,
|
|
52
|
+
className: "relative flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-red-200 bg-red-50 px-4 py-1.5 text-[12.5px] text-red-900 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200",
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ l(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
"aria-hidden": !0,
|
|
58
|
+
className: "pointer-events-none absolute inset-x-0 top-0 h-[3px] bg-[repeating-linear-gradient(135deg,rgb(239_68_68)_0_8px,transparent_8px_16px)] opacity-70 dark:bg-[repeating-linear-gradient(135deg,rgb(248_113_113)_0_8px,transparent_8px_16px)]"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ i("span", { className: "flex min-w-0 items-start gap-2 font-medium", children: [
|
|
62
|
+
/* @__PURE__ */ i("span", { className: "relative mt-[5px] flex h-2 w-2 shrink-0", "aria-hidden": !0, children: [
|
|
63
|
+
/* @__PURE__ */ l("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-red-400 opacity-75 motion-reduce:animate-none" }),
|
|
64
|
+
/* @__PURE__ */ l("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-red-500" })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ i("span", { className: "min-w-0", children: [
|
|
67
|
+
"Drill running: ",
|
|
68
|
+
c.label,
|
|
69
|
+
/* @__PURE__ */ i("span", { className: "font-normal", children: [
|
|
70
|
+
" on ",
|
|
71
|
+
c.target
|
|
72
|
+
] }),
|
|
73
|
+
s.length > 1 && /* @__PURE__ */ i(
|
|
74
|
+
"span",
|
|
75
|
+
{
|
|
76
|
+
className: "font-normal underline decoration-red-300 decoration-dotted underline-offset-2 dark:decoration-red-700",
|
|
77
|
+
"data-tip": s.slice(1).map((n) => `${n.label} on ${n.target}`).join(" · "),
|
|
78
|
+
children: [
|
|
79
|
+
" ",
|
|
80
|
+
"and ",
|
|
81
|
+
s.length - 1,
|
|
82
|
+
" more fault",
|
|
83
|
+
s.length > 2 ? "s" : ""
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ i("span", { className: "min-w-0 text-red-800/80 dark:text-red-300/80", children: [
|
|
90
|
+
c.started_by_name ? `started by ${c.started_by_name} · ` : "",
|
|
91
|
+
"ends in ",
|
|
92
|
+
/* @__PURE__ */ l("span", { className: "tabular-nums", children: E(g, p) }),
|
|
93
|
+
" · ",
|
|
94
|
+
"this is a planned test, not an outage"
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ l(S, { className: "ml-auto" }),
|
|
97
|
+
o && u && /* @__PURE__ */ l(
|
|
98
|
+
"a",
|
|
99
|
+
{
|
|
100
|
+
href: u,
|
|
101
|
+
onClick: (n) => {
|
|
102
|
+
/^https?:/i.test(u) || (n.preventDefault(), a(u));
|
|
103
|
+
},
|
|
104
|
+
"data-tip": "Open the chaos console to stop it",
|
|
105
|
+
className: "inline-flex h-7 shrink-0 items-center rounded-md border border-red-300 bg-white px-2.5 text-[12px] font-medium text-red-700 transition-colors duration-150 hover:border-red-400 hover:bg-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-400 dark:border-red-800 dark:bg-red-950/60 dark:text-red-200 dark:hover:border-red-700 dark:hover:bg-red-900/50",
|
|
106
|
+
children: "Stop"
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
m as ARMED_FAULTS_KEY,
|
|
115
|
+
K as DrillBanner,
|
|
116
|
+
E as drillCountdown,
|
|
117
|
+
f as useArmedFaults,
|
|
118
|
+
B as useDrillBannerShowing
|
|
119
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as c } from "@tanstack/react-query";
|
|
3
|
+
import { FlaskConical as u } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as m } from "../../context.js";
|
|
5
|
+
import { get as f } from "../../lib/commands.js";
|
|
6
|
+
import { cn as h } from "../../lib/utils.js";
|
|
7
|
+
const p = ["chaos", "drill-windows"];
|
|
8
|
+
function y(e, t, a = Date.now()) {
|
|
9
|
+
if (!(e != null && e.length)) return null;
|
|
10
|
+
const r = t == null ? a : t instanceof Date ? t.getTime() : new Date(t).getTime();
|
|
11
|
+
if (!Number.isFinite(r)) return null;
|
|
12
|
+
let l = null;
|
|
13
|
+
for (const i of e) {
|
|
14
|
+
const n = Date.parse(i.started_at), o = i.ended_at ? Date.parse(i.ended_at) : a;
|
|
15
|
+
r >= n && r <= o + 6e4 && (!l || n > Date.parse(l.started_at)) && (l = i);
|
|
16
|
+
}
|
|
17
|
+
return l;
|
|
18
|
+
}
|
|
19
|
+
function I() {
|
|
20
|
+
const e = m(), { data: t } = c({
|
|
21
|
+
queryKey: p,
|
|
22
|
+
queryFn: () => e.request(f("/chaos/drill-windows")).then((a) => a.data ?? []).catch(() => []),
|
|
23
|
+
staleTime: 3e4,
|
|
24
|
+
refetchInterval: 6e4,
|
|
25
|
+
retry: !1
|
|
26
|
+
});
|
|
27
|
+
return t ?? [];
|
|
28
|
+
}
|
|
29
|
+
const b = {
|
|
30
|
+
drill: "chaos drill",
|
|
31
|
+
monkey: "Chaos Monkey drill",
|
|
32
|
+
gameday: "game day",
|
|
33
|
+
ci: "CI drill"
|
|
34
|
+
};
|
|
35
|
+
function N({
|
|
36
|
+
windows: e,
|
|
37
|
+
at: t,
|
|
38
|
+
className: a
|
|
39
|
+
}) {
|
|
40
|
+
const r = y(e, t);
|
|
41
|
+
return r ? /* @__PURE__ */ s(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"data-drill-tag": r.run_id,
|
|
45
|
+
"data-tip": `Fired during the ${b[r.kind] ?? "chaos drill"} “${r.label}”. It may or may not be caused by it; everyone who normally hears about it was told.`,
|
|
46
|
+
className: h(
|
|
47
|
+
"inline-flex shrink-0 items-center gap-1 rounded border border-dashed border-violet-300 bg-violet-50 px-1.5 py-px text-[10.5px] font-medium text-violet-800 dark:border-violet-500/40 dark:bg-violet-500/10 dark:text-violet-300",
|
|
48
|
+
a
|
|
49
|
+
),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ d(u, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
52
|
+
"Drill"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
) : null;
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
p as DRILL_WINDOWS_KEY,
|
|
59
|
+
N as DrillTag,
|
|
60
|
+
y as drillAt,
|
|
61
|
+
I as useDrillWindows
|
|
62
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as t, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as o } from "@tanstack/react-query";
|
|
3
|
+
import { CalendarClock as i } from "lucide-react";
|
|
4
|
+
import { useOptionalNivaroClient as d } from "../../context.js";
|
|
5
|
+
import { get as l } from "../../lib/commands.js";
|
|
6
|
+
import { DeclareIncidentButton as c } from "./DeclareIncidentButton.js";
|
|
7
|
+
const m = ["chaos-gamedays-active"];
|
|
8
|
+
function u(a = !0) {
|
|
9
|
+
const e = d(), { data: r } = o({
|
|
10
|
+
queryKey: m,
|
|
11
|
+
queryFn: () => e.request(l("/chaos/gamedays/active")).then((n) => n.data ?? []).catch(() => []),
|
|
12
|
+
enabled: !!e && a,
|
|
13
|
+
staleTime: 3e4,
|
|
14
|
+
refetchInterval: 6e4
|
|
15
|
+
});
|
|
16
|
+
return r ?? [];
|
|
17
|
+
}
|
|
18
|
+
const p = {
|
|
19
|
+
lead: "You lead it",
|
|
20
|
+
scribe: "You are the scribe",
|
|
21
|
+
responder: "You are a responder"
|
|
22
|
+
};
|
|
23
|
+
function v({ enabled: a = !0 }) {
|
|
24
|
+
const e = u(a).filter((n) => n.status === "running");
|
|
25
|
+
if (!e.length) return null;
|
|
26
|
+
const r = e[0];
|
|
27
|
+
return /* @__PURE__ */ t(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "status",
|
|
31
|
+
"data-gameday-strip": !0,
|
|
32
|
+
"data-nvr-recording-hide": !0,
|
|
33
|
+
className: "flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-slate-200 bg-slate-50 px-4 py-1.5 text-[12.5px] text-slate-800 dark:border-border dark:bg-muted/40 dark:text-foreground",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ t("span", { className: "flex min-w-0 items-center gap-2 font-medium", children: [
|
|
36
|
+
/* @__PURE__ */ s(
|
|
37
|
+
i,
|
|
38
|
+
{
|
|
39
|
+
className: "h-3.5 w-3.5 shrink-0 text-nvr-navy dark:text-nvr-cyan",
|
|
40
|
+
"aria-hidden": !0
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ t("span", { className: "min-w-0", children: [
|
|
44
|
+
"Game day in progress: ",
|
|
45
|
+
r.title
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: [
|
|
49
|
+
p[r.role],
|
|
50
|
+
e.length > 1 ? ` · ${e.length - 1} more running` : ""
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ s(c, { className: "ml-auto" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
m as ACTIVE_GAMEDAYS_KEY,
|
|
59
|
+
v as GameDayStrip,
|
|
60
|
+
u as useActiveGamedays
|
|
61
|
+
};
|
|
@@ -8,13 +8,14 @@ import { cn as v, formatDateTime as f, formatRelative as V } from "../../lib/uti
|
|
|
8
8
|
import { TipLayer as ue } from "../TipLayer.js";
|
|
9
9
|
import { ChannelsAdminTab as ge } from "./ChannelArchive.js";
|
|
10
10
|
import { useUserSearch as ke } from "./chat-core.js";
|
|
11
|
+
import { HuddleAnalyticsTab as Ne } from "./HuddleAnalyticsTab.js";
|
|
11
12
|
const U = {
|
|
12
13
|
dm: "Direct message",
|
|
13
14
|
group: "Group conversation",
|
|
14
15
|
channel: "Channel",
|
|
15
16
|
general: "General",
|
|
16
17
|
record: "Record room"
|
|
17
|
-
},
|
|
18
|
+
}, fe = {
|
|
18
19
|
dm: "DM",
|
|
19
20
|
group: "Group",
|
|
20
21
|
channel: "Channel",
|
|
@@ -135,7 +136,7 @@ function Y({
|
|
|
135
136
|
] }, r.room)) })
|
|
136
137
|
] });
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function ve({ onOpenRoom: s }) {
|
|
139
140
|
const i = z(), [o, h] = b(30), { data: r, isLoading: a, isError: p, refetch: u, isFetching: c } = K({
|
|
140
141
|
queryKey: ["nvr-chat-analytics", o],
|
|
141
142
|
queryFn: () => i.request(A("/chat/admin/analytics", { days: o })).then((d) => d.data),
|
|
@@ -379,13 +380,13 @@ function ee(s) {
|
|
|
379
380
|
return s.kind === "group" && s.participant_count ? `${s.room_label} · ${s.participant_count} people` : s.room_label;
|
|
380
381
|
}
|
|
381
382
|
function te({ kind: s }) {
|
|
382
|
-
return /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 rounded border border-slate-200 px-1.5 text-[10.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300", children:
|
|
383
|
+
return /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 rounded border border-slate-200 px-1.5 text-[10.5px] font-medium text-slate-600 dark:border-border dark:text-slate-300", children: fe[s] });
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
+
function ye({
|
|
385
386
|
room: s,
|
|
386
387
|
onRoomChange: i
|
|
387
388
|
}) {
|
|
388
|
-
const o = z(), [h, r] = b(null), [a, p] = b(null), [u, c] = b([]), [m, n] = b(""), [x, y] = b(""), [d, k] = b(""), [w, _] = b(""), [E, ae] = b(!1), [W, se] = b(!1), [M, F] = b(1), [D, R] = b(null), I = 50,
|
|
389
|
+
const o = z(), [h, r] = b(null), [a, p] = b(null), [u, c] = b([]), [m, n] = b(""), [x, y] = b(""), [d, k] = b(""), [w, _] = b(""), [E, ae] = b(!1), [W, se] = b(!1), [M, F] = b(1), [D, R] = b(null), I = 50, H = {
|
|
389
390
|
...h ? { sender: h.id } : {},
|
|
390
391
|
...a ? { participant: a.id } : {},
|
|
391
392
|
...s ? { room: s.room } : {},
|
|
@@ -398,10 +399,10 @@ function ve({
|
|
|
398
399
|
page: M,
|
|
399
400
|
limit: I
|
|
400
401
|
}, { data: $, isLoading: j, isError: re, isFetching: le } = K({
|
|
401
|
-
queryKey: ["nvr-chat-admin-messages",
|
|
402
|
-
queryFn: () => o.request(A("/chat/admin/messages",
|
|
402
|
+
queryKey: ["nvr-chat-admin-messages", H],
|
|
403
|
+
queryFn: () => o.request(A("/chat/admin/messages", H)),
|
|
403
404
|
placeholderData: (l) => l
|
|
404
|
-
}),
|
|
405
|
+
}), G = ($ == null ? void 0 : $.data) ?? [], T = ($ == null ? void 0 : $.total) ?? 0, L = Math.max(1, Math.ceil(T / I)), N = () => F(1);
|
|
405
406
|
return /* @__PURE__ */ t("div", { className: "space-y-3", children: [
|
|
406
407
|
/* @__PURE__ */ t(
|
|
407
408
|
"p",
|
|
@@ -598,14 +599,14 @@ function ve({
|
|
|
598
599
|
)
|
|
599
600
|
] })
|
|
600
601
|
] }),
|
|
601
|
-
re ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-red-600 dark:text-red-400", children: "Couldn't load messages." }) : !j &&
|
|
602
|
+
re ? /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12.5px] text-red-600 dark:text-red-400", children: "Couldn't load messages." }) : !j && G.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12.5px] text-slate-500 dark:text-slate-400", children: "No messages match these filters." }) : /* @__PURE__ */ t("table", { className: "w-full table-fixed text-[12.5px]", children: [
|
|
602
603
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-[0.06em] text-slate-500 dark:border-border/60 dark:text-slate-400", children: [
|
|
603
604
|
/* @__PURE__ */ e("th", { className: "w-[132px] px-3 py-1.5 font-medium", children: "When" }),
|
|
604
605
|
/* @__PURE__ */ e("th", { className: "w-[150px] px-2 py-1.5 font-medium", children: "From" }),
|
|
605
606
|
/* @__PURE__ */ e("th", { className: "w-[220px] px-2 py-1.5 font-medium", children: "Where" }),
|
|
606
607
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Message" })
|
|
607
608
|
] }) }),
|
|
608
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
609
|
+
/* @__PURE__ */ e("tbody", { children: G.map((l) => /* @__PURE__ */ t(
|
|
609
610
|
"tr",
|
|
610
611
|
{
|
|
611
612
|
onClick: () => R(l.id),
|
|
@@ -659,7 +660,7 @@ function ve({
|
|
|
659
660
|
] })
|
|
660
661
|
] }),
|
|
661
662
|
D != null && /* @__PURE__ */ e(
|
|
662
|
-
|
|
663
|
+
we,
|
|
663
664
|
{
|
|
664
665
|
id: D,
|
|
665
666
|
onClose: () => R(null),
|
|
@@ -699,7 +700,7 @@ function B({ m: s, target: i }) {
|
|
|
699
700
|
}
|
|
700
701
|
);
|
|
701
702
|
}
|
|
702
|
-
function
|
|
703
|
+
function we({
|
|
703
704
|
id: s,
|
|
704
705
|
onClose: i,
|
|
705
706
|
onRoom: o
|
|
@@ -915,14 +916,15 @@ function ye({
|
|
|
915
916
|
}
|
|
916
917
|
);
|
|
917
918
|
}
|
|
918
|
-
function
|
|
919
|
+
function qe() {
|
|
919
920
|
const [s, i] = b("overview"), [o, h] = b(null);
|
|
920
921
|
return /* @__PURE__ */ t("div", { className: "space-y-4", "data-chat-analytics": !0, children: [
|
|
921
922
|
/* @__PURE__ */ e(ue, {}),
|
|
922
923
|
/* @__PURE__ */ e("div", { className: "flex gap-1 border-b border-slate-200 dark:border-border", role: "tablist", children: [
|
|
923
924
|
["overview", "Overview"],
|
|
924
925
|
["messages", "Messages"],
|
|
925
|
-
["channels", "Channels"]
|
|
926
|
+
["channels", "Channels"],
|
|
927
|
+
["huddles", "Huddles"]
|
|
926
928
|
].map(([r, a]) => /* @__PURE__ */ e(
|
|
927
929
|
"button",
|
|
928
930
|
{
|
|
@@ -940,15 +942,15 @@ function je() {
|
|
|
940
942
|
r
|
|
941
943
|
)) }),
|
|
942
944
|
s === "overview" ? /* @__PURE__ */ e(
|
|
943
|
-
|
|
945
|
+
ve,
|
|
944
946
|
{
|
|
945
947
|
onOpenRoom: (r, a) => {
|
|
946
948
|
h({ room: r, label: a }), i("messages");
|
|
947
949
|
}
|
|
948
950
|
}
|
|
949
|
-
) : s === "channels" ? /* @__PURE__ */ e(ge, {}) : /* @__PURE__ */ e(
|
|
951
|
+
) : s === "channels" ? /* @__PURE__ */ e(ge, {}) : s === "huddles" ? /* @__PURE__ */ e(Ne, {}) : /* @__PURE__ */ e(ye, { room: o, onRoomChange: h })
|
|
950
952
|
] });
|
|
951
953
|
}
|
|
952
954
|
export {
|
|
953
|
-
|
|
955
|
+
qe as ChatAnalyticsView
|
|
954
956
|
};
|