@nivaro/react 0.3.128 โ†’ 0.3.130

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.
@@ -1,64 +1,66 @@
1
1
  import { jsxs as s, jsx as t, Fragment as ee } from "react/jsx-runtime";
2
- import { useQueryClient as $e, useQuery as W, useMutation as A } from "@tanstack/react-query";
3
- import { MessageSquare as Ue, ChevronDown as ze, ClipboardPlus as We, Pencil as He, Trash2 as Ge, Check as Ee, X as Je, SmilePlus as Te, BellOff as Xe } from "lucide-react";
4
- import { useState as C, useRef as te, useEffect as qe, useMemo as z } from "react";
5
- import { createPortal as Ve } from "react-dom";
6
- import { toast as M } from "sonner";
7
- import { useNivaroClient as le, useItemEditAuth as Ze, useDrilldown as Ye } from "../../context.js";
8
- import { useDebounced as et } from "../../hooks/useDebounced.js";
9
- import { get as H, post as K, patch as tt, del as at } from "../../lib/commands.js";
10
- import { useRepliesWhileTyping as nt, mentionReceiptLine as rt, mentionReceiptSummary as st } from "../../lib/comment-awareness.js";
11
- import { stripCommentImages as ot } from "../../lib/comment-images.js";
12
- import { useLivePreference as lt } from "../../lib/live-preference.js";
13
- import { usePresenceOnlinePoll as it } from "../../lib/presence-live.js";
14
- import { useMyUserId as dt, useNoteTypists as ct, useDraftTypingSignal as mt, signalSentence as pt } from "../../lib/presence-signals.js";
15
- import { invalidateRecordTasks as ut } from "../../lib/record-tasks.js";
16
- import { useNewSince as xt } from "../../lib/seen-since.js";
17
- import { useStartsOpen as ht } from "../../lib/use-starts-open.js";
18
- import { titleCase as ye, formatDateTime as ie, formatRelative as De, cn as ve } from "../../lib/utils.js";
19
- import { AgentBadge as bt } from "../AgentBadge.js";
20
- import { AutolinkedText as Ie } from "../AutolinkedText.js";
21
- import { InboundRequestPopover as ft } from "../integrations/InboundRequest.js";
22
- import { useFieldComments as gt } from "../item-edit/field-comments-context.js";
23
- import { RelativeTime as Re } from "../RelativeTime.js";
24
- import { UserAvatar as yt } from "../UserAvatar.js";
25
- import { Avatar as vt, AvatarFallback as kt } from "../ui/avatar.js";
2
+ import { useQueryClient as Ee, useQuery as W, useMutation as L } from "@tanstack/react-query";
3
+ import { MessageSquare as ze, ChevronDown as We, ClipboardPlus as Ge, Pencil as He, Trash2 as Je, Check as Te, X as Xe, SmilePlus as qe, BellOff as Ve } from "lucide-react";
4
+ import { useState as S, useRef as te, useEffect as De, useMemo as z } from "react";
5
+ import { createPortal as Ze } from "react-dom";
6
+ import { toast as F } from "sonner";
7
+ import { useNivaroClient as le, useItemEditAuth as Ye, useDrilldown as et } from "../../context.js";
8
+ import { useDebounced as tt } from "../../hooks/useDebounced.js";
9
+ import { get as G, post as K, patch as at, del as rt } from "../../lib/commands.js";
10
+ import { useRepliesWhileTyping as nt, mentionReceiptLine as st, mentionReceiptSummary as ot } from "../../lib/comment-awareness.js";
11
+ import { stripCommentImages as lt } from "../../lib/comment-images.js";
12
+ import { useLivePreference as it } from "../../lib/live-preference.js";
13
+ import { usePresenceOnlinePoll as dt } from "../../lib/presence-live.js";
14
+ import { useMyUserId as ct, useNoteTypists as mt, useDraftTypingSignal as pt, signalSentence as ut } from "../../lib/presence-signals.js";
15
+ import { invalidateRecordTasks as xt } from "../../lib/record-tasks.js";
16
+ import { useNewSince as ht } from "../../lib/seen-since.js";
17
+ import { useStartsOpen as bt } from "../../lib/use-starts-open.js";
18
+ import { titleCase as ve, formatDateTime as ie, formatRelative as Ie, cn as ke } from "../../lib/utils.js";
19
+ import { AgentBadge as ft } from "../AgentBadge.js";
20
+ import { AutolinkedText as Re } from "../AutolinkedText.js";
21
+ import { InboundRequestPopover as gt } from "../integrations/InboundRequest.js";
22
+ import { useFieldComments as yt } from "../item-edit/field-comments-context.js";
23
+ import { RelativeTime as Pe } from "../RelativeTime.js";
24
+ import { GitlabSharedNotice as vt, MirroredAuthor as kt, MirroredBody as Nt, mirroredAuthorName as wt } from "../trackers/MirroredText.js";
25
+ import { useSourceTracker as _t } from "../trackers/use-tracker-link.js";
26
+ import { UserAvatar as Ct } from "../UserAvatar.js";
27
+ import { Avatar as St, AvatarFallback as $t } from "../ui/avatar.js";
26
28
  import { Button as Z } from "../ui/button.js";
