@nivaro/react 0.3.15 → 0.3.16

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 (34) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +127 -6
  4. package/dist/index.js +736 -734
  5. package/dist/shared/components/CollectionBrowserView.js +2344 -2309
  6. package/dist/shared/components/ItemEditForm.js +3773 -3604
  7. package/dist/shared/components/RecordGridEditor.js +319 -282
  8. package/dist/shared/components/RecordReadView.js +202 -200
  9. package/dist/shared/components/cbv/unknown-fields.js +18 -8
  10. package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
  11. package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
  12. package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
  13. package/dist/shared/components/item-edit/FieldRow.js +198 -184
  14. package/dist/shared/components/item-edit/HeaderTools.js +107 -99
  15. package/dist/shared/components/item-edit/InlineTableField.js +138 -136
  16. package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
  17. package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
  18. package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
  19. package/dist/shared/components/item-edit/column-length.js +12 -0
  20. package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
  21. package/dist/shared/components/panels/ItemLockBanner.js +307 -285
  22. package/dist/shared/components/panels/PipelinePanel.js +486 -465
  23. package/dist/shared/components/panels/RevisionsPanel.js +210 -204
  24. package/dist/shared/components/profile/DelegationCard.js +178 -121
  25. package/dist/shared/components/profile/PersonActivity.js +152 -139
  26. package/dist/shared/components/queue/QueueWorklist.js +668 -659
  27. package/dist/shared/components/queue/transition-note.js +90 -0
  28. package/dist/shared/components/support/SupportRequestDialog.js +100 -89
  29. package/dist/shared/components/support/TicketDetailSheet.js +104 -91
  30. package/dist/shared/lib/autofill-runs.js +33 -26
  31. package/dist/shared/lib/draft-store.js +40 -24
  32. package/dist/shared/lib/live-queries.js +10 -9
  33. package/dist/shared/lib/restore-skipped.js +10 -0
  34. package/package.json +1 -1
@@ -1,71 +1,72 @@
1
1
  import { jsxs as d, Fragment as we, jsx as r } from "react/jsx-runtime";
2
- import { useSensors as Sl, useSensor as Cl, PointerSensor as $l, DndContext as ql, closestCenter as Fl } from "@dnd-kit/core";
3
- import { SortableContext as Tl, verticalListSortingStrategy as Rl, arrayMove as Al, useSortable as Ol } from "@dnd-kit/sortable";
4
- import { CSS as El } from "@dnd-kit/utilities";
5
- import { useQueryClient as Ll, useQuery as H, useMutation as ve, useQueries as Je } from "@tanstack/react-query";
6
- import { AlertTriangle as Dl, FileDiff as Pl, RefreshCw as Kl, Rows3 as ra, Flame as Ml, Sparkles as Ql, BarChart3 as jl, SlidersHorizontal as Bl, Rows4 as Ul, Rows2 as Il, Play as Vl, Plus as Gt, ChevronDown as aa, Star as Gl, Pin as Wl, Loader2 as Hl, Check as Jl, Save as Yl, Bell as zl, Inbox as Xl, GripVertical as Zl } from "lucide-react";
7
- import { useState as k, useRef as j, useEffect as B, useMemo as G } from "react";
8
- import { createPortal as la } from "react-dom";
2
+ import { useSensors as Cl, useSensor as $l, PointerSensor as ql, DndContext as Fl, closestCenter as Tl } from "@dnd-kit/core";
3
+ import { SortableContext as Rl, verticalListSortingStrategy as Al, arrayMove as Ol, useSortable as El } from "@dnd-kit/sortable";
4
+ import { CSS as Ll } from "@dnd-kit/utilities";
5
+ import { useQueryClient as Dl, useQuery as H, useMutation as ve, useQueries as Je } from "@tanstack/react-query";
6
+ import { AlertTriangle as Pl, FileDiff as Kl, RefreshCw as Ml, Rows3 as aa, Flame as Ql, Sparkles as Bl, BarChart3 as jl, SlidersHorizontal as Ul, Rows4 as Il, Rows2 as Vl, Play as Gl, Plus as Wt, ChevronDown as la, Star as Wl, Pin as Hl, Loader2 as Jl, Check as Yl, Save as zl, Bell as Xl, Inbox as Zl, GripVertical as eo } from "lucide-react";
7
+ import { useState as k, useRef as B, useEffect as j, useMemo as G } from "react";
8
+ import { createPortal as oa } from "react-dom";
9
9
  import { toast as R } from "sonner";
10
- import { useNivaroClient as ma, useItemEditAuth as oa, useItemNavigation as eo, useNavigation as to, useOverlayState as no } from "../../context.js";
11
- import { useDebounced as ro } from "../../hooks/useDebounced.js";
12
- import { useElapsedLoading as ao } from "../../hooks/useElapsedLoading.js";
13
- import { useBulkProgressFeed as lo } from "../../lib/bulk-progress.js";
14
- import { get as O, post as ne, patch as sa, del as Tn, put as oo } from "../../lib/commands.js";
15
- import { evaluateExpression as so } from "../../lib/expression.js";
16
- import { deliverLive as io, releaseLiveOwner as co } from "../../lib/focus-mode.js";
17
- import { formatMultiValue as Ye, formatValue as uo } from "../../lib/format-value.js";
18
- import { createCursorBook as mo, pageRequest as bo, noteNextCursor as po } from "../../lib/keyset-pager.js";
19
- import { expandCoalesced as ho, LIVE_ASPECTS as xt } from "../../lib/live.js";
20
- import { useRowChanges as fo, useRowLocksByCollection as go, lockLabel as xo } from "../../lib/live-list.js";
21
- import { OPEN_IN_TABS_CAP as yo, openInTabs as ko, openInTabsMessage as ia } from "../../lib/open-in-tabs.js";
22
- import { isOwnWrite as vo } from "../../lib/own-writes.js";
23
- import { useRowPresence as wo, rowPresenceKey as _o } from "../../lib/presence-hooks.js";
24
- import { buildGroups as No } from "../../lib/queue-grouping.js";
25
- import { useOptionalRealtime as So } from "../../lib/realtime.js";
26
- import { rowHighlightTextClass as Co, rowHighlightClass as $o } from "../../lib/row-highlight.js";
10
+ import { useNivaroClient as ba, useItemEditAuth as sa, useItemNavigation as to, useNavigation as no, useOverlayState as ro } from "../../context.js";
11
+ import { useDebounced as ao } from "../../hooks/useDebounced.js";
12
+ import { useElapsedLoading as lo } from "../../hooks/useElapsedLoading.js";
13
+ import { useBulkProgressFeed as oo } from "../../lib/bulk-progress.js";
14
+ import { get as E, post as ne, patch as ia, del as Rn, put as so } from "../../lib/commands.js";
15
+ import { evaluateExpression as io } from "../../lib/expression.js";
16
+ import { deliverLive as co, releaseLiveOwner as uo } from "../../lib/focus-mode.js";
17
+ import { formatMultiValue as Ye, formatValue as mo } from "../../lib/format-value.js";
18
+ import { createCursorBook as bo, pageRequest as po, noteNextCursor as ho } from "../../lib/keyset-pager.js";
19
+ import { expandCoalesced as fo, LIVE_ASPECTS as xt } from "../../lib/live.js";
20
+ import { useRowChanges as go, useRowLocksByCollection as xo, lockLabel as yo } from "../../lib/live-list.js";
21
+ import { OPEN_IN_TABS_CAP as ko, openInTabs as vo, openInTabsMessage as ca } from "../../lib/open-in-tabs.js";
22
+ import { isOwnWrite as wo } from "../../lib/own-writes.js";
23
+ import { useRowPresence as _o, rowPresenceKey as No } from "../../lib/presence-hooks.js";
24
+ import { buildGroups as So } from "../../lib/queue-grouping.js";
25
+ import { useOptionalRealtime as Co } from "../../lib/realtime.js";
26
+ import { rowHighlightTextClass as $o, rowHighlightClass as qo } from "../../lib/row-highlight.js";
27
27
  import { userErrorMessage as yt } from "../../lib/safe-error.js";
28
- import { useMyScopes as qo, matchScopeDimension as Fo, effectiveScopeSeedIds as To } from "../../lib/use-my-scopes.js";
29
- import { useNewItemLayouts as Ro } from "../../lib/use-new-item-layouts.js";
30
- import { formatNumber as re, cn as C, titleCase as Rn, humanHours as Ao, formatRelative as Oo, formatDateTime as Eo, formatDate as Lo } from "../../lib/utils.js";
31
- import { usePublishAskContext as Do, useAskRecordDrag as Po } from "../ai/ask-context.js";
32
- import { useBuiltinGate as Ko, BulkActionButtons as Mo } from "../bulk/BulkActionButtons.js";
33
- import { BulkRowMark as Qo } from "../bulk/BulkRowMark.js";
28
+ import { useMyScopes as Fo, matchScopeDimension as To, effectiveScopeSeedIds as Ro } from "../../lib/use-my-scopes.js";
29
+ import { useNewItemLayouts as Ao } from "../../lib/use-new-item-layouts.js";
30
+ import { formatNumber as re, cn as C, titleCase as An, humanHours as Oo, formatRelative as Eo, formatDateTime as Lo, formatDate as Do } from "../../lib/utils.js";
31
+ import { usePublishAskContext as Po, useAskRecordDrag as Ko } from "../ai/ask-context.js";
32
+ import { useBuiltinGate as Mo, BulkActionButtons as Qo } from "../bulk/BulkActionButtons.js";
33
+ import { BulkRowMark as Bo } from "../bulk/BulkRowMark.js";
34
34
  import { RowActionsMenu as jo } from "../CollectionBrowserView.js";
35
- import { DataTable as Bo } from "../DataTable.js";
36
- import { EmptyState as Uo } from "../EmptyState.js";
37
- import { FocusModeToggle as Io } from "../FocusModeToggle.js";
38
- import { FulfilmentPill as Vo, FULFILMENT_FILTER_OPTIONS as Go } from "../FulfilmentPill.js";
39
- import { ImportFromFileButton as Wo } from "../import/ImportFromFileButton.js";
40
- import { IntegrationDots as Ho, INTEGRATIONS_FILTER_OPTIONS as Jo } from "../integrations/IntegrationDots.js";
41
- import { IntegrationsFilterPill as Yo } from "../integrations/IntegrationsFilterPill.js";
42
- import { readQueueReturn as zo, writeQueueReturn as ca } from "../item-edit/QueueReturnChip.js";
43
- import { LiveRowMark as Xo } from "../LiveRowMark.js";
44
- import { RealtimeStaleMark as Zo } from "../RealtimeStatusBanner.js";
45
- import { RecordDrilldownSheet as es } from "../RecordDrilldownSheet.js";
46
- import { RowHighlightLegend as ts } from "../RowHighlightLegend.js";
47
- import { RowPresence as ns } from "../RowPresence.js";
48
- import { TickerNumber as An } from "../TickerNumber.js";
49
- import { UnseenDot as rs } from "../UnseenDot.js";
50
- import { Badge as as } from "../ui/badge.js";
51
- import { Checkbox as On } from "../ui/checkbox.js";
52
- import { Command as da, CommandInput as ls, CommandList as ua, CommandEmpty as os, CommandItem as kt } from "../ui/command.js";
53
- import { Label as ss } from "../ui/label.js";
35
+ import { DataTable as Uo } from "../DataTable.js";
36
+ import { EmptyState as Io } from "../EmptyState.js";
37
+ import { FocusModeToggle as Vo } from "../FocusModeToggle.js";
38
+ import { FulfilmentPill as Go, FULFILMENT_FILTER_OPTIONS as Wo } from "../FulfilmentPill.js";
39
+ import { ImportFromFileButton as Ho } from "../import/ImportFromFileButton.js";
40
+ import { IntegrationDots as Jo, INTEGRATIONS_FILTER_OPTIONS as Yo } from "../integrations/IntegrationDots.js";
41
+ import { IntegrationsFilterPill as zo } from "../integrations/IntegrationsFilterPill.js";
42
+ import { readQueueReturn as Xo, writeQueueReturn as da } from "../item-edit/QueueReturnChip.js";
43
+ import { ListLoadError as Zo } from "../ListLoadError.js";
44
+ import { LiveRowMark as es } from "../LiveRowMark.js";
45
+ import { RealtimeStaleMark as ts } from "../RealtimeStatusBanner.js";
46
+ import { RecordDrilldownSheet as ns } from "../RecordDrilldownSheet.js";
47
+ import { RowHighlightLegend as rs } from "../RowHighlightLegend.js";
48
+ import { RowPresence as as } from "../RowPresence.js";
49
+ import { TickerNumber as On } from "../TickerNumber.js";
50
+ import { UnseenDot as ls } from "../UnseenDot.js";
51
+ import { Badge as os } from "../ui/badge.js";
52
+ import { Checkbox as En } from "../ui/checkbox.js";
53
+ import { Command as ua, CommandInput as ss, CommandList as ma, CommandEmpty as is, CommandItem as kt } from "../ui/command.js";
54
+ import { Label as cs } from "../ui/label.js";
54
55
  import { Popover as ze, PopoverTrigger as Xe, PopoverContent as Ze } from "../ui/popover.js";
55
- import { Skeleton as is } from "../ui/skeleton.js";
56
- import { OwnerAvatars as cs } from "./OwnerAvatars.js";
57
- import { ListLoadError as ds } from "../ListLoadError.js";
58
- import { QueueBulkBar as us } from "./QueueBulkBar.js";
59
- import { QueueItemSheet as ms } from "./QueueItemSheet.js";
60
- import { QueueKanbanBoard as bs } from "./QueueKanbanBoard.js";
61
- import { QueueQuickFilters as ps } from "./QueueQuickFilters.js";
62
- import { QueueWorkloadView as hs } from "./QueueWorkloadView.js";
63
- function fs({ summary: l }) {
56
+ import { Skeleton as ds } from "../ui/skeleton.js";
57
+ import { OwnerAvatars as us } from "./OwnerAvatars.js";
58
+ import { QueueBulkBar as ms } from "./QueueBulkBar.js";
59
+ import { QueueItemSheet as bs } from "./QueueItemSheet.js";
60
+ import { QueueKanbanBoard as ps } from "./QueueKanbanBoard.js";
61
+ import { QueueQuickFilters as hs } from "./QueueQuickFilters.js";
62
+ import { QueueWorkloadView as fs } from "./QueueWorkloadView.js";
63
+ import { useTransitionNote as gs, needsTransitionNote as xs } from "./transition-note.js";
64
+ function ys({ summary: l }) {
64
65
  if (!l || l.count === 0)
65
66
  return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
66
67
  const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), $ = [
67
68
  f ? `Last: ${f}` : null,
68
- l.last_at ? Oo(l.last_at) : null,
69
+ l.last_at ? Eo(l.last_at) : null,
69
70
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
70
71
  ].filter(Boolean).join(" · ");
71
72
  return /* @__PURE__ */ d(
@@ -87,15 +88,15 @@ function fs({ summary: l }) {
87
88
  }
88
89
  );
89
90
  }
