@nivaro/react 0.3.65 → 0.3.67

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 (43) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +21 -5
  4. package/dist/shared/components/ActivityEntry.js +28 -28
  5. package/dist/shared/components/CollectionBrowserView.js +2432 -2592
  6. package/dist/shared/components/ItemEditForm.js +3912 -3773
  7. package/dist/shared/components/MyWorkView.js +124 -113
  8. package/dist/shared/components/ProfileView.js +483 -472
  9. package/dist/shared/components/RecordCompare.js +149 -129
  10. package/dist/shared/components/ReportView.js +1100 -1094
  11. package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
  12. package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
  13. package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
  14. package/dist/shared/components/integrations/console/EventsView.js +22 -24
  15. package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
  16. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
  17. package/dist/shared/components/integrations/console/tone.js +22 -21
  18. package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
  19. package/dist/shared/components/item-edit/FieldRow.js +193 -193
  20. package/dist/shared/components/item-edit/GroupSection.js +559 -542
  21. package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
  22. package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
  23. package/dist/shared/components/item-edit/RecordInsights.js +46 -45
  24. package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
  25. package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
  26. package/dist/shared/components/item-edit/UserChip.js +264 -229
  27. package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
  28. package/dist/shared/components/item-edit/header-path-preview.js +52 -0
  29. package/dist/shared/components/item-edit/line-merge.js +73 -47
  30. package/dist/shared/components/item-edit/picker-search.js +25 -21
  31. package/dist/shared/components/panels/BranchLanes.js +7 -7
  32. package/dist/shared/components/panels/CommentPanel.js +72 -72
  33. package/dist/shared/components/panels/PipelinePanel.js +261 -261
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
  35. package/dist/shared/components/panels/RevisionsPanel.js +220 -220
  36. package/dist/shared/components/panels/TaskPanel.js +75 -75
  37. package/dist/shared/components/queue/QueueWorklist.js +1007 -979
  38. package/dist/shared/lib/compare-value.js +73 -0
  39. package/dist/shared/lib/format-value.js +19 -18
  40. package/dist/shared/lib/obligation-reason-text.js +1 -1
  41. package/dist/shared/lib/quick-filter-cascade.js +29 -19
  42. package/dist/shared/lib/utils.js +59 -57
  43. package/package.json +1 -1
@@ -1,50 +1,50 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { useQueryClient as ie, useQuery as le, useMutation as F } from "@tanstack/react-query";
3
- import { Bot as ce } from "lucide-react";
4
- import { useState as C, useRef as W, useEffect as E, useMemo as me } from "react";
5
- import { useApiFetchConfig as ue, useItemNavigation as pe, useNavigation as be } from "../context.js";
6
- import { useLiveEvent as he } from "../lib/live.js";
7
- import { useLiveOps as xe, useFreshIds as ge } from "../lib/live-ops.js";
8
- import { resolveNotificationTarget as Z, runNotificationTarget as fe } from "../lib/notification-target.js";
9
- import { usePrefetchIntent as ke } from "../lib/prefetch.js";
10
- import { useOptionalRealtime as ye } from "../lib/realtime.js";
11
- import { userErrorMessage as we } from "../lib/safe-error.js";
12
- import { withinDay as G, slaChip as Ne } from "../lib/sla-chip.js";
2
+ import { useQueryClient as le, useQuery as ce, useMutation as F } from "@tanstack/react-query";
3
+ import { Bot as me } from "lucide-react";
4
+ import { useState as C, useRef as W, useEffect as E, useMemo as ue } from "react";
5
+ import { useApiFetchConfig as pe, useItemNavigation as be, useNavigation as he } from "../context.js";
6
+ import { useLiveEvent as xe } from "../lib/live.js";
7
+ import { useLiveOps as ge, useFreshIds as fe } from "../lib/live-ops.js";
8
+ import { resolveNotificationTarget as Z, runNotificationTarget as ke } from "../lib/notification-target.js";
9
+ import { usePrefetchIntent as ye } from "../lib/prefetch.js";
10
+ import { useOptionalRealtime as we } from "../lib/realtime.js";
11
+ import { userErrorMessage as Ne } from "../lib/safe-error.js";
12
+ import { withinDay as G, slaChip as ve } from "../lib/sla-chip.js";
13
13
  import { cn as M } from "../lib/utils.js";
