@nivaro/react 0.3.40 → 0.3.42

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 (99) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +645 -16
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/PickerExcludedRows.js +3 -3
  20. package/dist/shared/components/ProfileView.js +776 -1003
  21. package/dist/shared/components/RecentRecordsRail.js +34 -16
  22. package/dist/shared/components/RecordReadView.js +500 -477
  23. package/dist/shared/components/Skeletons.js +199 -0
  24. package/dist/shared/components/SlowNotice.js +63 -0
  25. package/dist/shared/components/Term.js +23 -0
  26. package/dist/shared/components/WidgetSlot.js +350 -353
  27. package/dist/shared/components/access/PermissionSummary.js +106 -0
  28. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  29. package/dist/shared/components/chat/ChatPanel.js +902 -886
  30. package/dist/shared/components/chat/MemberPaging.js +70 -0
  31. package/dist/shared/components/chat/RoomParts.js +147 -117
  32. package/dist/shared/components/chat/ScreenClip.js +73 -69
  33. package/dist/shared/components/chat/chat-core.js +449 -396
  34. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  35. package/dist/shared/components/help-videos/api.js +2 -5
  36. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  37. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  38. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  39. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  40. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  41. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  42. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  43. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  44. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  45. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  46. package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
  47. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  48. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  49. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  50. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  51. package/dist/shared/components/item-edit/field-sources.js +33 -0
  52. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  53. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  54. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  55. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  56. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  57. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  58. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  59. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  60. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  61. package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
  62. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  63. package/dist/shared/components/list/InlineEdit.js +363 -0
  64. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  65. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  66. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  67. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  68. package/dist/shared/components/notifications/changes-lines.js +24 -0
  69. package/dist/shared/components/notifications/why-lines.js +64 -0
  70. package/dist/shared/components/panels/CommentPanel.js +316 -281
  71. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  72. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  73. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  74. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  75. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  76. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  77. package/dist/shared/components/profile/PersonProfile.js +57 -52
  78. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  79. package/dist/shared/hooks/useSlowReason.js +39 -0
  80. package/dist/shared/lib/activity-sentence.js +670 -0
  81. package/dist/shared/lib/config-sentences.js +418 -0
  82. package/dist/shared/lib/core-glossary.js +229 -0
  83. package/dist/shared/lib/error-hints.js +159 -0
  84. package/dist/shared/lib/error-message.js +105 -0
  85. package/dist/shared/lib/error-toast.js +22 -0
  86. package/dist/shared/lib/field-comments.js +25 -0
  87. package/dist/shared/lib/filter-sentence.js +261 -0
  88. package/dist/shared/lib/glossary.js +55 -48
  89. package/dist/shared/lib/idle-reload.js +138 -0
  90. package/dist/shared/lib/layout-resolve.js +42 -29
  91. package/dist/shared/lib/list-inline-edit.js +190 -0
  92. package/dist/shared/lib/list-link.js +147 -0
  93. package/dist/shared/lib/prefetch.js +259 -106
  94. package/dist/shared/lib/record-ref.js +72 -0
  95. package/dist/shared/lib/reload-holds.js +25 -0
  96. package/dist/shared/lib/safe-error.js +52 -24
  97. package/dist/shared/lib/skeleton-shapes.js +72 -0
  98. package/dist/shared/lib/slow-reason.js +63 -0
  99. package/package.json +1 -1
@@ -1,216 +1,280 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { useQueryClient as se, useQuery as oe, useMutation as I } from "@tanstack/react-query";
3
- import { Bot as ie } from "lucide-react";
4
- import { useState as N, useRef as L, useEffect as E, useMemo as le } from "react";
5
- import { useApiFetchConfig as ce, useItemNavigation as me, useNavigation as ue } from "../context.js";
6
- import { useLiveEvent as pe } from "../lib/live.js";
7
- import { useLiveOps as be, useFreshIds as xe } from "../lib/live-ops.js";
8
- import { resolveNotificationTarget as Z, runNotificationTarget as he } from "../lib/notification-target.js";
9
- import { useOptionalRealtime as ge } from "../lib/realtime.js";
10
- import { userErrorMessage as fe } from "../lib/safe-error.js";
11
- import { withinDay as G, slaChip as ke } from "../lib/sla-chip.js";
12
- import { cn as A } from "../lib/utils.js";
13
- import { AgentQuestionsCard as ye } from "./AgentQuestionsCard.js";
14
- import { FirstWeekCard as Ne } from "./ai/FirstWeekCard.js";
15
- import { TaskDoButton as we } from "./ai/TaskDo.js";
16
- import { openChatRoom as ve, canOpenChatRoom as _e } from "./chat/chat-core.js";
17
- import { useMyRecordRooms as Ce } from "./chat/chat-hooks.js";
18
- import { LearningPathCard as $e } from "./help-videos/viewer/LearningPathCard.js";
19
- import { RequiredVideosCard as Se } from "./help-videos/viewer/RequiredVideosCard.js";
20
- import { TickerNumber as Te } from "./TickerNumber.js";
21
- import { UserAvatar as je } from "./UserAvatar.js";
22
- const Ae = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], Me = {
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";
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 = {
23
25
  records: "Waiting on you",
24
26
  tasks: "My tasks",
25
27
  team: "Team tasks",
26
28
  waiting: "Waiting on others",
27
29
  notifications: "Notifications"
28
- }, qe = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), M = (l) => !!l && String(l).slice(0, 10) < qe(), Oe = {
30
+ }, De = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), L = (i) => !!i && String(i).slice(0, 10) < De(), Fe = {
29
31
  alert: "bg-red-500/10 text-red-600 dark:text-red-400",
30
32
  warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
31
33
  neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
32
34
  ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
33
35
  };
