@nivaro/react 0.3.116 → 0.3.118

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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,44 +1,44 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import { useQuery as L } from "@tanstack/react-query";
3
- import { Users as j, Check as q, Settings2 as W, Plus as D, X as E, BellRing as R, Bell as U, GitBranch as K, ListChecks as M, Clock as H, Search as I } from "lucide-react";
4
- import { useState as b, useId as Q, useMemo as Y } from "react";
5
- import { useOptionalNivaroClient as B } from "../../context.js";
3
+ import { Users as D, Check as j, Settings2 as M, Plus as q, X as B, BellRing as P, Bell as W, GitBranch as U, ListChecks as I, Clock as K, Search as H } from "lucide-react";
4
+ import { useState as f, useId as Q, useRef as Y, useMemo as G } from "react";
5
+ import { useOptionalNivaroClient as E } from "../../context.js";
6
6
  import { get as F } from "../../lib/commands.js";
7
- import { describeError as G } from "../../lib/error-message.js";
8
- import { desktopPermission as X, requestDesktopPermission as z } from "../../lib/watch-desktop.js";
9
- import { watchKeys as J } from "../../lib/watch-list.js";
10
- import { Popover as S, PopoverTrigger as _, PopoverContent as P } from "../ui/popover.js";
11
- import { Skeleton as V } from "../ui/skeleton.js";
7
+ import { describeError as X } from "../../lib/error-message.js";
8
+ import { desktopPermission as z, requestDesktopPermission as J } from "../../lib/watch-desktop.js";
9
+ import { watchKeys as V } from "../../lib/watch-list.js";
10
+ import { Popover as _, PopoverTrigger as S, PopoverContent as O } from "../ui/popover.js";
11
+ import { Skeleton as Z } from "../ui/skeleton.js";
12
12
  function w({
13
13
  checked: t,
14
- onChange: r,
15
- label: u,
16
- hint: h,
17
- disabled: i,
18
- indent: o
14
+ onChange: s,
15
+ label: o,
16
+ hint: r,
17
+ disabled: n,
18
+ indent: c
19
19
  }) {
20
- const d = Q();
21
- return /* @__PURE__ */ n("div", { className: `flex items-start gap-3 py-2 ${o ? "pl-4" : ""}`, children: [
22
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
20
+ const p = Q();
21
+ return /* @__PURE__ */ l("div", { className: `flex items-start gap-3 py-2 ${c ? "pl-4" : ""}`, children: [
22
+ /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
23
23
  /* @__PURE__ */ e(
24
24
  "label",
25
25
  {
26
- htmlFor: d,
27
- className: `block text-[12.5px] font-medium ${i ? "text-slate-400 dark:text-slate-500" : "text-slate-800 dark:text-slate-100"}`,
28
- children: u
26
+ htmlFor: p,
27
+ className: `block text-balance text-[12.5px] font-medium ${n ? "text-slate-400 dark:text-slate-500" : "text-slate-800 dark:text-slate-100"}`,
28
+ children: o
29
29
  }
30
30
  ),
31
- h && /* @__PURE__ */ e("div", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: h })
31
+ r && /* @__PURE__ */ e("div", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: r })
32
32
  ] }),
33
33
  /* @__PURE__ */ e(
34
34
  "button",
35
35
  {
36
- id: d,
36
+ id: p,
37
37
  type: "button",
38
38
  role: "switch",
39
39
  "aria-checked": t,
40
- disabled: i,
41
- onClick: () => r(!t),
40
+ disabled: n,
41
+ onClick: () => s(!t),
42
42
  className: `relative mt-0.5 inline-flex h-[18px] w-8 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 focus-visible:ring-offset-1 focus-visible:ring-offset-popover disabled:cursor-not-allowed disabled:opacity-40 ${t ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-white/[0.16]"}`,
43
43
  children: /* @__PURE__ */ e(
44
44
  "span",
@@ -54,49 +54,49 @@ function w({
54
54
  function $({ children: t }) {
55
55
  return /* @__PURE__ */ e("p", { className: "px-3 pb-1 pt-3 text-[11px] font-semibold text-slate-500 dark:text-slate-400", children: t });
56
56
  }
57
- const Z = "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-200";
58
- function be({
57
+ const ee = "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-200";
58
+ function ge({
59
59
  actions: t,
60
- onOpenTeam: r,
61
- onNewTeam: u
60
+ onOpenTeam: s,
61
+ onNewTeam: o
62
62
  }) {
63
- const { settings: h, teams: i } = t.prefs, [o, d] = b(() => X()), [s, a] = b(!1), l = async (c) => {
64
- if (!c) return void t.setSettings({ desktop: !1 }).catch(() => {
63
+ const { settings: r, teams: n } = t.prefs, [c, p] = f(() => z()), [h, a] = f(!1), m = async (i) => {
64
+ if (!i) return void t.setSettings({ desktop: !1 }).catch(() => {
65
65
  });
66
- const f = o === "granted" ? o : await z();
67
- d(f), f === "granted" && await t.setSettings({ desktop: !0 }).catch(() => {
66
+ const x = c === "granted" ? c : await J();
67
+ p(x), x === "granted" && await t.setSettings({ desktop: !0 }).catch(() => {
68
68
  });
69
69
  };
70
- return /* @__PURE__ */ n(S, { open: s, onOpenChange: a, children: [
71
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e(
70
+ return /* @__PURE__ */ l(_, { open: h, onOpenChange: a, children: [
71
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
72
72
  "button",
73
73
  {
74
74
  type: "button",
75
75
  "aria-label": "Watch list settings",
76
76
  "data-tip": "Settings",
77
- className: Z,
77
+ className: ee,
78
78
  "data-watch-settings": !0,
79
- children: /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" })
79
+ children: /* @__PURE__ */ e(M, { className: "h-3.5 w-3.5" })
80
80
  }
81
81
  ) }),
82
- /* @__PURE__ */ n(
83
- P,
82
+ /* @__PURE__ */ l(
83
+ O,
84
84
  {
85
85
  align: "end",
86
86
  className: "w-[300px] p-0",
87
- onOpenAutoFocus: (c) => c.preventDefault(),
87
+ onOpenAutoFocus: (i) => i.preventDefault(),
88
88
  children: [
89
- /* @__PURE__ */ n("div", { className: "px-3 pt-1", children: [
89
+ /* @__PURE__ */ l("div", { className: "px-3 pt-1", children: [
90
90
  /* @__PURE__ */ e($, { children: "Tell me" }),
91
- /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 px-3 dark:divide-white/[0.06]", children: [
91
+ /* @__PURE__ */ l("div", { className: "divide-y divide-slate-100 px-3 dark:divide-white/[0.06]", children: [
92
92
  /* @__PURE__ */ e(
93
93
  w,
94
94
  {
95
95
  label: "Desktop alerts",
96
- hint: o === "unsupported" ? "This browser cannot show notifications." : o === "denied" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-amber-300", children: "Your browser blocks notifications for this site. Allow them in the browser’s site settings, then turn this on." }) : "A notice on your computer when someone else changes a pinned record while this page is in the background.",
97
- checked: h.desktop && o === "granted",
98
- disabled: o === "unsupported",
99
- onChange: (c) => void l(c)
96
+ hint: c === "unsupported" ? "This browser cannot show notifications." : c === "denied" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-amber-300", children: "Your browser blocks notifications for this site. Allow them in the browser’s site settings, then turn this on." }) : "A notice on your computer when someone else changes a pinned record while this page is in the background.",
97
+ checked: r.desktop && c === "granted",
98
+ disabled: c === "unsupported",
99
+ onChange: (i) => void m(i)
100
100
  }
101
101
  ),
102
102
  /* @__PURE__ */ e(
@@ -104,21 +104,21 @@ function be({
104
104
  {
105
105
  label: "Daily email",
106
106
  hint: "One email each morning of what changed on your pinned records. Nothing on quiet days.",
107
- checked: h.digest,
108
- onChange: (c) => void t.setSettings({ digest: c }).catch(() => {
107
+ checked: r.digest,
108
+ onChange: (i) => void t.setSettings({ digest: i }).catch(() => {
109
109
  })
110
110
  }
111
111
  )
112
112
  ] }),
113
113
  /* @__PURE__ */ e($, { children: "Pin for me" }),
114
- /* @__PURE__ */ n("div", { className: "px-3", children: [
114
+ /* @__PURE__ */ l("div", { className: "px-3", children: [
115
115
  /* @__PURE__ */ e(
116
116
  w,
117
117
  {
118
118
  label: "Records that land on my step",
119
119
  hint: "When a record moves to a step you own, it is pinned here for you.",
120
- checked: h.auto_add,
121
- onChange: (c) => void t.setSettings({ auto_add: c }).catch(() => {
120
+ checked: r.auto_add,
121
+ onChange: (i) => void t.setSettings({ auto_add: i }).catch(() => {
122
122
  })
123
123
  }
124
124
  ),
@@ -128,9 +128,9 @@ function be({
128
128
  indent: !0,
129
129
  label: "Unpin them when they leave my step",
130
130
  hint: "Only records pinned this way. A record you pinned yourself stays.",
131
- checked: h.auto_remove,
132
- disabled: !h.auto_add,
133
- onChange: (c) => void t.setSettings({ auto_remove: c }).catch(() => {
131
+ checked: r.auto_remove,
132
+ disabled: !r.auto_add,
133
+ onChange: (i) => void t.setSettings({ auto_remove: i }).catch(() => {
134
134
  })
135
135
  }
136
136
  )
@@ -141,39 +141,39 @@ function be({
141
141
  {
142
142
  label: "Remove records when they’re completed",
143
143
  hint: "They show “Completed”, then leave 24 hours later or once you’ve seen them. Recently removed keeps them 7 days, with Undo.",
144
- checked: h.remove_completed,
145
- onChange: (c) => void t.setSettings({ remove_completed: c }).catch(() => {
144
+ checked: r.remove_completed,
145
+ onChange: (i) => void t.setSettings({ remove_completed: i }).catch(() => {
146
146
  })
147
147
  }
148
148
  ) })
149
149
  ] }),
150
- /* @__PURE__ */ n("div", { className: "mt-1 border-t border-border px-3 pb-2", children: [
150
+ /* @__PURE__ */ l("div", { className: "mt-1 border-t border-border px-3 pb-2", children: [
151
151
  /* @__PURE__ */ e($, { children: "Shared lists" }),
152
- i.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 pb-1 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "A list your team watches together. Each person sees only the records they can open." }) : /* @__PURE__ */ e("ul", { className: "pb-1", children: i.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
152
+ n.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 pb-1 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "A list your team watches together. Each person sees only the records they can open." }) : /* @__PURE__ */ e("ul", { className: "pb-1", children: n.map((i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
153
153
  "button",
154
154
  {
155
155
  type: "button",
156
156
  onClick: () => {
157
- a(!1), r(c.id);
157
+ a(!1), s(i.id);
158
158
  },
159
159
  className: "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
160
160
  children: [
161
- /* @__PURE__ */ e(j, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
162
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: c.name }),
163
- /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: c.pins.length })
161
+ /* @__PURE__ */ e(D, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
162
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: i.name }),
163
+ /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: i.pins.length })
164
164
  ]
165
165
  }
166
- ) }, c.id)) }),
167
- /* @__PURE__ */ n(
166
+ ) }, i.id)) }),
167
+ /* @__PURE__ */ l(
168
168
  "button",
169
169
  {
170
170
  type: "button",
171
171
  onClick: () => {
172
- a(!1), u();
172
+ a(!1), o();
173
173
  },
174
174
  className: "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-[12.5px] font-medium text-slate-700 hover:bg-muted dark:text-slate-200",
175
175
  children: [
176
- /* @__PURE__ */ e(D, { className: "h-3.5 w-3.5 shrink-0" }),
176
+ /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5 shrink-0" }),
177
177
  "New shared list"
178
178
  ]
179
179
  }
@@ -184,7 +184,7 @@ function be({
184
184
  )
185
185
  ] });
186
186
  }
187
- const ee = {
187
+ const te = {
188
188
  step: "It reaches a step",
189
189
  field: "A field changes",
190
190
  overdue: "It’s overdue"
@@ -192,43 +192,43 @@ const ee = {
192
192
  function A(t) {
193
193
  return `${t.kind === "step" ? `Reaches ${t.label ?? t.step ?? "a step"}` : t.kind === "field" ? `${t.label ?? t.field ?? "A field"} changes` : "It’s overdue"} · ${t.repeat ? "every time" : "once"}`;
194
194
  }
195
- function O({
195
+ function T({
196
196
  items: t,
197
- value: r,
198
- onPick: u,
199
- placeholder: h,
200
- empty: i
197
+ value: s,
198
+ onPick: o,
199
+ placeholder: r,
200
+ empty: n
201
201
  }) {
202
- const [o, d] = b(""), s = Y(() => {
203
- const a = o.trim().toLowerCase();
204
- return a ? t.filter((l) => l.label.toLowerCase().includes(a)) : t;
205
- }, [t, o]);
206
- return /* @__PURE__ */ n("div", { className: "rounded-md border border-border", children: [
207
- t.length > 7 && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 border-b border-border px-2", children: [
208
- /* @__PURE__ */ e(I, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" }),
202
+ const [c, p] = f(""), h = G(() => {
203
+ const a = c.trim().toLowerCase();
204
+ return a ? t.filter((m) => m.label.toLowerCase().includes(a)) : t;
205
+ }, [t, c]);
206
+ return /* @__PURE__ */ l("div", { className: "rounded-md border border-border", children: [
207
+ t.length > 7 && /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5 border-b border-border px-2", children: [
208
+ /* @__PURE__ */ e(H, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" }),
209
209
  /* @__PURE__ */ e(
210
210
  "input",
211
211
  {
212
- value: o,
213
- onChange: (a) => d(a.target.value),
214
- placeholder: h,
215
- "aria-label": h,
212
+ value: c,
213
+ onChange: (a) => p(a.target.value),
214
+ placeholder: r,
215
+ "aria-label": r,
216
216
  className: "h-7 min-w-0 flex-1 bg-transparent text-[12px] text-slate-800 outline-none placeholder:text-slate-400 dark:text-slate-100"
217
217
  }
218
218
  )
219
219
  ] }),
220
- /* @__PURE__ */ n("div", { role: "listbox", "aria-label": h, className: "max-h-36 overflow-y-auto p-1", children: [
221
- s.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: i }),
222
- s.map((a) => {
223
- const l = a.value === r;
224
- return /* @__PURE__ */ n(
220
+ /* @__PURE__ */ l("div", { role: "listbox", "aria-label": r, className: "max-h-36 overflow-y-auto p-1", children: [
221
+ h.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: n }),
222
+ h.map((a) => {
223
+ const m = a.value === s;
224
+ return /* @__PURE__ */ l(
225
225
  "button",
226
226
  {
227
227
  type: "button",
228
228
  role: "option",
229
- "aria-selected": l,
230
- onClick: () => u(a.value, a.label),
231
- className: `flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] ${l ? "bg-accent text-slate-900 dark:text-slate-50" : "text-slate-700 hover:bg-muted dark:text-slate-200"}`,
229
+ "aria-selected": m,
230
+ onClick: () => o(a.value, a.label),
231
+ className: `flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] ${m ? "bg-accent text-slate-900 dark:text-slate-50" : "text-slate-700 hover:bg-muted dark:text-slate-200"}`,
232
232
  children: [
233
233
  a.color !== void 0 && /* @__PURE__ */ e(
234
234
  "span",
@@ -239,7 +239,7 @@ function O({
239
239
  }
240
240
  ),
241
241
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a.label }),
242
- l && /* @__PURE__ */ e(q, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-nvr-cyan" })
242
+ m && /* @__PURE__ */ e(j, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-nvr-cyan" })
243
243
  ]
244
244
  },
245
245
  a.value
@@ -248,126 +248,126 @@ function O({
248
248
  ] })
249
249
  ] });
250
250
  }
251
- function te({
251
+ function ae({
252
252
  value: t,
253
- options: r,
254
- onChange: u,
255
- label: h
253
+ options: s,
254
+ onChange: o,
255
+ label: r
256
256
  }) {
257
257
  return /* @__PURE__ */ e(
258
258
  "div",
259
259
  {
260
260
  role: "radiogroup",
261
- "aria-label": h,
261
+ "aria-label": r,
262
262
  className: "inline-flex rounded-md bg-slate-100 p-0.5 dark:bg-white/[0.06]",
263
- children: r.map((i) => (
263
+ children: s.map((n) => (
264
264
  // biome-ignore lint/a11y/useSemanticElements: a segmented control, styled as one row
265
265
  /* @__PURE__ */ e(
266
266
  "button",
267
267
  {
268
268
  type: "button",
269
269
  role: "radio",
270
- "aria-checked": i.value === t,
271
- onClick: () => u(i.value),
272
- className: `rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${i.value === t ? "bg-white text-slate-900 shadow-[0_1px_2px_rgba(15,23,42,0.08)] dark:bg-white/[0.12] dark:text-slate-50" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"}`,
273
- children: i.label
270
+ "aria-checked": n.value === t,
271
+ onClick: () => o(n.value),
272
+ className: `rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${n.value === t ? "bg-white text-slate-900 shadow-[0_1px_2px_rgba(15,23,42,0.08)] dark:bg-white/[0.12] dark:text-slate-50" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"}`,
273
+ children: n.label
274
274
  },
275
- i.value
275
+ n.value
276
276
  )
277
277
  ))
278
278
  }
279
279
  );
280
280
  }
281
- function ae({
281
+ function se({
282
282
  row: t,
283
- actions: r,
284
- onDone: u
283
+ actions: s,
284
+ onDone: o
285
285
  }) {
286
- var x, v;
287
- const h = B(), i = L({
288
- queryKey: J.alertOptions(t.collection, t.id),
289
- queryFn: () => h.request(
286
+ var b, g;
287
+ const r = E(), n = L({
288
+ queryKey: V.alertOptions(t.collection, t.id),
289
+ queryFn: () => r.request(
290
290
  F(
291
291
  `/watch-list/alert-options/${encodeURIComponent(t.collection)}/${encodeURIComponent(t.id)}`
292
292
  )
293
- ).then((m) => m.data),
294
- enabled: !!h,
293
+ ).then((u) => u.data),
294
+ enabled: !!r,
295
295
  staleTime: 5 * 6e4
296
- }), [o, d] = b("step"), [s, a] = b(null), [l, p] = b("once"), [c, f] = b(!1), N = o === "overdue" || !!s, g = async () => {
297
- if (!(!N || c)) {
298
- f(!0);
296
+ }), [c, p] = f("step"), [h, a] = f(null), [m, d] = f("once"), [i, x] = f(!1), N = c === "overdue" || !!h, v = async () => {
297
+ if (!(!N || i)) {
298
+ x(!0);
299
299
  try {
300
- await r.addAlert({
300
+ await s.addAlert({
301
301
  collection: t.collection,
302
302
  id: t.id,
303
- kind: o,
304
- ...o === "step" ? { step: s == null ? void 0 : s.value, label: s == null ? void 0 : s.label } : {},
305
- ...o === "field" ? { field: s == null ? void 0 : s.value, label: s == null ? void 0 : s.label } : {},
306
- repeat: l === "always"
307
- }), u();
303
+ kind: c,
304
+ ...c === "step" ? { step: h == null ? void 0 : h.value, label: h == null ? void 0 : h.label } : {},
305
+ ...c === "field" ? { field: h == null ? void 0 : h.value, label: h == null ? void 0 : h.label } : {},
306
+ repeat: m === "always"
307
+ }), o();
308
308
  } catch {
309
309
  } finally {
310
- f(!1);
310
+ x(!1);
311
311
  }
312
312
  }
313
313
  };
314
- if (i.isError) {
315
- const m = G(i.error, "The choices could not load");
316
- return /* @__PURE__ */ e("p", { className: "py-2 text-[12px] text-slate-600 dark:text-slate-300", children: m.title });
314
+ if (n.isError) {
315
+ const u = X(n.error, "The choices could not load");
316
+ return /* @__PURE__ */ e("p", { className: "py-2 text-[12px] text-slate-600 dark:text-slate-300", children: u.title });
317
317
  }
318
- const y = ((x = i.data) == null ? void 0 : x.steps) ?? [], C = ((v = i.data) == null ? void 0 : v.fields) ?? [];
319
- return /* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
320
- /* @__PURE__ */ e("div", { role: "radiogroup", "aria-label": "Tell me when", className: "space-y-0.5", children: ["step", "field", "overdue"].map((m) => {
321
- const k = m === "step" && i.isSuccess && y.length === 0;
318
+ const y = ((b = n.data) == null ? void 0 : b.steps) ?? [], C = ((g = n.data) == null ? void 0 : g.fields) ?? [];
319
+ return /* @__PURE__ */ l("div", { className: "space-y-2.5", children: [
320
+ /* @__PURE__ */ e("div", { role: "radiogroup", "aria-label": "Tell me when", className: "space-y-0.5", children: ["step", "field", "overdue"].map((u) => {
321
+ const k = u === "step" && n.isSuccess && y.length === 0;
322
322
  return (
323
323
  // biome-ignore lint/a11y/useSemanticElements: a choice list, styled as menu rows
324
- /* @__PURE__ */ n(
324
+ /* @__PURE__ */ l(
325
325
  "button",
326
326
  {
327
327
  type: "button",
328
328
  role: "radio",
329
- "aria-checked": o === m,
329
+ "aria-checked": c === u,
330
330
  disabled: k,
331
331
  onClick: () => {
332
- d(m), a(null);
332
+ p(u), a(null);
333
333
  },
334
- className: `flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${o === m ? "bg-accent font-medium text-slate-900 dark:text-slate-50" : "text-slate-600 hover:bg-muted dark:text-slate-300"}`,
334
+ className: `flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c === u ? "bg-accent font-medium text-slate-900 dark:text-slate-50" : "text-slate-600 hover:bg-muted dark:text-slate-300"}`,
335
335
  children: [
336
- /* @__PURE__ */ e(m === "step" ? K : m === "field" ? M : H, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
337
- ee[m]
336
+ /* @__PURE__ */ e(u === "step" ? U : u === "field" ? I : K, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
337
+ te[u]
338
338
  ]
339
339
  },
340
- m
340
+ u
341
341
  )
342
342
  );
343
343
  }) }),
344
- o !== "overdue" && (i.isLoading ? /* @__PURE__ */ e(V, { className: "h-24 w-full rounded-md" }) : o === "step" ? /* @__PURE__ */ e(
345
- O,
344
+ c !== "overdue" && (n.isLoading ? /* @__PURE__ */ e(Z, { className: "h-24 w-full rounded-md" }) : c === "step" ? /* @__PURE__ */ e(
345
+ T,
346
346
  {
347
- items: y.map((m) => ({ value: m.key, label: m.label, color: m.color })),
348
- value: (s == null ? void 0 : s.value) ?? "",
349
- onPick: (m, k) => a({ value: m, label: k }),
347
+ items: y.map((u) => ({ value: u.key, label: u.label, color: u.color })),
348
+ value: (h == null ? void 0 : h.value) ?? "",
349
+ onPick: (u, k) => a({ value: u, label: k }),
350
350
  placeholder: "Find a step",
351
351
  empty: "No steps match"
352
352
  }
353
353
  ) : /* @__PURE__ */ e(
354
- O,
354
+ T,
355
355
  {
356
- items: C.map((m) => ({ value: m.field, label: m.label })),
357
- value: (s == null ? void 0 : s.value) ?? "",
358
- onPick: (m, k) => a({ value: m, label: k }),
356
+ items: C.map((u) => ({ value: u.field, label: u.label })),
357
+ value: (h == null ? void 0 : h.value) ?? "",
358
+ onPick: (u, k) => a({ value: u, label: k }),
359
359
  placeholder: "Find a field",
360
360
  empty: "No fields match"
361
361
  }
362
362
  )),
363
- o === "overdue" && /* @__PURE__ */ e("p", { className: "px-2 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "When its current step passes its due time. One alert per step it runs late on." }),
364
- /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2 pt-0.5", children: [
363
+ c === "overdue" && /* @__PURE__ */ e("p", { className: "px-2 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "When its current step passes its due time. One alert per step it runs late on." }),
364
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 pt-0.5", children: [
365
365
  /* @__PURE__ */ e(
366
- te,
366
+ ae,
367
367
  {
368
368
  label: "How often",
369
- value: l,
370
- onChange: p,
369
+ value: m,
370
+ onChange: d,
371
371
  options: [
372
372
  { value: "once", label: "Once" },
373
373
  { value: "always", label: "Every time" }
@@ -378,77 +378,121 @@ function ae({
378
378
  "button",
379
379
  {
380
380
  type: "button",
381
- disabled: !N || c,
382
- onClick: () => void g(),
383
- className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",
384
- children: c ? "Adding…" : "Add alert"
381
+ disabled: !N || i,
382
+ onClick: () => void v(),
383
+ className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:font-medium disabled:text-slate-400 disabled:hover:opacity-100 dark:disabled:bg-white/[0.06] dark:disabled:!text-slate-500",
384
+ children: i ? "Adding…" : "Add alert"
385
385
  }
386
386
  )
387
387
  ] })
388
388
  ] });
389
389
  }
390
- function fe({ row: t, actions: r }) {
391
- const [u, h] = b(!1), [i, o] = b(!1), d = r.prefs.alerts.filter((l) => l.key === t.key), s = d.length > 0, a = t.title ?? t.collection_label;
392
- return /* @__PURE__ */ n(
393
- S,
390
+ function le(t) {
391
+ const s = t == null ? void 0 : t.closest("[data-watch-dock]");
392
+ if (!t || !s) return { side: "left", sideOffset: 6 };
393
+ const o = s.getBoundingClientRect(), r = t.getBoundingClientRect();
394
+ return o.left < 300 ? { side: "bottom", sideOffset: 4 } : { side: "left", sideOffset: Math.max(6, Math.round(r.left - o.left) + 8) };
395
+ }
396
+ function ve({ row: t, actions: s }) {
397
+ const o = s.prefs.alerts.filter((n) => n.key === t.key);
398
+ if (o.length === 0) return null;
399
+ const r = A(o[0]) + (o.length > 1 ? ` +${o.length - 1}` : "");
400
+ return /* @__PURE__ */ l("span", { "data-tip": r, "data-watch-alert-mark": !0, className: "flex text-nvr-cyan", children: [
401
+ /* @__PURE__ */ e(P, { "aria-hidden": !0, className: "h-3 w-3" }),
402
+ /* @__PURE__ */ l("span", { className: "sr-only", children: [
403
+ "Alert: ",
404
+ r
405
+ ] })
406
+ ] });
407
+ }
408
+ function ye({ row: t, actions: s }) {
409
+ const o = s.prefs.pins.find((n) => n.key === t.key);
410
+ if (!(o != null && o.auto)) return null;
411
+ const r = s.prefs.settings.auto_remove ? "Pinned for you: it landed on your step. It unpins when it leaves your step." : "Pinned for you: it landed on your step.";
412
+ return /* @__PURE__ */ l(
413
+ "span",
414
+ {
415
+ "data-tip": r,
416
+ "data-watch-auto-pin": !0,
417
+ className: "inline-flex h-4 items-center rounded px-1 text-[10px] font-medium text-slate-500 ring-1 ring-inset ring-slate-200 dark:text-slate-400 dark:ring-white/[0.12]",
418
+ children: [
419
+ "For you",
420
+ /* @__PURE__ */ l("span", { className: "sr-only", children: [
421
+ ". ",
422
+ r
423
+ ] })
424
+ ]
425
+ }
426
+ );
427
+ }
428
+ function ke({ row: t, actions: s }) {
429
+ const [o, r] = f(!1), [n, c] = f(!1), [p, h] = f({
430
+ side: "left",
431
+ sideOffset: 6
432
+ }), a = Y(null), m = s.prefs.alerts.filter((x) => x.key === t.key), d = m.length > 0, i = t.title ?? t.collection_label;
433
+ return /* @__PURE__ */ l(
434
+ _,
394
435
  {
395
- open: u,
396
- onOpenChange: (l) => {
397
- h(l), l && o(!s);
436
+ open: o,
437
+ onOpenChange: (x) => {
438
+ x && (h(le(a.current)), c(!d)), r(x);
398
439
  },
399
440
  children: [
400
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e(
441
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
401
442
  "button",
402
443
  {
444
+ ref: a,
403
445
  type: "button",
404
- "aria-label": s ? `Alerts on ${a} (${d.length})` : `Add an alert on ${a}`,
405
- "data-tip": s ? A(d[0]) + (d.length > 1 ? ` +${d.length - 1}` : "") : "Alert me when…",
406
- "data-watch-alert": s ? "on" : "off",
407
- onClick: (l) => l.stopPropagation(),
408
- className: `flex h-6 w-6 items-center justify-center rounded-md transition-colors focus-visible:visible focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 group-hover/row:visible ${s ? "text-nvr-cyan hover:bg-nvr-cyan/10" : `${u ? "" : "invisible"} text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-500 dark:hover:bg-white/[0.08] dark:hover:text-slate-200`}`,
409
- children: s ? /* @__PURE__ */ e(R, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(U, { className: "h-3.5 w-3.5" })
446
+ "aria-label": d ? `Alerts on ${i} (${m.length})` : `Add an alert on ${i}`,
447
+ "data-tip": d ? A(m[0]) + (m.length > 1 ? ` +${m.length - 1}` : "") : "Alert me when…",
448
+ "data-watch-alert": d ? "on" : "off",
449
+ onClick: (x) => x.stopPropagation(),
450
+ className: `flex h-6 w-6 items-center justify-center rounded-md transition-colors focus-visible:visible focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 group-hover/row:visible ${o ? "" : "invisible"} ${d ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-500 dark:hover:bg-white/[0.08] dark:hover:text-slate-200"}`,
451
+ children: d ? /* @__PURE__ */ e(P, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" })
410
452
  }
411
453
  ) }),
412
- /* @__PURE__ */ n(
413
- P,
454
+ /* @__PURE__ */ l(
455
+ O,
414
456
  {
415
- align: "end",
416
- side: "left",
417
- className: "w-[280px] p-3",
418
- onClick: (l) => l.stopPropagation(),
457
+ align: p.side === "left" ? "start" : "end",
458
+ side: p.side,
459
+ sideOffset: p.sideOffset,
460
+ collisionPadding: { top: 56, bottom: 12, left: 12, right: 12 },
461
+ className: "w-[296px] max-w-[calc(100vw-24px)] p-3",
462
+ onClick: (x) => x.stopPropagation(),
419
463
  children: [
420
464
  /* @__PURE__ */ e("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Tell me when…" }),
421
- /* @__PURE__ */ e("p", { className: "mb-2 truncate text-[11.5px] text-slate-500 dark:text-slate-400", children: a }),
422
- s && /* @__PURE__ */ e("ul", { className: "mb-2 space-y-0.5", "aria-label": "Alerts on this record", children: d.map((l) => /* @__PURE__ */ n(
465
+ /* @__PURE__ */ e("p", { className: "mb-2 truncate text-[11.5px] text-slate-500 dark:text-slate-400", children: i }),
466
+ d && /* @__PURE__ */ e("ul", { className: "mb-2 space-y-0.5", "aria-label": "Alerts on this record", children: m.map((x) => /* @__PURE__ */ l(
423
467
  "li",
424
468
  {
425
- className: "flex items-center gap-2 rounded-md bg-slate-50 py-1 pl-2 pr-1 text-[12px] text-slate-700 dark:bg-white/[0.04] dark:text-slate-200",
469
+ className: "flex items-start gap-2 rounded-md bg-slate-50 py-1 pl-2 pr-1 text-[12px] text-slate-700 dark:bg-white/[0.04] dark:text-slate-200",
426
470
  children: [
427
- /* @__PURE__ */ e(R, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-nvr-cyan" }),
428
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", "data-tip": A(l), children: A(l) }),
471
+ /* @__PURE__ */ e(P, { "aria-hidden": !0, className: "mt-[3px] h-3 w-3 shrink-0 text-nvr-cyan" }),
472
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 break-words py-px leading-snug", children: A(x) }),
429
473
  /* @__PURE__ */ e(
430
474
  "button",
431
475
  {
432
476
  type: "button",
433
- "aria-label": `Remove alert: ${A(l)}`,
434
- onClick: () => void r.removeAlert(l.id).catch(() => {
477
+ "aria-label": `Remove alert: ${A(x)}`,
478
+ onClick: () => void s.removeAlert(x.id).catch(() => {
435
479
  }),
436
480
  className: "flex h-5 w-5 shrink-0 items-center justify-center rounded text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 dark:hover:bg-white/[0.08] dark:hover:text-slate-200",
437
- children: /* @__PURE__ */ e(E, { className: "h-3 w-3" })
481
+ children: /* @__PURE__ */ e(B, { className: "h-3 w-3" })
438
482
  }
439
483
  )
440
484
  ]
441
485
  },
442
- l.id
486
+ x.id
443
487
  )) }),
444
- i ? /* @__PURE__ */ e(ae, { row: t, actions: r, onDone: () => o(!1) }) : /* @__PURE__ */ n(
488
+ n ? /* @__PURE__ */ e(se, { row: t, actions: s, onDone: () => c(!1) }) : /* @__PURE__ */ l(
445
489
  "button",
446
490
  {
447
491
  type: "button",
448
- onClick: () => o(!0),
492
+ onClick: () => c(!0),
449
493
  className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-slate-700 hover:bg-muted dark:text-slate-200",
450
494
  children: [
451
- /* @__PURE__ */ e(D, { className: "h-3.5 w-3.5" }),
495
+ /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" }),
452
496
  "Add another"
453
497
  ]
454
498
  }
@@ -460,80 +504,80 @@ function fe({ row: t, actions: r }) {
460
504
  }
461
505
  );
462
506
  }
463
- function se({
507
+ function ne({
464
508
  value: t,
465
- onChange: r,
466
- meId: u
509
+ onChange: s,
510
+ meId: o
467
511
  }) {
468
- const h = B(), [i, o] = b(""), d = i.trim(), s = L({
469
- queryKey: ["watch-list", "people", d],
470
- queryFn: () => h.request(F("/users", { search: d, limit: 8 })).then(
471
- (p) => (p.data ?? []).map((c) => ({
472
- id: String(c.id),
473
- name: `${c.first_name ?? ""} ${c.last_name ?? ""}`.trim() || c.email || "Someone",
474
- email: c.email
512
+ const r = E(), [n, c] = f(""), p = n.trim(), h = L({
513
+ queryKey: ["watch-list", "people", p],
514
+ queryFn: () => r.request(F("/users", { search: p, limit: 8 })).then(
515
+ (d) => (d.data ?? []).map((i) => ({
516
+ id: String(i.id),
517
+ name: `${i.first_name ?? ""} ${i.last_name ?? ""}`.trim() || i.email || "Someone",
518
+ email: i.email
475
519
  }))
476
520
  ),
477
- enabled: !!h && d.length > 1,
521
+ enabled: !!r && p.length > 1,
478
522
  staleTime: 3e4
479
- }), a = new Set(t.map((p) => p.id.toLowerCase())), l = (s.data ?? []).filter((p) => !a.has(p.id.toLowerCase()));
480
- return /* @__PURE__ */ n("div", { children: [
481
- t.length > 0 && /* @__PURE__ */ e("ul", { className: "mb-2 flex flex-wrap gap-1.5", "aria-label": "People on this list", children: t.map((p) => /* @__PURE__ */ n(
523
+ }), a = new Set(t.map((d) => d.id.toLowerCase())), m = (h.data ?? []).filter((d) => !a.has(d.id.toLowerCase()));
524
+ return /* @__PURE__ */ l("div", { children: [
525
+ t.length > 0 && /* @__PURE__ */ e("ul", { className: "mb-2 flex flex-wrap gap-1.5", "aria-label": "People on this list", children: t.map((d) => /* @__PURE__ */ l(
482
526
  "li",
483
527
  {
484
528
  className: "inline-flex items-center gap-1 rounded-full bg-slate-100 py-0.5 pl-2.5 pr-1 text-[12px] text-slate-700 dark:bg-white/[0.07] dark:text-slate-200",
485
529
  children: [
486
- p.name,
487
- u && p.id.toLowerCase() === u.toLowerCase() && /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-slate-400", children: "(you)" }),
530
+ d.name,
531
+ o && d.id.toLowerCase() === o.toLowerCase() && /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-slate-400", children: "(you)" }),
488
532
  /* @__PURE__ */ e(
489
533
  "button",
490
534
  {
491
535
  type: "button",
492
- "aria-label": `Take ${p.name} off the list`,
493
- onClick: () => r(t.filter((c) => c.id !== p.id)),
536
+ "aria-label": `Take ${d.name} off the list`,
537
+ onClick: () => s(t.filter((i) => i.id !== d.id)),
494
538
  className: "flex h-4 w-4 items-center justify-center rounded-full text-slate-400 hover:bg-slate-200 hover:text-slate-700 dark:hover:bg-white/[0.1] dark:hover:text-slate-200",
495
- children: /* @__PURE__ */ e(E, { className: "h-2.5 w-2.5" })
539
+ children: /* @__PURE__ */ e(B, { className: "h-2.5 w-2.5" })
496
540
  }
497
541
  )
498
542
  ]
499
543
  },
500
- p.id
544
+ d.id
501
545
  )) }),
502
- /* @__PURE__ */ n("div", { className: "relative", children: [
546
+ /* @__PURE__ */ l("div", { className: "relative", children: [
503
547
  /* @__PURE__ */ e(
504
548
  "input",
505
549
  {
506
- value: i,
507
- onChange: (p) => o(p.target.value),
550
+ value: n,
551
+ onChange: (d) => c(d.target.value),
508
552
  placeholder: "Add someone by name",
509
553
  "aria-label": "Add someone by name",
510
554
  className: "h-8 w-full rounded-md border border-border bg-background px-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-slate-100"
511
555
  }
512
556
  ),
513
- d.length > 1 && (l.length > 0 || s.isSuccess) && /* @__PURE__ */ n(
557
+ p.length > 1 && (m.length > 0 || h.isSuccess) && /* @__PURE__ */ l(
514
558
  "div",
515
559
  {
516
560
  role: "listbox",
517
561
  "aria-label": "People",
518
562
  className: "absolute left-0 right-0 z-10 mt-1 max-h-48 overflow-y-auto rounded-md border border-border bg-popover p-1 shadow-md",
519
563
  children: [
520
- l.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-slate-400", children: "Nobody else matches" }),
521
- l.map((p) => /* @__PURE__ */ n(
564
+ m.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-slate-400", children: "Nobody else matches" }),
565
+ m.map((d) => /* @__PURE__ */ l(
522
566
  "button",
523
567
  {
524
568
  type: "button",
525
569
  role: "option",
526
570
  "aria-selected": !1,
527
571
  onClick: () => {
528
- r([...t, p]), o("");
572
+ s([...t, d]), c("");
529
573
  },
530
574
  className: "block w-full rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
531
575
  children: [
532
- p.name,
533
- p.email && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: p.email })
576
+ d.name,
577
+ d.email && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: d.email })
534
578
  ]
535
579
  },
536
- p.id
580
+ d.id
537
581
  ))
538
582
  ]
539
583
  }
@@ -541,35 +585,35 @@ function se({
541
585
  ] })
542
586
  ] });
543
587
  }
544
- function ve({
588
+ function we({
545
589
  actions: t,
546
- team: r,
547
- meId: u,
548
- meName: h,
549
- onClose: i,
550
- onCreated: o
590
+ team: s,
591
+ meId: o,
592
+ meName: r,
593
+ onClose: n,
594
+ onCreated: c
551
595
  }) {
552
- const [d, s] = b((r == null ? void 0 : r.name) ?? ""), [a, l] = b(
553
- () => r ? r.members.map((x) => ({ id: x.id, name: x.name })) : u ? [{ id: u, name: h || "You" }] : []
554
- ), [p, c] = b(!1), [f, N] = b(r ? !!r.remove_completed : !0), [g, y] = b(!1), C = t.prefs.direct_reports ?? 0, T = async () => {
555
- const x = d.trim();
556
- if (!(!x || g)) {
596
+ const [p, h] = f((s == null ? void 0 : s.name) ?? ""), [a, m] = f(
597
+ () => s ? s.members.map((b) => ({ id: b.id, name: b.name })) : o ? [{ id: o, name: r || "You" }] : []
598
+ ), [d, i] = f(!1), [x, N] = f(s ? !!s.remove_completed : !0), [v, y] = f(!1), C = t.prefs.direct_reports ?? 0, R = async () => {
599
+ const b = p.trim();
600
+ if (!(!b || v)) {
557
601
  y(!0);
558
602
  try {
559
- if (r)
560
- await t.editTeam(r.id, {
561
- name: x,
562
- members: a.map((v) => v.id),
563
- remove_completed: f
564
- }), i();
603
+ if (s)
604
+ await t.editTeam(s.id, {
605
+ name: b,
606
+ members: a.map((g) => g.id),
607
+ remove_completed: x
608
+ }), n();
565
609
  else {
566
- const v = await t.createTeam({
567
- name: x,
568
- members: a.map((m) => m.id),
569
- reports: p,
570
- remove_completed: f
610
+ const g = await t.createTeam({
611
+ name: b,
612
+ members: a.map((u) => u.id),
613
+ reports: d,
614
+ remove_completed: x
571
615
  });
572
- v ? o(v) : i();
616
+ g ? c(g) : n();
573
617
  }
574
618
  } catch {
575
619
  } finally {
@@ -577,26 +621,26 @@ function ve({
577
621
  }
578
622
  }
579
623
  };
580
- return /* @__PURE__ */ n(
624
+ return /* @__PURE__ */ l(
581
625
  "form",
582
626
  {
583
627
  className: "space-y-4 px-4 py-4",
584
- onSubmit: (x) => {
585
- x.preventDefault(), T();
628
+ onSubmit: (b) => {
629
+ b.preventDefault(), R();
586
630
  },
587
631
  "data-watch-team-editor": !0,
588
632
  children: [
589
- /* @__PURE__ */ n("div", { children: [
590
- /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: r ? "Change shared list" : "New shared list" }),
633
+ /* @__PURE__ */ l("div", { children: [
634
+ /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: s ? "Change shared list" : "New shared list" }),
591
635
  /* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "Everyone on it sees it as a tab here and can add records. Each person only sees the records they can open." })
592
636
  ] }),
593
- /* @__PURE__ */ n("label", { className: "block", children: [
637
+ /* @__PURE__ */ l("label", { className: "block", children: [
594
638
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Name" }),
595
639
  /* @__PURE__ */ e(
596
640
  "input",
597
641
  {
598
- value: d,
599
- onChange: (x) => s(x.target.value),
642
+ value: p,
643
+ onChange: (b) => h(b.target.value),
600
644
  maxLength: 60,
601
645
  placeholder: "Night shift, Region East…",
602
646
  autoFocus: !0,
@@ -604,16 +648,16 @@ function ve({
604
648
  }
605
649
  )
606
650
  ] }),
607
- /* @__PURE__ */ n("div", { children: [
651
+ /* @__PURE__ */ l("div", { children: [
608
652
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "People" }),
609
- /* @__PURE__ */ e(se, { value: a, onChange: l, meId: u }),
610
- !r && C > 0 && /* @__PURE__ */ n("label", { className: "mt-2 flex items-center gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
653
+ /* @__PURE__ */ e(ne, { value: a, onChange: m, meId: o }),
654
+ !s && C > 0 && /* @__PURE__ */ l("label", { className: "mt-2 flex items-center gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
611
655
  /* @__PURE__ */ e(
612
656
  "input",
613
657
  {
614
658
  type: "checkbox",
615
- checked: p,
616
- onChange: (x) => c(x.target.checked),
659
+ checked: d,
660
+ onChange: (b) => i(b.target.checked),
617
661
  className: "h-3.5 w-3.5 rounded border-slate-300 accent-[var(--nvr-cyan,#00ceff)]"
618
662
  }
619
663
  ),
@@ -622,27 +666,27 @@ function ve({
622
666
  ")"
623
667
  ] })
624
668
  ] }),
625
- /* @__PURE__ */ n("label", { className: "flex items-start gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
669
+ /* @__PURE__ */ l("label", { className: "flex items-start gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
626
670
  /* @__PURE__ */ e(
627
671
  "input",
628
672
  {
629
673
  type: "checkbox",
630
- checked: f,
631
- onChange: (x) => N(x.target.checked),
674
+ checked: x,
675
+ onChange: (b) => N(b.target.checked),
632
676
  className: "mt-0.5 h-3.5 w-3.5 rounded border-slate-300 accent-[var(--nvr-cyan,#00ceff)]"
633
677
  }
634
678
  ),
635
- /* @__PURE__ */ n("span", { children: [
679
+ /* @__PURE__ */ l("span", { children: [
636
680
  "Remove records when they’re completed",
637
681
  /* @__PURE__ */ e("span", { className: "mt-0.5 block text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "They show “Completed”, then leave the list 24 hours later. Recently removed keeps them 7 days, with Undo." })
638
682
  ] })
639
683
  ] }),
640
- /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
684
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
641
685
  /* @__PURE__ */ e(
642
686
  "button",
643
687
  {
644
688
  type: "button",
645
- onClick: i,
689
+ onClick: n,
646
690
  className: "rounded-md px-3 py-1.5 text-[12px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
647
691
  children: "Cancel"
648
692
  }
@@ -651,9 +695,9 @@ function ve({
651
695
  "button",
652
696
  {
653
697
  type: "submit",
654
- disabled: !d.trim() || g,
655
- className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",
656
- children: g ? "Saving…" : r ? "Save" : "Make list"
698
+ disabled: !p.trim() || v,
699
+ className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:font-medium disabled:text-slate-400 disabled:hover:opacity-100 dark:disabled:bg-white/[0.06] dark:disabled:!text-slate-500",
700
+ children: v ? "Saving…" : s ? "Save" : "Make list"
657
701
  }
658
702
  )
659
703
  ] })
@@ -661,39 +705,39 @@ function ve({
661
705
  }
662
706
  );
663
707
  }
664
- function ge({
708
+ function Ne({
665
709
  actions: t,
666
- collection: r,
667
- itemId: u,
668
- size: h = "md"
710
+ collection: s,
711
+ itemId: o,
712
+ size: r = "md"
669
713
  }) {
670
- const i = t.prefs.teams.filter((a) => (a.is_member || a.can_manage) && !a.owner_gone), o = `${r}:${u}`, d = i.filter((a) => a.pins.some((l) => l.key === o)).length;
671
- if (i.length === 0) return null;
672
- const s = h === "sm" ? "h-3 w-3" : "h-3.5 w-3.5";
673
- return /* @__PURE__ */ n(S, { children: [
674
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ e(
714
+ const n = t.prefs.teams.filter((a) => (a.is_member || a.can_manage) && !a.owner_gone), c = `${s}:${o}`, p = n.filter((a) => a.pins.some((m) => m.key === c)).length;
715
+ if (n.length === 0) return null;
716
+ const h = r === "sm" ? "h-3 w-3" : "h-3.5 w-3.5";
717
+ return /* @__PURE__ */ l(_, { children: [
718
+ /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
675
719
  "button",
676
720
  {
677
721
  type: "button",
678
- "aria-label": d > 0 ? `On ${d} shared list${d === 1 ? "" : "s"}` : "Add to a shared list",
679
- "data-tip": d > 0 ? `On ${d} shared list${d === 1 ? "" : "s"}` : "Add to a shared list",
680
- "data-watch-share": d > 0 ? "on" : "off",
722
+ "aria-label": p > 0 ? `On ${p} shared list${p === 1 ? "" : "s"}` : "Add to a shared list",
723
+ "data-tip": p > 0 ? `On ${p} shared list${p === 1 ? "" : "s"}` : "Add to a shared list",
724
+ "data-watch-share": p > 0 ? "on" : "off",
681
725
  onClick: (a) => a.stopPropagation(),
682
- className: `inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${h === "sm" ? "h-6 w-6" : "h-7 w-7"} ${d > 0 ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-300"}`,
683
- children: /* @__PURE__ */ e(j, { className: s })
726
+ className: `inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${r === "sm" ? "h-6 w-6" : "h-7 w-7"} ${p > 0 ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-300"}`,
727
+ children: /* @__PURE__ */ e(D, { className: h })
684
728
  }
685
729
  ) }),
686
- /* @__PURE__ */ n(P, { align: "start", className: "w-60 p-1", onClick: (a) => a.stopPropagation(), children: [
730
+ /* @__PURE__ */ l(O, { align: "start", className: "w-60 p-1", onClick: (a) => a.stopPropagation(), children: [
687
731
  /* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[11px] font-semibold text-slate-500 dark:text-slate-400", children: "Shared lists" }),
688
- i.map((a) => {
689
- const l = a.pins.some((p) => p.key === o);
690
- return /* @__PURE__ */ n(
732
+ n.map((a) => {
733
+ const m = a.pins.some((d) => d.key === c);
734
+ return /* @__PURE__ */ l(
691
735
  "button",
692
736
  {
693
737
  type: "button",
694
738
  role: "menuitemcheckbox",
695
- "aria-checked": l,
696
- onClick: () => void (l ? t.teamUnpin(a.id, r, u) : t.teamPin(a.id, r, u)).catch(() => {
739
+ "aria-checked": m,
740
+ onClick: () => void (m ? t.teamUnpin(a.id, s, o) : t.teamPin(a.id, s, o)).catch(() => {
697
741
  }),
698
742
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
699
743
  children: [
@@ -701,8 +745,8 @@ function ge({
701
745
  "span",
702
746
  {
703
747
  "aria-hidden": !0,
704
- className: `flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border ${l ? "border-nvr-cyan bg-nvr-cyan text-white" : "border-slate-300 dark:border-white/20"}`,
705
- children: l && /* @__PURE__ */ e(q, { className: "h-2.5 w-2.5", strokeWidth: 3 })
748
+ className: `flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border ${m ? "border-nvr-cyan bg-nvr-cyan text-white" : "border-slate-300 dark:border-white/20"}`,
749
+ children: m && /* @__PURE__ */ e(j, { className: "h-2.5 w-2.5", strokeWidth: 3 })
706
750
  }
707
751
  ),
708
752
  /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a.name })
@@ -715,9 +759,11 @@ function ge({
715
759
  ] });
716
760
  }
717
761
  export {
718
- fe as AlertButton,
719
- ve as TeamEditor,
720
- be as WatchSettingsMenu,
721
- ge as WatchShareMenu,
762
+ ke as AlertButton,
763
+ ve as AlertMark,
764
+ ye as AutoPinMark,
765
+ we as TeamEditor,
766
+ ge as WatchSettingsMenu,
767
+ Ne as WatchShareMenu,
722
768
  A as alertWords
723
769
  };