@nivaro/react 0.3.52 β†’ 0.3.53

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 (34) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +47 -3
  4. package/dist/shared/components/ItemEditForm.js +3851 -3821
  5. package/dist/shared/components/NotificationBell.js +163 -150
  6. package/dist/shared/components/PageRenderer.js +600 -549
  7. package/dist/shared/components/ProfileView.js +36 -34
  8. package/dist/shared/components/QueryStatStrip.js +96 -89
  9. package/dist/shared/components/QueryTable.js +214 -215
  10. package/dist/shared/components/ReportView.js +548 -529
  11. package/dist/shared/components/alerts/AlertManagerView.js +346 -320
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +1300 -1219
  13. package/dist/shared/components/item-edit/FieldAffordances.js +145 -136
  14. package/dist/shared/components/item-edit/FieldRenderer.js +366 -326
  15. package/dist/shared/components/item-edit/InlineTableField.js +3047 -2932
  16. package/dist/shared/components/item-edit/NestedRelationEditor.js +149 -143
  17. package/dist/shared/components/item-edit/PlanGrid.js +718 -705
  18. package/dist/shared/components/item-edit/SummaryPanel.js +351 -337
  19. package/dist/shared/components/item-edit/line-qty.js +115 -53
  20. package/dist/shared/components/item-edit/save-refusal.js +18 -18
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +210 -207
  22. package/dist/shared/components/panels/CommentPanel.js +204 -197
  23. package/dist/shared/components/panels/ItemLockBanner.js +318 -291
  24. package/dist/shared/components/panels/PipelinePanel.js +1388 -1218
  25. package/dist/shared/components/panels/RecordIntegrityBanner.js +201 -172
  26. package/dist/shared/components/panels/RevisionsPanel.js +101 -106
  27. package/dist/shared/components/panels/TransitionRequirementsDialog.js +564 -534
  28. package/dist/shared/components/panels/requirement-side-effects.js +46 -29
  29. package/dist/shared/components/queue/QueueItemSheet.js +219 -146
  30. package/dist/shared/components/queue/QueueWorklist.js +738 -730
  31. package/dist/shared/components/widgets/ReviewListWidget.js +236 -201
  32. package/dist/shared/lib/activity-sentence.js +236 -227
  33. package/dist/shared/lib/record-ref.js +43 -34
  34. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
1
  import { jsxs as s, jsx as e, Fragment as Y } from "react/jsx-runtime";
2
- import { useQueryClient as ge, useQuery as z, useMutation as L } from "@tanstack/react-query";
3
- import { MessageSquare as qe, ChevronDown as De, ClipboardPlus as Pe, Pencil as Te, Trash2 as Fe, Check as Re, X as Me, SmilePlus as ye } from "lucide-react";
2
+ import { useQueryClient as ve, useQuery as z, useMutation as L } from "@tanstack/react-query";
3
+ import { MessageSquare as De, ChevronDown as Pe, ClipboardPlus as Te, Pencil as Fe, Trash2 as Re, Check as Me, X as Ie, SmilePlus as ke } from "lucide-react";
4
4
  import { useState as N, useRef as U, useEffect as Q, useMemo as V } from "react";
5
- import { createPortal as Ie } from "react-dom";
5
+ import { createPortal as je } from "react-dom";
6
6
  import { toast as I } from "sonner";
7
- import { useNivaroClient as oe, useItemEditAuth as je, useDrilldown as Oe } from "../../context.js";
8
- import { useDebounced as Le } from "../../hooks/useDebounced.js";
9
- import { get as W, post as B, patch as Ae, del as Ke } from "../../lib/commands.js";
10
- import { usePresenceOnlinePoll as Be } from "../../lib/presence-live.js";
11
- import { useRecordSignalPeers as Qe, useRecordSignalSender as ze, signalSentence as Ue } from "../../lib/presence-signals.js";
12
- import { invalidateRecordTasks as We } from "../../lib/record-tasks.js";
13
- import { formatRelative as le, titleCase as Ge } from "../../lib/utils.js";
14
- import { AgentBadge as He } from "../AgentBadge.js";
7
+ import { useNivaroClient as oe, useItemEditAuth as Oe, useDrilldown as Le } from "../../context.js";
8
+ import { useDebounced as Ae } from "../../hooks/useDebounced.js";
9
+ import { get as W, post as B, patch as Ke, del as Be } from "../../lib/commands.js";
10
+ import { usePresenceOnlinePoll as Qe } from "../../lib/presence-live.js";
11
+ import { useRecordSignalPeers as ze, useRecordSignalSender as Ue, signalSentence as We } from "../../lib/presence-signals.js";
12
+ import { invalidateRecordTasks as Ge } from "../../lib/record-tasks.js";
13
+ import { formatRelative as le, titleCase as He } from "../../lib/utils.js";
14
+ import { AgentBadge as Xe } from "../AgentBadge.js";
15
15
  import { AutolinkedText as se } from "../AutolinkedText.js";
16
- import { InboundRequestPopover as Xe } from "../integrations/InboundRequest.js";
17
- import { useFieldComments as Je } from "../item-edit/field-comments-context.js";
18
- import { UserAvatar as Ve } from "../UserAvatar.js";
19
- import { Avatar as Ze, AvatarFallback as Ye } from "../ui/avatar.js";
16
+ import { InboundRequestPopover as Je } from "../integrations/InboundRequest.js";
17
+ import { useFieldComments as Ve } from "../item-edit/field-comments-context.js";
18
+ import { UserAvatar as Ze } from "../UserAvatar.js";
19
+ import { Avatar as Ye, AvatarFallback as et } from "../ui/avatar.js";
20
20
  import { Button as Z } from "../ui/button.js";