34
- function De({ sla: l }) {
35
- const c = ke(l);
36
- return c ? /* @__PURE__ */ e(
36
+ function We({ sla: i }) {
37
+ const u = Ne(i);
38
+ return u ? /* @__PURE__ */ e(
37
39
  "span",
38
40
  {
39
- "data-sla-chip": c.tone,
40
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Oe[c.tone]}`,
41
- children: c.label
41
+ "data-sla-chip": u.tone,
42
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Fe[u.tone]}`,
43
+ children: u.label
42
44
  }
43
45
  ) : null;
44
46
  }
45
- function Fe({ state: l, color: c }) {
46
- return l ? /* @__PURE__ */ e(
47
+ function Ee({ state: i, color: u }) {
48
+ return i ? /* @__PURE__ */ e(
47
49
  "span",
48
50
  {
49
51
  className: "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
50
52
  style: {
51
- backgroundColor: c ? `${c}22` : "rgba(100,116,139,.12)",
52
- color: c ?? void 0
53
+ backgroundColor: u ? `${u}22` : "rgba(100,116,139,.12)",
54
+ color: u ?? void 0
53
55
  },
54
- children: l.replace(/_/g, " ")
56
+ children: i.replace(/_/g, " ")
55
57
  }
56
58
  ) : null;
57
59
  }
58
- function q({ label: l, value: c, tone: u }) {
60
+ function Ue({ order: i, hidden: u }) {
61
+ const c = i.filter(
62
+ (m) => !u.includes(m) && (m === "records" || m === "tasks" || m === "notifications")
63
+ ), y = (m, g) => /* @__PURE__ */ d(
64
+ "section",
65
+ {
66
+ className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
67
+ children: [
68
+ /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
69
+ /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children: X[m] ?? m }),
70
+ m === "records" && /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
71
+ ] }),
72
+ /* @__PURE__ */ e(
73
+ Le,
74
+ {
75
+ header: !1,
76
+ rows: g,
77
+ rowClassName: "h-[37px] px-4",
78
+ columns: m === "records" ? [
79
+ { key: "label", grow: 6 },
80
+ { key: "where", width: 90, shape: "short" },
81
+ { key: "state", width: 72, shape: "badge" },
82
+ { key: "sla", width: 56, shape: "badge" }
83
+ ] : [
84
+ { key: "label", grow: 5 },
85
+ { key: "when", width: 64, shape: "date" }
86
+ ]
87
+ }
88
+ )
89
+ ]
90
+ },
91
+ m
92
+ ), k = [];
93
+ for (let m = 0; m < c.length; ) {
94
+ if (c[m] === "records") {
95
+ k.push(y("records", 5)), m++;
96
+ continue;
97
+ }
98
+ const g = c.slice(m, m + 2).filter((f) => f !== "records");
99
+ k.push(
100
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => y(f, 4)) }, g.join("+"))
101
+ ), m += g.length;
102
+ }
103
+ return /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
104
+ /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
105
+ /* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((m) => /* @__PURE__ */ d(
106
+ "div",
107
+ {
108
+ className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
109
+ children: [
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" }) })
112
+ ]
113
+ },
114
+ m
115
+ )) }),
116
+ /* @__PURE__ */ e("span", { className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Refresh" }),
117
+ /* @__PURE__ */ e("span", { className: "ml-2 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Customize" })
118
+ ] }),
119
+ k
120
+ ] });
121
+ }
122
+ function O({ label: i, value: u, tone: c }) {
59
123
  return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
60
- /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: l }),
61
- /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(Te, { value: c }) })
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 }) })
62
126
  ] });
63
127
  }