27
- import { Separator as ke } from "../ui/separator.js";
28
- import { Textarea as Nt } from "../ui/textarea.js";
29
- import { useHoldInPlace as wt, RepliesWhileTyping as _t, jumpToComment as Ct, SeenByLine as St, MentionDeliveryButton as $t } from "./CommentAwareness.js";
30
- import { useCommentImages as Et, CommentImageStrip as Tt, CommentBody as qt, imageDropProps as Dt } from "./CommentImages.js";
31
- import { RecordEventPathSheet as It } from "./IntegrationActivitySection.js";
32
- import { NewSinceChip as Rt } from "./NewSinceChip.js";
33
- const Pe = ["๐Ÿ‘", "โœ…", "๐Ÿ‘€", "๐ŸŽ‰", "โค๏ธ", "๐Ÿ˜‚"];
34
- function Pt(e) {
29
+ import { Separator as Ne } from "../ui/separator.js";
30
+ import { Textarea as Et } from "../ui/textarea.js";
31
+ import { useHoldInPlace as Tt, RepliesWhileTyping as qt, jumpToComment as Dt, SeenByLine as It, MentionDeliveryButton as Rt } from "./CommentAwareness.js";
32
+ import { useCommentImages as Pt, CommentImageStrip as Mt, CommentBody as Ft, imageDropProps as Ot } from "./CommentImages.js";
33
+ import { RecordEventPathSheet as jt } from "./IntegrationActivitySection.js";
34
+ import { NewSinceChip as Lt } from "./NewSinceChip.js";
35
+ const Me = ["๐Ÿ‘", "โœ…", "๐Ÿ‘€", "๐ŸŽ‰", "โค๏ธ", "๐Ÿ˜‚"];
36
+ function At(e) {
35
37
  var x, b, f, c;
36
38
  return [(x = e.first_name) == null ? void 0 : x[0], (b = e.last_name) == null ? void 0 : b[0]].filter(Boolean).join("").toUpperCase() || ((c = (f = e.email) == null ? void 0 : f[0]) == null ? void 0 : c.toUpperCase()) || "?";
37
39
  }
38
- const Ne = {
40
+ const we = {
39
41
  ok: "text-emerald-700 dark:text-emerald-400",
40
42
  neutral: "text-slate-500 dark:text-slate-400",
41
43
  warn: "text-amber-700 dark:text-amber-400"
42
44
  };
43
- function we({ tone: e }) {
44
- return e === "ok" ? /* @__PURE__ */ t(Ee, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : e === "warn" ? /* @__PURE__ */ t(Xe, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : null;
45
+ function _e({ tone: e }) {
46
+ return e === "ok" ? /* @__PURE__ */ t(Te, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : e === "warn" ? /* @__PURE__ */ t(Ve, { "aria-hidden": !0, className: "h-3 w-3 shrink-0" }) : null;
45
47
  }
46
48
  function oe(e) {
47
49
  return (e.mentions ?? []).filter(
48
- (l) => {
50
+ (o) => {
49
51
  var x;
50
- return l.id && String(l.id).toUpperCase() !== String(((x = e.user) == null ? void 0 : x.id) ?? "").toUpperCase();
52
+ return o.id && String(o.id).toUpperCase() !== String(((x = e.user) == null ? void 0 : x.id) ?? "").toUpperCase();
51
53
  }
52
54
  );
53
55
  }
54
- function Ft({
56
+ function Bt({
55
57
  comment: e,
56
- collection: l,
58
+ collection: o,
57
59
  item: x
58
60
  }) {
59
- const b = lt(), f = oe(e);
61
+ const b = it(), f = oe(e);
60
62
  if (f.length === 0) return null;
61
- const c = f.map((d) => ({ m: d, ...rt(d, De) })), m = st(f);
63
+ const c = f.map((d) => ({ m: d, ...st(d, Ie) })), m = ot(f);
62
64
  return /* @__PURE__ */ s(
63
65
  "p",
64
66
  {
@@ -74,9 +76,9 @@ function Ft({
74
76
  "data-mention-receipts-summary": !0,
75
77
  "data-tip": c.map((d) => d.text).join(" ยท "),
76
78
  "aria-label": c.map((d) => d.text).join(". "),
77
- className: ve("inline-flex items-center gap-1 rounded", Ne[m.tone]),
79
+ className: ke("inline-flex items-center gap-1 rounded", we[m.tone]),
78
80
  children: [
79
- /* @__PURE__ */ t(we, { tone: m.tone }),
81
+ /* @__PURE__ */ t(_e, { tone: m.tone }),
80
82
  m.text
81
83
  ]
82
84
  }
@@ -87,15 +89,15 @@ function Ft({
87
89
  "data-mention-seen": N === "ok" ? "seen" : "unseen",
88
90
  "data-mention-status": d.status ?? void 0,
89
91
  "data-tip": d.seen_at ? `Seen ${ie(d.seen_at)}` : void 0,
90
- className: ve("inline-flex items-center gap-1", Ne[N]),
92
+ className: ke("inline-flex items-center gap-1", we[N]),
91
93
  children: [
92
- /* @__PURE__ */ t(we, { tone: N }),
94
+ /* @__PURE__ */ t(_e, { tone: N }),
93
95
  k
94
96
  ]
95
97
  },
96
98
  d.id
97
99
  )),
98
- e.delivery_visible && /* @__PURE__ */ t($t, { collection: l, item: x, commentId: e.id })
100
+ e.delivery_visible && /* @__PURE__ */ t(Rt, { collection: o, item: x, commentId: e.id })
99
101
  ]
100
102
  }
101
103
  );
@@ -105,18 +107,19 @@ function Fe(e) {
105
107
  }
106
108
  function Y(e) {
107
109
  var x;
108
- const l = Fe(e.user);
109
- return (x = e.acting_admin) != null && x.name ? `${e.acting_admin.name} as ${l}` : l;
110
+ if (e.tracker) return wt(e.tracker);
111
+ const o = Fe(e.user);
112
+ return (x = e.acting_admin) != null && x.name ? `${e.acting_admin.name} as ${o}` : o;
110
113
  }
111
- function Mt({
114
+ function Kt({
112
115
  field: e,
113
- label: l,
116
+ label: o,
114
117
  resolved: x,
115
118
  onJump: b
116
119
  }) {
117
120
  const f = /* @__PURE__ */ s(ee, { children: [
118
121
  "on ",
119
- /* @__PURE__ */ t("span", { className: "font-medium", children: l }),
122
+ /* @__PURE__ */ t("span", { className: "font-medium", children: o }),
120
123
  x && /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: " ยท resolved" })
121
124
  ] }), c = "inline-flex min-w-0 max-w-[220px] items-center gap-1 truncate rounded-full border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300";
122
125
  return b ? /* @__PURE__ */ t(
@@ -125,129 +128,129 @@ function Mt({
125
128
  type: "button",
126
129
  "data-comment-field": e,
127
130
  onClick: b,
128
- "data-tip": `Go to ${l}`,
131
+ "data-tip": `Go to ${o}`,
129
132
  className: `${c} transition-colors hover:border-nvr-cyan/50 hover:text-[#0e7490] dark:hover:text-nvr-cyan`,
130
133
  children: f
131
134
  }
132
135
  ) : /* @__PURE__ */ t("span", { "data-comment-field": e, className: c, children: f });
133
136
  }
134
- function Ot(e, l) {
135
- const b = e.slice(0, l).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
136
- return b ? { start: l - b[2].length - 1, query: b[2] } : null;
137
+ function Qt(e, o) {
138
+ const b = e.slice(0, o).match(/(^|\s)@([a-zA-Z0-9._-]{2,})$/);
139
+ return b ? { start: o - b[2].length - 1, query: b[2] } : null;
137
140
  }
138
- function _e(e) {
141
+ function Ce(e) {
139
142
  return e.email.split("@")[0];
140
143
  }
141
144
  function se({
142
145
  value: e,
143
- onChange: l,
146
+ onChange: o,
144
147
  onImages: x,
145
148
  ...b
146
149
  }) {
147
- const f = le(), c = te(null), [m, d] = C(null), [k, N] = C(0), y = et((m == null ? void 0 : m.query) ?? "", 200), { data: S = [] } = W({
150
+ const f = le(), c = te(null), [m, d] = S(null), [k, N] = S(0), y = tt((m == null ? void 0 : m.query) ?? "", 200), { data: $ = [] } = W({
148
151
  queryKey: ["users", "mention-search", y],
149
152
  queryFn: () => f.request(
150
- H("/users", { limit: 8, sort: "first_name", search: y })
151
- ).then((r) => r.data),
153
+ G("/users", { limit: 8, sort: "first_name", search: y })
154
+ ).then((n) => n.data),
152
155
  enabled: !!m && y.length >= 2,
153
156
  staleTime: 3e4
154
- }), q = it(15e3, !!m), { data: I } = W({
157
+ }), q = dt(15e3, !!m), { data: I } = W({
155
158
  queryKey: ["presence-online"],
156
159
  queryFn: () => f.request(
157
- H("/presence/online")
160
+ G("/presence/online")
158
161
  ),
159
162
  enabled: !!m,
160
163
  refetchInterval: q,
161
164
  staleTime: 5e3
162
- }), p = (r) => {
165
+ }), p = (n) => {
163
166
  var u;
164
- const i = (u = I == null ? void 0 : I.data) == null ? void 0 : u.find((g) => String(g.user_id).toUpperCase() === r.toUpperCase());
167
+ const i = (u = I == null ? void 0 : I.data) == null ? void 0 : u.find((C) => String(C.user_id).toUpperCase() === n.toUpperCase());
165
168
  return i ? i.is_idle || i.away ? 1 : 0 : 2;
166
- }, w = S, { data: T = [] } = W({
169
+ }, w = $, { data: T = [] } = W({
167
170
  queryKey: ["mention-roles"],
168
- queryFn: () => f.request(H("/chat/roles")).then((r) => r.data).catch(() => []),
171
+ queryFn: () => f.request(G("/chat/roles")).then((n) => n.data).catch(() => []),
169
172
  enabled: !!m,
170
173
  staleTime: 5 * 6e4
171
- }), $ = m ? T.filter(
172
- (r) => r.name.toLowerCase().replace(/\s+/g, "-").startsWith(y.toLowerCase())
173
- ).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), o = !!m && y.length >= 2 && (w.length > 0 || _ || $.length > 0), v = w.length + (_ ? 1 : 0) + $.length, [P, G] = C(null), B = te(null);
174
- qe(() => {
175
- if (!o || !c.current) {
176
- G(null);
174
+ }), E = m ? T.filter(
175
+ (n) => n.name.toLowerCase().replace(/\s+/g, "-").startsWith(y.toLowerCase())
176
+ ).slice(0, 3) : [], _ = !!m && y.length >= 2 && "owners".startsWith(y.toLowerCase()), l = !!m && y.length >= 2 && (w.length > 0 || _ || E.length > 0), v = w.length + (_ ? 1 : 0) + E.length, [P, H] = S(null), A = te(null);
177
+ De(() => {
178
+ if (!l || !c.current) {
179
+ H(null);
177
180
  return;
178
181
  }
179
- const r = c.current.getBoundingClientRect();
180
- G({ top: r.bottom + 4, left: r.left, width: Math.min(r.width, 360) });
181
- const i = (g) => {
182
- var E;
183
- (E = B.current) != null && E.contains(g.target) || d(null);
182
+ const n = c.current.getBoundingClientRect();
183
+ H({ top: n.bottom + 4, left: n.left, width: Math.min(n.width, 360) });
184
+ const i = (C) => {
185
+ var g;
186
+ (g = A.current) != null && g.contains(C.target) || d(null);
184
187
  }, u = () => d(null);
185
188
  return window.addEventListener("scroll", i, !0), window.addEventListener("resize", u), () => {
186
189
  window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", u);
187
190
  };
188
- }, [o]);
189
- function Q(r) {
190
- const i = Ot(r.value, r.selectionStart ?? r.value.length);
191
+ }, [l]);
192
+ function Q(n) {
193
+ const i = Qt(n.value, n.selectionStart ?? n.value.length);
191
194
  d(i), i || N(0);
192
195
  }
193
- function R(r) {
196
+ function R(n) {
194
197
  if (!m || !c.current) return;
195
- const i = c.current.selectionStart ?? e.length, u = r === "__owners__" ? "@owners " : typeof r == "object" && "role" in r ? `@${r.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${_e(r)} `, g = e.slice(0, m.start) + u + e.slice(i);
196
- l(g), d(null), N(0);
197
- const E = m.start + u.length;
198
+ const i = c.current.selectionStart ?? e.length, u = n === "__owners__" ? "@owners " : typeof n == "object" && "role" in n ? `@${n.role.toLowerCase().replace(/\s+/g, "-")} ` : `@${Ce(n)} `, C = e.slice(0, m.start) + u + e.slice(i);
199
+ o(C), d(null), N(0);
200
+ const g = m.start + u.length;
198
201
  requestAnimationFrame(() => {
199
- var O, j;
200
- (O = c.current) == null || O.focus(), (j = c.current) == null || j.setSelectionRange(E, E);
202
+ var O, B;
203
+ (O = c.current) == null || O.focus(), (B = c.current) == null || B.setSelectionRange(g, g);
201
204
  });
202
205
  }
203
- function U(r) {
204
- if (o)
205
- if (r.key === "ArrowDown")
206
- r.preventDefault(), N((i) => (i + 1) % v);
207
- else if (r.key === "ArrowUp")
208
- r.preventDefault(), N((i) => (i - 1 + v) % v);
209
- else if (r.key === "Enter" || r.key === "Tab") {
210
- r.preventDefault();
211
- const i = Math.min(k, v - 1), u = _ ? 1 : 0, g = u + w.length;
206
+ function U(n) {
207
+ if (l)
208
+ if (n.key === "ArrowDown")
209
+ n.preventDefault(), N((i) => (i + 1) % v);
210
+ else if (n.key === "ArrowUp")
211
+ n.preventDefault(), N((i) => (i - 1 + v) % v);
212
+ else if (n.key === "Enter" || n.key === "Tab") {
213
+ n.preventDefault();
214
+ const i = Math.min(k, v - 1), u = _ ? 1 : 0, C = u + w.length;
212
215
  if (_ && i === 0) R("__owners__");
213
- else if (i >= g) {
214
- const E = $[i - g];
215
- E && R({ role: E.name });
216
+ else if (i >= C) {
217
+ const g = E[i - C];
218
+ g && R({ role: g.name });
216
219
  } else R(w[i - u]);
217
- } else r.key === "Escape" && (r.preventDefault(), d(null));
220
+ } else n.key === "Escape" && (n.preventDefault(), d(null));
218
221
  }
219
222
  return /* @__PURE__ */ s("div", { className: "relative", children: [
220
223
  /* @__PURE__ */ t(
221
- Nt,
224
+ Et,
222
225
  {
223
226
  ...b,
224
- ...x ? Dt(x) : {},
227
+ ...x ? Ot(x) : {},
225
228
  ref: c,
226
229
  value: e,
227
- onChange: (r) => {
228
- l(r.target.value), Q(r.target);
230
+ onChange: (n) => {
231
+ o(n.target.value), Q(n.target);
229
232
  },
230
233
  onKeyDown: U,
231
- onClick: (r) => Q(r.currentTarget),
234
+ onClick: (n) => Q(n.currentTarget),
232
235
  onBlur: () => setTimeout(() => d(null), 150)
233
236
  }
234
237
  ),
235
- o && P && Ve(
238
+ l && P && Ze(
236
239
  /* @__PURE__ */ s(
237
240
  "div",
238
241
  {
239
- ref: B,
242
+ ref: A,
240
243
  "data-mention-menu": "",
241
244
  className: "fixed z-[110] max-h-60 overflow-y-auto rounded-md border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-popover",
242
245
  style: { top: P.top, left: P.left, width: P.width },
243
- onMouseDown: (r) => r.preventDefault(),
246
+ onMouseDown: (n) => n.preventDefault(),
244
247
  children: [
245
248
  _ && /* @__PURE__ */ s(
246
249
  "button",
247
250
  {
248
251
  type: "button",
249
- onMouseDown: (r) => {
250
- r.preventDefault(), R("__owners__");
252
+ onMouseDown: (n) => {
253
+ n.preventDefault(), R("__owners__");
251
254
  },
252
255
  onMouseEnter: () => N(0),
253
256
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${k === 0 ? "bg-nvr-cyan/10" : ""}`,
@@ -260,70 +263,70 @@ function se({
260
263
  ]
261
264
  }
262
265
  ),
263
- w.map((r, i) => {
264
- var E, O;
265
- const u = _ ? i + 1 : i, g = [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email;
266
+ w.map((n, i) => {
267
+ var g, O;
268
+ const u = _ ? i + 1 : i, C = [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email;
266
269
  return /* @__PURE__ */ s(
267
270
  "button",
268
271
  {
269
272
  type: "button",
270
- onMouseDown: (j) => {
271
- j.preventDefault(), R(r);
273
+ onMouseDown: (B) => {
274
+ B.preventDefault(), R(n);
272
275
  },
273
276
  onMouseEnter: () => N(u),
274
277
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
275
278
  children: [
276
279
  /* @__PURE__ */ s("span", { className: "relative flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy/80 dark:text-nvr-cyan", children: [
277
- (`${((E = r.first_name) == null ? void 0 : E[0]) ?? ""}${((O = r.last_name) == null ? void 0 : O[0]) ?? ""}`.trim() || r.email[0]).toUpperCase(),
278
- p(r.id) < 2 && /* @__PURE__ */ t(
280
+ (`${((g = n.first_name) == null ? void 0 : g[0]) ?? ""}${((O = n.last_name) == null ? void 0 : O[0]) ?? ""}`.trim() || n.email[0]).toUpperCase(),
281
+ p(n.id) < 2 && /* @__PURE__ */ t(
279
282
  "span",
280
283
  {
281
- "data-mention-presence": p(r.id) === 0 ? "online" : "idle",
282
- title: p(r.id) === 0 ? "Online" : "Idle",
283
- className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${p(r.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
284
+ "data-mention-presence": p(n.id) === 0 ? "online" : "idle",
285
+ title: p(n.id) === 0 ? "Online" : "Idle",
286
+ className: `absolute -bottom-px -right-px h-2 w-2 rounded-full ring-2 ring-white dark:ring-popover ${p(n.id) === 0 ? "bg-emerald-500" : "border border-amber-500 bg-white dark:bg-popover"}`
284
287
  }
285
288
  )
286
289
  ] }),
287
290
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
288
- /* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: g }),
291
+ /* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: C }),
289
292
  /* @__PURE__ */ s("span", { className: "block truncate text-[11px] text-slate-400", children: [
290
- r.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
293
+ n.is_out_of_office && /* @__PURE__ */ s("span", { className: "mr-1 rounded bg-amber-100 px-1 py-px text-[9.5px] font-semibold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400", children: [
291
294
  "OOO",
292
- r.ooo_end ? ` until ${String(r.ooo_end).slice(0, 10)}` : ""
295
+ n.ooo_end ? ` until ${String(n.ooo_end).slice(0, 10)}` : ""
293
296
  ] }),
294
297
  "@",
295
- _e(r),
296
- (r.title || r.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
298
+ Ce(n),
299
+ (n.title || n.department) && /* @__PURE__ */ s("span", { className: "text-slate-400 dark:text-slate-500", children: [
297
300
  " ยท ",
298
- [r.title, r.department].filter(Boolean).join(", ")
301
+ [n.title, n.department].filter(Boolean).join(", ")
299
302
  ] })
300
303
  ] })
301
304
  ] })
302
305
  ]
303
306
  },
304
- r.id
307
+ n.id
305
308
  );
306
309
  }),
307
- $.map((r, i) => {
310
+ E.map((n, i) => {
308
311
  const u = w.length + (_ ? 1 : 0) + i;
309
312
  return /* @__PURE__ */ s(
310
313
  "button",
311
314
  {
312
315
  type: "button",
313
- onMouseDown: (g) => {
314
- g.preventDefault(), R({ role: r.name });
316
+ onMouseDown: (C) => {
317
+ C.preventDefault(), R({ role: n.name });
315
318
  },
316
319
  onMouseEnter: () => N(u),
317
320
  className: `flex w-full items-center gap-2.5 px-2.5 py-1.5 text-left transition-colors ${u === k ? "bg-nvr-cyan/10" : ""}`,
318
321
  children: [
319
322
  /* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/15 text-[10px] font-semibold text-violet-600 dark:text-violet-300", children: "R" }),
320
323
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
321
- /* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: r.name }),
324
+ /* @__PURE__ */ t("span", { className: "block truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: n.name }),
322
325
  /* @__PURE__ */ t("span", { className: "block text-[11px] text-slate-400", children: "Role โ€” notifies every member" })
323
326
  ] })
324
327
  ]
325
328
  },
326
- `role-${r.id}`
329
+ `role-${n.id}`
327
330
  );
328
331
  })
329
332
  ]
@@ -333,7 +336,7 @@ function se({
333
336
  )
334
337
  ] });
335
338
  }
336
- function Ce(e) {
339
+ function Se(e) {
337
340
  if (e.kind === "comment") return "people";
338
341
  switch (e.note.source) {
339
342
  case "note":
@@ -345,56 +348,56 @@ function Ce(e) {
345
348
  return "system";
346
349
  }
347
350
  }
348
- const jt = {
351
+ const Ut = {
349
352
  people: "People",
350
353
  system: "System",
351
354
  integration: "Integration"
352
355
  };
353
- function Se(e) {
354
- const l = e.kind === "comment" ? e.comment.text : e.note.text;
355
- return (e.kind === "comment" ? ot(l).replace(/<[^>]*>/g, " ") : l).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
356
+ function $e(e) {
357
+ const o = e.kind === "comment" ? e.comment.text : e.note.text;
358
+ return (e.kind === "comment" ? lt(o).replace(/<[^>]*>/g, " ") : o).replace(/@\[([^\]]+)\]/g, "@$1").replace(/\s+/g, " ").trim();
356
359
  }
357
- const Lt = "integrations:";
358
- function At({
360
+ const zt = "integrations:";
361
+ function Wt({
359
362
  note: e,
360
- collection: l,
363
+ collection: o,
361
364
  item: x
362
365
  }) {
363
366
  var _;
364
- const b = Ye(), [f, c] = C(!1), m = e.source === "external" && !!e.provider && !e.provider.startsWith(Lt), d = le(), k = $e(), [N, y] = C(!1), S = A({
365
- mutationFn: (o) => d.request(K(`/comments/${e.comment_id}/reactions`, { emoji: o })),
367
+ const b = et(), [f, c] = S(!1), m = e.source === "external" && !!e.provider && !e.provider.startsWith(zt), d = le(), k = Ee(), [N, y] = S(!1), $ = L({
368
+ mutationFn: (l) => d.request(K(`/comments/${e.comment_id}/reactions`, { emoji: l })),
366
369
  onSuccess: () => {
367
370
  y(!1), k.invalidateQueries({ queryKey: ["comments-related"] }), k.invalidateQueries({ queryKey: ["row-comment-counts"] });
368
371
  },
369
- onError: () => M.error("Failed to react")
370
- }), [q, I] = C(!1), p = A({
372
+ onError: () => F.error("Failed to react")
373
+ }), [q, I] = S(!1), p = L({
371
374
  mutationFn: () => d.request(
372
375
  K(`/integration-events/${encodeURIComponent(e.provider ?? "")}/replay`, {
373
376
  entry_id: e.id.replace(/^external:/, "")
374
377
  })
375
378
  ),
376
- onSuccess: (o) => {
379
+ onSuccess: (l) => {
377
380
  var v;
378
- I(!1), M.success("Event replayed", {
379
- description: (v = o == null ? void 0 : o.data) == null ? void 0 : v.detail
381
+ I(!1), F.success("Event replayed", {
382
+ description: (v = l == null ? void 0 : l.data) == null ? void 0 : v.detail
380
383
  }), k.invalidateQueries({ queryKey: ["comments-related"] });
381
384
  },
382
- onError: (o) => {
385
+ onError: (l) => {
383
386
  var P;
384
387
  I(!1);
385
- const v = (P = o == null ? void 0 : o.response) == null ? void 0 : P.error;
386
- M.error(v ?? (o == null ? void 0 : o.message) ?? "Replay failed", { duration: 8e3 });
388
+ const v = (P = l == null ? void 0 : l.response) == null ? void 0 : P.error;
389
+ F.error(v ?? (l == null ? void 0 : l.message) ?? "Replay failed", { duration: 8e3 });
387
390
  }
388
391
  }), w = e.link ? () => {
389
- const o = e.link;
390
- if (!o) return;
391
- const v = document.querySelector(`[data-o2m-row="${o.collection}:${o.item_id}"]`);
392
+ const l = e.link;
393
+ if (!l) return;
394
+ const v = document.querySelector(`[data-o2m-row="${l.collection}:${l.item_id}"]`);
392
395
  if (v) {
393
396
  v.scrollIntoView({ behavior: "smooth", block: "center" }), v.classList.add("nvr-row-flash"), setTimeout(() => v.classList.remove("nvr-row-flash"), 2400);
394
397
  return;
395
398
  }
396
- b == null || b.open({ collection: o.collection, itemId: o.item_id });
397
- } : null, T = e.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : e.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" : e.source === "external" || e.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" : e.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", $ = e.source === "import" && ((_ = e.import) != null && _.file_id) ? e.import : null;
399
+ b == null || b.open({ collection: l.collection, itemId: l.item_id });
400
+ } : null, T = e.source === "transition" ? "border-nvr-cyan/30 bg-nvr-cyan/[0.06] text-nvr-navy dark:text-nvr-cyan" : e.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" : e.source === "external" || e.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" : e.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", E = e.source === "import" && ((_ = e.import) != null && _.file_id) ? e.import : null;
398
401
  return /* @__PURE__ */ s("div", { className: "flex gap-3", "data-recorded-note": e.source, children: [
399
402
  /* @__PURE__ */ t("div", { className: "mt-1 h-8 w-8 shrink-0", "aria-hidden": !0 }),
400
403
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
@@ -410,25 +413,25 @@ function At({
410
413
  "data-line-comment-link": !0,
411
414
  children: e.context
412
415
  }
413
- ) : $ ? /* @__PURE__ */ t(
416
+ ) : E ? /* @__PURE__ */ t(
414
417
  "a",
415
418
  {
416
- href: `/api/files/${$.file_id}?download=1`,
419
+ href: `/api/files/${E.file_id}?download=1`,
417
420
  target: "_blank",
418
421
  rel: "noreferrer",
419
- onClick: (o) => o.stopPropagation(),
422
+ onClick: (l) => l.stopPropagation(),
420
423
  className: "truncate text-[11px] text-nvr-navy underline decoration-dotted underline-offset-2 dark:text-nvr-cyan",
421
- "data-note-import-file": $.file_id ?? void 0,
424
+ "data-note-import-file": E.file_id ?? void 0,
422
425
  children: e.context
423
426
  }
424
427
  ) : /* @__PURE__ */ t("span", { className: "truncate text-[11px] text-slate-400", children: e.context })),
425
- /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(Re, { value: e.created_at }) }),
428
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", "data-tip": ie(e.created_at), children: /* @__PURE__ */ t(Pe, { value: e.created_at }) }),
426
429
  e.source === "inbound" && e.inbound && /* @__PURE__ */ t(
427
- ft,
430
+ gt,
428
431
  {
429
432
  activityId: e.inbound.activity_id,
430
433
  callerName: e.label,
431
- collection: l,
434
+ collection: o,
432
435
  itemId: x,
433
436
  align: "end",
434
437
  children: /* @__PURE__ */ t(
@@ -469,52 +472,52 @@ function At({
469
472
  }
470
473
  )
471
474
  ] }),
472
- /* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(Ie, { text: e.text }) }),
475
+ /* @__PURE__ */ t("p", { className: "mt-1 whitespace-pre-wrap break-words text-[13px] leading-snug text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ t(Re, { text: e.text }) }),
473
476
  e.comment_id && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
474
- (e.reactions ?? []).map((o) => /* @__PURE__ */ s(
477
+ (e.reactions ?? []).map((l) => /* @__PURE__ */ s(
475
478
  "button",
476
479
  {
477
480
  type: "button",
478
- onClick: () => S.mutate(o.emoji),
479
- 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"}`,
481
+ onClick: () => $.mutate(l.emoji),
482
+ className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${l.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"}`,
480
483
  children: [
481
- o.emoji,
482
- /* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children: o.count })
484
+ l.emoji,
485
+ /* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] font-semibold", children: l.count })
483
486
  ]
484
487
  },
485
- o.emoji
488
+ l.emoji
486
489
  )),
487
490
  /* @__PURE__ */ s("span", { className: "relative", children: [
488
491
  /* @__PURE__ */ t(
489
492
  "button",
490
493
  {
491
494
  type: "button",
492
- onClick: () => y((o) => !o),
495
+ onClick: () => y((l) => !l),
493
496
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
494
497
  "aria-label": "Add reaction",
495
- children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
498
+ children: /* @__PURE__ */ t(qe, { className: "h-3.5 w-3.5" })
496
499
  }
497
500
  ),
498
- N && /* @__PURE__ */ t("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: Pe.map((o) => /* @__PURE__ */ t(
501
+ N && /* @__PURE__ */ t("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: Me.map((l) => /* @__PURE__ */ t(
499
502
  "button",
500
503
  {
501
504
  type: "button",
502
- onClick: () => S.mutate(o),
505
+ onClick: () => $.mutate(l),
503
506
  className: "rounded-full px-1 text-[14px] hover:bg-muted",
504
- children: o
507
+ children: l
505
508
  },
506
- o
509
+ l
507
510
  )) })
508
511
  ] })
509
512
  ] })
510
513
  ] }),
511
514
  m && e.provider && /* @__PURE__ */ t(
512
- It,
515
+ jt,
513
516
  {
514
517
  target: f ? {
515
518
  source: e.provider,
516
519
  id: e.id.replace(/^external:/, ""),
517
- record: { collection: l, item: x }
520
+ record: { collection: o, item: x }
518
521
  } : null,
519
522
  event: { label: e.label },
520
523
  onClose: () => c(!1)
@@ -522,117 +525,119 @@ function At({
522
525
  )
523
526
  ] });
524
527
  }
525
- function ya({
528
+ function $a({
526
529
  collection: e,
527
- item: l,
530
+ item: o,
528
531
  title: x,
529
532
  defaultExpanded: b,
530
533
  queuedComments: f,
531
534
  onQueueComment: c,
532
535
  onUnsentDraft: m
533
536
  }) {
534
- const d = le(), { userId: k } = Ze(), N = dt(), y = $e(), S = gt(), [q, I] = ht(b, !1), [p, w] = C(""), T = Et(), $ = te(m);
535
- $.current = m, qe(() => {
536
- var n;
537
- (n = $.current) == null || n.call($, p);
537
+ const d = le(), { userId: k } = Ye(), N = ct(), y = Ee(), $ = yt(), [q, I] = bt(b, !1), [p, w] = S(""), T = Pt(), E = te(m);
538
+ E.current = m, De(() => {
539
+ var r;
540
+ (r = E.current) == null || r.call(E, p);
538
541
  }, [p]);
539
- const [_, o] = C(!1), v = async () => {
540
- var n;
542
+ const [_, l] = S(!1), v = async () => {
543
+ var r;
541
544
  if (!(!p.trim() || _)) {
542
- o(!0);
545
+ l(!0);
543
546
  try {
544
547
  const a = await d.request(
545
548
  K("/ai/cleanup", { text: p })
546
549
  );
547
- (n = a.data) != null && n.text && w(a.data.text);
550
+ (r = a.data) != null && r.text && w(a.data.text);
548
551
  } catch {
549
552
  } finally {
550
- o(!1);
553
+ l(!1);
551
554
  }
552
555
  }
553
- }, P = ct(e, l);
554
- mt(e, l, p);
555
- const [G, B] = C(null), [Q, R] = C(null), [U, r] = C(""), i = !l || l === "new", u = ["comments", e, String(l)], { data: g, isLoading: E, isError: O } = W({
556
+ }, P = mt(e, o);
557
+ pt(e, o, p);
558
+ const [H, A] = S(null), [Q, R] = S(null), [U, n] = S(""), i = !o || o === "new", u = ["comments", e, String(o)], C = _t(i ? null : { kind: "record", id: `${e}:${o}` }, {
559
+ mayCreate: !1
560
+ }), { data: g, isLoading: O, isError: B } = W({
556
561
  queryKey: u,
557
- queryFn: () => d.request(H("/comments", { collection: e, item: l })).then((n) => n.data),
562
+ queryFn: () => d.request(G("/comments", { collection: e, item: o })).then((r) => r.data),
558
563
  enabled: !i
559
- }), j = z(() => (g ?? []).filter((n) => !n.deleted), [g]), J = nt(p, g, k || N), de = te(null);
560
- wt(de, J.replies.length);
561
- const { data: Me } = W({
562
- queryKey: ["comments-related", e, String(l)],
563
- queryFn: () => d.request(H("/comments/related", { collection: e, item: l })).then((n) => n.data ?? []).catch(() => []),
564
+ }), de = z(() => (g ?? []).filter((r) => !r.deleted), [g]), J = nt(p, g, k || N), ce = te(null);
565
+ Tt(ce, J.replies.length);
566
+ const { data: Oe } = W({
567
+ queryKey: ["comments-related", e, String(o)],
568
+ queryFn: () => d.request(G("/comments/related", { collection: e, item: o })).then((r) => r.data ?? []).catch(() => []),
564
569
  enabled: !i,
565
570
  staleTime: 3e4
566
- }), ce = Me ?? [], F = z(() => {
567
- const n = j.map((h) => ({ kind: "comment", at: h.created_at, comment: h })), a = ce.map((h) => ({ kind: "related", at: h.created_at, note: h }));
568
- return [...n, ...a].sort((h, L) => new Date(L.at).getTime() - new Date(h.at).getTime());
569
- }, [j, ce]), [X, Oe] = C(() => /* @__PURE__ */ new Set()), [V, je] = C(""), me = z(() => {
570
- const n = { people: 0, system: 0, integration: 0 };
571
- for (const a of F) n[Ce(a)]++;
572
- return n;
573
- }, [F]), pe = i ? (f ?? []).length : me.people, Le = z(
574
- () => (g ?? []).map((n) => {
571
+ }), me = Oe ?? [], M = z(() => {
572
+ const r = de.map((h) => ({ kind: "comment", at: h.created_at, comment: h })), a = me.map((h) => ({ kind: "related", at: h.created_at, note: h }));
573
+ return [...r, ...a].sort((h, j) => new Date(j.at).getTime() - new Date(h.at).getTime());
574
+ }, [de, me]), [X, je] = S(() => /* @__PURE__ */ new Set()), [V, Le] = S(""), pe = z(() => {
575
+ const r = { people: 0, system: 0, integration: 0 };
576
+ for (const a of M) r[Se(a)]++;
577
+ return r;
578
+ }, [M]), ue = i ? (f ?? []).length : pe.people, Ae = z(
579
+ () => (g ?? []).map((r) => {
575
580
  var a;
576
- return { at: n.created_at, by: ((a = n.user) == null ? void 0 : a.id) ?? null };
581
+ return { at: r.created_at, by: ((a = r.user) == null ? void 0 : a.id) ?? null };
577
582
  }),
578
583
  [g]
579
- ), Ae = xt({
584
+ ), Be = ht({
580
585
  userId: k,
581
586
  collection: e,
582
- item: l,
587
+ item: o,
583
588
  tab: "comments",
584
589
  open: q,
585
- entries: Le,
590
+ entries: Ae,
586
591
  ready: !i && !!g
587
592
  }), ae = z(() => {
588
- const n = V.trim().toLowerCase();
589
- return F.filter((a) => X.has(Ce(a)) ? !1 : n ? (a.kind === "comment" ? `${a.comment.text} ${Fe(a.comment.user)}` : `${a.note.text} ${a.note.user_name ?? ""} ${a.note.label} ${a.note.context ?? ""} ${a.note.provider ?? ""}`).toLowerCase().includes(n) : !0);
590
- }, [F, X, V]), Be = (n) => Oe((a) => {
593
+ const r = V.trim().toLowerCase();
594
+ return M.filter((a) => X.has(Se(a)) ? !1 : r ? (a.kind === "comment" ? `${a.comment.text} ${Fe(a.comment.user)}` : `${a.note.text} ${a.note.user_name ?? ""} ${a.note.label} ${a.note.context ?? ""} ${a.note.provider ?? ""}`).toLowerCase().includes(r) : !0);
595
+ }, [M, X, V]), Ke = (r) => je((a) => {
591
596
  const h = new Set(a);
592
- return h.has(n) ? h.delete(n) : h.add(n), h;
593
- }), Ke = X.size > 0 || V.trim() !== "", ne = A({
594
- mutationFn: (n) => d.request(K("/comments", { collection: e, item: l, text: n })),
597
+ return h.has(r) ? h.delete(r) : h.add(r), h;
598
+ }), Qe = X.size > 0 || V.trim() !== "", re = L({
599
+ mutationFn: (r) => d.request(K("/comments", { collection: e, item: o, text: r })),
595
600
  onSuccess: () => {
596
601
  y.invalidateQueries({ queryKey: u }), w(""), T.reset();
597
602
  },
598
- onError: () => M.error("Failed to post comment")
599
- }), ue = A({
600
- mutationFn: ({ id: n, text: a }) => d.request(tt(`/comments/${n}`, { text: a })),
603
+ onError: () => F.error("Failed to post comment")
604
+ }), xe = L({
605
+ mutationFn: ({ id: r, text: a }) => d.request(at(`/comments/${r}`, { text: a })),
601
606
  onSuccess: () => {
602
- y.invalidateQueries({ queryKey: u }), B(null), r("");
607
+ y.invalidateQueries({ queryKey: u }), A(null), n("");
603
608
  },
604
- onError: () => M.error("Failed to update comment")
605
- }), re = A({
606
- mutationFn: (n) => d.request(at(`/comments/${n}`)),
609
+ onError: () => F.error("Failed to update comment")
610
+ }), ne = L({
611
+ mutationFn: (r) => d.request(rt(`/comments/${r}`)),
607
612
  onSuccess: () => y.invalidateQueries({ queryKey: u }),
608
- onError: () => M.error("Failed to delete comment")
609
- }), xe = A({
610
- mutationFn: ({ id: n, emoji: a }) => d.request(K(`/comments/${n}/reactions`, { emoji: a })),
613
+ onError: () => F.error("Failed to delete comment")
614
+ }), he = L({
615
+ mutationFn: ({ id: r, emoji: a }) => d.request(K(`/comments/${r}/reactions`, { emoji: a })),
611
616
  onSuccess: () => y.invalidateQueries({ queryKey: u }),
612
- onError: () => M.error("Failed to react")
613
- }), [he, be] = C(null), Qe = A({
614
- mutationFn: (n) => d.request(
617
+ onError: () => F.error("Failed to react")
618
+ }), [be, fe] = S(null), Ue = L({
619
+ mutationFn: (r) => d.request(
615
620
  K("/tasks", {
616
621
  collection: e,
617
- item: l,
618
- title: n.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
622
+ item: o,
623
+ title: r.text.replace(/<[^>]*>/g, "").replace(/@\[([^\]]+)\]/g, "@$1").slice(0, 200),
619
624
  assignee: k
620
625
  })
621
626
  ),
622
627
  onSuccess: () => {
623
- ut(y, e, l), M.success("Task created from comment โ€” assigned to you");
628
+ xt(y, e, o), F.success("Task created from comment โ€” assigned to you");
624
629
  },
625
- onError: () => M.error("Could not create a task")
630
+ onError: () => F.error("Could not create a task")
626
631
  });
627
- function fe(n) {
628
- if (n.preventDefault(), i && c) {
632
+ function ge(r) {
633
+ if (r.preventDefault(), i && c) {
629
634
  if (!p.trim()) return;
630
635
  c(p.trim()), w("");
631
636
  } else {
632
637
  if (T.uploading) return;
633
638
  const a = T.compose(p);
634
639
  if (!a) return;
635
- ne.mutate(a);
640
+ re.mutate(a);
636
641
  }
637
642
  }
638
643
  return (
@@ -650,44 +655,44 @@ function ya({
650
655
  {
651
656
  type: "button",
652
657
  "data-panel-toggle": "notes",
653
- onClick: () => I((n) => !n),
658
+ onClick: () => I((r) => !r),
654
659
  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]",
655
660
  children: [
656
661
  /* @__PURE__ */ s("span", { className: "flex w-full items-center gap-2.5", children: [
657
- /* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
662
+ /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
658
663
  /* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: x || "Comments" }),
659
- pe > 0 && /* @__PURE__ */ t(
664
+ ue > 0 && /* @__PURE__ */ t(
660
665
  "span",
661
666
  {
662
667
  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",
663
668
  "data-notes-badge": !0,
664
- children: pe
669
+ children: ue
665
670
  }
666
671
  ),
667
- /* @__PURE__ */ t(Rt, { count: Ae, tab: "comments" }),
672
+ /* @__PURE__ */ t(Lt, { count: Be, tab: "comments" }),
668
673
  /* @__PURE__ */ t(
669
- ze,
674
+ We,
670
675
  {
671
676
  className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${q ? " rotate-180" : ""}`
672
677
  }
673
678
  )
674
679
  ] }),
675
- !q && !i && F.length > 0 && (() => {
676
- const n = F[0], a = n.kind === "comment" ? Y(n.comment) : n.note.user_name ?? "System", h = Se(n);
680
+ !q && !i && M.length > 0 && (() => {
681
+ const r = M[0], a = r.kind === "comment" ? Y(r.comment) : r.note.user_name ?? "System", h = $e(r);
677
682
  return h ? /* @__PURE__ */ s("span", { className: "mt-1 w-full truncate pl-6 text-[11.5px] text-slate-400", children: [
678
683
  /* @__PURE__ */ s("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: [
679
684
  a,
680
685
  ":"
681
686
  ] }),
682
687
  " ",
683
- /* @__PURE__ */ t(Ie, { text: h, plain: !0 })
688
+ /* @__PURE__ */ t(Re, { text: h, plain: !0 })
684
689
  ] }) : null;
685
690
  })()
686
691
  ]
687
692
  }
688
693
  ),
689
694
  q && /* @__PURE__ */ t("div", { className: "border-t border-slate-100 px-5 py-4 dark:border-border/60", children: i ? /* @__PURE__ */ s("div", { className: "space-y-4", children: [
690
- /* @__PURE__ */ s("form", { onSubmit: fe, className: "space-y-2", children: [
695
+ /* @__PURE__ */ s("form", { onSubmit: ge, className: "space-y-2", children: [
691
696
  /* @__PURE__ */ t(
692
697
  se,
693
698
  {
@@ -704,14 +709,14 @@ function ya({
704
709
  ] })
705
710
  ] }),
706
711
  (f ?? []).length > 0 && /* @__PURE__ */ s("div", { className: "space-y-2", children: [
707
- /* @__PURE__ */ t(ke, {}),
708
- (f ?? []).map((n, a) => /* @__PURE__ */ s(
712
+ /* @__PURE__ */ t(Ne, {}),
713
+ (f ?? []).map((r, a) => /* @__PURE__ */ s(
709
714
  "div",
710
715
  {
711
716
  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",
712
717
  children: [
713
718
  /* @__PURE__ */ t("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" }),
714
- /* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: n })
719
+ /* @__PURE__ */ t("p", { className: "text-[13px] leading-relaxed text-slate-600 dark:text-slate-300", children: r })
715
720
  ]
716
721
  },
717
722
  a
@@ -719,19 +724,20 @@ function ya({
719
724
  ] })
720
725
  ] }) : /* @__PURE__ */ s(ee, { children: [
721
726
  J.replies.length > 0 && /* @__PURE__ */ t("div", { className: "mb-2", children: /* @__PURE__ */ t(
722
- _t,
727
+ qt,
723
728
  {
724
- replies: J.replies.map((n) => ({
725
- id: n.id,
726
- name: Y(n),
727
- text: Se({ kind: "comment", comment: n }),
728
- created_at: n.created_at
729
+ replies: J.replies.map((r) => ({
730
+ id: r.id,
731
+ name: Y(r),
732
+ text: $e({ kind: "comment", comment: r }),
733
+ created_at: r.created_at
729
734
  })),
730
735
  onDismiss: J.dismiss,
731
- onJump: Ct
736
+ onJump: Dt
732
737
  }
733
738
  ) }),
734
- /* @__PURE__ */ s("form", { ref: de, onSubmit: fe, className: "space-y-2", children: [
739
+ /* @__PURE__ */ s("form", { ref: ce, onSubmit: ge, className: "space-y-2", children: [
740
+ C.shown.length > 0 && /* @__PURE__ */ t(vt, {}),
735
741
  /* @__PURE__ */ t(
736
742
  se,
737
743
  {
@@ -743,7 +749,7 @@ function ya({
743
749
  className: "text-[13px]"
744
750
  }
745
751
  ),
746
- /* @__PURE__ */ t(Tt, { images: T }),
752
+ /* @__PURE__ */ t(Mt, { images: T }),
747
753
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
748
754
  /* @__PURE__ */ t("p", { className: "text-[11px] text-slate-400", children: "Type @ plus two letters to mention a teammate, or @owners to notify everyone currently assigned." }),
749
755
  /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5", children: [
@@ -763,87 +769,87 @@ function ya({
763
769
  {
764
770
  type: "submit",
765
771
  size: "sm",
766
- disabled: !p.trim() && !T.hasReady || T.uploading || ne.isPending,
767
- children: ne.isPending ? "Postingโ€ฆ" : T.uploading ? "Uploadingโ€ฆ" : "Comment"
772
+ disabled: !p.trim() && !T.hasReady || T.uploading || re.isPending,
773
+ children: re.isPending ? "Postingโ€ฆ" : T.uploading ? "Uploadingโ€ฆ" : "Comment"
768
774
  }
769
775
  )
770
776
  ] })
771
777
  ] })
772
778
  ] }),
773
- P.map((n) => /* @__PURE__ */ s(
779
+ P.map((r) => /* @__PURE__ */ s(
774
780
  "p",
775
781
  {
776
782
  className: "flex items-center gap-1.5 text-[11.5px] italic text-slate-400 dark:text-slate-500",
777
- "data-note-typing": n.field ?? "",
783
+ "data-note-typing": r.field ?? "",
778
784
  "aria-live": "polite",
779
785
  children: [
780
786
  /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan motion-reduce:animate-none" }),
781
- pt(
782
- n.names,
783
- n.field ? `replying on ${(S == null ? void 0 : S.labelOf(n.field)) ?? ye(n.field)}` : "replying"
787
+ ut(
788
+ r.names,
789
+ r.field ? `replying on ${($ == null ? void 0 : $.labelOf(r.field)) ?? ve(r.field)}` : "replying"
784
790
  ),
785
791
  "โ€ฆ"
786
792
  ]
787
793
  },
788
- n.field ?? ""
794
+ r.field ?? ""
789
795
  )),
790
- /* @__PURE__ */ t(ke, { className: "my-4" }),
791
- F.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
792
- ["people", "system", "integration"].map((n) => {
793
- const a = !X.has(n), h = me[n];
796
+ /* @__PURE__ */ t(Ne, { className: "my-4" }),
797
+ M.length > 0 && /* @__PURE__ */ s("div", { className: "mb-3 flex flex-wrap items-center gap-1.5", "data-notes-filters": !0, children: [
798
+ ["people", "system", "integration"].map((r) => {
799
+ const a = !X.has(r), h = pe[r];
794
800
  return /* @__PURE__ */ s(
795
801
  "button",
796
802
  {
797
803
  type: "button",
798
- onClick: () => Be(n),
804
+ onClick: () => Ke(r),
799
805
  "aria-pressed": a,
800
- "data-notes-filter": n,
806
+ "data-notes-filter": r,
801
807
  disabled: h === 0 && a,
802
808
  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`,
803
- title: n === "people" ? "Comments and notes people wrote" : n === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
809
+ title: r === "people" ? "Comments and notes people wrote" : r === "system" ? "State changes, change reasons, addendums and imports" : "Events an integration recorded",
804
810
  children: [
805
- jt[n],
811
+ Ut[r],
806
812
  /* @__PURE__ */ t("span", { className: "tabular-nums text-[10px] opacity-70", children: h })
807
813
  ]
808
814
  },
809
- n
815
+ r
810
816
  );
811
817
  }),
812
818
  /* @__PURE__ */ t(
813
819
  "input",
814
820
  {
815
821
  value: V,
816
- onChange: (n) => je(n.target.value),
822
+ onChange: (r) => Le(r.target.value),
817
823
  placeholder: "Search notesโ€ฆ",
818
824
  "aria-label": "Search notes",
819
825
  "data-notes-search": !0,
820
826
  className: "ml-auto h-6 w-[150px] rounded-md border border-slate-200 bg-background px-2 text-[11.5px] dark:border-border"
821
827
  }
822
828
  ),
823
- Ke && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
829
+ Qe && /* @__PURE__ */ s("span", { className: "text-[10.5px] tabular-nums text-slate-400", "data-notes-shown": !0, children: [
824
830
  ae.length,
825
831
  " of ",
826
- F.length
832
+ M.length
827
833
  ] })
828
834
  ] }),
829
- E ? /* @__PURE__ */ t("div", { className: "space-y-4", children: ["a", "b"].map((n) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
835
+ O ? /* @__PURE__ */ t("div", { className: "space-y-4", children: ["a", "b"].map((r) => /* @__PURE__ */ s("div", { className: "flex gap-3", children: [
830
836
  /* @__PURE__ */ t("div", { className: "h-8 w-8 shrink-0 animate-pulse rounded-full bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
831
837
  /* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
832
838
  /* @__PURE__ */ t("div", { className: "h-3 w-32 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
833
839
  /* @__PURE__ */ t("div", { className: "h-3 w-full animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
834
840
  ] })
835
- ] }, n)) }) : O ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : F.length === 0 ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ae.length === 0 ? /* @__PURE__ */ t("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__ */ t("div", { className: "nvr-stagger-direct space-y-4", children: ae.map((n) => {
836
- var ge;
837
- if (n.kind === "related")
841
+ ] }, r)) }) : B ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-red-500", children: "Failed to load comments." }) : M.length === 0 ? /* @__PURE__ */ t("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "No notes yet." }) : ae.length === 0 ? /* @__PURE__ */ t("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__ */ t("div", { className: "nvr-stagger-direct space-y-4", children: ae.map((r) => {
842
+ var ye;
843
+ if (r.kind === "related")
838
844
  return /* @__PURE__ */ t("div", { className: "nvr-section-enter", children: /* @__PURE__ */ t(
839
- At,
845
+ Wt,
840
846
  {
841
- note: n.note,
847
+ note: r.note,
842
848
  collection: e,
843
- item: String(l)
849
+ item: String(o)
844
850
  }
845
- ) }, n.note.id);
846
- const a = n.comment, h = k === a.user.id, L = G === a.id;
851
+ ) }, r.note.id);
852
+ const a = r.comment, h = k === a.user.id, j = H === a.id;
847
853
  return /* @__PURE__ */ s(
848
854
  "div",
849
855
  {
@@ -851,43 +857,49 @@ function ya({
851
857
  className: "nvr-section-enter group flex gap-3 rounded-lg",
852
858
  children: [
853
859
  /* @__PURE__ */ t(
854
- yt,
860
+ Ct,
855
861
  {
856
862
  userId: a.user.id,
857
863
  className: "h-8 w-8",
858
- fallback: /* @__PURE__ */ t(vt, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t(kt, { className: "bg-[#cbd5e1] text-[11px] font-semibold text-[#334155] dark:bg-[#475569] dark:text-[#f1f5f9]", children: Pt(a.user) }) })
864
+ fallback: /* @__PURE__ */ t(St, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ t($t, { className: "bg-[#cbd5e1] text-[11px] font-semibold text-[#334155] dark:bg-[#475569] dark:text-[#f1f5f9]", children: At(a.user) }) })
859
865
  }
860
866
  ),
861
867
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
862
868
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
863
- /* @__PURE__ */ t(
869
+ a.tracker ? /* @__PURE__ */ t(
870
+ kt,
871
+ {
872
+ from: a.tracker,
873
+ className: "text-[13px] font-medium text-slate-800 dark:text-slate-100"
874
+ }
875
+ ) : /* @__PURE__ */ t(
864
876
  "span",
865
877
  {
866
878
  className: "text-[13px] font-medium text-slate-800",
867
- "data-comment-acting-admin": ((ge = a.acting_admin) == null ? void 0 : ge.id) || void 0,
879
+ "data-comment-acting-admin": ((ye = a.acting_admin) == null ? void 0 : ye.id) || void 0,
868
880
  children: Y(a)
869
881
  }
870
882
  ),
871
- /* @__PURE__ */ t(bt, { label: a.via_agent }),
883
+ /* @__PURE__ */ t(ft, { label: a.via_agent }),
872
884
  /* @__PURE__ */ t(
873
885
  "span",
874
886
  {
875
887
  className: "text-[11px] text-slate-400",
876
888
  "data-tip": ie(a.created_at),
877
- children: /* @__PURE__ */ t(Re, { value: a.created_at })
889
+ children: /* @__PURE__ */ t(Pe, { value: a.created_at })
878
890
  }
879
891
  ),
880
892
  a.updated_at && a.updated_at !== a.created_at && /* @__PURE__ */ t("span", { className: "text-[10px] text-slate-300", children: "(edited)" }),
881
893
  a.field && /* @__PURE__ */ t(
882
- Mt,
894
+ Kt,
883
895
  {
884
896
  field: a.field,
885
- label: (S == null ? void 0 : S.labelOf(a.field)) ?? ye(a.field),
897
+ label: ($ == null ? void 0 : $.labelOf(a.field)) ?? ve(a.field),
886
898
  resolved: !!a.resolved_at,
887
- onJump: S ? () => S.jump(a.field) : void 0
899
+ onJump: $ ? () => $.jump(a.field) : void 0
888
900
  }
889
901
  ),
890
- !L && /* @__PURE__ */ s(
902
+ !j && /* @__PURE__ */ s(
891
903
  "div",
892
904
  {
893
905
  className: `ml-auto flex items-center gap-1 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${Q === a.id ? "opacity-100" : "opacity-0"}`,
@@ -899,8 +911,8 @@ function ya({
899
911
  title: "Make a task from this comment",
900
912
  "aria-label": "Make a task from this comment",
901
913
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted",
902
- onClick: () => Qe.mutate(a),
903
- children: /* @__PURE__ */ t(We, { className: "h-3 w-3" })
914
+ onClick: () => Ue.mutate(a),
915
+ children: /* @__PURE__ */ t(Ge, { className: "h-3 w-3" })
904
916
  }
905
917
  ),
906
918
  h && (Q === a.id ? /* @__PURE__ */ s(ee, { children: [
@@ -909,13 +921,13 @@ function ya({
909
921
  {
910
922
  type: "button",
911
923
  autoFocus: !0,
912
- disabled: re.isPending,
924
+ disabled: ne.isPending,
913
925
  "data-comment-delete-confirm": a.id,
914
926
  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",
915
- onClick: () => re.mutate(a.id, {
927
+ onClick: () => ne.mutate(a.id, {
916
928
  onSettled: () => R(null)
917
929
  }),
918
- children: re.isPending ? "Deletingโ€ฆ" : "Delete comment?"
930
+ children: ne.isPending ? "Deletingโ€ฆ" : "Delete comment?"
919
931
  }
920
932
  ),
921
933
  /* @__PURE__ */ t(
@@ -936,7 +948,7 @@ function ya({
936
948
  "aria-label": "Edit comment",
937
949
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",
938
950
  onClick: () => {
939
- B(a.id), r(a.text);
951
+ A(a.id), n(a.text);
940
952
  },
941
953
  children: /* @__PURE__ */ t(He, { className: "h-3 w-3" })
942
954
  }
@@ -949,7 +961,7 @@ function ya({
949
961
  "aria-label": "Delete comment",
950
962
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500",
951
963
  onClick: () => R(a.id),
952
- children: /* @__PURE__ */ t(Ge, { className: "h-3 w-3" })
964
+ children: /* @__PURE__ */ t(Je, { className: "h-3 w-3" })
953
965
  }
954
966
  )
955
967
  ] }))
@@ -957,12 +969,12 @@ function ya({
957
969
  }
958
970
  )
959
971
  ] }),
960
- L ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
972
+ j ? /* @__PURE__ */ s("div", { className: "mt-1.5 space-y-2", children: [
961
973
  /* @__PURE__ */ t(
962
974
  se,
963
975
  {
964
976
  value: U,
965
- onChange: r,
977
+ onChange: n,
966
978
  rows: 3,
967
979
  className: "text-[13px]"
968
980
  }
@@ -973,10 +985,10 @@ function ya({
973
985
  {
974
986
  size: "sm",
975
987
  className: "h-7 gap-1.5",
976
- disabled: !U.trim() || ue.isPending,
977
- onClick: () => ue.mutate({ id: a.id, text: U.trim() }),
988
+ disabled: !U.trim() || xe.isPending,
989
+ onClick: () => xe.mutate({ id: a.id, text: U.trim() }),
978
990
  children: [
979
- /* @__PURE__ */ t(Ee, { className: "h-3 w-3" }),
991
+ /* @__PURE__ */ t(Te, { className: "h-3 w-3" }),
980
992
  " Save"
981
993
  ]
982
994
  }
@@ -988,46 +1000,52 @@ function ya({
988
1000
  variant: "outline",
989
1001
  className: "h-7 gap-1.5",
990
1002
  onClick: () => {
991
- B(null), r("");
1003
+ A(null), n("");
992
1004
  },
993
1005
  children: [
994
- /* @__PURE__ */ t(Je, { className: "h-3 w-3" }),
1006
+ /* @__PURE__ */ t(Xe, { className: "h-3 w-3" }),
995
1007
  " Cancel"
996
1008
  ]
997
1009
  }
998
1010
  )
999
1011
  ] })
1000
- ] }) : /* @__PURE__ */ t(
1001
- qt,
1012
+ ] }) : a.tracker ? /* @__PURE__ */ t(
1013
+ Nt,
1014
+ {
1015
+ text: a.text,
1016
+ className: "mt-0.5 text-[13px] leading-relaxed text-slate-600 dark:text-slate-300"
1017
+ }
1018
+ ) : /* @__PURE__ */ t(
1019
+ Ft,
1002
1020
  {
1003
1021
  text: a.text,
1004
- record: { collection: e, itemId: l },
1005
- caption: `${Y(a)} ยท ${De(a.created_at)}`,
1022
+ record: { collection: e, itemId: o },
1023
+ caption: `${Y(a)} ยท ${Ie(a.created_at)}`,
1006
1024
  className: "mt-0.5 whitespace-pre-wrap text-[13px] leading-relaxed text-slate-600"
1007
1025
  }
1008
1026
  ),
1009
- !L && /* @__PURE__ */ t(
1010
- Ft,
1027
+ !j && /* @__PURE__ */ t(
1028
+ Bt,
1011
1029
  {
1012
1030
  comment: a,
1013
1031
  collection: e,
1014
- item: String(l)
1032
+ item: String(o)
1015
1033
  }
1016
1034
  ),
1017
- !L && /* @__PURE__ */ t(
1018
- St,
1035
+ !j && /* @__PURE__ */ t(
1036
+ It,
1019
1037
  {
1020
1038
  people: a.seen_by,
1021
1039
  hasMentions: oe(a).length > 0,
1022
1040
  exclude: new Set(oe(a).map((D) => String(D.id).toUpperCase()))
1023
1041
  }
1024
1042
  ),
1025
- !L && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
1043
+ !j && /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-1", children: [
1026
1044
  (a.reactions ?? []).map((D) => /* @__PURE__ */ s(
1027
1045
  "button",
1028
1046
  {
1029
1047
  type: "button",
1030
- onClick: () => xe.mutate({ id: a.id, emoji: D.emoji }),
1048
+ onClick: () => he.mutate({ id: a.id, emoji: D.emoji }),
1031
1049
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-px text-[11px] transition-colors ${D.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"}`,
1032
1050
  children: [
1033
1051
  D.emoji,
@@ -1041,18 +1059,18 @@ function ya({
1041
1059
  "button",
1042
1060
  {
1043
1061
  type: "button",
1044
- onClick: () => be(he === a.id ? null : a.id),
1062
+ onClick: () => fe(be === a.id ? null : a.id),
1045
1063
  className: "rounded p-0.5 text-slate-300 transition-colors hover:bg-slate-100 hover:text-slate-500 dark:hover:bg-muted",
1046
1064
  "aria-label": "Add reaction",
1047
- children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
1065
+ children: /* @__PURE__ */ t(qe, { className: "h-3.5 w-3.5" })
1048
1066
  }
1049
1067
  ),
1050
- he === a.id && /* @__PURE__ */ t("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: Pe.map((D) => /* @__PURE__ */ t(
1068
+ be === a.id && /* @__PURE__ */ t("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: Me.map((D) => /* @__PURE__ */ t(
1051
1069
  "button",
1052
1070
  {
1053
1071
  type: "button",
1054
1072
  onClick: () => {
1055
- xe.mutate({ id: a.id, emoji: D }), be(null);
1073
+ he.mutate({ id: a.id, emoji: D }), fe(null);
1056
1074
  },
1057
1075
  className: "rounded-full px-1 text-[14px] hover:bg-muted",
1058
1076
  children: D
@@ -1074,7 +1092,7 @@ function ya({
1074
1092
  );
1075
1093
  }
1076
1094
  export {
1077
- ya as CommentPanel,
1095
+ $a as CommentPanel,
1078
1096
  se as MentionTextarea,
1079
- Se as notePreviewText
1097
+ $e as notePreviewText
1080
1098
  };