21
- import { Separator as he } from "../ui/separator.js";
22
- import { Textarea as et } from "../ui/textarea.js";
23
- import { RecordEventPathSheet as tt } from "./IntegrationActivitySection.js";
24
- const ve = ["πŸ‘", "βœ…", "πŸ‘€", "πŸŽ‰", "❀️", "πŸ˜‚"];
25
- function nt(t) {
21
+ import { Separator as fe } from "../ui/separator.js";
22
+ import { Textarea as tt } from "../ui/textarea.js";
23
+ import { RecordEventPathSheet as nt } from "./IntegrationActivitySection.js";
24
+ const Ne = ["πŸ‘", "βœ…", "πŸ‘€", "πŸŽ‰", "❀️", "πŸ˜‚"];
25
+ function at(t) {
26
26
  var d, c, h, m;
27
27
  return [(d = t.first_name) == null ? void 0 : d[0], (c = t.last_name) == null ? void 0 : c[0]].filter(Boolean).join("").toUpperCase() || ((m = (h = t.email) == null ? void 0 : h[0]) == null ? void 0 : m.toUpperCase()) || "?";
28
28
  }
@@ -58,10 +58,10 @@ function rt({ comment: t }) {
58
58
  }
59
59
  );
60
60
  }
61
- function re(t) {
61
+ function ae(t) {
62
62
  return [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email;
63
63
  }
64
- function at({
64
+ function st({
65
65
  field: t,
66
66
  label: i,
67
67
  resolved: d,
@@ -84,47 +84,47 @@ function at({
84
84
  }
85
85
  ) : /* @__PURE__ */ e("span", { "data-comment-field": t, className: m, children: h });
86
86
  }
87
- function st(t, i) {
87
+ function ot(t, i) {
88
88
  const c = t.slice(0, i).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
89
89
  return c ? { start: i - c[2].length - 1, query: c[2] } : null;
90
90
  }
91
- function be(t) {
91
+ function ge(t) {
92
92
  return t.email.split("@")[0];
93
93
  }
94
- function ae({
94
+ function re({
95
95
  value: t,
96
96
  onChange: i,
97
97
  ...d
98
98
  }) {
99
- const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v = Le((m == null ? void 0 : m.query) ?? "", 200), { data: q = [] } = z({
99
+ const c = oe(), h = U(null), [m, C] = N(null), [y, w] = N(0), v = Ae((m == null ? void 0 : m.query) ?? "", 200), { data: q = [] } = z({
100
100
  queryKey: ["users", "mention-search", v],
101
101
  queryFn: () => c.request(
102
102
  W("/users", { limit: 8, sort: "first_name", search: v })
103
103
  ).then((n) => n.data),
104
104
  enabled: !!m && v.length >= 2,
105
105
  staleTime: 3e4
106
- }), R = Be(15e3, !!m), { data: D } = z({
106
+ }), F = Qe(15e3, !!m), { data: E } = z({
107
107
  queryKey: ["presence-online"],
108
108
  queryFn: () => c.request(
109
109
  W("/presence/online")
110
110
  ),
111
111
  enabled: !!m,
112
- refetchInterval: R,
112
+ refetchInterval: F,
113
113
  staleTime: 5e3
114
114
  }), _ = (n) => {
115
115
  var p;
116
- const l = (p = D == null ? void 0 : D.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() === n.toUpperCase());
116
+ const l = (p = E == null ? void 0 : E.data) == null ? void 0 : p.find((b) => String(b.user_id).toUpperCase() === n.toUpperCase());
117
117
  return l ? l.is_idle || l.away ? 1 : 0 : 2;
118
- }, u = [...q].sort((n, l) => _(n.id) - _(l.id)), { data: P = [] } = z({
118
+ }, u = [...q].sort((n, l) => _(n.id) - _(l.id)), { data: D = [] } = z({
119
119
  queryKey: ["mention-roles"],
120
120
  queryFn: () => c.request(W("/chat/roles")).then((n) => n.data).catch(() => []),
121
121
  enabled: !!m,
122
122
  staleTime: 5 * 6e4
123
- }), S = m ? P.filter(
123
+ }), S = m ? D.filter(
124
124
  (n) => n.name.toLowerCase().replace(/\s+/g, "-").startsWith(v.toLowerCase())
125
- ).slice(0, 3) : [], k = !!m && v.length >= 2 && "owners".startsWith(v.toLowerCase()), T = !!m && v.length >= 2 && (u.length > 0 || k || S.length > 0), o = u.length + (k ? 1 : 0) + S.length, [f, $] = N(null), O = U(null);
125
+ ).slice(0, 3) : [], k = !!m && v.length >= 2 && "owners".startsWith(v.toLowerCase()), P = !!m && v.length >= 2 && (u.length > 0 || k || S.length > 0), o = u.length + (k ? 1 : 0) + S.length, [f, $] = N(null), O = U(null);
126
126
  Q(() => {
127
- if (!T || !h.current) {
127
+ if (!P || !h.current) {
128
128
  $(null);
129
129
  return;
130
130
  }
@@ -137,14 +137,14 @@ function ae({
137
137
  return window.addEventListener("scroll", l, !0), window.addEventListener("resize", p), () => {
138
138
  window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", p);
139
139
  };
140
- }, [T]);
140
+ }, [P]);
141
141
  function G(n) {
142
- const l = st(n.value, n.selectionStart ?? n.value.length);
142
+ const l = ot(n.value, n.selectionStart ?? n.value.length);
143
143
  C(l), l || w(0);
144
144
  }
145
- function F(n) {
145
+ function T(n) {
146
146
  if (!m || !h.current) return;
147
- const l = h.current.selectionStart ?? t.length, p = n === "__owners__" ? "@owners " : typeof n == "object" && "role" in n ? `@${n.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${be(n)} `, b = t.slice(0, m.start) + p + t.slice(l);
147
+ const l = h.current.selectionStart ?? t.length, p = n === "__owners__" ? "@owners " : typeof n == "object" && "role" in n ? `@${n.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${ge(n)} `, b = t.slice(0, m.start) + p + t.slice(l);
148
148
  i(b), C(null), w(0);
149
149
  const g = m.start + p.length;
150
150
  requestAnimationFrame(() => {
@@ -153,7 +153,7 @@ function ae({
153
153
  });
154
154
  }
155
155
  function H(n) {
156
- if (T)
156
+ if (P)
157
157
  if (n.key === "ArrowDown")
158
158
  n.preventDefault(), w((l) => (l + 1) % o);
159
159
  else if (n.key === "ArrowUp")
@@ -161,16 +161,16 @@ function ae({
161
161
  else if (n.key === "Enter" || n.key === "Tab") {
162
162
  n.preventDefault();
163
163
  const l = Math.min(y, o - 1), p = k ? 1 : 0, b = p + u.length;
164
- if (k && l === 0) F("__owners__");
164
+ if (k && l === 0) T("__owners__");
165
165
  else if (l >= b) {
166
166
  const g = S[l - b];
167
- g && F({ role: g.name });
168
- } else F(u[l - p]);
167
+ g && T({ role: g.name });
168
+ } else T(u[l - p]);
169
169
  } else n.key === "Escape" && (n.preventDefault(), C(null));
170
170
  }
171
171
  return /* @__PURE__ */ s("div", { className: "relative", children: [
172
172
  /* @__PURE__ */ e(
173
- et,
173
+ tt,
174
174
  {
175
175
  ...d,
176
176
  ref: h,
@@ -183,7 +183,7 @@ function ae({
183
183
  onBlur: () => setTimeout(() => C(null), 150)
184
184
  }
185
185
  ),
186
- T && f && Ie(
186
+ P && f && je(
187
187
  /* @__PURE__ */ s(
188
188
  "div",
189
189
  {
@@ -198,7 +198,7 @@ function ae({
198
198
  {
199
199
  type: "button",
200
200
  onMouseDown: (n) => {
201
- n.preventDefault(), F("__owners__");
201
+ n.preventDefault(), T("__owners__");
202
202
  },
203
203
  onMouseEnter: () => w(0),
204
204
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${y === 0 ? "bg-nvr-cyan/10" : ""}`,
@@ -219,7 +219,7 @@ function ae({
219
219
  {
220
220
  type: "button",
221
221
  onMouseDown: (A) => {
222
- A.preventDefault(), F(n);
222
+ A.preventDefault(), T(n);
223
223
  },
224
224
  onMouseEnter: () => w(p),
225
225
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
@@ -243,7 +243,7 @@ function ae({
243
243
  n.ooo_end ? ` until ${String(n.ooo_end).slice(0, 10)}` : ""
244
244
  ] }),
245
245
  "@",
246
- be(n),
246
+ ge(n),
247
247
  (n.title || n.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
248
248
  " Β· ",
249
249
  [n.title, n.department].filter(Boolean).join(", ")
@@ -262,7 +262,7 @@ function ae({
262
262
  {
263
263
  type: "button",
264
264
  onMouseDown: (b) => {
265
- b.preventDefault(), F({ role: n.name });
265
+ b.preventDefault(), T({ role: n.name });
266
266
  },
267
267
  onMouseEnter: () => w(p),
268
268
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${p === y ? "bg-nvr-cyan/10" : ""}`,
@@ -284,7 +284,7 @@ function ae({
284
284
  )
285
285
  ] });
286
286
  }
287
- function fe(t) {
287
+ function ye(t) {
288
288
  if (t.kind === "comment") return "people";
289
289
  switch (t.note.source) {
290
290
  case "note":
@@ -296,24 +296,24 @@ function fe(t) {
296
296
  return "system";
297
297
  }
298
298
  }
299
- const ot = {
299
+ const lt = {
300
300
  people: "People",
301
301
  system: "System",
302
302
  integration: "Integration"
303
- }, lt = "integrations:";
304
- function it({
303
+ }, it = "integrations:";
304
+ function dt({
305
305
  note: t,
306
306
  collection: i,
307
307
  item: d
308
308
  }) {
309
- var T;
310
- const c = Oe(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(lt), y = oe(), w = ge(), [v, q] = N(!1), R = L({
309
+ var P;
310
+ const c = Le(), [h, m] = N(!1), C = t.source === "external" && !!t.provider && !t.provider.startsWith(it), y = oe(), w = ve(), [v, q] = N(!1), F = L({
311
311
  mutationFn: (o) => y.request(B(`/comments/${t.comment_id}/reactions`, { emoji: o })),
312
312
  onSuccess: () => {
313
313
  q(!1), w.invalidateQueries({ queryKey: ["comments-related"] }), w.invalidateQueries({ queryKey: ["row-comment-counts"] });
314
314
  },
315
315
  onError: () => I.error("Failed to react")
316
- }), [D, _] = N(!1), u = L({
316
+ }), [E, _] = N(!1), u = L({
317
317
  mutationFn: () => y.request(
318
318
  B(`/integration-events/${encodeURIComponent(t.provider ?? "")}/replay`, {
319
319
  entry_id: t.id.replace(/^external:/, "")
@@ -331,7 +331,7 @@ function it({
331
331
  const f = ($ = o == null ? void 0 : o.response) == null ? void 0 : $.error;
332
332
  I.error(f ?? (o == null ? void 0 : o.message) ?? "Replay failed", { duration: 8e3 });
333
333
  }
334
- }), P = t.link ? () => {
334
+ }), D = t.link ? () => {
335
335
  const o = t.link;
336
336
  if (!o) return;
337
337
  const f = document.querySelector(`[data-o2m-row="${o.collection}:${o.item_id}"]`);
@@ -340,18 +340,18 @@ function it({
340
340
  return;
341
341
  }
342
342
  c == null || c.open({ collection: o.collection, itemId: o.item_id });
343
- } : null, S = t.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : t.source === "addendum" ? "border-amber-200 bg-amber-50/60 text-amber-700 dark:border-amber-900/40 dark:bg-amber-900/10 dark:text-amber-400" : t.source === "external" || t.source === "inbound" ? "border-sky-200 bg-sky-50/70 text-sky-700 dark:border-sky-900/40 dark:bg-sky-900/10 dark:text-sky-300" : t.source === "import" ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50/80 text-slate-600 dark:border-border dark:bg-muted/40 dark:text-slate-300", k = t.source === "import" && ((T = t.import) != null && T.file_id) ? t.import : null;
343
+ } : null, S = t.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : t.source === "addendum" ? "border-amber-200 bg-amber-50/60 text-amber-700 dark:border-amber-900/40 dark:bg-amber-900/10 dark:text-amber-400" : t.source === "external" || t.source === "inbound" ? "border-sky-200 bg-sky-50/70 text-sky-700 dark:border-sky-900/40 dark:bg-sky-900/10 dark:text-sky-300" : t.source === "import" ? "border-emerald-200 bg-emerald-50/70 text-emerald-700 dark:border-emerald-900/40 dark:bg-emerald-900/10 dark:text-emerald-300" : "border-slate-200 bg-slate-50/80 text-slate-600 dark:border-border dark:bg-muted/40 dark:text-slate-300", k = t.source === "import" && ((P = t.import) != null && P.file_id) ? t.import : null;
344
344
  return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": t.source, children: [
345
345
  /* @__PURE__ */ e("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
346
346
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
347
347
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
348
348
  /* @__PURE__ */ e("span", { className: `rounded border px-1.5 py-px text-[10px] font-medium ${S}`, children: t.label }),
349
349
  t.user_name && /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-700 dark:text-slate-200", children: t.user_name }),
350
- t.context && (P ? /* @__PURE__ */ e(
350
+ t.context && (D ? /* @__PURE__ */ e(
351
351
  "button",
352
352
  {
353
353
  type: "button",
354
- onClick: P,
354
+ onClick: D,
355
355
  className: "truncate text-[11px] text-nvr-navy underline-offset-2 hover:underline dark:text-nvr-cyan",
356
356
  "data-line-comment-link": !0,
357
357
  children: t.context
@@ -370,7 +370,7 @@ function it({
370
370
  ) : /* @__PURE__ */ e("span", { className: "truncate text-[11px] text-slate-400", children: t.context })),
371
371
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(t.created_at) }),
372
372
  t.source === "inbound" && t.inbound && /* @__PURE__ */ e(
373
- Xe,
373
+ Je,
374
374
  {
375
375
  activityId: t.inbound.activity_id,
376
376
  callerName: t.label,
@@ -405,13 +405,13 @@ function it({
405
405
  "button",
406
406
  {
407
407
  type: "button",
408
- onClick: () => D ? u.mutate() : _(!0),
408
+ onClick: () => E ? u.mutate() : _(!0),
409
409
  onBlur: () => _(!1),
410
410
  disabled: u.isPending,
411
411
  "data-note-replay": t.id,
412
- className: `rounded px-1.5 py-px text-[10.5px] font-medium transition-colors ${D ? "bg-sky-600 text-white" : "text-sky-700 hover:bg-sky-50 dark:text-sky-300 dark:hover:bg-sky-900/20"}`,
412
+ className: `rounded px-1.5 py-px text-[10.5px] font-medium transition-colors ${E ? "bg-sky-600 text-white" : "text-sky-700 hover:bg-sky-50 dark:text-sky-300 dark:hover:bg-sky-900/20"}`,
413
413
  "data-tip": "Re-apply this event from its stored payload",
414
- children: u.isPending ? "Replaying…" : D ? "Replay this event?" : "Replay"
414
+ children: u.isPending ? "Replaying…" : E ? "Replay this event?" : "Replay"
415
415
  }
416
416
  )
417
417
  ] }),
@@ -421,7 +421,7 @@ function it({
421
421
  "button",
422
422
  {
423
423
  type: "button",
424
- onClick: () => R.mutate(o.emoji),
424
+ onClick: () => F.mutate(o.emoji),
425
425
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${o.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
426
426
  children: [
427
427
  o.emoji,
@@ -438,14 +438,14 @@ function it({
438
438
  onClick: () => q((o) => !o),
439
439
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
440
440
  "aria-label": "Add reaction",
441
- children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
441
+ children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
442
442
  }
443
443
  ),
444
- v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: ve.map((o) => /* @__PURE__ */ e(
444
+ v && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Ne.map((o) => /* @__PURE__ */ e(
445
445
  "button",
446
446
  {
447
447
  type: "button",
448
- onClick: () => R.mutate(o),
448
+ onClick: () => F.mutate(o),
449
449
  className: "rounded-full px-1 text-[14px] hover:bg-muted",
450
450
  children: o
451
451
  },
@@ -455,7 +455,7 @@ function it({
455
455
  ] })
456
456
  ] }),
457
457
  C && t.provider && /* @__PURE__ */ e(
458
- tt,
458
+ nt,
459
459
  {
460
460
  target: h ? {
461
461
  source: t.provider,
@@ -468,7 +468,7 @@ function it({
468
468
  )
469
469
  ] });
470
470
  }
471
- function Tt({
471
+ function Ft({
472
472
  collection: t,
473
473
  item: i,
474
474
  title: d,
@@ -477,96 +477,96 @@ function Tt({
477
477
  onQueueComment: m,
478
478
  onUnsentDraft: C
479
479
  }) {
480
- const y = oe(), { userId: w } = je(), v = ge(), q = Je(), [R, D] = N(!1), _ = U(!1);
480
+ const y = oe(), { userId: w } = Oe(), v = ve(), q = Ve(), [F, E] = N(!1), _ = U(!1);
481
481
  Q(() => {
482
- !_.current && c !== void 0 && (_.current = !0, D(c));
482
+ !_.current && c !== void 0 && (_.current = !0, E(c));
483
483
  }, [c]);
484
- const [u, P] = N(""), S = U(C);
484
+ const [u, D] = N(""), S = U(C);
485
485
  S.current = C, Q(() => {
486
- var r;
487
- (r = S.current) == null || r.call(S, u);
486
+ var a;
487
+ (a = S.current) == null || a.call(S, u);
488
488
  }, [u]);
489
- const [k, T] = N(!1), o = async () => {
490
- var r;
489
+ const [k, P] = N(!1), o = async () => {
490
+ var a;
491
491
  if (!(!u.trim() || k)) {
492
- T(!0);
492
+ P(!0);
493
493
  try {
494
- const a = await y.request(
494
+ const r = await y.request(
495
495
  B("/ai/cleanup", { text: u })
496
496
  );
497
- (r = a.data) != null && r.text && P(a.data.text);
497
+ (a = r.data) != null && a.text && D(r.data.text);
498
498
  } catch {
499
499
  } finally {
500
- T(!1);
500
+ P(!1);
501
501
  }
502
502
  }
503
- }, f = Qe(t, i, "note"), $ = ze(t, i, "note"), O = U(0);
503
+ }, f = ze(t, i, "note"), $ = Ue(t, i, "note"), O = U(0);
504
504
  Q(() => {
505
505
  if (!u.trim()) {
506
506
  O.current && $("stop"), O.current = 0;
507
507
  return;
508
508
  }
509
- const r = Date.now();
510
- r - O.current < 2500 || (O.current = r, $("start"));
509
+ const a = Date.now();
510
+ a - O.current < 2500 || (O.current = a, $("start"));
511
511
  }, [u, $]), Q(() => () => $("stop"), [$]);
512
- const [G, F] = N(null), [H, n] = N(null), [l, p] = N(""), b = !i || i === "new", g = ["comments", t, String(i)], { data: j, isLoading: A, isError: ke } = z({
512
+ const [G, T] = N(null), [H, n] = N(null), [l, p] = N(""), b = !i || i === "new", g = ["comments", t, String(i)], { data: j, isLoading: A, isError: we } = z({
513
513
  queryKey: g,
514
- queryFn: () => y.request(W("/comments", { collection: t, item: i })).then((r) => r.data),
514
+ queryFn: () => y.request(W("/comments", { collection: t, item: i })).then((a) => a.data),
515
515
  enabled: !b
516
- }), ie = V(() => (j ?? []).filter((r) => !r.deleted), [j]), { data: Ne } = z({
516
+ }), ie = V(() => (j ?? []).filter((a) => !a.deleted), [j]), { data: _e } = z({
517
517
  queryKey: ["comments-related", t, String(i)],
518
- queryFn: () => y.request(W("/comments/related", { collection: t, item: i })).then((r) => r.data ?? []).catch(() => []),
518
+ queryFn: () => y.request(W("/comments/related", { collection: t, item: i })).then((a) => a.data ?? []).catch(() => []),
519
519
  enabled: !b,
520
520
  staleTime: 3e4
521
- }), de = Ne ?? [], E = V(() => {
522
- const r = ie.map((x) => ({ kind: "comment", at: x.created_at, comment: x })), a = de.map((x) => ({ kind: "related", at: x.created_at, note: x }));
523
- return [...r, ...a].sort((x, K) => new Date(K.at).getTime() - new Date(x.at).getTime());
524
- }, [ie, de]), [X, we] = N(() => /* @__PURE__ */ new Set()), [J, _e] = N(""), Ce = V(() => {
525
- const r = { people: 0, system: 0, integration: 0 };
526
- for (const a of E) r[fe(a)]++;
527
- return r;
528
- }, [E]), ee = V(() => {
529
- const r = J.trim().toLowerCase();
530
- return E.filter((a) => X.has(fe(a)) ? !1 : r ? (a.kind === "comment" ? `${a.comment.text} ${re(a.comment.user)}` : `${a.note.text} ${a.note.user_name ?? ""} ${a.note.label} ${a.note.context ?? ""} ${a.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
531
- }, [E, X, J]), Se = (r) => we((a) => {
532
- const x = new Set(a);
533
- return x.has(r) ? x.delete(r) : x.add(r), x;
534
- }), $e = X.size > 0 || J.trim() !== "", te = L({
535
- mutationFn: (r) => y.request(B("/comments", { collection: t, item: i, text: r })),
521
+ }), de = _e ?? [], R = V(() => {
522
+ const a = ie.map((x) => ({ kind: "comment", at: x.created_at, comment: x })), r = de.map((x) => ({ kind: "related", at: x.created_at, note: x }));
523
+ return [...a, ...r].sort((x, K) => new Date(K.at).getTime() - new Date(x.at).getTime());
524
+ }, [ie, de]), [X, Ce] = N(() => /* @__PURE__ */ new Set()), [J, Se] = N(""), ce = V(() => {
525
+ const a = { people: 0, system: 0, integration: 0 };
526
+ for (const r of R) a[ye(r)]++;
527
+ return a;
528
+ }, [R]), me = b ? (h ?? []).length : ce.people, ee = V(() => {
529
+ const a = J.trim().toLowerCase();
530
+ return R.filter((r) => X.has(ye(r)) ? !1 : a ? (r.kind === "comment" ? `${r.comment.text} ${ae(r.comment.user)}` : `${r.note.text} ${r.note.user_name ?? ""} ${r.note.label} ${r.note.context ?? ""} ${r.note.provider ?? ""}`).toLowerCase().includes(a) : !0);
531
+ }, [R, X, J]), $e = (a) => Ce((r) => {
532
+ const x = new Set(r);
533
+ return x.has(a) ? x.delete(a) : x.add(a), x;
534
+ }), qe = X.size > 0 || J.trim() !== "", te = L({
535
+ mutationFn: (a) => y.request(B("/comments", { collection: t, item: i, text: a })),
536
536
  onSuccess: () => {
537
- v.invalidateQueries({ queryKey: g }), P("");
537
+ v.invalidateQueries({ queryKey: g }), D("");
538
538
  },
539
539
  onError: () => I.error("Failed to post comment")
540
- }), ce = L({
541
- mutationFn: ({ id: r, text: a }) => y.request(Ae(`/comments/${r}`, { text: a })),
540
+ }), ue = L({
541
+ mutationFn: ({ id: a, text: r }) => y.request(Ke(`/comments/${a}`, { text: r })),
542
542
  onSuccess: () => {
543
- v.invalidateQueries({ queryKey: g }), F(null), p("");
543
+ v.invalidateQueries({ queryKey: g }), T(null), p("");
544
544
  },
545
545
  onError: () => I.error("Failed to update comment")
546
546
  }), ne = L({
547
- mutationFn: (r) => y.request(Ke(`/comments/${r}`)),
547
+ mutationFn: (a) => y.request(Be(`/comments/${a}`)),
548
548
  onSuccess: () => v.invalidateQueries({ queryKey: g }),
549
549
  onError: () => I.error("Failed to delete comment")
550
- }), me = L({
551
- mutationFn: ({ id: r, emoji: a }) => y.request(B(`/comments/${r}/reactions`, { emoji: a })),
550
+ }), pe = L({
551
+ mutationFn: ({ id: a, emoji: r }) => y.request(B(`/comments/${a}/reactions`, { emoji: r })),
552
552
  onSuccess: () => v.invalidateQueries({ queryKey: g }),
553
553
  onError: () => I.error("Failed to react")
554
- }), [ue, pe] = N(null), Ee = L({
555
- mutationFn: (r) => y.request(
554
+ }), [xe, he] = N(null), Ee = L({
555
+ mutationFn: (a) => y.request(
556
556
  B("/tasks", {
557
557
  collection: t,
558
558
  item: i,
559
- title: r.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
559
+ title: a.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
560
560
  assignee: w
561
561
  })
562
562
  ),
563
563
  onSuccess: () => {
564
- We(v, t, i), I.success("Task created from comment β€” assigned to you");
564
+ Ge(v, t, i), I.success("Task created from comment β€” assigned to you");
565
565
  },
566
566
  onError: () => I.error("Could not create a task")
567
567
  });
568
- function xe(r) {
569
- r.preventDefault(), u.trim() && (b && m ? (m(u.trim()), P("")) : te.mutate(u.trim()));
568
+ function be(a) {
569
+ a.preventDefault(), u.trim() && (b && m ? (m(u.trim()), D("")) : te.mutate(u.trim()));
570
570
  }
571
571
  return (
572
572
  // Addressable from elsewhere (the summary panel jumps here), which needs
@@ -575,7 +575,7 @@ function Tt({
575
575
  "div",
576
576
  {
577
577
  "data-panel": "notes",
578
- "data-panel-expanded": R ? "true" : "false",
578
+ "data-panel-expanded": F ? "true" : "false",
579
579
  className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
580
580
  children: [
581
581
  /* @__PURE__ */ s(
@@ -583,25 +583,32 @@ function Tt({
583
583
  {
584
584
  type: "button",
585
585
  "data-panel-toggle": "notes",
586
- onClick: () => D((r) => !r),
586
+ onClick: () => E((a) => !a),
587
587
  className: "flex w-full flex-col px-5 py-3.5 text-left transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
588
588
  children: [
589
589
  /* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
590
- /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
590
+ /* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
591
591
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: d || "Comments" }),
592
- (E.length > 0 || (h ?? []).length > 0) && /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: b ? (h ?? []).length : E.length }),
592
+ me > 0 && /* @__PURE__ */ e(
593
+ "span",
594
+ {
595
+ className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400",
596
+ "data-notes-badge": !0,
597
+ children: me
598
+ }
599
+ ),
593
600
  /* @__PURE__ */ e(
594
- De,
601
+ Pe,
595
602
  {
596
- className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${R ? " rotate-180" : ""}`
603
+ className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${F ? " rotate-180" : ""}`
597
604
  }
598
605
  )
599
606
  ] }),
600
- !R && !b && E.length > 0 && (() => {
601
- const r = E[0], a = r.kind === "comment" ? re(r.comment.user) : r.note.user_name ?? "System", x = (r.kind === "comment" ? r.comment.text : r.note.text).replace(/<[^>]*>/g, " ").replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
607
+ !F && !b && R.length > 0 && (() => {
608
+ const a = R[0], r = a.kind === "comment" ? ae(a.comment.user) : a.note.user_name ?? "System", x = (a.kind === "comment" ? a.comment.text : a.note.text).replace(/<[^>]*>/g, " ").replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
602
609
  return x ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
603
610
  /* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
604
- a,
611
+ r,
605
612
  ":"
606
613
  ] }),
607
614
  " ",
@@ -611,13 +618,13 @@ function Tt({
611
618
  ]
612
619
  }
613
620
  ),
614
- R && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: b ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
615
- /* @__PURE__ */ s("form", { onSubmit: xe, className: "space-y-2", children: [
621
+ F && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: b ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
622
+ /* @__PURE__ */ s("form", { onSubmit: be, className: "space-y-2", children: [
616
623
  /* @__PURE__ */ e(
617
- ae,
624
+ re,
618
625
  {
619
626
  value: u,
620
- onChange: P,
627
+ onChange: D,
621
628
  placeholder: "Write a comment…",
622
629
  rows: 3,
623
630
  className: "text-[13px]"
@@ -629,26 +636,26 @@ function Tt({
629
636
  ] })
630
637
  ] }),
631
638
  (h ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
632
- /* @__PURE__ */ e(he, {}),
633
- (h ?? []).map((r, a) => /* @__PURE__ */ s(
639
+ /* @__PURE__ */ e(fe, {}),
640
+ (h ?? []).map((a, r) => /* @__PURE__ */ s(
634
641
  "div",
635
642
  {
636
643
  className: "flex items-start gap-2.5 rounded-lg border border-dashed border-amber-200/70 bg-amber-50/40 px-3 py-2 dark:border-amber-500/20 dark:bg-amber-500/5",
637
644
  children: [
638
645
  /* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex shrink-0 items-center rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-600 dark:bg-amber-500/15 dark:text-amber-400", children: "Pending" }),
639
- /* @__PURE__ */ e("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: r })
646
+ /* @__PURE__ */ e("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: a })
640
647
  ]
641
648
  },
642
- a
649
+ r
643
650
  ))
644
651
  ] })
645
652
  ] }) : /* @__PURE__ */ s(Y, { children: [
646
- /* @__PURE__ */ s("form", { onSubmit: xe, className: "space-y-2", children: [
653
+ /* @__PURE__ */ s("form", { onSubmit: be, className: "space-y-2", children: [
647
654
  /* @__PURE__ */ e(
648
- ae,
655
+ re,
649
656
  {
650
657
  value: u,
651
- onChange: P,
658
+ onChange: D,
652
659
  placeholder: "Write a comment…",
653
660
  rows: 3,
654
661
  className: "text-[13px]"
@@ -679,95 +686,95 @@ function Tt({
679
686
  "data-note-typing": !0,
680
687
  children: [
681
688
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
682
- Ue(f, "writing a note"),
689
+ We(f, "writing a note"),
683
690
  "…"
684
691
  ]
685
692
  }
686
693
  ),
687
- /* @__PURE__ */ e(he, { className: "my-4" }),
688
- E.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
689
- ["people", "system", "integration"].map((r) => {
690
- const a = !X.has(r), x = Ce[r];
694
+ /* @__PURE__ */ e(fe, { className: "my-4" }),
695
+ R.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
696
+ ["people", "system", "integration"].map((a) => {
697
+ const r = !X.has(a), x = ce[a];
691
698
  return /* @__PURE__ */ s(
692
699
  "button",
693
700
  {
694
701
  type: "button",
695
- onClick: () => Se(r),
696
- "aria-pressed": a,
697
- "data-notes-filter": r,
698
- disabled: x === 0 && a,
699
- className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${a ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
700
- title: r === "people" ? "Comments and notes people wrote" : r === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
702
+ onClick: () => $e(a),
703
+ "aria-pressed": r,
704
+ "data-notes-filter": a,
705
+ disabled: x === 0 && r,
706
+ className: `inline-flex items-center gap-1 rounded-full border px-2 py-px text-[11px] font-medium transition-colors ${r ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through decoration-slate-300 dark:border-border"} disabled:opacity-50`,
707
+ title: a === "people" ? "Comments and notes people wrote" : a === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
701
708
  children: [
702
- ot[r],
709
+ lt[a],
703
710
  /* @__PURE__ */ e("span", { className: "tabular-nums text-[10px] opacity-70", children: x })
704
711
  ]
705
712
  },
706
- r
713
+ a
707
714
  );
708
715
  }),
709
716
  /* @__PURE__ */ e(
710
717
  "input",
711
718
  {
712
719
  value: J,
713
- onChange: (r) => _e(r.target.value),
720
+ onChange: (a) => Se(a.target.value),
714
721
  placeholder: "Search notes…",
715
722
  "aria-label": "Search notes",
716
723
  "data-notes-search": !0,
717
724
  className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
718
725
  }
719
726
  ),
720
- $e && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
727
+ qe && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
721
728
  ee.length,
722
729
  " of ",
723
- E.length
730
+ R.length
724
731
  ] })
725
732
  ] }),
726
- A ? /* @__PURE__ */ e("div", { className: "space-y-4", children: ["a", "b"].map((r) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
733
+ A ? /* @__PURE__ */ e("div", { className: "space-y-4", children: ["a", "b"].map((a) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
727
734
  /* @__PURE__ */ e("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
728
735
  /* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
729
736
  /* @__PURE__ */ e("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
730
737
  /* @__PURE__ */ e("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
731
738
  ] })
732
- ] }, r)) }) : ke ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : E.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ee.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match β€” clear the search or turn a filter back on." }) : /* @__PURE__ */ e("div", { className: "nvr-stagger-direct space-y-4", children: ee.map((r) => {
733
- if (r.kind === "related")
739
+ ] }, a)) }) : we ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : R.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ee.length === 0 ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes match β€” clear the search or turn a filter back on." }) : /* @__PURE__ */ e("div", { className: "nvr-stagger-direct space-y-4", children: ee.map((a) => {
740
+ if (a.kind === "related")
734
741
  return /* @__PURE__ */ e("div", { className: "nvr-section-enter", children: /* @__PURE__ */ e(
735
- it,
742
+ dt,
736
743
  {
737
- note: r.note,
744
+ note: a.note,
738
745
  collection: t,
739
746
  item: String(i)
740
747
  }
741
- ) }, r.note.id);
742
- const a = r.comment, x = w === a.user.id, K = G === a.id;
748
+ ) }, a.note.id);
749
+ const r = a.comment, x = w === r.user.id, K = G === r.id;
743
750
  return /* @__PURE__ */ s("div", { className: "nvr-section-enter group flex gap-3", children: [
744
751
  /* @__PURE__ */ e(
745
- Ve,
752
+ Ze,
746
753
  {
747
- userId: a.user.id,
754
+ userId: r.user.id,
748
755
  className: "h-8 w-8",
749
- fallback: /* @__PURE__ */ e(Ze, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ e(Ye, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: nt(a.user) }) })
756
+ fallback: /* @__PURE__ */ e(Ye, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ e(et, { className: "bg-nvr-cyan/15 text-[11px] font-bold text-nvr-navy", children: at(r.user) }) })
750
757
  }
751
758
  ),
752
759
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
753
760
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
754
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: re(a.user) }),
755
- /* @__PURE__ */ e(He, { label: a.via_agent }),
756
- /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(a.created_at) }),
757
- a.updated_at && a.updated_at !== a.created_at && /* @__PURE__ */ e("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
758
- a.field && /* @__PURE__ */ e(
759
- at,
761
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800", children: ae(r.user) }),
762
+ /* @__PURE__ */ e(Xe, { label: r.via_agent }),
763
+ /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: le(r.created_at) }),
764
+ r.updated_at && r.updated_at !== r.created_at && /* @__PURE__ */ e("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
765
+ r.field && /* @__PURE__ */ e(
766
+ st,
760
767
  {
761
- field: a.field,
762
- label: (q == null ? void 0 : q.labelOf(a.field)) ?? Ge(a.field),
763
- resolved: !!a.resolved_at,
764
- onJump: q ? () => q.jump(a.field) : void 0
768
+ field: r.field,
769
+ label: (q == null ? void 0 : q.labelOf(r.field)) ?? He(r.field),
770
+ resolved: !!r.resolved_at,
771
+ onJump: q ? () => q.jump(r.field) : void 0
765
772
  }
766
773
  ),
767
774
  !K && /* @__PURE__ */ s(
768
775
  "div",
769
776
  {
770
- className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H === a.id ? "opacity-100" : "opacity-0"}`,
777
+ className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${H === r.id ? "opacity-100" : "opacity-0"}`,
771
778
  children: [
772
779
  /* @__PURE__ */ e(
773
780
  "button",
@@ -776,20 +783,20 @@ function Tt({
776
783
  title: "Make a task from this comment",
777
784
  "aria-label": "Make a task from this comment",
778
785
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
779
- onClick: () => Ee.mutate(a),
780
- children: /* @__PURE__ */ e(Pe, { className: "h-3 w-3" })
786
+ onClick: () => Ee.mutate(r),
787
+ children: /* @__PURE__ */ e(Te, { className: "h-3 w-3" })
781
788
  }
782
789
  ),
783
- x && (H === a.id ? /* @__PURE__ */ s(Y, { children: [
790
+ x && (H === r.id ? /* @__PURE__ */ s(Y, { children: [
784
791
  /* @__PURE__ */ e(
785
792
  "button",
786
793
  {
787
794
  type: "button",
788
795
  autoFocus: !0,
789
796
  disabled: ne.isPending,
790
- "data-comment-delete-confirm": a.id,
797
+ "data-comment-delete-confirm": r.id,
791
798
  className: "rounded bg-red-600 px-1.5 py-px text-[10.5px] font-medium text-white transition-colors hover:bg-red-700 disabled:opacity-60",
792
- onClick: () => ne.mutate(a.id, {
799
+ onClick: () => ne.mutate(r.id, {
793
800
  onSettled: () => n(null)
794
801
  }),
795
802
  children: ne.isPending ? "Deleting…" : "Delete comment?"
@@ -813,9 +820,9 @@ function Tt({
813
820
  "aria-label": "Edit comment",
814
821
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
815
822
  onClick: () => {
816
- F(a.id), p(a.text);
823
+ T(r.id), p(r.text);
817
824
  },
818
- children: /* @__PURE__ */ e(Te, { className: "h-3 w-3" })
825
+ children: /* @__PURE__ */ e(Fe, { className: "h-3 w-3" })
819
826
  }
820
827
  ),
821
828
  /* @__PURE__ */ e(
@@ -825,8 +832,8 @@ function Tt({
825
832
  title: "Delete comment",
826
833
  "aria-label": "Delete comment",
827
834
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
828
- onClick: () => n(a.id),
829
- children: /* @__PURE__ */ e(Fe, { className: "h-3 w-3" })
835
+ onClick: () => n(r.id),
836
+ children: /* @__PURE__ */ e(Re, { className: "h-3 w-3" })
830
837
  }
831
838
  )
832
839
  ] }))
@@ -836,7 +843,7 @@ function Tt({
836
843
  ] }),
837
844
  K ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
838
845
  /* @__PURE__ */ e(
839
- ae,
846
+ re,
840
847
  {
841
848
  value: l,
842
849
  onChange: p,
@@ -850,10 +857,10 @@ function Tt({
850
857
  {
851
858
  size: "sm",
852
859
  className: "h-7 gap-1.5",
853
- disabled: !l.trim() || ce.isPending,
854
- onClick: () => ce.mutate({ id: a.id, text: l.trim() }),
860
+ disabled: !l.trim() || ue.isPending,
861
+ onClick: () => ue.mutate({ id: r.id, text: l.trim() }),
855
862
  children: [
856
- /* @__PURE__ */ e(Re, { className: "h-3 w-3" }),
863
+ /* @__PURE__ */ e(Me, { className: "h-3 w-3" }),
857
864
  " Save"
858
865
  ]
859
866
  }
@@ -865,23 +872,23 @@ function Tt({
865
872
  variant: "outline",
866
873
  className: "h-7 gap-1.5",
867
874
  onClick: () => {
868
- F(null), p("");
875
+ T(null), p("");
869
876
  },
870
877
  children: [
871
- /* @__PURE__ */ e(Me, { className: "h-3 w-3" }),
878
+ /* @__PURE__ */ e(Ie, { className: "h-3 w-3" }),
872
879
  " Cancel"
873
880
  ]
874
881
  }
875
882
  )
876
883
  ] })
877
- ] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text: a.text }) }),
878
- !K && /* @__PURE__ */ e(rt, { comment: a }),
884
+ ] }) : /* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600", children: /* @__PURE__ */ e(se, { text: r.text }) }),
885
+ !K && /* @__PURE__ */ e(rt, { comment: r }),
879
886
  !K && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
880
- (a.reactions ?? []).map((M) => /* @__PURE__ */ s(
887
+ (r.reactions ?? []).map((M) => /* @__PURE__ */ s(
881
888
  "button",
882
889
  {
883
890
  type: "button",
884
- onClick: () => me.mutate({ id: a.id, emoji: M.emoji }),
891
+ onClick: () => pe.mutate({ id: r.id, emoji: M.emoji }),
885
892
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${M.mine ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-slate-50 text-slate-600 hover:border-slate-300 dark:border-border dark:bg-muted dark:text-slate-300"}`,
886
893
  children: [
887
894
  M.emoji,
@@ -895,18 +902,18 @@ function Tt({
895
902
  "button",
896
903
  {
897
904
  type: "button",
898
- onClick: () => pe(ue === a.id ? null : a.id),
905
+ onClick: () => he(xe === r.id ? null : r.id),
899
906
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
900
907
  "aria-label": "Add reaction",
901
- children: /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" })
908
+ children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
902
909
  }
903
910
  ),
904
- ue === a.id && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: ve.map((M) => /* @__PURE__ */ e(
911
+ xe === r.id && /* @__PURE__ */ e("span", { className: "absolute bottom-6 left-0 z-20 flex gap-0.5 rounded-full border border-slate-200 bg-white px-1.5 py-1 shadow-lg dark:border-border dark:bg-popover", children: Ne.map((M) => /* @__PURE__ */ e(
905
912
  "button",
906
913
  {
907
914
  type: "button",
908
915
  onClick: () => {
909
- me.mutate({ id: a.id, emoji: M }), pe(null);
916
+ pe.mutate({ id: r.id, emoji: M }), he(null);
910
917
  },
911
918
  className: "rounded-full px-1 text-[14px] hover:bg-muted",
912
919
  children: M
@@ -916,7 +923,7 @@ function Tt({
916
923
  ] })
917
924
  ] })
918
925
  ] })
919
- ] }, a.id);
926
+ ] }, r.id);
920
927
  }) })
921
928
  ] }) })
922
929
  ]
@@ -925,6 +932,6 @@ function Tt({
925
932
  );
926
933
  }
927
934
  export {
928
- Tt as CommentPanel,
929
- ae as MentionTextarea
935
+ Ft as CommentPanel,
936
+ re as MentionTextarea
930
937
  };