@nivaro/react 0.3.0 → 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.
Files changed (27) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +341 -0
  4. package/dist/index.js +764 -723
  5. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  6. package/dist/shared/components/LoadErrorNote.js +49 -0
  7. package/dist/shared/components/PretendDown.js +258 -0
  8. package/dist/shared/components/ProfileView.js +54 -49
  9. package/dist/shared/components/QueryErrorState.js +16 -0
  10. package/dist/shared/components/ReportView.js +1351 -1338
  11. package/dist/shared/components/WidgetSlot.js +438 -418
  12. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  13. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  14. package/dist/shared/components/chaos/DrillTag.js +62 -0
  15. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  16. package/dist/shared/components/client-chaos-gate.js +51 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  18. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  19. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  20. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  21. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  22. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  23. package/dist/shared/lib/client-chaos.js +359 -0
  24. package/dist/shared/lib/load-error.js +26 -0
  25. package/dist/shared/lib/socket-realtime.js +31 -30
  26. package/dist/shared/lib/worker-socket.js +108 -89
  27. package/package.json +1 -1
@@ -1,28 +1,32 @@
1
- import { jsxs as a, jsx as r, Fragment as A } from "react/jsx-runtime";
2
- import { AlertOctagon as j, AlertTriangle as F, ChevronRight as B, Loader2 as K, ChevronDown as O, ExternalLink as G } from "lucide-react";
3
- import { useState as T, useMemo as V, useId as W, useRef as X } from "react";
1
+ import { jsxs as a, jsx as o, Fragment as A } from "react/jsx-runtime";
2
+ import { AlertOctagon as j, AlertTriangle as F, ChevronRight as B, Loader2 as K, ChevronDown as O, ExternalLink as W } from "lucide-react";
3
+ import { useState as L, useMemo as G, useId as V, useRef as X } from "react";
4
4
  import { useItemEditAuth as q } from "../../../context.js";
5
5
  import { cn as x, titleCase as H } from "../../../lib/utils.js";
6
6
  import { ExplainButton as J } from "../../ai/ExplainButton.js";