14
- import { AgentQuestionsCard as ve } from "./AgentQuestionsCard.js";
15
- import { FirstWeekCard as _e } from "./ai/FirstWeekCard.js";
16
- import { TaskDoButton as Ce } from "./ai/TaskDo.js";
17
- import { openChatRoom as Se, canOpenChatRoom as $e } from "./chat/chat-core.js";
18
- import { useMyRecordRooms as Te } from "./chat/chat-hooks.js";
19
- import { LearningPathCard as je } from "./help-videos/viewer/LearningPathCard.js";
20
- import { RequiredVideosCard as Ae } from "./help-videos/viewer/RequiredVideosCard.js";
21
- import { SkeletonBar as Me, ListSkeleton as Le } from "./Skeletons.js";
22
- import { TickerNumber as Oe } from "./TickerNumber.js";
23
- import { UserAvatar as qe } from "./UserAvatar.js";
24
- const Ie = 8e3, R = ["records", "tasks", "team", "waiting", "notifications"], X = {
14
+ import { AgentQuestionsCard as _e } from "./AgentQuestionsCard.js";
15
+ import { FirstWeekCard as Ce } from "./ai/FirstWeekCard.js";
16
+ import { TaskDoButton as $e } from "./ai/TaskDo.js";
17
+ import { openChatRoom as Se, canOpenChatRoom as Te } from "./chat/chat-core.js";
18
+ import { useMyRecordRooms as je } from "./chat/chat-hooks.js";
19
+ import { LearningPathCard as Ae } from "./help-videos/viewer/LearningPathCard.js";
20
+ import { RequiredVideosCard as Me } from "./help-videos/viewer/RequiredVideosCard.js";
21
+ import { SkeletonBar as Oe, ListSkeleton as Le } from "./Skeletons.js";
22
+ import { TickerNumber as qe } from "./TickerNumber.js";
23
+ import { UserAvatar as Ie } from "./UserAvatar.js";
24
+ const De = 8e3, R = ["records", "tasks", "team", "waiting", "notifications"], X = {
25
25
  records: "Waiting on you",
26
26
  tasks: "My tasks",
27
27
  team: "Team tasks",
28
28
  waiting: "Waiting on others",
29
29
  notifications: "Notifications"
30
- }, De = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), L = (i) => !!i && String(i).slice(0, 10) < De(), Fe = {
30
+ }, Fe = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), O = (i) => !!i && String(i).slice(0, 10) < Fe(), We = {
31
31
  alert: "bg-red-500/10 text-red-600 dark:text-red-400",
32
32
  warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
33
33
  neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
34
34
  ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
35
35
  };
36
- function We({ sla: i }) {
37
- const u = Ne(i);
36
+ function Ee({ sla: i }) {
37
+ const u = ve(i);
38
38
  return u ? /* @__PURE__ */ e(
39
39
  "span",
40
40
  {
41
41
  "data-sla-chip": u.tone,
42
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Fe[u.tone]}`,
42
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${We[u.tone]}`,
43
43
  children: u.label
44
44
  }
45
45
  ) : null;
46
46
  }
47
- function Ee({ state: i, color: u }) {
47
+ function Ue({ state: i, color: u }) {
48
48
  return i ? /* @__PURE__ */ e(
49
49
  "span",
50
50
  {
@@ -57,10 +57,10 @@ function Ee({ state: i, color: u }) {
57
57
  }
58
58
  ) : null;
59
59
  }
60
- function Ue({ order: i, hidden: u }) {
60
+ function Ke({ order: i, hidden: u }) {
61
61
  const c = i.filter(
62
62
  (m) => !u.includes(m) && (m === "records" || m === "tasks" || m === "notifications")
63
- ), y = (m, g) => /* @__PURE__ */ d(
63
+ ), w = (m, g) => /* @__PURE__ */ d(
64
64
  "section",
65
65
  {
66
66
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
@@ -92,12 +92,12 @@ function Ue({ order: i, hidden: u }) {
92
92
  ), k = [];
93
93
  for (let m = 0; m < c.length; ) {
94
94
  if (c[m] === "records") {
95
- k.push(y("records", 5)), m++;
95
+ k.push(w("records", 5)), m++;
96
96
  continue;
97
97
  }
98
98
  const g = c.slice(m, m + 2).filter((f) => f !== "records");
99
99
  k.push(
100
- /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => y(f, 4)) }, g.join("+"))
100
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => w(f, 4)) }, g.join("+"))
101
101
  ), m += g.length;
102
102
  }