64
- function nt({
65
- notificationRoutes: l,
66
- onOpenPath: c
128
+ function mt({
129
+ notificationRoutes: i,
130
+ onOpenPath: u
67
131
  } = {}) {
68
- const { apiBase: u, authHeaders: w, credentials: v } = ce(), { open: W } = me(), _ = ue(), h = se(), U = (r) => {
69
- var b, i;
70
- const n = ((b = l == null ? void 0 : l.support) == null ? void 0 : b.call(l, String(r))) ?? ((i = _.consoleUrl) == null ? void 0 : i.call(_, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
71
- c ? c(n) : _.navigate(n);
72
- }, O = ge(), [R, C] = N(!1), [x, ee] = N(() => {
132
+ const { apiBase: c, authHeaders: y, credentials: k } = ue(), { open: m } = pe(), g = be(), f = ie(), ee = ke(), U = (r) => {
133
+ var h, l;
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
+ u ? u(n) : g.navigate(n);
136
+ }, q = ye(), [te, S] = C(!1), [x, re] = C(() => {
73
137
  try {
74
138
  const r = localStorage.getItem("nvr_mywork_sections");
75
139
  if (r) {
76
140
  const n = JSON.parse(r);
77
141
  if (Array.isArray(n == null ? void 0 : n.order) && Array.isArray(n == null ? void 0 : n.hidden)) {
78
- const b = X.map((i, m) => ({
79
- k: i,
80
- at: n.order.indexOf(i) >= 0 ? n.order.indexOf(i) : m - 0.5
81
- })).sort((i, m) => i.at - m.at).map((i) => i.k);
82
- return { order: b, hidden: n.hidden.filter((i) => b.includes(i)) };
142
+ const h = R.map((l, p) => ({
143
+ k: l,
144
+ at: n.order.indexOf(l) >= 0 ? n.order.indexOf(l) : p - 0.5
145
+ })).sort((l, p) => l.at - p.at).map((l) => l.k);
146
+ return { order: h, hidden: n.hidden.filter((l) => h.includes(l)) };
83
147
  }
84
148
  }
85
149
  } catch {
86
150
  }
87
- return { order: [...X], hidden: [] };
151
+ return { order: [...R], hidden: [] };
88
152
  }), K = (r) => {
89
- ee(r);
153
+ re(r);
90
154
  try {
91
155
  localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
92
156
  } catch {
93
157
  }
94
- }, [te, re] = N(!1), Q = L(0), [$, ae] = N("all"), { data: a, isLoading: ne, refetch: P, isFetching: B } = oe({
158
+ }, [ae, de] = C(!1), P = W(0), [$, ne] = C("all"), { data: a, isLoading: se, refetch: Q, isFetching: B } = le({
95
159
  queryKey: ["my-work"],
96
160
  queryFn: async () => {
97
- const r = await fetch(`${u}/my-work`, { headers: w, credentials: v });
161
+ const r = await fetch(`${c}/my-work`, { headers: y, credentials: k });
98
162
  if (!r.ok) throw new Error("my-work failed");
99
163
  return (await r.json()).data;
100
164
  },
101
165
  staleTime: 6e4
102
- }), z = L(0), g = L(null), H = () => {
166
+ }), z = W(0), w = W(null), H = () => {
103
167
  const r = () => {
104
- g.current = null, z.current = Date.now(), C(!1), h.invalidateQueries({ queryKey: ["my-work"] });
105
- }, n = z.current + Ae - Date.now();
106
- g.current || (n <= 0 ? r() : g.current = setTimeout(r, n));
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));
107
171
  };
108
- be("my-work", H, { debounceMs: 1500 }), pe("notification:new", H, { debounceMs: 1500 }), E(
172
+ xe("my-work", H, { debounceMs: 1500 }), he("notification:new", H, { debounceMs: 1500 }), E(
109
173
  () => () => {
110
- g.current && clearTimeout(g.current);
174
+ w.current && clearTimeout(w.current);
111
175
  },
112
176
  []
113
177
  );
114
- const J = xe([
178
+ const J = ge([
115
179
  ...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
116
180
  ...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
117
181
  ...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
118
182
  ...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
119
183
  ...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
120
- ]), f = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", D = le(() => {
184
+ ]), N = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = me(() => {
121
185
  const r = /* @__PURE__ */ new Set();
122
186
  for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
123
187
  return [...r];
124
188
  }, [a]);
125
189
  E(() => {
126
- if (!(!O || D.length === 0))
127
- return O.subscribeCollections(D, () => {
190
+ if (!(!q || I.length === 0))
191
+ return q.subscribeCollections(I, () => {
128
192
  const r = Date.now();
129
- r - Q.current < 3e4 || (Q.current = r, C(!0));
193
+ r - P.current < 3e4 || (P.current = r, S(!0));
130
194
  });
131
- }, [O, D]);
132
- const V = I({
195
+ }, [q, I]);
196
+ const V = F({
133
197
  // A ticket closes through /support so its requester hears about it.
134
- mutationFn: (r) => fetch(`${u}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
198
+ mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
135
199
  method: "PATCH",
136
- headers: { ...w, "content-type": "application/json" },
137
- credentials: v,
200
+ headers: { ...y, "content-type": "application/json" },
201
+ credentials: k,
138
202
  body: JSON.stringify({ status: "done" })
139
203
  }),
140
- onSuccess: () => h.invalidateQueries({ queryKey: ["my-work"] })
141
- }), S = I({
204
+ onSuccess: () => f.invalidateQueries({ queryKey: ["my-work"] })
205
+ }), T = F({
142
206
  mutationFn: async ({ id: r, action: n }) => {
143
- const b = await fetch(`${u}/tasks/${r}/${n}`, {
207
+ const h = await fetch(`${c}/tasks/${r}/${n}`, {
144
208
  method: "POST",
145
- headers: { ...w, "content-type": "application/json" },
146
- credentials: v,
209
+ headers: { ...y, "content-type": "application/json" },
210
+ credentials: k,
147
211
  body: "{}"
148
- }), i = await b.json().catch(() => ({}));
149
- if (!b.ok) throw new Error(i.error ?? "Failed");
212
+ }), l = await h.json().catch(() => ({}));
213
+ if (!h.ok) throw new Error(l.error ?? "Failed");
150
214
  return n;
151
215
  },
152
216
  onSuccess: (r) => {
153
- F(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
217
+ D(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), f.invalidateQueries({ queryKey: ["my-work"] });
154
218
  },
155
- onError: (r) => F(fe(r, "Failed"))
156
- }), [T, F] = N(null);
219
+ onError: (r) => D(we(r, "Failed"))
220
+ }), [j, D] = C(null);
157
221
  E(() => {
158
- if (!T) return;
159
- const r = setTimeout(() => F(null), 4e3);
222
+ if (!j) return;
223
+ const r = setTimeout(() => D(null), 4e3);
160
224
  return () => clearTimeout(r);
161
- }, [T]);
162
- const Y = I({
163
- mutationFn: (r) => fetch(`${u}/notifications/mark-read`, {
225
+ }, [j]);
226
+ const Y = F({
227
+ mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
164
228
  method: "POST",
165
- headers: { ...w, "content-type": "application/json" },
166
- credentials: v,
229
+ headers: { ...y, "content-type": "application/json" },
230
+ credentials: k,
167
231
  body: JSON.stringify({ ids: r })
168
232
  }),
169
233
  onSuccess: () => {
170
- h.invalidateQueries({ queryKey: ["my-work"] }), h.invalidateQueries({ queryKey: ["notifications"] });
234
+ f.invalidateQueries({ queryKey: ["my-work"] }), f.invalidateQueries({ queryKey: ["notifications"] });
171
235
  }
172
- }), k = (r, n) => {
173
- const b = {
174
- record: (m, t) => (W({ collection: m, itemId: t }), null),
175
- ...l
176
- }, i = Z(r, n, {
177
- ...b,
178
- record: (m, t) => {
179
- var p;
180
- return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m, t)) ?? null;
236
+ }), v = (r, n) => {
237
+ const h = {
238
+ record: (p, t) => (m({ collection: p, itemId: t }), null),
239
+ ...i
240
+ }, l = Z(r, n, {
241
+ ...h,
242
+ record: (p, t) => {
243
+ var b;
244
+ return ((b = i == null ? void 0 : i.record) == null ? void 0 : b.call(i, p, t)) ?? null;
181
245
  }
182
246
  });
183
- if (i) {
184
- he(i, (m) => c == null ? void 0 : c(m));
247
+ if (l) {
248
+ fe(l, (p) => u == null ? void 0 : u(p));
185
249
  return;
186
250
  }
187
- r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && W({ collection: r, itemId: n });
188
- }, de = (r, n) => r && n && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, n, {
251
+ r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && m({ collection: r, itemId: n });
252
+ }, oe = (r, n) => r && n && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, n, {
189
253
  record: () => null,
190
- ...l
254
+ ...i
191
255
  });
192
- return ne || !a ? /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-3 p-6", children: [1, 2, 3, 4].map((r) => /* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, r)) }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
193
- /* @__PURE__ */ e(Ne, { onOpenPath: c }),
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 }),
194
258
  /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
195
259
  /* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
196
- /* @__PURE__ */ e(q, { label: "Waiting on you", value: a.counts.owned }),
260
+ /* @__PURE__ */ e(O, { label: "Waiting on you", value: a.counts.owned }),
197
261
  /* @__PURE__ */ e(
198
- q,
262
+ O,
199
263
  {
200
264
  label: "SLA breached",
201
265
  value: a.counts.owned_breached,
202
266
  tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
203
267
  }
204
268
  ),
205
- /* @__PURE__ */ e(q, { label: "Open tasks", value: a.counts.tasks }),
206
- /* @__PURE__ */ e(q, { label: "Unread notifications", value: a.counts.notifications })
269
+ /* @__PURE__ */ e(O, { label: "Open tasks", value: a.counts.tasks }),
270
+ /* @__PURE__ */ e(O, { label: "Unread notifications", value: a.counts.notifications })
207
271
  ] }),
208
- R && /* @__PURE__ */ d(
272
+ te && /* @__PURE__ */ d(
209
273
  "button",
210
274
  {
211
275
  type: "button",
212
276
  onClick: () => {
213
- C(!1), P();
277
+ S(!1), Q();
214
278
  },
215
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]",
216
280
  children: [
@@ -224,7 +288,7 @@ function nt({
224
288
  {
225
289
  type: "button",
226
290
  onClick: () => {
227
- C(!1), P();
291
+ S(!1), Q();
228
292
  },
229
293
  disabled: B,
230
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",
@@ -236,17 +300,17 @@ function nt({
236
300
  "button",
237
301
  {
238
302
  type: "button",
239
- onClick: () => re((r) => !r),
303
+ onClick: () => de((r) => !r),
240
304
  className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
241
305
  children: "Customize"
242
306
  }
243
307
  ),
244
- te && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
308
+ ae && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
245
309
  /* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
246
310
  x.order.map((r, n) => {
247
- const b = Me[r] ?? r, i = x.hidden.includes(r), m = (t) => {
248
- const p = [...x.order], s = n + t;
249
- s < 0 || s >= p.length || ([p[n], p[s]] = [p[s], p[n]], K({ ...x, order: p }));
311
+ const h = X[r] ?? r, l = x.hidden.includes(r), p = (t) => {
312
+ const b = [...x.order], o = n + t;
313
+ o < 0 || o >= b.length || ([b[n], b[o]] = [b[o], b[n]], K({ ...x, order: b }));
250
314
  };
251
315
  return /* @__PURE__ */ d("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
252
316
  /* @__PURE__ */ e(
@@ -255,25 +319,25 @@ function nt({
255
319
  type: "button",
256
320
  onClick: () => K({
257
321
  ...x,
258
- hidden: i ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
322
+ hidden: l ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
259
323
  }),
260
324
  className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
261
- title: i ? "Show section" : "Hide section",
262
- children: i ? "" : "✓"
325
+ title: l ? "Show section" : "Hide section",
326
+ children: l ? "" : "✓"
263
327
  }
264
328
  ),
265
329
  /* @__PURE__ */ e(
266
330
  "span",
267
331
  {
268
- className: `min-w-0 flex-1 truncate text-[12px] ${i ? "text-slate-400 line-through" : ""}`,
269
- children: b
332
+ className: `min-w-0 flex-1 truncate text-[12px] ${l ? "text-slate-400 line-through" : ""}`,
333
+ children: h
270
334
  }
271
335
  ),
272
336
  /* @__PURE__ */ e(
273
337
  "button",
274
338
  {
275
339
  type: "button",
276
- onClick: () => m(-1),
340
+ onClick: () => p(-1),
277
341
  disabled: n === 0,
278
342
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
279
343
  children: "↑"
@@ -283,7 +347,7 @@ function nt({
283
347
  "button",
284
348
  {
285
349
  type: "button",
286
- onClick: () => m(1),
350
+ onClick: () => p(1),
287
351
  disabled: n === x.order.length - 1,
288
352
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
289
353
  children: "↓"
@@ -294,73 +358,74 @@ function nt({
294
358
  ] })
295
359
  ] })
296
360
  ] }),
297
- T && /* @__PURE__ */ e(
361
+ j && /* @__PURE__ */ e(
298
362
  "p",
299
363
  {
300
364
  className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[12px] dark:border-border dark:bg-card",
301
365
  role: "status",
302
366
  "data-my-work-task-note": !0,
303
- children: T
367
+ children: j
304
368
  }
305
369
  ),
306
- /* @__PURE__ */ e(ye, { questions: a.questions ?? [] }),
307
- /* @__PURE__ */ e(Se, { className: "mb-4" }),
308
- /* @__PURE__ */ e($e, { className: "mb-4" }),
370
+ /* @__PURE__ */ e(ve, { questions: a.questions ?? [] }),
371
+ /* @__PURE__ */ e(Ae, { className: "mb-4" }),
372
+ /* @__PURE__ */ e(je, { className: "mb-4" }),
309
373
  (() => {
310
374
  const r = {
311
375
  records: () => {
312
- const t = a.owned.filter((o) => G(o.sla)).length, p = a.owned.filter((o) => {
313
- var y;
314
- return ((y = o.sla) == null ? void 0 : y.status) === "breached";
315
- }).length, s = $ === "soon" ? a.owned.filter((o) => G(o.sla)) : $ === "breached" ? a.owned.filter((o) => {
316
- var y;
317
- return ((y = o.sla) == null ? void 0 : y.status) === "breached";
318
- }) : a.owned, j = [
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";
382
+ }) : a.owned, A = [
319
383
  { key: "all", label: `All (${a.owned.length})` },
320
384
  { key: "soon", label: `Warning within 24h (${t})` },
321
- { key: "breached", label: `Breached (${p})` }
385
+ { key: "breached", label: `Breached (${b})` }
322
386
  ];
323
387
  return /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
324
388
  /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
325
389
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
326
390
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
327
391
  ] }),
328
- a.owned.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: j.map((o) => /* @__PURE__ */ e(
392
+ a.owned.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: A.map((s) => /* @__PURE__ */ e(
329
393
  "button",
330
394
  {
331
395
  type: "button",
332
- "data-my-work-sla-filter": o.key,
333
- "aria-pressed": $ === o.key,
334
- onClick: () => ae(o.key),
396
+ "data-my-work-sla-filter": s.key,
397
+ "aria-pressed": $ === s.key,
398
+ onClick: () => ne(s.key),
335
399
  className: [
336
400
  "rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
337
- $ === o.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.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"
338
402
  ].join(" "),
339
- children: o.label
403
+ children: s.label
340
404
  },
341
- o.key
405
+ s.key
342
406
  )) }) }),
343
- s.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: s.map((o) => /* @__PURE__ */ e(
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(
344
408
  "li",
345
409
  {
346
- className: f(`o:${o.collection}:${o.item}`),
347
- "data-my-work-fresh": J.has(`o:${o.collection}:${o.item}`) || void 0,
410
+ className: N(`o:${s.collection}:${s.item}`),
411
+ "data-my-work-fresh": J.has(`o:${s.collection}:${s.item}`) || void 0,
348
412
  children: /* @__PURE__ */ d(
349
413
  "button",
350
414
  {
351
415
  type: "button",
352
- onClick: () => k(o.collection, o.item),
416
+ onClick: () => v(s.collection, s.item),
417
+ ...ee.record(s.collection, s.item),
353
418
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
354
419
  children: [
355
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
356
- /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
357
- /* @__PURE__ */ e(Fe, { state: o.state, color: o.state_color }),
358
- /* @__PURE__ */ e(De, { sla: o.sla })
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 })
359
424
  ]
360
425
  }
361
426
  )
362
427
  },
363
- `${o.collection}:${o.item}`
428
+ `${s.collection}:${s.item}`
364
429
  )) })
365
430
  ] });
366
431
  },
@@ -369,7 +434,7 @@ function nt({
369
434
  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(
370
435
  "li",
371
436
  {
372
- className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${t.id}`)),
437
+ className: M("flex items-center gap-2.5 px-4 py-2", N(`t:${t.id}`)),
373
438
  children: [
374
439
  /* @__PURE__ */ e(
375
440
  "button",
@@ -391,7 +456,7 @@ function nt({
391
456
  "data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
392
457
  "data-my-work-agent-task": t.id,
393
458
  children: [
394
- /* @__PURE__ */ e(ie, { className: "h-3 w-3", "aria-hidden": !0 }),
459
+ /* @__PURE__ */ e(ce, { className: "h-3 w-3", "aria-hidden": !0 }),
395
460
  t.agent_name ?? "Agent"
396
461
  ]
397
462
  }
@@ -400,7 +465,7 @@ function nt({
400
465
  "button",
401
466
  {
402
467
  type: "button",
403
- onClick: () => t.kind === "support" ? U(t.id) : k(t.collection, t.item),
468
+ onClick: () => t.kind === "support" ? U(t.id) : v(t.collection, t.item),
404
469
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
405
470
  children: [
406
471
  t.title,
@@ -409,18 +474,18 @@ function nt({
409
474
  }
410
475
  ),
411
476
  /* @__PURE__ */ e(
412
- we,
477
+ Ce,
413
478
  {
414
479
  task: t,
415
480
  isAssignee: !0,
416
481
  compact: !0,
417
- onTaskChanged: () => void h.invalidateQueries({ queryKey: ["my-work"] })
482
+ onTaskChanged: () => void f.invalidateQueries({ queryKey: ["my-work"] })
418
483
  }
419
484
  ),
420
485
  t.due_date && /* @__PURE__ */ e(
421
486
  "span",
422
487
  {
423
- className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
488
+ className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
424
489
  children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
425
490
  }
426
491
  )
@@ -442,7 +507,7 @@ function nt({
442
507
  (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(
443
508
  "li",
444
509
  {
445
- className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${t.id}`)),
510
+ className: M("flex items-center gap-2.5 px-4 py-2", N(`tt:${t.id}`)),
446
511
  "data-my-work-team-task": t.id,
447
512
  children: [
448
513
  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" }),
@@ -450,7 +515,7 @@ function nt({
450
515
  "button",
451
516
  {
452
517
  type: "button",
453
- onClick: () => k(t.collection, t.item),
518
+ onClick: () => v(t.collection, t.item),
454
519
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
455
520
  children: [
456
521
  t.title,
@@ -461,7 +526,7 @@ function nt({
461
526
  t.due_date && /* @__PURE__ */ e(
462
527
  "span",
463
528
  {
464
- className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
529
+ className: `text-[11px] tabular-nums ${L(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
465
530
  children: new Date(t.due_date).toLocaleDateString(void 0, {
466
531
  timeZone: "UTC"
467
532
  })
@@ -471,8 +536,8 @@ function nt({
471
536
  "button",
472
537
  {
473
538
  type: "button",
474
- onClick: () => S.mutate({ id: t.id, action: "claim" }),
475
- disabled: S.isPending,
539
+ onClick: () => T.mutate({ id: t.id, action: "claim" }),
540
+ disabled: T.isPending,
476
541
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
477
542
  "data-my-work-claim": t.id,
478
543
  children: "Pick it up"
@@ -486,7 +551,7 @@ function nt({
486
551
  }
487
552
  ),
488
553
  waiting: () => {
489
- const t = a.requested ?? [], p = t.filter((s) => M(s.due_date)).length;
554
+ const t = a.requested ?? [], b = t.filter((o) => L(o.due_date)).length;
490
555
  return /* @__PURE__ */ d(
491
556
  "section",
492
557
  {
@@ -496,63 +561,63 @@ function nt({
496
561
  /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
497
562
  /* @__PURE__ */ d("h2", { className: "text-[13px] font-medium", children: [
498
563
  "Waiting on others",
499
- p > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
500
- p,
564
+ b > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
565
+ b,
501
566
  " overdue"
502
567
  ] })
503
568
  ] }),
504
569
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
505
570
  ] }),
506
- 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((s) => {
507
- const j = M(s.due_date), o = !!s.nudged_at && Date.now() - new Date(s.nudged_at).getTime() < 20 * 36e5;
571
+ 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;
508
573
  return /* @__PURE__ */ d(
509
574
  "li",
510
575
  {
511
- className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${s.id}`)),
512
- "data-my-work-requested": s.id,
576
+ className: M("flex items-center gap-2.5 px-4 py-2", N(`r:${o.id}`)),
577
+ "data-my-work-requested": o.id,
513
578
  children: [
514
579
  /* @__PURE__ */ d(
515
580
  "button",
516
581
  {
517
582
  type: "button",
518
- onClick: () => s.kind === "support" ? U(s.id) : k(s.collection, s.item),
583
+ onClick: () => o.kind === "support" ? U(o.id) : v(o.collection, o.item),
519
584
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
520
585
  children: [
521
- s.title,
586
+ o.title,
522
587
  /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
523
- s.assignee_name ?? (s.team_name ? `${s.team_name} team` : "Unassigned"),
524
- s.item_label
588
+ o.assignee_name ?? (o.team_name ? `${o.team_name} team` : "Unassigned"),
589
+ o.item_label
525
590
  ].filter(Boolean).join(" · ") })
526
591
  ]
527
592
  }
528
593
  ),
529
- s.due_date && /* @__PURE__ */ d(
594
+ o.due_date && /* @__PURE__ */ d(
530
595
  "span",
531
596
  {
532
- className: `text-[11px] tabular-nums ${j ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
597
+ className: `text-[11px] tabular-nums ${A ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
533
598
  children: [
534
- j ? "Overdue · " : "",
535
- new Date(s.due_date).toLocaleDateString(void 0, {
599
+ A ? "Overdue · " : "",
600
+ new Date(o.due_date).toLocaleDateString(void 0, {
536
601
  timeZone: "UTC"
537
602
  })
538
603
  ]
539
604
  }
540
605
  ),
541
- s.kind !== "support" && /* @__PURE__ */ e(
606
+ o.kind !== "support" && /* @__PURE__ */ e(
542
607
  "button",
543
608
  {
544
609
  type: "button",
545
- onClick: () => S.mutate({ id: s.id, action: "nudge" }),
546
- disabled: S.isPending || o,
547
- title: o ? "Already nudged today" : "Send a reminder",
610
+ onClick: () => T.mutate({ id: o.id, action: "nudge" }),
611
+ disabled: T.isPending || s,
612
+ title: s ? "Already nudged today" : "Send a reminder",
548
613
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
549
- "data-my-work-nudge": s.id,
550
- children: o ? "Nudged" : "Nudge"
614
+ "data-my-work-nudge": o.id,
615
+ children: s ? "Nudged" : "Nudge"
551
616
  }
552
617
  )
553
618
  ]
554
619
  },
555
- s.id
620
+ o.id
556
621
  );
557
622
  }) })
558
623
  ]
@@ -575,10 +640,10 @@ function nt({
575
640
  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(
576
641
  "li",
577
642
  {
578
- className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${t.id}`)),
643
+ className: M("flex items-start gap-2.5 px-4 py-2", N(`n:${t.id}`)),
579
644
  children: [
580
645
  /* @__PURE__ */ e(
581
- je,
646
+ qe,
582
647
  {
583
648
  userId: t.sender,
584
649
  className: "mt-0.5 h-5 w-5",
@@ -589,8 +654,8 @@ function nt({
589
654
  "button",
590
655
  {
591
656
  type: "button",
592
- onClick: () => k(t.collection, t.item),
593
- className: de(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",
657
+ onClick: () => v(t.collection, t.item),
658
+ 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",
594
659
  children: [
595
660
  /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
596
661
  t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
@@ -614,57 +679,57 @@ function nt({
614
679
  ] })
615
680
  }, n = new Map(
616
681
  x.order.filter((t) => !x.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
617
- ), b = [...n.keys()], i = [];
618
- let m = 0;
619
- for (; m < b.length; ) {
620
- const t = b[m];
682
+ ), h = [...n.keys()], l = [];
683
+ let p = 0;
684
+ for (; p < h.length; ) {
685
+ const t = h[p];
621
686
  if (t === "records")
622
- i.push(/* @__PURE__ */ e("div", { children: n.get(t) }, t)), m++;
687
+ l.push(/* @__PURE__ */ e("div", { children: n.get(t) }, t)), p++;
623
688
  else {
624
- const p = [t];
625
- m + 1 < b.length && b[m + 1] !== "records" && p.push(b[m + 1]), i.push(
626
- /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: p.map((s) => /* @__PURE__ */ e("div", { children: n.get(s) }, s)) }, p.join("+"))
627
- ), m += p.length;
689
+ const b = [t];
690
+ p + 1 < h.length && h[p + 1] !== "records" && b.push(h[p + 1]), l.push(
691
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: b.map((o) => /* @__PURE__ */ e("div", { children: n.get(o) }, o)) }, b.join("+"))
692
+ ), p += b.length;
628
693
  }
629
694
  }
630
- return i;
695
+ return l;
631
696
  })(),
632
- /* @__PURE__ */ e(Ie, {})
697
+ /* @__PURE__ */ e(Ke, {})
633
698
  ] });
634
699
  }
635
- function Ie() {
636
- const l = _e(), { rooms: c } = Ce(l);
637
- return !l || c.length === 0 ? null : /* @__PURE__ */ d(
700
+ function Ke() {
701
+ const i = $e(), { rooms: u } = Te(i);
702
+ return !i || u.length === 0 ? null : /* @__PURE__ */ d(
638
703
  "section",
639
704
  {
640
705
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
641
706
  "data-my-work-chat": !0,
642
707
  children: [
643
708
  /* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
644
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
709
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: u.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
645
710
  "button",
646
711
  {
647
712
  type: "button",
648
- onClick: () => ve(u.room, u.label),
713
+ onClick: () => Se(c.room, c.label),
649
714
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
650
- "data-my-work-chat-room": u.room,
715
+ "data-my-work-chat-room": c.room,
651
716
  children: [
652
717
  /* @__PURE__ */ d("span", { className: "min-w-0 flex-1", children: [
653
- /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: u.label }),
654
- u.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
655
- u.last_message.sender_name ? `${u.last_message.sender_name}: ` : "",
656
- u.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
718
+ /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: c.label }),
719
+ c.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
720
+ c.last_message.sender_name ? `${c.last_message.sender_name}: ` : "",
721
+ c.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
657
722
  ] })
658
723
  ] }),
659
- u.mentions > 0 && /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white", children: "@" }),
660
- /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-slate-100 px-1.5 text-[10px] font-bold tabular-nums text-slate-600 dark:bg-muted dark:text-slate-300", children: u.unread > 99 ? "99+" : u.unread })
724
+ c.mentions > 0 && /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white", children: "@" }),
725
+ /* @__PURE__ */ e("span", { className: "flex h-5 min-w-5 items-center justify-center rounded-full bg-slate-100 px-1.5 text-[10px] font-bold tabular-nums text-slate-600 dark:bg-muted dark:text-slate-300", children: c.unread > 99 ? "99+" : c.unread })
661
726
  ]
662
727
  }
663
- ) }, u.room)) })
728
+ ) }, c.room)) })
664
729
  ]
665
730
  }
666
731
  );
667
732
  }
668
733
  export {
669
- nt as MyWorkView
734
+ mt as MyWorkView
670
735
  };