@nivaro/react 0.3.99 → 0.3.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useFormSchema.js +82 -85
  3. package/dist/hooks/useSessionRecorder.js +206 -175
  4. package/dist/index.d.ts +84 -16
  5. package/dist/index.js +627 -622
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/ActivityEntry.js +5 -5
  8. package/dist/shared/components/CollectionBrowserView.js +516 -503
  9. package/dist/shared/components/ItemEditForm.js +3471 -3465
  10. package/dist/shared/components/JobsTray.js +76 -61
  11. package/dist/shared/components/MyWorkView.js +133 -126
  12. package/dist/shared/components/NotificationBell.js +322 -289
  13. package/dist/shared/components/RecordCompare.js +38 -40
  14. package/dist/shared/components/RecordReadView.js +119 -119
  15. package/dist/shared/components/TipLayer.js +56 -41
  16. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  18. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  19. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  20. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  21. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  22. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  23. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  24. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  25. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  26. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  27. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  28. package/dist/shared/components/item-edit/related-missing.js +75 -19
  29. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  30. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  31. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  32. package/dist/shared/components/panels/BackgroundMove.js +242 -0
  33. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  34. package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
  35. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  36. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  37. package/dist/shared/components/profile/DayTimeline.js +145 -140
  38. package/dist/shared/components/profile/PersonAccess.js +679 -383
  39. package/dist/shared/components/profile/PersonActivity.js +404 -427
  40. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  41. package/dist/shared/components/profile/PersonProfile.js +33 -32
  42. package/dist/shared/components/profile/journey-view.js +166 -0
  43. package/dist/shared/lib/activity-sentence.js +319 -236
  44. package/dist/shared/lib/commands.js +18 -14
  45. package/dist/shared/lib/error-hints.js +1 -1
  46. package/dist/shared/lib/job-failure-text.js +12 -0
  47. package/dist/shared/lib/jobs-tray.js +60 -41
  48. package/dist/shared/lib/move-failure.js +19 -0
  49. package/dist/shared/lib/obligation-banner.js +22 -21
  50. package/dist/shared/lib/partner-failure.js +83 -0
  51. package/dist/shared/lib/prefetch.js +73 -73
  52. package/dist/shared/lib/replay-checkout.js +18 -13
  53. package/dist/shared/lib/replay-context.js +90 -77
  54. package/dist/shared/lib/replay-idle.js +21 -0
  55. package/dist/shared/lib/replay-socket.js +21 -17
  56. package/dist/shared/lib/rum.js +56 -51
  57. package/dist/shared/lib/safe-error.js +17 -13
  58. package/dist/shared/lib/stale-chunk.js +69 -26
  59. package/dist/shared/lib/system-collections.js +20 -0
  60. package/package.json +1 -1
@@ -1,55 +1,55 @@
1
- import { jsxs as o, jsx as s, Fragment as w } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as n, Fragment as w } from "react/jsx-runtime";
2
2
  import { useQuery as p } from "@tanstack/react-query";
3
3
  import { Info as N } from "lucide-react";
4
4
  import { useState as y, useRef as k, useEffect as _ } from "react";
5
- import { useNivaroClient as m } from "../../context.js";
5
+ import { useNivaroClient as h } from "../../context.js";
6
6
  import { get as u } from "../../lib/commands.js";
7
7
  import { toLocalDateString as f, formatDateTime as v } from "../../lib/utils.js";