90
- const gs = 50, Wt = "nivaro_addendums", xs = [
91
+ const ks = 50, Ht = "nivaro_addendums", vs = [
91
92
  { value: "mine", label: "My Items" },
92
93
  { value: "unowned", label: "No Owners" },
93
94
  { value: "claimed", label: "Claimed by me" },
94
95
  { value: "all", label: "All Items" }
95
96
  ];
96
- function ys({ summary: l }) {
97
+ function ws({ summary: l }) {
97
98
  if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
98
- const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", L = l.cost_impact, U = L != null && L !== 0 ? `${L > 0 ? "+" : "−"}$${Math.abs(L).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
99
+ const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", D = l.cost_impact, U = D != null && D !== 0 ? `${D > 0 ? "+" : "−"}$${Math.abs(D).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
99
100
  return /* @__PURE__ */ d(
100
101
  "span",
101
102
  {
@@ -124,22 +125,22 @@ function ys({ summary: l }) {
124
125
  }
125
126
  );
126
127
  }
127
- function ks(l) {
128
- return Ao(l);
128
+ function _s(l) {
129
+ return Oo(l);
129
130
  }
130
- function vs({ status: l }) {
131
+ function Ns({ status: l }) {
131
132
  return l ? /* @__PURE__ */ r("span", { className: C("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
132
133
  }
133
- function ws({ points: l, inline: f = !1 }) {
134
+ function Ss({ points: l, inline: f = !1 }) {
134
135
  if (l.length < 2) return null;
135
- const $ = f ? 40 : 64, L = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
136
- (pe, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(L - 2 - (pe - h) / p * (L - 4)).toFixed(1)}`
136
+ const $ = f ? 40 : 64, D = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
137
+ (pe, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(D - 2 - (pe - h) / p * (D - 4)).toFixed(1)}`
137
138
  ).join(" ");
138
139
  return /* @__PURE__ */ r(
139
140
  "svg",
140
141
  {
141
142
  width: $,
142
- height: L,
143
+ height: D,
143
144
  className: f ? "opacity-40" : "mt-1.5 opacity-40",
144
145
  "aria-hidden": "true",
145
146
  children: /* @__PURE__ */ r("path", { d: W, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
@@ -150,7 +151,7 @@ function vt({
150
151
  label: l,
151
152
  count: f,
152
153
  filteredCount: $,
153
- active: L,
154
+ active: D,
154
155
  isLoading: U,
155
156
  tone: h,
156
157
  trend: p,
@@ -165,17 +166,17 @@ function vt({
165
166
  onClick: pe,
166
167
  className: C(
167
168
  "nvr-section-enter flex items-center gap-1.5 bg-white px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:bg-card dark:hover:bg-card/80",
168
- L && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
169
- !L && !U && f === 0 && "opacity-50"
169
+ D && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
170
+ !D && !U && f === 0 && "opacity-50"
170
171
  ),
171
- children: U ? /* @__PURE__ */ r(is, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(we, { children: [
172
+ children: U ? /* @__PURE__ */ r(ds, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(we, { children: [
172
173
  /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(we, { children: [
173
- /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(An, { value: $, format: re }) }),
174
+ /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(On, { value: $, format: re }) }),
174
175
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
175
176
  "/ ",
176
- /* @__PURE__ */ r(An, { value: f, format: re })
177
+ /* @__PURE__ */ r(On, { value: f, format: re })
177
178
  ] })
178
- ] }) : /* @__PURE__ */ r(An, { value: f, format: re }) }),
179
+ ] }) : /* @__PURE__ */ r(On, { value: f, format: re }) }),
179
180
  /* @__PURE__ */ r(
180
181
  "span",
181
182
  {
@@ -199,16 +200,16 @@ function vt({
199
200
  ]
200
201
  }
201
202
  ),
202
- p && f > 0 && /* @__PURE__ */ r(ws, { points: p, inline: !0 })
203
+ p && f > 0 && /* @__PURE__ */ r(Ss, { points: p, inline: !0 })
203
204
  ] })
204
205
  }
205
206
  );
206
207
  }
207
- function _s({
208
+ function Cs({
208
209
  label: l,
209
210
  count: f,
210
211
  filteredCount: $,
211
- color: L,
212
+ color: D,
212
213
  active: U,
213
214
  onClick: h
214
215
  }) {
@@ -226,7 +227,7 @@ function _s({
226
227
  "span",
227
228
  {
228
229
  className: "h-2 w-2 shrink-0 rounded-full",
229
- style: { backgroundColor: L ?? "#94a3b8" }
230
+ style: { backgroundColor: D ?? "#94a3b8" }
230
231
  }
231
232
  ),
232
233
  l,
@@ -244,16 +245,16 @@ function _s({
244
245
  function wt(l) {
245
246
  return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, ($) => $.toUpperCase())).join(" → ");
246
247
  }
247
- function Ns({
248
+ function $s({
248
249
  id: l,
249
250
  label: f,
250
251
  checked: $,
251
- onCheckedChange: L
252
+ onCheckedChange: D
252
253
  }) {
253
- const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: pe } = Ol({
254
+ const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: pe } = El({
254
255
  id: l
255
256
  }), g = {
256
- transform: El.Transform.toString(v),
257
+ transform: Ll.Transform.toString(v),
257
258
  transition: W,
258
259
  opacity: pe ? 0.4 : 1
259
260
  }, J = `col-toggle-${l}`;
@@ -264,48 +265,48 @@ function Ns({
264
265
  ...U,
265
266
  ...h,
266
267
  className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
267
- children: /* @__PURE__ */ r(Zl, { className: "h-3.5 w-3.5" })
268
+ children: /* @__PURE__ */ r(eo, { className: "h-3.5 w-3.5" })
268
269
  }
269
270
  ),
270
- /* @__PURE__ */ r(On, { id: J, checked: $, onCheckedChange: L }),
271
- /* @__PURE__ */ r(ss, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
271
+ /* @__PURE__ */ r(En, { id: J, checked: $, onCheckedChange: D }),
272
+ /* @__PURE__ */ r(cs, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
272
273
  ] });
273
274
  }
274
- function Pi({
275
+ function Bi({
275
276
  queueId: l,
276
277
  realtime: f,
277
278
  renderError: $,
278
- hideCreateActions: L = !1,
279
+ hideCreateActions: D = !1,
279
280
  onAsk: U
280
281
  }) {
281
- var Qr, jr, Br, Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea, ta;
282
- const h = Ll(), p = ma(), { userId: v } = oa(), W = eo(), { navigate: pe } = to(), [g, J] = k("all"), [_e, E] = k(1), En = j(mo()), [_t, ba] = k(() => {
282
+ var Br, jr, Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea, ta, na;
283
+ const h = Dl(), p = ba(), { userId: v } = sa(), W = to(), { navigate: pe } = no(), [g, J] = k("all"), [_e, L] = k(1), Ln = B(bo()), [_t, pa] = k(() => {
283
284
  try {
284
285
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
285
286
  } catch {
286
287
  return "compact";
287
288
  }
288
- }), [A, Ee] = k("table"), [I, Le] = k(""), [w, P] = k({}), [Nt, Ln] = k(() => /* @__PURE__ */ new Set()), [N, et] = k(null), [he, Ht] = k(/* @__PURE__ */ new Set()), [tt, Jt] = k(null), [St, Yt] = k(null), [zt, Ct] = k(0), Ne = fo(), Xt = So(), Zt = j({}).current, Dn = j(/* @__PURE__ */ new Set()), [pa, ha] = k(0), [Pn, fa] = k(0), De = j(!1), $t = j([]), Kn = j(null), Mn = j(!1), Qn = j(0), en = j("table");
289
- en.current = A;
290
- const tn = 25, { data: s, error: qt } = H({
289
+ }), [A, Ee] = k("table"), [I, Le] = k(""), [w, K] = k({}), [Nt, Dn] = k(() => /* @__PURE__ */ new Set()), [N, et] = k(null), [he, Jt] = k(/* @__PURE__ */ new Set()), [tt, Yt] = k(null), [St, zt] = k(null), [Xt, Ct] = k(0), Ne = go(), Zt = Co(), en = B({}).current, Pn = B(/* @__PURE__ */ new Set()), [ha, fa] = k(0), [Kn, ga] = k(0), De = B(!1), $t = B([]), Mn = B(null), Qn = B(!1), Bn = B(0), tn = B("table");
290
+ tn.current = A;
291
+ const nn = 25, { data: s, error: qt } = H({
291
292
  queryKey: ["queue-meta", l],
292
- queryFn: () => p.request(O(`/queues/${l}`)).then((e) => e.data),
293
+ queryFn: () => p.request(E(`/queues/${l}`)).then((e) => e.data),
293
294
  enabled: !!l
294
- }), { scopes: nt, ready: jn } = qo(), Bn = j(!1), [Un, In] = k(!1), [Se, ga] = k({}), oe = j({});
295
- B(() => {
296
- if (Bn.current || !jn || !s) return;
297
- Bn.current = !0;
295
+ }), { scopes: nt, ready: jn } = Fo(), Un = B(!1), [In, Vn] = k(!1), [Se, xa] = k({}), oe = B({});
296
+ j(() => {
297
+ if (Un.current || !jn || !s) return;
298
+ Un.current = !0;
298
299
  const e = (s.extra_field_meta ?? []).filter(
299
300
  (t) => t.kind === "relation" && t.target_collection && t.display_field
300
301
  );
301
302
  if (e.length === 0 || !nt) {
302
- In(!0);
303
+ Vn(!0);
303
304
  return;
304
305
  }
305
306
  (async () => {
306
307
  const t = {}, n = {}, a = async (o, c) => {
307
308
  const b = await p.request(
308
- O(`/items/${o.target_collection}`, {
309
+ E(`/items/${o.target_collection}`, {
309
310
  filter: JSON.stringify({ id: { _in: c } }),
310
311
  fields: `id,${o.display_field}`,
311
312
  limit: "200"
@@ -318,7 +319,7 @@ function Pi({
318
319
  ];
319
320
  };
320
321
  for (const o of e) {
321
- const c = Fo(nt, { collection: o.target_collection });
322
+ const c = To(nt, { collection: o.target_collection });
322
323
  if (!c) continue;
323
324
  const b = `extra.${o.path}`;
324
325
  try {
@@ -327,22 +328,22 @@ function Pi({
327
328
  const T = await a(o, m);
328
329
  T.length > 0 && (n[b.slice(6)] = T);
329
330
  }
330
- const M = To(nt, c.name);
331
- if (M.length === 0) continue;
331
+ const O = Ro(nt, c.name);
332
+ if (O.length === 0) continue;
332
333
  const F = w[b];
333
334
  if (F && (Array.isArray(F) ? F.length > 0 : F !== ""))
334
335
  continue;
335
- const y = M.length ? await a(o, M) : [];
336
+ const y = O.length ? await a(o, O) : [];
336
337
  y.length > 0 && (t[b] = y);
337
338
  } catch {
338
339
  }
339
340
  }
340
- Object.keys(n).length > 0 && ga(n), Object.keys(t).length > 0 && (oe.current = t, P((o) => ({ ...o, ...t }))), In(!0);
341
+ Object.keys(n).length > 0 && xa(n), Object.keys(t).length > 0 && (oe.current = t, K((o) => ({ ...o, ...t }))), Vn(!0);
341
342
  })();
342
343
  }, [jn, nt, s]);
343
- const Pe = ((jr = (Qr = s == null ? void 0 : s.sources) == null ? void 0 : Qr.find((e) => e.type === "collection")) == null ? void 0 : jr.collection) ?? null, { data: Vn = [] } = H({
344
+ const Pe = ((jr = (Br = s == null ? void 0 : s.sources) == null ? void 0 : Br.find((e) => e.type === "collection")) == null ? void 0 : jr.collection) ?? null, { data: Gn = [] } = H({
344
345
  queryKey: ["queue-browser-quick-filters", Pe],
345
- queryFn: () => p.request(O(`/collections/${Pe}`)).then((e) => {
346
+ queryFn: () => p.request(E(`/collections/${Pe}`)).then((e) => {
346
347
  var t, n;
347
348
  return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
348
349
  }).catch(() => []),
@@ -353,9 +354,9 @@ function Pi({
353
354
  for (const n of (s == null ? void 0 : s.sources) ?? [])
354
355
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
355
356
  return t;
356
- }, [s == null ? void 0 : s.sources]), Ft = Ro(
357
+ }, [s == null ? void 0 : s.sources]), Ft = Ao(
357
358
  z.length === 1 ? z[0] : null
358
- ), nn = L === !0 || Array.isArray(L) && z.length > 0 && z.every((e) => L.includes(e)), se = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, Ce = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], xa = (u == null ? void 0 : u.work_next) !== !1, rn = (u == null ? void 0 : u.bulk_actions) !== !1, an = Ko(
359
+ ), rn = D === !0 || Array.isArray(D) && z.length > 0 && z.every((e) => D.includes(e)), se = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, Ce = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], ya = (u == null ? void 0 : u.work_next) !== !1, an = (u == null ? void 0 : u.bulk_actions) !== !1, ln = Mo(
359
360
  [
360
361
  ...new Set(
361
362
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -365,16 +366,16 @@ function Pi({
365
366
  ), q = (e, t) => {
366
367
  var n, a;
367
368
  return ((a = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : a.trim()) || t;
368
- }, Gn = j(!1);
369
- B(() => {
370
- !s || Gn.current || (Gn.current = !0, Le("-priority"));
369
+ }, Wn = B(!1);
370
+ j(() => {
371
+ !s || Wn.current || (Wn.current = !0, Le("-priority"));
371
372
  }, [s]);
372
- const [ae, ya] = k(!1);
373
- B(() => {
373
+ const [ae, ka] = k(!1);
374
+ j(() => {
374
375
  s != null && s.display_config && !Ce.includes(A) && Ee(Ce[0]);
375
- }, [s, A, Ce]), B(() => {
376
+ }, [s, A, Ce]), j(() => {
376
377
  if (!(s != null && s.sources)) return;
377
- const e = Xt ? (y, T) => Xt.subscribeCollections(y, T) : f == null ? void 0 : f.subscribe;
378
+ const e = Zt ? (y, T) => Zt.subscribeCollections(y, T) : f == null ? void 0 : f.subscribe;
378
379
  if (!e) return;
379
380
  const t = [
380
381
  ...new Set(
@@ -386,25 +387,25 @@ function Pi({
386
387
  let a = null, o = null, c = null;
387
388
  const b = () => {
388
389
  c || (c = setTimeout(() => {
389
- c = null, fa((y) => y + 1);
390
+ c = null, ga((y) => y + 1);
390
391
  }, 1500));
391
392
  }, m = () => {
392
393
  o || (o = setTimeout(() => {
393
- if (o = null, Qn.current > 0 || Mn.current) {
394
+ if (o = null, Bn.current > 0 || Qn.current) {
394
395
  $t.current = [], Ct((y) => y + 1);
395
396
  return;
396
397
  }
397
398
  De.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
398
399
  }, 900));
399
- }, M = (y) => {
400
+ }, O = (y) => {
400
401
  let T = !1, Q = 0, ke = !1;
401
402
  const Oe = y.flatMap(
402
- (_) => _ ? ho(_) : [_]
403
+ (_) => _ ? fo(_) : [_]
403
404
  );
404
405
  for (const _ of Oe) {
405
- const be = _ == null ? void 0 : _.changed_fields, Vt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, na = Vt != null && Dn.current.has(Vt);
406
+ const be = _ == null ? void 0 : _.changed_fields, Gt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, ra = Gt != null && Pn.current.has(Gt);
406
407
  if (_ && !_.action && (be != null && be.length) && be.every((gt) => gt.startsWith("$"))) {
407
- be.includes(xt.tasks) && n.add("queue-task-counts"), be.includes(xt.integrations) && n.add("queue-integrations-summary"), be.includes(xt.addendums) && n.add("queue-collection-addendums"), be.includes(xt.lock) && ha((gt) => gt + 1), be.includes(xt.state) && (ke = !0, (na || en.current === "kanban") && (T = !0)), a || (a = setTimeout(() => {
408
+ be.includes(xt.tasks) && n.add("queue-task-counts"), be.includes(xt.integrations) && n.add("queue-integrations-summary"), be.includes(xt.addendums) && n.add("queue-collection-addendums"), be.includes(xt.lock) && fa((gt) => gt + 1), be.includes(xt.state) && (ke = !0, (ra || tn.current === "kanban") && (T = !0)), a || (a = setTimeout(() => {
408
409
  a = null;
409
410
  for (const gt of n) h.invalidateQueries({ queryKey: [gt] });
410
411
  n.clear();
@@ -412,16 +413,16 @@ function Pi({
412
413
  continue;
413
414
  }
414
415
  ke = !0;
415
- const Nl = (_ == null ? void 0 : _.collection) != null && vo(_.collection, _.item);
416
- Vt && (na || (_ == null ? void 0 : _.action) === "create" || en.current === "kanban") ? (T = !0, Nl || $t.current.push({ key: Vt, by: null })) : Q += 1;
416
+ const Sl = (_ == null ? void 0 : _.collection) != null && wo(_.collection, _.item);
417
+ Gt && (ra || (_ == null ? void 0 : _.action) === "create" || tn.current === "kanban") ? (T = !0, Sl || $t.current.push({ key: Gt, by: null })) : Q += 1;
417
418
  }
418
419
  Q > 0 && Ct((_) => _ + Q), T && m(), ke && b();
419
- }, F = e(t, (y) => io(Zt, [y ?? {}], M));
420
+ }, F = e(t, (y) => co(en, [y ?? {}], O));
420
421
  return () => {
421
- F(), co(Zt), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
422
+ F(), uo(en), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
422
423
  };
423
- }, [Xt, f, s == null ? void 0 : s.sources, h, l, v, Zt]);
424
- const Ke = ro(w, 350), ka = JSON.stringify(Ke) === JSON.stringify(w), ln = j(!1), $e = A === "table" && !!N, Wn = (() => {
424
+ }, [Zt, f, s == null ? void 0 : s.sources, h, l, v, en]);
425
+ const Ke = ao(w, 350), va = JSON.stringify(Ke) === JSON.stringify(w), on = B(!1), $e = A === "table" && !!N, Hn = (() => {
425
426
  const e = /* @__PURE__ */ new Set();
426
427
  for (const t of (s == null ? void 0 : s.extra_field_meta) ?? [])
427
428
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
@@ -449,38 +450,38 @@ function Pi({
449
450
  return e;
450
451
  })();
451
452
  function Me(e, t) {
452
- P((n) => ({ ...n, [e]: n[e] === t ? "" : t })), E(1);
453
+ K((n) => ({ ...n, [e]: n[e] === t ? "" : t })), L(1);
453
454
  }
454
- function va(e) {
455
- P((t) => {
455
+ function wa(e) {
456
+ K((t) => {
456
457
  const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((c) => c !== e) : [...a, e];
457
458
  return { ...t, state: o };
458
- }), E(1);
459
+ }), L(1);
459
460
  }
460
- const wa = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], _a = (e) => !e || Array.isArray(e) && e.length === 0;
461
- function Na() {
462
- P({ ...oe.current }), J("all"), E(1);
461
+ const _a = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], Na = (e) => !e || Array.isArray(e) && e.length === 0;
462
+ function Sa() {
463
+ K({ ...oe.current }), J("all"), L(1);
463
464
  }
464
- const [rt, Sa] = k(() => {
465
+ const [rt, Ca] = k(() => {
465
466
  try {
466
467
  return localStorage.getItem("nvr_queue_insights_open") === "1";
467
468
  } catch {
468
469
  return !1;
469
470
  }
470
471
  });
471
- B(() => {
472
+ j(() => {
472
473
  try {
473
474
  localStorage.setItem("nvr_queue_insights_open", rt ? "1" : "0");
474
475
  } catch {
475
476
  }
476
477
  }, [rt]);
477
- const { data: Ca = [] } = H({
478
+ const { data: $a = [] } = H({
478
479
  queryKey: ["queue-view-subs", l],
479
- queryFn: () => p.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
480
+ queryFn: () => p.request(E("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
480
481
  staleTime: 3e4
481
- }), Tt = (e) => Ca.find((t) => t.queue_view_id === e), $a = (e) => {
482
+ }), Tt = (e) => $a.find((t) => t.queue_view_id === e), qa = (e) => {
482
483
  const t = Tt(e);
483
- (t ? p.request(Tn(`/notification-subscriptions/${t.id}`)) : p.request(
484
+ (t ? p.request(Rn(`/notification-subscriptions/${t.id}`)) : p.request(
484
485
  ne("/notification-subscriptions", {
485
486
  queue_id: l,
486
487
  queue_view_id: e,
@@ -491,18 +492,18 @@ function Pi({
491
492
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
492
493
  ), h.invalidateQueries({ queryKey: ["queue-view-subs", l] });
493
494
  }).catch((a) => R.error(yt(a, "Failed")));
494
- }, [Hn, on] = k(null), sn = [
495
+ }, [Jn, sn] = k(null), cn = [
495
496
  ...new Set(
496
497
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
497
498
  )
498
- ], { data: qa = {} } = H({
499
- queryKey: ["queue-custom-actions", l, sn.join(",")],
499
+ ], { data: Fa = {} } = H({
500
+ queryKey: ["queue-custom-actions", l, cn.join(",")],
500
501
  queryFn: async () => {
501
502
  const e = {};
502
- for (const t of sn.slice(0, 6))
503
+ for (const t of cn.slice(0, 6))
503
504
  try {
504
505
  const n = await p.request(
505
- O("/custom-actions", { collection: t })
506
+ E("/custom-actions", { collection: t })
506
507
  );
507
508
  e[t] = n.data ?? [];
508
509
  } catch {
@@ -510,20 +511,20 @@ function Pi({
510
511
  }
511
512
  return e;
512
513
  },
513
- enabled: sn.length > 0,
514
+ enabled: cn.length > 0,
514
515
  staleTime: 6e4
515
- }), Fa = (e) => qa[e] ?? [], Ta = (e, t) => {
516
+ }), Ta = (e) => Fa[e] ?? [], Ra = (e, t) => {
516
517
  p.request(ne(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
517
518
  R.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
518
519
  }).catch((n) => {
519
520
  const a = n.response;
520
521
  R.error((a == null ? void 0 : a.error) ?? yt(n, `${e.label} failed`));
521
522
  });
522
- }, { data: cn = [] } = H({
523
+ }, { data: dn = [] } = H({
523
524
  queryKey: ["queue-triage-labels", l],
524
- queryFn: () => p.request(O(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
525
+ queryFn: () => p.request(E(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
525
526
  staleTime: 3e4
526
- }), Jn = (e, t) => {
527
+ }), Yn = (e, t) => {
527
528
  p.request(
528
529
  ne(`/queues/${l}/triage-labels/toggle`, {
529
530
  collection: e.collection,
@@ -535,13 +536,13 @@ function Pi({
535
536
  }).catch((n) => R.error(yt(n, "Label failed")));
536
537
  }, {
537
538
  data: i,
538
- isLoading: Yn,
539
+ isLoading: zn,
539
540
  isFetching: Rt,
540
- isPlaceholderData: Ra,
541
+ isPlaceholderData: Aa,
541
542
  dataUpdatedAt: le,
542
- isError: zn,
543
- error: Aa,
544
- refetch: Oa
543
+ isError: Xn,
544
+ error: Oa,
545
+ refetch: Ea
545
546
  } = H({
546
547
  queryKey: [
547
548
  "queue-items",
@@ -553,8 +554,8 @@ function Pi({
553
554
  N
554
555
  ],
555
556
  queryFn: async () => {
556
- const e = !$e && A === "table", t = JSON.stringify([l, g, I, fe, tn]), n = e ? bo(En.current, t, _e, "").after : void 0, a = await p.request(
557
- O(`/queues/${l}/items`, {
557
+ const e = !$e && A === "table", t = JSON.stringify([l, g, I, fe, nn]), n = e ? po(Ln.current, t, _e, "").after : void 0, a = await p.request(
558
+ E(`/queues/${l}/items`, {
558
559
  scope: g,
559
560
  // Last State Change is Aging read the other way round: the newest
560
561
  // move is the least aged.
@@ -564,11 +565,11 @@ function Pi({
564
565
  // Kanban renders the full matching set, grouped client-side.
565
566
  ...$e ? {
566
567
  group_by: N,
567
- ...Wn.length ? { group_sums: Wn.join(",") } : {}
568
- } : A === "table" ? { page: _e, limit: tn, ...n ? { after: n } : {} } : {}
568
+ ...Hn.length ? { group_sums: Hn.join(",") } : {}
569
+ } : A === "table" ? { page: _e, limit: nn, ...n ? { after: n } : {} } : {}
569
570
  })
570
571
  );
571
- return n && po(En.current, t, _e, a.next_cursor), a;
572
+ return n && ho(Ln.current, t, _e, a.next_cursor), a;
572
573
  },
573
574
  // Wait for display_config AND scope seeding so the first fetch uses the
574
575
  // configured defaults and already carries the viewer's restricted filters.
@@ -577,40 +578,40 @@ function Pi({
577
578
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
578
579
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
579
580
  // waits for the debounced copy to settle; later typing still debounces.
580
- enabled: !!l && ae && Un && (ln.current || ka),
581
+ enabled: !!l && ae && In && (on.current || va),
581
582
  // Keep the previous page rendered while a sort/filter/page change refetches —
582
583
  // swapping to skeletons collapsed the table height and jittered the page.
583
584
  placeholderData: (e) => e
584
585
  });
585
- i && !ln.current && (ln.current = !0);
586
+ i && !on.current && (on.current = !0);
586
587
  const Qe = Object.entries(oe.current).filter(
587
588
  ([e, t]) => {
588
589
  var n;
589
590
  return !((n = Se[e.slice(6)]) != null && n.length) && JSON.stringify(fe[e] ?? null) === JSON.stringify(t);
590
591
  }
591
- ).map(([e]) => e), Xn = Qe.length > 0 && Object.keys(fe).every((e) => Qe.includes(e)), Zn = Object.fromEntries(
592
+ ).map(([e]) => e), Zn = Qe.length > 0 && Object.keys(fe).every((e) => Qe.includes(e)), er = Object.fromEntries(
592
593
  Object.entries(fe).filter(([e]) => !Qe.includes(e))
593
- ), { data: Ea } = H({
594
- queryKey: ["queue-default-hidden", l, g, Zn],
595
- enabled: !!l && !!i && !Rt && i.total === 0 && ((Br = i.empty) == null ? void 0 : Br.reason) === "filters" && Qe.length > 0 && !Xn,
594
+ ), { data: La } = H({
595
+ queryKey: ["queue-default-hidden", l, g, er],
596
+ enabled: !!l && !!i && !Rt && i.total === 0 && ((Ur = i.empty) == null ? void 0 : Ur.reason) === "filters" && Qe.length > 0 && !Zn,
596
597
  staleTime: 3e4,
597
598
  retry: !1,
598
599
  queryFn: () => p.request(
599
- O(`/queues/${l}/items`, {
600
+ E(`/queues/${l}/items`, {
600
601
  scope: g,
601
- filters: JSON.stringify(Zn),
602
+ filters: JSON.stringify(er),
602
603
  page: 1,
603
604
  limit: 1
604
605
  })
605
606
  ).then((e) => Number(e.total ?? 0))
606
- }), ie = Xn ? Math.max(0, (((Ur = i == null ? void 0 : i.stats) == null ? void 0 : Ur.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : Ea ?? 0, er = (e) => Qe.map(e).join(" and "), tr = () => {
607
- P((e) => {
607
+ }), ie = Zn ? Math.max(0, (((Ir = i == null ? void 0 : i.stats) == null ? void 0 : Ir.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : La ?? 0, tr = (e) => Qe.map(e).join(" and "), nr = () => {
608
+ K((e) => {
608
609
  const t = { ...e };
609
610
  for (const n of Qe) delete t[n];
610
611
  return t;
611
- }), E(1);
612
+ }), L(1);
612
613
  };
613
- B(() => {
614
+ j(() => {
614
615
  if (typeof window > "u" || !le) return;
615
616
  const e = window;
616
617
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
@@ -624,29 +625,34 @@ function Pi({
624
625
  }, a = t.find((o) => o.queue === l);
625
626
  t.push(n), t.length > 50 && t.shift(), a && a !== n && le - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
626
627
  }, [le]);
627
- const je = Yn && !i || !ae || !Un && !i, nr = (Rt && !Yn || Ra && Rt) && !De.current, La = G(
628
+ const Be = zn && !i || !ae || !In && !i, rr = (Rt && !zn || Aa && Rt) && !De.current, Da = G(
628
629
  () => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
629
630
  [$e, i == null ? void 0 : i.data]
630
- ), Da = wo(La), rr = ao(Rt && !De.current);
631
- async function ar(e, t) {
632
- const a = (await p.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
631
+ ), Pa = _o(Da), At = gs(), ar = lo(Rt && !De.current);
632
+ async function lr(e, t) {
633
+ var m;
634
+ const a = (await p.request(E(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
633
635
  if (!a || a.states.length === 0)
634
636
  throw new Error("This item has no workflow instance");
635
- const o = a.states.find((b) => b.key === t);
637
+ const o = a.states.find((O) => O.key === t);
636
638
  if (!o) throw new Error("Target state not found");
637
639
  const c = a.available_transitions.find(
638
- (b) => b.to_state === o.id
640
+ (O) => O.to_state === o.id
639
641
  );
640
642
  if (!c) throw new Error("No transition available to move this item here");
643
+ let b = null;
644
+ if (xs(c) && (b = await At.ask(((m = c.label) == null ? void 0 : m.trim()) || "Move"), !b))
645
+ throw new Error("Not moved — this move needs a note");
641
646
  await p.request(
642
647
  ne(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
643
- transition_id: c.id
648
+ transition_id: c.id,
649
+ ...b ? { comment: b } : {}
644
650
  })
645
651
  );
646
652
  }
647
- const Pa = ve({
653
+ const Ka = ve({
648
654
  mutationFn: async ({ item: e, targetState: t }) => {
649
- await ar(e, t);
655
+ await lr(e, t);
650
656
  },
651
657
  onSuccess: () => {
652
658
  h.invalidateQueries({ queryKey: ["queue-items", l, g] });
@@ -663,7 +669,7 @@ function Pi({
663
669
  ),
664
670
  onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
665
671
  onError: () => R.error("Failed to claim item")
666
- }), Be = ve({
672
+ }), je = ve({
667
673
  mutationFn: (e) => p.request(
668
674
  ne(`/queues/${l}/release`, {
669
675
  source_collection: e.collection,
@@ -674,16 +680,16 @@ function Pi({
674
680
  onError: () => R.error("Failed to release item")
675
681
  }), { data: Ue } = H({
676
682
  queryKey: ["queue-column-prefs", l],
677
- queryFn: () => p.request(O(`/queues/${l}/column-prefs`)),
683
+ queryFn: () => p.request(E(`/queues/${l}/column-prefs`)),
678
684
  enabled: !!l
679
- }), [dn, At] = k(null), [Ie, un] = k(null);
680
- B(() => {
681
- Ue && un(Ue.data.default_view_id);
685
+ }), [un, Ot] = k(null), [Ie, mn] = k(null);
686
+ j(() => {
687
+ Ue && mn(Ue.data.default_view_id);
682
688
  }, [Ue]);
683
- const [Ka, lr] = k({}), ce = $e ? (i == null ? void 0 : i.groups) ?? null : null, Ot = (ce ?? []).filter((e) => !he.has(e.key)).map((e) => e.key).flatMap(
684
- (e) => Array.from({ length: Ka[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
685
- ), mn = Je({
686
- queries: Ot.map(({ key: e, page: t }) => ({
689
+ const [Ma, or] = k({}), ce = $e ? (i == null ? void 0 : i.groups) ?? null : null, Et = (ce ?? []).filter((e) => !he.has(e.key)).map((e) => e.key).flatMap(
690
+ (e) => Array.from({ length: Ma[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
691
+ ), bn = Je({
692
+ queries: Et.map(({ key: e, page: t }) => ({
687
693
  queryKey: [
688
694
  "queue-items",
689
695
  l,
@@ -696,30 +702,30 @@ function Pi({
696
702
  t
697
703
  ],
698
704
  queryFn: () => p.request(
699
- O(`/queues/${l}/items`, {
705
+ E(`/queues/${l}/items`, {
700
706
  scope: g,
701
707
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
702
708
  filters: JSON.stringify(fe),
703
709
  group_by: N,
704
710
  group_key: e,
705
711
  page: t,
706
- limit: gs
712
+ limit: ks
707
713
  })
708
714
  ).then((n) => ({ key: e, rows: n.data })),
709
715
  enabled: !!i && $e,
710
716
  placeholderData: (n) => n
711
717
  }))
712
- }), Ma = mn.map((e) => e.dataUpdatedAt).join(","), bn = G(() => {
718
+ }), Qa = bn.map((e) => e.dataUpdatedAt).join(","), pn = G(() => {
713
719
  const e = /* @__PURE__ */ new Map();
714
- return mn.forEach((t, n) => {
720
+ return bn.forEach((t, n) => {
715
721
  if (!t.data) return;
716
- const a = Ot[n].key;
722
+ const a = Et[n].key;
717
723
  e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
718
724
  }), e;
719
- }, [Ma, Ot.map((e) => `${e.key}\0${e.page}`).join("")]), Qa = new Set(
720
- mn.flatMap((e, t) => e.isFetching ? [Ot[t].key] : [])
721
- ), S = ce ? [...bn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
722
- Do(
725
+ }, [Qa, Et.map((e) => `${e.key}\0${e.page}`).join("")]), Ba = new Set(
726
+ bn.flatMap((e, t) => e.isFetching ? [Et[t].key] : [])
727
+ ), S = ce ? [...pn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
728
+ Po(
723
729
  l ? {
724
730
  queue: {
725
731
  id: l,
@@ -730,33 +736,33 @@ function Pi({
730
736
  }
731
737
  } : null
732
738
  );
733
- const ja = Po(), at = S.some((e) => e.fulfilment !== void 0), lt = S.some((e) => e.send_backs !== void 0), { data: Et, dataUpdatedAt: Ba } = H({
734
- queryKey: ["queue-live-stats", l, g, Ke, Pn],
739
+ const ja = Ko(), at = S.some((e) => e.fulfilment !== void 0), lt = S.some((e) => e.send_backs !== void 0), { data: Lt, dataUpdatedAt: Ua } = H({
740
+ queryKey: ["queue-live-stats", l, g, Ke, Kn],
735
741
  queryFn: () => p.request(
736
- O(`/queues/${l}/items`, {
742
+ E(`/queues/${l}/items`, {
737
743
  scope: g,
738
744
  filters: JSON.stringify(fe),
739
745
  page: 1,
740
746
  limit: 1
741
747
  })
742
748
  ),
743
- enabled: Pn > 0 && !!i,
749
+ enabled: Kn > 0 && !!i,
744
750
  staleTime: Number.POSITIVE_INFINITY,
745
751
  placeholderData: (e) => e,
746
752
  retry: !1
747
- }), pn = !!Et && Ba > le, x = pn ? Et.stats : i == null ? void 0 : i.stats, Y = pn ? Et.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, or = pn ? Et.state_counts : i == null ? void 0 : i.state_counts;
748
- Dn.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
749
- const Lt = go(
753
+ }), hn = !!Lt && Ua > le, x = hn ? Lt.stats : i == null ? void 0 : i.stats, Y = hn ? Lt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, sr = hn ? Lt.state_counts : i == null ? void 0 : i.state_counts;
754
+ Pn.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
755
+ const Dt = xo(
750
756
  S.map((e) => ({ collection: e.collection, id: e.item_id })),
751
- pa
752
- ), sr = j(le), ir = j(0);
753
- !De.current && le !== ir.current && (sr.current = le), B(() => {
757
+ ha
758
+ ), ir = B(le), cr = B(0);
759
+ !De.current && le !== cr.current && (ir.current = le), j(() => {
754
760
  const e = new Set(S.map((t) => `${t.collection}:${t.item_id}`));
755
761
  if (De.current) {
756
- De.current = !1, ir.current = le;
762
+ De.current = !1, cr.current = le;
757
763
  const t = $t.current;
758
764
  $t.current = [];
759
- const n = Kn.current, a = /* @__PURE__ */ new Set();
765
+ const n = Mn.current, a = /* @__PURE__ */ new Set();
760
766
  for (const o of t)
761
767
  !e.has(o.key) || a.has(o.key) || (a.add(o.key), Ne.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
762
768
  if (n) {
@@ -764,21 +770,21 @@ function Pi({
764
770
  o.length > 0 && o.length <= 20 && Ne.note(o, null, "create");
765
771
  }
766
772
  }
767
- Kn.current = e;
768
- }, [le]), B(() => {
773
+ Mn.current = e;
774
+ }, [le]), j(() => {
769
775
  Ct(0);
770
776
  }, [i]);
771
- function Ua() {
777
+ function Ia() {
772
778
  h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), Ct(0);
773
779
  }
774
780
  const { data: de } = H({
775
781
  queryKey: ["queue-trends", l],
776
- queryFn: () => p.request(O(`/queues/${l}/trends`, { days: 14 })),
782
+ queryFn: () => p.request(E(`/queues/${l}/trends`, { days: 14 })),
777
783
  enabled: !!l,
778
784
  staleTime: 300 * 1e3
779
785
  }), { data: ue } = H({
780
786
  queryKey: ["queue-trends", l, "mine"],
781
- queryFn: () => p.request(O(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
787
+ queryFn: () => p.request(E(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
782
788
  enabled: !!l && g === "mine",
783
789
  staleTime: 300 * 1e3
784
790
  });
@@ -802,54 +808,54 @@ function Pi({
802
808
  )
803
809
  ],
804
810
  [s == null ? void 0 : s.sources]
805
- ), { data: Ia } = H({
811
+ ), { data: Va } = H({
806
812
  queryKey: ["collections"],
807
- queryFn: () => p.request(O("/collections")).then((e) => e.data),
813
+ queryFn: () => p.request(E("/collections")).then((e) => e.data),
808
814
  staleTime: 300 * 1e3
809
815
  }), Ve = Je({
810
816
  queries: st.map((e) => ({
811
817
  queryKey: ["queue-collection-addendums", e],
812
818
  queryFn: () => p.request(
813
- O(`/collections/${e}`)
819
+ E(`/collections/${e}`)
814
820
  ).then((t) => {
815
821
  var n;
816
822
  return !!((n = t.data) != null && n.addendums_enabled);
817
823
  }).catch(() => !1),
818
824
  staleTime: 300 * 1e3
819
825
  }))
820
- }).some((e) => e.data === !0), { data: hn = [] } = H({
826
+ }).some((e) => e.data === !0), { data: fn = [] } = H({
821
827
  queryKey: ["queue-integrations-collections"],
822
- queryFn: () => p.request(O("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
828
+ queryFn: () => p.request(E("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
823
829
  staleTime: 300 * 1e3
824
- }), ge = st.some((e) => hn.includes(e)), fn = G(() => {
830
+ }), ge = st.some((e) => fn.includes(e)), gn = G(() => {
825
831
  var t;
826
832
  const e = {};
827
833
  if (!ge) return e;
828
834
  for (const n of S) {
829
- if (!hn.includes(n.collection)) continue;
835
+ if (!fn.includes(n.collection)) continue;
830
836
  const a = e[t = n.collection] ?? (e[t] = []);
831
837
  a.length < 500 && a.push(n.item_id);
832
838
  }
833
839
  return e;
834
- }, [S, hn, ge]), cr = Object.keys(fn), dr = Je({
835
- queries: cr.map((e) => ({
836
- queryKey: ["queue-integrations-summary", e, fn[e].join(",")],
840
+ }, [S, fn, ge]), dr = Object.keys(gn), ur = Je({
841
+ queries: dr.map((e) => ({
842
+ queryKey: ["queue-integrations-summary", e, gn[e].join(",")],
837
843
  queryFn: () => p.request(
838
844
  ne("/integration-obligations/summary", {
839
845
  collection: e,
840
- ids: fn[e]
846
+ ids: gn[e]
841
847
  })
842
848
  ).then((t) => t.data ?? {}).catch(() => ({})),
843
849
  staleTime: 3e4
844
850
  }))
845
- }), Va = dr.map((e) => e.dataUpdatedAt).join(","), Ga = G(() => {
851
+ }), Ga = ur.map((e) => e.dataUpdatedAt).join(","), Wa = G(() => {
846
852
  const e = {};
847
- return cr.forEach((t, n) => {
853
+ return dr.forEach((t, n) => {
848
854
  var o;
849
- const a = ((o = dr[n]) == null ? void 0 : o.data) ?? {};
855
+ const a = ((o = ur[n]) == null ? void 0 : o.data) ?? {};
850
856
  for (const [c, b] of Object.entries(a)) e[`${t}:${c}`] = b;
851
857
  }), e;
852
- }, [Va]), gn = G(() => {
858
+ }, [Ga]), xn = G(() => {
853
859
  var t;
854
860
  const e = {};
855
861
  for (const n of S) {
@@ -859,31 +865,31 @@ function Pi({
859
865
  a.length < 500 && a.push(n.item_id);
860
866
  }
861
867
  return e;
862
- }, [S]), xn = Object.keys(gn), ur = Je({
863
- queries: xn.map((e) => ({
864
- queryKey: ["queue-task-counts", e, gn[e].join(",")],
868
+ }, [S]), yn = Object.keys(xn), mr = Je({
869
+ queries: yn.map((e) => ({
870
+ queryKey: ["queue-task-counts", e, xn[e].join(",")],
865
871
  queryFn: () => p.request(
866
- ne("/tasks/counts", { collection: e, ids: gn[e] })
872
+ ne("/tasks/counts", { collection: e, ids: xn[e] })
867
873
  ).then((t) => t.data ?? {}).catch(() => ({})),
868
874
  staleTime: 3e4
869
875
  }))
870
- }), Wa = ur.map((e) => e.dataUpdatedAt).join(","), Ha = G(() => {
876
+ }), Ha = mr.map((e) => e.dataUpdatedAt).join(","), Ja = G(() => {
871
877
  const e = {};
872
- return xn.forEach((t, n) => {
878
+ return yn.forEach((t, n) => {
873
879
  var a;
874
- for (const [o, c] of Object.entries(((a = ur[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
880
+ for (const [o, c] of Object.entries(((a = mr[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
875
881
  }), e;
876
- }, [Wa]), mr = xn.length > 0, br = Je({
882
+ }, [Ha]), br = yn.length > 0, pr = Je({
877
883
  queries: st.map((e) => ({
878
884
  queryKey: ["queue-collection-risk-rules", e],
879
885
  queryFn: () => p.request(
880
- O("/at-risk/rules/active", { collection: e })
886
+ E("/at-risk/rules/active", { collection: e })
881
887
  ).then((t) => t.data ?? []).catch(() => []),
882
888
  staleTime: 300 * 1e3
883
889
  }))
884
- }), Ja = br.map((e) => e.dataUpdatedAt).join(","), pr = G(() => {
890
+ }), Ya = pr.map((e) => e.dataUpdatedAt).join(","), hr = G(() => {
885
891
  const e = /* @__PURE__ */ new Map();
886
- for (const t of br)
892
+ for (const t of pr)
887
893
  for (const n of t.data ?? []) {
888
894
  const a = e.get(n.name);
889
895
  e.set(n.name, {
@@ -892,65 +898,65 @@ function Pi({
892
898
  });
893
899
  }
894
900
  return [...e.values()];
895
- }, [Ja]), hr = Je({
901
+ }, [Ya]), fr = Je({
896
902
  queries: st.map((e) => ({
897
903
  queryKey: ["queue-collection-states", e],
898
904
  queryFn: () => p.request(
899
- O(`/queues/collection-states/${e}`)
905
+ E(`/queues/collection-states/${e}`)
900
906
  ).then((t) => t.data),
901
907
  staleTime: 300 * 1e3
902
908
  }))
903
- }), fr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), xe = G(() => {
909
+ }), gr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), xe = G(() => {
904
910
  const e = {};
905
- for (const t of hr)
911
+ for (const t of fr)
906
912
  (t.data ?? []).forEach((n, a) => {
907
913
  e[n.key] = { label: n.label, color: n.color, sort: a };
908
914
  });
909
915
  return e;
910
- }, [hr.map((e) => e.data)]), gr = x ? Object.entries(x.by_state).sort(
916
+ }, [fr.map((e) => e.data)]), xr = x ? Object.entries(x.by_state).sort(
911
917
  (e, t) => {
912
918
  var n, a;
913
919
  return (((n = xe[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = xe[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
914
920
  }
915
- ) : [], xr = (e) => [...e].sort(
921
+ ) : [], yr = (e) => [...e].sort(
916
922
  (t, n) => {
917
923
  var a, o;
918
924
  return (((a = xe[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = xe[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
919
925
  }
920
- ), yn = G(() => {
926
+ ), kn = G(() => {
921
927
  const e = {};
922
928
  for (const [t, n] of Object.entries(xe)) e[t] = n.label;
923
929
  return e;
924
- }, [xe]), Fe = (e) => e ? e === "none" ? "No State" : yn[e] ?? fr(e) : "—", it = (e) => {
925
- if (e === Wt) return "Addendums";
926
- const t = (Ia ?? []).find((n) => n.collection === e);
927
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || fr(e);
930
+ }, [xe]), Fe = (e) => e ? e === "none" ? "No State" : kn[e] ?? gr(e) : "—", it = (e) => {
931
+ if (e === Ht) return "Addendums";
932
+ const t = (Va ?? []).find((n) => n.collection === e);
933
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || gr(e);
928
934
  }, Z = G(() => N ? ce ? ce.map((e) => ({
929
935
  key: e.key,
930
- rows: bn.get(e.key) ?? [],
936
+ rows: pn.get(e.key) ?? [],
931
937
  breached: e.breached,
932
938
  atRisk: e.at_risk,
933
939
  count: e.count,
934
940
  sums: e.sums ?? {}
935
- })) : No(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, ce, bn]), kn = j(null);
936
- B(() => {
941
+ })) : So(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, ce, pn]), vn = B(null);
942
+ j(() => {
937
943
  if (!N || !Z) {
938
- kn.current = null;
944
+ vn.current = null;
939
945
  return;
940
946
  }
941
- if ($e && !ce || kn.current === N) return;
942
- kn.current = N;
947
+ if ($e && !ce || vn.current === N) return;
948
+ vn.current = N;
943
949
  const e = Z.reduce((t, n) => t + n.count, 0);
944
- Ht(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), lr({});
950
+ Jt(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), or({});
945
951
  }, [N, ce]);
946
- function Ya(e) {
947
- Ht((t) => {
952
+ function za(e) {
953
+ Jt((t) => {
948
954
  const n = new Set(t);
949
955
  return n.has(e) ? n.delete(e) : n.add(e), n;
950
956
  });
951
957
  }
952
- const ee = G(() => Z ? Z.filter((e) => !he.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, he]), D = (e) => `${e.collection}:${e.item_id}`, [ye, Te] = k(null), [za, vn] = k(!1), [Dt, Pt] = k(null), wn = (e) => {
953
- if (e.collection === Wt && e.url) {
958
+ const ee = G(() => Z ? Z.filter((e) => !he.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, he]), P = (e) => `${e.collection}:${e.item_id}`, [ye, Te] = k(null), [Xa, wn] = k(!1), [Pt, Kt] = k(null), _n = (e) => {
959
+ if (e.collection === Ht && e.url) {
954
960
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
955
961
  if (t) {
956
962
  const n = {};
@@ -970,33 +976,33 @@ function Pi({
970
976
  };
971
977
  }, ct = (e) => {
972
978
  var t;
973
- s && ca({
979
+ s && da({
974
980
  queue_id: l,
975
981
  name: s.name,
976
982
  path: `${window.location.pathname}${window.location.search}`,
977
983
  at: Date.now(),
978
- scroll: ((t = Qt.current) == null ? void 0 : t.scrollTop) ?? 0,
984
+ scroll: ((t = Bt.current) == null ? void 0 : t.scrollTop) ?? 0,
979
985
  state: { scope: g, page: _e, sort: I, filters: w, group_by: N, view: A }
980
- }), W.open(wn(e));
981
- }, [K, dt] = k(
986
+ }), W.open(_n(e));
987
+ }, [M, dt] = k(
982
988
  null
983
989
  );
984
- B(() => {
985
- if (!K) return;
990
+ j(() => {
991
+ if (!M) return;
986
992
  const e = () => dt(null);
987
993
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
988
994
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
989
995
  };
990
- }, [K]);
991
- const Kt = (e) => {
992
- Pt(D(e));
996
+ }, [M]);
997
+ const Mt = (e) => {
998
+ Kt(P(e));
993
999
  const t = (u == null ? void 0 : u.row_click) ?? "preview";
994
- if (t === "full" || e.collection === Wt) {
1000
+ if (t === "full" || e.collection === Ht) {
995
1001
  ct(e);
996
1002
  return;
997
1003
  }
998
1004
  if (t === "layout") {
999
- Ar({
1005
+ Or({
1000
1006
  collection: e.collection,
1001
1007
  itemId: e.item_id,
1002
1008
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -1007,82 +1013,82 @@ function Pi({
1007
1013
  }
1008
1014
  Te(e);
1009
1015
  };
1010
- B(() => {
1016
+ j(() => {
1011
1017
  if (!ye) return;
1012
- const e = S.find((t) => D(t) === D(ye));
1018
+ const e = S.find((t) => P(t) === P(ye));
1013
1019
  e && e !== ye && Te(e);
1014
1020
  }, [S]);
1015
- const Xa = (e) => !e.claimed_by || e.claimed_by.id === v;
1016
- function yr(e) {
1017
- const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(Xa);
1021
+ const Za = (e) => !e.claimed_by || e.claimed_by.id === v;
1022
+ function kr(e) {
1023
+ const t = e ? ee.findIndex((a) => P(a) === P(e)) + 1 : 0, n = ee.slice(t).find(Za);
1018
1024
  if (!n) {
1019
- vn(!1), Te(null), R.info("Nothing left to work on — queue clear!");
1025
+ wn(!1), Te(null), R.info("Nothing left to work on — queue clear!");
1020
1026
  return;
1021
1027
  }
1022
- if (Pt(D(n)), se && !n.claimed_by && qe.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1028
+ if (Kt(P(n)), se && !n.claimed_by && qe.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1023
1029
  ct(n);
1024
1030
  return;
1025
1031
  }
1026
- vn(!0), Te(n);
1032
+ wn(!0), Te(n);
1027
1033
  }
1028
- B(() => {
1034
+ j(() => {
1029
1035
  if (A !== "table") return;
1030
1036
  function e(t) {
1031
1037
  var o;
1032
1038
  const n = t.target;
1033
1039
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1034
1040
  return;
1035
- const a = Dt ? ee.findIndex((c) => D(c) === Dt) : -1;
1041
+ const a = Pt ? ee.findIndex((c) => P(c) === Pt) : -1;
1036
1042
  if (t.key === "j" || t.key === "ArrowDown") {
1037
1043
  t.preventDefault();
1038
1044
  const c = ee[Math.min(a + 1, ee.length - 1)];
1039
- c && Pt(D(c));
1045
+ c && Kt(P(c));
1040
1046
  } else if (t.key === "k" || t.key === "ArrowUp") {
1041
1047
  t.preventDefault();
1042
1048
  const c = ee[Math.max(a - 1, 0)];
1043
- c && Pt(D(c));
1049
+ c && Kt(P(c));
1044
1050
  } else if (t.key === "Enter" && a >= 0 && !ye)
1045
- t.preventDefault(), Kt(ee[a]);
1051
+ t.preventDefault(), Mt(ee[a]);
1046
1052
  else if (t.key === "c" && a >= 0 && se) {
1047
1053
  t.preventDefault();
1048
1054
  const c = ee[a];
1049
- ((o = c.claimed_by) == null ? void 0 : o.id) === v ? Be.mutate(c) : qe.mutate(c);
1055
+ ((o = c.claimed_by) == null ? void 0 : o.id) === v ? je.mutate(c) : qe.mutate(c);
1050
1056
  } else t.key === "o" && a >= 0 && (t.preventDefault(), ct(ee[a]));
1051
1057
  }
1052
1058
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1053
- }, [A, ee, Dt, ye, v, qe, Be, se]);
1059
+ }, [A, ee, Pt, ye, v, qe, je, se]);
1054
1060
  const { data: V } = H({
1055
1061
  queryKey: ["queue-views", l],
1056
- queryFn: () => p.request(O(`/queues/${l}/views`)),
1062
+ queryFn: () => p.request(E(`/queues/${l}/views`)),
1057
1063
  enabled: !!l
1058
- }), [ut, mt] = k(null), [Za, _n] = k(!1), [Nn, kr] = k(""), [vr, wr] = k(!1), [bt, _r] = k(!1);
1059
- function Mt(e) {
1064
+ }), [ut, mt] = k(null), [el, Nn] = k(!1), [Sn, vr] = k(""), [wr, _r] = k(!1), [bt, Nr] = k(!1);
1065
+ function Qt(e) {
1060
1066
  const t = e.state ?? {};
1061
- J(t.scope ?? "all"), P({ ...oe.current, ...t.filters ?? {} }), Le(t.sort ?? ""), et(t.group_by ?? null), At(t.columns ?? null), Yt(t.pins ?? null), t.view && Ee(Ce.includes(t.view) ? t.view : Ce[0]), E(1), mt(e.id);
1067
+ J(t.scope ?? "all"), K({ ...oe.current, ...t.filters ?? {} }), Le(t.sort ?? ""), et(t.group_by ?? null), Ot(t.columns ?? null), zt(t.pins ?? null), t.view && Ee(Ce.includes(t.view) ? t.view : Ce[0]), L(1), mt(e.id);
1062
1068
  }
1063
- function el() {
1069
+ function tl() {
1064
1070
  var t, n;
1065
1071
  const e = V == null ? void 0 : V.data.find((a) => a.is_default);
1066
1072
  if (e) {
1067
- Mt(e);
1073
+ Qt(e);
1068
1074
  return;
1069
1075
  }
1070
- J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), P({ ...oe.current }), Le(""), et(null), At(null), Yt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Ee(s.display_config.default_view), E(1), mt(null);
1076
+ J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), K({ ...oe.current }), Le(""), et(null), Ot(null), zt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Ee(s.display_config.default_view), L(1), mt(null);
1071
1077
  }
1072
- B(() => {
1078
+ j(() => {
1073
1079
  if (ae || !(s != null && s.display_config) || Ue === void 0 || V === void 0) return;
1074
1080
  const e = Ue.data.default_view_id, t = e != null ? V.data.find((a) => a.id === e) : void 0, n = V.data.find((a) => a.is_default);
1075
- t ? Mt(t) : n ? Mt(n) : (Ee(s.display_config.default_view), J(s.display_config.default_scope)), ya(!0);
1081
+ t ? Qt(t) : n ? Qt(n) : (Ee(s.display_config.default_view), J(s.display_config.default_scope)), ka(!0);
1076
1082
  }, [s, Ue, V, ae]);
1077
- const Qt = j(null), jt = j(null);
1078
- B(() => {
1083
+ const Bt = B(null), jt = B(null);
1084
+ j(() => {
1079
1085
  if (!ae) return;
1080
- const e = zo();
1086
+ const e = Xo();
1081
1087
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1082
- ca({ ...e, restore: !1 });
1088
+ da({ ...e, restore: !1 });
1083
1089
  const t = e.state ?? {};
1084
- t.scope && J(t.scope), t.filters && P({ ...oe.current, ...t.filters }), t.sort != null && Le(t.sort), et(t.group_by ?? null), t.view && Ee(t.view), t.page && E(t.page), jt.current = e.scroll ?? 0;
1085
- }, [ae, l]), B(() => {
1090
+ t.scope && J(t.scope), t.filters && K({ ...oe.current, ...t.filters }), t.sort != null && Le(t.sort), et(t.group_by ?? null), t.view && Ee(t.view), t.page && L(t.page), jt.current = e.scroll ?? 0;
1091
+ }, [ae, l]), j(() => {
1086
1092
  if (!ae || typeof window > "u") return;
1087
1093
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1088
1094
  if (!t) return;
@@ -1092,21 +1098,21 @@ function Pi({
1092
1098
  window.history.state,
1093
1099
  "",
1094
1100
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1095
- ), J("all"), P((a) => ({ ...a, owners: [t] })), mt(null), E(1);
1096
- }, [ae]), B(() => {
1097
- jt.current == null || S.length === 0 || !Qt.current || (Qt.current.scrollTop = jt.current, jt.current = null);
1101
+ ), J("all"), K((a) => ({ ...a, owners: [t] })), mt(null), L(1);
1102
+ }, [ae]), j(() => {
1103
+ jt.current == null || S.length === 0 || !Bt.current || (Bt.current.scrollTop = jt.current, jt.current = null);
1098
1104
  }, [S]);
1099
- const { isAdmin: Bt } = oa(), Nr = Bt || (s == null ? void 0 : s.owner) != null && s.owner === v, tl = ve({
1100
- mutationFn: ({ viewId: e, on: t }) => p.request(sa(`/queues/views/${e}`, { is_default: t })),
1105
+ const { isAdmin: Ut } = sa(), Sr = Ut || (s == null ? void 0 : s.owner) != null && s.owner === v, nl = ve({
1106
+ mutationFn: ({ viewId: e, on: t }) => p.request(ia(`/queues/views/${e}`, { is_default: t })),
1101
1107
  onSuccess: () => {
1102
1108
  h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("Queue default view updated");
1103
1109
  },
1104
1110
  onError: () => R.error("Could not update the queue default view")
1105
- }), Sr = ve({
1111
+ }), Cr = ve({
1106
1112
  mutationFn: () => p.request(
1107
1113
  ne(`/queues/${l}/views`, {
1108
- name: Nn.trim(),
1109
- is_shared: vr || bt,
1114
+ name: Sn.trim(),
1115
+ is_shared: wr || bt,
1110
1116
  is_default: bt,
1111
1117
  state: {
1112
1118
  scope: g,
@@ -1114,42 +1120,42 @@ function Pi({
1114
1120
  sort: I,
1115
1121
  group_by: N,
1116
1122
  view: A,
1117
- columns: dn,
1123
+ columns: un,
1118
1124
  pins: St
1119
1125
  }
1120
1126
  })
1121
1127
  ),
1122
1128
  onSuccess: (e) => {
1123
- _n(!1), kr(""), wr(!1), _r(!1), mt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("View saved");
1129
+ Nn(!1), vr(""), _r(!1), Nr(!1), mt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("View saved");
1124
1130
  },
1125
1131
  onError: () => R.error("Failed to save view")
1126
- }), [Cr, $r] = k(null), Re = ve({
1132
+ }), [$r, qr] = k(null), Re = ve({
1127
1133
  mutationFn: (e) => p.request(
1128
- sa(`/queues/views/${e.id}`, {
1134
+ ia(`/queues/views/${e.id}`, {
1129
1135
  state: {
1130
1136
  scope: g,
1131
1137
  filters: w,
1132
1138
  sort: I,
1133
1139
  group_by: N,
1134
1140
  view: A,
1135
- columns: dn,
1141
+ columns: un,
1136
1142
  pins: St
1137
1143
  }
1138
1144
  })
1139
1145
  ),
1140
1146
  onSuccess: (e, t) => {
1141
- h.invalidateQueries({ queryKey: ["queue-views", l] }), $r(t.id), setTimeout(() => $r((n) => n === t.id ? null : n), 2e3), R.success(`Saved "${t.name}" with the current filters, scope and sort`);
1147
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), qr(t.id), setTimeout(() => qr((n) => n === t.id ? null : n), 2e3), R.success(`Saved "${t.name}" with the current filters, scope and sort`);
1142
1148
  },
1143
1149
  onError: () => R.error("Failed to update view")
1144
- }), nl = ve({
1145
- mutationFn: (e) => p.request(Tn(`/queues/views/${e}`)),
1150
+ }), rl = ve({
1151
+ mutationFn: (e) => p.request(Rn(`/queues/views/${e}`)),
1146
1152
  onSuccess: (e, t) => {
1147
- h.invalidateQueries({ queryKey: ["queue-views", l] }), mt(null), Ie === t && un(null);
1153
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), mt(null), Ie === t && mn(null);
1148
1154
  },
1149
1155
  onError: () => R.error("Failed to delete view")
1150
- }), rl = ve({
1151
- mutationFn: (e) => p.request(oo(`/queues/${l}/default-view`, { view_id: e })),
1152
- onMutate: (e) => un(e),
1156
+ }), al = ve({
1157
+ mutationFn: (e) => p.request(so(`/queues/${l}/default-view`, { view_id: e })),
1158
+ onMutate: (e) => mn(e),
1153
1159
  onSuccess: (e, t) => {
1154
1160
  h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.success(
1155
1161
  t === null ? "Reverted to the general default" : "Set as your default view"
@@ -1158,14 +1164,16 @@ function Pi({
1158
1164
  onError: () => {
1159
1165
  h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.error("Failed to update default view");
1160
1166
  }
1161
- }), [Ae, Ut] = k([]);
1162
- lo(), Qn.current = Ae.length;
1163
- const [qr, Fr] = k(!1);
1164
- async function Sn(e, t) {
1165
- const n = S.filter((b) => Ae.includes(D(b)));
1166
- Fr(!0);
1167
- const a = await Promise.allSettled(n.map(t)), o = a.filter((b) => b.status === "fulfilled").length, c = a.length - o;
1168
- Fr(!1), Ut([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? R.warning(`${e}: ${o} succeeded, ${c} failed`) : R.success(`${e}: ${o} succeeded`);
1167
+ }), [Ae, It] = k([]);
1168
+ oo(), Bn.current = Ae.length;
1169
+ const [Fr, Tr] = k(!1);
1170
+ async function Cn(e, t) {
1171
+ const n = S.filter((b) => Ae.includes(P(b)));
1172
+ Tr(!0), At.beginBatch();
1173
+ const a = await Promise.allSettled(n.map(t));
1174
+ At.endBatch();
1175
+ const o = a.filter((b) => b.status === "fulfilled").length, c = a.length - o;
1176
+ Tr(!1), It([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? R.warning(`${e}: ${o} succeeded, ${c} failed`) : R.success(`${e}: ${o} succeeded`);
1169
1177
  }
1170
1178
  const Ge = (e) => {
1171
1179
  var t;
@@ -1174,7 +1182,7 @@ function Pi({
1174
1182
  if (a) return a;
1175
1183
  }
1176
1184
  return null;
1177
- }, al = (e) => {
1185
+ }, ll = (e) => {
1178
1186
  if (N === "state") return e === "No state" ? e : Fe(e);
1179
1187
  if (N === "collection") return it(e);
1180
1188
  if (N != null && N.startsWith("extra.") && e !== "—") {
@@ -1182,11 +1190,11 @@ function Pi({
1182
1190
  if (t) return Ye(e, t);
1183
1191
  }
1184
1192
  return e;
1185
- }, ll = Z == null ? void 0 : Z.map((e) => ({
1193
+ }, ol = Z == null ? void 0 : Z.map((e) => ({
1186
1194
  key: e.key,
1187
1195
  rows: e.rows,
1188
1196
  header: /* @__PURE__ */ d(we, { children: [
1189
- /* @__PURE__ */ r("span", { children: al(e.key) }),
1197
+ /* @__PURE__ */ r("span", { children: ll(e.key) }),
1190
1198
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1191
1199
  "(",
1192
1200
  re(e.count),
@@ -1209,14 +1217,14 @@ function Pi({
1209
1217
  t
1210
1218
  );
1211
1219
  }),
1212
- ce && !he.has(e.key) && Qa.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1220
+ ce && !he.has(e.key) && Ba.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1213
1221
  ce && !he.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1214
1222
  "button",
1215
1223
  {
1216
1224
  type: "button",
1217
1225
  "data-queue-group-more": e.key,
1218
1226
  onClick: (t) => {
1219
- t.stopPropagation(), lr((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1227
+ t.stopPropagation(), or((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1220
1228
  },
1221
1229
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1222
1230
  children: [
@@ -1237,13 +1245,13 @@ function Pi({
1237
1245
  " at risk"
1238
1246
  ] })
1239
1247
  ] })
1240
- })), Cn = (((Ir = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Ir.length) ?? 0) > 1, Tr = S.some((e) => !!e.unseen) || Lt.size > 0 || S.some((e) => Ne.isNew(D(e))), Rr = [
1241
- ...Cn ? [
1248
+ })), $n = (((Vr = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Vr.length) ?? 0) > 1, Rr = S.some((e) => !!e.unseen) || Dt.size > 0 || S.some((e) => Ne.isNew(P(e))), Ar = [
1249
+ ...$n ? [
1242
1250
  {
1243
1251
  key: "collection",
1244
1252
  header: q("collection", "Collection"),
1245
1253
  sortable: !0,
1246
- render: (e) => /* @__PURE__ */ r(as, { variant: "outline", children: it(e.collection) })
1254
+ render: (e) => /* @__PURE__ */ r(os, { variant: "outline", children: it(e.collection) })
1247
1255
  }
1248
1256
  ] : [],
1249
1257
  {
@@ -1251,22 +1259,22 @@ function Pi({
1251
1259
  header: q("label", "Item"),
1252
1260
  sortable: !0,
1253
1261
  // Room in the left padding for the hanging unseen mark (#643).
1254
- className: Tr ? "pl-[30px]" : void 0,
1255
- headerClassName: Tr ? "pl-[30px]" : void 0,
1262
+ className: Rr ? "pl-[30px]" : void 0,
1263
+ headerClassName: Rr ? "pl-[30px]" : void 0,
1256
1264
  render: (e) => (
1257
1265
  // Underlined because clicking opens the item. The row is clickable as
1258
1266
  // a whole, but nothing on it said so — an underline is the one
1259
1267
  // convention people already read as "this goes somewhere".
1260
1268
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1261
- Lt.get(D(e)) || Ne.isNew(D(e)) ? /* @__PURE__ */ r(
1262
- Xo,
1269
+ Dt.get(P(e)) || Ne.isNew(P(e)) ? /* @__PURE__ */ r(
1270
+ es,
1263
1271
  {
1264
- lock: Lt.get(D(e)),
1265
- isNew: Ne.isNew(D(e)),
1272
+ lock: Dt.get(P(e)),
1273
+ isNew: Ne.isNew(P(e)),
1266
1274
  dataAttr: "data-queue-live-mark",
1267
1275
  hang: !0
1268
1276
  }
1269
- ) : /* @__PURE__ */ r(rs, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1277
+ ) : /* @__PURE__ */ r(ls, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1270
1278
  /* @__PURE__ */ r(
1271
1279
  "span",
1272
1280
  {
@@ -1285,9 +1293,9 @@ function Pi({
1285
1293
  t
1286
1294
  )),
1287
1295
  /* @__PURE__ */ r(
1288
- ns,
1296
+ as,
1289
1297
  {
1290
- viewers: Da[_o(e.collection, e.item_id)],
1298
+ viewers: Pa[No(e.collection, e.item_id)],
1291
1299
  dataAttr: "data-queue-presence"
1292
1300
  }
1293
1301
  )
@@ -1318,13 +1326,13 @@ function Pi({
1318
1326
  key: "owners",
1319
1327
  header: q("owners", "Owners"),
1320
1328
  sortable: !0,
1321
- render: (e) => /* @__PURE__ */ r(cs, { owners: e.owners })
1329
+ render: (e) => /* @__PURE__ */ r(us, { owners: e.owners })
1322
1330
  },
1323
1331
  {
1324
1332
  key: "aging_hours",
1325
1333
  header: q("aging_hours", "Aging"),
1326
1334
  sortable: !0,
1327
- render: (e) => ks(e.aging_hours)
1335
+ render: (e) => _s(e.aging_hours)
1328
1336
  },
1329
1337
  {
1330
1338
  // When the record entered its current state — the same moment Aging
@@ -1332,13 +1340,13 @@ function Pi({
1332
1340
  key: "state_entered",
1333
1341
  header: q("state_entered", "Last State Change"),
1334
1342
  sortable: !0,
1335
- render: (e) => e.state_entered_at ? uo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1343
+ render: (e) => e.state_entered_at ? mo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1336
1344
  },
1337
1345
  {
1338
1346
  key: "sla_status",
1339
1347
  header: q("sla_status", "SLA"),
1340
1348
  sortable: !0,
1341
- render: (e) => /* @__PURE__ */ r(vs, { status: e.sla_status })
1349
+ render: (e) => /* @__PURE__ */ r(Ns, { status: e.sla_status })
1342
1350
  },
1343
1351
  {
1344
1352
  key: "at_risk",
@@ -1346,7 +1354,7 @@ function Pi({
1346
1354
  sortable: !0,
1347
1355
  render: (e) => {
1348
1356
  var t;
1349
- return e.at_risk ? /* @__PURE__ */ d("span", { className: Co(e.at_risk_color ?? "red"), children: [
1357
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: $o(e.at_risk_color ?? "red"), children: [
1350
1358
  "⚑ ",
1351
1359
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1352
1360
  ] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
@@ -1357,7 +1365,7 @@ function Pi({
1357
1365
  key: "addendums",
1358
1366
  header: q("addendums", "Addendums"),
1359
1367
  sortable: !1,
1360
- render: (e) => /* @__PURE__ */ r(ys, { summary: e.addendums })
1368
+ render: (e) => /* @__PURE__ */ r(ws, { summary: e.addendums })
1361
1369
  }
1362
1370
  ] : [],
1363
1371
  ...at ? [
@@ -1366,7 +1374,7 @@ function Pi({
1366
1374
  header: q("fulfilment", "Shipped"),
1367
1375
  sortable: !0,
1368
1376
  render: (e) => /* @__PURE__ */ r(
1369
- Vo,
1377
+ Go,
1370
1378
  {
1371
1379
  collection: e.collection,
1372
1380
  itemId: e.item_id,
@@ -1380,16 +1388,16 @@ function Pi({
1380
1388
  key: "integrations",
1381
1389
  header: q("integrations", "Integrations"),
1382
1390
  sortable: !1,
1383
- render: (e) => /* @__PURE__ */ r(Ho, { rows: Ga[`${e.collection}:${e.item_id}`] })
1391
+ render: (e) => /* @__PURE__ */ r(Jo, { rows: Wa[`${e.collection}:${e.item_id}`] })
1384
1392
  }
1385
1393
  ] : [],
1386
- ...mr ? [
1394
+ ...br ? [
1387
1395
  {
1388
1396
  key: "tasks",
1389
1397
  header: q("tasks", "Tasks"),
1390
1398
  sortable: !1,
1391
1399
  render: (e) => {
1392
- const t = Ha[`${e.collection}:${e.item_id}`];
1400
+ const t = Ja[`${e.collection}:${e.item_id}`];
1393
1401
  return !t || t.open === 0 ? /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
1394
1402
  "span",
1395
1403
  {
@@ -1409,10 +1417,10 @@ function Pi({
1409
1417
  key: "send_backs",
1410
1418
  header: q("send_backs", "Sent back"),
1411
1419
  sortable: !0,
1412
- render: (e) => /* @__PURE__ */ r(fs, { summary: e.send_backs })
1420
+ render: (e) => /* @__PURE__ */ r(ys, { summary: e.send_backs })
1413
1421
  }
1414
1422
  ] : []
1415
- ], ol = {
1423
+ ], sl = {
1416
1424
  key: "claim",
1417
1425
  header: "",
1418
1426
  render: (e) => e.claimed_by ? /* @__PURE__ */ r(
@@ -1420,7 +1428,7 @@ function Pi({
1420
1428
  {
1421
1429
  type: "button",
1422
1430
  onClick: (t) => {
1423
- t.stopPropagation(), Be.mutate(e);
1431
+ t.stopPropagation(), je.mutate(e);
1424
1432
  },
1425
1433
  className: "text-[11px] text-slate-400 underline hover:text-slate-600",
1426
1434
  children: "Release"
@@ -1436,7 +1444,7 @@ function Pi({
1436
1444
  children: "Claim"
1437
1445
  }
1438
1446
  )
1439
- }, pt = (s == null ? void 0 : s.available_extra_fields) ?? [], ht = no("drill.queue"), X = ht.value, Ar = (e) => ht.push([e]), sl = (e) => {
1447
+ }, pt = (s == null ? void 0 : s.available_extra_fields) ?? [], ht = ro("drill.queue"), X = ht.value, Or = (e) => ht.push([e]), il = (e) => {
1440
1448
  var t;
1441
1449
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1442
1450
  const a = (t = n.drilldown) == null ? void 0 : t[e];
@@ -1448,26 +1456,26 @@ function Pi({
1448
1456
  };
1449
1457
  }
1450
1458
  return { enabled: !0, layout_id: null, width: null };
1451
- }, il = G(() => {
1459
+ }, cl = G(() => {
1452
1460
  const e = {};
1453
1461
  for (const t of (s == null ? void 0 : s.sources) ?? [])
1454
1462
  for (const [n, a] of Object.entries(t.column_formats ?? {}))
1455
1463
  n in e || (e[n] = a);
1456
1464
  return e;
1457
- }, [s == null ? void 0 : s.sources]), cl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, dl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1458
- function ul(e) {
1459
- if (cl.test(e)) return { text: e.split("@")[0], title: e };
1460
- if (dl.test(e)) {
1465
+ }, [s == null ? void 0 : s.sources]), dl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ul = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1466
+ function ml(e) {
1467
+ if (dl.test(e)) return { text: e.split("@")[0], title: e };
1468
+ if (ul.test(e)) {
1461
1469
  const t = new Date(e);
1462
1470
  if (!Number.isNaN(t.getTime()))
1463
1471
  return {
1464
- text: Lo(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1465
- title: Eo(t)
1472
+ text: Do(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1473
+ title: Lo(t)
1466
1474
  };
1467
1475
  }
1468
1476
  return { text: e, title: e };
1469
1477
  }
1470
- const ml = pt.map((e) => ({
1478
+ const bl = pt.map((e) => ({
1471
1479
  key: `extra.${e}`,
1472
1480
  header: q(`extra.${e}`, wt(e)),
1473
1481
  sortable: !0,
@@ -1475,15 +1483,15 @@ function Pi({
1475
1483
  var y, T;
1476
1484
  const n = (y = t.extra) == null ? void 0 : y[e];
1477
1485
  if (n == null || n === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
1478
- const a = Ge(e), o = a ? Ye(String(n), a) : String(n), { text: c, title: b } = ul(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), M = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = sl(e);
1479
- return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && M.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
1486
+ const a = Ge(e), o = a ? Ye(String(n), a) : String(n), { text: c, title: b } = ml(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), O = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = il(e);
1487
+ return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && O.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
1480
1488
  "button",
1481
1489
  {
1482
1490
  type: "button",
1483
1491
  onClick: (Q) => {
1484
- Q.stopPropagation(), Ar({
1492
+ Q.stopPropagation(), Or({
1485
1493
  collection: m.target_collection,
1486
- itemId: M[0],
1494
+ itemId: O[0],
1487
1495
  layoutId: F.layout_id,
1488
1496
  width: F.width,
1489
1497
  title: o
@@ -1498,7 +1506,7 @@ function Pi({
1498
1506
  {
1499
1507
  type: "button",
1500
1508
  onClick: (Q) => {
1501
- Q.stopPropagation(), on({ row: t, path: e, value: o });
1509
+ Q.stopPropagation(), sn({ row: t, path: e, value: o });
1502
1510
  },
1503
1511
  title: "Show the rows behind this number",
1504
1512
  className: "block max-w-[200px] truncate text-left text-[12px] tabular-nums underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
@@ -1506,8 +1514,8 @@ function Pi({
1506
1514
  }
1507
1515
  ) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: c });
1508
1516
  }
1509
- })), Or = [
1510
- ...Cn ? ["collection"] : [],
1517
+ })), Er = [
1518
+ ...$n ? ["collection"] : [],
1511
1519
  "state",
1512
1520
  "owners",
1513
1521
  "aging_hours",
@@ -1518,10 +1526,10 @@ function Pi({
1518
1526
  ...at ? ["fulfilment"] : [],
1519
1527
  ...ge ? ["integrations"] : [],
1520
1528
  ...lt ? ["send_backs"] : [],
1521
- ...mr ? ["tasks"] : [],
1529
+ ...br ? ["tasks"] : [],
1522
1530
  ...pt.map((e) => `extra.${e}`)
1523
- ], bl = [
1524
- ...Cn ? ["collection"] : [],
1531
+ ], pl = [
1532
+ ...$n ? ["collection"] : [],
1525
1533
  "state",
1526
1534
  "owners",
1527
1535
  ...Ve ? ["addendums"] : [],
@@ -1532,29 +1540,29 @@ function Pi({
1532
1540
  "sla_status",
1533
1541
  "at_risk",
1534
1542
  ...pt.slice(0, 2).map((e) => `extra.${e}`)
1535
- ], pl = (u == null ? void 0 : u.default_columns) ?? null, $n = dn ?? pl, te = new Set($n ?? bl);
1543
+ ], hl = (u == null ? void 0 : u.default_columns) ?? null, qn = un ?? hl, te = new Set(qn ?? pl);
1536
1544
  Ve && !Nt.has("addendums") && te.add("addendums"), at && !Nt.has("fulfilment") && te.add("fulfilment"), ge && !Nt.has("integrations") && te.add("integrations"), lt && !Nt.has("send_backs") && te.add("send_backs");
1537
- const hl = new Set(Bt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1538
- for (const e of hl) te.delete(e);
1545
+ const fl = new Set(Ut ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1546
+ for (const e of fl) te.delete(e);
1539
1547
  const We = [
1540
- ...($n ?? []).filter((e) => Or.includes(e)),
1541
- ...Or.filter((e) => !($n ?? []).includes(e))
1542
- ], fl = Sl(Cl($l, { activationConstraint: { distance: 4 } }));
1543
- function gl(e) {
1548
+ ...(qn ?? []).filter((e) => Er.includes(e)),
1549
+ ...Er.filter((e) => !(qn ?? []).includes(e))
1550
+ ], gl = Cl($l(ql, { activationConstraint: { distance: 4 } }));
1551
+ function xl(e) {
1544
1552
  const { active: t, over: n } = e;
1545
1553
  if (!n || t.id === n.id) return;
1546
1554
  const a = We.indexOf(String(t.id)), o = We.indexOf(String(n.id));
1547
- a === -1 || o === -1 || At(
1548
- Al(We, a, o).filter((c) => te.has(c))
1555
+ a === -1 || o === -1 || Ot(
1556
+ Ol(We, a, o).filter((c) => te.has(c))
1549
1557
  );
1550
1558
  }
1551
- const Er = Rr.find((e) => e.key === "label"), xl = {
1552
- ...Er,
1559
+ const Lr = Ar.find((e) => e.key === "label"), yl = {
1560
+ ...Lr,
1553
1561
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1554
- /* @__PURE__ */ r(Qo, { rowId: e.item_id }),
1555
- Er.render(e, ...t)
1562
+ /* @__PURE__ */ r(Bo, { rowId: e.item_id }),
1563
+ Lr.render(e, ...t)
1556
1564
  ] })
1557
- }, yl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1565
+ }, kl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1558
1566
  (e) => ({
1559
1567
  key: `formula.${e.key}`,
1560
1568
  header: e.label,
@@ -1562,7 +1570,7 @@ function Pi({
1562
1570
  const n = {
1563
1571
  ...t,
1564
1572
  ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([c, b]) => [`extra.${c}`, b])) : {}
1565
- }, a = so(e.formula, (c) => {
1573
+ }, a = io(e.formula, (c) => {
1566
1574
  const b = n[c] ?? (t.extra ? t.extra[c] : void 0), m = Number(b);
1567
1575
  return Number.isFinite(m) ? m : b ?? null;
1568
1576
  });
@@ -1571,10 +1579,10 @@ function Pi({
1571
1579
  return Number.isFinite(o) ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ r("span", { children: String(a) });
1572
1580
  }
1573
1581
  })
1574
- ), Lr = [...Rr, ...ml, ...yl], kl = {
1582
+ ), Dr = [...Ar, ...bl, ...kl], vl = {
1575
1583
  key: "__actions__",
1576
1584
  header: "",
1577
- render: (e) => e.collection === "tasks" || e.collection === Wt ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1585
+ render: (e) => e.collection === "tasks" || e.collection === Ht ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1578
1586
  jo,
1579
1587
  {
1580
1588
  collection: e.collection,
@@ -1584,7 +1592,7 @@ function Pi({
1584
1592
  onPeek: () => Te(e),
1585
1593
  urlFor: W.urlFor,
1586
1594
  onDeleted: () => {
1587
- p.request(Tn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1595
+ p.request(Rn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1588
1596
  R.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
1589
1597
  }).catch((t) => R.error(yt(t, "Delete failed")));
1590
1598
  },
@@ -1592,16 +1600,16 @@ function Pi({
1592
1600
  bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null
1593
1601
  }
1594
1602
  ) })
1595
- }, It = [
1596
- xl,
1597
- ...We.filter((e) => te.has(e)).map((e) => Lr.find((t) => t.key === e)).filter((e) => e !== void 0),
1598
- ...se ? [ol] : [],
1599
- kl
1600
- ], Dr = G(() => {
1603
+ }, Vt = [
1604
+ yl,
1605
+ ...We.filter((e) => te.has(e)).map((e) => Dr.find((t) => t.key === e)).filter((e) => e !== void 0),
1606
+ ...se ? [sl] : [],
1607
+ vl
1608
+ ], Pr = G(() => {
1601
1609
  var a;
1602
- const e = u == null ? void 0 : u.default_pins, t = St ?? (e && Object.keys(e).length > 0 ? e : { [((a = It[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(It.map((o) => o.key));
1610
+ const e = u == null ? void 0 : u.default_pins, t = St ?? (e && Object.keys(e).length > 0 ? e : { [((a = Vt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Vt.map((o) => o.key));
1603
1611
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1604
- }, [St, u == null ? void 0 : u.default_pins, It.map((e) => e.key).join("|")]), Pr = [
1612
+ }, [St, u == null ? void 0 : u.default_pins, Vt.map((e) => e.key).join("|")]), Kr = [
1605
1613
  { value: "state", label: "State" },
1606
1614
  { value: "collection", label: "Collection" },
1607
1615
  { value: "sla_status", label: "SLA status" },
@@ -1609,7 +1617,7 @@ function Pi({
1609
1617
  { value: "owners", label: "Owner" },
1610
1618
  { value: "aging", label: "Aging" },
1611
1619
  ...pt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, wt(e)) }))
1612
- ], Kr = (e) => async (t) => {
1620
+ ], Mr = (e) => async (t) => {
1613
1621
  if (!e.target_collection || !e.display_field) return [];
1614
1622
  const n = {
1615
1623
  limit: 25,
@@ -1617,16 +1625,16 @@ function Pi({
1617
1625
  };
1618
1626
  t.trim() && (n.filter = JSON.stringify({ [e.display_field]: { _contains: t.trim() } }));
1619
1627
  const o = (await p.request(
1620
- O(`/items/${e.target_collection}`, n)
1621
- )).data ?? [], c = Ge(e.path), b = Se[e.path] ? new Set(Se[e.path]) : null, m = /* @__PURE__ */ new Set(), M = [];
1628
+ E(`/items/${e.target_collection}`, n)
1629
+ )).data ?? [], c = Ge(e.path), b = Se[e.path] ? new Set(Se[e.path]) : null, m = /* @__PURE__ */ new Set(), O = [];
1622
1630
  for (const F of o) {
1623
1631
  const y = F[e.display_field];
1624
1632
  if (y == null || y === "") continue;
1625
1633
  const T = String(y);
1626
- m.has(T) || b && !b.has(T) || (m.add(T), M.push({ label: c ? Ye(T, c) : T, value: T }));
1634
+ m.has(T) || b && !b.has(T) || (m.add(T), O.push({ label: c ? Ye(T, c) : T, value: T }));
1627
1635
  }
1628
- return M;
1629
- }, qn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), He = [
1636
+ return O;
1637
+ }, Fn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), He = [
1630
1638
  {
1631
1639
  key: "collection",
1632
1640
  placeholder: q("collection", "Collection"),
@@ -1644,7 +1652,7 @@ function Pi({
1644
1652
  multi: !0,
1645
1653
  // Until the rows land, the pipeline's own states (no counts yet) rather
1646
1654
  // than an empty list.
1647
- options: xr(
1655
+ options: yr(
1648
1656
  i ? i.available_values.state ?? [] : Object.keys(xe)
1649
1657
  ).map((e) => {
1650
1658
  var t;
@@ -1653,7 +1661,7 @@ function Pi({
1653
1661
  value: e,
1654
1662
  // How many rows sit in it under the other active filters (the State
1655
1663
  // filter itself left out, or every other state would read 0).
1656
- count: or ? or[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1664
+ count: sr ? sr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1657
1665
  };
1658
1666
  })
1659
1667
  },
@@ -1676,12 +1684,12 @@ function Pi({
1676
1684
  { label: "No", value: "no" }
1677
1685
  ]
1678
1686
  },
1679
- ...pr.length > 0 ? [
1687
+ ...hr.length > 0 ? [
1680
1688
  {
1681
1689
  key: "at_risk_rule",
1682
1690
  placeholder: "Highlight rule",
1683
1691
  type: "select",
1684
- options: pr
1692
+ options: hr
1685
1693
  }
1686
1694
  ] : [],
1687
1695
  {
@@ -1708,7 +1716,7 @@ function Pi({
1708
1716
  key: "integrations",
1709
1717
  placeholder: q("integrations", "Integrations"),
1710
1718
  type: "select",
1711
- options: Jo.map((e) => ({ label: e.label, value: e.value }))
1719
+ options: Yo.map((e) => ({ label: e.label, value: e.value }))
1712
1720
  }
1713
1721
  ] : [],
1714
1722
  ...at ? [
@@ -1716,7 +1724,7 @@ function Pi({
1716
1724
  key: "fulfilment",
1717
1725
  placeholder: "Shipped",
1718
1726
  type: "select",
1719
- options: Go
1727
+ options: Wo
1720
1728
  }
1721
1729
  ] : [],
1722
1730
  ...lt ? [
@@ -1731,13 +1739,13 @@ function Pi({
1731
1739
  ]
1732
1740
  }
1733
1741
  ] : [],
1734
- ...cn.length > 0 ? [
1742
+ ...dn.length > 0 ? [
1735
1743
  {
1736
1744
  key: "labels",
1737
1745
  placeholder: "Triage label",
1738
1746
  type: "combobox",
1739
1747
  multi: !0,
1740
- options: cn.map((e) => ({ label: e, value: e }))
1748
+ options: dn.map((e) => ({ label: e, value: e }))
1741
1749
  }
1742
1750
  ] : [],
1743
1751
  {
@@ -1746,7 +1754,7 @@ function Pi({
1746
1754
  type: "combobox",
1747
1755
  multi: !0,
1748
1756
  loadOptions: async (e) => ((await p.request(
1749
- O(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
1757
+ E(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
1750
1758
  )).data ?? []).map((n) => ({ label: n, value: n }))
1751
1759
  },
1752
1760
  {
@@ -1761,7 +1769,7 @@ function Pi({
1761
1769
  },
1762
1770
  ...pt.map((e) => {
1763
1771
  var b, m;
1764
- const t = qn.get(e), n = q(`extra.${e}`, wt(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ge(e);
1772
+ const t = Fn.get(e), n = q(`extra.${e}`, wt(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ge(e);
1765
1773
  if ((o == null ? void 0 : o.type) === "datetime") return { ...a, type: "date" };
1766
1774
  if ((o == null ? void 0 : o.type) === "number") return { ...a, type: "number" };
1767
1775
  if ((o == null ? void 0 : o.type) === "boolean")
@@ -1778,21 +1786,21 @@ function Pi({
1778
1786
  ...a,
1779
1787
  type: "combobox",
1780
1788
  multi: !0,
1781
- options: c.map((M) => ({ label: o ? Ye(M, o) : M, value: M }))
1789
+ options: c.map((O) => ({ label: o ? Ye(O, o) : O, value: O }))
1782
1790
  } : (t == null ? void 0 : t.kind) === "relation" ? {
1783
1791
  ...a,
1784
1792
  type: "combobox",
1785
1793
  multi: !0,
1786
1794
  restricted: !!((m = Se[e]) != null && m.length),
1787
- loadOptions: Kr(t)
1795
+ loadOptions: Mr(t)
1788
1796
  } : { ...a, placeholder: `Search ${n}…`, type: "text" };
1789
1797
  })
1790
- ], Fn = He.filter(
1798
+ ], Tn = He.filter(
1791
1799
  (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1792
- ), Mr = (e) => {
1800
+ ), Qr = (e) => {
1793
1801
  var t;
1794
1802
  return (((t = He.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1795
- }, ft = new Set(Object.keys(oe.current)), vl = ((e) => {
1803
+ }, ft = new Set(Object.keys(oe.current)), wl = ((e) => {
1796
1804
  var n;
1797
1805
  if (e.some((a) => a.key === "state")) return e;
1798
1806
  const t = He.find((a) => a.key === "state");
@@ -1804,8 +1812,8 @@ function Pi({
1804
1812
  var Q, ke, Oe;
1805
1813
  if (!c.key.startsWith("extra.")) return null;
1806
1814
  if (c.type === "combobox") return c;
1807
- const b = c.key.slice(6), m = qn.get(b), M = ft.has(c.key);
1808
- if ((m == null ? void 0 : m.kind) !== "relation" && !M) return null;
1815
+ const b = c.key.slice(6), m = Fn.get(b), O = ft.has(c.key);
1816
+ if ((m == null ? void 0 : m.kind) !== "relation" && !O) return null;
1809
1817
  const F = Ge(b), y = (Q = i == null ? void 0 : i.available_values.extra) == null ? void 0 : Q[b], T = c.placeholder.replace(/^Search (.*)…$/, "$1");
1810
1818
  return y != null && y.length ? {
1811
1819
  key: c.key,
@@ -1823,13 +1831,13 @@ function Pi({
1823
1831
  type: "combobox",
1824
1832
  multi: !0,
1825
1833
  restricted: !!((Oe = Se[b]) != null && Oe.length),
1826
- loadOptions: Kr(m)
1834
+ loadOptions: Mr(m)
1827
1835
  } : null;
1828
1836
  };
1829
- if (Vn.length > 0) {
1837
+ if (Gn.length > 0) {
1830
1838
  const c = [], b = /* @__PURE__ */ new Set();
1831
- for (const m of Vn) {
1832
- const M = (m.path ?? []).join(".");
1839
+ for (const m of Gn) {
1840
+ const O = (m.path ?? []).join(".");
1833
1841
  let F;
1834
1842
  if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
1835
1843
  F = He.find((y) => y.key === "state");
@@ -1838,8 +1846,8 @@ function Pi({
1838
1846
  var Oe;
1839
1847
  if (!Q.key.startsWith("extra.") || b.has(Q.key)) return !1;
1840
1848
  const ke = Q.key.slice(6);
1841
- return ((Oe = qn.get(ke)) == null ? void 0 : Oe.target_collection) === m.collection;
1842
- }), T = y.find((Q) => Q.key.slice(6).startsWith(`${M}.`)) ?? y[0];
1849
+ return ((Oe = Fn.get(ke)) == null ? void 0 : Oe.target_collection) === m.collection;
1850
+ }), T = y.find((Q) => Q.key.slice(6).startsWith(`${O}.`)) ?? y[0];
1843
1851
  F = T ? e(T) : null;
1844
1852
  }
1845
1853
  !F || b.has(F.key) || (b.add(F.key), c.push(m.label ? { ...F, placeholder: m.label } : F));
@@ -1848,13 +1856,13 @@ function Pi({
1848
1856
  m && !b.has(m.key) && (ft.has(m.key) || m.restricted) && c.push(m);
1849
1857
  if (c.length > 0) return c;
1850
1858
  }
1851
- const t = Fn.map(e).filter((c) => c !== null), a = [
1859
+ const t = Tn.map(e).filter((c) => c !== null), a = [
1852
1860
  ...t.filter((c) => ft.has(c.key) || c.restricted),
1853
1861
  ...t.filter((c) => !ft.has(c.key) && !c.restricted)
1854
1862
  ].slice(0, 6);
1855
- return a.length > 0 ? a : Fn.filter((c) => c.key === "state" || c.key === "owners");
1863
+ return a.length > 0 ? a : Tn.filter((c) => c.key === "state" || c.key === "owners");
1856
1864
  })()
1857
- ), wl = (() => {
1865
+ ), _l = (() => {
1858
1866
  if (!x) return null;
1859
1867
  const e = Y ?? x, t = [
1860
1868
  {
@@ -1888,7 +1896,7 @@ function Pi({
1888
1896
  tone: "text-slate-600 dark:text-slate-300",
1889
1897
  on: g === "unowned",
1890
1898
  toggle: () => {
1891
- J(g === "unowned" ? "all" : "unowned"), E(1);
1899
+ J(g === "unowned" ? "all" : "unowned"), L(1);
1892
1900
  }
1893
1901
  }
1894
1902
  ].filter((n) => n.n > 0 || n.on);
@@ -1926,17 +1934,17 @@ function Pi({
1926
1934
  }
1927
1935
  );
1928
1936
  })();
1929
- function _l(e) {
1937
+ function Nl(e) {
1930
1938
  const t = new Set(te);
1931
- t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Ln((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Ln((n) => {
1939
+ t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Dn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Dn((n) => {
1932
1940
  const a = new Set(n);
1933
1941
  return a.delete(e), a;
1934
- })), At([...t]);
1942
+ })), Ot([...t]);
1935
1943
  }
1936
1944
  return qt ? ($ == null ? void 0 : $((qt == null ? void 0 : qt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
1937
1945
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
1938
1946
  (i == null ? void 0 : i.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
1939
- /* @__PURE__ */ r(Dl, { className: "h-4 w-4 shrink-0" }),
1947
+ /* @__PURE__ */ r(Pl, { className: "h-4 w-4 shrink-0" }),
1940
1948
  /* @__PURE__ */ r("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
1941
1949
  ] }),
1942
1950
  /* @__PURE__ */ d(
@@ -1945,13 +1953,13 @@ function Pi({
1945
1953
  className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
1946
1954
  "data-queue-toolbar": !0,
1947
1955
  children: [
1948
- ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: xs.filter((e) => se || e.value !== "claimed").map(
1956
+ ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: vs.filter((e) => se || e.value !== "claimed").map(
1949
1957
  (e, t) => /* @__PURE__ */ r(
1950
1958
  "button",
1951
1959
  {
1952
1960
  type: "button",
1953
1961
  onClick: () => {
1954
- J(e.value), E(1);
1962
+ J(e.value), L(1);
1955
1963
  },
1956
1964
  className: C(
1957
1965
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
@@ -1991,7 +1999,7 @@ function Pi({
1991
1999
  "aria-pressed": w.unseen === "yes",
1992
2000
  "data-queue-unseen-filter": !0,
1993
2001
  title: "Only records someone else changed since you last opened them",
1994
- onClick: () => P((e) => {
2002
+ onClick: () => K((e) => {
1995
2003
  const t = { ...e };
1996
2004
  return t.unseen === "yes" ? delete t.unseen : t.unseen = "yes", t;
1997
2005
  }),
@@ -2008,41 +2016,41 @@ function Pi({
2008
2016
  type: "button",
2009
2017
  "aria-pressed": w.addendums === "active",
2010
2018
  title: "Only records with an addendum still in review",
2011
- onClick: () => P((e) => {
2019
+ onClick: () => K((e) => {
2012
2020
  const t = { ...e };
2013
2021
  return t.addendums === "active" ? delete t.addendums : t.addendums = "active", t;
2014
2022
  }),
2015
2023
  className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${w.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
2016
2024
  children: [
2017
- /* @__PURE__ */ r(Pl, { className: "h-3.5 w-3.5" }),
2025
+ /* @__PURE__ */ r(Kl, { className: "h-3.5 w-3.5" }),
2018
2026
  "Active addendums"
2019
2027
  ]
2020
2028
  }
2021
2029
  ),
2022
2030
  ge && /* @__PURE__ */ r(
2023
- Yo,
2031
+ zo,
2024
2032
  {
2025
2033
  label: q("integrations", "Integrations"),
2026
2034
  value: w.integrations,
2027
- onChange: (e) => P((t) => {
2035
+ onChange: (e) => K((t) => {
2028
2036
  const n = { ...t };
2029
2037
  return e ? n.integrations = e : delete n.integrations, n;
2030
2038
  })
2031
2039
  }
2032
2040
  ),
2033
- /* @__PURE__ */ r(Zo, { className: "h-8" }),
2034
- /* @__PURE__ */ r(Io, {}),
2035
- zt > 0 && /* @__PURE__ */ d(
2041
+ /* @__PURE__ */ r(ts, { className: "h-8" }),
2042
+ /* @__PURE__ */ r(Vo, {}),
2043
+ Xt > 0 && /* @__PURE__ */ d(
2036
2044
  "button",
2037
2045
  {
2038
2046
  type: "button",
2039
- onClick: Ua,
2047
+ onClick: Ia,
2040
2048
  className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
2041
2049
  children: [
2042
- /* @__PURE__ */ r(Kl, { className: "h-3 w-3" }),
2043
- zt,
2050
+ /* @__PURE__ */ r(Ml, { className: "h-3 w-3" }),
2051
+ Xt,
2044
2052
  " update",
2045
- zt === 1 ? "" : "s",
2053
+ Xt === 1 ? "" : "s",
2046
2054
  " · Refresh"
2047
2055
  ]
2048
2056
  }
@@ -2058,17 +2066,17 @@ function Pi({
2058
2066
  N ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2059
2067
  ),
2060
2068
  children: [
2061
- /* @__PURE__ */ r(ra, { className: "h-3.5 w-3.5" }),
2062
- N ? `Group: ${((Vr = Pr.find((e) => e.value === N)) == null ? void 0 : Vr.label) ?? N}` : "Group"
2069
+ /* @__PURE__ */ r(aa, { className: "h-3.5 w-3.5" }),
2070
+ N ? `Group: ${((Gr = Kr.find((e) => e.value === N)) == null ? void 0 : Gr.label) ?? N}` : "Group"
2063
2071
  ]
2064
2072
  }
2065
2073
  ) }),
2066
- /* @__PURE__ */ r(Ze, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(da, { children: [
2067
- /* @__PURE__ */ r(ls, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2068
- /* @__PURE__ */ d(ua, { children: [
2069
- /* @__PURE__ */ r(os, { children: "No attribute found." }),
2074
+ /* @__PURE__ */ r(Ze, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(ua, { children: [
2075
+ /* @__PURE__ */ r(ss, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2076
+ /* @__PURE__ */ d(ma, { children: [
2077
+ /* @__PURE__ */ r(is, { children: "No attribute found." }),
2070
2078
  /* @__PURE__ */ r(kt, { value: "__none__", onSelect: () => et(null), children: "None" }),
2071
- Pr.map((e) => /* @__PURE__ */ r(
2079
+ Kr.map((e) => /* @__PURE__ */ r(
2072
2080
  kt,
2073
2081
  {
2074
2082
  value: e.label,
@@ -2085,14 +2093,14 @@ function Pi({
2085
2093
  {
2086
2094
  type: "button",
2087
2095
  onClick: () => {
2088
- Le(I === "-priority" ? "" : "-priority"), E(1);
2096
+ Le(I === "-priority" ? "" : "-priority"), L(1);
2089
2097
  },
2090
2098
  className: C(
2091
2099
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2092
2100
  I === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2093
2101
  ),
2094
2102
  children: [
2095
- /* @__PURE__ */ r(Ml, { className: "h-3.5 w-3.5" }),
2103
+ /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5" }),
2096
2104
  "Priority"
2097
2105
  ]
2098
2106
  }
@@ -2101,7 +2109,7 @@ function Pi({
2101
2109
  "button",
2102
2110
  {
2103
2111
  type: "button",
2104
- onClick: () => Ht(
2112
+ onClick: () => Jt(
2105
2113
  he.size > 0 ? /* @__PURE__ */ new Set() : new Set(Z.map((e) => e.key))
2106
2114
  ),
2107
2115
  className: "flex h-8 items-center rounded-md px-2 text-[12px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
@@ -2118,15 +2126,15 @@ function Pi({
2118
2126
  tt ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2119
2127
  ),
2120
2128
  children: [
2121
- /* @__PURE__ */ r(ra, { className: "h-3.5 w-3.5" }),
2129
+ /* @__PURE__ */ r(aa, { className: "h-3.5 w-3.5" }),
2122
2130
  tt ? `Lanes: ${tt === "collection" ? "Collection" : "Owner"}` : "Lanes"
2123
2131
  ]
2124
2132
  }
2125
2133
  ) }),
2126
- /* @__PURE__ */ r(Ze, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(da, { children: /* @__PURE__ */ d(ua, { children: [
2127
- /* @__PURE__ */ r(kt, { value: "none", onSelect: () => Jt(null), children: "None" }),
2128
- /* @__PURE__ */ r(kt, { value: "collection", onSelect: () => Jt("collection"), children: "Collection" }),
2129
- /* @__PURE__ */ r(kt, { value: "owner", onSelect: () => Jt("owners"), children: "Owner" })
2134
+ /* @__PURE__ */ r(Ze, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(ua, { children: /* @__PURE__ */ d(ma, { children: [
2135
+ /* @__PURE__ */ r(kt, { value: "none", onSelect: () => Yt(null), children: "None" }),
2136
+ /* @__PURE__ */ r(kt, { value: "collection", onSelect: () => Yt("collection"), children: "Collection" }),
2137
+ /* @__PURE__ */ r(kt, { value: "owner", onSelect: () => Yt("owners"), children: "Owner" })
2130
2138
  ] }) }) })
2131
2139
  ] }),
2132
2140
  U && s && /* @__PURE__ */ d(
@@ -2138,7 +2146,7 @@ function Pi({
2138
2146
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2139
2147
  "data-queue-ask": !0,
2140
2148
  children: [
2141
- /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2149
+ /* @__PURE__ */ r(Bl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2142
2150
  "Ask about this queue"
2143
2151
  ]
2144
2152
  }
@@ -2147,7 +2155,7 @@ function Pi({
2147
2155
  "button",
2148
2156
  {
2149
2157
  type: "button",
2150
- onClick: () => Sa((e) => !e),
2158
+ onClick: () => Ca((e) => !e),
2151
2159
  "aria-expanded": rt,
2152
2160
  title: "Trends, aging, pace and states",
2153
2161
  className: C(
@@ -2168,31 +2176,31 @@ function Pi({
2168
2176
  type: "button",
2169
2177
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2170
2178
  children: [
2171
- /* @__PURE__ */ r(Bl, { className: "h-3.5 w-3.5" }),
2179
+ /* @__PURE__ */ r(Ul, { className: "h-3.5 w-3.5" }),
2172
2180
  "Columns"
2173
2181
  ]
2174
2182
  }
2175
2183
  ) }),
2176
2184
  /* @__PURE__ */ r(Ze, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
2177
- ql,
2185
+ Fl,
2178
2186
  {
2179
- sensors: fl,
2180
- collisionDetection: Fl,
2181
- onDragEnd: gl,
2187
+ sensors: gl,
2188
+ collisionDetection: Tl,
2189
+ onDragEnd: xl,
2182
2190
  children: /* @__PURE__ */ r(
2183
- Tl,
2191
+ Rl,
2184
2192
  {
2185
2193
  items: We,
2186
- strategy: Rl,
2194
+ strategy: Al,
2187
2195
  children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: We.map((e) => {
2188
- const t = Lr.find((n) => n.key === e);
2196
+ const t = Dr.find((n) => n.key === e);
2189
2197
  return /* @__PURE__ */ r(
2190
- Ns,
2198
+ $s,
2191
2199
  {
2192
2200
  id: e,
2193
2201
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2194
2202
  checked: te.has(e),
2195
- onCheckedChange: () => _l(e)
2203
+ onCheckedChange: () => Nl(e)
2196
2204
  },
2197
2205
  e
2198
2206
  );
@@ -2208,7 +2216,7 @@ function Pi({
2208
2216
  type: "button",
2209
2217
  onClick: () => {
2210
2218
  const e = _t === "compact" ? "comfortable" : "compact";
2211
- ba(e);
2219
+ pa(e);
2212
2220
  try {
2213
2221
  localStorage.setItem("nvr_table_density", e);
2214
2222
  } catch {
@@ -2217,32 +2225,32 @@ function Pi({
2217
2225
  "aria-label": "Row density",
2218
2226
  title: _t === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2219
2227
  className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
2220
- children: _t === "compact" ? /* @__PURE__ */ r(Ul, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Il, { className: "h-3.5 w-3.5" })
2228
+ children: _t === "compact" ? /* @__PURE__ */ r(Il, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Vl, { className: "h-3.5 w-3.5" })
2221
2229
  }
2222
2230
  ),
2223
- A === "table" && xa && ee.length > 0 && /* @__PURE__ */ d(
2231
+ A === "table" && ya && ee.length > 0 && /* @__PURE__ */ d(
2224
2232
  "button",
2225
2233
  {
2226
2234
  type: "button",
2227
- onClick: () => yr(),
2235
+ onClick: () => kr(),
2228
2236
  className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
2229
2237
  children: [
2230
- /* @__PURE__ */ r(Vl, { className: "h-3 w-3 fill-current" }),
2238
+ /* @__PURE__ */ r(Gl, { className: "h-3 w-3 fill-current" }),
2231
2239
  "Work Next"
2232
2240
  ]
2233
2241
  }
2234
2242
  ),
2235
- !nn && z.length === 1 && (Ft ? /* @__PURE__ */ d(ze, { children: [
2243
+ !rn && z.length === 1 && (Ft ? /* @__PURE__ */ d(ze, { children: [
2236
2244
  /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2237
2245
  "button",
2238
2246
  {
2239
2247
  type: "button",
2240
2248
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2241
2249
  children: [
2242
- /* @__PURE__ */ r(Gt, { className: "h-3.5 w-3.5" }),
2250
+ /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2243
2251
  "New ",
2244
- Rn(z[0]),
2245
- /* @__PURE__ */ r(aa, { className: "h-3 w-3 opacity-60" })
2252
+ An(z[0]),
2253
+ /* @__PURE__ */ r(la, { className: "h-3 w-3 opacity-60" })
2246
2254
  ]
2247
2255
  }
2248
2256
  ) }),
@@ -2259,7 +2267,7 @@ function Pi({
2259
2267
  }),
2260
2268
  className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2261
2269
  children: [
2262
- ((Gr = Ft.active) == null ? void 0 : Gr.create_label) ?? ((Wr = Ft.active) == null ? void 0 : Wr.name) ?? "Default layout",
2270
+ ((Wr = Ft.active) == null ? void 0 : Wr.create_label) ?? ((Hr = Ft.active) == null ? void 0 : Hr.name) ?? "Default layout",
2263
2271
  /* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2264
2272
  ]
2265
2273
  }
@@ -2292,22 +2300,22 @@ function Pi({
2292
2300
  }),
2293
2301
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2294
2302
  children: [
2295
- /* @__PURE__ */ r(Gt, { className: "h-3.5 w-3.5" }),
2303
+ /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2296
2304
  "New ",
2297
- Rn(z[0])
2305
+ An(z[0])
2298
2306
  ]
2299
2307
  }
2300
2308
  )),
2301
- !nn && z.length > 1 && /* @__PURE__ */ d(ze, { children: [
2309
+ !rn && z.length > 1 && /* @__PURE__ */ d(ze, { children: [
2302
2310
  /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2303
2311
  "button",
2304
2312
  {
2305
2313
  type: "button",
2306
2314
  className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2307
2315
  children: [
2308
- /* @__PURE__ */ r(Gt, { className: "h-3.5 w-3.5" }),
2316
+ /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2309
2317
  "New",
2310
- /* @__PURE__ */ r(aa, { className: "h-3 w-3 opacity-60" })
2318
+ /* @__PURE__ */ r(la, { className: "h-3 w-3 opacity-60" })
2311
2319
  ]
2312
2320
  }
2313
2321
  ) }),
@@ -2322,15 +2330,15 @@ function Pi({
2322
2330
  }),
2323
2331
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2324
2332
  children: [
2325
- /* @__PURE__ */ r(Gt, { className: "h-3 w-3 opacity-60" }),
2326
- Rn(e)
2333
+ /* @__PURE__ */ r(Wt, { className: "h-3 w-3 opacity-60" }),
2334
+ An(e)
2327
2335
  ]
2328
2336
  },
2329
2337
  e
2330
2338
  )) })
2331
2339
  ] }),
2332
- !nn && Pe && pe && /* @__PURE__ */ r(
2333
- Wo,
2340
+ !rn && Pe && pe && /* @__PURE__ */ r(
2341
+ Ho,
2334
2342
  {
2335
2343
  collection: Pe,
2336
2344
  onParsed: (e, t) => pe(`/collections/${Pe}/new`, {
@@ -2355,10 +2363,10 @@ function Pi({
2355
2363
  label: "Total",
2356
2364
  count: (x == null ? void 0 : x.total) ?? 0,
2357
2365
  filteredCount: Y ? Y.total : null,
2358
- active: Object.values(w).every(_a) && g === "all",
2359
- isLoading: je,
2366
+ active: Object.values(w).every(Na) && g === "all",
2367
+ isLoading: Be,
2360
2368
  ...ot("total"),
2361
- onClick: Na
2369
+ onClick: Sa
2362
2370
  }
2363
2371
  ),
2364
2372
  /* @__PURE__ */ r(
@@ -2369,7 +2377,7 @@ function Pi({
2369
2377
  filteredCount: Y ? Y.sla_warning : null,
2370
2378
  tone: "amber",
2371
2379
  active: w.sla_status === "warning",
2372
- isLoading: je,
2380
+ isLoading: Be,
2373
2381
  deltaBadIsUp: !0,
2374
2382
  ...ot("sla_warning"),
2375
2383
  onClick: () => Me("sla_status", "warning")
@@ -2383,7 +2391,7 @@ function Pi({
2383
2391
  filteredCount: Y ? Y.sla_breached : null,
2384
2392
  tone: "red",
2385
2393
  active: w.sla_status === "breached",
2386
- isLoading: je,
2394
+ isLoading: Be,
2387
2395
  deltaBadIsUp: !0,
2388
2396
  ...ot("sla_breached"),
2389
2397
  onClick: () => Me("sla_status", "breached")
@@ -2397,7 +2405,7 @@ function Pi({
2397
2405
  filteredCount: Y ? Y.at_risk : null,
2398
2406
  tone: "red",
2399
2407
  active: w.at_risk === "yes",
2400
- isLoading: je,
2408
+ isLoading: Be,
2401
2409
  deltaBadIsUp: !0,
2402
2410
  ...ot("at_risk"),
2403
2411
  onClick: () => Me("at_risk", "yes")
@@ -2410,11 +2418,11 @@ function Pi({
2410
2418
  count: (x == null ? void 0 : x.unowned) ?? 0,
2411
2419
  filteredCount: Y ? Y.unowned : null,
2412
2420
  active: g === "unowned",
2413
- isLoading: je,
2421
+ isLoading: Be,
2414
2422
  deltaBadIsUp: !0,
2415
2423
  ...ot("unowned"),
2416
2424
  onClick: () => {
2417
- J(g === "unowned" ? "all" : "unowned"), E(1);
2425
+ J(g === "unowned" ? "all" : "unowned"), L(1);
2418
2426
  }
2419
2427
  }
2420
2428
  )
@@ -2429,10 +2437,10 @@ function Pi({
2429
2437
  {
2430
2438
  type: "button",
2431
2439
  onClick: () => {
2432
- P((a) => ({
2440
+ K((a) => ({
2433
2441
  ...a,
2434
2442
  aging_hours: a.aging_hours === t ? "" : t
2435
- })), E(1);
2443
+ })), L(1);
2436
2444
  },
2437
2445
  className: C(
2438
2446
  "rounded-md border px-2 py-1 tabular-nums transition-colors",
@@ -2468,17 +2476,17 @@ function Pi({
2468
2476
  ] }) : /* @__PURE__ */ r(we, { children: "→ Holding steady" })
2469
2477
  }
2470
2478
  ),
2471
- gr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: gr.map(([e, t]) => {
2479
+ xr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: xr.map(([e, t]) => {
2472
2480
  var n;
2473
2481
  return /* @__PURE__ */ r(
2474
- _s,
2482
+ Cs,
2475
2483
  {
2476
2484
  label: Fe(e),
2477
2485
  count: t,
2478
2486
  filteredCount: Y ? Y.by_state[e] ?? 0 : null,
2479
2487
  color: ((n = xe[e]) == null ? void 0 : n.color) ?? null,
2480
- active: wa.includes(e),
2481
- onClick: () => va(e)
2488
+ active: _a.includes(e),
2489
+ onClick: () => wa(e)
2482
2490
  },
2483
2491
  e
2484
2492
  );
@@ -2487,18 +2495,18 @@ function Pi({
2487
2495
  }
2488
2496
  ),
2489
2497
  A !== "workload" && /* @__PURE__ */ r(
2490
- ps,
2498
+ hs,
2491
2499
  {
2492
- defs: vl,
2500
+ defs: wl,
2493
2501
  values: w,
2494
2502
  seededKeys: ft,
2495
2503
  onApply: (e) => {
2496
- P((t) => ({ ...t, ...e })), E(1);
2504
+ K((t) => ({ ...t, ...e })), L(1);
2497
2505
  },
2498
2506
  onClear: () => {
2499
- P({ ...oe.current }), E(1);
2507
+ K({ ...oe.current }), L(1);
2500
2508
  },
2501
- right: wl
2509
+ right: _l
2502
2510
  }
2503
2511
  ),
2504
2512
  /* @__PURE__ */ d(
@@ -2514,7 +2522,7 @@ function Pi({
2514
2522
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.06] px-2.5 text-[12px] text-slate-700 dark:text-slate-200",
2515
2523
  children: [
2516
2524
  "Your default ",
2517
- er(Mr),
2525
+ tr(Qr),
2518
2526
  " filter is hiding",
2519
2527
  " ",
2520
2528
  ie.toLocaleString("en-US"),
@@ -2525,7 +2533,7 @@ function Pi({
2525
2533
  "button",
2526
2534
  {
2527
2535
  type: "button",
2528
- onClick: tr,
2536
+ onClick: nr,
2529
2537
  className: "font-medium text-[#0284a8] underline-offset-2 hover:underline dark:text-nvr-cyan",
2530
2538
  children: "Show all"
2531
2539
  }
@@ -2556,10 +2564,10 @@ function Pi({
2556
2564
  "aria-label": "Clear the owner filter",
2557
2565
  "data-queue-owner-filter-clear": !0,
2558
2566
  onClick: () => {
2559
- P((e) => {
2567
+ K((e) => {
2560
2568
  const { owners: t, ...n } = e;
2561
2569
  return n;
2562
- }), E(1);
2570
+ }), L(1);
2563
2571
  },
2564
2572
  className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
2565
2573
  children: "✕"
@@ -2572,7 +2580,7 @@ function Pi({
2572
2580
  "button",
2573
2581
  {
2574
2582
  type: "button",
2575
- onClick: el,
2583
+ onClick: tl,
2576
2584
  title: "Revert to the queue default (filters, columns and sort cleared)",
2577
2585
  className: C(
2578
2586
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
@@ -2596,13 +2604,13 @@ function Pi({
2596
2604
  {
2597
2605
  type: "button",
2598
2606
  title: Ie === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2599
- onClick: () => rl.mutate(Ie === e.id ? null : e.id),
2607
+ onClick: () => al.mutate(Ie === e.id ? null : e.id),
2600
2608
  className: C(
2601
2609
  "shrink-0",
2602
2610
  Ie === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2603
2611
  ),
2604
2612
  children: /* @__PURE__ */ r(
2605
- Gl,
2613
+ Wl,
2606
2614
  {
2607
2615
  className: C("h-3 w-3", Ie === e.id && "fill-current"),
2608
2616
  "aria-label": Ie === e.id ? "Default view" : "Set as default"
@@ -2610,25 +2618,25 @@ function Pi({
2610
2618
  )
2611
2619
  }
2612
2620
  ),
2613
- /* @__PURE__ */ d("button", { type: "button", onClick: () => Mt(e), children: [
2621
+ /* @__PURE__ */ d("button", { type: "button", onClick: () => Qt(e), children: [
2614
2622
  e.name,
2615
2623
  e.is_default ? /* @__PURE__ */ r("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-400", children: "· shared" })
2616
2624
  ] }),
2617
- Nr && /* @__PURE__ */ r(
2625
+ Sr && /* @__PURE__ */ r(
2618
2626
  "button",
2619
2627
  {
2620
2628
  type: "button",
2621
- onClick: () => tl.mutate({ viewId: e.id, on: !e.is_default }),
2629
+ onClick: () => nl.mutate({ viewId: e.id, on: !e.is_default }),
2622
2630
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2623
2631
  className: C(
2624
2632
  "shrink-0",
2625
2633
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2626
2634
  ),
2627
2635
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2628
- children: /* @__PURE__ */ r(Wl, { className: C("h-3 w-3", e.is_default && "fill-current") })
2636
+ children: /* @__PURE__ */ r(Hl, { className: C("h-3 w-3", e.is_default && "fill-current") })
2629
2637
  }
2630
2638
  ),
2631
- (e.user === v || Bt) && ut === e.id && /* @__PURE__ */ r(
2639
+ (e.user === v || Ut) && ut === e.id && /* @__PURE__ */ r(
2632
2640
  "button",
2633
2641
  {
2634
2642
  type: "button",
@@ -2637,35 +2645,35 @@ function Pi({
2637
2645
  title: "Update this view with the current filters, scope and sort",
2638
2646
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2639
2647
  "aria-label": `Update view ${e.name}`,
2640
- "data-view-update-state": Re.isPending ? "saving" : Cr === e.id ? "saved" : "idle",
2641
- children: Re.isPending && ((t = Re.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Hl, { className: "h-3 w-3 animate-spin" }) : Cr === e.id ? /* @__PURE__ */ r(
2642
- Jl,
2648
+ "data-view-update-state": Re.isPending ? "saving" : $r === e.id ? "saved" : "idle",
2649
+ children: Re.isPending && ((t = Re.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Jl, { className: "h-3 w-3 animate-spin" }) : $r === e.id ? /* @__PURE__ */ r(
2650
+ Yl,
2643
2651
  {
2644
2652
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
2645
2653
  strokeWidth: 3
2646
2654
  }
2647
- ) : /* @__PURE__ */ r(Yl, { className: "h-3 w-3" })
2655
+ ) : /* @__PURE__ */ r(zl, { className: "h-3 w-3" })
2648
2656
  }
2649
2657
  ),
2650
2658
  ut === e.id && /* @__PURE__ */ r(
2651
2659
  "button",
2652
2660
  {
2653
2661
  type: "button",
2654
- onClick: () => $a(e.id),
2662
+ onClick: () => qa(e.id),
2655
2663
  title: Tt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2656
2664
  className: C(
2657
2665
  "shrink-0",
2658
2666
  Tt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2659
2667
  ),
2660
2668
  "aria-label": `Subscribe to view ${e.name}`,
2661
- children: /* @__PURE__ */ r(zl, { className: C("h-3 w-3", Tt(e.id) && "fill-current") })
2669
+ children: /* @__PURE__ */ r(Xl, { className: C("h-3 w-3", Tt(e.id) && "fill-current") })
2662
2670
  }
2663
2671
  ),
2664
2672
  e.user === v && /* @__PURE__ */ r(
2665
2673
  "button",
2666
2674
  {
2667
2675
  type: "button",
2668
- onClick: () => nl.mutate(e.id),
2676
+ onClick: () => rl.mutate(e.id),
2669
2677
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2670
2678
  "aria-label": `Delete view ${e.name}`,
2671
2679
  children: "×"
@@ -2676,7 +2684,7 @@ function Pi({
2676
2684
  e.id
2677
2685
  );
2678
2686
  }),
2679
- /* @__PURE__ */ d(ze, { open: Za, onOpenChange: _n, children: [
2687
+ /* @__PURE__ */ d(ze, { open: el, onOpenChange: Nn, children: [
2680
2688
  /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ r(
2681
2689
  "button",
2682
2690
  {
@@ -2689,13 +2697,13 @@ function Pi({
2689
2697
  /* @__PURE__ */ d(Ze, { className: "w-[240px] p-3", align: "end", children: [
2690
2698
  (() => {
2691
2699
  const e = V == null ? void 0 : V.data.find((t) => t.id === ut);
2692
- return !e || e.user !== v && !Bt ? null : /* @__PURE__ */ d(
2700
+ return !e || e.user !== v && !Ut ? null : /* @__PURE__ */ d(
2693
2701
  "button",
2694
2702
  {
2695
2703
  type: "button",
2696
2704
  disabled: Re.isPending,
2697
2705
  onClick: () => {
2698
- Re.mutate(e), _n(!1);
2706
+ Re.mutate(e), Nn(!1);
2699
2707
  },
2700
2708
  className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
2701
2709
  children: [
@@ -2709,29 +2717,29 @@ function Pi({
2709
2717
  /* @__PURE__ */ r(
2710
2718
  "input",
2711
2719
  {
2712
- value: Nn,
2713
- onChange: (e) => kr(e.target.value),
2720
+ value: Sn,
2721
+ onChange: (e) => vr(e.target.value),
2714
2722
  placeholder: "View name",
2715
2723
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
2716
2724
  }
2717
2725
  ),
2718
2726
  /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2719
2727
  /* @__PURE__ */ r(
2720
- On,
2728
+ En,
2721
2729
  {
2722
- checked: vr || bt,
2730
+ checked: wr || bt,
2723
2731
  disabled: bt,
2724
- onCheckedChange: (e) => wr(e === !0)
2732
+ onCheckedChange: (e) => _r(e === !0)
2725
2733
  }
2726
2734
  ),
2727
2735
  "Share with everyone"
2728
2736
  ] }),
2729
- Nr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2737
+ Sr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2730
2738
  /* @__PURE__ */ r(
2731
- On,
2739
+ En,
2732
2740
  {
2733
2741
  checked: bt,
2734
- onCheckedChange: (e) => _r(e === !0)
2742
+ onCheckedChange: (e) => Nr(e === !0)
2735
2743
  }
2736
2744
  ),
2737
2745
  "Set as queue default (everyone starts here)"
@@ -2740,8 +2748,8 @@ function Pi({
2740
2748
  "button",
2741
2749
  {
2742
2750
  type: "button",
2743
- disabled: !Nn.trim() || Sr.isPending,
2744
- onClick: () => Sr.mutate(),
2751
+ disabled: !Sn.trim() || Cr.isPending,
2752
+ onClick: () => Cr.mutate(),
2745
2753
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
2746
2754
  children: "Save current view"
2747
2755
  }
@@ -2752,66 +2760,66 @@ function Pi({
2752
2760
  }
2753
2761
  )
2754
2762
  ] }),
2755
- /* @__PURE__ */ d("div", { ref: Qt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2756
- zn && /* @__PURE__ */ r(ds, { error: Aa, onRetry: () => void Oa(), className: "mb-3" }),
2763
+ /* @__PURE__ */ d("div", { ref: Bt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2764
+ Xn && /* @__PURE__ */ r(Zo, { error: Oa, onRetry: () => void Ea(), className: "mb-3" }),
2757
2765
  A === "table" ? /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2758
2766
  "div",
2759
2767
  {
2760
2768
  ref: Ne.rootRef,
2761
2769
  className: C(
2762
2770
  "relative min-w-0 flex-1 transition-opacity duration-200",
2763
- nr && "pointer-events-none opacity-60"
2771
+ rr && "pointer-events-none opacity-60"
2764
2772
  ),
2765
- "aria-busy": nr || void 0,
2773
+ "aria-busy": rr || void 0,
2766
2774
  children: [
2767
- rr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2775
+ ar != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2768
2776
  "Still working — ",
2769
- rr,
2777
+ ar,
2770
2778
  "s"
2771
2779
  ] }),
2772
2780
  /* @__PURE__ */ r(
2773
- Bo,
2781
+ Uo,
2774
2782
  {
2775
2783
  fillHeight: !0,
2776
- enterKey: sr.current,
2784
+ enterKey: ir.current,
2777
2785
  density: _t,
2778
2786
  minBodyHeight: 360,
2779
- columns: It,
2787
+ columns: Vt,
2780
2788
  rows: S,
2781
2789
  rowKey: (e) => `${e.collection}:${e.item_id}`,
2782
2790
  total: (i == null ? void 0 : i.total) ?? 0,
2783
2791
  page: _e,
2784
- limit: tn,
2785
- isLoading: je,
2786
- onPageChange: E,
2787
- onRowClick: (e) => Kt(e),
2792
+ limit: nn,
2793
+ isLoading: Be,
2794
+ onPageChange: L,
2795
+ onRowClick: (e) => Mt(e),
2788
2796
  rowDragProps: (e) => ja({ collection: e.collection, id: e.item_id }),
2789
2797
  onRowContextMenu: (e, t) => {
2790
2798
  t.preventDefault(), dt({ x: t.clientX, y: t.clientY, row: e });
2791
2799
  },
2792
2800
  rowTitle: (e) => {
2793
- const t = Lt.get(D(e));
2794
- return Ne.titleFor(D(e)) ?? (t && !t.is_mine ? xo(t) : void 0);
2801
+ const t = Dt.get(P(e));
2802
+ return Ne.titleFor(P(e)) ?? (t && !t.is_mine ? yo(t) : void 0);
2795
2803
  },
2796
- rowClassName: (e) => Dt === D(e) ? (
2804
+ rowClassName: (e) => Pt === P(e) ? (
2797
2805
  // Pinned sticky cells use bg-inherit — the highlight must be
2798
2806
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
2799
2807
  // scrolled content bleeds through the pinned columns. Same
2800
2808
  // pair DataTable uses for selected rows when pins are active.
2801
2809
  "bg-[#f2fdff] dark:bg-[#20303a]"
2802
- ) : e.at_risk ? $o(e.at_risk_color ?? "red") : void 0,
2803
- emptyMessage: zn ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
2804
- Uo,
2810
+ ) : e.at_risk ? qo(e.at_risk_color ?? "red") : void 0,
2811
+ emptyMessage: Xn ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
2812
+ Io,
2805
2813
  {
2806
- icon: Xl,
2807
- title: ((Hr = i == null ? void 0 : i.empty) == null ? void 0 : Hr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Jr = i == null ? void 0 : i.empty) == null ? void 0 : Jr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Yr = i == null ? void 0 : i.empty) == null ? void 0 : Yr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2808
- detail: ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "filters" && ie > 0 ? `Your default ${er(Mr)} filter is hiding ${ie.toLocaleString("en-US")} item${ie === 1 ? "" : "s"} here.` : ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((Zr = i == null ? void 0 : i.empty) == null ? void 0 : Zr.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2809
- action: ((ea = i == null ? void 0 : i.empty) == null ? void 0 : ea.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2814
+ icon: Zl,
2815
+ title: ((Jr = i == null ? void 0 : i.empty) == null ? void 0 : Jr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Yr = i == null ? void 0 : i.empty) == null ? void 0 : Yr.reason) === "scope_mine" ? "Nothing waiting on you" : ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2816
+ detail: ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.reason) === "filters" && ie > 0 ? `Your default ${tr(Qr)} filter is hiding ${ie.toLocaleString("en-US")} item${ie === 1 ? "" : "s"} here.` : ((Zr = i == null ? void 0 : i.empty) == null ? void 0 : Zr.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((ea = i == null ? void 0 : i.empty) == null ? void 0 : ea.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2817
+ action: ((ta = i == null ? void 0 : i.empty) == null ? void 0 : ta.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2810
2818
  ie > 0 && /* @__PURE__ */ d(
2811
2819
  "button",
2812
2820
  {
2813
2821
  type: "button",
2814
- onClick: tr,
2822
+ onClick: nr,
2815
2823
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-white hover:brightness-105",
2816
2824
  "data-queue-empty-defaults": !0,
2817
2825
  children: [
@@ -2829,7 +2837,7 @@ function Pi({
2829
2837
  const e = {};
2830
2838
  for (const [n, a] of Object.entries(oe.current))
2831
2839
  (t = Se[n.slice(6)]) != null && t.length && (e[n] = a);
2832
- P(e), E(1);
2840
+ K(e), L(1);
2833
2841
  },
2834
2842
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2835
2843
  "data-queue-empty-clear": !0,
@@ -2841,7 +2849,7 @@ function Pi({
2841
2849
  {
2842
2850
  type: "button",
2843
2851
  onClick: () => {
2844
- J("all"), E(1);
2852
+ J("all"), L(1);
2845
2853
  },
2846
2854
  className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2847
2855
  "data-queue-empty-all": !0,
@@ -2853,40 +2861,40 @@ function Pi({
2853
2861
  ),
2854
2862
  sort: I,
2855
2863
  onSortChange: (e) => {
2856
- Le(e), E(1);
2864
+ Le(e), L(1);
2857
2865
  },
2858
- filterDefs: Fn,
2866
+ filterDefs: Tn,
2859
2867
  filterValues: w,
2860
2868
  onFilterChange: (e, t) => {
2861
- P((n) => ({ ...n, [e]: t })), E(1);
2869
+ K((n) => ({ ...n, [e]: t })), L(1);
2862
2870
  },
2863
- rowGroups: ll ?? void 0,
2871
+ rowGroups: ol ?? void 0,
2864
2872
  collapsedGroups: he,
2865
- onToggleGroup: Ya,
2866
- selectedIds: rn ? Ae : void 0,
2867
- onSelectionChange: rn ? Ut : void 0,
2873
+ onToggleGroup: za,
2874
+ selectedIds: an ? Ae : void 0,
2875
+ onSelectionChange: an ? It : void 0,
2868
2876
  hideFilterRow: !0,
2869
2877
  nowrapCells: !0,
2870
- columnPins: Dr,
2878
+ columnPins: Pr,
2871
2879
  onColumnPinChange: (e, t) => {
2872
- Yt((n) => {
2873
- const a = { ...n ?? Dr };
2880
+ zt((n) => {
2881
+ const a = { ...n ?? Pr };
2874
2882
  return t ? a[e] = t : delete a[e], a;
2875
2883
  });
2876
2884
  },
2877
2885
  columnFilterRow: !0,
2878
2886
  hScrollProxy: !0,
2879
2887
  footer: /* @__PURE__ */ r(
2880
- ts,
2888
+ rs,
2881
2889
  {
2882
2890
  collections: st,
2883
2891
  selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
2884
2892
  onToggle: (e) => {
2885
2893
  const t = e.ids.join(",");
2886
- P((n) => ({
2894
+ K((n) => ({
2887
2895
  ...n,
2888
2896
  at_risk_rule: n.at_risk_rule === t ? "" : t
2889
- })), E(1);
2897
+ })), L(1);
2890
2898
  },
2891
2899
  className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
2892
2900
  }
@@ -2896,37 +2904,37 @@ function Pi({
2896
2904
  ]
2897
2905
  }
2898
2906
  ) }) }) : A === "kanban" ? /* @__PURE__ */ r(
2899
- bs,
2907
+ ps,
2900
2908
  {
2901
2909
  items: S,
2902
- onCardClick: (e) => Kt(e),
2903
- onDrop: (e, t) => Pa.mutate({ item: e, targetState: t }),
2910
+ onCardClick: (e) => Mt(e),
2911
+ onDrop: (e, t) => Ka.mutate({ item: e, targetState: t }),
2904
2912
  onClaim: (e) => qe.mutate(e),
2905
- onRelease: (e) => Be.mutate(e),
2913
+ onRelease: (e) => je.mutate(e),
2906
2914
  swimlaneBy: tt,
2907
- stateLabels: yn,
2915
+ stateLabels: kn,
2908
2916
  laneLabel: tt === "collection" ? it : void 0,
2909
2917
  claimsEnabled: se,
2910
2918
  onDraggingChange: (e) => {
2911
- Mn.current = e;
2919
+ Qn.current = e;
2912
2920
  }
2913
2921
  }
2914
- ) : /* @__PURE__ */ r(hs, { queueId: l })
2922
+ ) : /* @__PURE__ */ r(fs, { queueId: l })
2915
2923
  ] }),
2916
- rn && /* @__PURE__ */ d(
2917
- us,
2924
+ an && /* @__PURE__ */ d(
2925
+ ms,
2918
2926
  {
2919
2927
  count: Ae.length,
2920
2928
  claimsEnabled: se,
2921
- showClaim: an("claim"),
2922
- showRelease: an("release"),
2923
- showTransition: an("transition"),
2924
- states: xr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2929
+ showClaim: ln("claim"),
2930
+ showRelease: ln("release"),
2931
+ showTransition: ln("transition"),
2932
+ states: yr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2925
2933
  value: e,
2926
2934
  label: Fe(e)
2927
2935
  })),
2928
- busy: qr,
2929
- onClaim: () => Sn(
2936
+ busy: Fr,
2937
+ onClaim: () => Cn(
2930
2938
  "Claim",
2931
2939
  (e) => p.request(
2932
2940
  ne(`/queues/${l}/claim`, {
@@ -2935,7 +2943,7 @@ function Pi({
2935
2943
  })
2936
2944
  )
2937
2945
  ),
2938
- onRelease: () => Sn(
2946
+ onRelease: () => Cn(
2939
2947
  "Release",
2940
2948
  (e) => p.request(
2941
2949
  ne(`/queues/${l}/release`, {
@@ -2944,34 +2952,34 @@ function Pi({
2944
2952
  })
2945
2953
  )
2946
2954
  ),
2947
- onTransition: (e) => Sn("Transition", (t) => ar(t, e)),
2948
- onClear: () => Ut([]),
2955
+ onTransition: (e) => Cn("Transition", (t) => lr(t, e)),
2956
+ onClear: () => It([]),
2949
2957
  children: [
2950
2958
  Ae.length >= 2 && /* @__PURE__ */ r(
2951
2959
  "button",
2952
2960
  {
2953
2961
  type: "button",
2954
2962
  onClick: () => {
2955
- const e = ko(
2956
- S.filter((t) => Ae.includes(D(t)) && t.collection !== "tasks").map((t) => W.urlFor(wn(t)))
2963
+ const e = vo(
2964
+ S.filter((t) => Ae.includes(P(t)) && t.collection !== "tasks").map((t) => W.urlFor(_n(t)))
2957
2965
  );
2958
- e.blocked > 0 || e.capped > 0 ? R.warning(ia(e)) : R.success(ia(e));
2966
+ e.blocked > 0 || e.capped > 0 ? R.warning(ca(e)) : R.success(ca(e));
2959
2967
  },
2960
2968
  "data-bulk-open-tabs": !0,
2961
- title: `Open the selected records in new tabs (up to ${yo})`,
2969
+ title: `Open the selected records in new tabs (up to ${ko})`,
2962
2970
  className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
2963
2971
  children: "Open in tabs"
2964
2972
  }
2965
2973
  ),
2966
2974
  /* @__PURE__ */ r(
2967
- Mo,
2975
+ Qo,
2968
2976
  {
2969
- targets: S.filter((e) => Ae.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2977
+ targets: S.filter((e) => Ae.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2970
2978
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
2971
2979
  tone: "light",
2972
- disabled: qr,
2980
+ disabled: Fr,
2973
2981
  onDone: (e) => {
2974
- e.failed === 0 && Ut([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
2982
+ e.failed === 0 && It([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
2975
2983
  }
2976
2984
  }
2977
2985
  )
@@ -2979,7 +2987,7 @@ function Pi({
2979
2987
  }
2980
2988
  ),
2981
2989
  X != null && X.length ? /* @__PURE__ */ r(
2982
- es,
2990
+ ns,
2983
2991
  {
2984
2992
  collection: X[0].collection,
2985
2993
  itemId: X[0].itemId,
@@ -2993,14 +3001,14 @@ function Pi({
2993
3001
  onClose: () => ht.back(X.length)
2994
3002
  }
2995
3003
  ) : null,
2996
- K && la(
3004
+ M && oa(
2997
3005
  /* @__PURE__ */ d(
2998
3006
  "div",
2999
3007
  {
3000
3008
  style: {
3001
3009
  position: "fixed",
3002
- left: Math.min(K.x, window.innerWidth - 200),
3003
- top: Math.min(K.y, window.innerHeight - 260),
3010
+ left: Math.min(M.x, window.innerWidth - 200),
3011
+ top: Math.min(M.y, window.innerHeight - 260),
3004
3012
  zIndex: 125
3005
3013
  },
3006
3014
  className: "w-48 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900",
@@ -3008,20 +3016,20 @@ function Pi({
3008
3016
  "data-queue-row-menu": !0,
3009
3017
  children: [
3010
3018
  [
3011
- { label: "Open", run: () => Kt(K.row) },
3019
+ { label: "Open", run: () => Mt(M.row) },
3012
3020
  {
3013
3021
  label: "Open full record",
3014
- run: () => ct(K.row)
3022
+ run: () => ct(M.row)
3015
3023
  },
3016
- { label: "Peek", run: () => Te(K.row) },
3024
+ { label: "Peek", run: () => Te(M.row) },
3017
3025
  ...se ? [
3018
- ((ta = K.row.claimed_by) == null ? void 0 : ta.id) === v ? { label: "Release claim", run: () => Be.mutate(K.row) } : { label: "Claim", run: () => qe.mutate(K.row) }
3026
+ ((na = M.row.claimed_by) == null ? void 0 : na.id) === v ? { label: "Release claim", run: () => je.mutate(M.row) } : { label: "Claim", run: () => qe.mutate(M.row) }
3019
3027
  ] : [],
3020
3028
  {
3021
3029
  label: "Copy ID",
3022
3030
  run: () => {
3023
3031
  var e;
3024
- return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(K.row.item_id));
3032
+ return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(M.row.item_id));
3025
3033
  }
3026
3034
  },
3027
3035
  {
@@ -3029,14 +3037,14 @@ function Pi({
3029
3037
  run: () => {
3030
3038
  var e;
3031
3039
  return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
3032
- `${window.location.origin}${W.urlFor(wn(K.row))}`
3040
+ `${window.location.origin}${W.urlFor(_n(M.row))}`
3033
3041
  ));
3034
3042
  }
3035
3043
  },
3036
3044
  // Custom actions (#125): the record's registered actions, right here.
3037
- ...Fa(K.row.collection).map((e) => ({
3045
+ ...Ta(M.row.collection).map((e) => ({
3038
3046
  label: e.label,
3039
- run: () => Ta(e, K.row)
3047
+ run: () => Ra(e, M.row)
3040
3048
  }))
3041
3049
  ].map((e) => /* @__PURE__ */ r(
3042
3050
  "button",
@@ -3050,16 +3058,16 @@ function Pi({
3050
3058
  },
3051
3059
  e.label
3052
3060
  )),
3053
- K.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3061
+ M.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3054
3062
  /* @__PURE__ */ r("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
3055
- cn.slice(0, 8).map((e) => {
3056
- const t = (K.row.labels ?? []).includes(e);
3063
+ dn.slice(0, 8).map((e) => {
3064
+ const t = (M.row.labels ?? []).includes(e);
3057
3065
  return /* @__PURE__ */ d(
3058
3066
  "button",
3059
3067
  {
3060
3068
  type: "button",
3061
3069
  onClick: () => {
3062
- Jn(K.row, e), dt(null);
3070
+ Yn(M.row, e), dt(null);
3063
3071
  },
3064
3072
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3065
3073
  children: [
@@ -3083,7 +3091,7 @@ function Pi({
3083
3091
  const n = e.target.elements.namedItem(
3084
3092
  "newlabel"
3085
3093
  ).value.trim();
3086
- n && (Jn(K.row, n), dt(null));
3094
+ n && (Yn(M.row, n), dt(null));
3087
3095
  },
3088
3096
  className: "px-3 py-1",
3089
3097
  children: /* @__PURE__ */ r(
@@ -3104,52 +3112,53 @@ function Pi({
3104
3112
  ),
3105
3113
  document.body
3106
3114
  ),
3107
- Hn && la(
3115
+ Jn && oa(
3108
3116
  /* @__PURE__ */ r(
3109
- Ss,
3117
+ qs,
3110
3118
  {
3111
3119
  queueId: l,
3112
- drill: Hn,
3113
- onClose: () => on(null),
3120
+ drill: Jn,
3121
+ onClose: () => sn(null),
3114
3122
  onOpenRecord: (e, t) => {
3115
- on(null), W.open({ collection: e, itemId: t, layoutSlug: null });
3123
+ sn(null), W.open({ collection: e, itemId: t, layoutSlug: null });
3116
3124
  }
3117
3125
  }
3118
3126
  ),
3119
3127
  document.body
3120
3128
  ),
3121
3129
  /* @__PURE__ */ r(
3122
- ms,
3130
+ bs,
3123
3131
  {
3124
3132
  item: ye,
3125
- stateLabels: yn,
3133
+ stateLabels: kn,
3126
3134
  collectionLabel: it,
3127
3135
  claimsEnabled: se,
3128
- columnFormats: il,
3136
+ columnFormats: cl,
3129
3137
  width: u == null ? void 0 : u.sheet_width,
3130
3138
  itemLayout: u == null ? void 0 : u.item_layout,
3131
3139
  onOpenChange: (e) => {
3132
- e || (Te(null), vn(!1));
3140
+ e || (Te(null), wn(!1));
3133
3141
  },
3134
3142
  onClaim: (e) => qe.mutate(e),
3135
- onRelease: (e) => Be.mutate(e),
3136
- workNextActive: za,
3137
- onNext: () => ye && yr(ye),
3143
+ onRelease: (e) => je.mutate(e),
3144
+ workNextActive: Xa,
3145
+ onNext: () => ye && kr(ye),
3138
3146
  refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
3139
3147
  }
3140
- )
3148
+ ),
3149
+ At.dialog
3141
3150
  ] });
3142
3151
  }
3143
- function Ss({
3152
+ function qs({
3144
3153
  queueId: l,
3145
3154
  drill: f,
3146
3155
  onClose: $,
3147
- onOpenRecord: L
3156
+ onOpenRecord: D
3148
3157
  }) {
3149
- const U = ma(), { data: h, isLoading: p } = H({
3158
+ const U = ba(), { data: h, isLoading: p } = H({
3150
3159
  queryKey: ["queue-agg-rows", l, f.row.collection, f.row.item_id, f.path],
3151
3160
  queryFn: () => U.request(
3152
- O(`/queues/${l}/aggregate-rows`, {
3161
+ E(`/queues/${l}/aggregate-rows`, {
3153
3162
  collection: f.row.collection,
3154
3163
  item_id: f.row.item_id,
3155
3164
  path: f.path
@@ -3193,7 +3202,7 @@ function Ss({
3193
3202
  "button",
3194
3203
  {
3195
3204
  type: "button",
3196
- onClick: () => h.target && L(h.target, String(v.id)),
3205
+ onClick: () => h.target && D(h.target, String(v.id)),
3197
3206
  className: "min-w-0 truncate text-left text-[12.5px] underline decoration-dotted underline-offset-2 hover:text-nvr-navy dark:hover:text-nvr-cyan",
3198
3207
  children: v.label
3199
3208
  }
@@ -3207,5 +3216,5 @@ function Ss({
3207
3216
  );
3208
3217
  }
3209
3218
  export {
3210
- Pi as QueueWorklist
3219
+ Bi as QueueWorklist
3211
3220
  };