103
103
  return /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
@@ -108,7 +108,7 @@ function Ue({ order: i, hidden: u }) {
108
108
  className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
109
109
  children: [
110
110
  /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: m }),
111
- /* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Me, { width: 34, className: "h-[18px] rounded-md" }) })
111
+ /* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Oe, { width: 34, className: "h-[18px] rounded-md" }) })
112
112
  ]
113
113
  },
114
114
  m
@@ -119,21 +119,21 @@ function Ue({ order: i, hidden: u }) {
119
119
  k
120
120
  ] });
121
121
  }
122
- function O({ label: i, value: u, tone: c }) {
122
+ function L({ label: i, value: u, tone: c }) {
123
123
  return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
124
124
  /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: i }),
125
- /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(Oe, { value: u }) })
125
+ /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(qe, { value: u }) })
126
126
  ] });
127
127
  }
128
- function mt({
128
+ function ut({
129
129
  notificationRoutes: i,
130
130
  onOpenPath: u
131
131
  } = {}) {
132
- const { apiBase: c, authHeaders: y, credentials: k } = ue(), { open: m } = pe(), g = be(), f = ie(), ee = ke(), U = (r) => {
132
+ const { apiBase: c, authHeaders: w, credentials: k } = pe(), { open: m } = be(), g = he(), f = le(), ee = ye(), U = (r) => {
133
133
  var h, l;
134
134
  const n = ((h = i == null ? void 0 : i.support) == null ? void 0 : h.call(i, String(r))) ?? ((l = g.consoleUrl) == null ? void 0 : l.call(g, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
135
135
  u ? u(n) : g.navigate(n);
136
- }, q = ye(), [te, S] = C(!1), [x, re] = C(() => {
136
+ }, q = we(), [te, $] = C(!1), [x, re] = C(() => {
137
137
  try {
138
138
  const r = localStorage.getItem("nvr_mywork_sections");
139
139
  if (r) {
@@ -155,33 +155,33 @@ function mt({
155
155
  localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
156
156
  } catch {
157
157
  }
158
- }, [ae, de] = C(!1), P = W(0), [$, ne] = C("all"), { data: a, isLoading: se, refetch: Q, isFetching: B } = le({
158
+ }, [ae, de] = C(!1), P = W(0), [S, ne] = C("all"), { data: a, isLoading: se, refetch: Q, isFetching: B } = ce({
159
159
  queryKey: ["my-work"],
160
160
  queryFn: async () => {
161
- const r = await fetch(`${c}/my-work`, { headers: y, credentials: k });
161
+ const r = await fetch(`${c}/my-work`, { headers: w, credentials: k });
162
162
  if (!r.ok) throw new Error("my-work failed");
163
163
  return (await r.json()).data;
164
164
  },
165
165
  staleTime: 6e4
166
- }), z = W(0), w = W(null), H = () => {
166
+ }), z = W(0), N = W(null), H = () => {
167
167
  const r = () => {
168
- w.current = null, z.current = Date.now(), S(!1), f.invalidateQueries({ queryKey: ["my-work"] });
169
- }, n = z.current + Ie - Date.now();
170
- w.current || (n <= 0 ? r() : w.current = setTimeout(r, n));
168
+ N.current = null, z.current = Date.now(), $(!1), f.invalidateQueries({ queryKey: ["my-work"] });
169
+ }, n = z.current + De - Date.now();
170
+ N.current || (n <= 0 ? r() : N.current = setTimeout(r, n));
171
171
  };
172
- xe("my-work", H, { debounceMs: 1500 }), he("notification:new", H, { debounceMs: 1500 }), E(
172
+ ge("my-work", H, { debounceMs: 1500 }), xe("notification:new", H, { debounceMs: 1500 }), E(
173
173
  () => () => {
174
- w.current && clearTimeout(w.current);
174
+ N.current && clearTimeout(N.current);
175
175
  },
176
176
  []
177
177
  );
178
- const J = ge([
178
+ const J = fe([
179
179
  ...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
180
180
  ...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
181
181
  ...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
182
182
  ...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
183
183
  ...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
184
- ]), N = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = me(() => {
184
+ ]), v = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = ue(() => {
185
185
  const r = /* @__PURE__ */ new Set();
