@nivaro/react 0.3.43 → 0.3.45

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 (33) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +38 -5
  4. package/dist/shared/components/CollectionBrowserView.js +1390 -1358
  5. package/dist/shared/components/DataTable.js +356 -334
  6. package/dist/shared/components/ProfileView.js +16 -21
  7. package/dist/shared/components/command-center/CommandCenterView.js +90 -355
  8. package/dist/shared/components/command-center/Header.js +70 -0
  9. package/dist/shared/components/command-center/PeekPanel.js +6 -0
  10. package/dist/shared/components/command-center/api.js +26 -0
  11. package/dist/shared/components/command-center/panels/AttentionPanel.js +6 -0
  12. package/dist/shared/components/command-center/panels/FeedPanel.js +33 -0
  13. package/dist/shared/components/command-center/panels/FlowPanel.js +61 -0
  14. package/dist/shared/components/command-center/panels/ForecastPanel.js +6 -0
  15. package/dist/shared/components/command-center/panels/MapPanel.js +74 -0
  16. package/dist/shared/components/command-center/panels/PartnersPanel.js +6 -0
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +47 -0
  18. package/dist/shared/components/command-center/panels/RegionPicker.js +6 -0
  19. package/dist/shared/components/command-center/panels/SystemPanel.js +53 -0
  20. package/dist/shared/components/command-center/panels/ThroughputPanel.js +6 -0
  21. package/dist/shared/components/command-center/panels/TimeBar.js +10 -0
  22. package/dist/shared/components/command-center/panels/TrafficPanel.js +11 -0
  23. package/dist/shared/components/command-center/panels/WorkloadPanel.js +6 -0
  24. package/dist/shared/components/command-center/panels/registry.js +28 -0
  25. package/dist/shared/components/command-center/state.js +12 -0
  26. package/dist/shared/components/command-center/theme.js +66 -0
  27. package/dist/shared/components/imports/ImportConsole.js +48 -47
  28. package/dist/shared/components/notifications/TestMyRules.js +39 -38
  29. package/dist/shared/components/profile/TeamsConnect.js +2 -2
  30. package/dist/shared/components/queue/QueueQuickFilters.js +81 -63
  31. package/dist/shared/components/queue/QueueWorklist.js +598 -586
  32. package/dist/shared/lib/quick-filter-cascade.js +29 -0
  33. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { jsxs as d, Fragment as Ne, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as Se, jsx as a } from "react/jsx-runtime";
2
2
  import { useSensors as Hl, useSensor as Jl, PointerSensor as Yl, DndContext as zl, closestCenter as Xl } from "@dnd-kit/core";
3
3
  import { SortableContext as Zl, verticalListSortingStrategy as eo, arrayMove as to, useSortable as no } from "@dnd-kit/sortable";
4
4
  import { CSS as ro } from "@dnd-kit/utilities";
5
- import { useQueryClient as ao, useQuery as W, useMutation as _e, useQueries as Qe } from "@tanstack/react-query";
6
- import { AlertTriangle as lo, FileDiff as oo, RefreshCw as so, Rows3 as pa, Flame as io, Sparkles as co, BarChart3 as uo, SlidersHorizontal as mo, ListChecks as bo, Rows4 as po, Rows2 as ho, Play as fo, Plus as Yt, ChevronDown as ha, Star as go, Pin as xo, Loader2 as yo, Check as ko, Save as vo, Bell as wo, Inbox as _o, GripVertical as No } from "lucide-react";
7
- import { useState as v, useRef as U, useEffect as j, useMemo as V } from "react";
5
+ import { useQueryClient as ao, useQuery as W, useMutation as Ne, useQueries as Qe } from "@tanstack/react-query";
6
+ import { AlertTriangle as lo, FileDiff as oo, RefreshCw as so, Rows3 as ba, Flame as io, Sparkles as co, BarChart3 as uo, SlidersHorizontal as mo, ListChecks as po, Rows4 as bo, Rows2 as ho, Play as fo, Plus as Yt, ChevronDown as ha, Star as go, Pin as xo, Loader2 as yo, Check as ko, Save as vo, Bell as wo, Inbox as _o, GripVertical as No } from "lucide-react";
7
+ import { useState as w, useRef as U, useEffect as j, useMemo as V } from "react";
8
8
  import { createPortal as fa } from "react-dom";
9
9
  import { toast as O } from "sonner";
10
10
  import { useNivaroClient as _a, useItemEditAuth as ga, useItemNavigation as So, useNavigation as Co, useOverlayState as $o } from "../../context.js";
@@ -12,69 +12,70 @@ import { useDebounced as qo } from "../../hooks/useDebounced.js";
12
12
  import { useElapsedLoading as Fo } from "../../hooks/useElapsedLoading.js";
13
13
  import { useSlowReason as To } from "../../hooks/useSlowReason.js";
14
14
  import { useBulkProgressFeed as Ro } from "../../lib/bulk-progress.js";
15
- import { get as A, post as ae, patch as xa, del as Dn, put as Eo } from "../../lib/commands.js";
15
+ import { get as A, post as se, patch as xa, del as Dn, put as Eo } from "../../lib/commands.js";
16
16
  import { evaluateExpression as Ao } from "../../lib/expression.js";
17
17
  import { clauseFromControlValue as Lo, filterSentence as Oo } from "../../lib/filter-sentence.js";
18
18
  import { deliverLive as Do, releaseLiveOwner as Po } from "../../lib/focus-mode.js";
19
19
  import { formatMultiValue as tt, formatValue as Ko } from "../../lib/format-value.js";
20
20
  import { createCursorBook as Mo, pageRequest as Qo, noteNextCursor as Bo } from "../../lib/keyset-pager.js";
21
- import { expandCoalesced as jo, LIVE_ASPECTS as Ct } from "../../lib/live.js";
22
- import { normalizeInlineEdit as Uo, inlineM2oTarget as Io, inlineChoices as Vo, inlineEditFor as Go, nextInlineKey as Wo } from "../../lib/list-inline-edit.js";
23
- import { sanitizeQueueLinkState as Ho, readListLinkFromLocation as Jo, dropListLinkParam as Yo } from "../../lib/list-link.js";
21
+ import { normalizeInlineEdit as jo, inlineM2oTarget as Uo, inlineChoices as Io, inlineEditFor as Vo, nextInlineKey as Go } from "../../lib/list-inline-edit.js";
22
+ import { sanitizeQueueLinkState as Wo, readListLinkFromLocation as Ho, dropListLinkParam as Jo } from "../../lib/list-link.js";
23
+ import { expandCoalesced as Yo, LIVE_ASPECTS as Ct } from "../../lib/live.js";
24
24
  import { useRowChanges as zo, useRowLocksByCollection as Xo, lockLabel as Zo } from "../../lib/live-list.js";
25
25
  import { OPEN_IN_TABS_CAP as es, openInTabs as ts, openInTabsMessage as ya } from "../../lib/open-in-tabs.js";
26
26
  import { isOwnWrite as ns } from "../../lib/own-writes.js";
27
27
  import { usePrefetchIntent as rs } from "../../lib/prefetch.js";
28
28
  import { useRowPresence as as, rowPresenceKey as ls } from "../../lib/presence-hooks.js";
29
29
  import { buildGroups as os } from "../../lib/queue-grouping.js";
30
- import { useOptionalRealtime as ss } from "../../lib/realtime.js";
31
- import { rowHighlightTextClass as is, rowHighlightClass as cs } from "../../lib/row-highlight.js";
30
+ import { cascadeFilter as ss, fetchCascadeRelations as is } from "../../lib/quick-filter-cascade.js";
31
+ import { useOptionalRealtime as cs } from "../../lib/realtime.js";
32
+ import { rowHighlightTextClass as ds, rowHighlightClass as us } from "../../lib/row-highlight.js";
32
33
  import { userErrorMessage as $t } from "../../lib/safe-error.js";
33
- import { useMyScopes as ds, matchScopeDimension as us, effectiveScopeSeedIds as ms } from "../../lib/use-my-scopes.js";
34
- import { useNewItemLayouts as bs } from "../../lib/use-new-item-layouts.js";
35
- import { formatNumber as le, cn as R, titleCase as Pn, humanHours as ps, formatRelative as hs, formatDateTime as fs, formatDate as gs } from "../../lib/utils.js";
36
- import { usePublishAskContext as xs, useAskRecordDrag as ys } from "../ai/ask-context.js";
37
- import { useBuiltinGate as ks, BulkActionButtons as vs } from "../bulk/BulkActionButtons.js";
38
- import { BulkRowMark as ws } from "../bulk/BulkRowMark.js";
39
- import { RowActionsMenu as _s, roleMayUpdate as Ns } from "../CollectionBrowserView.js";
40
- import { DataTable as Ss } from "../DataTable.js";
41
- import { EmptyState as Cs } from "../EmptyState.js";
42
- import { FocusModeToggle as $s } from "../FocusModeToggle.js";
43
- import { FulfilmentPill as qs, FULFILMENT_FILTER_OPTIONS as Fs } from "../FulfilmentPill.js";
44
- import { ImportFromFileButton as Ts } from "../import/ImportFromFileButton.js";
45
- import { IntegrationDots as Rs, INTEGRATIONS_FILTER_OPTIONS as Es } from "../integrations/IntegrationDots.js";
46
- import { IntegrationsFilterPill as As } from "../integrations/IntegrationsFilterPill.js";
47
- import { readQueueReturn as Ls, writeQueueReturn as ka } from "../item-edit/QueueReturnChip.js";
48
- import { ListLoadError as Os } from "../ListLoadError.js";
49
- import { CopyListLinkButton as Ds } from "../list/CopyListLinkButton.js";
50
- import { useInlineEdit as Ps, InlineEditCell as Ks } from "../list/InlineEdit.js";
51
- import { LiveRowMark as Ms } from "../LiveRowMark.js";
52
- import { usePickerExcludedRows as Qs, PICKER_EXCLUDED_ROW_CLASS as Bs, PICKER_EXCLUDED_TITLE as js } from "../PickerExcludedRows.js";
53
- import { RealtimeStaleMark as Us } from "../RealtimeStatusBanner.js";
54
- import { RecordDrilldownSheet as Is } from "../RecordDrilldownSheet.js";
55
- import { RowHighlightLegend as Vs } from "../RowHighlightLegend.js";
56
- import { RowPresence as Gs } from "../RowPresence.js";
34
+ import { useMyScopes as ms, matchScopeDimension as ps, effectiveScopeSeedIds as bs } from "../../lib/use-my-scopes.js";
35
+ import { useNewItemLayouts as hs } from "../../lib/use-new-item-layouts.js";
36
+ import { formatNumber as ie, cn as R, titleCase as Pn, humanHours as fs, formatRelative as gs, formatDateTime as xs, formatDate as ys } from "../../lib/utils.js";
37
+ import { usePublishAskContext as ks, useAskRecordDrag as vs } from "../ai/ask-context.js";
38
+ import { useBuiltinGate as ws, BulkActionButtons as _s } from "../bulk/BulkActionButtons.js";
39
+ import { BulkRowMark as Ns } from "../bulk/BulkRowMark.js";
40
+ import { RowActionsMenu as Ss, roleMayUpdate as Cs } from "../CollectionBrowserView.js";
41
+ import { DataTable as $s } from "../DataTable.js";
42
+ import { EmptyState as qs } from "../EmptyState.js";
43
+ import { FocusModeToggle as Fs } from "../FocusModeToggle.js";
44
+ import { FulfilmentPill as Ts, FULFILMENT_FILTER_OPTIONS as Rs } from "../FulfilmentPill.js";
45
+ import { ImportFromFileButton as Es } from "../import/ImportFromFileButton.js";
46
+ import { IntegrationDots as As, INTEGRATIONS_FILTER_OPTIONS as Ls } from "../integrations/IntegrationDots.js";
47
+ import { IntegrationsFilterPill as Os } from "../integrations/IntegrationsFilterPill.js";
48
+ import { readQueueReturn as Ds, writeQueueReturn as ka } from "../item-edit/QueueReturnChip.js";
49
+ import { ListLoadError as Ps } from "../ListLoadError.js";
50
+ import { LiveRowMark as Ks } from "../LiveRowMark.js";
51
+ import { CopyListLinkButton as Ms } from "../list/CopyListLinkButton.js";
52
+ import { useInlineEdit as Qs, InlineEditCell as Bs } from "../list/InlineEdit.js";
53
+ import { usePickerExcludedRows as js, PICKER_EXCLUDED_ROW_CLASS as Us, PICKER_EXCLUDED_TITLE as Is } from "../PickerExcludedRows.js";
54
+ import { RealtimeStaleMark as Vs } from "../RealtimeStatusBanner.js";
55
+ import { RecordDrilldownSheet as Gs } from "../RecordDrilldownSheet.js";
56
+ import { RowHighlightLegend as Ws } from "../RowHighlightLegend.js";
57
+ import { RowPresence as Hs } from "../RowPresence.js";
57
58
  import { TickerNumber as Kn } from "../TickerNumber.js";
58
- import { UnseenDot as Ws } from "../UnseenDot.js";
59
- import { Badge as Hs } from "../ui/badge.js";
59
+ import { UnseenDot as Js } from "../UnseenDot.js";
60
+ import { Badge as Ys } from "../ui/badge.js";
60
61
  import { Checkbox as Mn } from "../ui/checkbox.js";
61
- import { Command as va, CommandInput as Js, CommandList as wa, CommandEmpty as Ys, CommandItem as qt } from "../ui/command.js";
62
- import { Label as zs } from "../ui/label.js";
62
+ import { Command as va, CommandInput as zs, CommandList as wa, CommandEmpty as Xs, CommandItem as qt } from "../ui/command.js";
63
+ import { Label as Zs } from "../ui/label.js";
63
64
  import { Popover as nt, PopoverTrigger as rt, PopoverContent as at } from "../ui/popover.js";