8
- function P(a, t, n) {
9
- for (const r of [
10
- ["record-audience", t, n],
11
- ["erp-submissions", t, String(n)],
12
- ["integration-obligations", "record", t, String(n)],
13
- ["record-integrations", t, n],
14
- ["record-external-ids", t, n],
15
- ["record-owner-history", t, n],
16
- ["record-mail-log", t, n],
17
- ["record-chat-mentions", t, n]
8
+ function P(a, t, r) {
9
+ for (const s of [
10
+ ["record-audience", t, r],
11
+ ["erp-submissions", t, String(r)],
12
+ ["integration-obligations", "record", t, String(r)],
13
+ ["record-integrations", t, r],
14
+ ["record-external-ids", t, r],
15
+ ["record-owner-history", t, r],
16
+ ["record-mail-log", t, r],
17
+ ["record-chat-mentions", t, r]
18
18
  ])
19
- a.invalidateQueries({ queryKey: r });
19
+ a.invalidateQueries({ queryKey: s });
20
20
  }
21
- function U(a, t, n) {
22
- a.invalidateQueries({ queryKey: ["item", t, n] }), a.invalidateQueries({
23
- predicate: (r) => r.queryKey[0] === "o2m-rows" && String(r.queryKey[3]) === n
24
- }), a.invalidateQueries({ queryKey: ["child-summary", t, n] }), a.invalidateQueries({ queryKey: ["last-touch", t, n] }), a.invalidateQueries({ queryKey: ["sla-breach", t, n] }), a.invalidateQueries({
25
- predicate: (r) => (r.queryKey[0] === "item-actions" || r.queryKey[0] === "ext-item-actions") && r.queryKey[1] === t && String(r.queryKey[2]) === n
26
- }), q(a, t, n);
21
+ function U(a, t, r) {
22
+ a.invalidateQueries({ queryKey: ["item", t, r] }), a.invalidateQueries({ queryKey: ["resolve-paths", t, r] }), a.invalidateQueries({
23
+ predicate: (s) => s.queryKey[0] === "o2m-rows" && String(s.queryKey[3]) === r
24
+ }), a.invalidateQueries({ queryKey: ["child-summary", t, r] }), a.invalidateQueries({ queryKey: ["last-touch", t, r] }), a.invalidateQueries({ queryKey: ["sla-breach", t, r] }), a.invalidateQueries({
25
+ predicate: (s) => (s.queryKey[0] === "item-actions" || s.queryKey[0] === "ext-item-actions") && s.queryKey[1] === t && String(s.queryKey[2]) === r
26
+ }), q(a, t, r);
27
27
  }
28
28
  const $ = 4e3;
29
- function q(a, t, n) {
29
+ function q(a, t, r) {
30
30
  var e;
31
- const r = () => {
32
- a.invalidateQueries({ queryKey: ["comments", t, n] }), a.invalidateQueries({ queryKey: ["comments-related", t, n] });
31
+ const s = () => {
32
+ a.invalidateQueries({ queryKey: ["comments", t, r] }), a.invalidateQueries({ queryKey: ["comments-related", t, r] });
33
33
  };
34
- r();
35
- const l = setTimeout(r, $);
34
+ s();
35
+ const l = setTimeout(s, $);
36
36
  (e = l.unref) == null || e.call(l);
37
37
  }
38
38
  function W({
39
39
  collection: a,
40
40
  itemId: t,
41
- compact: n
41
+ compact: r
42
42
  }) {
43
- const [r, l] = y(!1), [e, i] = y("audience"), c = k(null);
43
+ const [s, l] = y(!1), [e, i] = y("audience"), c = k(null);
44
44
  return _(() => {
45
- if (!r) return;
45
+ if (!s) return;
46
46
  const d = (x) => {
47
- var h;
48
- (h = c.current) != null && h.contains(x.target) || l(!1);
47
+ var m;
48
+ (m = c.current) != null && m.contains(x.target) || l(!1);
49
49
  };
50
50
  return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
51
- }, [r]), /* @__PURE__ */ o("div", { ref: c, className: "relative", children: [
52
- /* @__PURE__ */ s(
51
+ }, [s]), /* @__PURE__ */ o("div", { ref: c, className: "relative", children: [
52
+ /* @__PURE__ */ n(
53
53
  "button",
54
54
  {
55
55
  type: "button",
@@ -57,18 +57,18 @@ function W({
57
57
  "data-tip": "Record insights — audience, integrations, owner history",
58
58
  title: "Record insights",
59
59
  "aria-label": "Record insights",
60
- className: n ? "inline-flex h-8 w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
61
- children: /* @__PURE__ */ s(N, { className: n ? "h-4 w-4" : "h-3.5 w-3.5" })
60
+ className: r ? "inline-flex h-8 w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
61
+ children: /* @__PURE__ */ n(N, { className: r ? "h-4 w-4" : "h-3.5 w-3.5" })
62
62
  }
63
63
  ),
64
- r && /* @__PURE__ */ o("div", { className: "absolute right-0 top-full z-[60] mt-1 w-[480px] max-w-[92vw] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-border dark:bg-card", children: [
65
- /* @__PURE__ */ s("div", { className: "mb-2 flex gap-1", children: [
64
+ s && /* @__PURE__ */ o("div", { className: "absolute right-0 top-full z-[60] mt-1 w-[480px] max-w-[92vw] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-border dark:bg-card", children: [
65
+ /* @__PURE__ */ n("div", { className: "mb-2 flex gap-1", children: [
66
66
  ["audience", "Audience"],
67
67
  ["integrations", "Integrations"],
68
68
  ["owners", "Owner history"],
69
69
  ["mail", "Mail"],
70
70
  ["chat", "Chat"]
71
- ].map(([d, x]) => /* @__PURE__ */ s(
71
+ ].map(([d, x]) => /* @__PURE__ */ n(
72
72
  "button",
73
73
  {
74
74
  type: "button",
@@ -78,11 +78,11 @@ function W({
78
78
  },
79
79
  d
80
80
  )) }),
81
- e === "audience" && /* @__PURE__ */ s(L, { collection: a, itemId: t }),
82
- e === "integrations" && /* @__PURE__ */ s(K, { collection: a, itemId: t }),
83
- e === "owners" && /* @__PURE__ */ s(S, { collection: a, itemId: t }),
84
- e === "mail" && /* @__PURE__ */ s(E, { collection: a, itemId: t }),
85
- e === "chat" && /* @__PURE__ */ s(Q, { collection: a, itemId: t })
81
+ e === "audience" && /* @__PURE__ */ n(K, { collection: a, itemId: t }),
82
+ e === "integrations" && /* @__PURE__ */ n(L, { collection: a, itemId: t }),
83
+ e === "owners" && /* @__PURE__ */ n(S, { collection: a, itemId: t }),
84
+ e === "mail" && /* @__PURE__ */ n(E, { collection: a, itemId: t }),
85
+ e === "chat" && /* @__PURE__ */ n(Q, { collection: a, itemId: t })
86
86
  ] })
87
87
  ] });
88
88
  }
@@ -93,15 +93,15 @@ const T = {
93
93
  delete: "deletions",
94
94
  workflow_transition: "state changes"
95
95
  };
96
- function L({ collection: a, itemId: t }) {
97
- const n = m(), { data: r, isLoading: l } = p({
96
+ function K({ collection: a, itemId: t }) {
97
+ const r = h(), { data: s, isLoading: l } = p({
98
98
  queryKey: ["record-audience", a, t],
99
- queryFn: () => n.request(u(`/audience/${a}/${t}`)).then((i) => i.data),
99
+ queryFn: () => r.request(u(`/audience/${a}/${t}`)).then((i) => i.data),
100
100
  staleTime: 3e4
101
101
  });
102
- if (l) return /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" });
103
- const e = (r == null ? void 0 : r.people) ?? [];
104
- return e.length === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Nobody hears about changes here automatically — no owners, watchers, or subscribers." }) : /* @__PURE__ */ o("div", { className: "max-h-72 overflow-y-auto", children: [
102
+ if (l) return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "Loading…" });
103
+ const e = (s == null ? void 0 : s.people) ?? [];
104
+ return e.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "Nobody hears about changes here automatically — no owners, watchers, or subscribers." }) : /* @__PURE__ */ o("div", { className: "max-h-72 overflow-y-auto", children: [
105
105
  /* @__PURE__ */ o("p", { className: "pb-1.5 text-[10.5px] text-slate-400", children: [
106
106
  e.length,
107
107
  " ",
@@ -113,9 +113,9 @@ function L({ collection: a, itemId: t }) {
113
113
  {
114
114
  className: "border-t border-slate-100 py-1.5 first:border-t-0 dark:border-border/50",
115
115
  children: [
116
- /* @__PURE__ */ s("p", { className: "text-[12px] font-medium text-slate-700 dark:text-slate-200", children: i.name }),
116
+ /* @__PURE__ */ n("p", { className: "text-[12px] font-medium text-slate-700 dark:text-slate-200", children: i.name }),
117
117
  /* @__PURE__ */ o("div", { className: "mt-0.5 flex flex-wrap gap-1", children: [
118
- i.owner && /* @__PURE__ */ s("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-px text-[10.5px] font-medium text-nvr-navy dark:text-nvr-cyan", children: "Owner — notified on transitions" }),
118
+ i.owner && /* @__PURE__ */ n("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-px text-[10.5px] font-medium text-nvr-navy dark:text-nvr-cyan", children: "Owner — notified on transitions" }),
119
119
  i.watch_fields.length > 0 && /* @__PURE__ */ o(
120
120
  "span",
121
121
  {
@@ -149,29 +149,29 @@ function L({ collection: a, itemId: t }) {
149
149
  ))
150
150
  ] });
151
151
  }
152
- function K({ collection: a, itemId: t }) {
153
- const n = m(), { data: r = [], isLoading: l } = p({
152
+ function L({ collection: a, itemId: t }) {
153
+ const r = h(), { data: s = [], isLoading: l } = p({
154
154
  queryKey: ["erp-submissions", a, String(t)],
155
- queryFn: () => n.request(
155
+ queryFn: () => r.request(
156
156
  u(`/erp-submissions/${a}/${encodeURIComponent(t)}`)
157
157
  ).then((d) => d.data ?? []).catch(() => []),
158
158
  staleTime: 3e4
159
159
  }), { data: e, isLoading: i } = p({
160
160
  queryKey: ["record-integrations", a, t],
161
- queryFn: () => n.request(u(`/record-integrations/${a}/${t}`)).then((d) => d.data),
161
+ queryFn: () => r.request(u(`/record-integrations/${a}/${t}`)).then((d) => d.data),
162
162
  staleTime: 3e4
163
163
  }), { data: c = [] } = p({
164
164
  queryKey: ["record-external-ids", a, t],
165
- queryFn: () => n.request(u(`/items/${a}/${t}`)).then((d) => {
166
- const x = d.data ?? {}, h = /(external|nuvolo|mwf|oracle|sap|erp|legacy|fusion|mdsi).*(id|number|ref)|^(order_number|requisition_id|sales_order_id)$/i;
167
- return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" && h.test(b)).map(([b, g]) => ({ field: b, value: String(g).slice(0, 60) })).slice(0, 12);
165
+ queryFn: () => r.request(u(`/items/${a}/${t}`)).then((d) => {
166
+ const x = d.data ?? {}, m = /(external|nuvolo|mwf|oracle|sap|erp|legacy|fusion|mdsi).*(id|number|ref)|^(order_number|requisition_id|sales_order_id)$/i;
167
+ return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" && m.test(b)).map(([b, g]) => ({ field: b, value: String(g).slice(0, 60) })).slice(0, 12);
168
168
  }).catch(() => []),
169
169
  staleTime: 6e4
170
170
  });
171
- return i || l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length + ((e == null ? void 0 : e.webhooks.length) ?? 0) === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No integration activity for this record." }) : /* @__PURE__ */ o(w, { children: [
171
+ return i || l ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : s.length + ((e == null ? void 0 : e.webhooks.length) ?? 0) === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No integration activity for this record." }) : /* @__PURE__ */ o(w, { children: [
172
172
  c.length > 0 && /* @__PURE__ */ o("div", { className: "border-b border-slate-100 px-3 py-2 dark:border-border/50", children: [
173
- /* @__PURE__ */ s("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "External identifiers" }),
174
- /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap gap-1.5", children: c.map((d) => /* @__PURE__ */ o(
173
+ /* @__PURE__ */ n("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "External identifiers" }),
174
+ /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap gap-1.5", children: c.map((d) => /* @__PURE__ */ o(
175
175
  "span",
176
176
  {
177
177
  className: "inline-flex items-center gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-0.5 text-[11px] dark:border-border dark:bg-muted/40",
@@ -180,15 +180,15 @@ function K({ collection: a, itemId: t }) {
180
180
  d.field,
181
181
  ":"
182
182
  ] }),
183
- /* @__PURE__ */ s("span", { className: "font-mono text-slate-700 dark:text-slate-200", children: d.value })
183
+ /* @__PURE__ */ n("span", { className: "font-mono text-slate-700 dark:text-slate-200", children: d.value })
184
184
  ]
185
185
  },
186
186
  d.field
187
187
  )) })
188
188
  ] }),
189
189
  /* @__PURE__ */ o("div", { className: "max-h-72 space-y-1 overflow-y-auto text-[12px]", children: [
190
- r.map((d) => /* @__PURE__ */ o("p", { className: "flex items-baseline justify-between gap-2", children: [
191
- /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-slate-700 dark:text-slate-200", children: d.external_api_name ?? d.target ?? d.endpoint_path ?? "ERP push" }),
190
+ s.map((d) => /* @__PURE__ */ o("p", { className: "flex items-baseline justify-between gap-2", children: [
191
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate text-slate-700 dark:text-slate-200", children: d.external_api_name ?? d.target ?? d.endpoint_path ?? "ERP push" }),
192
192
  /* @__PURE__ */ o(
193
193
  "span",
194
194
  {
@@ -216,14 +216,14 @@ function K({ collection: a, itemId: t }) {
216
216
  ] });
217
217
  }
218
218
  function S({ collection: a, itemId: t }) {
219
- const n = m(), { data: r = [], isLoading: l } = p({
219
+ const r = h(), { data: s = [], isLoading: l } = p({
220
220
  queryKey: ["record-owner-history", a, t],
221
- queryFn: () => n.request(u(`/owner-history/${a}/${t}`)).then((e) => e.data),
221
+ queryFn: () => r.request(u(`/owner-history/${a}/${t}`)).then((e) => e.data),
222
222
  staleTime: 3e4
223
223
  });
224
- return l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No workflow history on this record." }) : /* @__PURE__ */ o("div", { className: "max-h-72 space-y-2 overflow-y-auto text-[12px]", children: [
225
- /* @__PURE__ */ s("p", { className: "text-[10.5px] text-amber-600 dark:text-amber-400", children: "Owners shown are resolved with TODAY's matrix config — membership changes since then aren't snapshotted." }),
226
- r.map((e, i) => (
224
+ return l ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : s.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No workflow history on this record." }) : /* @__PURE__ */ o("div", { className: "max-h-72 space-y-2 overflow-y-auto text-[12px]", children: [
225
+ /* @__PURE__ */ n("p", { className: "text-[10.5px] text-amber-600 dark:text-amber-400", children: "Owners shown are resolved with TODAY's matrix config — membership changes since then aren't snapshotted." }),
226
+ s.map((e, i) => (
227
227
  // biome-ignore lint/suspicious/noArrayIndexKey: ordered stays
228
228
  /* @__PURE__ */ o("div", { children: [
229
229
  /* @__PURE__ */ o("p", { className: "font-medium text-slate-700 dark:text-slate-200", children: [
@@ -236,7 +236,7 @@ function S({ collection: a, itemId: t }) {
236
236
  e.moved_by ? ` · moved by ${e.moved_by}` : ""
237
237
  ] })
238
238
  ] }),
239
- /* @__PURE__ */ s("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: e.owners.length > 0 ? e.owners.map((c) => c.name).join(", ") : "no resolved owners" })
239
+ /* @__PURE__ */ n("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: e.owners.length > 0 ? e.owners.map((c) => c.name).join(", ") : "no resolved owners" })
240
240
  ] }, i)
241
241
  ))
242
242
  ] });
@@ -251,16 +251,16 @@ const R = {
251
251
  }
252
252
  };
253
253
  function j(a) {
254
- const t = a.split(/[,;]/).map((r) => r.trim()).filter(Boolean);
255
- return t.slice(0, 2).map((r) => r.split("@")[0]).join(", ") + (t.length > 2 ? ` +${t.length - 2}` : "");
254
+ const t = a.split(/[,;]/).map((s) => s.trim()).filter(Boolean);
255
+ return t.slice(0, 2).map((s) => s.split("@")[0]).join(", ") + (t.length > 2 ? ` +${t.length - 2}` : "");
256
256
  }
257
257
  function E({ collection: a, itemId: t }) {
258
- const n = m(), { data: r = [], isLoading: l } = p({
258
+ const r = h(), { data: s = [], isLoading: l } = p({
259
259
  queryKey: ["record-mail-log", a, t],
260
- queryFn: () => n.request(u(`/mail-log/record/${a}/${t}`)).then((e) => e.data ?? []).catch(() => []),
260
+ queryFn: () => r.request(u(`/mail-log/record/${a}/${t}`)).then((e) => e.data ?? []).catch(() => []),
261
261
  staleTime: 3e4
262
262
  });
263
- return l ? /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" }) : r.length === 0 ? /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "No emails have been sent about this record." }) : /* @__PURE__ */ s("div", { className: "max-h-80 overflow-y-auto", children: r.map((e) => {
263
+ return l ? /* @__PURE__ */ n("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" }) : s.length === 0 ? /* @__PURE__ */ n("p", { className: "p-3 text-[12px] text-slate-400", children: "No emails have been sent about this record." }) : /* @__PURE__ */ n("div", { className: "max-h-80 overflow-y-auto", children: s.map((e) => {
264
264
  const i = R[e.status] ?? {
265
265
  label: e.status,
266
266
  cls: "bg-slate-500/10 text-slate-500"
@@ -271,7 +271,7 @@ function E({ collection: a, itemId: t }) {
271
271
  className: "border-t border-slate-100 py-2 first:border-t-0 dark:border-border/50",
272
272
  children: [
273
273
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-2", children: [
274
- /* @__PURE__ */ s(
274
+ /* @__PURE__ */ n(
275
275
  "p",
276
276
  {
277
277
  className: "min-w-0 text-[12px] leading-snug text-slate-700 [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] overflow-hidden dark:text-slate-200",
@@ -279,7 +279,7 @@ function E({ collection: a, itemId: t }) {
279
279
  children: e.subject
280
280
  }
281
281
  ),
282
- /* @__PURE__ */ s(
282
+ /* @__PURE__ */ n(
283
283
  "span",
284
284
  {
285
285
  className: `shrink-0 rounded-full px-1.5 py-px text-[10px] font-medium ${i.cls}`,
@@ -293,12 +293,12 @@ function E({ collection: a, itemId: t }) {
293
293
  j(e.to)
294
294
  ] }),
295
295
  " · ",
296
- /* @__PURE__ */ s("span", { "data-tip": v(e.created_at), children: new Date(e.created_at).toLocaleDateString(void 0, {
296
+ /* @__PURE__ */ n("span", { "data-tip": v(e.created_at), children: new Date(e.created_at).toLocaleDateString(void 0, {
297
297
  month: "short",
298
298
  day: "numeric"
299
299
  }) })
300
300
  ] }),
301
- e.status === "failed" && e.error && /* @__PURE__ */ s(
301
+ e.status === "failed" && e.error && /* @__PURE__ */ n(
302
302
  "p",
303
303
  {
304
304
  className: "mt-0.5 truncate rounded bg-red-500/5 px-1.5 py-0.5 text-[10.5px] text-red-600 dark:text-red-400",
@@ -313,30 +313,30 @@ function E({ collection: a, itemId: t }) {
313
313
  }) });
314
314
  }
315
315
  function Q({ collection: a, itemId: t }) {
316
- const n = m(), { data: r = [], isLoading: l } = p({
316
+ const r = h(), { data: s = [], isLoading: l } = p({
317
317
  queryKey: ["record-chat-mentions", a, t],
318
- queryFn: () => n.request(u(`/chat/record-mentions/${a}/${t}`)).then((i) => i.data ?? []).catch(() => []),
318
+ queryFn: () => r.request(u(`/chat/record-mentions/${a}/${t}`)).then((i) => i.data ?? []).catch(() => []),
319
319
  staleTime: 6e4
320
320
  });
321
- if (l) return /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" });
322
- if (r.length === 0)
323
- return /* @__PURE__ */ s("p", { className: "p-3 text-[12px] text-slate-400", children: "No chat messages mention this record outside its own room." });
321
+ if (l) return /* @__PURE__ */ n("p", { className: "p-3 text-[12px] text-slate-400", children: "Loading…" });
322
+ if (s.length === 0)
323
+ return /* @__PURE__ */ n("p", { className: "p-3 text-[12px] text-slate-400", children: "No chat messages mention this record outside its own room." });
324
324
  const e = (i) => i === "global" ? "#global" : i.startsWith("ch:") ? `#${i.slice(3)}` : i.startsWith("dm:") ? "a direct message" : i;
325
- return /* @__PURE__ */ s("div", { className: "max-h-72 overflow-y-auto", children: r.map((i) => /* @__PURE__ */ o(
325
+ return /* @__PURE__ */ n("div", { className: "max-h-72 overflow-y-auto", children: s.map((i) => /* @__PURE__ */ o(
326
326
  "div",
327
327
  {
328
328
  className: "border-b border-slate-100 px-3 py-1.5 last:border-b-0 dark:border-border/50",
329
329
  children: [
330
330
  /* @__PURE__ */ o("p", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
331
- /* @__PURE__ */ s("span", { className: "font-medium", children: i.sender_name ?? "Someone" }),
331
+ /* @__PURE__ */ n("span", { className: "font-medium", children: i.sender_name ?? "Someone" }),
332
332
  " ",
333
333
  /* @__PURE__ */ o("span", { className: "text-slate-400", children: [
334
334
  "in ",
335
335
  e(i.room)
336
336
  ] })
337
337
  ] }),
338
- /* @__PURE__ */ s("p", { className: "truncate text-[11.5px] text-slate-500", children: i.message.slice(0, 160) }),
339
- /* @__PURE__ */ s("p", { className: "text-[10px] text-slate-400", children: v(i.date_created) })
338
+ /* @__PURE__ */ n("p", { className: "truncate text-[11.5px] text-slate-500", children: i.message.slice(0, 160) }),
339
+ /* @__PURE__ */ n("p", { className: "text-[10px] text-slate-400", children: v(i.date_created) })
340
340
  ]
341
341
  },
342
342
  i.id