186
186
  for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
187
187
  return [...r];
@@ -190,14 +190,14 @@ function mt({
190
190
  if (!(!q || I.length === 0))
191
191
  return q.subscribeCollections(I, () => {
192
192
  const r = Date.now();
193
- r - P.current < 3e4 || (P.current = r, S(!0));
193
+ r - P.current < 3e4 || (P.current = r, $(!0));
194
194
  });
195
195
  }, [q, I]);
196
196
  const V = F({
197
197
  // A ticket closes through /support so its requester hears about it.
198
198
  mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
199
199
  method: "PATCH",
200
- headers: { ...y, "content-type": "application/json" },
200
+ headers: { ...w, "content-type": "application/json" },
201
201
  credentials: k,
202
202
  body: JSON.stringify({ status: "done" })
203
203
  }),
@@ -206,7 +206,7 @@ function mt({
206
206
  mutationFn: async ({ id: r, action: n }) => {
207
207
  const h = await fetch(`${c}/tasks/${r}/${n}`, {
208
208
  method: "POST",
209
- headers: { ...y, "content-type": "application/json" },
209
+ headers: { ...w, "content-type": "application/json" },
210
210
  credentials: k,
211
211
  body: "{}"
212
212
  }), l = await h.json().catch(() => ({}));
@@ -216,7 +216,7 @@ function mt({
216
216
  onSuccess: (r) => {
217
217
  D(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), f.invalidateQueries({ queryKey: ["my-work"] });
218
218
  },
219
- onError: (r) => D(we(r, "Failed"))
219
+ onError: (r) => D(Ne(r, "Failed"))
220
220
  }), [j, D] = C(null);
221
221
  E(() => {
222
222
  if (!j) return;
@@ -226,14 +226,14 @@ function mt({
226
226
  const Y = F({
227
227
  mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
228
228
  method: "POST",
229
- headers: { ...y, "content-type": "application/json" },
229
+ headers: { ...w, "content-type": "application/json" },
230
230
  credentials: k,
231
231
  body: JSON.stringify({ ids: r })
232
232
  }),
233
233
  onSuccess: () => {
234
234
  f.invalidateQueries({ queryKey: ["my-work"] }), f.invalidateQueries({ queryKey: ["notifications"] });
235
235
  }
236
- }), v = (r, n) => {
236
+ }), _ = (r, n) => {
237
237
  const h = {
238
238
  record: (p, t) => (m({ collection: p, itemId: t }), null),
239
239
  ...i
@@ -245,7 +245,7 @@ function mt({
245
245
  }
246
246
  });
247
247
  if (l) {
248
- fe(l, (p) => u == null ? void 0 : u(p));
248
+ ke(l, (p) => u == null ? void 0 : u(p));
249
249
  return;
250
250
  }
251
251
  r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && m({ collection: r, itemId: n });
@@ -253,28 +253,28 @@ function mt({
253
253
  record: () => null,
254
254
  ...i
255
255
  });
256
- return se || !a ? /* @__PURE__ */ e(Ue, { order: x.order, hidden: x.hidden }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
257
- /* @__PURE__ */ e(_e, { onOpenPath: u }),
256
+ return se || !a ? /* @__PURE__ */ e(Ke, { order: x.order, hidden: x.hidden }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
257
+ /* @__PURE__ */ e(Ce, { onOpenPath: u }),
258
258
  /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
259
259
  /* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
260
- /* @__PURE__ */ e(O, { label: "Waiting on you", value: a.counts.owned }),
260
+ /* @__PURE__ */ e(L, { label: "Waiting on you", value: a.counts.owned }),
261
261
  /* @__PURE__ */ e(
262
- O,
262
+ L,
263
263
  {
264
264
  label: "SLA breached",
265
265
  value: a.counts.owned_breached,
266
266
  tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
267
267
  }
268
268
  ),
269
- /* @__PURE__ */ e(O, { label: "Open tasks", value: a.counts.tasks }),
270
- /* @__PURE__ */ e(O, { label: "Unread notifications", value: a.counts.notifications })
269
+ /* @__PURE__ */ e(L, { label: "Open tasks", value: a.counts.tasks }),
270
+ /* @__PURE__ */ e(L, { label: "Unread notifications", value: a.counts.notifications })
271
271
  ] }),
272
272
  te && /* @__PURE__ */ d(
273
273
  "button",
274
274
  {
275
275
  type: "button",
276
276
  onClick: () => {
277
- S(!1), Q();
277
+ $(!1), Q();
278
278
  },
279
279
  className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
280
280
  children: [
@@ -288,7 +288,7 @@ function mt({
288
288
  {
289
289
  type: "button",
290
290
  onClick: () => {
291
- S(!1), Q();
291
+ $(!1), Q();
292
292
  },
293
293
  disabled: B,
294
294
  className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
@@ -367,18 +367,18 @@ function mt({
367
367
  children: j
368
368
  }
369
369
  ),
370
- /* @__PURE__ */ e(ve, { questions: a.questions ?? [] }),
370
+ /* @__PURE__ */ e(_e, { questions: a.questions ?? [] }),
371
+ /* @__PURE__ */ e(Me, { className: "mb-4" }),
371
372
  /* @__PURE__ */ e(Ae, { className: "mb-4" }),
372
- /* @__PURE__ */ e(je, { className: "mb-4" }),
373
373
  (() => {
374
374
  const r = {
375
375
  records: () => {
376
376
  const t = a.owned.filter((s) => G(s.sla)).length, b = a.owned.filter((s) => {
377
- var _;
378
- return ((_ = s.sla) == null ? void 0 : _.status) === "breached";
379
- }).length, o = $ === "soon" ? a.owned.filter((s) => G(s.sla)) : $ === "breached" ? a.owned.filter((s) => {
380
- var _;
381
- return ((_ = s.sla) == null ? void 0 : _.status) === "breached";
377
+ var y;
378
+ return ((y = s.sla) == null ? void 0 : y.status) === "breached";
379
+ }).length, o = S === "soon" ? a.owned.filter((s) => G(s.sla)) : S === "breached" ? a.owned.filter((s) => {
380
+ var y;
381
+ return ((y = s.sla) == null ? void 0 : y.status) === "breached";
382
382
  }) : a.owned, A = [
383
383
  { key: "all", label: `All (${a.owned.length})` },
384
384
  { key: "soon", label: `Warning within 24h (${t})` },
@@ -394,39 +394,50 @@ function mt({
394
394
  {
395
395
  type: "button",
396
396
  "data-my-work-sla-filter": s.key,
397
- "aria-pressed": $ === s.key,
397
+ "aria-pressed": S === s.key,
398
398
  onClick: () => ne(s.key),
399
399
  className: [
400
400
  "rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
401
- $ === s.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
401
+ S === s.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
402
402
  ].join(" "),
403
403
  children: s.label
404
404
  },
405
405
  s.key
406
406
  )) }) }),
407
- o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((s) => /* @__PURE__ */ e(
408
- "li",
409
- {
410
- className: N(`o:${s.collection}:${s.item}`),
411
- "data-my-work-fresh": J.has(`o:${s.collection}:${s.item}`) || void 0,
412
- children: /* @__PURE__ */ d(
413
- "button",
414
- {
415
- type: "button",
416
- onClick: () => v(s.collection, s.item),
417
- ...ee.record(s.collection, s.item),
418
- className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
419
- children: [
420
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: s.label }),
421
- /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: s.collection.replace(/_/g, " ") }),
422
- /* @__PURE__ */ e(Ee, { state: s.state, color: s.state_color }),
423
- /* @__PURE__ */ e(We, { sla: s.sla })
424
- ]
425
- }
426
- )
427
- },
428
- `${s.collection}:${s.item}`
429
- )) })
407
+ o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((s) => {
408
+ var y;
409
+ return /* @__PURE__ */ e(
410
+ "li",
411
+ {
412
+ className: v(`o:${s.collection}:${s.item}`),
413
+ "data-my-work-fresh": J.has(`o:${s.collection}:${s.item}`) || void 0,
414
+ children: /* @__PURE__ */ d(
415
+ "button",
416
+ {
417
+ type: "button",
418
+ onClick: () => _(s.collection, s.item),
419
+ ...ee.record(s.collection, s.item),
420
+ className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
421
+ children: [
422
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: s.label }),
423
+ /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: s.collection.replace(/_/g, " ") }),
424
+ ((y = s.flags) == null ? void 0 : y.some((ie) => /^on hold$/i.test(ie.name.trim()))) && /* @__PURE__ */ e(
425
+ "span",
426
+ {
427
+ "data-my-work-hold": !0,
428
+ className: "shrink-0 rounded-full bg-amber-500/15 px-1.5 py-px text-[10.5px] font-semibold text-amber-800 dark:text-amber-300",
429
+ children: "On hold"
430
+ }
431
+ ),
432
+ /* @__PURE__ */ e(Ue, { state: s.state, color: s.state_color }),
433
+ /* @__PURE__ */ e(Ee, { sla: s.sla })
434
+ ]
435
+ }
436
+ )
437
+ },
438
+ `${s.collection}:${s.item}`
439
+ );
440
+ }) })
430
441
  ] });