7
- import { useSignalAction as Q, useDismissRows as Y, useSnooze as Z } from "./api.js";
8
- import { canDrill as ee, RowDrill as te } from "./drill/index.js";
9
- import { SnoozeMenu as P, DismissButton as ne } from "./SnoozeMenu.js";
10
- import { TONE_FILL as oe, TONE_TEXT as D, agoText as re, exactTime as R, TONE_SOFT as ie, ageOf as se } from "./tone.js";
11
- const ae = ["retry_submission", "extension"], le = (t) => t.kind === "extension" ? U(t) : t.kind, U = (t) => `${t.kind}:${t.id ?? ""}`;
12
- function de(t) {
7
+ import { useDrillWindows as Q, DrillTag as Y } from "../../chaos/DrillTag.js";
8
+ import { useSignalAction as Z, useDismissRows as ee, useSnooze as te } from "./api.js";
9
+ import { canDrill as ne, RowDrill as oe } from "./drill/index.js";
10
+ import { SnoozeMenu as P, DismissButton as re } from "./SnoozeMenu.js";
11
+ import { TONE_FILL as ie, TONE_TEXT as T, agoText as se, exactTime as R, TONE_SOFT as ae, ageOf as le } from "./tone.js";
12
+ const de = ["retry_submission", "extension"], ce = (t) => t.kind === "extension" ? U(t) : t.kind, U = (t) => `${t.kind}:${t.id ?? ""}`;
13
+ function ue(t) {
13
14
  let e = null;
14
15
  for (const m of t.rows) (!e || m.first_seen < e) && (e = m.first_seen);
15
16
  return e;
16
17
  }
17
- function we({
18
+ function $e({
18
19
  signal: t,
19
20
  expanded: e,
20
21
  onToggle: m,
21
- onOpenRecord: b,
22
+ onOpenRecord: g,
22
23
  onExplain: p,
23
24
  canExplain: l
24
25
  }) {
25
- const f = t.severity === "critical", v = f ? "negative" : "warning", S = f ? j : F, y = de(t), k = t.rows[0], [N, z] = T(!1), g = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
26
+ const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ? j : F, y = ue(t), z = Q(), $ = t.rows.reduce(
27
+ (N, D) => !N || D.first_seen > N ? D.first_seen : N,
28
+ null
29
+ ), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
26
30
  return /* @__PURE__ */ a(
27
31
  "section",
28
32
  {
@@ -36,30 +40,31 @@ function we({
36
40
  type: "button",
37
41
  onClick: m,
38
42
  "aria-expanded": e,
39
- "aria-controls": g,
43
+ "aria-controls": _,
40
44
  className: "flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
41
45
  children: [
42
- /* @__PURE__ */ r(
46
+ /* @__PURE__ */ o(
43
47
  "span",
44
48
  {
45
49
  className: x(
46
50
  "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
47
- ie[v]
51
+ ae[v]
48
52
  ),
49
- "data-tip": f ? "Critical — something is failing now" : "Worth a look",
50
- children: /* @__PURE__ */ r(S, { className: x("h-3.5 w-3.5", D[v]), "aria-hidden": !0 })
53
+ "data-tip": h ? "Critical — something is failing now" : "Worth a look",
54
+ children: /* @__PURE__ */ o(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
51
55
  }
52
56
  ),
53
57
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
54
58
  /* @__PURE__ */ a("span", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
55
- /* @__PURE__ */ r("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
56
- t.error ? /* @__PURE__ */ r("span", { className: x("text-[12px] font-medium", D.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
57
- /* @__PURE__ */ r("span", { className: x("font-semibold", D[v]), children: t.count }),
59
+ /* @__PURE__ */ o("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
60
+ $ && /* @__PURE__ */ o(Y, { windows: z, at: $, className: "self-center" }),
61
+ t.error ? /* @__PURE__ */ o("span", { className: x("text-[12px] font-medium", T.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
62
+ /* @__PURE__ */ o("span", { className: x("font-semibold", T[v]), children: t.count }),
58
63
  " open",
59
64
  y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${R(y)}`, children: [
60
65
  " ",
61
66
  "· oldest ",
62
- se(y)
67
+ le(y)
63
68
  ] }),
64
69
  t.snoozed.length > 0 && /* @__PURE__ */ a(A, { children: [
65
70
  " · ",
@@ -68,9 +73,9 @@ function we({
68
73
  ] })
69
74
  ] })
70
75
  ] }),
71
- /* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${k.detail}` : ""}` : t.description })
76
+ /* @__PURE__ */ o("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${k.detail}` : ""}` : t.description })
72
77
  ] }),
73
- /* @__PURE__ */ r(
78
+ /* @__PURE__ */ o(
74
79
  B,
75
80
  {
76
81
  className: x(
@@ -83,18 +88,18 @@ function we({
83
88
  ]
84
89
  }
85
90
  ),
86
- e && /* @__PURE__ */ a("div", { id: g, className: "border-t border-border", children: [
87
- t.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]", D.negative), children: [
91
+ e && /* @__PURE__ */ a("div", { id: _, className: "border-t border-border", children: [
92
+ t.error ? /* @__PURE__ */ a("p", { className: x("px-4 py-3 text-[12.5px]", T.negative), children: [
88
93
  "Couldn't evaluate · ",
89
94
  t.error
90
95
  ] }) : /* @__PURE__ */ a(A, { children: [
91
- /* @__PURE__ */ r("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
92
- /* @__PURE__ */ r(
93
- ce,
96
+ /* @__PURE__ */ o("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
97
+ /* @__PURE__ */ o(
98
+ me,
94
99
  {
95
100
  signal: t,
96
101
  rows: t.rows,
97
- onOpenRecord: b,
102
+ onOpenRecord: g,
98
103
  onExplain: p,
99
104
  canExplain: l
100
105
  }
@@ -112,15 +117,15 @@ function we({
112
117
  "button",
113
118
  {
114
119
  type: "button",
115
- onClick: () => z(($) => !$),
116
- "aria-expanded": N,
120
+ onClick: () => C((N) => !N),
121
+ "aria-expanded": b,
117
122
  "data-ic-snoozed-fold": t.snoozed.length,
118
123
  className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12px] font-medium text-muted-foreground hover:text-foreground",
119
124
  children: [
120
- /* @__PURE__ */ r(
125
+ /* @__PURE__ */ o(
121
126
  B,
122
127
  {
123
- className: x("h-3.5 w-3.5 transition-transform", N && "rotate-90")
128
+ className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
124
129
  }
125
130
  ),
126
131
  "Snoozed (",
@@ -129,109 +134,109 @@ function we({
129
134
  ]
130
135
  }
131
136
  ),
132
- N && /* @__PURE__ */ r(me, { signal: t })
137
+ b && /* @__PURE__ */ o(fe, { signal: t })
133
138
  ] })
134
139
  ] })
135
140
  ]
136
141
  }
137
142
  );
138
143
  }
139
- function ce({
144
+ function me({
140
145
  signal: t,
141
146
  rows: e,
142
147
  onOpenRecord: m,
143
- onExplain: b,
148
+ onExplain: g,
144
149
  canExplain: p
145
150
  }) {
146
- const l = Q(), f = Y(), [v, S] = T({}), [y, k] = T(/* @__PURE__ */ new Set()), [N, z] = T(/* @__PURE__ */ new Set()), g = V(() => {
151
+ const l = Z(), h = ee(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = G(() => {
147
152
  if (!e.some((s) => s.group)) return null;
148
- const o = /* @__PURE__ */ new Map();
153
+ const r = /* @__PURE__ */ new Map();
149
154
  for (const s of e) {
150
- const i = s.group ?? "—", d = o.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
151
- d.rows.push(s), o.set(i, d);
155
+ const i = s.group ?? "—", d = r.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
156
+ d.rows.push(s), r.set(i, d);
152
157
  }
153
- return [...o.values()].sort((s, i) => i.rows.length - s.rows.length);
154
- }, [e]), $ = async (o, s) => {
158
+ return [...r.values()].sort((s, i) => i.rows.length - s.rows.length);
159
+ }, [e]), C = async (r, s) => {
155
160
  var d;
156
161
  const i = s.map((c) => c.key);
157
- k((c) => /* @__PURE__ */ new Set([...c, ...i]));
162
+ z((c) => /* @__PURE__ */ new Set([...c, ...i]));
158
163
  try {
159
- const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: o });
164
+ const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: r });
160
165
  S((n) => {
161
166
  const u = { ...n };
162
- for (const h of c) u[h.key] = h;
167
+ for (const f of c) u[f.key] = f;
163
168
  return u;
164
- }), z((n) => new Set([...n].filter((u) => !i.includes(u))));
169
+ }), k((n) => new Set([...n].filter((u) => !i.includes(u))));
165
170
  } catch (c) {
166
171
  const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? (c instanceof Error ? c.message : "The action failed");
167
172
  S((u) => {
168
- const h = { ...u };
169
- for (const w of i) h[w] = { key: w, ok: !1, message: n };
170
- return h;
173
+ const f = { ...u };
174
+ for (const w of i) f[w] = { key: w, ok: !1, message: n };
175
+ return f;
171
176
  });
172
177
  } finally {
173
- k((c) => new Set([...c].filter((n) => !i.includes(n))));
178
+ z((c) => new Set([...c].filter((n) => !i.includes(n))));
174
179
  }
175
- }, C = async (o) => {
180
+ }, _ = async (r) => {
176
181
  var i;
177
- const s = o.map((d) => d.key);
178
- k((d) => /* @__PURE__ */ new Set([...d, ...s]));
182
+ const s = r.map((d) => d.key);
183
+ z((d) => /* @__PURE__ */ new Set([...d, ...s]));
179
184
  try {
180
- await f.mutateAsync({ signal: t.id, row_keys: s }), z((d) => new Set([...d].filter((c) => !s.includes(c))));
185
+ await h.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
181
186
  } catch (d) {
182
187
  const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? (d instanceof Error ? d.message : "Could not dismiss");
183
188
  S((n) => {
184
189
  const u = { ...n };
185
- for (const h of s) u[h] = { key: h, ok: !1, message: c };
190
+ for (const f of s) u[f] = { key: f, ok: !1, message: c };
186
191
  return u;
187
192
  });
188
193
  } finally {
189
- k((d) => new Set([...d].filter((c) => !s.includes(c))));
194
+ z((d) => new Set([...d].filter((c) => !s.includes(c))));
190
195
  }
191
- }, L = (o, s) => {
196
+ }, N = (r, s) => {
192
197
  var i, d, c, n;
193
- if (o.kind === "open") {
194
- const u = ((i = o.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), h = ((c = o.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
195
- u && h && (m == null || m(u, String(h)));
198
+ if (r.kind === "open") {
199
+ const u = ((i = r.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), f = ((c = r.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
200
+ u && f && (m == null || m(u, String(f)));
196
201
  return;
197
202
  }
198
- if (o.kind === "explain") {
199
- b == null || b(o, s);
203
+ if (r.kind === "explain") {
204
+ g == null || g(r, s);
200
205
  return;
201
206
  }
202
- $(o, [s]);
203
- }, _ = (o, s) => /* @__PURE__ */ r(
204
- ue,
207
+ C(r, [s]);
208
+ }, D = (r, s) => /* @__PURE__ */ o(
209
+ pe,
205
210
  {
206
211
  signal: t,
207
- row: o,
208
- result: v[o.key],
209
- busy: y.has(o.key),
212
+ row: r,
213
+ result: v[r.key],
214
+ busy: y.has(r.key),
210
215
  selectable: s,
211
- selected: N.has(o.key),
212
- onSelect: (i) => z((d) => {
216
+ selected: $.has(r.key),
217
+ onSelect: (i) => k((d) => {
213
218
  const c = new Set(d);
214
- return i ? c.add(o.key) : c.delete(o.key), c;
219
+ return i ? c.add(r.key) : c.delete(r.key), c;
215
220
  }),
216
- onAction: (i) => L(i, o),
221
+ onAction: (i) => N(i, r),
217
222
  onOpenRecord: m,
218
223
  canExplain: p
219
224
  },
220
- o.key
225
+ r.key
221
226
  );
222
- if (!g) {
223
- const o = e.length > 0 && e.every((i) => N.has(i.key)), s = e.filter((i) => N.has(i.key));
227
+ if (!b) {
228
+ const r = e.length > 0 && e.every((i) => $.has(i.key)), s = e.filter((i) => $.has(i.key));
224
229
  return /* @__PURE__ */ a("div", { children: [
225
230
  e.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
226
- /* @__PURE__ */ r(
231
+ /* @__PURE__ */ o(
227
232
  "input",
228
233
  {
229
234
  type: "checkbox",
230
- checked: o,
235
+ checked: r,
231
236
  ref: (i) => {
232
- i && (i.indeterminate = s.length > 0 && !o);
237
+ i && (i.indeterminate = s.length > 0 && !r);
233
238
  },
234
- onChange: (i) => z(new Set(i.target.checked ? e.map((d) => d.key) : [])),
239
+ onChange: (i) => k(new Set(i.target.checked ? e.map((d) => d.key) : [])),
235
240
  "aria-label": "Select every problem",
236
241
  "data-ic-select-all": !0,
237
242
  className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
@@ -243,36 +248,36 @@ function ce({
243
248
  type: "button",
244
249
  "data-ic-bulk-action": "dismiss",
245
250
  disabled: s.some((i) => y.has(i.key)),
246
- onClick: () => void C(s),
251
+ onClick: () => void _(s),
247
252
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
248
253
  children: [
249
- s.some((i) => y.has(i.key)) && /* @__PURE__ */ r(K, { className: "h-3 w-3 animate-spin" }),
254
+ s.some((i) => y.has(i.key)) && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
250
255
  "Dismiss selected ",
251
256
  s.length
252
257
  ]
253
258
  }
254
- ) : /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
259
+ ) : /* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
255
260
  ] }),
256
- /* @__PURE__ */ r("ul", { className: "divide-y divide-border", children: e.map((i) => _(i, !0)) })
261
+ /* @__PURE__ */ o("ul", { className: "divide-y divide-border", children: e.map((i) => D(i, !0)) })
257
262
  ] });
258
263
  }
259
- return /* @__PURE__ */ r("div", { className: "pb-1", children: g.map((o) => {
260
- const s = o.rows.filter((n) => N.has(n.key)), i = o.rows.length > 0 && s.length === o.rows.length, d = /* @__PURE__ */ new Map();
264
+ return /* @__PURE__ */ o("div", { className: "pb-1", children: b.map((r) => {
265
+ const s = r.rows.filter((n) => $.has(n.key)), i = r.rows.length > 0 && s.length === r.rows.length, d = /* @__PURE__ */ new Map();
261
266
  for (const n of s) {
262
267
  const u = /* @__PURE__ */ new Set();
263
- for (const h of n.actions) {
264
- if (!ae.includes(h.kind)) continue;
265
- const w = le(h);
268
+ for (const f of n.actions) {
269
+ if (!de.includes(f.kind)) continue;
270
+ const w = ce(f);
266
271
  if (u.has(w)) continue;
267
272
  u.add(w);
268
- const M = d.get(w) ?? { action: h, rows: [] };
273
+ const M = d.get(w) ?? { action: f, rows: [] };
269
274
  M.rows.push(n), d.set(w, M);
270
275
  }
271
276
  }
272
277
  const c = s.some((n) => y.has(n.key));
273
- return /* @__PURE__ */ a("div", { "data-ic-group": o.key, className: "mt-2 first:mt-1", children: [
278
+ return /* @__PURE__ */ a("div", { "data-ic-group": r.key, className: "mt-2 first:mt-1", children: [
274
279
  /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
275
- /* @__PURE__ */ r(
280
+ /* @__PURE__ */ o(
276
281
  "input",
277
282
  {
278
283
  type: "checkbox",
@@ -280,19 +285,19 @@ function ce({
280
285
  ref: (n) => {
281
286
  n && (n.indeterminate = s.length > 0 && !i);
282
287
  },
283
- onChange: (n) => z((u) => {
284
- const h = new Set(u);
285
- for (const w of o.rows)
286
- n.target.checked ? h.add(w.key) : h.delete(w.key);
287
- return h;
288
+ onChange: (n) => k((u) => {
289
+ const f = new Set(u);
290
+ for (const w of r.rows)
291
+ n.target.checked ? f.add(w.key) : f.delete(w.key);
292
+ return f;
288
293
  }),
289
- "aria-label": `Select every problem in ${o.label}`,
290
- "data-ic-group-select": o.key,
294
+ "aria-label": `Select every problem in ${r.label}`,
295
+ "data-ic-group-select": r.key,
291
296
  className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
292
297
  }
293
298
  ),
294
- /* @__PURE__ */ r("span", { className: "text-[12.5px] font-semibold text-foreground", children: o.label }),
295
- /* @__PURE__ */ r("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: o.rows.length }),
299
+ /* @__PURE__ */ o("span", { className: "text-[12.5px] font-semibold text-foreground", children: r.label }),
300
+ /* @__PURE__ */ o("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: r.rows.length }),
296
301
  /* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1", children: [
297
302
  [...d.entries()].map(([n, u]) => /* @__PURE__ */ a(
298
303
  "button",
@@ -300,7 +305,7 @@ function ce({
300
305
  type: "button",
301
306
  "data-ic-bulk-action": u.action.kind,
302
307
  onClick: () => {
303
- $(u.action, u.rows);
308
+ C(u.action, u.rows);
304
309
  },
305
310
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted",
306
311
  children: [
@@ -317,77 +322,77 @@ function ce({
317
322
  type: "button",
318
323
  "data-ic-bulk-action": "dismiss",
319
324
  disabled: c,
320
- onClick: () => void C(s),
325
+ onClick: () => void _(s),
321
326
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
322
327
  children: [
323
- c && /* @__PURE__ */ r(K, { className: "h-3 w-3 animate-spin" }),
328
+ c && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
324
329
  "Dismiss selected ",
325
330
  s.length
326
331
  ]
327
332
  }
328
333
  ),
329
- /* @__PURE__ */ r(
334
+ /* @__PURE__ */ o(
330
335
  P,
331
336
  {
332
337
  signal: t.id,
333
338
  signalLabel: t.label,
334
- group: { key: o.key, label: o.label },
339
+ group: { key: r.key, label: r.label },
335
340
  defaultScope: "group"
336
341
  }
337
342
  )
338
343
  ] })
339
344
  ] }),
340
- /* @__PURE__ */ r("ul", { className: "divide-y divide-border", children: o.rows.map((n) => _(n, !0)) })
341
- ] }, o.key);
345
+ /* @__PURE__ */ o("ul", { className: "divide-y divide-border", children: r.rows.map((n) => D(n, !0)) })
346
+ ] }, r.key);
342
347
  }) });
343
348
  }
344
349
  function E(t) {
345
350
  return t.label ? t.label : `${H(t.collection).replace(/s$/, "")} ${t.id}`;
346
351
  }
347
- function ue({
352
+ function pe({
348
353
  signal: t,
349
354
  row: e,
350
355
  result: m,
351
- busy: b,
356
+ busy: g,
352
357
  selectable: p,
353
358
  selected: l,
354
- onSelect: f,
359
+ onSelect: h,
355
360
  onAction: v,
356
361
  onOpenRecord: S,
357
362
  canExplain: y
358
363
  }) {
359
364
  var i, d, c;
360
- const k = e.since ?? e.first_seen, N = e.actions.filter(
365
+ const z = e.since ?? e.first_seen, $ = e.actions.filter(
361
366
  (n) => !(n.kind === "open" && e.record) && !(n.kind === "explain" && (y == null ? void 0 : y(n)) === !1)
362
- ), { isAdmin: z } = q(), [g, $] = T(!1), C = W(), L = X(null), _ = ee(e.drill), o = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
367
+ ), { isAdmin: k } = q(), [b, C] = L(!1), _ = V(), N = X(null), D = ne(e.drill), r = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
363
368
  var u;
364
369
  return n.kind === "retry_submission" && n.id === ((u = e.drill) == null ? void 0 : u.id);
365
370
  }) : void 0, s = () => {
366
371
  var n;
367
- $(!1), (n = L.current) == null || n.focus();
372
+ C(!1), (n = N.current) == null || n.focus();
368
373
  };
369
374
  return /* @__PURE__ */ a(
370
375
  "li",
371
376
  {
372
377
  "data-ic-row": e.key,
373
- "data-ic-row-open": g ? "" : void 0,
374
- className: x(g && "bg-muted/30"),
378
+ "data-ic-row-open": b ? "" : void 0,
379
+ className: x(b && "bg-muted/30"),
375
380
  children: [
376
381
  /* @__PURE__ */ a("div", { className: "flex gap-3 px-4 py-2.5", children: [
377
- p && /* @__PURE__ */ r(
382
+ p && /* @__PURE__ */ o(
378
383
  "input",
379
384
  {
380
385
  type: "checkbox",
381
386
  checked: l,
382
- onChange: (n) => f(n.target.checked),
387
+ onChange: (n) => h(n.target.checked),
383
388
  "aria-label": `Select ${e.title}`,
384
389
  "data-ic-select-row": e.key,
385
390
  className: "mt-1 h-3.5 w-3.5 shrink-0 accent-[rgb(var(--nvr-cyan-rgb))]"
386
391
  }
387
392
  ),
388
393
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
389
- /* @__PURE__ */ r("p", { className: "text-[12.5px] font-medium text-foreground", children: e.title }),
390
- e.detail && /* @__PURE__ */ r(
394
+ /* @__PURE__ */ o("p", { className: "text-[12.5px] font-medium text-foreground", children: e.title }),
395
+ e.detail && /* @__PURE__ */ o(
391
396
  "p",
392
397
  {
393
398
  className: "mt-0.5 line-clamp-2 break-words text-[12px] leading-snug text-muted-foreground",
@@ -395,10 +400,10 @@ function ue({
395
400
  children: e.detail
396
401
  }
397
402
  ),
398
- /* @__PURE__ */ r(
403
+ /* @__PURE__ */ o(
399
404
  I,
400
405
  {
401
- since: k,
406
+ since: z,
402
407
  record: e.record,
403
408
  onOpenRecord: S,
404
409
  className: "mt-1 flex-wrap gap-x-2 xl:hidden"
@@ -411,15 +416,15 @@ function ue({
411
416
  "data-ic-result": m.ok ? "ok" : "failed",
412
417
  className: x(
413
418
  "mt-1 flex items-start gap-1.5 text-[12px] font-medium",
414
- D[m.ok ? "positive" : "negative"]
419
+ T[m.ok ? "positive" : "negative"]
415
420
  ),
416
421
  children: [
417
- /* @__PURE__ */ r(
422
+ /* @__PURE__ */ o(
418
423
  "span",
419
424
  {
420
425
  className: x(
421
426
  "mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",
422
- oe[m.ok ? "positive" : "negative"]
427
+ ie[m.ok ? "positive" : "negative"]
423
428
  )
424
429
  }
425
430
  ),
@@ -428,10 +433,10 @@ function ue({
428
433
  }
429
434
  )
430
435
  ] }),
431
- /* @__PURE__ */ r(
436
+ /* @__PURE__ */ o(
432
437
  I,
433
438
  {
434
- since: k,
439
+ since: z,
435
440
  record: e.record,
436
441
  onOpenRecord: S,
437
442
  className: "hidden w-[210px] shrink-0 flex-col items-start gap-0.5 pt-0.5 xl:flex",
@@ -439,30 +444,30 @@ function ue({
439
444
  }
440
445
  ),
441
446
  /* @__PURE__ */ a("div", { className: "flex shrink-0 items-start gap-1", children: [
442
- _ && /* @__PURE__ */ a(
447
+ D && /* @__PURE__ */ a(
443
448
  "button",
444
449
  {
445
- ref: L,
450
+ ref: N,
446
451
  type: "button",
447
452
  "data-ic-drill-toggle": `${(d = e.drill) == null ? void 0 : d.kind}:${(c = e.drill) == null ? void 0 : c.id}`,
448
- "aria-expanded": g,
449
- "aria-controls": g ? C : void 0,
450
- onClick: () => $((n) => !n),
453
+ "aria-expanded": b,
454
+ "aria-controls": b ? _ : void 0,
455
+ onClick: () => C((n) => !n),
451
456
  onKeyDown: (n) => {
452
- n.key === "Escape" && g && (n.preventDefault(), n.stopPropagation(), $(!1));
457
+ n.key === "Escape" && b && (n.preventDefault(), n.stopPropagation(), C(!1));
453
458
  },
454
459
  className: x(
455
460
  "inline-flex h-7 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
456
- g ? "border-[color:rgb(var(--nvr-cyan-rgb)/0.45)] bg-[color:rgb(var(--nvr-cyan-rgb)/0.10)] text-foreground dark:bg-[color:rgb(var(--nvr-cyan-rgb)/0.16)]" : "border-border bg-card text-foreground hover:bg-muted"
461
+ b ? "border-[color:rgb(var(--nvr-cyan-rgb)/0.45)] bg-[color:rgb(var(--nvr-cyan-rgb)/0.10)] text-foreground dark:bg-[color:rgb(var(--nvr-cyan-rgb)/0.16)]" : "border-border bg-card text-foreground hover:bg-muted"
457
462
  ),
458
463
  children: [
459
464
  "Details",
460
- /* @__PURE__ */ r(
465
+ /* @__PURE__ */ o(
461
466
  O,
462
467
  {
463
468
  className: x(
464
469
  "h-3 w-3 transition-transform duration-200",
465
- g && "rotate-180"
470
+ b && "rotate-180"
466
471
  ),
467
472
  "aria-hidden": !0
468
473
  }
@@ -470,23 +475,23 @@ function ue({
470
475
  ]
471
476
  }
472
477
  ),
473
- N.map((n) => /* @__PURE__ */ a(
478
+ $.map((n) => /* @__PURE__ */ a(
474
479
  "button",
475
480
  {
476
481
  type: "button",
477
482
  "data-ic-action": n.kind,
478
- disabled: b,
483
+ disabled: g,
479
484
  onClick: () => v(n),
480
485
  className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
481
486
  children: [
482
- b && n.kind !== "explain" && /* @__PURE__ */ r(K, { className: "h-3 w-3 animate-spin" }),
487
+ g && n.kind !== "explain" && /* @__PURE__ */ o(K, { className: "h-3 w-3 animate-spin" }),
483
488
  n.label
484
489
  ]
485
490
  },
486
491
  U(n)
487
492
  )),
488
- /* @__PURE__ */ r(ne, { signal: t.id, rowKey: e.key }),
489
- /* @__PURE__ */ r(
493
+ /* @__PURE__ */ o(re, { signal: t.id, rowKey: e.key }),
494
+ /* @__PURE__ */ o(
490
495
  P,
491
496
  {
492
497
  signal: t.id,
@@ -498,7 +503,7 @@ function ue({
498
503
  )
499
504
  ] })
500
505
  ] }),
501
- z && /* @__PURE__ */ r("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ r(
506
+ k && /* @__PURE__ */ o("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ o(
502
507
  J,
503
508
  {
504
509
  kind: "signal-row",
@@ -506,23 +511,23 @@ function ue({
506
511
  label: "Explain this failure"
507
512
  }
508
513
  ) }),
509
- g && _ && e.drill && // Esc anywhere inside the open drill collapses it.
510
- /* @__PURE__ */ r(
514
+ b && D && e.drill && // Esc anywhere inside the open drill collapses it.
515
+ /* @__PURE__ */ o(
511
516
  "section",
512
517
  {
513
- id: C,
518
+ id: _,
514
519
  "aria-label": `Details: ${e.title}`,
515
520
  onKeyDown: (n) => {
516
521
  n.key === "Escape" && !n.defaultPrevented && (n.stopPropagation(), s());
517
522
  },
518
523
  className: "border-t border-border pb-4 pl-11 pr-4 pt-3",
519
- children: /* @__PURE__ */ r(
520
- te,
524
+ children: /* @__PURE__ */ o(
525
+ oe,
521
526
  {
522
527
  drill: e.drill,
523
528
  onOpenRecord: S,
524
- onRetry: o ? () => v(o) : void 0,
525
- retryBusy: b
529
+ onRetry: r ? () => v(r) : void 0,
530
+ retryBusy: g
526
531
  }
527
532
  )
528
533
  }
@@ -535,16 +540,16 @@ function I({
535
540
  since: t,
536
541
  record: e,
537
542
  onOpenRecord: m,
538
- className: b,
543
+ className: g,
539
544
  stacked: p
540
545
  }) {
541
- return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", b), children: [
546
+ return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", g), children: [
542
547
  /* @__PURE__ */ a("span", { "data-tip": R(t), className: "tabular-nums", children: [
543
548
  "Since ",
544
- re(t)
549
+ se(t)
545
550
  ] }),
546
551
  e && /* @__PURE__ */ a(A, { children: [
547
- !p && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "·" }),
552
+ !p && /* @__PURE__ */ o("span", { "aria-hidden": !0, children: "·" }),
548
553
  m ? /* @__PURE__ */ a(
549
554
  "button",
550
555
  {
@@ -554,23 +559,23 @@ function I({
554
559
  className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
555
560
  children: [
556
561
  E(e),
557
- /* @__PURE__ */ r(G, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
562
+ /* @__PURE__ */ o(W, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
558
563
  ]
559
564
  }
560
- ) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: E(e) })
565
+ ) : /* @__PURE__ */ o("span", { className: "font-medium text-foreground", children: E(e) })
561
566
  ] })
562
567
  ] });
563
568
  }
564
- function me({ signal: t }) {
565
- const { remove: e } = Z(), m = /* @__PURE__ */ new Map();
569
+ function fe({ signal: t }) {
570
+ const { remove: e } = te(), m = /* @__PURE__ */ new Map();
566
571
  for (const p of t.snoozed) {
567
572
  if (!p.snooze) continue;
568
573
  const l = m.get(p.snooze.id) ?? [];
569
574
  l.push(p), m.set(p.snooze.id, l);
570
575
  }
571
- const b = (p) => new Set(p.map((f) => f.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
572
- return /* @__PURE__ */ r("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
573
- const l = p.snooze, f = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
576
+ const g = (p) => new Set(p.map((h) => h.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
577
+ return /* @__PURE__ */ o("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
578
+ const l = p.snooze, h = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
574
579
  month: "short",
575
580
  day: "numeric",
576
581
  hour: "numeric",
@@ -578,30 +583,30 @@ function me({ signal: t }) {
578
583
  })}` : ""}`;
579
584
  return /* @__PURE__ */ a("li", { "data-ic-row": p.key, "data-ic-snoozed": !0, className: "flex gap-3 px-4 py-2", children: [
580
585
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
581
- /* @__PURE__ */ r("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
586
+ /* @__PURE__ */ o("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
582
587
  /* @__PURE__ */ a("p", { className: "text-[11.5px] text-muted-foreground", children: [
583
588
  v,
584
- f.length > 1 ? ` with ${b(f)}` : "",
589
+ h.length > 1 ? ` with ${g(h)}` : "",
585
590
  l != null && l.note ? ` — “${l.note}”` : ""
586
591
  ] })
587
592
  ] }),
588
- l && /* @__PURE__ */ r(
593
+ l && /* @__PURE__ */ o(
589
594
  "button",
590
595
  {
591
596
  type: "button",
592
597
  "data-ic-unsnooze": l.id,
593
- "data-ic-unsnooze-count": f.length,
594
- "data-tip": f.length > 1 ? `This snooze covers ${f.length} problems (${b(f)}) — they all come back` : void 0,
598
+ "data-ic-unsnooze-count": h.length,
599
+ "data-tip": h.length > 1 ? `This snooze covers ${h.length} problems (${g(h)}) — they all come back` : void 0,
595
600
  disabled: e.isPending && e.variables === l.id,
596
601
  onClick: () => e.mutate(l.id),
597
602
  className: "h-7 shrink-0 rounded-md px-2.5 text-[12px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-60",
598
- children: f.length > 1 ? `Unsnooze all ${f.length}` : l != null && l.until_occurrence ? "Undo" : "Unsnooze"
603
+ children: h.length > 1 ? `Unsnooze all ${h.length}` : l != null && l.until_occurrence ? "Undo" : "Unsnooze"
599
604
  }
600
605
  )
601
606
  ] }, p.key);
602
607
  }) });
603
608
  }
604
609
  export {
605
- we as SignalCard,
606
- de as oldestSeen
610
+ $e as SignalCard,
611
+ ue as oldestSeen
607
612
  };