64
- import { Skeleton as Xs } from "../ui/skeleton.js";
65
- import { OwnerAvatars as Zs } from "./OwnerAvatars.js";
66
- import { QueueBulkBar as ei } from "./QueueBulkBar.js";
67
- import { QueueItemSheet as ti } from "./QueueItemSheet.js";
68
- import { QueueKanbanBoard as ni } from "./QueueKanbanBoard.js";
69
- import { QueueQuickFilters as ri } from "./QueueQuickFilters.js";
70
- import { QueueWorkloadView as ai } from "./QueueWorkloadView.js";
71
- import { useTransitionNote as li, needsTransitionNote as oi } from "./transition-note.js";
72
- function si({ summary: l }) {
65
+ import { Skeleton as ei } from "../ui/skeleton.js";
66
+ import { OwnerAvatars as ti } from "./OwnerAvatars.js";
67
+ import { QueueBulkBar as ni } from "./QueueBulkBar.js";
68
+ import { QueueItemSheet as ri } from "./QueueItemSheet.js";
69
+ import { QueueKanbanBoard as ai } from "./QueueKanbanBoard.js";
70
+ import { QueueQuickFilters as li } from "./QueueQuickFilters.js";
71
+ import { QueueWorkloadView as oi } from "./QueueWorkloadView.js";
72
+ import { useTransitionNote as si, needsTransitionNote as ii } from "./transition-note.js";
73
+ function ci({ summary: l }) {
73
74
  if (!l || l.count === 0)
74
75
  return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
75
76
  const y = [l.last_from, l.last_to].filter(Boolean).join(" → "), L = [
76
77
  y ? `Last: ${y}` : null,
77
- l.last_at ? hs(l.last_at) : null,
78
+ l.last_at ? gs(l.last_at) : null,
78
79
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
79
80
  ].filter(Boolean).join(" · ");
80
81
  return /* @__PURE__ */ d(
@@ -96,13 +97,13 @@ function si({ summary: l }) {
96
97
  }
97
98
  );
98
99
  }
99
- const ii = 50, zt = "nivaro_addendums", ci = [
100
+ const di = 50, zt = "nivaro_addendums", ui = [
100
101
  { value: "mine", label: "My Items" },
101
102
  { value: "unowned", label: "No Owners" },
102
103
  { value: "claimed", label: "Claimed by me" },
103
104
  { value: "all", label: "All Items" }
104
105
  ];
105
- function di({ summary: l }) {
106
+ function mi({ summary: l }) {
106
107
  if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
107
108
  const y = l.active > 0, L = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", K = l.cost_impact, G = K != null && K !== 0 ? `${K > 0 ? "+" : "−"}$${Math.abs(K).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
108
109
  return /* @__PURE__ */ d(
@@ -133,16 +134,16 @@ function di({ summary: l }) {
133
134
  }
134
135
  );
135
136
  }
136
- function ui(l) {
137
- return ps(l);
137
+ function pi(l) {
138
+ return fs(l);
138
139
  }
139
- function mi({ status: l }) {
140
+ function bi({ status: l }) {
140
141
  return l ? /* @__PURE__ */ a("span", { className: R("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__ */ a("span", { className: "text-slate-300", children: "—" });
141
142
  }
142
- function bi({ points: l, inline: y = !1 }) {
143
+ function hi({ points: l, inline: y = !1 }) {
143
144
  if (l.length < 2) return null;
144
- const L = y ? 40 : 64, K = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, C = L / (l.length - 1), H = l.map(
145
- (ge, g) => `${g === 0 ? "M" : "L"}${(g * C).toFixed(1)},${(K - 2 - (ge - f) / h * (K - 4)).toFixed(1)}`
145
+ const L = y ? 40 : 64, K = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, S = L / (l.length - 1), H = l.map(
146
+ (xe, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(K - 2 - (xe - f) / h * (K - 4)).toFixed(1)}`
146
147
  ).join(" ");
147
148
  return /* @__PURE__ */ a(
148
149
  "svg",
@@ -163,28 +164,28 @@ function Ft({
163
164
  isLoading: G,
164
165
  tone: f,
165
166
  trend: h,
166
- delta: C,
167
+ delta: S,
167
168
  deltaBadIsUp: H,
168
- onClick: ge
169
+ onClick: xe
169
170
  }) {
170
171
  return /* @__PURE__ */ a(
171
172
  "button",
172
173
  {
173
174
  type: "button",
174
- onClick: ge,
175
+ onClick: xe,
175
176
  className: R(
176
177
  "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",
177
178
  K && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
178
179
  !K && !G && y === 0 && "opacity-50"
179
180
  ),
180
- children: G ? /* @__PURE__ */ a(Xs, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Ne, { children: [
181
- /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Ne, { children: [
182
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Kn, { value: L, format: le }) }),
181
+ children: G ? /* @__PURE__ */ a(ei, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Se, { children: [
182
+ /* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Se, { children: [
183
+ /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Kn, { value: L, format: ie }) }),
183
184
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
184
185
  "/ ",
185
- /* @__PURE__ */ a(Kn, { value: y, format: le })
186
+ /* @__PURE__ */ a(Kn, { value: y, format: ie })
186
187
  ] })
187
- ] }) : /* @__PURE__ */ a(Kn, { value: y, format: le }) }),
188
+ ] }) : /* @__PURE__ */ a(Kn, { value: y, format: ie }) }),
188
189
  /* @__PURE__ */ a(
189
190
  "span",
190
191
  {
@@ -195,25 +196,25 @@ function Ft({
195
196
  children: l
196
197
  }
197
198
  ),
198
- C != null && C !== 0 && /* @__PURE__ */ d(
199
+ S != null && S !== 0 && /* @__PURE__ */ d(
199
200
  "span",
200
201
  {
201
202
  className: R(
202
203
  "text-[10px] font-medium leading-none",
203
- H ? C > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
204
+ H ? S > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
204
205
  ),
205
206
  children: [
206
- C > 0 ? "↑" : "↓",
207
- le(Math.abs(C))
207
+ S > 0 ? "↑" : "↓",
208
+ ie(Math.abs(S))
208
209
  ]
209
210
  }
210
211
  ),
211
- h && y > 0 && /* @__PURE__ */ a(bi, { points: h, inline: !0 })
212
+ h && y > 0 && /* @__PURE__ */ a(hi, { points: h, inline: !0 })
212
213
  ] })
213
214
  }
214
215
  );
215
216
  }
216
- function pi({
217
+ function fi({
217
218
  label: l,
218
219
  count: y,
219
220
  filteredCount: L,
@@ -239,13 +240,13 @@ function pi({
239
240
  }
240
241
  ),
241
242
  l,
242
- /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Ne, { children: [
243
- /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: le(L) }),
243
+ /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: L != null ? /* @__PURE__ */ d(Se, { children: [
244
+ /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(L) }),
244
245
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
245
246
  " / ",
246
- le(y)
247
+ ie(y)
247
248
  ] })
248
- ] }) : le(y) })
249
+ ] }) : ie(y) })
249
250
  ]
250
251
  }
251
252
  );
@@ -253,19 +254,19 @@ function pi({
253
254
  function lt(l) {
254
255
  return l.split(".").map((y) => y.replace(/_/g, " ").replace(/\b\w/g, (L) => L.toUpperCase())).join(" → ");
255
256
  }
256
- function hi({
257
+ function gi({
257
258
  id: l,
258
259
  label: y,
259
260
  checked: L,
260
261
  onCheckedChange: K
261
262
  }) {
262
- const { attributes: G, listeners: f, setNodeRef: h, transform: C, transition: H, isDragging: ge } = no({
263
+ const { attributes: G, listeners: f, setNodeRef: h, transform: S, transition: H, isDragging: xe } = no({
263
264
  id: l
264
265
  }), g = {
265
- transform: ro.Transform.toString(C),
266
+ transform: ro.Transform.toString(S),
266
267
  transition: H,
267
- opacity: ge ? 0.4 : 1
268
- }, J = `col-toggle-${l}`;
268
+ opacity: xe ? 0.4 : 1
269
+ }, z = `col-toggle-${l}`;
269
270
  return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
270
271
  /* @__PURE__ */ a(
271
272
  "span",
@@ -276,11 +277,11 @@ function hi({
276
277
  children: /* @__PURE__ */ a(No, { className: "h-3.5 w-3.5" })
277
278
  }
278
279
  ),
279
- /* @__PURE__ */ a(Mn, { id: J, checked: L, onCheckedChange: K }),
280
- /* @__PURE__ */ a(zs, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: y })
280
+ /* @__PURE__ */ a(Mn, { id: z, checked: L, onCheckedChange: K }),
281
+ /* @__PURE__ */ a(Zs, { htmlFor: z, className: "cursor-pointer text-[12px] font-normal", children: y })
281
282
  ] });
282
283
  }
283
- function Pc({
284
+ function Qc({
284
285
  queueId: l,
285
286
  realtime: y,
286
287
  renderError: L,
@@ -288,19 +289,19 @@ function Pc({
288
289
  onAsk: G
289
290
  }) {
290
291
  var zr, Xr, Zr, ea, ta, na, ra, aa, la, oa, sa, ia, ca, da, ua, ma;
291
- const f = ao(), h = _a(), { userId: C } = ga(), H = So(), { navigate: ge } = Co(), [g, J] = v("all"), [ie, D] = v(1), Qn = U(Mo()), [Tt, Na] = v(() => {
292
+ const f = ao(), h = _a(), { userId: S } = ga(), H = So(), { navigate: xe } = Co(), [g, z] = w("all"), [de, D] = w(1), Qn = U(Mo()), [Tt, Na] = w(() => {
292
293
  try {
293
294
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
294
295
  } catch {
295
296
  return "compact";
296
297
  }
297
- }), [F, Be] = v("table"), [I, je] = v(""), [N, M] = v({}), [Rt, Bn] = v(() => /* @__PURE__ */ new Set()), [$, ot] = v(null), [xe, Xt] = v(/* @__PURE__ */ new Set()), [st, Zt] = v(null), [it, en] = v(null), [tn, Et] = v(0), Se = zo(), nn = ss(), rn = U({}).current, jn = U(/* @__PURE__ */ new Set()), [Sa, Ca] = v(0), [Un, $a] = v(0), Ce = U(!1), At = U([]), In = U(null), Vn = U(!1), Gn = U(0), an = U("table");
298
- an.current = F;
298
+ }), [q, Be] = w("table"), [I, je] = w(""), [_, M] = w({}), [Rt, Bn] = w(() => /* @__PURE__ */ new Set()), [$, ot] = w(null), [ye, Xt] = w(/* @__PURE__ */ new Set()), [st, Zt] = w(null), [it, en] = w(null), [tn, Et] = w(0), Ce = zo(), nn = cs(), rn = U({}).current, jn = U(/* @__PURE__ */ new Set()), [Sa, Ca] = w(0), [Un, $a] = w(0), $e = U(!1), At = U([]), In = U(null), Vn = U(!1), Gn = U(0), an = U("table");
299
+ an.current = q;
299
300
  const ln = 25, { data: i, error: Lt } = W({
300
301
  queryKey: ["queue-meta", l],
301
302
  queryFn: () => h.request(A(`/queues/${l}`)).then((e) => e.data),
302
303
  enabled: !!l
303
- }), { scopes: ct, ready: Wn } = ds(), Hn = U(!1), [Jn, Yn] = v(!1), [$e, qa] = v({}), ce = U({});
304
+ }), { scopes: ct, ready: Wn } = ms(), Hn = U(!1), [Jn, Yn] = w(!1), [qe, qa] = w({}), ue = U({});
304
305
  j(() => {
305
306
  if (Hn.current || !Wn || !i) return;
306
307
  Hn.current = !0;
@@ -327,26 +328,26 @@ function Pc({
327
328
  ];
328
329
  };
329
330
  for (const o of e) {
330
- const s = us(ct, { collection: o.target_collection });
331
+ const s = ps(ct, { collection: o.target_collection });
331
332
  if (!s) continue;
332
333
  const m = `extra.${o.path}`;
333
334
  try {
334
335
  const p = ct.restricted[s.name] ?? [];
335
336
  if (p.length > 0) {
336
- const _ = await r(o, p);
337
- _.length > 0 && (n[m.slice(6)] = _);
337
+ const C = await r(o, p);
338
+ C.length > 0 && (n[m.slice(6)] = C);
338
339
  }
339
- const S = ms(ct, s.name);
340
- if (S.length === 0) continue;
341
- const k = N[m];
340
+ const N = bs(ct, s.name);
341
+ if (N.length === 0) continue;
342
+ const k = _[m];
342
343
  if (k && (Array.isArray(k) ? k.length > 0 : k !== ""))
343
344
  continue;
344
- const b = S.length ? await r(o, S) : [];
345
+ const b = N.length ? await r(o, N) : [];
345
346
  b.length > 0 && (t[m] = b);
346
347
  } catch {
347
348
  }
348
349
  }
349
- Object.keys(n).length > 0 && qa(n), Object.keys(t).length > 0 && (ce.current = t, M((o) => ({ ...o, ...t }))), Yn(!0);
350
+ Object.keys(n).length > 0 && qa(n), Object.keys(t).length > 0 && (ue.current = t, M((o) => ({ ...o, ...t }))), Yn(!0);
350
351
  })();
351
352
  }, [Wn, ct, i]);
352
353
  const Ue = ((Xr = (zr = i == null ? void 0 : i.sources) == null ? void 0 : zr.find((e) => e.type === "collection")) == null ? void 0 : Xr.collection) ?? null, { data: zn = [] } = W({
@@ -357,14 +358,14 @@ function Pc({
357
358
  }).catch(() => []),
358
359
  enabled: !!Ue,
359
360
  staleTime: 3e5
360
- }), X = V(() => {
361
+ }), te = V(() => {
361
362
  const e = /* @__PURE__ */ new Set(), t = [];
362
363
  for (const n of (i == null ? void 0 : i.sources) ?? [])
363
364
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
364
365
  return t;
365
- }, [i == null ? void 0 : i.sources]), Ot = bs(
366
- X.length === 1 ? X[0] : null
367
- ), on = K === !0 || Array.isArray(K) && X.length > 0 && X.every((e) => K.includes(e)), de = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, qe = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Fa = (u == null ? void 0 : u.work_next) !== !1, Dt = (u == null ? void 0 : u.bulk_actions) !== !1, sn = ks(
366
+ }, [i == null ? void 0 : i.sources]), Ot = hs(
367
+ te.length === 1 ? te[0] : null
368
+ ), on = K === !0 || Array.isArray(K) && te.length > 0 && te.every((e) => K.includes(e)), me = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, Fe = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Fa = (u == null ? void 0 : u.work_next) !== !1, Dt = (u == null ? void 0 : u.bulk_actions) !== !1, sn = ws(
368
369
  [
369
370
  ...new Set(
370
371
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -378,12 +379,12 @@ function Pc({
378
379
  j(() => {
379
380
  !i || Xn.current || (Xn.current = !0, je("-priority"));
380
381
  }, [i]);
381
- const [Z, Ta] = v(!1);
382
+ const [ne, Ta] = w(!1);
382
383
  j(() => {
383
- i != null && i.display_config && !qe.includes(F) && Be(qe[0]);
384
- }, [i, F, qe]), j(() => {
384
+ i != null && i.display_config && !Fe.includes(q) && Be(Fe[0]);
385
+ }, [i, q, Fe]), j(() => {
385
386
  if (!(i != null && i.sources)) return;
386
- const e = nn ? (b, _) => nn.subscribeCollections(b, _) : y == null ? void 0 : y.subscribe;
387
+ const e = nn ? (b, C) => nn.subscribeCollections(b, C) : y == null ? void 0 : y.subscribe;
387
388
  if (!e) return;
388
389
  const t = [
389
390
  ...new Set(
@@ -403,34 +404,34 @@ function Pc({
403
404
  At.current = [], Et((b) => b + 1);
404
405
  return;
405
406
  }
406
- Ce.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
407
+ $e.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
407
408
  }, 900));
408
- }, S = (b) => {
409
- let _ = !1, w = 0, se = !1;
410
- const Me = b.flatMap(
411
- (q) => q ? jo(q) : [q]
409
+ }, N = (b) => {
410
+ let C = !1, v = 0, J = !1;
411
+ const Y = b.flatMap(
412
+ (T) => T ? Yo(T) : [T]
412
413
  );
413
- for (const q of Me) {
414
- const fe = q == null ? void 0 : q.changed_fields, Jt = (q == null ? void 0 : q.collection) != null ? `${q.collection}:${String(q.item)}` : null, ba = Jt != null && jn.current.has(Jt);
415
- if (q && !q.action && (fe != null && fe.length) && fe.every((St) => St.startsWith("$"))) {
416
- fe.includes(Ct.tasks) && n.add("queue-task-counts"), fe.includes(Ct.integrations) && n.add("queue-integrations-summary"), fe.includes(Ct.addendums) && n.add("queue-collection-addendums"), fe.includes(Ct.lock) && Ca((St) => St + 1), fe.includes(Ct.state) && (se = !0, (ba || an.current === "kanban") && (_ = !0)), r || (r = setTimeout(() => {
414
+ for (const T of Y) {
415
+ const ee = T == null ? void 0 : T.changed_fields, Jt = (T == null ? void 0 : T.collection) != null ? `${T.collection}:${String(T.item)}` : null, pa = Jt != null && jn.current.has(Jt);
416
+ if (T && !T.action && (ee != null && ee.length) && ee.every((St) => St.startsWith("$"))) {
417
+ ee.includes(Ct.tasks) && n.add("queue-task-counts"), ee.includes(Ct.integrations) && n.add("queue-integrations-summary"), ee.includes(Ct.addendums) && n.add("queue-collection-addendums"), ee.includes(Ct.lock) && Ca((St) => St + 1), ee.includes(Ct.state) && (J = !0, (pa || an.current === "kanban") && (C = !0)), r || (r = setTimeout(() => {
417
418
  r = null;
418
419
  for (const St of n) f.invalidateQueries({ queryKey: [St] });
419
420
  n.clear();
420
421
  }, 300));
421
422
  continue;
422
423
  }
423
- se = !0;
424
- const Wl = (q == null ? void 0 : q.collection) != null && ns(q.collection, q.item);
425
- Jt && (ba || (q == null ? void 0 : q.action) === "create" || an.current === "kanban") ? (_ = !0, Wl || At.current.push({ key: Jt, by: null })) : w += 1;
424
+ J = !0;
425
+ const Wl = (T == null ? void 0 : T.collection) != null && ns(T.collection, T.item);
426
+ Jt && (pa || (T == null ? void 0 : T.action) === "create" || an.current === "kanban") ? (C = !0, Wl || At.current.push({ key: Jt, by: null })) : v += 1;
426
427
  }
427
- w > 0 && Et((q) => q + w), _ && p(), se && m();
428
- }, k = e(t, (b) => Do(rn, [b ?? {}], S));
428
+ v > 0 && Et((T) => T + v), C && p(), J && m();
429
+ }, k = e(t, (b) => Do(rn, [b ?? {}], N));
429
430
  return () => {
430
431
  k(), Po(rn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
431
432
  };
432
- }, [nn, y, i == null ? void 0 : i.sources, f, l, C, rn]);
433
- const Fe = qo(N, 350), Ra = JSON.stringify(Fe) === JSON.stringify(N), cn = U(!1), Te = F === "table" && !!$, Zn = (() => {
433
+ }, [nn, y, i == null ? void 0 : i.sources, f, l, S, rn]);
434
+ const Te = qo(_, 350), Ra = JSON.stringify(Te) === JSON.stringify(_), cn = U(!1), Re = q === "table" && !!$, Zn = (() => {
434
435
  const e = /* @__PURE__ */ new Set();
435
436
  for (const t of (i == null ? void 0 : i.extra_field_meta) ?? [])
436
437
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
@@ -440,9 +441,9 @@ function Pc({
440
441
  t.type === "addendums" && e.add("cost_impact");
441
442
  }
442
443
  return [...e].slice(0, 12);
443
- })(), ye = (() => {
444
+ })(), ke = (() => {
444
445
  const e = {};
445
- for (const [t, n] of Object.entries(Fe))
446
+ for (const [t, n] of Object.entries(Te))
446
447
  if (n) {
447
448
  if (Array.isArray(n)) {
448
449
  n.length > 0 && (e[t] = n);
@@ -466,11 +467,11 @@ function Pc({
466
467
  return { ...t, state: o };
467
468
  }), D(1);
468
469
  }
469
- const Aa = Array.isArray(N.state) ? N.state : N.state ? [N.state] : [], La = (e) => !e || Array.isArray(e) && e.length === 0;
470
+ const Aa = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], La = (e) => !e || Array.isArray(e) && e.length === 0;
470
471
  function Oa() {
471
- M({ ...ce.current }), J("all"), D(1);
472
+ M({ ...ue.current }), z("all"), D(1);
472
473
  }
473
- const [dt, Da] = v(() => {
474
+ const [dt, Da] = w(() => {
474
475
  try {
475
476
  return localStorage.getItem("nvr_queue_insights_open") === "1";
476
477
  } catch {
@@ -490,7 +491,7 @@ function Pc({
490
491
  }), Pt = (e) => Pa.find((t) => t.queue_view_id === e), Ka = (e) => {
491
492
  const t = Pt(e);
492
493
  (t ? h.request(Dn(`/notification-subscriptions/${t.id}`)) : h.request(
493
- ae("/notification-subscriptions", {
494
+ se("/notification-subscriptions", {
494
495
  queue_id: l,
495
496
  queue_view_id: e,
496
497
  digest_frequency: "instant"
@@ -500,7 +501,7 @@ function Pc({
500
501
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
501
502
  ), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
502
503
  }).catch((r) => O.error($t(r, "Failed")));
503
- }, [er, dn] = v(null), un = [
504
+ }, [er, dn] = w(null), un = [
504
505
  ...new Set(
505
506
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
506
507
  )
@@ -522,7 +523,7 @@ function Pc({
522
523
  enabled: un.length > 0,
523
524
  staleTime: 6e4
524
525
  }), Qa = (e) => Ma[e] ?? [], Ba = (e, t) => {
525
- h.request(ae(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
526
+ h.request(se(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
526
527
  O.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
527
528
  }).catch((n) => {
528
529
  const r = n.response;
@@ -534,7 +535,7 @@ function Pc({
534
535
  staleTime: 3e4
535
536
  }), tr = (e, t) => {
536
537
  h.request(
537
- ae(`/queues/${l}/triage-labels/toggle`, {
538
+ se(`/queues/${l}/triage-labels/toggle`, {
538
539
  collection: e.collection,
539
540
  item_id: e.item_id,
540
541
  label: t
@@ -547,7 +548,7 @@ function Pc({
547
548
  isLoading: nr,
548
549
  isFetching: ut,
549
550
  isPlaceholderData: ja,
550
- dataUpdatedAt: oe,
551
+ dataUpdatedAt: ce,
551
552
  isError: rr,
552
553
  error: Ua,
553
554
  refetch: Ia
@@ -557,27 +558,27 @@ function Pc({
557
558
  l,
558
559
  g,
559
560
  I,
560
- Fe,
561
- F === "table" && !$ ? ie : "all",
561
+ Te,
562
+ q === "table" && !$ ? de : "all",
562
563
  $
563
564
  ],
564
565
  queryFn: async () => {
565
- const e = !Te && F === "table", t = JSON.stringify([l, g, I, ye, ln]), n = e ? Qo(Qn.current, t, ie, "").after : void 0, r = await h.request(
566
+ const e = !Re && q === "table", t = JSON.stringify([l, g, I, ke, ln]), n = e ? Qo(Qn.current, t, de, "").after : void 0, r = await h.request(
566
567
  A(`/queues/${l}/items`, {
567
568
  scope: g,
568
569
  // Last State Change is Aging read the other way round: the newest
569
570
  // move is the least aged.
570
571
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
571
- filters: JSON.stringify(ye),
572
+ filters: JSON.stringify(ke),
572
573
  // Table + group: headers only (rows load per group on expand, #741).
573
574
  // Kanban renders the full matching set, grouped client-side.
574
- ...Te ? {
575
+ ...Re ? {
575
576
  group_by: $,
576
577
  ...Zn.length ? { group_sums: Zn.join(",") } : {}
577
- } : F === "table" ? { page: ie, limit: ln, ...n ? { after: n } : {} } : {}
578
+ } : q === "table" ? { page: de, limit: ln, ...n ? { after: n } : {} } : {}
578
579
  })
579
580
  );
580
- return n && Bo(Qn.current, t, ie, r.next_cursor), r;
581
+ return n && Bo(Qn.current, t, de, r.next_cursor), r;
581
582
  },
582
583
  // Wait for display_config AND scope seeding so the first fetch uses the
583
584
  // configured defaults and already carries the viewer's restricted filters.
@@ -586,19 +587,19 @@ function Pc({
586
587
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
587
588
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
588
589
  // waits for the debounced copy to settle; later typing still debounces.
589
- enabled: !!l && Z && Jn && (cn.current || Ra),
590
+ enabled: !!l && ne && Jn && (cn.current || Ra),
590
591
  // Keep the previous page rendered while a sort/filter/page change refetches —
591
592
  // swapping to skeletons collapsed the table height and jittered the page.
592
593
  placeholderData: (e) => e
593
594
  });
594
595
  c && !cn.current && (cn.current = !0);
595
- const Ve = Object.entries(ce.current).filter(
596
+ const Ve = Object.entries(ue.current).filter(
596
597
  ([e, t]) => {
597
598
  var n;
598
- return !((n = $e[e.slice(6)]) != null && n.length) && JSON.stringify(ye[e] ?? null) === JSON.stringify(t);
599
+ return !((n = qe[e.slice(6)]) != null && n.length) && JSON.stringify(ke[e] ?? null) === JSON.stringify(t);
599
600
  }
600
- ).map(([e]) => e), ar = Ve.length > 0 && Object.keys(ye).every((e) => Ve.includes(e)), lr = Object.fromEntries(
601
- Object.entries(ye).filter(([e]) => !Ve.includes(e))
601
+ ).map(([e]) => e), ar = Ve.length > 0 && Object.keys(ke).every((e) => Ve.includes(e)), lr = Object.fromEntries(
602
+ Object.entries(ke).filter(([e]) => !Ve.includes(e))
602
603
  ), { data: Va } = W({
603
604
  queryKey: ["queue-default-hidden", l, g, lr],
604
605
  enabled: !!l && !!c && !ut && c.total === 0 && ((Zr = c.empty) == null ? void 0 : Zr.reason) === "filters" && Ve.length > 0 && !ar,
@@ -612,7 +613,7 @@ function Pc({
612
613
  limit: 1
613
614
  })
614
615
  ).then((e) => Number(e.total ?? 0))
615
- }), ue = ar ? Math.max(0, (((ea = c == null ? void 0 : c.stats) == null ? void 0 : ea.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : Va ?? 0, or = (e) => Ve.map(e).join(" and "), sr = () => {
616
+ }), pe = ar ? Math.max(0, (((ea = c == null ? void 0 : c.stats) == null ? void 0 : ea.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : Va ?? 0, or = (e) => Ve.map(e).join(" and "), sr = () => {
616
617
  M((e) => {
617
618
  const t = { ...e };
618
619
  for (const n of Ve) delete t[n];
@@ -620,24 +621,24 @@ function Pc({
620
621
  }), D(1);
621
622
  };
622
623
  j(() => {
623
- if (typeof window > "u" || !oe) return;
624
+ if (typeof window > "u" || !ce) return;
624
625
  const e = window;
625
626
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
626
627
  const t = e.__nvrQueueTrace, n = {
627
628
  queue: l,
628
- at: oe,
629
+ at: ce,
629
630
  scope: g,
630
631
  sort: I,
631
- filters: JSON.stringify(Fe),
632
- page: ie
632
+ filters: JSON.stringify(Te),
633
+ page: de
633
634
  }, r = t.find((o) => o.queue === l);
634
- t.push(n), t.length > 50 && t.shift(), r && r !== n && oe - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
635
- }, [oe]);
636
- const Ge = nr && !c || !Z || !Jn && !c, ir = (ut && !nr || ja && ut) && !Ce.current, Ga = V(
637
- () => (Te ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
638
- [Te, c == null ? void 0 : c.data]
639
- ), Wa = as(Ga), Kt = li(), cr = Fo(ut && !Ce.current), Ha = To({
640
- pending: ut && !Ce.current,
635
+ t.push(n), t.length > 50 && t.shift(), r && r !== n && ce - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
636
+ }, [ce]);
637
+ const Ge = nr && !c || !ne || !Jn && !c, ir = (ut && !nr || ja && ut) && !$e.current, Ga = V(
638
+ () => (Re ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
639
+ [Re, c == null ? void 0 : c.data]
640
+ ), Wa = as(Ga), Kt = si(), cr = Fo(ut && !$e.current), Ha = To({
641
+ pending: ut && !$e.current,
641
642
  request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
642
643
  noun: "items"
643
644
  }), Ja = rs();
@@ -646,23 +647,23 @@ function Pc({
646
647
  const r = (await h.request(A(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
647
648
  if (!r || r.states.length === 0)
648
649
  throw new Error("This item has no workflow instance");
649
- const o = r.states.find((S) => S.key === t);
650
+ const o = r.states.find((N) => N.key === t);
650
651
  if (!o) throw new Error("Target state not found");
651
652
  const s = r.available_transitions.find(
652
- (S) => S.to_state === o.id
653
+ (N) => N.to_state === o.id
653
654
  );
654
655
  if (!s) throw new Error("No transition available to move this item here");
655
656
  let m = null;
656
- if (oi(s) && (m = await Kt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
657
+ if (ii(s) && (m = await Kt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
657
658
  throw new Error("Not moved — this move needs a note");
658
659
  await h.request(
659
- ae(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
660
+ se(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
660
661
  transition_id: s.id,
661
662
  ...m ? { comment: m } : {}
662
663
  })
663
664
  );
664
665
  }
665
- const Ya = _e({
666
+ const Ya = Ne({
666
667
  mutationFn: async ({ item: e, targetState: t }) => {
667
668
  await dr(e, t);
668
669
  },
@@ -672,18 +673,18 @@ function Pc({
672
673
  onError: (e) => {
673
674
  O.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
674
675
  }
675
- }), Re = _e({
676
+ }), Ee = Ne({
676
677
  mutationFn: (e) => h.request(
677
- ae(`/queues/${l}/claim`, {
678
+ se(`/queues/${l}/claim`, {
678
679
  source_collection: e.collection,
679
680
  item_id: e.item_id
680
681
  })
681
682
  ),
682
683
  onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
683
684
  onError: () => O.error("Failed to claim item")
684
- }), We = _e({
685
+ }), We = Ne({
685
686
  mutationFn: (e) => h.request(
686
- ae(`/queues/${l}/release`, {
687
+ se(`/queues/${l}/release`, {
687
688
  source_collection: e.collection,
688
689
  item_id: e.item_id
689
690
  })
@@ -694,13 +695,13 @@ function Pc({
694
695
  queryKey: ["queue-column-prefs", l],
695
696
  queryFn: () => h.request(A(`/queues/${l}/column-prefs`)),
696
697
  enabled: !!l
697
- }), [Mt, Qt] = v(null), [Je, bn] = v(null);
698
+ }), [Mt, Qt] = w(null), [Je, pn] = w(null);
698
699
  j(() => {
699
- He && bn(He.data.default_view_id);
700
+ He && pn(He.data.default_view_id);
700
701
  }, [He]);
701
- const [za, ur] = v({}), me = Te ? (c == null ? void 0 : c.groups) ?? null : null, Bt = (me ?? []).filter((e) => !xe.has(e.key)).map((e) => e.key).flatMap(
702
+ const [za, ur] = w({}), be = Re ? (c == null ? void 0 : c.groups) ?? null : null, Bt = (be ?? []).filter((e) => !ye.has(e.key)).map((e) => e.key).flatMap(
702
703
  (e) => Array.from({ length: za[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
703
- ), pn = Qe({
704
+ ), bn = Qe({
704
705
  queries: Bt.map(({ key: e, page: t }) => ({
705
706
  queryKey: [
706
707
  "queue-items",
@@ -708,7 +709,7 @@ function Pc({
708
709
  "group-rows",
709
710
  g,
710
711
  I,
711
- Fe,
712
+ Te,
712
713
  $,
713
714
  e,
714
715
  t
@@ -717,43 +718,43 @@ function Pc({
717
718
  A(`/queues/${l}/items`, {
718
719
  scope: g,
719
720
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
720
- filters: JSON.stringify(ye),
721
+ filters: JSON.stringify(ke),
721
722
  group_by: $,
722
723
  group_key: e,
723
724
  page: t,
724
- limit: ii
725
+ limit: di
725
726
  })
726
727
  ).then((n) => ({ key: e, rows: n.data })),
727
- enabled: !!c && Te,
728
+ enabled: !!c && Re,
728
729
  placeholderData: (n) => n
729
730
  }))
730
- }), Xa = pn.map((e) => e.dataUpdatedAt).join(","), hn = V(() => {
731
+ }), Xa = bn.map((e) => e.dataUpdatedAt).join(","), hn = V(() => {
731
732
  const e = /* @__PURE__ */ new Map();
732
- return pn.forEach((t, n) => {
733
+ return bn.forEach((t, n) => {
733
734
  if (!t.data) return;
734
735
  const r = Bt[n].key;
735
736
  e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
736
737
  }), e;
737
738
  }, [Xa, Bt.map((e) => `${e.key}\0${e.page}`).join("")]), Za = new Set(
738
- pn.flatMap((e, t) => e.isFetching ? [Bt[t].key] : [])
739
- ), T = me ? [...hn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
740
- xs(
739
+ bn.flatMap((e, t) => e.isFetching ? [Bt[t].key] : [])
740
+ ), F = be ? [...hn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
741
+ ks(
741
742
  l ? {
742
743
  queue: {
743
744
  id: l,
744
745
  label: i == null ? void 0 : i.name,
745
746
  scope: g,
746
- filters: JSON.stringify(ye),
747
- items: T.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
747
+ filters: JSON.stringify(ke),
748
+ items: F.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
748
749
  }
749
750
  } : null
750
751
  );
751
- const el = ys(), mt = T.some((e) => e.fulfilment !== void 0), bt = T.some((e) => e.send_backs !== void 0), { data: jt, dataUpdatedAt: tl } = W({
752
- queryKey: ["queue-live-stats", l, g, Fe, Un],
752
+ const el = vs(), mt = F.some((e) => e.fulfilment !== void 0), pt = F.some((e) => e.send_backs !== void 0), { data: jt, dataUpdatedAt: tl } = W({
753
+ queryKey: ["queue-live-stats", l, g, Te, Un],
753
754
  queryFn: () => h.request(
754
755
  A(`/queues/${l}/items`, {
755
756
  scope: g,
756
- filters: JSON.stringify(ye),
757
+ filters: JSON.stringify(ke),
757
758
  page: 1,
758
759
  limit: 1
759
760
  })
@@ -762,58 +763,58 @@ function Pc({
762
763
  staleTime: Number.POSITIVE_INFINITY,
763
764
  placeholderData: (e) => e,
764
765
  retry: !1
765
- }), fn = !!jt && tl > oe, x = fn ? jt.stats : c == null ? void 0 : c.stats, Y = fn ? jt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, mr = fn ? jt.state_counts : c == null ? void 0 : c.state_counts;
766
- jn.current = new Set(T.map((e) => `${e.collection}:${e.item_id}`));
767
- const pt = Xo(
768
- T.map((e) => ({ collection: e.collection, id: e.item_id })),
766
+ }), fn = !!jt && tl > ce, x = fn ? jt.stats : c == null ? void 0 : c.stats, X = fn ? jt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, mr = fn ? jt.state_counts : c == null ? void 0 : c.state_counts;
767
+ jn.current = new Set(F.map((e) => `${e.collection}:${e.item_id}`));
768
+ const bt = Xo(
769
+ F.map((e) => ({ collection: e.collection, id: e.item_id })),
769
770
  Sa
770
- ), br = U(oe), pr = U(0);
771
- !Ce.current && oe !== pr.current && (br.current = oe), j(() => {
772
- const e = new Set(T.map((t) => `${t.collection}:${t.item_id}`));
773
- if (Ce.current) {
774
- Ce.current = !1, pr.current = oe;
771
+ ), pr = U(ce), br = U(0);
772
+ !$e.current && ce !== br.current && (pr.current = ce), j(() => {
773
+ const e = new Set(F.map((t) => `${t.collection}:${t.item_id}`));
774
+ if ($e.current) {
775
+ $e.current = !1, br.current = ce;
775
776
  const t = At.current;
776
777
  At.current = [];
777
778
  const n = In.current, r = /* @__PURE__ */ new Set();
778
779
  for (const o of t)
779
- !e.has(o.key) || r.has(o.key) || (r.add(o.key), Se.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
780
+ !e.has(o.key) || r.has(o.key) || (r.add(o.key), Ce.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
780
781
  if (n) {
781
782
  const o = [...e].filter((s) => !n.has(s) && !r.has(s));
782
- o.length > 0 && o.length <= 20 && Se.note(o, null, "create");
783
+ o.length > 0 && o.length <= 20 && Ce.note(o, null, "create");
783
784
  }
784
785
  }
785
786
  In.current = e;
786
- }, [oe]), j(() => {
787
+ }, [ce]), j(() => {
787
788
  Et(0);
788
789
  }, [c]);
789
790
  function nl() {
790
791
  f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Et(0);
791
792
  }
792
- const { data: be } = W({
793
+ const { data: he } = W({
793
794
  queryKey: ["queue-trends", l],
794
795
  queryFn: () => h.request(A(`/queues/${l}/trends`, { days: 14 })),
795
796
  enabled: !!l,
796
797
  staleTime: 300 * 1e3
797
- }), { data: pe } = W({
798
+ }), { data: fe } = W({
798
799
  queryKey: ["queue-trends", l, "mine"],
799
800
  queryFn: () => h.request(A(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
800
801
  enabled: !!l && g === "mine",
801
802
  staleTime: 300 * 1e3
802
803
  });
803
804
  function ht(e) {
804
- const n = (g === "all" ? be == null ? void 0 : be.data : g === "mine" ? pe == null ? void 0 : pe.data : void 0) ?? [];
805
+ const n = (g === "all" ? he == null ? void 0 : he.data : g === "mine" ? fe == null ? void 0 : fe.data : void 0) ?? [];
805
806
  if (n.length === 0) return {};
806
807
  const r = n.map((s) => s[e]), o = n[n.length - 1];
807
808
  return { trend: r, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
808
809
  }
809
- const he = V(() => {
810
- const t = (g === "all" ? be == null ? void 0 : be.data : g === "mine" ? pe == null ? void 0 : pe.data : void 0) ?? [];
810
+ const ge = V(() => {
811
+ const t = (g === "all" ? he == null ? void 0 : he.data : g === "mine" ? fe == null ? void 0 : fe.data : void 0) ?? [];
811
812
  if (t.length < 3 || !x) return null;
812
813
  const n = t.map(
813
814
  (m) => g === "mine" ? m.owned ?? m.total : m.total
814
815
  ), r = n.slice(1).map((m, p) => m - n[p]), o = r.reduce((m, p) => m + p, 0) / r.length, s = x.total;
815
816
  return Math.abs(o) < 0.05 ? { dir: "flat", pace: o, days: null } : o < 0 ? { dir: "down", pace: o, days: Math.max(1, Math.ceil(s / -o)) } : { dir: "up", pace: o, days: null };
816
- }, [be == null ? void 0 : be.data, pe == null ? void 0 : pe.data, g, x]), ft = V(
817
+ }, [he == null ? void 0 : he.data, fe == null ? void 0 : fe.data, g, x]), ft = V(
817
818
  () => [
818
819
  ...new Set(
819
820
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -839,21 +840,21 @@ function Pc({
839
840
  queryKey: ["queue-integrations-collections"],
840
841
  queryFn: () => h.request(A("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
841
842
  staleTime: 300 * 1e3
842
- }), ke = ft.some((e) => gn.includes(e)), xn = V(() => {
843
+ }), ve = ft.some((e) => gn.includes(e)), xn = V(() => {
843
844
  var t;
844
845
  const e = {};
845
- if (!ke) return e;
846
- for (const n of T) {
846
+ if (!ve) return e;
847
+ for (const n of F) {
847
848
  if (!gn.includes(n.collection)) continue;
848
849
  const r = e[t = n.collection] ?? (e[t] = []);
849
850
  r.length < 500 && r.push(n.item_id);
850
851
  }
851
852
  return e;
852
- }, [T, gn, ke]), hr = Object.keys(xn), fr = Qe({
853
+ }, [F, gn, ve]), hr = Object.keys(xn), fr = Qe({
853
854
  queries: hr.map((e) => ({
854
855
  queryKey: ["queue-integrations-summary", e, xn[e].join(",")],
855
856
  queryFn: () => h.request(
856
- ae("/integration-obligations/summary", {
857
+ se("/integration-obligations/summary", {
857
858
  collection: e,
858
859
  ids: xn[e]
859
860
  })
@@ -870,18 +871,18 @@ function Pc({
870
871
  }, [al]), yn = V(() => {
871
872
  var t;
872
873
  const e = {};
873
- for (const n of T) {
874
+ for (const n of F) {
874
875
  if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
875
876
  continue;
876
877
  const r = e[t = n.collection] ?? (e[t] = []);
877
878
  r.length < 500 && r.push(n.item_id);
878
879
  }
879
880
  return e;
880
- }, [T]), kn = Object.keys(yn), gr = Qe({
881
+ }, [F]), kn = Object.keys(yn), gr = Qe({
881
882
  queries: kn.map((e) => ({
882
883
  queryKey: ["queue-task-counts", e, yn[e].join(",")],
883
884
  queryFn: () => h.request(
884
- ae("/tasks/counts", { collection: e, ids: yn[e] })
885
+ se("/tasks/counts", { collection: e, ids: yn[e] })
885
886
  ).then((t) => t.data ?? {}).catch(() => ({})),
886
887
  staleTime: 3e4
887
888
  }))
@@ -918,7 +919,7 @@ function Pc({
918
919
  ).then((t) => t.data),
919
920
  staleTime: 300 * 1e3
920
921
  }))
921
- }), wr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), ve = V(() => {
922
+ }), wr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), we = V(() => {
922
923
  const e = {};
923
924
  for (const t of vr)
924
925
  (t.data ?? []).forEach((n, r) => {
@@ -928,46 +929,46 @@ function Pc({
928
929
  }, [vr.map((e) => e.data)]), _r = x ? Object.entries(x.by_state).sort(
929
930
  (e, t) => {
930
931
  var n, r;
931
- return (((n = ve[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = ve[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
932
+ return (((n = we[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = we[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
932
933
  }
933
934
  ) : [], Nr = (e) => [...e].sort(
934
935
  (t, n) => {
935
936
  var r, o;
936
- return (((r = ve[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = ve[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
937
+ return (((r = we[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = we[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
937
938
  }
938
939
  ), vn = V(() => {
939
940
  const e = {};
940
- for (const [t, n] of Object.entries(ve)) e[t] = n.label;
941
+ for (const [t, n] of Object.entries(we)) e[t] = n.label;
941
942
  return e;
942
- }, [ve]), Ee = (e) => e ? e === "none" ? "No State" : vn[e] ?? wr(e) : "—", gt = (e) => {
943
+ }, [we]), Ae = (e) => e ? e === "none" ? "No State" : vn[e] ?? wr(e) : "—", gt = (e) => {
943
944
  if (e === zt) return "Addendums";
944
945
  const t = (rl ?? []).find((n) => n.collection === e);
945
946
  return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || wr(e);
946
- }, ne = V(() => $ ? me ? me.map((e) => ({
947
+ }, le = V(() => $ ? be ? be.map((e) => ({
947
948
  key: e.key,
948
949
  rows: hn.get(e.key) ?? [],
949
950
  breached: e.breached,
950
951
  atRisk: e.at_risk,
951
952
  count: e.count,
952
953
  sums: e.sums ?? {}
953
- })) : os(T, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [T, $, me, hn]), wn = U(null);
954
+ })) : os(F, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [F, $, be, hn]), wn = U(null);
954
955
  j(() => {
955
- if (!$ || !ne) {
956
+ if (!$ || !le) {
956
957
  wn.current = null;
957
958
  return;
958
959
  }
959
- if (Te && !me || wn.current === $) return;
960
+ if (Re && !be || wn.current === $) return;
960
961
  wn.current = $;
961
- const e = ne.reduce((t, n) => t + n.count, 0);
962
- Xt(e > 200 ? new Set(ne.map((t) => t.key)) : /* @__PURE__ */ new Set()), ur({});
963
- }, [$, me]);
962
+ const e = le.reduce((t, n) => t + n.count, 0);
963
+ Xt(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), ur({});
964
+ }, [$, be]);
964
965
  function cl(e) {
965
966
  Xt((t) => {
966
967
  const n = new Set(t);
967
968
  return n.has(e) ? n.delete(e) : n.add(e), n;
968
969
  });
969
970
  }
970
- const re = V(() => ne ? ne.filter((e) => !xe.has(e.key)).flatMap((e) => e.rows) : T, [ne, T, xe]), P = (e) => `${e.collection}:${e.item_id}`, [we, Ae] = v(null), [dl, _n] = v(!1), [Ut, It] = v(null), Nn = (e) => {
971
+ const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) : F, [le, F, ye]), P = (e) => `${e.collection}:${e.item_id}`, [_e, Le] = w(null), [dl, _n] = w(!1), [Ut, It] = w(null), Nn = (e) => {
971
972
  if (e.collection === zt && e.url) {
972
973
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
973
974
  if (t) {
@@ -994,9 +995,9 @@ function Pc({
994
995
  path: `${window.location.pathname}${window.location.search}`,
995
996
  at: Date.now(),
996
997
  scroll: ((t = Gt.current) == null ? void 0 : t.scrollTop) ?? 0,
997
- state: { scope: g, page: ie, sort: I, filters: N, group_by: $, view: F }
998
+ state: { scope: g, page: de, sort: I, filters: _, group_by: $, view: q }
998
999
  }), H.open(Nn(e));
999
- }, [Q, yt] = v(
1000
+ }, [Q, yt] = w(
1000
1001
  null
1001
1002
  );
1002
1003
  j(() => {
@@ -1023,85 +1024,85 @@ function Pc({
1023
1024
  });
1024
1025
  return;
1025
1026
  }
1026
- Ae(e);
1027
+ Le(e);
1027
1028
  };
1028
1029
  j(() => {
1029
- if (!we) return;
1030
- const e = T.find((t) => P(t) === P(we));
1031
- e && e !== we && Ae(e);
1032
- }, [T]);
1033
- const ul = (e) => !e.claimed_by || e.claimed_by.id === C;
1030
+ if (!_e) return;
1031
+ const e = F.find((t) => P(t) === P(_e));
1032
+ e && e !== _e && Le(e);
1033
+ }, [F]);
1034
+ const ul = (e) => !e.claimed_by || e.claimed_by.id === S;
1034
1035
  function Sr(e) {
1035
- const t = e ? re.findIndex((r) => P(r) === P(e)) + 1 : 0, n = re.slice(t).find(ul);
1036
+ const t = e ? oe.findIndex((r) => P(r) === P(e)) + 1 : 0, n = oe.slice(t).find(ul);
1036
1037
  if (!n) {
1037
- _n(!1), Ae(null), O.info("Nothing left to work on — queue clear!");
1038
+ _n(!1), Le(null), O.info("Nothing left to work on — queue clear!");
1038
1039
  return;
1039
1040
  }
1040
- if (It(P(n)), de && !n.claimed_by && Re.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1041
+ if (It(P(n)), me && !n.claimed_by && Ee.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1041
1042
  xt(n);
1042
1043
  return;
1043
1044
  }
1044
- _n(!0), Ae(n);
1045
+ _n(!0), Le(n);
1045
1046
  }
1046
1047
  j(() => {
1047
- if (F !== "table") return;
1048
+ if (q !== "table") return;
1048
1049
  function e(t) {
1049
1050
  var o;
1050
1051
  const n = t.target;
1051
1052
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1052
1053
  return;
1053
- const r = Ut ? re.findIndex((s) => P(s) === Ut) : -1;
1054
+ const r = Ut ? oe.findIndex((s) => P(s) === Ut) : -1;
1054
1055
  if (t.key === "j" || t.key === "ArrowDown") {
1055
1056
  t.preventDefault();
1056
- const s = re[Math.min(r + 1, re.length - 1)];
1057
+ const s = oe[Math.min(r + 1, oe.length - 1)];
1057
1058
  s && It(P(s));
1058
1059
  } else if (t.key === "k" || t.key === "ArrowUp") {
1059
1060
  t.preventDefault();
1060
- const s = re[Math.max(r - 1, 0)];
1061
+ const s = oe[Math.max(r - 1, 0)];
1061
1062
  s && It(P(s));
1062
- } else if (t.key === "Enter" && r >= 0 && !we)
1063
- t.preventDefault(), Vt(re[r]);
1064
- else if (t.key === "c" && r >= 0 && de) {
1063
+ } else if (t.key === "Enter" && r >= 0 && !_e)
1064
+ t.preventDefault(), Vt(oe[r]);
1065
+ else if (t.key === "c" && r >= 0 && me) {
1065
1066
  t.preventDefault();
1066
- const s = re[r];
1067
- ((o = s.claimed_by) == null ? void 0 : o.id) === C ? We.mutate(s) : Re.mutate(s);
1068
- } else t.key === "o" && r >= 0 && (t.preventDefault(), xt(re[r]));
1067
+ const s = oe[r];
1068
+ ((o = s.claimed_by) == null ? void 0 : o.id) === S ? We.mutate(s) : Ee.mutate(s);
1069
+ } else t.key === "o" && r >= 0 && (t.preventDefault(), xt(oe[r]));
1069
1070
  }
1070
1071
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1071
- }, [F, re, Ut, we, C, Re, We, de]);
1072
+ }, [q, oe, Ut, _e, S, Ee, We, me]);
1072
1073
  const { data: B } = W({
1073
1074
  queryKey: ["queue-views", l],
1074
1075
  queryFn: () => h.request(A(`/queues/${l}/views`)),
1075
1076
  enabled: !!l
1076
- }), [ze, Xe] = v(null), [ml, Sn] = v(!1), [Cn, Cr] = v(""), [$r, qr] = v(!1), [kt, Fr] = v(!1);
1077
+ }), [ze, Xe] = w(null), [ml, Sn] = w(!1), [Cn, Cr] = w(""), [$r, qr] = w(!1), [kt, Fr] = w(!1);
1077
1078
  function vt(e) {
1078
1079
  const t = e.state ?? {};
1079
- J(t.scope ?? "all"), M({ ...ce.current, ...t.filters ?? {} }), je(t.sort ?? ""), ot(t.group_by ?? null), Qt(t.columns ?? null), en(t.pins ?? null), t.view && Be(qe.includes(t.view) ? t.view : qe[0]), D(1), Xe(e.id);
1080
+ z(t.scope ?? "all"), M({ ...ue.current, ...t.filters ?? {} }), je(t.sort ?? ""), ot(t.group_by ?? null), Qt(t.columns ?? null), en(t.pins ?? null), t.view && Be(Fe.includes(t.view) ? t.view : Fe[0]), D(1), Xe(e.id);
1080
1081
  }
1081
- function bl() {
1082
+ function pl() {
1082
1083
  var t, n;
1083
1084
  const e = B == null ? void 0 : B.data.find((r) => r.is_default);
1084
1085
  if (e) {
1085
1086
  vt(e);
1086
1087
  return;
1087
1088
  }
1088
- J(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...ce.current }), je(""), ot(null), Qt(null), en(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && Be(i.display_config.default_view), D(1), Xe(null);
1089
+ z(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...ue.current }), je(""), ot(null), Qt(null), en(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && Be(i.display_config.default_view), D(1), Xe(null);
1089
1090
  }
1090
1091
  j(() => {
1091
- if (Z || !(i != null && i.display_config) || He === void 0 || B === void 0) return;
1092
+ if (ne || !(i != null && i.display_config) || He === void 0 || B === void 0) return;
1092
1093
  const e = He.data.default_view_id, t = e != null ? B.data.find((r) => r.id === e) : void 0, n = B.data.find((r) => r.is_default);
1093
- t ? vt(t) : n ? vt(n) : (Be(i.display_config.default_view), J(i.display_config.default_scope)), Ta(!0);
1094
- }, [i, He, B, Z]);
1094
+ t ? vt(t) : n ? vt(n) : (Be(i.display_config.default_view), z(i.display_config.default_scope)), Ta(!0);
1095
+ }, [i, He, B, ne]);
1095
1096
  const Gt = U(null), Wt = U(null);
1096
1097
  j(() => {
1097
- if (!Z) return;
1098
- const e = Ls();
1098
+ if (!ne) return;
1099
+ const e = Ds();
1099
1100
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1100
1101
  ka({ ...e, restore: !1 });
1101
1102
  const t = e.state ?? {};
1102
- t.scope && J(t.scope), t.filters && M({ ...ce.current, ...t.filters }), t.sort != null && je(t.sort), ot(t.group_by ?? null), t.view && Be(t.view), t.page && D(t.page), Wt.current = e.scroll ?? 0;
1103
- }, [Z, l]), j(() => {
1104
- if (!Z || typeof window > "u") return;
1103
+ t.scope && z(t.scope), t.filters && M({ ...ue.current, ...t.filters }), t.sort != null && je(t.sort), ot(t.group_by ?? null), t.view && Be(t.view), t.page && D(t.page), Wt.current = e.scroll ?? 0;
1104
+ }, [ne, l]), j(() => {
1105
+ if (!ne || typeof window > "u") return;
1105
1106
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1106
1107
  if (!t) return;
1107
1108
  e.delete("owner");
@@ -1110,56 +1111,56 @@ function Pc({
1110
1111
  window.history.state,
1111
1112
  "",
1112
1113
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1113
- ), J("all"), M((r) => ({ ...r, owners: [t] })), Xe(null), D(1);
1114
- }, [Z]), j(() => {
1115
- if (!Z) return;
1116
- const e = Ho(Jo(`queue:${l}`));
1117
- e && (Yo(), vt({
1114
+ ), z("all"), M((r) => ({ ...r, owners: [t] })), Xe(null), D(1);
1115
+ }, [ne]), j(() => {
1116
+ if (!ne) return;
1117
+ const e = Wo(Ho(`queue:${l}`));
1118
+ e && (Jo(), vt({
1118
1119
  id: -1,
1119
1120
  // Saved views type filters loosely as strings; multi-selects ride as arrays there too.
1120
1121
  state: e
1121
1122
  }), Xe(null), e.page && D(e.page));
1122
- }, [Z]);
1123
- const pl = () => ({
1123
+ }, [ne]);
1124
+ const bl = () => ({
1124
1125
  scope: g,
1125
- filters: N,
1126
+ filters: _,
1126
1127
  sort: I,
1127
1128
  group_by: $,
1128
- view: F,
1129
+ view: q,
1129
1130
  columns: Mt,
1130
1131
  pins: it,
1131
- ...ie > 1 ? { page: ie } : {}
1132
+ ...de > 1 ? { page: de } : {}
1132
1133
  });
1133
1134
  j(() => {
1134
- Wt.current == null || T.length === 0 || !Gt.current || (Gt.current.scrollTop = Wt.current, Wt.current = null);
1135
- }, [T]);
1136
- const { isAdmin: Le } = ga(), hl = T.map((e) => `${e.collection}|${e.item_id}`).join(","), fl = V(
1137
- () => T.map((e) => ({ collection: e.collection, id: e.item_id })),
1135
+ Wt.current == null || F.length === 0 || !Gt.current || (Gt.current.scrollTop = Wt.current, Wt.current = null);
1136
+ }, [F]);
1137
+ const { isAdmin: Oe } = ga(), hl = F.map((e) => `${e.collection}|${e.item_id}`).join(","), fl = V(
1138
+ () => F.map((e) => ({ collection: e.collection, id: e.item_id })),
1138
1139
  [hl]
1139
- ), Tr = Qs(fl, Le), gl = (e) => Ut === P(e) ? (
1140
+ ), Tr = js(fl, Oe), gl = (e) => Ut === P(e) ? (
1140
1141
  // Pinned sticky cells use bg-inherit — the highlight must be
1141
1142
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
1142
1143
  // scrolled content bleeds through the pinned columns. Same
1143
1144
  // pair DataTable uses for selected rows when pins are active.
1144
1145
  "bg-[#f2fdff] dark:bg-[#20303a]"
1145
- ) : e.at_risk ? cs(e.at_risk_color ?? "red") : void 0, Rr = Le || (i == null ? void 0 : i.owner) != null && i.owner === C, xl = _e({
1146
+ ) : e.at_risk ? us(e.at_risk_color ?? "red") : void 0, Rr = Oe || (i == null ? void 0 : i.owner) != null && i.owner === S, xl = Ne({
1146
1147
  mutationFn: ({ viewId: e, on: t }) => h.request(xa(`/queues/views/${e}`, { is_default: t })),
1147
1148
  onSuccess: () => {
1148
1149
  f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("Queue default view updated");
1149
1150
  },
1150
1151
  onError: () => O.error("Could not update the queue default view")
1151
- }), Er = _e({
1152
+ }), Er = Ne({
1152
1153
  mutationFn: () => h.request(
1153
- ae(`/queues/${l}/views`, {
1154
+ se(`/queues/${l}/views`, {
1154
1155
  name: Cn.trim(),
1155
1156
  is_shared: $r || kt,
1156
1157
  is_default: kt,
1157
1158
  state: {
1158
1159
  scope: g,
1159
- filters: N,
1160
+ filters: _,
1160
1161
  sort: I,
1161
1162
  group_by: $,
1162
- view: F,
1163
+ view: q,
1163
1164
  columns: Mt,
1164
1165
  pins: it
1165
1166
  }
@@ -1169,15 +1170,15 @@ function Pc({
1169
1170
  Sn(!1), Cr(""), qr(!1), Fr(!1), Xe(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("View saved");
1170
1171
  },
1171
1172
  onError: () => O.error("Failed to save view")
1172
- }), [Ar, Lr] = v(null), Oe = _e({
1173
+ }), [Ar, Lr] = w(null), De = Ne({
1173
1174
  mutationFn: (e) => h.request(
1174
1175
  xa(`/queues/views/${e.id}`, {
1175
1176
  state: {
1176
1177
  scope: g,
1177
- filters: N,
1178
+ filters: _,
1178
1179
  sort: I,
1179
1180
  group_by: $,
1180
- view: F,
1181
+ view: q,
1181
1182
  columns: Mt,
1182
1183
  pins: it
1183
1184
  }
@@ -1187,15 +1188,15 @@ function Pc({
1187
1188
  f.invalidateQueries({ queryKey: ["queue-views", l] }), Lr(t.id), setTimeout(() => Lr((n) => n === t.id ? null : n), 2e3), O.success(`Saved "${t.name}" with the current filters, scope and sort`);
1188
1189
  },
1189
1190
  onError: () => O.error("Failed to update view")
1190
- }), yl = _e({
1191
+ }), yl = Ne({
1191
1192
  mutationFn: (e) => h.request(Dn(`/queues/views/${e}`)),
1192
1193
  onSuccess: (e, t) => {
1193
- f.invalidateQueries({ queryKey: ["queue-views", l] }), Xe(null), Je === t && bn(null);
1194
+ f.invalidateQueries({ queryKey: ["queue-views", l] }), Xe(null), Je === t && pn(null);
1194
1195
  },
1195
1196
  onError: () => O.error("Failed to delete view")
1196
- }), kl = _e({
1197
+ }), kl = Ne({
1197
1198
  mutationFn: (e) => h.request(Eo(`/queues/${l}/default-view`, { view_id: e })),
1198
- onMutate: (e) => bn(e),
1199
+ onMutate: (e) => pn(e),
1199
1200
  onSuccess: (e, t) => {
1200
1201
  f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.success(
1201
1202
  t === null ? "Reverted to the general default" : "Set as your default view"
@@ -1204,22 +1205,22 @@ function Pc({
1204
1205
  onError: () => {
1205
1206
  f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.error("Failed to update default view");
1206
1207
  }
1207
- }), [De, Ze] = v([]), [z, Or] = v(!1), vl = () => {
1208
- z && Ze([]), Or(!z);
1208
+ }), [Pe, Ze] = w([]), [Z, Or] = w(!1), vl = () => {
1209
+ Z && Ze([]), Or(!Z);
1209
1210
  };
1210
1211
  j(() => {
1211
- F !== "table" && z && (Or(!1), Ze([]));
1212
- }, [F, z]), Ro(), Gn.current = De.length;
1213
- const [Dr, Pr] = v(!1);
1212
+ q !== "table" && Z && (Or(!1), Ze([]));
1213
+ }, [q, Z]), Ro(), Gn.current = Pe.length;
1214
+ const [Dr, Pr] = w(!1);
1214
1215
  async function $n(e, t) {
1215
- const n = T.filter((m) => De.includes(P(m)));
1216
+ const n = F.filter((m) => Pe.includes(P(m)));
1216
1217
  Pr(!0), Kt.beginBatch();
1217
1218
  const r = await Promise.allSettled(n.map(t));
1218
1219
  Kt.endBatch();
1219
1220
  const o = r.filter((m) => m.status === "fulfilled").length, s = r.length - o;
1220
1221
  Pr(!1), Ze([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? O.warning(`${e}: ${o} succeeded, ${s} failed`) : O.success(`${e}: ${o} succeeded`);
1221
1222
  }
1222
- const Pe = (e) => {
1223
+ const Ke = (e) => {
1223
1224
  var t;
1224
1225
  for (const n of (i == null ? void 0 : i.sources) ?? []) {
1225
1226
  const r = (t = n.column_formats) == null ? void 0 : t[e];
@@ -1227,25 +1228,25 @@ function Pc({
1227
1228
  }
1228
1229
  return null;
1229
1230
  }, wl = (e) => {
1230
- if ($ === "state") return e === "No state" ? e : Ee(e);
1231
+ if ($ === "state") return e === "No state" ? e : Ae(e);
1231
1232
  if ($ === "collection") return gt(e);
1232
1233
  if ($ != null && $.startsWith("extra.") && e !== "—") {
1233
- const t = Pe($.slice(6));
1234
+ const t = Ke($.slice(6));
1234
1235
  if (t) return tt(e, t);
1235
1236
  }
1236
1237
  return e;
1237
- }, _l = ne == null ? void 0 : ne.map((e) => ({
1238
+ }, _l = le == null ? void 0 : le.map((e) => ({
1238
1239
  key: e.key,
1239
1240
  rows: e.rows,
1240
- header: /* @__PURE__ */ d(Ne, { children: [
1241
+ header: /* @__PURE__ */ d(Se, { children: [
1241
1242
  /* @__PURE__ */ a("span", { children: wl(e.key) }),
1242
1243
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1243
1244
  "(",
1244
- le(e.count),
1245
+ ie(e.count),
1245
1246
  ")"
1246
1247
  ] }),
1247
1248
  Object.entries(e.sums).map(([t, n]) => {
1248
- const r = Pe(t);
1249
+ const r = Ke(t);
1249
1250
  return /* @__PURE__ */ d(
1250
1251
  "span",
1251
1252
  {
@@ -1255,14 +1256,14 @@ function Pc({
1255
1256
  E(`extra.${t}`, lt(t)),
1256
1257
  ":",
1257
1258
  " ",
1258
- r ? tt(String(n), r) : le(n)
1259
+ r ? tt(String(n), r) : ie(n)
1259
1260
  ]
1260
1261
  },
1261
1262
  t
1262
1263
  );
1263
1264
  }),
1264
- me && !xe.has(e.key) && Za.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1265
- me && !xe.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1265
+ be && !ye.has(e.key) && Za.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
1266
+ be && !ye.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1266
1267
  "button",
1267
1268
  {
1268
1269
  type: "button",
@@ -1273,9 +1274,9 @@ function Pc({
1273
1274
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1274
1275
  children: [
1275
1276
  "Showing ",
1276
- le(e.rows.length),
1277
+ ie(e.rows.length),
1277
1278
  " of ",
1278
- le(e.count),
1279
+ ie(e.count),
1279
1280
  " · Show more"
1280
1281
  ]
1281
1282
  }
@@ -1289,13 +1290,13 @@ function Pc({
1289
1290
  " at risk"
1290
1291
  ] })
1291
1292
  ] })
1292
- })), qn = (((ta = c == null ? void 0 : c.available_values.collection) == null ? void 0 : ta.length) ?? 0) > 1, Kr = T.some((e) => !!e.unseen) || pt.size > 0 || T.some((e) => Se.isNew(P(e))), Mr = [
1293
+ })), qn = (((ta = c == null ? void 0 : c.available_values.collection) == null ? void 0 : ta.length) ?? 0) > 1, Kr = F.some((e) => !!e.unseen) || bt.size > 0 || F.some((e) => Ce.isNew(P(e))), Mr = [
1293
1294
  ...qn ? [
1294
1295
  {
1295
1296
  key: "collection",
1296
1297
  header: E("collection", "Collection"),
1297
1298
  sortable: !0,
1298
- render: (e) => /* @__PURE__ */ a(Hs, { variant: "outline", children: gt(e.collection) })
1299
+ render: (e) => /* @__PURE__ */ a(Ys, { variant: "outline", children: gt(e.collection) })
1299
1300
  }
1300
1301
  ] : [],
1301
1302
  {
@@ -1310,15 +1311,15 @@ function Pc({
1310
1311
  // a whole, but nothing on it said so — an underline is the one
1311
1312
  // convention people already read as "this goes somewhere".
1312
1313
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1313
- pt.get(P(e)) || Se.isNew(P(e)) ? /* @__PURE__ */ a(
1314
- Ms,
1314
+ bt.get(P(e)) || Ce.isNew(P(e)) ? /* @__PURE__ */ a(
1315
+ Ks,
1315
1316
  {
1316
- lock: pt.get(P(e)),
1317
- isNew: Se.isNew(P(e)),
1317
+ lock: bt.get(P(e)),
1318
+ isNew: Ce.isNew(P(e)),
1318
1319
  dataAttr: "data-queue-live-mark",
1319
1320
  hang: !0
1320
1321
  }
1321
- ) : /* @__PURE__ */ a(Ws, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1322
+ ) : /* @__PURE__ */ a(Js, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1322
1323
  /* @__PURE__ */ a(
1323
1324
  "span",
1324
1325
  {
@@ -1337,7 +1338,7 @@ function Pc({
1337
1338
  t
1338
1339
  )),
1339
1340
  /* @__PURE__ */ a(
1340
- Gs,
1341
+ Hs,
1341
1342
  {
1342
1343
  viewers: Wa[ls(e.collection, e.item_id)],
1343
1344
  dataAttr: "data-queue-presence"
@@ -1358,9 +1359,9 @@ function Pc({
1358
1359
  backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
1359
1360
  color: e.state_color ?? void 0
1360
1361
  },
1361
- title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ee(e.state)}` : Ee(e.state),
1362
+ title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ae(e.state)}` : Ae(e.state),
1362
1363
  children: [
1363
- Ee(e.state),
1364
+ Ae(e.state),
1364
1365
  e.via_addendum && /* @__PURE__ */ a("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
1365
1366
  ]
1366
1367
  }
@@ -1370,13 +1371,13 @@ function Pc({
1370
1371
  key: "owners",
1371
1372
  header: E("owners", "Owners"),
1372
1373
  sortable: !0,
1373
- render: (e) => /* @__PURE__ */ a(Zs, { owners: e.owners })
1374
+ render: (e) => /* @__PURE__ */ a(ti, { owners: e.owners })
1374
1375
  },
1375
1376
  {
1376
1377
  key: "aging_hours",
1377
1378
  header: E("aging_hours", "Aging"),
1378
1379
  sortable: !0,
1379
- render: (e) => ui(e.aging_hours)
1380
+ render: (e) => pi(e.aging_hours)
1380
1381
  },
1381
1382
  {
1382
1383
  // When the record entered its current state — the same moment Aging
@@ -1390,7 +1391,7 @@ function Pc({
1390
1391
  key: "sla_status",
1391
1392
  header: E("sla_status", "SLA"),
1392
1393
  sortable: !0,
1393
- render: (e) => /* @__PURE__ */ a(mi, { status: e.sla_status })
1394
+ render: (e) => /* @__PURE__ */ a(bi, { status: e.sla_status })
1394
1395
  },
1395
1396
  {
1396
1397
  key: "at_risk",
@@ -1398,7 +1399,7 @@ function Pc({
1398
1399
  sortable: !0,
1399
1400
  render: (e) => {
1400
1401
  var t;
1401
- return e.at_risk ? /* @__PURE__ */ d("span", { className: is(e.at_risk_color ?? "red"), children: [
1402
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: ds(e.at_risk_color ?? "red"), children: [
1402
1403
  "⚑ ",
1403
1404
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1404
1405
  ] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
@@ -1409,7 +1410,7 @@ function Pc({
1409
1410
  key: "addendums",
1410
1411
  header: E("addendums", "Addendums"),
1411
1412
  sortable: !1,
1412
- render: (e) => /* @__PURE__ */ a(di, { summary: e.addendums })
1413
+ render: (e) => /* @__PURE__ */ a(mi, { summary: e.addendums })
1413
1414
  }
1414
1415
  ] : [],
1415
1416
  ...mt ? [
@@ -1418,7 +1419,7 @@ function Pc({
1418
1419
  header: E("fulfilment", "Shipped"),
1419
1420
  sortable: !0,
1420
1421
  render: (e) => /* @__PURE__ */ a(
1421
- qs,
1422
+ Ts,
1422
1423
  {
1423
1424
  collection: e.collection,
1424
1425
  itemId: e.item_id,
@@ -1427,12 +1428,12 @@ function Pc({
1427
1428
  )
1428
1429
  }
1429
1430
  ] : [],
1430
- ...ke ? [
1431
+ ...ve ? [
1431
1432
  {
1432
1433
  key: "integrations",
1433
1434
  header: E("integrations", "Integrations"),
1434
1435
  sortable: !1,
1435
- render: (e) => /* @__PURE__ */ a(Rs, { rows: ll[`${e.collection}:${e.item_id}`] })
1436
+ render: (e) => /* @__PURE__ */ a(As, { rows: ll[`${e.collection}:${e.item_id}`] })
1436
1437
  }
1437
1438
  ] : [],
1438
1439
  ...xr ? [
@@ -1456,12 +1457,12 @@ function Pc({
1456
1457
  }
1457
1458
  }
1458
1459
  ] : [],
1459
- ...bt ? [
1460
+ ...pt ? [
1460
1461
  {
1461
1462
  key: "send_backs",
1462
1463
  header: E("send_backs", "Sent back"),
1463
1464
  sortable: !0,
1464
- render: (e) => /* @__PURE__ */ a(si, { summary: e.send_backs })
1465
+ render: (e) => /* @__PURE__ */ a(ci, { summary: e.send_backs })
1465
1466
  }
1466
1467
  ] : []
1467
1468
  ], Nl = {
@@ -1482,13 +1483,13 @@ function Pc({
1482
1483
  {
1483
1484
  type: "button",
1484
1485
  onClick: (t) => {
1485
- t.stopPropagation(), Re.mutate(e);
1486
+ t.stopPropagation(), Ee.mutate(e);
1486
1487
  },
1487
1488
  className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
1488
1489
  children: "Claim"
1489
1490
  }
1490
1491
  )
1491
- }, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = $o("drill.queue"), ee = _t.value, Qr = (e) => _t.push([e]), Sl = (e) => {
1492
+ }, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = $o("drill.queue"), re = _t.value, Qr = (e) => _t.push([e]), Sl = (e) => {
1492
1493
  var t;
1493
1494
  for (const n of (i == null ? void 0 : i.sources) ?? []) {
1494
1495
  const r = (t = n.drilldown) == null ? void 0 : t[e];
@@ -1513,13 +1514,13 @@ function Pc({
1513
1514
  const t = new Date(e);
1514
1515
  if (!Number.isNaN(t.getTime()))
1515
1516
  return {
1516
- text: gs(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1517
- title: fs(t)
1517
+ text: ys(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1518
+ title: xs(t)
1518
1519
  };
1519
1520
  }
1520
1521
  return { text: e, title: e };
1521
1522
  }
1522
- const Fn = Uo(u == null ? void 0 : u.inline_edit), Br = Fn.enabled ? [
1523
+ const Fn = jo(u == null ? void 0 : u.inline_edit), Br = Fn.enabled ? [
1523
1524
  ...new Set(
1524
1525
  ((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
1525
1526
  )
@@ -1542,26 +1543,26 @@ function Pc({
1542
1543
  const { data: Rl } = W({
1543
1544
  queryKey: ["my-permissions"],
1544
1545
  queryFn: () => h.request(A("/security/my/permissions")).then((e) => e.data),
1545
- enabled: Fn.enabled && !Le,
1546
+ enabled: Fn.enabled && !Oe,
1546
1547
  staleTime: 5 * 6e4
1547
- }), jr = Ps(), Ur = (e, t) => {
1548
+ }), jr = Qs(), Ur = (e, t) => {
1548
1549
  if (t.includes(".")) return null;
1549
1550
  const n = Tn.get(e.collection);
1550
1551
  if (!n) return null;
1551
- const r = pt.get(P(e));
1552
- return r && !r.is_mine ? null : Go({
1552
+ const r = bt.get(P(e));
1553
+ return r && !r.is_mine ? null : Vo({
1553
1554
  config: Fn,
1554
1555
  key: t,
1555
1556
  field: n.fields.get(t),
1556
1557
  collection: e.collection,
1557
1558
  relations: n.relations,
1558
- mayUpdate: Le || Ns(Rl, e.collection)
1559
+ mayUpdate: Oe || Cs(Rl, e.collection)
1559
1560
  });
1560
1561
  }, Ir = (e, t, n) => {
1561
1562
  var r, o, s;
1562
1563
  return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
1563
1564
  }, El = (e, t, n, r, o) => {
1564
- const s = (b) => `${P(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Ur(e, b)), p = o === 0 ? null : Wo(m, t, o), S = (b) => b.collection === e.collection && b.item_id === e.item_id, k = (b) => S(b) ? n === "m2o" ? {
1565
+ const s = (b) => `${P(e)}|${b}`, m = [...ae].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Ur(e, b)), p = o === 0 ? null : Go(m, t, o), N = (b) => b.collection === e.collection && b.item_id === e.item_id, k = (b) => N(b) ? n === "m2o" ? {
1565
1566
  ...b,
1566
1567
  extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
1567
1568
  } : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
@@ -1576,11 +1577,11 @@ function Pc({
1576
1577
  next: p ? s(p) : null,
1577
1578
  optimistic: () => {
1578
1579
  const b = f.getQueriesData({ queryKey: ["queue-items", l] });
1579
- return f.setQueriesData({ queryKey: ["queue-items", l] }, (_) => {
1580
- const w = _;
1581
- return Array.isArray(w == null ? void 0 : w.data) ? { ...w, data: w.data.map(k) } : Array.isArray(w == null ? void 0 : w.rows) ? { ...w, rows: w.rows.map(k) } : _;
1580
+ return f.setQueriesData({ queryKey: ["queue-items", l] }, (C) => {
1581
+ const v = C;
1582
+ return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(k) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(k) } : C;
1582
1583
  }), () => {
1583
- for (const [_, w] of b) f.setQueryData(_, w);
1584
+ for (const [C, v] of b) f.setQueryData(C, v);
1584
1585
  };
1585
1586
  },
1586
1587
  // Labels, rollups and the row's place in the queue follow the server.
@@ -1591,15 +1592,15 @@ function Pc({
1591
1592
  if (!r) return n;
1592
1593
  const o = Tn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
1593
1594
  return /* @__PURE__ */ a(
1594
- Ks,
1595
+ Bs,
1595
1596
  {
1596
1597
  controller: jr,
1597
1598
  cellKey: `${P(e)}|${t}`,
1598
1599
  kind: r,
1599
1600
  value: Ir(e, t, r),
1600
1601
  label: E(`extra.${t}`, lt(t)),
1601
- choices: s ? Vo(s) : void 0,
1602
- target: r === "m2o" && o ? Io(o.relations, e.collection, t) : null,
1602
+ choices: s ? Io(s) : void 0,
1603
+ target: r === "m2o" && o ? Uo(o.relations, e.collection, t) : null,
1603
1604
  onCommit: (m, p) => El(e, t, r, m, p),
1604
1605
  children: n
1605
1606
  }
@@ -1615,21 +1616,21 @@ function Pc({
1615
1616
  {
1616
1617
  const o = (n = e.extra) == null ? void 0 : n[t];
1617
1618
  if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
1618
- const s = Pe(t), m = s ? tt(String(o), s) : String(o), { text: p, title: S } = Fl(m), k = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((w) => w.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], _ = Sl(t);
1619
- return (k == null ? void 0 : k.kind) === "relation" && k.target_collection && b.length > 0 && _.enabled && !k.aggregate ? /* @__PURE__ */ a(
1619
+ const s = Ke(t), m = s ? tt(String(o), s) : String(o), { text: p, title: N } = Fl(m), k = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((v) => v.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], C = Sl(t);
1620
+ return (k == null ? void 0 : k.kind) === "relation" && k.target_collection && b.length > 0 && C.enabled && !k.aggregate ? /* @__PURE__ */ a(
1620
1621
  "button",
1621
1622
  {
1622
1623
  type: "button",
1623
- onClick: (w) => {
1624
- w.stopPropagation(), Qr({
1624
+ onClick: (v) => {
1625
+ v.stopPropagation(), Qr({
1625
1626
  collection: k.target_collection,
1626
1627
  itemId: b[0],
1627
- layoutId: _.layout_id,
1628
- width: _.width,
1628
+ layoutId: C.layout_id,
1629
+ width: C.width,
1629
1630
  title: m
1630
1631
  });
1631
1632
  },
1632
- title: S,
1633
+ title: N,
1633
1634
  className: "block max-w-[200px] truncate text-left text-[12px] text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
1634
1635
  children: p
1635
1636
  }
@@ -1637,14 +1638,14 @@ function Pc({
1637
1638
  "button",
1638
1639
  {
1639
1640
  type: "button",
1640
- onClick: (w) => {
1641
- w.stopPropagation(), dn({ row: e, path: t, value: m });
1641
+ onClick: (v) => {
1642
+ v.stopPropagation(), dn({ row: e, path: t, value: m });
1642
1643
  },
1643
1644
  title: "Show the rows behind this number",
1644
1645
  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",
1645
1646
  children: p
1646
1647
  }
1647
- ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: S, children: p });
1648
+ ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: N, children: p });
1648
1649
  }
1649
1650
  }
1650
1651
  const Vr = [
@@ -1657,8 +1658,8 @@ function Pc({
1657
1658
  "at_risk",
1658
1659
  ...Ye ? ["addendums"] : [],
1659
1660
  ...mt ? ["fulfilment"] : [],
1660
- ...ke ? ["integrations"] : [],
1661
- ...bt ? ["send_backs"] : [],
1661
+ ...ve ? ["integrations"] : [],
1662
+ ...pt ? ["send_backs"] : [],
1662
1663
  ...xr ? ["tasks"] : [],
1663
1664
  ...wt.map((e) => `extra.${e}`)
1664
1665
  ], Dl = [
@@ -1667,16 +1668,16 @@ function Pc({
1667
1668
  "owners",
1668
1669
  ...Ye ? ["addendums"] : [],
1669
1670
  ...mt ? ["fulfilment"] : [],
1670
- ...ke ? ["integrations"] : [],
1671
- ...bt ? ["send_backs"] : [],
1671
+ ...ve ? ["integrations"] : [],
1672
+ ...pt ? ["send_backs"] : [],
1672
1673
  "aging_hours",
1673
1674
  "sla_status",
1674
1675
  "at_risk",
1675
1676
  ...wt.slice(0, 2).map((e) => `extra.${e}`)
1676
- ], Pl = (u == null ? void 0 : u.default_columns) ?? null, Rn = Mt ?? Pl, te = new Set(Rn ?? Dl);
1677
- Ye && !Rt.has("addendums") && te.add("addendums"), mt && !Rt.has("fulfilment") && te.add("fulfilment"), ke && !Rt.has("integrations") && te.add("integrations"), bt && !Rt.has("send_backs") && te.add("send_backs");
1678
- const Kl = new Set(Le ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1679
- for (const e of Kl) te.delete(e);
1677
+ ], Pl = (u == null ? void 0 : u.default_columns) ?? null, Rn = Mt ?? Pl, ae = new Set(Rn ?? Dl);
1678
+ Ye && !Rt.has("addendums") && ae.add("addendums"), mt && !Rt.has("fulfilment") && ae.add("fulfilment"), ve && !Rt.has("integrations") && ae.add("integrations"), pt && !Rt.has("send_backs") && ae.add("send_backs");
1679
+ const Kl = new Set(Oe ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1680
+ for (const e of Kl) ae.delete(e);
1680
1681
  const et = [
1681
1682
  ...(Rn ?? []).filter((e) => Vr.includes(e)),
1682
1683
  ...Vr.filter((e) => !(Rn ?? []).includes(e))
@@ -1686,13 +1687,13 @@ function Pc({
1686
1687
  if (!n || t.id === n.id) return;
1687
1688
  const r = et.indexOf(String(t.id)), o = et.indexOf(String(n.id));
1688
1689
  r === -1 || o === -1 || Qt(
1689
- to(et, r, o).filter((s) => te.has(s))
1690
+ to(et, r, o).filter((s) => ae.has(s))
1690
1691
  );
1691
1692
  }
1692
1693
  const Gr = Mr.find((e) => e.key === "label"), Bl = {
1693
1694
  ...Gr,
1694
1695
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1695
- /* @__PURE__ */ a(ws, { rowId: e.item_id }),
1696
+ /* @__PURE__ */ a(Ns, { rowId: e.item_id }),
1696
1697
  Gr.render(e, ...t)
1697
1698
  ] })
1698
1699
  }, jl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
@@ -1716,13 +1717,13 @@ function Pc({
1716
1717
  key: "__actions__",
1717
1718
  header: "",
1718
1719
  render: (e) => e.collection === "tasks" || e.collection === zt ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
1719
- _s,
1720
+ Ss,
1720
1721
  {
1721
1722
  collection: e.collection,
1722
1723
  id: e.item_id,
1723
1724
  hasPipeline: e.state != null,
1724
1725
  onOpen: () => xt(e),
1725
- onPeek: () => Ae(e),
1726
+ onPeek: () => Le(e),
1726
1727
  urlFor: H.urlFor,
1727
1728
  onDeleted: () => {
1728
1729
  h.request(Dn(`/items/${e.collection}/${e.item_id}`)).then(() => {
@@ -1731,13 +1732,13 @@ function Pc({
1731
1732
  },
1732
1733
  onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
1733
1734
  bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
1734
- disabled: z
1735
+ disabled: Z
1735
1736
  }
1736
1737
  ) })
1737
1738
  }, Ht = [
1738
1739
  Bl,
1739
- ...et.filter((e) => te.has(e)).map((e) => Wr.find((t) => t.key === e)).filter((e) => e !== void 0),
1740
- ...de ? [Nl] : [],
1740
+ ...et.filter((e) => ae.has(e)).map((e) => Wr.find((t) => t.key === e)).filter((e) => e !== void 0),
1741
+ ...me ? [Nl] : [],
1741
1742
  Ul
1742
1743
  ], Hr = V(() => {
1743
1744
  var r;
@@ -1750,25 +1751,34 @@ function Pc({
1750
1751
  { value: "at_risk", label: "At risk" },
1751
1752
  { value: "owners", label: "Owner" },
1752
1753
  { value: "aging", label: "Aging" },
1753
- ...wt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
1754
- ], Yr = (e) => async (t) => {
1754
+ ...wt.filter((e) => ae.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
1755
+ ], Yr = (e) => async (t, n) => {
1755
1756
  if (!e.target_collection || !e.display_field) return [];
1756
- const n = {
1757
+ const r = {
1757
1758
  limit: 25,
1758
- sort: e.display_field
1759
- };
1760
- t.trim() && (n.filter = JSON.stringify({ [e.display_field]: { _contains: t.trim() } }));
1761
- const o = (await h.request(
1762
- A(`/items/${e.target_collection}`, n)
1763
- )).data ?? [], s = Pe(e.path), m = $e[e.path] ? new Set($e[e.path]) : null, p = /* @__PURE__ */ new Set(), S = [];
1764
- for (const k of o) {
1765
- const b = k[e.display_field];
1766
- if (b == null || b === "") continue;
1767
- const _ = String(b);
1768
- p.has(_) || m && !m.has(_) || (p.add(_), S.push({ label: s ? tt(_, s) : _, value: _ }));
1759
+ sort: e.display_field,
1760
+ // Records hidden from pickers (a retired zone) are not offered.
1761
+ picker: "1"
1762
+ }, o = n != null && n.narrowBy.length ? ss(
1763
+ e.target_collection,
1764
+ await is(h, f, e.target_collection),
1765
+ n.narrowBy
1766
+ ) : null, s = [
1767
+ ...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
1768
+ ...o ? [o] : []
1769
+ ];
1770
+ s.length > 0 && (r.filter = JSON.stringify(s.length === 1 ? s[0] : { _and: s }));
1771
+ const p = (await h.request(
1772
+ A(`/items/${e.target_collection}`, r)
1773
+ )).data ?? [], N = Ke(e.path), k = qe[e.path] ? new Set(qe[e.path]) : null, b = /* @__PURE__ */ new Set(), C = [];
1774
+ for (const v of p) {
1775
+ const J = v[e.display_field];
1776
+ if (J == null || J === "") continue;
1777
+ const Y = String(J);
1778
+ b.has(Y) || k && !k.has(Y) || (b.add(Y), C.push({ label: N ? tt(Y, N) : Y, value: Y }));
1769
1779
  }
1770
- return S;
1771
- }, En = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Ke = [
1780
+ return C;
1781
+ }, En = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Me = [
1772
1782
  {
1773
1783
  key: "collection",
1774
1784
  placeholder: E("collection", "Collection"),
@@ -1787,11 +1797,11 @@ function Pc({
1787
1797
  // Until the rows land, the pipeline's own states (no counts yet) rather
1788
1798
  // than an empty list.
1789
1799
  options: Nr(
1790
- c ? c.available_values.state ?? [] : Object.keys(ve)
1800
+ c ? c.available_values.state ?? [] : Object.keys(we)
1791
1801
  ).map((e) => {
1792
1802
  var t;
1793
1803
  return {
1794
- label: Ee(e),
1804
+ label: Ae(e),
1795
1805
  value: e,
1796
1806
  // How many rows sit in it under the other active filters (the State
1797
1807
  // filter itself left out, or every other state would read 0).
@@ -1845,12 +1855,12 @@ function Pc({
1845
1855
  ] : [],
1846
1856
  // #630 — integration partners; the queue read model filters on it
1847
1857
  // (live path in memory, materialized cache in SQL).
1848
- ...ke ? [
1858
+ ...ve ? [
1849
1859
  {
1850
1860
  key: "integrations",
1851
1861
  placeholder: E("integrations", "Integrations"),
1852
1862
  type: "select",
1853
- options: Es.map((e) => ({ label: e.label, value: e.value }))
1863
+ options: Ls.map((e) => ({ label: e.label, value: e.value }))
1854
1864
  }
1855
1865
  ] : [],
1856
1866
  ...mt ? [
@@ -1858,10 +1868,10 @@ function Pc({
1858
1868
  key: "fulfilment",
1859
1869
  placeholder: "Shipped",
1860
1870
  type: "select",
1861
- options: Fs
1871
+ options: Rs
1862
1872
  }
1863
1873
  ] : [],
1864
- ...bt ? [
1874
+ ...pt ? [
1865
1875
  {
1866
1876
  key: "send_backs",
1867
1877
  placeholder: "Sent back",
@@ -1903,7 +1913,7 @@ function Pc({
1903
1913
  },
1904
1914
  ...wt.map((e) => {
1905
1915
  var m, p;
1906
- const t = En.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Pe(e);
1916
+ const t = En.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Ke(e);
1907
1917
  if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
1908
1918
  if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
1909
1919
  if ((o == null ? void 0 : o.type) === "boolean")
@@ -1920,34 +1930,34 @@ function Pc({
1920
1930
  ...r,
1921
1931
  type: "combobox",
1922
1932
  multi: !0,
1923
- options: s.map((S) => ({ label: o ? tt(S, o) : S, value: S }))
1933
+ options: s.map((N) => ({ label: o ? tt(N, o) : N, value: N }))
1924
1934
  } : (t == null ? void 0 : t.kind) === "relation" ? {
1925
1935
  ...r,
1926
1936
  type: "combobox",
1927
1937
  multi: !0,
1928
- restricted: !!((p = $e[e]) != null && p.length),
1938
+ restricted: !!((p = qe[e]) != null && p.length),
1929
1939
  loadOptions: Yr(t)
1930
1940
  } : { ...r, placeholder: `Search ${n}…`, type: "text" };
1931
1941
  })
1932
- ], An = Ke.filter(
1933
- (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1942
+ ], An = Me.filter(
1943
+ (e) => ae.has(e.key) || e.key === "label" || e.key === "owners"
1934
1944
  ), Ln = (e) => {
1935
1945
  var t;
1936
- return (((t = Ke.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1946
+ return (((t = Me.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1937
1947
  }, On = (() => {
1938
1948
  var n, r;
1939
1949
  const e = [];
1940
- for (const [o, s] of Object.entries(Fe)) {
1950
+ for (const [o, s] of Object.entries(Te)) {
1941
1951
  if (!s || Array.isArray(s) && s.length === 0) continue;
1942
- const m = Ke.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, S = p ? Pe(p) : null, k = Lo({
1952
+ const m = Me.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, N = p ? Ke(p) : null, k = Lo({
1943
1953
  field: Ln(o),
1944
1954
  type: (m == null ? void 0 : m.type) ?? "select",
1945
1955
  value: s,
1946
1956
  optionLabel: (b) => {
1947
- var _, w;
1948
- return (w = (_ = m == null ? void 0 : m.options) == null ? void 0 : _.find((se) => se.value === b)) == null ? void 0 : w.label;
1957
+ var C, v;
1958
+ return (v = (C = m == null ? void 0 : m.options) == null ? void 0 : C.find((J) => J.value === b)) == null ? void 0 : v.label;
1949
1959
  },
1950
- currency: (S == null ? void 0 : S.type) === "number" && S.prefix === "$",
1960
+ currency: (N == null ? void 0 : N.type) === "number" && N.prefix === "$",
1951
1961
  rangeUnit: m == null ? void 0 : m.range_unit
1952
1962
  });
1953
1963
  k && e.push(k);
@@ -1961,59 +1971,61 @@ function Pc({
1961
1971
  shown: typeof t == "number" ? t : null,
1962
1972
  of: (x == null ? void 0 : x.total) ?? null
1963
1973
  });
1964
- })(), Nt = new Set(Object.keys(ce.current)), Il = ((e) => {
1974
+ })(), Nt = new Set(Object.keys(ue.current)), Il = ((e) => {
1965
1975
  var n;
1966
1976
  if (e.some((r) => r.key === "state")) return e;
1967
- const t = Ke.find((r) => r.key === "state");
1977
+ const t = Me.find((r) => r.key === "state");
1968
1978
  return !t || c && !((n = c.available_values.state) != null && n.length) ? e : [...e, t];
1969
1979
  })(
1970
1980
  (() => {
1971
1981
  var o;
1972
1982
  const e = (s) => {
1973
- var w, se, Me;
1983
+ var J, Y, T;
1974
1984
  if (!s.key.startsWith("extra.")) return null;
1975
1985
  if (s.type === "combobox") return s;
1976
- const m = s.key.slice(6), p = En.get(m), S = Nt.has(s.key);
1977
- if ((p == null ? void 0 : p.kind) !== "relation" && !S) return null;
1978
- const k = Pe(m), b = (w = c == null ? void 0 : c.available_values.extra) == null ? void 0 : w[m], _ = s.placeholder.replace(/^Search (.*)…$/, "$1");
1986
+ const m = s.key.slice(6), p = En.get(m), N = Nt.has(s.key);
1987
+ if ((p == null ? void 0 : p.kind) !== "relation" && !N) return null;
1988
+ const k = Ke(m), b = (J = c == null ? void 0 : c.available_values.extra) == null ? void 0 : J[m], C = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
1979
1989
  return b != null && b.length ? {
1980
1990
  key: s.key,
1981
- placeholder: _,
1991
+ placeholder: C,
1982
1992
  type: "combobox",
1983
1993
  multi: !0,
1984
- restricted: !!((se = $e[m]) != null && se.length),
1985
- options: b.map((q) => ({
1986
- label: k && k.type !== "number" ? tt(q, k) : q,
1987
- value: q
1994
+ cascade: v,
1995
+ restricted: !!((Y = qe[m]) != null && Y.length),
1996
+ options: b.map((ee) => ({
1997
+ label: k && k.type !== "number" ? tt(ee, k) : ee,
1998
+ value: ee
1988
1999
  }))
1989
2000
  } : (p == null ? void 0 : p.kind) === "relation" ? {
1990
2001
  key: s.key,
1991
- placeholder: _,
2002
+ placeholder: C,
1992
2003
  type: "combobox",
1993
2004
  multi: !0,
1994
- restricted: !!((Me = $e[m]) != null && Me.length),
2005
+ cascade: v,
2006
+ restricted: !!((T = qe[m]) != null && T.length),
1995
2007
  loadOptions: Yr(p)
1996
2008
  } : null;
1997
2009
  };
1998
2010
  if (zn.length > 0) {
1999
2011
  const s = [], m = /* @__PURE__ */ new Set();
2000
2012
  for (const p of zn) {
2001
- const S = (p.path ?? []).join(".");
2013
+ const N = (p.path ?? []).join(".");
2002
2014
  let k;
2003
2015
  if (p.key === "state" || /(^|_)state$/.test(((o = p.path) == null ? void 0 : o[0]) ?? ""))
2004
- k = Ke.find((b) => b.key === "state");
2016
+ k = Me.find((b) => b.key === "state");
2005
2017
  else {
2006
- const b = Ke.filter((w) => {
2007
- var Me;
2008
- if (!w.key.startsWith("extra.") || m.has(w.key)) return !1;
2009
- const se = w.key.slice(6);
2010
- return ((Me = En.get(se)) == null ? void 0 : Me.target_collection) === p.collection;
2011
- }), _ = b.find((w) => w.key.slice(6).startsWith(`${S}.`)) ?? b[0];
2012
- k = _ ? e(_) : null;
2018
+ const b = Me.filter((v) => {
2019
+ var Y;
2020
+ if (!v.key.startsWith("extra.") || m.has(v.key)) return !1;
2021
+ const J = v.key.slice(6);
2022
+ return ((Y = En.get(J)) == null ? void 0 : Y.target_collection) === p.collection;
2023
+ }), C = b.find((v) => v.key.slice(6).startsWith(`${N}.`)) ?? b[0];
2024
+ k = C ? e(C) : null;
2013
2025
  }
2014
2026
  !k || m.has(k.key) || (m.add(k.key), s.push(p.label ? { ...k, placeholder: p.label } : k));
2015
2027
  }
2016
- for (const p of Ke.map(e))
2028
+ for (const p of Me.map(e))
2017
2029
  p && !m.has(p.key) && (Nt.has(p.key) || p.restricted) && s.push(p);
2018
2030
  if (s.length > 0) return s;
2019
2031
  }
@@ -2025,13 +2037,13 @@ function Pc({
2025
2037
  })()
2026
2038
  ), Vl = (() => {
2027
2039
  if (!x) return null;
2028
- const e = Y ?? x, t = [
2040
+ const e = X ?? x, t = [
2029
2041
  {
2030
2042
  key: "breached",
2031
2043
  n: e.sla_breached,
2032
2044
  label: "past SLA",
2033
2045
  tone: "text-red-600 dark:text-red-400",
2034
- on: N.sla_status === "breached",
2046
+ on: _.sla_status === "breached",
2035
2047
  toggle: () => Ie("sla_status", "breached")
2036
2048
  },
2037
2049
  {
@@ -2039,7 +2051,7 @@ function Pc({
2039
2051
  n: e.sla_warning,
2040
2052
  label: "SLA soon",
2041
2053
  tone: "text-amber-700 dark:text-amber-400",
2042
- on: N.sla_status === "warning",
2054
+ on: _.sla_status === "warning",
2043
2055
  toggle: () => Ie("sla_status", "warning")
2044
2056
  },
2045
2057
  {
@@ -2047,7 +2059,7 @@ function Pc({
2047
2059
  n: e.at_risk,
2048
2060
  label: "at risk",
2049
2061
  tone: "text-red-600 dark:text-red-400",
2050
- on: N.at_risk === "yes",
2062
+ on: _.at_risk === "yes",
2051
2063
  toggle: () => Ie("at_risk", "yes")
2052
2064
  },
2053
2065
  {
@@ -2057,7 +2069,7 @@ function Pc({
2057
2069
  tone: "text-slate-600 dark:text-slate-300",
2058
2070
  on: g === "unowned",
2059
2071
  toggle: () => {
2060
- J(g === "unowned" ? "all" : "unowned"), D(1);
2072
+ z(g === "unowned" ? "all" : "unowned"), D(1);
2061
2073
  }
2062
2074
  }
2063
2075
  ].filter((n) => n.n > 0 || n.on);
@@ -2096,7 +2108,7 @@ function Pc({
2096
2108
  );
2097
2109
  })();
2098
2110
  function Gl(e) {
2099
- const t = new Set(te);
2111
+ const t = new Set(ae);
2100
2112
  t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Bn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Bn((n) => {
2101
2113
  const r = new Set(n);
2102
2114
  return r.delete(e), r;
@@ -2114,13 +2126,13 @@ function Pc({
2114
2126
  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",
2115
2127
  "data-queue-toolbar": !0,
2116
2128
  children: [
2117
- Z ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ci.filter((e) => de || e.value !== "claimed").map(
2129
+ ne ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ui.filter((e) => me || e.value !== "claimed").map(
2118
2130
  (e, t) => /* @__PURE__ */ a(
2119
2131
  "button",
2120
2132
  {
2121
2133
  type: "button",
2122
2134
  onClick: () => {
2123
- J(e.value), D(1);
2135
+ z(e.value), D(1);
2124
2136
  },
2125
2137
  className: R(
2126
2138
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
@@ -2132,13 +2144,13 @@ function Pc({
2132
2144
  e.value
2133
2145
  )
2134
2146
  ) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
2135
- Z ? qe.length <= 1 ? null : (
2147
+ ne ? Fe.length <= 1 ? null : (
2136
2148
  // One allowed view means nothing to switch to — no button.
2137
2149
  /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
2138
2150
  { value: "table", label: "Table" },
2139
2151
  { value: "kanban", label: "Kanban" },
2140
2152
  { value: "workload", label: "Workload" }
2141
- ].filter((e) => qe.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2153
+ ].filter((e) => Fe.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
2142
2154
  "button",
2143
2155
  {
2144
2156
  type: "button",
@@ -2146,7 +2158,7 @@ function Pc({
2146
2158
  className: R(
2147
2159
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
2148
2160
  t > 0 && "border-l border-slate-200 dark:border-border",
2149
- F === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
2161
+ q === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
2150
2162
  ),
2151
2163
  children: e.label
2152
2164
  },
@@ -2157,14 +2169,14 @@ function Pc({
2157
2169
  "button",
2158
2170
  {
2159
2171
  type: "button",
2160
- "aria-pressed": N.unseen === "yes",
2172
+ "aria-pressed": _.unseen === "yes",
2161
2173
  "data-queue-unseen-filter": !0,
2162
2174
  title: "Only records someone else changed since you last opened them",
2163
2175
  onClick: () => M((e) => {
2164
2176
  const t = { ...e };
2165
2177
  return t.unseen === "yes" ? delete t.unseen : t.unseen = "yes", t;
2166
2178
  }),
2167
- className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${N.unseen === "yes" ? "border-nvr-cyan/40 bg-[#f2fdff] text-nvr-navy dark:border-nvr-cyan/40 dark:bg-[#20303a] dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
2179
+ className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${_.unseen === "yes" ? "border-nvr-cyan/40 bg-[#f2fdff] text-nvr-navy dark:border-nvr-cyan/40 dark:bg-[#20303a] dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
2168
2180
  children: [
2169
2181
  /* @__PURE__ */ a("span", { className: "h-2 w-2 rounded-full bg-nvr-cyan" }),
2170
2182
  "Unseen changes"
@@ -2175,32 +2187,32 @@ function Pc({
2175
2187
  "button",
2176
2188
  {
2177
2189
  type: "button",
2178
- "aria-pressed": N.addendums === "active",
2190
+ "aria-pressed": _.addendums === "active",
2179
2191
  title: "Only records with an addendum still in review",
2180
2192
  onClick: () => M((e) => {
2181
2193
  const t = { ...e };
2182
2194
  return t.addendums === "active" ? delete t.addendums : t.addendums = "active", t;
2183
2195
  }),
2184
- className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${N.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"}`,
2196
+ className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${_.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"}`,
2185
2197
  children: [
2186
2198
  /* @__PURE__ */ a(oo, { className: "h-3.5 w-3.5" }),
2187
2199
  "Active addendums"
2188
2200
  ]
2189
2201
  }
2190
2202
  ),
2191
- ke && /* @__PURE__ */ a(
2192
- As,
2203
+ ve && /* @__PURE__ */ a(
2204
+ Os,
2193
2205
  {
2194
2206
  label: E("integrations", "Integrations"),
2195
- value: N.integrations,
2207
+ value: _.integrations,
2196
2208
  onChange: (e) => M((t) => {
2197
2209
  const n = { ...t };
2198
2210
  return e ? n.integrations = e : delete n.integrations, n;
2199
2211
  })
2200
2212
  }
2201
2213
  ),
2202
- /* @__PURE__ */ a(Us, { className: "h-8" }),
2203
- /* @__PURE__ */ a($s, {}),
2214
+ /* @__PURE__ */ a(Vs, { className: "h-8" }),
2215
+ /* @__PURE__ */ a(Fs, {}),
2204
2216
  tn > 0 && /* @__PURE__ */ d(
2205
2217
  "button",
2206
2218
  {
@@ -2217,7 +2229,7 @@ function Pc({
2217
2229
  }
2218
2230
  ),
2219
2231
  /* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
2220
- F === "table" && /* @__PURE__ */ d(nt, { children: [
2232
+ q === "table" && /* @__PURE__ */ d(nt, { children: [
2221
2233
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2222
2234
  "button",
2223
2235
  {
@@ -2227,15 +2239,15 @@ function Pc({
2227
2239
  $ ? "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"
2228
2240
  ),
2229
2241
  children: [
2230
- /* @__PURE__ */ a(pa, { className: "h-3.5 w-3.5" }),
2242
+ /* @__PURE__ */ a(ba, { className: "h-3.5 w-3.5" }),
2231
2243
  $ ? `Group: ${((na = Jr.find((e) => e.value === $)) == null ? void 0 : na.label) ?? $}` : "Group"
2232
2244
  ]
2233
2245
  }
2234
2246
  ) }),
2235
2247
  /* @__PURE__ */ a(at, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(va, { children: [
2236
- /* @__PURE__ */ a(Js, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2248
+ /* @__PURE__ */ a(zs, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2237
2249
  /* @__PURE__ */ d(wa, { children: [
2238
- /* @__PURE__ */ a(Ys, { children: "No attribute found." }),
2250
+ /* @__PURE__ */ a(Xs, { children: "No attribute found." }),
2239
2251
  /* @__PURE__ */ a(qt, { value: "__none__", onSelect: () => ot(null), children: "None" }),
2240
2252
  Jr.map((e) => /* @__PURE__ */ a(
2241
2253
  qt,
@@ -2249,7 +2261,7 @@ function Pc({
2249
2261
  ] })
2250
2262
  ] }) })
2251
2263
  ] }),
2252
- F === "table" && /* @__PURE__ */ d(
2264
+ q === "table" && /* @__PURE__ */ d(
2253
2265
  "button",
2254
2266
  {
2255
2267
  type: "button",
@@ -2266,18 +2278,18 @@ function Pc({
2266
2278
  ]
2267
2279
  }
2268
2280
  ),
2269
- F === "table" && $ && ne && /* @__PURE__ */ a(
2281
+ q === "table" && $ && le && /* @__PURE__ */ a(
2270
2282
  "button",
2271
2283
  {
2272
2284
  type: "button",
2273
2285
  onClick: () => Xt(
2274
- xe.size > 0 ? /* @__PURE__ */ new Set() : new Set(ne.map((e) => e.key))
2286
+ ye.size > 0 ? /* @__PURE__ */ new Set() : new Set(le.map((e) => e.key))
2275
2287
  ),
2276
2288
  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",
2277
- children: xe.size > 0 ? "Expand all" : "Collapse all"
2289
+ children: ye.size > 0 ? "Expand all" : "Collapse all"
2278
2290
  }
2279
2291
  ),
2280
- F === "kanban" && /* @__PURE__ */ d(nt, { children: [
2292
+ q === "kanban" && /* @__PURE__ */ d(nt, { children: [
2281
2293
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2282
2294
  "button",
2283
2295
  {
@@ -2287,7 +2299,7 @@ function Pc({
2287
2299
  st ? "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"
2288
2300
  ),
2289
2301
  children: [
2290
- /* @__PURE__ */ a(pa, { className: "h-3.5 w-3.5" }),
2302
+ /* @__PURE__ */ a(ba, { className: "h-3.5 w-3.5" }),
2291
2303
  st ? `Lanes: ${st === "collection" ? "Collection" : "Owner"}` : "Lanes"
2292
2304
  ]
2293
2305
  }
@@ -2312,7 +2324,7 @@ function Pc({
2312
2324
  ]
2313
2325
  }
2314
2326
  ),
2315
- /* @__PURE__ */ a(Ds, { listKey: `queue:${l}`, getState: pl }),
2327
+ /* @__PURE__ */ a(Ms, { listKey: `queue:${l}`, getState: bl }),
2316
2328
  /* @__PURE__ */ d(
2317
2329
  "button",
2318
2330
  {
@@ -2331,7 +2343,7 @@ function Pc({
2331
2343
  ]
2332
2344
  }
2333
2345
  ),
2334
- F === "table" && /* @__PURE__ */ d(nt, { children: [
2346
+ q === "table" && /* @__PURE__ */ d(nt, { children: [
2335
2347
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2336
2348
  "button",
2337
2349
  {
@@ -2357,11 +2369,11 @@ function Pc({
2357
2369
  children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: et.map((e) => {
2358
2370
  const t = Wr.find((n) => n.key === e);
2359
2371
  return /* @__PURE__ */ a(
2360
- hi,
2372
+ gi,
2361
2373
  {
2362
2374
  id: e,
2363
2375
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2364
- checked: te.has(e),
2376
+ checked: ae.has(e),
2365
2377
  onCheckedChange: () => Gl(e)
2366
2378
  },
2367
2379
  e
@@ -2372,22 +2384,22 @@ function Pc({
2372
2384
  }
2373
2385
  ) })
2374
2386
  ] }),
2375
- F === "table" && Dt && /* @__PURE__ */ d(
2387
+ q === "table" && Dt && /* @__PURE__ */ d(
2376
2388
  "button",
2377
2389
  {
2378
2390
  type: "button",
2379
2391
  onClick: vl,
2380
- "aria-pressed": z,
2381
- "data-queue-bulk-mode": z ? "on" : "off",
2382
- "data-tip": z ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
2383
- className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${z ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
2392
+ "aria-pressed": Z,
2393
+ "data-queue-bulk-mode": Z ? "on" : "off",
2394
+ "data-tip": Z ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
2395
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${Z ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
2384
2396
  children: [
2385
- /* @__PURE__ */ a(bo, { className: "h-3.5 w-3.5" }),
2386
- z ? "Done" : "Bulk select"
2397
+ /* @__PURE__ */ a(po, { className: "h-3.5 w-3.5" }),
2398
+ Z ? "Done" : "Bulk select"
2387
2399
  ]
2388
2400
  }
2389
2401
  ),
2390
- F === "table" && /* @__PURE__ */ a(
2402
+ q === "table" && /* @__PURE__ */ a(
2391
2403
  "button",
2392
2404
  {
2393
2405
  type: "button",
@@ -2402,10 +2414,10 @@ function Pc({
2402
2414
  "aria-label": "Row density",
2403
2415
  title: Tt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2404
2416
  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",
2405
- children: Tt === "compact" ? /* @__PURE__ */ a(po, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(ho, { className: "h-3.5 w-3.5" })
2417
+ children: Tt === "compact" ? /* @__PURE__ */ a(bo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(ho, { className: "h-3.5 w-3.5" })
2406
2418
  }
2407
2419
  ),
2408
- F === "table" && Fa && re.length > 0 && /* @__PURE__ */ d(
2420
+ q === "table" && Fa && oe.length > 0 && /* @__PURE__ */ d(
2409
2421
  "button",
2410
2422
  {
2411
2423
  type: "button",
@@ -2417,7 +2429,7 @@ function Pc({
2417
2429
  ]
2418
2430
  }
2419
2431
  ),
2420
- !on && X.length === 1 && (Ot ? /* @__PURE__ */ d(nt, { children: [
2432
+ !on && te.length === 1 && (Ot ? /* @__PURE__ */ d(nt, { children: [
2421
2433
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2422
2434
  "button",
2423
2435
  {
@@ -2426,7 +2438,7 @@ function Pc({
2426
2438
  children: [
2427
2439
  /* @__PURE__ */ a(Yt, { className: "h-3.5 w-3.5" }),
2428
2440
  "New ",
2429
- Pn(X[0]),
2441
+ Pn(te[0]),
2430
2442
  /* @__PURE__ */ a(ha, { className: "h-3 w-3 opacity-60" })
2431
2443
  ]
2432
2444
  }
@@ -2437,7 +2449,7 @@ function Pc({
2437
2449
  {
2438
2450
  type: "button",
2439
2451
  onClick: () => H.open({
2440
- collection: X[0],
2452
+ collection: te[0],
2441
2453
  itemId: "new",
2442
2454
  // Same layout the queue opens existing records with.
2443
2455
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
@@ -2454,7 +2466,7 @@ function Pc({
2454
2466
  {
2455
2467
  type: "button",
2456
2468
  onClick: () => H.open({
2457
- collection: X[0],
2469
+ collection: te[0],
2458
2470
  itemId: "new",
2459
2471
  layoutSlug: e.slug
2460
2472
  }),
@@ -2469,7 +2481,7 @@ function Pc({
2469
2481
  {
2470
2482
  type: "button",
2471
2483
  onClick: () => H.open({
2472
- collection: X[0],
2484
+ collection: te[0],
2473
2485
  itemId: "new",
2474
2486
  // Open a new record on the same layout the queue opens
2475
2487
  // existing ones with, so creating and reviewing match.
@@ -2479,11 +2491,11 @@ function Pc({
2479
2491
  children: [
2480
2492
  /* @__PURE__ */ a(Yt, { className: "h-3.5 w-3.5" }),
2481
2493
  "New ",
2482
- Pn(X[0])
2494
+ Pn(te[0])
2483
2495
  ]
2484
2496
  }
2485
2497
  )),
2486
- !on && X.length > 1 && /* @__PURE__ */ d(nt, { children: [
2498
+ !on && te.length > 1 && /* @__PURE__ */ d(nt, { children: [
2487
2499
  /* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
2488
2500
  "button",
2489
2501
  {
@@ -2496,7 +2508,7 @@ function Pc({
2496
2508
  ]
2497
2509
  }
2498
2510
  ) }),
2499
- /* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: X.map((e) => /* @__PURE__ */ d(
2511
+ /* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: te.map((e) => /* @__PURE__ */ d(
2500
2512
  "button",
2501
2513
  {
2502
2514
  type: "button",
@@ -2514,11 +2526,11 @@ function Pc({
2514
2526
  e
2515
2527
  )) })
2516
2528
  ] }),
2517
- !on && Ue && ge && /* @__PURE__ */ a(
2518
- Ts,
2529
+ !on && Ue && xe && /* @__PURE__ */ a(
2530
+ Es,
2519
2531
  {
2520
2532
  collection: Ue,
2521
- onParsed: (e, t) => ge(`/collections/${Ue}/new`, {
2533
+ onParsed: (e, t) => xe(`/collections/${Ue}/new`, {
2522
2534
  state: { importResult: e, importTemplateId: t.id }
2523
2535
  })
2524
2536
  }
@@ -2539,8 +2551,8 @@ function Pc({
2539
2551
  {
2540
2552
  label: "Total",
2541
2553
  count: (x == null ? void 0 : x.total) ?? 0,
2542
- filteredCount: Y ? Y.total : null,
2543
- active: Object.values(N).every(La) && g === "all",
2554
+ filteredCount: X ? X.total : null,
2555
+ active: Object.values(_).every(La) && g === "all",
2544
2556
  isLoading: Ge,
2545
2557
  ...ht("total"),
2546
2558
  onClick: Oa
@@ -2551,9 +2563,9 @@ function Pc({
2551
2563
  {
2552
2564
  label: "Warning",
2553
2565
  count: (x == null ? void 0 : x.sla_warning) ?? 0,
2554
- filteredCount: Y ? Y.sla_warning : null,
2566
+ filteredCount: X ? X.sla_warning : null,
2555
2567
  tone: "amber",
2556
- active: N.sla_status === "warning",
2568
+ active: _.sla_status === "warning",
2557
2569
  isLoading: Ge,
2558
2570
  deltaBadIsUp: !0,
2559
2571
  ...ht("sla_warning"),
@@ -2565,9 +2577,9 @@ function Pc({
2565
2577
  {
2566
2578
  label: "Breached",
2567
2579
  count: (x == null ? void 0 : x.sla_breached) ?? 0,
2568
- filteredCount: Y ? Y.sla_breached : null,
2580
+ filteredCount: X ? X.sla_breached : null,
2569
2581
  tone: "red",
2570
- active: N.sla_status === "breached",
2582
+ active: _.sla_status === "breached",
2571
2583
  isLoading: Ge,
2572
2584
  deltaBadIsUp: !0,
2573
2585
  ...ht("sla_breached"),
@@ -2579,9 +2591,9 @@ function Pc({
2579
2591
  {
2580
2592
  label: "At Risk",
2581
2593
  count: (x == null ? void 0 : x.at_risk) ?? 0,
2582
- filteredCount: Y ? Y.at_risk : null,
2594
+ filteredCount: X ? X.at_risk : null,
2583
2595
  tone: "red",
2584
- active: N.at_risk === "yes",
2596
+ active: _.at_risk === "yes",
2585
2597
  isLoading: Ge,
2586
2598
  deltaBadIsUp: !0,
2587
2599
  ...ht("at_risk"),
@@ -2593,13 +2605,13 @@ function Pc({
2593
2605
  {
2594
2606
  label: "Unowned",
2595
2607
  count: (x == null ? void 0 : x.unowned) ?? 0,
2596
- filteredCount: Y ? Y.unowned : null,
2608
+ filteredCount: X ? X.unowned : null,
2597
2609
  active: g === "unowned",
2598
2610
  isLoading: Ge,
2599
2611
  deltaBadIsUp: !0,
2600
2612
  ...ht("unowned"),
2601
2613
  onClick: () => {
2602
- J(g === "unowned" ? "all" : "unowned"), D(1);
2614
+ z(g === "unowned" ? "all" : "unowned"), D(1);
2603
2615
  }
2604
2616
  }
2605
2617
  )
@@ -2621,7 +2633,7 @@ function Pc({
2621
2633
  },
2622
2634
  className: R(
2623
2635
  "rounded-md border px-2 py-1 tabular-nums transition-colors",
2624
- N.aging_hours === t ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground",
2636
+ _.aging_hours === t ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground",
2625
2637
  n === 0 && "opacity-45"
2626
2638
  ),
2627
2639
  children: [
@@ -2632,36 +2644,36 @@ function Pc({
2632
2644
  },
2633
2645
  e
2634
2646
  )) }),
2635
- he && /* @__PURE__ */ a(
2647
+ ge && /* @__PURE__ */ a(
2636
2648
  "span",
2637
2649
  {
2638
2650
  "data-queue-burndown": !0,
2639
- className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${he.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : he.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2651
+ className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${ge.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : ge.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2640
2652
  "data-tip": "Average net change per day over the last 14 days of snapshots",
2641
- children: he.dir === "down" ? /* @__PURE__ */ d(Ne, { children: [
2653
+ children: ge.dir === "down" ? /* @__PURE__ */ d(Se, { children: [
2642
2654
  "▼ ",
2643
- Math.abs(he.pace).toFixed(1),
2655
+ Math.abs(ge.pace).toFixed(1),
2644
2656
  "/day — clears in ~",
2645
- he.days,
2657
+ ge.days,
2646
2658
  " day",
2647
- he.days === 1 ? "" : "s",
2659
+ ge.days === 1 ? "" : "s",
2648
2660
  " at this pace"
2649
- ] }) : he.dir === "up" ? /* @__PURE__ */ d(Ne, { children: [
2661
+ ] }) : ge.dir === "up" ? /* @__PURE__ */ d(Se, { children: [
2650
2662
  "▲ Growing ",
2651
- he.pace.toFixed(1),
2663
+ ge.pace.toFixed(1),
2652
2664
  "/day"
2653
- ] }) : /* @__PURE__ */ a(Ne, { children: "→ Holding steady" })
2665
+ ] }) : /* @__PURE__ */ a(Se, { children: "→ Holding steady" })
2654
2666
  }
2655
2667
  ),
2656
2668
  _r.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: _r.map(([e, t]) => {
2657
2669
  var n;
2658
2670
  return /* @__PURE__ */ a(
2659
- pi,
2671
+ fi,
2660
2672
  {
2661
- label: Ee(e),
2673
+ label: Ae(e),
2662
2674
  count: t,
2663
- filteredCount: Y ? Y.by_state[e] ?? 0 : null,
2664
- color: ((n = ve[e]) == null ? void 0 : n.color) ?? null,
2675
+ filteredCount: X ? X.by_state[e] ?? 0 : null,
2676
+ color: ((n = we[e]) == null ? void 0 : n.color) ?? null,
2665
2677
  active: Aa.includes(e),
2666
2678
  onClick: () => Ea(e)
2667
2679
  },
@@ -2671,17 +2683,17 @@ function Pc({
2671
2683
  ]
2672
2684
  }
2673
2685
  ),
2674
- F !== "workload" && /* @__PURE__ */ a(
2675
- ri,
2686
+ q !== "workload" && /* @__PURE__ */ a(
2687
+ li,
2676
2688
  {
2677
2689
  defs: Il,
2678
- values: N,
2690
+ values: _,
2679
2691
  seededKeys: Nt,
2680
2692
  onApply: (e) => {
2681
2693
  M((t) => ({ ...t, ...e })), D(1);
2682
2694
  },
2683
2695
  onClear: () => {
2684
- M({ ...ce.current }), D(1);
2696
+ M({ ...ue.current }), D(1);
2685
2697
  },
2686
2698
  right: Vl
2687
2699
  }
@@ -2692,19 +2704,19 @@ function Pc({
2692
2704
  className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
2693
2705
  "data-queue-saved-views": !0,
2694
2706
  children: [
2695
- ((c == null ? void 0 : c.total) ?? 0) > 0 && ue > 0 && /* @__PURE__ */ d(
2707
+ ((c == null ? void 0 : c.total) ?? 0) > 0 && pe > 0 && /* @__PURE__ */ d(
2696
2708
  "span",
2697
2709
  {
2698
- "data-queue-default-hiding": ue,
2710
+ "data-queue-default-hiding": pe,
2699
2711
  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",
2700
2712
  children: [
2701
2713
  "Your default ",
2702
2714
  or(Ln),
2703
2715
  " filter is hiding",
2704
2716
  " ",
2705
- ue.toLocaleString("en-US"),
2717
+ pe.toLocaleString("en-US"),
2706
2718
  " item",
2707
- ue === 1 ? "" : "s",
2719
+ pe === 1 ? "" : "s",
2708
2720
  " ·",
2709
2721
  /* @__PURE__ */ a(
2710
2722
  "button",
@@ -2718,7 +2730,7 @@ function Pc({
2718
2730
  ]
2719
2731
  }
2720
2732
  ),
2721
- Array.isArray(N.owners) && N.owners.length > 0 && /* @__PURE__ */ d(
2733
+ Array.isArray(_.owners) && _.owners.length > 0 && /* @__PURE__ */ d(
2722
2734
  "span",
2723
2735
  {
2724
2736
  "data-queue-owner-filter": !0,
@@ -2726,7 +2738,7 @@ function Pc({
2726
2738
  children: [
2727
2739
  "Owner:",
2728
2740
  " ",
2729
- N.owners.map(
2741
+ _.owners.map(
2730
2742
  (e) => {
2731
2743
  var t, n;
2732
2744
  return ((n = (t = c == null ? void 0 : c.available_values.owners) == null ? void 0 : t.find(
@@ -2757,7 +2769,7 @@ function Pc({
2757
2769
  "button",
2758
2770
  {
2759
2771
  type: "button",
2760
- onClick: bl,
2772
+ onClick: pl,
2761
2773
  title: "Revert to the queue default (filters, columns and sort cleared)",
2762
2774
  className: R(
2763
2775
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
@@ -2813,17 +2825,17 @@ function Pc({
2813
2825
  children: /* @__PURE__ */ a(xo, { className: R("h-3 w-3", e.is_default && "fill-current") })
2814
2826
  }
2815
2827
  ),
2816
- (e.user === C || Le) && ze === e.id && /* @__PURE__ */ a(
2828
+ (e.user === S || Oe) && ze === e.id && /* @__PURE__ */ a(
2817
2829
  "button",
2818
2830
  {
2819
2831
  type: "button",
2820
- onClick: () => Oe.mutate(e),
2821
- disabled: Oe.isPending,
2832
+ onClick: () => De.mutate(e),
2833
+ disabled: De.isPending,
2822
2834
  title: "Update this view with the current filters, scope and sort",
2823
2835
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2824
2836
  "aria-label": `Update view ${e.name}`,
2825
- "data-view-update-state": Oe.isPending ? "saving" : Ar === e.id ? "saved" : "idle",
2826
- children: Oe.isPending && ((t = Oe.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(yo, { className: "h-3 w-3 animate-spin" }) : Ar === e.id ? /* @__PURE__ */ a(
2837
+ "data-view-update-state": De.isPending ? "saving" : Ar === e.id ? "saved" : "idle",
2838
+ children: De.isPending && ((t = De.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(yo, { className: "h-3 w-3 animate-spin" }) : Ar === e.id ? /* @__PURE__ */ a(
2827
2839
  ko,
2828
2840
  {
2829
2841
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
@@ -2846,7 +2858,7 @@ function Pc({
2846
2858
  children: /* @__PURE__ */ a(wo, { className: R("h-3 w-3", Pt(e.id) && "fill-current") })
2847
2859
  }
2848
2860
  ),
2849
- e.user === C && /* @__PURE__ */ a(
2861
+ e.user === S && /* @__PURE__ */ a(
2850
2862
  "button",
2851
2863
  {
2852
2864
  type: "button",
@@ -2874,13 +2886,13 @@ function Pc({
2874
2886
  /* @__PURE__ */ d(at, { className: "w-[240px] p-3", align: "end", children: [
2875
2887
  (() => {
2876
2888
  const e = B == null ? void 0 : B.data.find((t) => t.id === ze);
2877
- return !e || e.user !== C && !Le ? null : /* @__PURE__ */ d(
2889
+ return !e || e.user !== S && !Oe ? null : /* @__PURE__ */ d(
2878
2890
  "button",
2879
2891
  {
2880
2892
  type: "button",
2881
- disabled: Oe.isPending,
2893
+ disabled: De.isPending,
2882
2894
  onClick: () => {
2883
- Oe.mutate(e), Sn(!1);
2895
+ De.mutate(e), Sn(!1);
2884
2896
  },
2885
2897
  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",
2886
2898
  children: [
@@ -2938,7 +2950,7 @@ function Pc({
2938
2950
  )
2939
2951
  ] }),
2940
2952
  /* @__PURE__ */ d("div", { ref: Gt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2941
- rr && /* @__PURE__ */ a(Os, { error: Ua, onRetry: () => void Ia(), className: "mb-3" }),
2953
+ rr && /* @__PURE__ */ a(Ps, { error: Ua, onRetry: () => void Ia(), className: "mb-3" }),
2942
2954
  On && /* @__PURE__ */ a(
2943
2955
  "p",
2944
2956
  {
@@ -2949,10 +2961,10 @@ function Pc({
2949
2961
  children: On
2950
2962
  }
2951
2963
  ),
2952
- F === "table" ? /* @__PURE__ */ a(Ne, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2964
+ q === "table" ? /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2953
2965
  "div",
2954
2966
  {
2955
- ref: Se.rootRef,
2967
+ ref: Ce.rootRef,
2956
2968
  className: R(
2957
2969
  "relative min-w-0 flex-1 transition-opacity duration-200",
2958
2970
  ir && "pointer-events-none opacity-60"
@@ -2966,17 +2978,17 @@ function Pc({
2966
2978
  "s"
2967
2979
  ] }),
2968
2980
  /* @__PURE__ */ a(
2969
- Ss,
2981
+ $s,
2970
2982
  {
2971
2983
  fillHeight: !0,
2972
- enterKey: br.current,
2984
+ enterKey: pr.current,
2973
2985
  density: Tt,
2974
2986
  minBodyHeight: 360,
2975
2987
  columns: Ht,
2976
- rows: T,
2988
+ rows: F,
2977
2989
  rowKey: (e) => `${e.collection}:${e.item_id}`,
2978
2990
  total: (c == null ? void 0 : c.total) ?? 0,
2979
- page: ie,
2991
+ page: de,
2980
2992
  limit: ln,
2981
2993
  isLoading: Ge,
2982
2994
  onPageChange: D,
@@ -2989,21 +3001,21 @@ function Pc({
2989
3001
  t.preventDefault(), yt({ x: t.clientX, y: t.clientY, row: e });
2990
3002
  },
2991
3003
  rowTitle: (e) => {
2992
- const t = pt.get(P(e));
2993
- return Se.titleFor(P(e)) ?? (t && !t.is_mine ? Zo(t) : void 0) ?? (Tr(e.collection, e.item_id) ? js : void 0);
3004
+ const t = bt.get(P(e));
3005
+ return Ce.titleFor(P(e)) ?? (t && !t.is_mine ? Zo(t) : void 0) ?? (Tr(e.collection, e.item_id) ? Is : void 0);
2994
3006
  },
2995
3007
  rowClassName: (e) => R(
2996
3008
  gl(e),
2997
- Tr(e.collection, e.item_id) && Bs
3009
+ Tr(e.collection, e.item_id) && Us
2998
3010
  ),
2999
3011
  emptyMessage: rr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
3000
- Cs,
3012
+ qs,
3001
3013
  {
3002
3014
  icon: _o,
3003
3015
  title: ((la = c == null ? void 0 : c.empty) == null ? void 0 : la.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((oa = c == null ? void 0 : c.empty) == null ? void 0 : oa.reason) === "scope_mine" ? "Nothing waiting on you" : ((sa = c == null ? void 0 : c.empty) == null ? void 0 : sa.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3004
- detail: ((ia = c == null ? void 0 : c.empty) == null ? void 0 : ia.reason) === "filters" && ue > 0 ? `Your default ${or(Ln)} filter is hiding ${ue.toLocaleString("en-US")} item${ue === 1 ? "" : "s"} here.` : ((ca = c == null ? void 0 : c.empty) == null ? void 0 : ca.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." : ((da = c == null ? void 0 : c.empty) == null ? void 0 : da.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3016
+ detail: ((ia = c == null ? void 0 : c.empty) == null ? void 0 : ia.reason) === "filters" && pe > 0 ? `Your default ${or(Ln)} filter is hiding ${pe.toLocaleString("en-US")} item${pe === 1 ? "" : "s"} here.` : ((ca = c == null ? void 0 : c.empty) == null ? void 0 : ca.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." : ((da = c == null ? void 0 : c.empty) == null ? void 0 : da.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3005
3017
  action: ((ua = c == null ? void 0 : c.empty) == null ? void 0 : ua.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3006
- ue > 0 && /* @__PURE__ */ d(
3018
+ pe > 0 && /* @__PURE__ */ d(
3007
3019
  "button",
3008
3020
  {
3009
3021
  type: "button",
@@ -3012,7 +3024,7 @@ function Pc({
3012
3024
  "data-queue-empty-defaults": !0,
3013
3025
  children: [
3014
3026
  "Show all ",
3015
- ue.toLocaleString("en-US")
3027
+ pe.toLocaleString("en-US")
3016
3028
  ]
3017
3029
  }
3018
3030
  ),
@@ -3023,8 +3035,8 @@ function Pc({
3023
3035
  onClick: () => {
3024
3036
  var t;
3025
3037
  const e = {};
3026
- for (const [n, r] of Object.entries(ce.current))
3027
- (t = $e[n.slice(6)]) != null && t.length && (e[n] = r);
3038
+ for (const [n, r] of Object.entries(ue.current))
3039
+ (t = qe[n.slice(6)]) != null && t.length && (e[n] = r);
3028
3040
  M(e), D(1);
3029
3041
  },
3030
3042
  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",
@@ -3037,7 +3049,7 @@ function Pc({
3037
3049
  {
3038
3050
  type: "button",
3039
3051
  onClick: () => {
3040
- J("all"), D(1);
3052
+ z("all"), D(1);
3041
3053
  },
3042
3054
  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",
3043
3055
  "data-queue-empty-all": !0,
@@ -3052,15 +3064,15 @@ function Pc({
3052
3064
  je(e), D(1);
3053
3065
  },
3054
3066
  filterDefs: An,
3055
- filterValues: N,
3067
+ filterValues: _,
3056
3068
  onFilterChange: (e, t) => {
3057
3069
  M((n) => ({ ...n, [e]: t })), D(1);
3058
3070
  },
3059
3071
  rowGroups: _l ?? void 0,
3060
- collapsedGroups: xe,
3072
+ collapsedGroups: ye,
3061
3073
  onToggleGroup: cl,
3062
- selectedIds: Dt && z ? De : void 0,
3063
- onSelectionChange: Dt && z ? Ze : void 0,
3074
+ selectedIds: Dt && Z ? Pe : void 0,
3075
+ onSelectionChange: Dt && Z ? Ze : void 0,
3064
3076
  hideFilterRow: !0,
3065
3077
  nowrapCells: !0,
3066
3078
  columnPins: Hr,
@@ -3073,10 +3085,10 @@ function Pc({
3073
3085
  columnFilterRow: !0,
3074
3086
  hScrollProxy: !0,
3075
3087
  footer: /* @__PURE__ */ a(
3076
- Vs,
3088
+ Ws,
3077
3089
  {
3078
3090
  collections: ft,
3079
- selectedIds: String(N.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
3091
+ selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
3080
3092
  onToggle: (e) => {
3081
3093
  const t = e.ids.join(",");
3082
3094
  M((n) => ({
@@ -3091,41 +3103,41 @@ function Pc({
3091
3103
  )
3092
3104
  ]
3093
3105
  }
3094
- ) }) }) : F === "kanban" ? /* @__PURE__ */ a(
3095
- ni,
3106
+ ) }) }) : q === "kanban" ? /* @__PURE__ */ a(
3107
+ ai,
3096
3108
  {
3097
- items: T,
3109
+ items: F,
3098
3110
  onCardClick: (e) => Vt(e),
3099
3111
  onDrop: (e, t) => Ya.mutate({ item: e, targetState: t }),
3100
- onClaim: (e) => Re.mutate(e),
3112
+ onClaim: (e) => Ee.mutate(e),
3101
3113
  onRelease: (e) => We.mutate(e),
3102
3114
  swimlaneBy: st,
3103
3115
  stateLabels: vn,
3104
3116
  laneLabel: st === "collection" ? gt : void 0,
3105
- claimsEnabled: de,
3117
+ claimsEnabled: me,
3106
3118
  onDraggingChange: (e) => {
3107
3119
  Vn.current = e;
3108
3120
  }
3109
3121
  }
3110
- ) : /* @__PURE__ */ a(ai, { queueId: l })
3122
+ ) : /* @__PURE__ */ a(oi, { queueId: l })
3111
3123
  ] }),
3112
- Dt && z && /* @__PURE__ */ d(
3113
- ei,
3124
+ Dt && Z && /* @__PURE__ */ d(
3125
+ ni,
3114
3126
  {
3115
- count: De.length,
3116
- claimsEnabled: de,
3127
+ count: Pe.length,
3128
+ claimsEnabled: me,
3117
3129
  showClaim: sn("claim"),
3118
3130
  showRelease: sn("release"),
3119
3131
  showTransition: sn("transition"),
3120
3132
  states: Nr((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
3121
3133
  value: e,
3122
- label: Ee(e)
3134
+ label: Ae(e)
3123
3135
  })),
3124
3136
  busy: Dr,
3125
3137
  onClaim: () => $n(
3126
3138
  "Claim",
3127
3139
  (e) => h.request(
3128
- ae(`/queues/${l}/claim`, {
3140
+ se(`/queues/${l}/claim`, {
3129
3141
  source_collection: e.collection,
3130
3142
  item_id: e.item_id
3131
3143
  })
@@ -3134,7 +3146,7 @@ function Pc({
3134
3146
  onRelease: () => $n(
3135
3147
  "Release",
3136
3148
  (e) => h.request(
3137
- ae(`/queues/${l}/release`, {
3149
+ se(`/queues/${l}/release`, {
3138
3150
  source_collection: e.collection,
3139
3151
  item_id: e.item_id
3140
3152
  })
@@ -3143,13 +3155,13 @@ function Pc({
3143
3155
  onTransition: (e) => $n("Transition", (t) => dr(t, e)),
3144
3156
  onClear: () => Ze([]),
3145
3157
  children: [
3146
- De.length >= 2 && /* @__PURE__ */ a(
3158
+ Pe.length >= 2 && /* @__PURE__ */ a(
3147
3159
  "button",
3148
3160
  {
3149
3161
  type: "button",
3150
3162
  onClick: () => {
3151
3163
  const e = ts(
3152
- T.filter((t) => De.includes(P(t)) && t.collection !== "tasks").map((t) => H.urlFor(Nn(t)))
3164
+ F.filter((t) => Pe.includes(P(t)) && t.collection !== "tasks").map((t) => H.urlFor(Nn(t)))
3153
3165
  );
3154
3166
  e.blocked > 0 || e.capped > 0 ? O.warning(ya(e)) : O.success(ya(e));
3155
3167
  },
@@ -3160,9 +3172,9 @@ function Pc({
3160
3172
  }
3161
3173
  ),
3162
3174
  /* @__PURE__ */ a(
3163
- vs,
3175
+ _s,
3164
3176
  {
3165
- targets: T.filter((e) => De.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3177
+ targets: F.filter((e) => Pe.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3166
3178
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
3167
3179
  tone: "light",
3168
3180
  disabled: Dr,
@@ -3174,19 +3186,19 @@ function Pc({
3174
3186
  ]
3175
3187
  }
3176
3188
  ),
3177
- ee != null && ee.length ? /* @__PURE__ */ a(
3178
- Is,
3189
+ re != null && re.length ? /* @__PURE__ */ a(
3190
+ Gs,
3179
3191
  {
3180
- collection: ee[0].collection,
3181
- itemId: ee[0].itemId,
3182
- layoutId: ee[0].layoutId,
3183
- rootLayoutSlug: ee[0].rootLayoutSlug,
3184
- width: ee[0].width,
3185
- title: ee[0].title,
3186
- stack: ee,
3187
- onPush: (e) => _t.push([...ee, e]),
3192
+ collection: re[0].collection,
3193
+ itemId: re[0].itemId,
3194
+ layoutId: re[0].layoutId,
3195
+ rootLayoutSlug: re[0].rootLayoutSlug,
3196
+ width: re[0].width,
3197
+ title: re[0].title,
3198
+ stack: re,
3199
+ onPush: (e) => _t.push([...re, e]),
3188
3200
  onPop: () => _t.back(),
3189
- onClose: () => _t.back(ee.length)
3201
+ onClose: () => _t.back(re.length)
3190
3202
  }
3191
3203
  ) : null,
3192
3204
  Q && fa(
@@ -3209,9 +3221,9 @@ function Pc({
3209
3221
  label: "Open full record",
3210
3222
  run: () => xt(Q.row)
3211
3223
  },
3212
- { label: "Peek", run: () => Ae(Q.row) },
3213
- ...de ? [
3214
- ((ma = Q.row.claimed_by) == null ? void 0 : ma.id) === C ? { label: "Release claim", run: () => We.mutate(Q.row) } : { label: "Claim", run: () => Re.mutate(Q.row) }
3224
+ { label: "Peek", run: () => Le(Q.row) },
3225
+ ...me ? [
3226
+ ((ma = Q.row.claimed_by) == null ? void 0 : ma.id) === S ? { label: "Release claim", run: () => We.mutate(Q.row) } : { label: "Claim", run: () => Ee.mutate(Q.row) }
3215
3227
  ] : [],
3216
3228
  {
3217
3229
  label: "Copy ID",
@@ -3302,7 +3314,7 @@ function Pc({
3302
3314
  ),
3303
3315
  er && fa(
3304
3316
  /* @__PURE__ */ a(
3305
- fi,
3317
+ xi,
3306
3318
  {
3307
3319
  queueId: l,
3308
3320
  drill: er,
@@ -3315,29 +3327,29 @@ function Pc({
3315
3327
  document.body
3316
3328
  ),
3317
3329
  /* @__PURE__ */ a(
3318
- ti,
3330
+ ri,
3319
3331
  {
3320
- item: we,
3332
+ item: _e,
3321
3333
  stateLabels: vn,
3322
3334
  collectionLabel: gt,
3323
- claimsEnabled: de,
3335
+ claimsEnabled: me,
3324
3336
  columnFormats: Cl,
3325
3337
  width: u == null ? void 0 : u.sheet_width,
3326
3338
  itemLayout: u == null ? void 0 : u.item_layout,
3327
3339
  onOpenChange: (e) => {
3328
- e || (Ae(null), _n(!1));
3340
+ e || (Le(null), _n(!1));
3329
3341
  },
3330
- onClaim: (e) => Re.mutate(e),
3342
+ onClaim: (e) => Ee.mutate(e),
3331
3343
  onRelease: (e) => We.mutate(e),
3332
3344
  workNextActive: dl,
3333
- onNext: () => we && Sr(we),
3345
+ onNext: () => _e && Sr(_e),
3334
3346
  refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
3335
3347
  }
3336
3348
  ),
3337
3349
  Kt.dialog
3338
3350
  ] });
3339
3351
  }
3340
- function fi({
3352
+ function xi({
3341
3353
  queueId: l,
3342
3354
  drill: y,
3343
3355
  onClose: L,
@@ -3351,7 +3363,7 @@ function fi({
3351
3363
  item_id: y.row.item_id,
3352
3364
  path: y.path
3353
3365
  })
3354
- ).then((C) => C.data)
3366
+ ).then((S) => S.data)
3355
3367
  });
3356
3368
  return /* @__PURE__ */ a(
3357
3369
  "div",
@@ -3362,7 +3374,7 @@ function fi({
3362
3374
  "div",
3363
3375
  {
3364
3376
  className: "max-h-[70vh] w-[480px] overflow-y-auto rounded-xl border border-slate-200 bg-white p-4 shadow-2xl dark:border-border dark:bg-card",
3365
- onClick: (C) => C.stopPropagation(),
3377
+ onClick: (S) => S.stopPropagation(),
3366
3378
  children: [
3367
3379
  /* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
3368
3380
  /* @__PURE__ */ d("div", { children: [
@@ -3385,18 +3397,18 @@ function fi({
3385
3397
  }
3386
3398
  )
3387
3399
  ] }),
3388
- h ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((f == null ? void 0 : f.rows) ?? []).length === 0 ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: f == null ? void 0 : f.rows.map((C) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
3400
+ h ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((f == null ? void 0 : f.rows) ?? []).length === 0 ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: f == null ? void 0 : f.rows.map((S) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
3389
3401
  /* @__PURE__ */ a(
3390
3402
  "button",
3391
3403
  {
3392
3404
  type: "button",
3393
- onClick: () => f.target && K(f.target, String(C.id)),
3405
+ onClick: () => f.target && K(f.target, String(S.id)),
3394
3406
  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",
3395
- children: C.label
3407
+ children: S.label
3396
3408
  }
3397
3409
  ),
3398
- /* @__PURE__ */ a("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: C.leaf_value == null ? "—" : String(C.leaf_value) })
3399
- ] }, String(C.id))) })
3410
+ /* @__PURE__ */ a("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: S.leaf_value == null ? "—" : String(S.leaf_value) })
3411
+ ] }, String(S.id))) })
3400
3412
  ]
3401
3413
  }
3402
3414
  )
@@ -3404,5 +3416,5 @@ function fi({
3404
3416
  );
3405
3417
  }
3406
3418
  export {
3407
- Pc as QueueWorklist
3419
+ Qc as QueueWorklist
3408
3420
  };