431
442
  },
432
443
  tasks: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
@@ -434,7 +445,7 @@ function mt({
434
445
  a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ d(
435
446
  "li",
436
447
  {
437
- className: M("flex items-center gap-2.5 px-4 py-2", N(`t:${t.id}`)),
448
+ className: M("flex items-center gap-2.5 px-4 py-2", v(`t:${t.id}`)),
438
449
  children: [
439
450
  /* @__PURE__ */ e(
440
451
  "button",
@@ -456,7 +467,7 @@ function mt({
456
467
  "data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
457
468
  "data-my-work-agent-task": t.id,
458
469
  children: [
459
- /* @__PURE__ */ e(ce, { className: "h-3 w-3", "aria-hidden": !0 }),
470
+ /* @__PURE__ */ e(me, { className: "h-3 w-3", "aria-hidden": !0 }),
460
471
  t.agent_name ?? "Agent"
461
472
  ]
462
473
  }
@@ -465,7 +476,7 @@ function mt({
465
476
  "button",
466
477
  {
467
478
  type: "button",
468
- onClick: () => t.kind === "support" ? U(t.id) : v(t.collection, t.item),
479
+ onClick: () => t.kind === "support" ? U(t.id) : _(t.collection, t.item),
469
480
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
470
481
  children: [
471
482
  t.title,
@@ -474,7 +485,7 @@ function mt({
474
485
  }
475
486
  ),
476
487
  /* @__PURE__ */ e(
477
- Ce,
488
+ $e,
478
489
  {
479
490
  task: t,
480
491
  isAssignee: !0,
@@ -485,7 +496,7 @@ function mt({
485
496
  t.due_date && /* @__PURE__ */ e(
486
497
  "span",
487
498
  {
488
- className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
499
+ className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
489
500
  children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
490
501
  }
491
502
  )
@@ -507,7 +518,7 @@ function mt({
507
518
  (a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ d(
508
519
  "li",
509
520
  {
510
- className: M("flex items-center gap-2.5 px-4 py-2", N(`tt:${t.id}`)),
521
+ className: M("flex items-center gap-2.5 px-4 py-2", v(`tt:${t.id}`)),
511
522
  "data-my-work-team-task": t.id,
512
523
  children: [
513
524
  t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
@@ -515,7 +526,7 @@ function mt({
515
526
  "button",
516
527
  {
517
528
  type: "button",
518
- onClick: () => v(t.collection, t.item),
529
+ onClick: () => _(t.collection, t.item),
519
530
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
520
531
  children: [
521
532
  t.title,
@@ -526,7 +537,7 @@ function mt({
526
537
  t.due_date && /* @__PURE__ */ e(
527
538
  "span",
528
539
  {
529
- className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
540
+ className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
530
541
  children: new Date(t.due_date).toLocaleDateString(void 0, {
531
542
  timeZone: "UTC"
532
543
  })
@@ -551,7 +562,7 @@ function mt({
551
562
  }
552
563
  ),
553
564
  waiting: () => {
554
- const t = a.requested ?? [], b = t.filter((o) => L(o.due_date)).length;
565
+ const t = a.requested ?? [], b = t.filter((o) => O(o.due_date)).length;
555
566
  return /* @__PURE__ */ d(
556
567
  "section",
557
568
  {
@@ -569,18 +580,18 @@ function mt({
569
580
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
570
581
  ] }),
571
582
  t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((o) => {
572
- const A = L(o.due_date), s = !!o.nudged_at && Date.now() - new Date(o.nudged_at).getTime() < 20 * 36e5;
583
+ const A = O(o.due_date), s = !!o.nudged_at && Date.now() - new Date(o.nudged_at).getTime() < 20 * 36e5;
573
584
  return /* @__PURE__ */ d(
574
585
  "li",
575
586
  {
576
- className: M("flex items-center gap-2.5 px-4 py-2", N(`r:${o.id}`)),
587
+ className: M("flex items-center gap-2.5 px-4 py-2", v(`r:${o.id}`)),
577
588
  "data-my-work-requested": o.id,
578
589
  children: [
579
590
  /* @__PURE__ */ d(
580
591
  "button",
581
592
  {
582
593
  type: "button",
583
- onClick: () => o.kind === "support" ? U(o.id) : v(o.collection, o.item),
594
+ onClick: () => o.kind === "support" ? U(o.id) : _(o.collection, o.item),
584
595
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
585
596
  children: [
586
597
  o.title,
@@ -640,10 +651,10 @@ function mt({
640
651
  a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ d(
641
652
  "li",
642
653
  {
643
- className: M("flex items-start gap-2.5 px-4 py-2", N(`n:${t.id}`)),
654
+ className: M("flex items-start gap-2.5 px-4 py-2", v(`n:${t.id}`)),
644
655
  children: [
645
656
  /* @__PURE__ */ e(
646
- qe,
657
+ Ie,
647
658
  {
648
659
  userId: t.sender,
649
660
  className: "mt-0.5 h-5 w-5",
@@ -654,7 +665,7 @@ function mt({
654
665
  "button",
655
666
  {
656
667
  type: "button",
657
- onClick: () => v(t.collection, t.item),
668
+ onClick: () => _(t.collection, t.item),
658
669
  className: oe(t.collection, t.item) ? "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80" : "min-w-0 flex-1 cursor-default text-left",
659
670
  children: [
660
671
  /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
@@ -694,11 +705,11 @@ function mt({
694
705
  }
695
706
  return l;
696
707
  })(),
697
- /* @__PURE__ */ e(Ke, {})
708
+ /* @__PURE__ */ e(Pe, {})
698
709
  ] });
699
710
  }
700
- function Ke() {
701
- const i = $e(), { rooms: u } = Te(i);
711
+ function Pe() {
712
+ const i = Te(), { rooms: u } = je(i);
702
713
  return !i || u.length === 0 ? null : /* @__PURE__ */ d(
703
714
  "section",
704
715
  {
@@ -731,5 +742,5 @@ function Ke() {
731
742
  );
732
743
  }
733
744
  export {
734
- mt as MyWorkView
745
+ ut as MyWorkView
735
746
  };